CN-121994463-A - Method, system, device, storage medium and program product for detecting operation state
Abstract
The invention discloses an operation state detection method and system, wherein the method comprises the steps of monitoring natural gas transmission and distribution equipment and collecting multiple groups of operation state data of the natural gas transmission and distribution equipment; and training a neural network model based on an attention mechanism by using the data set to obtain a fault type prediction model, and detecting the running state of the natural gas transmission and distribution equipment by using the fault type prediction model. The invention realizes the monitoring and fault detection of the running state of the natural gas transmission and distribution equipment.
Inventors
- HU SHUNYUAN
- ZHANG SHAOXIONG
- DAI ZHIXIANG
- WANG FENG
- XU LI
- XIA TAIWU
Assignees
- 中国石油天然气股份有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20241107
Claims (17)
- 1. An operation state detection method, characterized by comprising: Monitoring natural gas transmission and distribution equipment, and collecting multiple groups of operation state data of the natural gas transmission and distribution equipment; Preprocessing and data fusion are carried out on the multiple groups of running state data to obtain a data set; training the neural network model based on the attention mechanism by utilizing the data set to obtain a fault type prediction model, and detecting the running state of the natural gas transmission and distribution equipment by utilizing the fault type prediction model.
- 2. The method for detecting an operating state according to claim 1, wherein, Each set of operating state data includes first attribute data, second attribute data, and fault data; The first attribute data comprises an acoustic wave signal, and the second attribute data comprises acceleration, ambient temperature, ambient humidity, natural gas flow, motor temperature, natural gas pressure, 24-hour period and valve opening and closing state; the fault data includes fault types including valve body puncture, turbine damage, motor heating faults, internal leakage, spool damage, and gearbox housing rupture.
- 3. The method for detecting an operating state according to claim 2, wherein, The sound wave signals comprise a first sound wave signal and a second sound wave signal, and the first sound wave signal and the second sound wave signal are acquired through a first emission sensor and a second emission sensor respectively; The acceleration comprises a first acceleration and a second acceleration, and the first acceleration and the second acceleration are acquired through a first acceleration sensor and a second acceleration sensor respectively; the environment temperature comprises a first environment temperature and a second environment temperature, and the first environment temperature and the second environment temperature are acquired through a first temperature sensor and a second temperature sensor respectively; The environment humidity comprises a first environment humidity and a second environment humidity, and the first environment humidity and the second environment humidity are acquired through a first humidity sensor and a second humidity sensor respectively; The natural gas flow is acquired through a flow sensor; the natural gas temperature is acquired through a third temperature sensor; The temperature of the motor is acquired through a fourth temperature sensor; the natural gas pressure is collected through a pressure sensor; The characteristic difference of the air consumption in different time periods in one day is reflected by utilizing the 24-hour time period; and the valve switch state is obtained according to the signal changes of all the sensors on the electric valve.
- 4. A method of detecting an operating state according to claim 2 or 3, wherein the preprocessing of the plurality of sets of operating state data comprises the steps of: Correspondingly sequencing a plurality of groups of running state data according to time; cutting the first attribute data according to a preset time interval to obtain first attribute data of different intervals, namely obtaining each section of waveform data after the acoustic wave signals are segmented; taking a preset time interval as a time interval, performing interval classification coding on the second attribute data based on the time interval, and performing one-hot coding on fault data; wherein performing interval classification encoding on the second attribute data based on the cut time interval includes: And segmenting according to the attribute of the second attribute data to obtain a plurality of pieces of sub-attribute data, and encoding each piece of sub-attribute data to enable each piece of sub-attribute data to have a unique ID.
- 5. The running state detection method according to claim 4, wherein the data fusion is performed on the preprocessed data, comprising the steps of: Extracting two-dimensional features of the first attribute data, namely extracting the two-dimensional features in each section of waveform data after the acoustic wave signals are segmented to obtain a two-dimensional vector matrix of the first attribute data; initializing a vector matrix of the second attribute data, and embedding and searching the data coded in the second attribute data to correspondingly obtain a one-dimensional vector matrix corresponding to each data; setting multi-layer perceptron MLP corresponding to each second attribute data, and converting the one-dimensional vector matrix of each second attribute data into a two-dimensional vector matrix with equal first attribute data dimension through the corresponding multi-layer perceptron MLP; Transversely splicing the two-dimensional vector matrix of the first attribute data with the two-dimensional vector matrix of the second attribute data to obtain a fusion vector matrix; and converting the fault data after the one-hot coding into a fault class vector matrix.
- 6. The running state detection method according to claim 1, wherein the neural network model based on the attention mechanism is preliminarily constructed before training the neural network model based on the attention mechanism using the data set, comprising the steps of: Based on an attention mechanism and a transducer architecture, constructing a neural network structure by adopting a multi-layer stacked encoder and decoder; In the structure of the neural network, parameters of all sub-layers in the neural network are further set; setting a cross entropy loss function as a loss function of a neural network model, wherein the cross entropy loss function is used for measuring the difference between an actual fault class label of equipment and equipment fault class prediction probability distribution; Wherein each layer of encoder comprises a multi-headed self-focusing machine sublayer and a feedforward neural network sublayer, the multi-headed self-focusing machine sublayer being implemented by computing a plurality of independent self-focusing sublayers in parallel; each layer of decoder comprises a multi-head self-attention machine shielding sublayer, a multi-head attention machine shielding sublayer and a feedforward neural network sublayer; The multi-head self-attention mechanism sub-layer and the shielding multi-head self-attention mechanism sub-layer are attention modules; Residual links are added between the sub-layers, and normalization operation is performed on each sub-layer.
- 7. The method according to claim 6, wherein the further setting of parameters of each sub-layer in the neural network comprises setting parameters of sub-layers of the multi-headed attention machine and setting activation functions of each layer; Setting parameters of a multi-head attention machine sublayer, wherein the parameters comprise the number of multi-heads, the dimension of each head and the input and output dimension, and meanwhile, the number of the multi-heads is ensured to be divided by the input and output dimension; The setting of the activation functions of all layers comprises that the activation functions of the multi-head attention machine sublayer adopt linear change and dot product attention scaling, the feedforward neural network sublayer adopts Relu activation functions, and the output layer adopts a Softmax function.
- 8. The method for detecting an operating state according to claim 6 or 7, wherein, The cross entropy loss function is: Wherein C (Y, P) represents a cross entropy loss function, P represents a prediction probability of the neural network model for each equipment failure category, p= (P 1 ,p 2 ,...,p i ,...,p n ), i represents a number, i=1, 2,..n, n represents a total number of equipment failure categories, P i represents a prediction probability of an ith equipment failure category, Y represents an equipment actual failure category label, and y= (Y 1 ,y 2 ,...,y i ,...,y n ),y i represents an indicator variable of the ith equipment failure category in the equipment actual failure category label).
- 9. The method of claim 6, wherein training the neural network model based on the attention mechanism using the dataset to obtain the fault class prediction model comprises: Dividing the data set into a training set and a testing set, and inputting sample sequence data in the training set into a neural network model for repeated training, wherein the neural network model captures the relationship characteristics of different positions in the sample sequence data by using an attention mechanism so as to obtain a fault class prediction model; each layer of encoder in the neural network is responsible for carrying out data fusion on the operation state data to obtain a fusion vector matrix, and mapping the fusion vector matrix into an intermediate vector containing operation characteristic information; An encoder in the neural network sends the intermediate vector to a decoder, which utilizes decoding the intermediate vector into an output sequence; Wherein the sample sequence data x= (X 1 ,x 2 ,...,x i ,...,x n ) T, the output sequence p= (P 1 ,p 2 ,...,p i ,...,p n ) T, Wherein x n represents nth first attribute data and corresponding second attribute data, P represents an output sequence, namely, a device fault class prediction probability corresponding to sample sequence data, P i represents a prediction probability of an ith device fault class, i represents the number, i=1, 2, n, n represents the total number of the device fault classes, and T represents time.
- 10. The method of claim 9, wherein capturing the relationship features of the different locations in the sample sequence data using an attention mechanism comprises the steps of: the attention module comprises a linear transformation submodule Q, a linear transformation submodule K, a linear transformation submodule V, a scaling dot product attention submodule, a splicing submodule and a linear transformation submodule; The input characteristic data of the input attention module are subjected to linear transformation by utilizing a linear transformation submodule Q, a linear transformation submodule K and a linear transformation submodule V respectively, and a query vector, a key vector and a value vector are correspondingly obtained; after the attention module carries out head-division calculation on the query vector, the key vector and the value vector, the attention sub-module calculates the dot product of the query vector and the key vector by utilizing the scaling dot product so as to measure the similarity of the query vector and the key vector, and the attention weight is obtained by carrying out normalization processing on the dot product calculation result; And the splicing sub-module splices the multi-head attention result, and the linear transformation sub-module is utilized to linearly transform and output the spliced result.
- 11. The method for detecting an operating state according to claim 1 or 9, wherein, Solving the optimization problem of a fault class prediction model minimization objective function by using an Adam algorithm, wherein the minimization objective function is as follows: Where n represents the total number of classes of equipment failure, p i represents the predicted probability of the ith equipment failure class, and y i represents the indicator variable of the ith equipment failure class.
- 12. The running state detection method according to claim 6 or 9, wherein updating the weight of the attention module and judging whether the neural network model converges during the neural network model training process, comprises the steps of: Inputting the training set into a preliminarily constructed neural network model, obtaining the equipment fault class prediction probability output by the neural network model through forward propagation calculation, and calculating a loss value between the equipment fault class prediction probability and an equipment actual fault class label by using a cross entropy loss function; Calculating the gradient of the cross entropy loss function equivalent to the neural network model parameter by adopting a self-differentiating tool, and updating the weight in the attention module according to the gradient; Judging whether the neural network model is converged or not by monitoring the loss value, if the loss value of the neural network model is not obviously reduced in a plurality of training periods, considering that the neural network model is converged, stopping training at the moment to obtain a failure type prediction model after training is completed, and if not, continuing training the neural network until convergence.
- 13. The running state detection method according to claim 1, wherein after training to obtain the failure class prediction model, the failure class prediction model is tested using test set data in the dataset, comprising the steps of: inputting test data in the test set into a fault type prediction model to predict the fault type of the natural gas transmission and distribution equipment; Fitting a nonlinear relation between the test data feature vector and the fault class by using a weight parameter in the neural network structure, and calculating the test data feature vector by using forward propagation calculation to obtain an equipment fault class prediction probability vector corresponding to the test data; the equipment fault class prediction probability vector is in one-to-one correspondence with all the equipment fault class vectors, and whether the index of the maximum value in the equipment fault class prediction probability vector is the same as the index of the maximum value in the corresponding equipment fault class vector is judged; If the equipment failure type prediction model is different, feedback training is carried out on the failure type prediction model until indexes are the same.
- 14. An operational status detection system, comprising: the acquisition unit is used for monitoring the natural gas transmission and distribution equipment and acquiring a plurality of groups of operation state data of the natural gas transmission and distribution equipment; The data processing unit is used for preprocessing and data fusion of the multiple groups of running state data to obtain a data set; The training unit is used for training the neural network model based on the attention mechanism by utilizing the data set to obtain a fault type prediction model, and detecting the running state of the natural gas transmission and distribution equipment by utilizing the fault type prediction model.
- 15. An electronic device comprising a memory, a processor and a computer program stored on the memory, the processor executing the computer program or instructions to implement the method of detecting an operational state of any of claims 1-13.
- 16. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program or instructions which, when executed by a processor, implements the method of detecting an operation state according to any of claims 1-13.
- 17. A computer program product comprising a computer program or instructions which, when executed by a processor, implements the method of operating state detection of any of claims 1-13.
Description
Method, system, device, storage medium and program product for detecting operation state Technical Field The present invention relates to the field of fault detection technology, and in particular, to an operating state detection method, system, device, storage medium, and program product. Background For natural gas transmission and distribution equipment, the running state of the natural gas transmission and distribution equipment needs to be predicted due to the combustibility and explosiveness of the transportation gas, and the transmission and distribution equipment needs to be monitored and fault diagnosed in order to meet the gas consumption requirement of a terminal on the natural gas, so that the fault or potential fault of the natural gas transmission and distribution equipment is conveniently found in time. However, because of the almost irremovable nature of the gas transmission and distribution equipment, knowing and obtaining the operation state of the equipment has a certain obstacle, and how to better know and obtain the operation technical state of the equipment in the process that the equipment is not disassembled and/or operated, determine whether the whole or part is normal or not, find the cause of equipment failure, and judge the position and the category of the failure of the gas transmission and distribution equipment is a problem to be solved urgently. The conventional gas transmission and distribution station performs routine maintenance on gas transmission and distribution equipment according to a formulated maintenance period, so that the conditions of insufficient maintenance and excessive maintenance are caused to a certain extent, and sometimes even maintenance faults or production accidents are caused, meanwhile, the planned maintenance mode does not consider the difference of key equipment in actual use and the reasons related to the faults of the equipment, the defect of the equipment in actual demand maintenance quantity is considered, and the early faults cannot be prevented by periodic maintenance, so that the state prediction and fault diagnosis methods of the gas transmission and distribution equipment are required to be performed to eliminate or weaken fault results. Disclosure of Invention The invention aims to provide an operation state detection method, an operation state detection system, an operation state detection device, a storage medium and a program product, and the operation state detection and the fault detection of natural gas transmission and distribution equipment are realized. In order to achieve the above purpose, the present invention provides the following technical solutions: in a first aspect, an embodiment of the present invention provides an operation state detection method, including: Monitoring natural gas transmission and distribution equipment, and collecting multiple groups of operation state data of the natural gas transmission and distribution equipment; Preprocessing and data fusion are carried out on the multiple groups of running state data to obtain a data set; training the neural network model based on the attention mechanism by utilizing the data set to obtain a fault type prediction model, and detecting the running state of the natural gas transmission and distribution equipment by utilizing the fault type prediction model. In a second aspect, an embodiment of the present invention provides an operation state detection system, including: the acquisition unit is used for monitoring the natural gas transmission and distribution equipment and acquiring a plurality of groups of operation state data of the natural gas transmission and distribution equipment; The data processing unit is used for preprocessing and data fusion of the multiple groups of running state data to obtain a data set; the training unit is used for training the neural network model based on the attention mechanism by utilizing the data set to obtain a fault type prediction model, and detecting the running state of the natural gas transmission and distribution equipment by utilizing the fault type prediction model. In a third aspect, an embodiment of the present invention further provides an electronic device, including a memory, a processor, and a computer program stored on the memory, where the processor executes the computer program or instructions to implement the foregoing method for detecting an operating state. In a fourth aspect, embodiments of the present invention further provide a computer storage medium having stored therein a computer program or instructions which, when executed by a processor, implement the foregoing method of detecting an operating state. In a fifth aspect, embodiments of the present invention further provide a computer program product comprising a computer program or instructions which, when executed by a processor, implement the aforementioned method of detecting an operating state. The application has the technical effects and advant