To reduce the maintenance cost of the integrated manufacturing software system,the aperiodic inspection strategy is an important method to trigger software rejuvenation.In the existing optimization research on this strate-gy,the reliability objectives or constraints adopted are fixed in the entire software operating cycle,and cannot be dy-namically adjusted according to the software operating status.Therefore,a multi-state aperiodic inspection strategy and its optimization method were proposed.In this strategy,the inspection reliability in different state intervals was taken as the decision variable and the minimum maintenance cost of the system as the object to establish an optimiza-tion model to dynamically determine the optimal inspection period.Based on the Markov semi-renewal process char-acteristics of the aperiodic inspection strategy,a discrete maintenance cost evaluation model under multi-state relia-bility constraints was established.The optimal strategy configuration parameters were searched by the genetic algo-rithm to obtain the optimal inspection period.Experimental results showed that compared with the existing single-state aperiodic inspection method,the proposed method could reduce the system maintenance cost by about 5.32%on average,and the maximum could be reduced by about 11%.