Method and equipment for predicting abnormality of plunger pump
By obtaining the historical data of the plunger pump and training a multi-layer Fourier analysis network model, the limitations of the plunger pump abnormal prediction in the prior art are solved, and abnormal detection of pressure, speed, torque and flow is achieved, supporting the status monitoring and predictive maintenance of the equipment.
Patent Information
- Application Number
- CN202510792393.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2025-07-25
AI Technical Summary
In the prior art, the plunger pump abnormality prediction method needs to rely on the comparison of new measurement data with simulation data, which has limitations and cannot promptly detect equipment failures caused by abnormal pressure fluctuations.
By obtaining the historical data of the plunger pump, determining the unit data length, and using a multi-layer Fourier analysis network to train the initial anomaly prediction model, learning the periodic characteristics in the historical data, and forming a target plunger pump abnormality prediction model, which is used to detect abnormalities in pressure, speed, torque and flow.
Accurate prediction of future pressure change trends of plunger pumps is achieved, clear physical explanations are provided, and the equipment's status monitoring and predictive maintenance is supported, which enhances the performance of abnormal detection.
Smart Images

Figure CN120367792A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of anomaly prediction, and more particularly, to a method and device for predicting anomalies in a piston pump. Background Art
[0002] A piston pump is a device widely used in the industrial field. Its core function is to pressurize and transport liquids through the reciprocating motion of a piston. However, in actual operation, the piston pump may experience abnormal pressure fluctuations due to reasons such as wear of the friction pair and damage of parts. If such anomalies are not detected in a timely manner, they may lead to equipment failures and even cause serious economic losses.
[0003] The existing methods for predicting anomalies in piston pumps can analyze the similarity between simulation data and test data to determine whether the piston pump is abnormal.
[0004] However, this method in the prior art requires measuring new test data first and then comparing it with healthy simulation data. Therefore, it depends on measurement data and has certain limitations. Summary of the Invention
[0005] The purpose of this application is to provide a method and device for predicting anomalies in a piston pump to solve the problem of certain limitations in determining piston pump anomalies in the prior art.
[0006] To achieve the above object, the technical solutions adopted in the embodiments of this application are as follows:
[0007] In a first aspect, an embodiment of this application provides a method for predicting anomalies in a piston pump, the method including:
[0008] Obtain historical data of the piston pump, where the historical data includes: pressure data, rotational speed data, torque data, and flow rate data;
[0009] Determine the unit data length according to the historical data;
[0010] Train an initial piston pump anomaly prediction model according to the historical data and the unit data length to obtain a target piston pump anomaly prediction model. Among them, the initial piston pump anomaly prediction model includes a multi-layer Fourier analysis network. When training the initial piston pump anomaly prediction model, the Fourier analysis network learns the periodic characteristics in the historical data;
[0011] Based on the target piston pump pressure prediction model, perform anomaly detection on the piston pump to obtain a prediction result, where the prediction result includes at least one of the following: pressure anomaly prediction result, rotational speed anomaly prediction result, torque anomaly prediction result, and flow rate anomaly prediction result.
[0012] In a second aspect, another embodiment of the present application provides a plunger pump anomaly prediction device, the device comprising:
[0013] An acquisition module, configured to acquire historical data of the plunger pump, the historical data including: pressure data, rotational speed data, torque data, and flow rate data;
[0014] A determination module, configured to determine a unit data length according to the historical data;
[0015] A training module, configured to train an initial plunger pump anomaly prediction model according to the historical data and the unit data length to obtain a target plunger pump anomaly prediction model, wherein the initial plunger pump anomaly prediction model includes a multi-layer Fourier analysis network, and when training the initial plunger pump anomaly prediction model, the Fourier analysis network learns periodic features in the historical data;
[0016] A prediction module, configured to perform anomaly detection on the plunger pump based on the target plunger pump pressure prediction model to obtain a prediction result, the prediction result including at least one of the following: a pressure anomaly prediction result, a rotational speed anomaly prediction result, a torque anomaly prediction result, and a flow rate anomaly prediction result.
[0017] In a third aspect, another embodiment of the present application provides an electronic device, comprising: a processor, a storage medium, and a bus, the storage medium storing machine-readable instructions executable by the processor, when the electronic device runs, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to perform the steps of any method described in the first aspect above.
[0018] In a fourth aspect, another embodiment of the present application provides a storage medium, on which a computer program is stored, and when the computer program is run by a processor, it performs the steps of any method described in the first aspect above.
[0019] The beneficial effects of the present application are as follows: By obtaining the historical data of the plunger pump and determining the unit data length based on the historical data, the initial plunger pump anomaly prediction model including a multi-layer Fourier analysis network is trained according to the historical data and the unit data length. When training the initial plunger pump anomaly prediction model, the Fourier analysis network learns the periodic features in the historical data to obtain the target plunger pump anomaly prediction model, which can combine the physical laws of the plunger pump with deep learning methods. By explicitly extracting the periodic laws during the operation of the plunger pump, the target plunger pump anomaly prediction model can accurately capture the periodic features in the historical data, identify abnormal fluctuations deviating from the normal periodic laws, and enhance the performance of the target plunger pump anomaly prediction model based on the Fourier analysis network. Therefore, based on the target plunger pump pressure prediction model, the plunger pump can be detected for anomalies to obtain a prediction result, which can not only accurately predict the future pressure change trend of the plunger pump but also provide a clear physical explanation, providing strong support for the condition monitoring and predictive maintenance of the equipment. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present application and should not be regarded as limiting the scope. For those of ordinary skill in the art, other relevant drawings can be obtained based on these drawings without creative efforts.
[0021] Figure 1 It is a schematic flowchart of a plunger pump anomaly prediction method provided by an embodiment of the present application;
[0022] Figure 2 It is a schematic flowchart of determining the unit data length in the plunger pump anomaly prediction method provided by an embodiment of the present application;
[0023] Figure 3 It is a schematic diagram of the historical data in the plunger pump anomaly prediction method provided by an embodiment of the present application;
[0024] Figure 4 It is a schematic flowchart of obtaining the target plunger pump anomaly prediction model in the plunger pump anomaly prediction method provided by an embodiment of the present application;
[0025] Figure 5 It is a schematic structural diagram of the initial plunger pump anomaly prediction model in the plunger pump anomaly prediction method provided by an embodiment of the present application;
[0026] Figure 6 It is a schematic flowchart of obtaining the target plunger pump anomaly prediction model in the plunger pump anomaly prediction method provided by an embodiment of the present application;
[0027] Figure 7 It is a schematic flowchart when obtaining the target plunger pump anomaly prediction model in the plunger pump anomaly prediction method provided by the embodiment of the present application;
[0028] Figure 8 It is another structural schematic diagram of the initial plunger pump anomaly prediction model in the plunger pump anomaly prediction method provided by the embodiment of the present application;
[0029] Figure 9 It is another schematic flowchart when obtaining the target plunger pump anomaly prediction model in the plunger pump anomaly prediction method provided by the embodiment of the present application;
[0030] Figure 10 It is another training schematic diagram in the plunger pump anomaly prediction method provided by the embodiment of the present application;
[0031] Figure 11 It is a schematic diagram of a plunger pump anomaly prediction device provided by the embodiment of the present application;
[0032] Figure 12 It is a schematic diagram of the structure of the electronic device provided by the embodiment of the present application. Detailed implementation manners
[0033] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. It should be understood that the accompanying drawings in the present application are only for the purposes of illustration and description, and are not used to limit the protection scope of the present application. In addition, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in the present application illustrate the operations implemented according to some embodiments of the present application. It should be understood that the operations in the flowchart may not be implemented in sequence, and steps without logical context relationships may be reversed or implemented simultaneously. In addition, those skilled in the art may add one or more other operations to the flowchart or remove one or more operations from the flowchart under the guidance of the content of the present application.
[0034] In addition, the described embodiments are only some embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application described and illustrated in the accompanying drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application to be protected, but only represents the selected embodiments of the present application. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative efforts belong to the protection scope of the present application.
[0035] It should be noted that the term "including" will be used in the embodiments of the present application to indicate the existence of the features stated thereafter, but does not exclude the addition of other features.
[0036] In the prior art, the abnormal prediction method of the plunger pump can perform similarity analysis on simulation data and test data to determine whether the plunger pump is abnormal.
[0037] However, this method in the prior art needs to first measure new test data and then compare it with healthy simulation data. Therefore, it depends on measurement data and has certain limitations.
[0038] Based on the above problems, the present application proposes an abnormal prediction method for a plunger pump. By obtaining the historical data of the plunger pump and determining the unit data length according to the historical data, the initial plunger pump abnormal prediction model including a multi-layer Fourier analysis network is trained based on the historical data and the unit data length. When training the initial plunger pump abnormal prediction model, the Fourier analysis network learns the periodic features in the historical data to obtain the target plunger pump abnormal prediction model. It can combine the physical laws of the plunger pump with deep learning methods, improve the model's ability to depict the abnormal fluctuations of the plunger pump by explicitly extracting the periodic laws during the operation of the plunger pump, enhance the performance of the target plunger pump abnormal prediction model based on the Fourier analysis network, and thus can perform abnormal detection on the plunger pump based on the target plunger pump pressure prediction model to obtain a prediction result. It can not only accurately predict the future pressure change trend of the plunger pump, but also provide a clear physical explanation, providing strong support for the condition monitoring and predictive maintenance of the equipment.
[0039] The following describes in detail the abnormal prediction method for a plunger pump provided by the embodiments of the present application in combination with multiple embodiments.
[0040] Figure 1 FIG. is a schematic flow chart of an abnormal prediction method for a plunger pump provided by an embodiment of the present application. Referring to Figure 1 As shown, the execution subject of this method can be any electronic device with processing capabilities. This method includes:
[0041] S101. Obtain the historical data of the plunger pump.
[0042] Optionally, the historical data of the plunger pump can be obtained.
[0043] Specifically, the historical data can be various sensor data generated by the plunger pump during a period of past operation, including pressure data, rotational speed data, torque data, and flow rate data.
[0044] Exemplarily, if the piston pump has been running for 1 hour and the pressure sensor records data once per second, then the pressure data in the historical data can be a sequence of pressure values recorded within this 1 hour.
[0045] S102. Determine the unit data length according to the historical data.
[0046] Optionally, the historical data can be analyzed to determine the working cycle or operation cycle of the piston pump during historical operation, so as to determine the unit data length.
[0047] Among them, the unit data length is used to indicate the time window length of the future pressure and flow data output by the model, that is, the length of the output sequence. Through the unit data length, it can be ensured that the piston pump anomaly prediction model can fully learn and predict the pressure periodic law of the piston pump.
[0048] Optionally, the unit data length is also used to indicate the length of the input sequence of the piston pump anomaly prediction model.
[0049] Exemplarily, assume that each time slot is 1 millisecond and assume that the historical data covers 100 time slots. When the unit data length is 20 time slots, the target piston pump anomaly prediction model can predict the prediction results for the next 20 time slots.
[0050] S103. Train the initial piston pump anomaly prediction model according to the historical data and the unit data length to obtain the target piston pump anomaly prediction model.
[0051] It can be understood that the piston pump realizes fluid transportation through the reciprocating motion of multiple pistons in the cylinder block. Each piston sequentially experiences the suction-discharge cycle process. This periodic motion directly causes periodic fluctuations in the output pressure data, rotational speed data, torque data, and flow data. Therefore, the historical data of the piston pump has obvious periodic characteristics.
[0052] Optionally, after obtaining the unit data length, data with the corresponding length can be taken from the historical data as the input sequence for the current training round according to the unit data length, and the initial piston pump anomaly prediction model is trained based on the input sequence of the current training round to obtain the target piston pump anomaly prediction model.
[0053] Optionally, after obtaining the unit data length, the parameters in the initial piston pump anomaly prediction model can also be adjusted according to the unit data length, and the initial piston pump anomaly prediction model is trained according to the historical data to obtain the target piston pump anomaly prediction model.
[0054] Among them, the initial plunger pump anomaly prediction model includes a multi-layer Fourier analysis network. When training the initial plunger pump anomaly prediction model, the Fourier analysis network learns the periodic features in the historical data. Specifically, the periodic features are used to indicate the features that show repetitive patterns in time in the historical data.
[0055] Optionally, the Fourier analysis network can capture the periodicity of the historical data of the plunger pump based on the idea of Fourier analysis, and combine the physical characteristics of the plunger pump and the capabilities of deep learning for complex non-linear mapping.
[0056] S104. Based on the target plunger pump pressure prediction model, perform anomaly detection on the plunger pump to obtain a prediction result.
[0057] Optionally, after obtaining the target plunger pump pressure prediction model, the pressure data, rotation speed data, torque data, and flow rate data of the plunger pump in the current time period can be input into the target plunger pump pressure prediction model to perform anomaly prediction on the plunger pump, and a prediction result for the plunger pump in the next time period can be obtained.
[0058] Among them, the prediction result includes at least one of the following: pressure anomaly prediction result, rotation speed anomaly prediction result, torque anomaly prediction result, and flow rate anomaly prediction result.
[0059] In this embodiment, by obtaining the historical data of the plunger pump and determining the unit data length according to the historical data, the initial plunger pump anomaly prediction model including a multi-layer Fourier analysis network is trained based on the historical data and the unit data length. When training the initial plunger pump anomaly prediction model, the Fourier analysis network learns the periodic features in the historical data to obtain the target plunger pump anomaly prediction model, which can combine the physical laws of the plunger pump with deep learning methods. By explicitly extracting the periodic laws in the operation of the plunger pump, the target plunger pump anomaly prediction model can accurately capture the periodic features in the historical data, identify abnormal fluctuations deviating from the normal periodic laws, enhance the performance of the target plunger pump anomaly prediction model based on the Fourier analysis network, and thus perform anomaly detection on the plunger pump based on the target plunger pump pressure prediction model to obtain a prediction result, which can not only accurately predict the future pressure change trend of the plunger pump, but also provide a clear physical explanation, providing strong support for the condition monitoring and predictive maintenance of the equipment.
[0060] In a possible implementation manner, Figure 2 This is a schematic flowchart for determining the unit data length in the plunger pump anomaly prediction method provided by the embodiments of the present application. Referring to Figure 2 as shown, in S102 above, determining the unit data length according to the historical data includes:
[0061] S201. Determine the sampling frequency of the historical data.
[0062] It can be understood that the unit data length is used to indicate the length of the input sequence of the plunger pump anomaly prediction model, and the time window length of the future pressure and flow data output by the plunger pump anomaly prediction model, that is, the length of the output sequence. Among them, the length of the input sequence is related to the sampling frequency of the historical data.
[0063] Optionally, determine the sampling frequency of the pressure data, rotational speed data, torque data, and flow data in the historical data respectively, so as to determine the sampling frequency of the historical data. Among them, the sampling frequency of the historical data can be the maximum sampling frequency or the average sampling frequency of the pressure data, rotational speed data, torque data, and flow data.
[0064] S202. Determine the unit data length according to the sampling frequency of the historical data and the number of plungers information of the plunger pump.
[0065] Optionally, after obtaining the sampling frequency of the historical data, it can be calculated according to the sampling frequency of the historical data and the number of plungers information of the plunger pump to obtain the unit data length. Among them, the number of plungers information of the plunger pump refers to the number of plungers in the plunger pump.
[0066] Exemplarily, the least common multiple of the sampling frequency of the historical data and the number of plungers information of the plunger pump can be calculated as the unit data length. By using the least common multiple of the sampling frequency of the historical data and the number of plungers information of the plunger pump, it is possible to avoid the problem that the model learns incomplete periodic features due to some periods not being completely covered, and at the same time, it is possible to avoid the problem of increased complexity caused by additional padding or cropping data due to aligned periods.
[0067] Determining the unit data length through the sampling frequency of the historical data and the number of plungers information of the plunger pump can ensure that the model can completely capture the periodicity reflected by the sampling frequency in the historical data and the periodic features reflected by the number of plungers information of the plunger pump, so as to better learn and predict the change law of the historical data.
[0068] In a possible implementation manner, determining the sampling frequency of the historical data in S201 above includes:
[0069] According to the sampling frequency of the pressure data, the sampling frequency of the rotational speed data, the sampling frequency of the torque data, and the sampling frequency of the flow data, determine the maximum sampling frequency of the historical data, and use the maximum sampling frequency as the sampling frequency.
[0070] Optionally, the maximum sampling frequency can be determined from the sampling frequencies of the pressure data, rotational speed data, torque data, and flow rate data, and used as the maximum sampling frequency of the historical data. The maximum sampling frequency is used as the sampling frequency of the historical data.
[0071] By using the highest sampling frequency as a reference, it can be ensured that the pressure data, rotational speed data, torque data, and flow rate data are completely aligned on the time axis, avoiding the loss of detailed information in high-frequency signals and maximizing the integrity of high-frequency signals, thereby improving the accuracy of model prediction.
[0072] In a possible implementation, after determining the sampling frequency of the historical data, the method provided by the embodiments of the present application further includes:
[0073] Perform filling processing on the historical data according to the sampling frequency of the historical data to obtain the filled historical data.
[0074] Optionally, taking the sampling frequency of the historical data as the maximum sampling frequency as an example, data with a sampling frequency lower than the maximum sampling frequency in the historical data can be filled, and the data with a sampling frequency lower than the maximum sampling frequency can be filled with the maximum sampling frequency.
[0075] Exemplarily, Figure 3 is a schematic diagram of historical data in the plunger pump anomaly prediction method provided by the embodiments of the present application. Refer to Figure 3 As shown, assuming that the sampling frequencies of the rotational speed data and torque data are 1000, the sampling frequency of the pressure data is 20000, the rotational speed data, torque data, and flow rate data are 2.5e5 points, and the pressure data is 5e6 points. Then, since the sampling frequencies of the rotational speed data, torque data, and flow rate data are 1 / 20 of the pressure, time slots can be divided according to the sampling frequency of the pressure. The torque, torque, and flow rate in every 20 time slots are set to a fixed value to achieve the filling of the rotational speed data, torque data, and flow rate data. Among them, the timing of every 20 time slots can be obtained from the values of these 20 time slots.
[0076] Performing filling processing on the historical data according to the sampling frequency of the historical data to obtain the filled historical data can ensure that all physical quantities are represented on the same time axis, thereby improving the consistency of model input and maximizing the integrity of high-frequency signals.
[0077] In a possible implementation, Figure 4 is a schematic flowchart of a process for obtaining the target plunger pump anomaly prediction model in the plunger pump anomaly prediction method provided by the embodiments of the present application. Refer to Figure 4As shown in the figure, in step S103, the initial plunger pump anomaly prediction model is trained according to historical data and the unit data length to obtain the target plunger pump anomaly prediction model, including:
[0078] S401. Split the historical data into multiple input sequences according to the historical data and the unit data length.
[0079] Optionally, the historical data can be segmented according to the unit data length to obtain multiple input sequences. Among them, each input sequence is respectively used to indicate the pressure, rotational speed, torque, and flow rate of the plunger pump in the time slot corresponding to an input sequence.
[0080] Exemplarily, taking the pressure data as an example, assuming that the sampling frequency of the pressure data is 20,000, the total number of pressure data points is 5e6 (i.e., 5,000,000 points), and each time slot corresponds to one data point, then the total number of time slots can be determined to be 5,000,000. At this time, the unit data length is 18,000 time slots. Then, the total number of time slots 5,000,000 can be segmented according to the length of 18,000 to obtain 27 complete input sequences, and each sequence contains 180,000 time slots of data. The data of the last remaining 140,000 time slots can be filled and processed separately as the 28th input sequence.
[0081] S402. Train the initial plunger pump anomaly prediction model according to each input sequence to obtain the target plunger pump anomaly prediction model.
[0082] Optionally, after obtaining each input sequence, one input sequence can be taken from each input sequence as training data each time to train the initial plunger pump anomaly prediction model, so as to obtain the output sequence of the next time slot corresponding to this input sequence, and calculate the loss based on the output sequence of the next time slot corresponding to this input sequence and the input sequences in each input sequence with the same time slot as the output sequence of the next time slot, and determine whether to end the iteration based on the loss. If the iteration ends, the initial plunger pump anomaly prediction model at the end of the training is used as the target plunger pump anomaly prediction model.
[0083] By splitting the historical data into multiple input sequences according to the historical data and the unit data length, and training the initial plunger pump anomaly prediction model according to each input sequence to obtain the target plunger pump anomaly prediction model, the target plunger pump anomaly prediction model can learn the periodic characteristics of the historical data and can make full use of the historical data for training.
[0084] In a possible implementation manner, Figure 5 This is a schematic structural diagram of the initial plunger pump anomaly prediction model in the plunger pump anomaly prediction method provided by the embodiments of the present application. Refer to Figure 5As shown, the initial plunger pump anomaly prediction model includes: a fully connected embedding layer, a multi-layer Fourier analysis network, and a fully connected output layer connected in sequence. The initial plunger pump anomaly prediction model also includes at least one learnable physical parameter of the plunger pump.
[0085] Optionally, the fully connected embedding layer (Fully Connected Embedding Layer) can specifically be a multi-layer perceptron (MLP - Multilayer Perceptron, abbreviated as MLP), which is used to convert the input sequence representation into a continuous vector representation. Specifically, the fully connected embedding layer is used to map the pressure data, rotational speed data, torque data, and flow rate data in the input sequence into a vector respectively, so as to capture the semantic relationships and similarities between features, reduce the model input dimension, and improve the calculation efficiency.
[0086] Optionally, the Fourier analysis network (Fourier Analysis Networks, abbreviated as FAN layer) serves as a hidden layer, which is used to transform the vector output by the fully connected embedding layer into the frequency domain and perform global convolution operations to capture the periodic features in the historical data of the plunger pump, and combine physical laws to enhance the prediction ability of the initial plunger pump anomaly prediction model.
[0087] Exemplarily, the definition of the FAN layer is
[0088] where (d x , d p and are the first dimensions of the input x, Wp, respectively), and the output degree of the FAN layer is σ is the activation function.
[0089] Optionally, the multi-layer Fourier analysis network is used to gradually extract features in different frequency ranges. Exemplarily, the first layer network is used to extract the low-frequency global trend, the second layer network is used to capture the periodic fluctuations in the medium frequency, and the deeper layer network is used to further refine the high-frequency components, so as to more efficiently capture the complex periodic features and non-linear relationships in the plunger pump input sequence, and model the non-linear physical relationships, so as to perform joint optimization in combination with physical laws, and enhance the prediction ability, expression ability, and adaptability of the model.
[0090] Optionally, the physical parameters of the plunger pump are used as physical constraint conditions during the training process, which can include the rotational speed flow coefficient, mechanical efficiency, friction force, and valve flow coefficient, etc., so as to ensure that the output of the target plunger pump anomaly prediction model not only conforms to the data distribution of the historical data, but also satisfies the physical laws.
[0091] Optionally, a fully connected output layer is used to map the features extracted by the Fourier analysis network to the target output space, generating an output sequence of the piston pump, that is, the predicted value.
[0092] In a possible implementation, Figure 6 is a schematic flowchart of a process for obtaining the target piston pump anomaly prediction model in the piston pump anomaly prediction method provided by the embodiments of the present application. Referring to Figure 6 as shown, in the above S402, according to each input sequence, the initial piston pump anomaly prediction model is trained to obtain the target piston pump anomaly prediction model, including:
[0093] S601. Input the input sequence of the current time slot into the fully connected embedding layer, and process the input sequence of the current time slot through the fully connected embedding layer, each Fourier analysis network, and the fully connected output layer to obtain the output sequence of the piston pump at the current time slot.
[0094] Optionally, input the input sequence of the current time slot into the fully connected embedding layer, map the input sequence of the current time slot through the fully connected embedding layer in sequence, extract the periodic components and frequency domain information in the input features through each Fourier analysis network, and map the features extracted by the FAN layer to the target output space through the fully connected output layer to generate the output sequence of the piston pump at the current time slot.
[0095] Exemplarily, each Fourier analysis network adjusts the input dimension of the output vector output by the fully connected embedding layer, extracts the periodic components in the output vector through Fourier transform or similar frequency domain analysis methods, and combines the physical parameters of the piston pump to optimize the feature extraction process to obtain the output features.
[0096] Among them, the output sequence is used to indicate at least one of the following: the pressure, rotational speed, torque, and flow rate of the piston pump in the next time slot of the current time slot.
[0097] S602. Determine the current loss according to the output sequence of the piston pump at the current time slot and the current values of the learnable physical parameters of the piston pump.
[0098] Optionally, the current loss can be calculated by inputting the output sequence of the piston pump at the current time slot and the current values of the learnable physical parameters of the piston pump into a preset loss calculation formula.
[0099] Exemplarily, the preset loss calculation formula can be implemented based on MSE or MAE.
[0100] Determining the current loss based on the output sequence of the plunger pump in the current time slot and the current values of the learnable physical parameters of the plunger pump can embed the actual operating law of the plunger pump into the optimization process of the model, providing additional prior knowledge for the model. These physical laws can help the model better understand the mechanism behind the data, thereby improving the prediction accuracy. At the same time, overfitting can also be reduced.
[0101] S603. Determine whether to end the training based on the current loss. If so, end the training; if not, adjust the fully connected embedding layer, each Fourier analysis network, the fully connected output layer, and the values of the learnable physical parameters of the plunger pump based on the current loss.
[0102] Optionally, after obtaining the current loss, the current loss can be compared with a preset loss threshold to determine whether to end the training. If so, end the training; if not, adjust the fully connected embedding layer, each Fourier analysis network, the fully connected output layer, and the values of the learnable physical parameters of the plunger pump based on the current loss.
[0103] Exemplarily, the values of the fully connected embedding layer, each Fourier analysis network, the fully connected output layer, and the learnable physical parameters of the plunger pump can be adjusted by the gradient descent method.
[0104] Exemplarily, Figure 7 is a training schematic diagram in the plunger pump anomaly prediction method provided by the embodiments of the present application. Referring to Figure 7 as shown, assuming that the results are taken every 200 Epochs, the green is the training set, the blue is the test set, and the red is the predicted value of the test set. The training process can be obtained as Figure 7 shown.
[0105] In a possible implementation manner, Figure 7 is a flowchart of obtaining the target plunger pump anomaly prediction model in the plunger pump anomaly prediction method provided by the embodiments of the present application. Referring to Figure 7 as shown, in S602 above, determining the current loss according to the output sequence of the plunger pump in the current time slot and the current values of the learnable physical parameters of the plunger pump includes:
[0106] S701. Determine the input sequence of the next time slot of the plunger pump in the current time slot.
[0107] Optionally, the input sequence of the next time slot of the plunger pump in the current time slot can be found from each input sequence.
[0108] S702. Calculate the current loss according to the input sequence of the next time slot of the plunger pump in the current time slot, the output sequence of the plunger pump in the current time slot, and the current values of the learnable physical parameters of the plunger pump.
[0109] Exemplarily, the current loss can be calculated with reference to the following formula:
[0110] Loss = Loss_net(model(output_seq), truth_seq) + phy_Loss
[0111] Where Loss_net is the loss of the network, which can be MSE or MAE, output_seq is the output sequence of the plunger pump at the current time slot, truth_seq is the true value of the real sequence, that is, the input sequence in the same time slot as the output sequence of the current time slot in each input sequence, that is, the input sequence of the plunger pump in the next time slot of the current time slot. phy_Loss is the physical loss, which can be calculated from the current values of the physical parameters of each plunger pump in the current training.
[0112] In one possible implementation, the learnable physical parameters of the plunger pump include: mechanical efficiency and speed-flow coefficient.
[0113] Optionally, with the rotational speed of n, torque of T, flow rate of Q, and pressure of P, the following physical relationship exists:
[0114] Q·P = a·n·T, Q ≈ n·b·10e -3 b
[0115] Where a is the mechanical efficiency and b is the speed-flow coefficient.
[0116] Setting the mechanical efficiency and speed-flow coefficient as the learnable physical parameters of the plunger pump enables the trained target plunger pump anomaly prediction model to automatically adapt to different working conditions of the plunger pump without manual intervention. At the same time, it can also improve the generalization ability across scenarios. Moreover, the trained target plunger pump anomaly prediction model can directly learn the true values of these parameters from historical data, avoiding the influence of human errors.
[0117] It can be understood that the above describes the training process of the initial plunger pump anomaly prediction model including at least one learnable physical parameter of the plunger pump. When the initial plunger pump anomaly prediction model includes learnable physical parameters of the plunger pump, it can be understood that physical inspiration is added to the plunger pump anomaly prediction model. In another example, the initial plunger pump anomaly prediction model may not add physical inspiration, that is, the initial plunger pump anomaly prediction model does not include learnable physical parameters of the plunger pump, which will be described in detail below.
[0118] In one possible implementation, Figure 8 This is another structural schematic diagram of the initial plunger pump anomaly prediction model in the plunger pump anomaly prediction method provided by the embodiments of the present application. Refer to Figure 8As shown in the figure, the initial plunger pump anomaly prediction model includes: a fully connected embedding layer, a multi-layer Fourier analysis network, and a fully connected output layer connected in sequence.
[0119] Optionally, the fully connected embedding layer (Fully Connected Embedding Layer) can specifically be a multi-layer perceptron (MLP - Multilayer Perceptron, abbreviated as MLP), which is used to convert the input sequence representation into a continuous vector representation. Specifically, the fully connected embedding layer is used to map the pressure data, rotational speed data, torque data, and flow rate data in the input sequence into a vector respectively, so as to capture the semantic relationships and similarities between features, reduce the model input dimension, and improve the calculation efficiency.
[0120] Optionally, the Fourier analysis network (Fourier Analysis Networks, abbreviated as FAN layer) serves as a hidden layer, which is used to convert the vector output by the fully connected embedding layer into the frequency domain and perform global convolution operations to capture the periodic features in the historical data of the plunger pump, and combine physical laws to enhance the prediction ability of the initial plunger pump anomaly prediction model.
[0121] Exemplarily, the definition of the FAN layer is
[0122] Among them, (d x , d p and are the first dimensions of the input x, Wp, respectively), the output degree of the FAN layer is σ is the activation function.
[0123] Optionally, the multi-layer Fourier analysis network is used to gradually extract features in different frequency ranges. Exemplarily, the first layer network is used to extract the global trend of low frequencies, the second layer network is used to capture the periodic fluctuations of medium frequencies, and deeper layer networks are used to further refine the high-frequency components, so as to more efficiently capture the complex periodic features and non-linear relationships in the plunger pump input sequence, and model non-linear physical relationships, so as to perform joint optimization in combination with physical laws, and enhance the prediction ability, expression ability, and adaptability of the model.
[0124] Optionally, the fully connected output layer is used to map the features extracted by the Fourier analysis network to the target output space, and generate the output sequence of the plunger pump, that is, the predicted value.
[0125] In a possible implementation manner, Figure 9 This is another schematic flowchart when obtaining the target plunger pump anomaly prediction model in the plunger pump anomaly prediction method provided by the embodiments of this application. Refer to Figure 9As shown, in step S402, the initial plunger pump anomaly prediction model is trained based on each input sequence to obtain the target plunger pump anomaly prediction model, including:
[0126] S901. Input the input sequence of the current time slot into the fully connected embedding layer, and process the input sequence of the current time slot through the fully connected embedding layer, each Fourier analysis network, and the fully connected output layer to obtain the output sequence of the plunger pump at the current time slot.
[0127] Optionally, input the input sequence of the current time slot into the fully connected embedding layer, map the input sequence of the current time slot through the fully connected embedding layer in sequence, extract the periodic components and frequency domain information in the input features through each Fourier analysis network, and map the features extracted by the FAN layer to the target output space through the fully connected output layer to generate the output sequence of the plunger pump at the current time slot.
[0128] Exemplarily, each Fourier analysis network adjusts the input dimension of the output vector output by the fully connected embedding layer, and extracts the periodic components in the output vector through Fourier transform or a similar frequency domain analysis method to obtain the output features.
[0129] Among them, the output sequence is used to indicate at least one of the following: the pressure, rotational speed, torque, and flow rate of the plunger pump in the next time slot of the current time slot.
[0130] S902. Determine the input sequence of the plunger pump in the next time slot of the current time slot.
[0131] Optionally, the input sequence of the plunger pump in the next time slot of the current time slot can be found from each input sequence.
[0132] S903. Calculate the current loss according to the input sequence of the plunger pump in the next time slot of the current time slot and the output sequence of the plunger pump at the current time slot.
[0133] Exemplarily, the current loss can be calculated with reference to the following formula:
[0134] Loss = Loss_net(model(output_seq), truth_seq)
[0135] Among them, Loss_net is the loss of the network, which can be MSE or MAE, output_seq is the output sequence of the plunger pump at the current time slot, and truth_seq is the true value of the true sequence, that is, the input sequence in the same time slot as the output sequence of the current time slot in each input sequence, that is, the input sequence of the plunger pump in the next time slot of the current time slot.
[0136] S904. Determine whether to end the training based on the current loss. If so, end the training; if not, adjust the fully connected embedding layer, each Fourier analysis network, and the fully connected output layer based on the current loss.
[0137] Optionally, after obtaining the current loss, the current loss can be compared with a preset loss threshold to determine whether to end the training. If so, end the training; if not, adjust the fully connected embedding layer, each Fourier analysis network, the fully connected output layer, and the values of each learnable physical parameter of the plunger pump based on the current loss.
[0138] Exemplarily, the values of the fully connected embedding layer, each Fourier analysis network, the fully connected output layer, and each learnable physical parameter of the plunger pump can be adjusted by the gradient descent method.
[0139] Exemplarily, Figure 10 Another training schematic diagram in the plunger pump anomaly prediction method provided by the embodiments of the present application is shown in Figure 10 As shown, assuming that the results are taken every 200 Epochs, the green is the training set, the blue is the test set, and the red is the predicted value of the test set, the training process can be obtained as Figure 10 shown.
[0140] Exemplarily, continuing to refer to Figure 7 and Figure 10 , it can be determined that the training process with physical inspiration added to the initial plunger pump anomaly prediction model is slightly faster than the training process without physical inspiration added to the initial plunger pump anomaly prediction model.
[0141] Based on the same inventive concept, an embodiment of the present application also provides a plunger pump anomaly prediction device corresponding to the plunger pump anomaly prediction method. Since the principle of solving problems by the device in the embodiment of the present application is similar to the above plunger pump anomaly prediction method in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0142] Figure 11 A schematic diagram of a plunger pump anomaly prediction device provided by an embodiment of the present application is shown in Figure 11 As shown, the device includes: an acquisition module 1101, a determination module 1102, a training module 1103, and a prediction module 1104;
[0143] The acquisition module 1101 is used to acquire historical data of the plunger pump, and the historical data includes: pressure data, rotational speed data, torque data, and flow rate data;
[0144] The determination module 1102 is used to determine the unit data length according to the historical data;
[0145] A training module 1103 is configured to train an initial plunger pump anomaly prediction model based on historical data and the unit data length to obtain a target plunger pump anomaly prediction model. The initial plunger pump anomaly prediction model includes a multi-layer Fourier analysis network. When training the initial plunger pump anomaly prediction model, the Fourier analysis network learns the periodic features in the historical data.
[0146] A prediction module 1104 is configured to perform anomaly detection on the plunger pump based on the target plunger pump pressure prediction model to obtain a prediction result, where the prediction result includes at least one of the following: a pressure anomaly prediction result, a rotational speed anomaly prediction result, a torque anomaly prediction result, and a flow rate anomaly prediction result.
[0147] In a possible implementation, the determination module 1102 is specifically configured to:
[0148] Determine the sampling frequency of the historical data;
[0149] Determine the unit data length according to the sampling frequency of the historical data and the plunger number information of the plunger pump.
[0150] In a possible implementation, the determination module 1102 is specifically configured to:
[0151] Determine the maximum sampling frequency of the historical data according to the sampling frequency of the pressure data, the sampling frequency of the rotational speed data, the sampling frequency of the torque data, and the sampling frequency of the flow rate data, and use the maximum sampling frequency as the sampling frequency.
[0152] In a possible implementation, the device further includes a filling module configured to:
[0153] Perform filling processing on the historical data according to the sampling frequency of the historical data to obtain the filled historical data.
[0154] In a possible implementation, the training module 1103 is specifically configured to:
[0155] Split the historical data into multiple input sequences according to the historical data and the unit data length, where each input sequence is respectively used to indicate the pressure, rotational speed, torque, and flow rate of the plunger pump in a time slot corresponding to the input sequence;
[0156] Train the initial plunger pump anomaly prediction model according to each input sequence to obtain the target plunger pump anomaly prediction model.
[0157] In a possible implementation, the initial plunger pump anomaly prediction model includes a fully connected embedding layer, a multi-layer Fourier analysis network, and a fully connected output layer connected in sequence. The initial plunger pump anomaly prediction model further includes at least one learnable plunger pump physical parameter;
[0158] The training module 1103 is specifically configured to: input the input sequence of the current time slot into the fully connected embedding layer, and process the input sequence of the current time slot through the fully connected embedding layer, each Fourier analysis network, and the fully connected output layer to obtain the output sequence of the plunger pump at the current time slot, where the output sequence is used to indicate at least one of the following: the pressure, rotational speed, torque, and flow rate of the plunger pump in the next time slot of the current time slot;
[0159] Determine the current loss according to the output sequence of the plunger pump at the current time slot and the current values of each learnable physical parameter of the plunger pump;
[0160] Based on the current loss, determine whether to end the training. If so, end the training. If not, adjust the values of the fully connected embedding layer, each Fourier analysis network, the fully connected output layer, and each learnable physical parameter of the plunger pump based on the current loss.
[0161] In a possible implementation, the training module 1103 is specifically configured to:
[0162] Determine the input sequence of the plunger pump in the next time slot of the current time slot;
[0163] Calculate the current loss according to the input sequence of the plunger pump in the next time slot of the current time slot, the output sequence of the plunger pump at the current time slot, and the current values of each learnable physical parameter of the plunger pump.
[0164] In a possible implementation, the learnable physical parameters of the plunger pump include: mechanical efficiency and rotational speed - flow coefficient.
[0165] In a possible implementation, the initial plunger pump anomaly prediction model includes: a fully connected embedding layer, a multi - layer Fourier analysis network, and a fully connected output layer connected in sequence;
[0166] The training module 1103 is specifically configured to: input the input sequence of the current time slot into the fully connected embedding layer, and process the input sequence of the current time slot through the fully connected embedding layer, each Fourier analysis network, and the fully connected output layer to obtain the output sequence of the plunger pump at the current time slot, where the output sequence is used to indicate at least one of the following: the pressure, rotational speed, torque, and flow rate of the plunger pump in the next time slot of the current time slot;
[0167] Determine the input sequence of the plunger pump in the next time slot of the current time slot;
[0168] Calculate the current loss according to the input sequence of the plunger pump in the next time slot of the current time slot and the output sequence of the plunger pump at the current time slot;
[0169] Based on the current loss, determine whether to end the training. If so, end the training; if not, adjust the fully-connected embedding layer, each Fourier analysis network, and the fully-connected output layer based on the current loss.
[0170] For the processing flow of each module in the device and the interaction flow between modules, reference can be made to the relevant descriptions in the above method embodiments, which will not be elaborated here.
[0171] An embodiment of this application also provides an electronic device, such as Figure 12 shown Figure 12 is a schematic structural diagram of the electronic device provided by the embodiment of this application, including: a processor 1201, a memory 1202. Optionally, a bus 1203 may also be included. The memory 1202 stores machine-readable instructions executable by the processor 1201 (such as, Figure 11 the execution instructions corresponding to the acquisition module 1101, the determination module 1102, the training module 1103, and the prediction module 1104 in the device in
[0172] An embodiment of this application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, the steps of the above plunger pump anomaly prediction method are executed.
[0173] Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the above-described systems and devices can refer to the corresponding processes in the method embodiments, which will not be elaborated in this application. In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation. For another example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the displayed or discussed coupling or direct coupling or communication connection between each other can be through some communication interfaces, and the indirect coupling or communication connection of the devices or modules can be in an electrical, mechanical, or other form.
[0174] In addition, each functional unit in various embodiments of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. If the function is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, may be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs.
[0175] The above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, which should all be covered by the protection scope of the present application.
Claims
1. An abnormal prediction method for a plunger pump, characterized in that, Including: Obtaining historical data of a plunger pump, where the historical data includes: pressure data, rotational speed data, torque data, and flow rate data; Determining a unit data length according to the historical data; Training an initial plunger pump anomaly prediction model according to the historical data and the unit data length to obtain a target plunger pump anomaly prediction model. Among them, the initial plunger pump anomaly prediction model includes a multi-layer Fourier analysis network. When training the initial plunger pump anomaly prediction model, the Fourier analysis network learns the periodic features in the historical data; Based on the target plunger pump pressure prediction model, performing anomaly prediction on the plunger pump to obtain a prediction result, where the prediction result includes at least one of the following: pressure anomaly prediction result, rotational speed anomaly prediction result, torque anomaly prediction result, and flow rate anomaly prediction result.
2. The abnormal prediction method of the plunger pump according to claim 1, wherein, The determining the unit data length according to the historical data includes: Determining the sampling frequency of the historical data; Determining the unit data length according to the sampling frequency of the historical data and the plunger quantity information of the plunger pump.
3. The abnormal prediction method of the plunger pump according to claim 2, wherein The determining the sampling frequency of the historical data includes: Determining the maximum sampling frequency of the historical data according to the sampling frequency of the pressure data, the sampling frequency of the rotational speed data, the sampling frequency of the torque data, and the sampling frequency of the flow rate data, and using the maximum sampling frequency as the sampling frequency.
4. The abnormal prediction method of the plunger pump according to claim 2, characterized in that, The method further includes: Performing padding processing on the historical data according to the sampling frequency of the historical data to obtain padded historical data.
5. The abnormal prediction method for a plunger pump according to claim 1, characterized in that, The training the initial plunger pump anomaly prediction model according to the historical data and the unit data length to obtain a target plunger pump anomaly prediction model includes: Splitting the historical data into multiple input sequences according to the historical data and the unit data length, and each input sequence is respectively used to indicate the pressure, rotational speed, torque, and flow rate of the plunger pump at a time slot corresponding to the input sequence; Training the initial plunger pump anomaly prediction model according to each input sequence to obtain a target plunger pump anomaly prediction model.
6. The abnormal prediction method of the plunger pump according to claim 5, wherein The initial plunger pump anomaly prediction model includes: a fully connected embedding layer, multiple layers of the Fourier analysis network, and a fully connected output layer connected in sequence. The initial plunger pump anomaly prediction model further includes at least one learnable plunger pump physical parameter; The training the initial plunger pump anomaly prediction model according to each input sequence to obtain a target plunger pump anomaly prediction model includes: Inputting the input sequence of the current time slot into the fully connected embedding layer, and processing the input sequence of the current time slot through the fully connected embedding layer, each Fourier analysis network, and the fully connected output layer to obtain an output sequence of the plunger pump at the current time slot, where the output sequence is used to indicate at least one of the following: the pressure, rotational speed, torque, and flow rate of the plunger pump at the next time slot of the current time slot; Determining a current loss according to the output sequence of the plunger pump at the current time slot and the current values of each learnable plunger pump physical parameter. Based on the current loss, determine whether to end the training. If so, end the training; if not, adjust the fully connected embedding layer, each of the Fourier analysis networks, the fully connected output layer, and the values of each learnable physical parameter of the plunger pump based on the current loss.
7. The abnormal prediction method of the plunger pump according to claim 6, characterized in that, Determining the current loss according to the output sequence of the plunger pump in the current time slot and the current values of each learnable physical parameter of the plunger pump includes: Determine the input sequence of the plunger pump in the next time slot of the current time slot; Calculate the current loss according to the input sequence of the plunger pump in the next time slot of the current time slot, the output sequence of the plunger pump in the current time slot, and the current values of each learnable physical parameter of the plunger pump.
8. The abnormal prediction method of the plunger pump according to claim 6, characterized in that, The learnable physical parameters of the plunger pump include: mechanical efficiency and speed-flow coefficient.
9. The abnormal prediction method of the plunger pump according to claim 5, characterized in that, The initial plunger pump anomaly prediction model includes: a fully connected embedding layer, multiple layers of the Fourier analysis network, and a fully connected output layer connected in sequence; Training the initial plunger pump anomaly prediction model according to each input sequence to obtain a target plunger pump anomaly prediction model includes: Input the input sequence of the current time slot into the fully connected embedding layer, and process the input sequence of the current time slot through the fully connected embedding layer, each of the Fourier analysis networks, and the fully connected output layer to obtain the output sequence of the plunger pump in the current time slot. The output sequence is used to indicate at least one of the following: the pressure, speed, torque, and flow rate of the plunger pump in the next time slot of the current time slot; Determine the input sequence of the plunger pump in the next time slot of the current time slot; Calculate the current loss according to the input sequence of the plunger pump in the next time slot of the current time slot and the output sequence of the plunger pump in the current time slot; Based on the current loss, determine whether to end the training. If so, end the training; if not, adjust the fully connected embedding layer, each of the Fourier analysis networks, and the fully connected output layer based on the current loss.
10. An electronic device, characterized in that, Includes: A processor and a memory, the memory stores machine-readable instructions executable by the processor. When the electronic device runs, the processor executes the machine-readable instructions to perform the steps of the method for predicting plunger pump anomalies according to any one of claims 1 to 9.