Training of Friction Prediction Model after Pipeline Pigging, Multi-step Prediction Method and Device for Crude Oil Pipeline
By conducting multi-step prediction and abnormal working condition monitoring of the friction resistance of crude oil pipelines, the problem of relying on subjective experience in the existing technology of cleaning cycle determination is solved, efficient and accurate monitoring and prediction of crude oil pipelines are achieved, and the efficiency and safety of cleaning operations are improved.
Patent Information
- Application Number
- CN202211418268.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-14
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2042-11-14
AI Technical Summary
When determining the crude oil pipeline cleaning cycle, the prior art relies on the subjective experience of the operator, resulting in low accuracy and applicability, and it is easy to delay the optimal treatment period for abnormal working conditions.
By obtaining the historical sampling data of the crude oil conveying pipe section, calculating the pipeline friction resistance value and converting it into the reference friction resistance value, forming time series data, dividing it into training data sets and test data sets, using the LSTM neural network model to make multi-step prediction of the reference friction resistance value, and combining the abnormal working condition monitoring method, it realizes the prediction of future friction resistance value and monitoring of abnormal working conditions.
It realizes efficient and accurate guidance on the crude oil pipeline cleaning cycle, can monitor and predict the current and future situations of the pipeline during transportation, and reduces the risk of delays for abnormal friction and abnormal working conditions.
Smart Images

Figure CN118036692B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of crude oil pipeline transportation, and particularly to a training method for a friction prediction model after pigging of a crude oil pipeline, a multi-step friction prediction method, an abnormal condition monitoring method and device. Background Art
[0002] Most of the crude oil produced in our country is waxy crude oil with a high wax content. When hot oil is transported forward in the pipeline, the temperature of the crude oil is continuously reduced by the surrounding environment. When the temperature is lower than the wax precipitation point temperature of the crude oil, wax will gradually deposit inside the pipe wall, bringing many difficulties to the transportation. Wax deposition will not only increase the energy consumption of pipeline operation, affect the safe operation of the pipeline, but also may cause the crude oil in the pipe to cool and gel, resulting in a pipe blockage accident, bringing great potential safety hazards to the pipeline transportation. The earliest developed and widely used wax removal technology is pigging. A reasonable pigging cycle and the monitoring of pipeline-related parameters during transportation provide a basis for formulating an economical and effective pigging plan and a pipeline optimized operation plan.
[0003] In the method for determining the pigging cycle, the judgment of the pigging cycle depends on the subjective experience of the operator. First, it has high requirements for the professional and experience of the dispatcher and is easily affected subjectively; second, the working time or energy is limited, easy to get tired, and affected by mood swings; third, the efficiency is low, the speed is slow, and it is not easy to integrate information. When an abnormal condition occurs until the dispatcher discovers it and then takes corresponding measures, at least one hour or even longer has passed, which is very likely to delay the best period for abnormal handling. In addition, in actual engineering applications, various working conditions occur, and the method of determining the pigging cycle based on theoretical calculations is not suitable. To sum up, the existing methods are time-consuming and laborious, and the accuracy and applicability are not high. Therefore, there is an urgent need for a method that can not only give pigging guidance efficiently and accurately, but also monitor and predict the current and future conditions of the pipeline during transportation. Summary of the Invention
[0004] In view of the above problems, the present invention is proposed to provide a training method for a friction prediction model after pigging of a crude oil pipeline, a multi-step friction prediction method, an abnormal condition monitoring method and device that can overcome or at least partially solve the above problems.
[0005] In a first aspect, an embodiment of the present invention provides a training method for a friction prediction model after pigging of a crude oil pipeline, including:
[0006] Obtain historical sampling data of the throughput of the upstream station, the outlet pressure of the upstream station and the inlet pressure of the downstream station, the elevations of the upstream and downstream stations, and the mileage of the upstream and downstream stations of the crude oil pipeline segment between two pigging intervals, and the corresponding sampling time information;
[0007] Calculate the pipeline friction values corresponding to each sampling moment based on the historical sampling data of the throughput of the previous station, the outlet pressure of the previous station, the inlet pressure of the subsequent station, the elevations of the previous and subsequent stations, and the mileage of the previous and subsequent stations of the crude oil pipeline section, and convert them into corresponding reference friction values;
[0008] Form the time series data of the reference friction values based on the reference friction values corresponding to each sampling moment;
[0009] Divide the time series data of the reference friction values into a training data set and a test data set;
[0010] Iteratively use the training data set to train a preset neural network model, and evaluate the error of the predicted values output by the neural network model using the test data set until a preset convergence condition is reached to obtain the prediction model of the friction after pigging of the crude oil pipeline; the predicted values include the reference friction values of the crude oil pipeline section at multiple moments.
[0011] Calculate the pipeline friction values corresponding to each sampling moment based on the historical sampling data of the throughput of the previous station, the outlet pressure of the previous station, the inlet pressure of the subsequent station, the elevations of the previous and subsequent stations, and the mileage of the previous and subsequent stations of the crude oil pipeline section, including:
[0012] Calculate the pipeline friction value according to the following formula:
[0013]
[0014] In the above formula, P c is the outlet pressure of the previous station; P R is the inlet pressure of the subsequent station;
[0015] ρ is the density of the crude oil transported in the crude oil pipeline section; g is the acceleration due to gravity;
[0016] H c is the elevation of the previous station; H R is the elevation of the subsequent station;
[0017] L c is the mileage of the previous station; L R is the mileage of the subsequent station.
[0018] Convert the pipeline friction value into the corresponding reference friction value according to the following formula:
[0019]
[0020] Q is the throughput of the previous station.
[0021] The time series data of the friction values includes the pipeline friction values at several different sampling moments arranged in chronological order;
[0022] After forming the time series data of the friction resistance based on the reference friction resistance values corresponding to each sampling time, the method further includes:
[0023] Calculating the correlation coefficient between the reference friction resistance values at each moment and the previous moment in the time series data;
[0024] If the correlation coefficient is greater than or equal to a preset threshold, it is confirmed that there is a correlation;
[0025] Taking the time series data of the reference friction resistance values with a correlation as the data in the training data set and the test data set.
[0026] The correlation coefficient is calculated by the following method:
[0027]
[0028] Where X0, X -1 , X -n represent the reference friction resistance value at the current moment, the reference friction resistance value at the previous sampling moment, and the reference friction resistance values at the previous n sampling moments respectively.
[0029] The data in the training data set and the test data set are in the form of the following three-dimensional matrix:
[0030] X n →(x samples , x step , x features );
[0031] Among them, X n represents the time series sample, x samples represents the number of input data each time, x step represents using the data of the reference friction resistance at the previous several moments to predict, x features represents the number of prediction features, which is 1.
[0032] The neural network model is an LSTM neural network model;
[0033] In the LSTM neural network model, a periodic sliding window is adopted. After each cycle is completed, the predicted value of the test set is replaced with the true value again, and the long time series is split into multiple short time series;
[0034] Within a single cycle, a multi-model cyclic rolling prediction mode is adopted. The previous predicted value is added to the next input for re-prediction, and so on until the predicted number of steps set for this cycle is reached.
[0035] And the test data set is used to evaluate the error of the predicted value output by the neural network model, including:
[0036] The prediction accuracy of the model is evaluated by the mean absolute error (MAE) or root mean square error (RMSE) of the predicted values output by the neural network model;
[0037] The mean absolute error is:
[0038] The root mean square error is:
[0039] is the predicted value, and y i is the true value.
[0040] In a second aspect, an embodiment of the present invention provides a multi-step prediction method for the friction after pigging of a crude oil pipeline, including:
[0041] Obtain historical sampling data of the upstream flow rate, the upstream outlet pressure and the downstream inlet pressure of the crude oil pipeline section, the elevations of the upstream and downstream stations, and the mileage of the upstream and downstream stations, as well as the corresponding sampling time information;
[0042] According to the obtained historical sampling data of the upstream flow rate, the upstream outlet pressure and the downstream inlet pressure of the crude oil pipeline section, the elevations of the upstream and downstream stations, and the mileage of the upstream and downstream stations, calculate the pipeline friction values corresponding to each sampling time and convert them into corresponding reference friction values;
[0043] According to the reference friction values corresponding to each sampling time, form the time series data of the reference friction values;
[0044] After processing the time series data, input it into the prediction model for the friction after pigging of the crude oil pipeline that has been pre-trained, and output the reference friction values of the crude oil pipeline section at multiple future times through the prediction model;
[0045] The prediction model for the friction after pigging of the crude oil pipeline is obtained by the training method of the prediction model for the friction after pigging of the crude oil pipeline as described above.
[0046] In a third aspect, an embodiment of the present invention provides a monitoring method for abnormal working conditions, including:
[0047] Obtain the reference friction values of the crude oil pipeline section at multiple future times obtained by the multi-step prediction method for the friction after pigging of the crude oil pipeline as described above;
[0048] Compare the reference friction values of the crude oil pipeline section at the multiple future times with a preset warning threshold and / or alarm threshold;
[0049] According to the comparison result, determine whether to give a warning and / or alarm for abnormal working conditions.
[0050] Fourth aspect, an embodiment of the present invention provides a training device for a multi-step prediction model of the friction after pigging in a crude oil pipeline, including:
[0051] A first acquisition module, configured to acquire historical sampling data of the throughput of the upstream station, the outlet pressure of the upstream station, the inlet pressure of the downstream station, the elevations of the upstream and downstream stations, and the mileage of the upstream and downstream stations of the crude oil pipeline section between two pigging intervals, as well as the corresponding sampling time information;
[0052] A first calculation module, configured to calculate the pipeline friction value corresponding to each sampling time according to the historical sampling data of the throughput of the upstream station, the outlet pressure of the upstream station, the inlet pressure of the downstream station, the elevations of the upstream and downstream stations, and the mileage of the upstream and downstream stations of the crude oil pipeline section, and convert it into a corresponding reference friction value;
[0053] A first data processing module, configured to form time series data of the reference friction value according to the reference friction value corresponding to each sampling time; divide the time series data of the reference friction value into a training data set and a test data set;
[0054] A training module, configured to iteratively use the training data set to train a preset neural network model, and evaluate the error of the predicted value output by the neural network model using the test data set until a preset convergence condition is reached, to obtain the prediction model of the friction after pigging in the crude oil pipeline; the predicted value includes the reference friction values of the crude oil pipeline section at multiple times.
[0055] Fifth aspect, an embodiment of the present invention provides a multi-step prediction device for the friction after pigging in a crude oil pipeline, including:
[0056] A second acquisition module, configured to acquire historical sampling data of the throughput of the upstream station, the outlet pressure of the upstream station, the inlet pressure of the downstream station, the elevations of the upstream and downstream stations, and the mileage of the upstream and downstream stations of the collected crude oil pipeline section, as well as the corresponding sampling time information;
[0057] A second calculation module, configured to calculate the pipeline friction value corresponding to each sampling time according to the acquired historical sampling data of the throughput of the upstream station, the outlet pressure of the upstream station, the inlet pressure of the downstream station, the elevations of the upstream and downstream stations, and the mileage of the upstream and downstream stations of the crude oil pipeline section, and convert it into a corresponding reference friction value; form time series data of the reference friction value according to the reference friction value corresponding to each sampling time;
[0058] A prediction module, configured to process the time series data and then input it into a pre-trained prediction model of the friction after pigging in the crude oil pipeline, and output the reference friction values of the crude oil pipeline section at multiple future times through the prediction model;
[0059] The prediction model of the friction after pigging in the crude oil pipeline is obtained by the training method of the prediction model of the friction after pigging in the crude oil pipeline as described above.
[0060] In a sixth aspect, an embodiment of the present invention provides a monitoring device for abnormal working conditions, including:
[0061] A third acquisition module, configured to acquire the reference friction values of the crude oil pipeline segments at multiple future moments obtained by the multi-step prediction method for the friction after pigging of the crude oil pipeline as described above;
[0062] A monitoring module, configured to compare the reference friction values of the crude oil pipeline segments at the multiple future moments with a preset warning threshold and / or an alarm threshold; and determine whether to give a warning and / or an alarm according to the comparison result.
[0063] In a seventh aspect, an embodiment of the present invention provides a computing device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the training method for the prediction model of the friction after pigging of the crude oil pipeline as described above, or implements the multi-step prediction method for the friction after pigging of the crude oil pipeline as described above, or implements the monitoring method for the friction of the crude oil pipeline segment as described above.
[0064] In an eighth aspect, an embodiment of the present invention provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, it implements the training method for the prediction model of the friction after pigging of the crude oil pipeline as described above, or implements the multi-step prediction method for the friction after pigging of the crude oil pipeline as described above, or implements the monitoring method for the friction of the crude oil pipeline segment as described above.
[0065] The beneficial effects of the above technical solutions provided by the embodiments of the present invention at least include:
[0066] The training method for the prediction model of the friction after pigging of the crude oil pipeline, the multi-step prediction method for the friction, the monitoring method and device for abnormal working conditions provided by the embodiments of the present invention utilize a machine learning-based method to realize the prediction of the friction at multiple future time points by learning the friction of the crude oil pipeline, and can determine the warning and alarm thresholds based on the prediction of the friction at multiple future time points according to the friction distribution under historical steady-state working conditions, compare the predicted friction values, realize the monitoring of the friction anomaly in a relatively long period, as well as the monitoring of abnormal working conditions, and effectively guide operations such as pipeline pigging.
[0067] Other features and advantages of the present invention will be described in the following specification, and part of them will become obvious from the specification, or will be understood by implementing the present invention. The objectives and other advantages of the present invention can be achieved and obtained through the structures specifically pointed out in the written specification, claims, and drawings.
[0068] The technical solutions of the present invention will be further described in detail below with reference to the drawings and embodiments. Brief Description of the Drawings
[0069] The drawings are used to provide a further understanding of the present invention, and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation to the present invention. In the drawings:
[0070] Figure 1 is a flowchart of a training method for a friction prediction model after pigging of a crude oil pipeline in an embodiment of the present invention;
[0071] Figure 2 is a schematic diagram of the input and output of an LSTM neural network model in an embodiment of the present invention;
[0072] Figure 3 is a schematic diagram of the prediction process of the LSTM model in one cycle in an embodiment of the present invention;
[0073] Figure 4 is a flowchart of a prediction method for friction after pigging of a crude oil pipeline in an embodiment of the present invention;
[0074] Figure 5 is a flowchart of a monitoring method for abnormal working conditions in an embodiment of the present invention;
[0075] Figure 6 is a flowchart of using the friction after pigging of a crude oil pipeline to realize early warning, alarm and pigging operation of abnormal working conditions, etc. in an embodiment of the present invention;
[0076] Figure 7 is a structural block diagram of a training device for a friction prediction model after pigging of a crude oil pipeline in an embodiment of the present invention;
[0077] Figure 8 is a structural block diagram of a prediction device for friction after pigging of a crude oil pipeline in an embodiment of the present invention;
[0078] Figure 9 is a structural block diagram of a monitoring device for abnormal working conditions in an embodiment of the present invention. Detailed Description of the Embodiments
[0079] Hereinafter, exemplary embodiments of the present disclosure will be described in more detail with reference to the drawings. Although the exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present disclosure can be more thoroughly understood and the scope of the present disclosure can be fully communicated to those skilled in the art.
[0080] The inventors of the present invention have found that during the actual operation of a waxy crude oil pipeline, the influence of wax deposition on the pipe wall on the friction resistance is mainly manifested in the following two points: on the one hand, the pipe diameter of the pipeline is fixed, and wax deposition on the pipe wall will cause the actual effective flow area of the pipeline to shrink, and the friction resistance will increase; on the other hand, the wax deposition layer also plays a certain heat preservation role. When the pipeline operates under the condition of constant temperature difference, the oil temperature along the way increases and the viscosity decreases, and the friction resistance will decrease. However, relatively speaking, the increase in friction resistance caused by the wax deposition layer is the main influencing factor. Therefore, the prediction of the amount of wax deposition can be transformed into the prediction of the friction resistance. By predicting the friction resistance, the change of the wax layer thickness in the pipeline can be further predicted, providing reasonable data reference for the pigging cycle and the monitoring of abnormal working conditions.
[0081] Based on this, the embodiments of the present invention realize the monitoring and prediction of the current and future conditions of the pipeline during transportation by predicting the friction resistance of the crude oil transportation pipeline, so as to efficiently and accurately give pigging guidance.
[0082] The embodiments of the present invention provide a training method for a friction resistance prediction model after pigging of a crude oil pipeline, as shown in Figure 1 and includes:
[0083] S11. Obtain the historical sampling data of the throughput of the upstream station, the outlet pressure of the upstream station and the inlet pressure of the downstream station, the elevations of the upstream and downstream stations, and the mileage of the upstream and downstream stations of the crude oil transportation pipeline section between two pigging intervals, as well as the corresponding sampling time information;
[0084] S12. Calculate the pipeline friction resistance values corresponding to each sampling time according to the historical sampling data of the throughput of the upstream station, the outlet pressure of the upstream station and the inlet pressure of the downstream station, the elevations of the upstream and downstream stations, and the mileage of the upstream and downstream stations of the crude oil transportation pipeline section, and convert them into corresponding reference friction resistance values;
[0085] S13. Form the time series data of the reference friction resistance values according to the reference friction resistance values corresponding to each sampling time;
[0086] S14. Divide the time series data of the reference friction resistance values into a training data set and a test data set;
[0087] S15. Iteratively use the training data set to train a preset neural network model, and evaluate the error of the predicted values output by the neural network model using the test data set until the preset convergence condition is reached, and obtain the friction resistance prediction model after pigging of the crude oil pipeline; wherein, the predicted values include the reference friction resistance values of the crude oil transportation pipeline section at multiple times.
[0088] The friction prediction model after pigging for the crude oil pipeline provided by the embodiment of the present invention is for a single-segment crude oil transportation pipeline segment. For different pipeline segments, the corresponding multi-step friction prediction models for the crude oil pipeline after pigging are trained respectively, and the friction at each future moment is predicted by using the corresponding friction prediction model for the crude oil pipeline after pigging.
[0089] The following takes the training and multi-step prediction process of the friction prediction model for the crude oil pipeline after pigging corresponding to a single-segment crude oil transportation pipeline segment as an example for illustration.
[0090] In the embodiment of the present invention, data such as the throughput of the upstream station of the crude oil transportation pipeline segment, the inlet and outlet pressures of each station, the inlet and outlet flows, the elevations of the upstream and downstream stations, and the mileage of the upstream and downstream stations can be collected through a Supervisory Control And Data Acquisition (SCADA) system. Then, the pipeline friction is calculated using the Bernoulli equation and converted into the friction per 100 kilometers using the Rabinowitz formula.
[0091] Specifically, historical sampling data such as the throughput of the upstream station of the crude oil transportation pipeline segment, the outlet pressure of the upstream station and the inlet pressure of the downstream station in each station, the inlet and outlet flows, the elevations of the upstream and downstream stations, and the mileage of the upstream and downstream stations, as well as the corresponding time data (recording the sampling time) are collected through the SCADA system.
[0092] For example, the time span of the data is from January 2020 to March 2022. Since the data is relatively stable in a short period, the sampling time interval adopts the granularity of "hour", such as sampling once every 1 hour. In this way, data such as the throughput of the upstream station, the inlet and outlet pressures between the upstream and downstream stations, the inlet and outlet flows, the elevation, and the mileage corresponding to several sampling moments can be obtained.
[0093] The friction per 100 kilometers P of the pipeline segment is calculated based on the inlet and outlet pressures, elevation difference, and mileage difference of the pipeline segment (upstream station - downstream station) f , and the calculation formula is as follows:
[0094]
[0095] where P C and P R are the outlet pressure of the upstream station and the inlet pressure of the downstream station of the pipeline segment respectively, H C and H R are the elevation of the upstream station and the elevation of the downstream station respectively, L C and L R are the mileage of the upstream station and the mileage of the downstream station respectively. g is the value of the acceleration due to gravity, for example, g = 9.807, and ρ is the density value of the crude oil transported in the crude oil pipeline segment.
[0096] To eliminate the friction change caused by the throughput change, the friction per 100 kilometers of the pipeline segment needs to be converted to 1350m3 The frictional resistance at a certain throughput is obtained as the reference frictional resistance, that is, the frictional resistance at any throughput is converted into the frictional resistance at a throughput of 1350:
[0097]
[0098] where Q is the throughput of the previous station.
[0099] In the above step S13, the following processing can also be performed on the data:
[0100] Processing of abnormal data and missing values, and eliminating data that significantly exceeds the business scope.
[0101] Sort the reference frictional resistance data corresponding to each moment in the order of the sampling time, and filter out the data that does not conform to the correlation relationship according to the correlation coefficient.
[0102] Determine whether there is a certain relationship between the reference frictional resistance at a certain moment and the reference frictional resistance in the previous few hours. For example, it is determined by using the correlation coefficient, because the correlation coefficient is a statistical index used to reflect the closeness of the correlation relationship between variables. The time series data of the frictional resistance is expressed as follows:
[0103] X = (X -n , …, X -1 , X0);
[0104] Correlation coefficient calculation formula:
[0105]
[0106] where X0, X -1 , X -n represent the reference frictional resistance at the current moment, the reference frictional resistance at the previous sampling moment (for example, the previous 1 hour), and the reference frictional resistance at the previous n sampling moments (for example, the previous n hours), respectively.
[0107] Calculate the correlation coefficient between the reference frictional resistance value at each moment in the time series data and the reference frictional resistance value at the previous moment;
[0108] If the correlation coefficient is greater than or equal to the preset threshold, it is confirmed that there is a correlation relationship, and the reference frictional resistance value at this moment can be retained.
[0109] For example, if the correlation coefficient between the data is greater than 0.8, it is considered that the data has a close correlation with the reference frictional resistance value corresponding to the previous sampling moment. Therefore, this data needs to be retained in the time series data.
[0110] In addition, in order to improve the convergence speed and prediction accuracy of the model, it is necessary to normalize the data set. In this technology, the Min-Max function is used to normalize the training set and the test set respectively. Data normalization means scaling the data set proportionally to the interval [0, 1].
[0111] In addition, the training set and the test set will be divided, for example, in a ratio of 7:3.
[0112] In the embodiment of the present invention, the data in the training data set and the test data set are in the form of the following three-dimensional matrix:
[0113] X n →(x samples ,x step ,x features );
[0114] Among them, X n represents the time series sample, x samples represents the number of input data each time, x step represents how many previous benchmark friction data are used for prediction, x features represents the number of predicted features, which is the benchmark friction in the embodiment of the present invention. Therefore, the number of predicted features is 1.
[0115] In the above step S15, in a supervised learning manner, by training a preset neural network model, the trained model is used to input the benchmark friction data of the previous n moments and predict the benchmark friction data of the next m moments. This process is described by the following specific formula:
[0116] X p =(X p1 ,X p2 ,…,X pm )
[0117] X n+pi =(X -n+i ,…,X0,X pi ),i=1,2,3…m
[0118] X n+pi (i=1,2,3,…m)→LSTM→X p
[0119] In the above formula, X n+pi =(X -n+i ,…,X0,X pi ),i=1,2,3…m are the benchmark friction data of the previous n moments; X p =(X p1 ,X p2 ,…,X pm ) are the benchmark friction data of the next m moments.
[0120] In one embodiment, the neural network model is a long short-term memory (LSTM) neural network model;
[0121] The LSTM neural network model can predict the reference friction values at the next m time steps by predicting the reference friction values at the previous n time steps.
[0122] Further, in the above LSTM neural network model, a periodic sliding window is adopted to split a long time series into multiple short time series (each short time series is a cycle), and after each cycle is completed, the predicted values of the test set are replaced with the true values;
[0123] Specifically, within a single cycle (i.e., within each short time series), a multi-model cyclic rolling prediction mode is adopted. The previous predicted value is added to the next input for re-prediction, and this process is repeated until the predicted number of steps set for this cycle is reached.
[0124] Refer to Figure 2 As shown, the input of the LSTM neural network model is multiple time steps, and the output is also multiple time steps.
[0125] The model training process includes:
[0126] 1), Determine the data range of the hidden layer neurons through the empirical method. The formula is as follows:
[0127]
[0128] Where hn is the number of hidden layer neurons determined according to the above formula, n in and n out are the numbers of neurons in the data input layer and result output layer of the neural network model; k is an integer, k ∈ [1, 10];
[0129] 2), Select the minimum root mean square error of the model through the trial-and-error method;
[0130] 3), Update the model parameters;
[0131] 4), Update the number of hidden layer neurons according to the error.
[0132] After each iteration, the training data set is input into the LSTM neural network model for training, and then the test set is used to evaluate the predicted values of the model output. For example, the mean absolute error MAE or root mean square error RMSE of the predicted values output by the neural network model is used to evaluate the prediction accuracy of the model;
[0133] The mean absolute error is:
[0134] The root mean square error is:
[0135] is the predicted value, y i is the true value.
[0136] When the error is lower than the preset threshold, the training of the LSTM neural network model is completed.
[0137] The inventors of the present invention found that when using the LSTM neural network model to predict the friction resistance, the traditional LSTM neural network model has the following problems: ① Predicting the future 1-step data through the previous n data, which obviously cannot meet the engineering requirements for timeliness; ② Predicting the future m-step data through the previous n data. As the number of prediction steps increases, the input data set will be completely updated to the predicted value, and there are certain errors in the predicted value itself. The errors will continue to accumulate and be transmitted backward, and the overall prediction error will accumulate and increase. Therefore, it is necessary to make certain adjustments to the LSTM model to solve this problem.
[0138] In the embodiments of the present invention, the periodic sliding method is adopted to select the input data, that is, the predicted value of the test set is replaced with the true value every certain period of time (one cycle). And within each cycle, the cyclic prediction mode is still adopted.
[0139] Within each cycle, assuming the input data X n =(X -n , …, X -1 , X0), the cyclic prediction mode is adopted, that is, the previous predicted value p is added to the input training data set, and then a new p value is predicted, and so on until the preset number of prediction steps in this cycle is reached.
[0140] In the embodiments of the present invention, based on the LSTM model, the selection of the input data for each test is adjusted, and the periodic sliding window is used to select the training data for each input, so that X n can be updated with time, that is, the predicted value of the test set is replaced with the true value every certain period of time (every time a cycle is completed).
[0141] Assuming that the time step is 3 (cycles), X1, X2, X3... are the true values, and p1, p2, p3... are the predicted values. Figure 3 The prediction process of the LSTM model within one cycle is given.
[0142] Referring to Figure 3 as shown, the first input is X1, X2, and X3, and the predicted value p1 is output. In the second input data, it includes not only X2 and X3 but also the predicted value p1 output last time; the data input for the third time includes not only X3 but also the predicted values output for the first and second times.
[0143] Figure 3 The step size of the input data for each step (for example, input the data of three sampling periods X1, X2, and X3, and three sampling periods is the step size), and this step size can be determined by the following method:
[0144] According to the curve graph of the prediction error varying with the time step, determine the time step corresponding to the mutation of the prediction error as the step size of the input data.
[0145] The above-mentioned mutation of the prediction error can be determined, for example, by a preset threshold of the absolute value of the difference in the prediction error. Monitor the absolute value of the difference in the prediction error between each moment and the previous moment. If the absolute value of the difference in the error between a certain moment and the previous moment exceeds the preset threshold, it is considered that an error mutation has occurred. At this time, continue to monitor the duration of the continuous prediction error mutation until the error mutation ends, and then the time step corresponding to the prediction error mutation can be obtained.
[0146] Through model selection and comparative experiments, it is found that the LSTM with a periodic sliding window mode has the smallest error and the best fitting effect; the effect of BP-LSTM is the second, and the effect of the traditional LSTM model is the worst.
[0147] The values of MAE and RMSE of the three LSTM models can be referred to as shown in Table 1 below:
[0148]
[0149]
[0150] The embodiment of the present invention also provides a multi-step prediction method for the friction resistance after pigging of a crude oil pipeline. Refer to Figure 4 as shown, including:
[0151] S41. Obtain the historical sampling data of the upstream throughput, the upstream outlet pressure and the downstream inlet pressure of the crude oil pipeline section to be collected, the elevations of the upstream and downstream stations, and the mileage of the upstream and downstream stations, as well as the corresponding sampling time information;
[0152] S42. According to the historical sampling data of the upstream throughput, the upstream outlet pressure and the downstream inlet pressure of the crude oil pipeline section to be collected, the elevations of the upstream and downstream stations, and the mileage of the upstream and downstream stations, calculate the pipeline friction resistance value corresponding to each sampling time and convert it into the corresponding reference friction resistance value;
[0153] S43. According to the reference friction resistance values corresponding to each sampling time, form the time series data of the reference friction resistance values;
[0154] After processing the timing data, input it into a multi-step prediction model of the friction resistance after pigging of the crude oil pipeline that has been pre-trained, and output the reference friction resistance values of the crude oil pipeline section at multiple future moments through the prediction model.
[0155] The above prediction model of the friction resistance after pigging of the crude oil pipeline is obtained by the training method of the prediction model of the friction resistance after pigging of the crude oil pipeline as described above.
[0156] The execution processes of the above steps S41 to S43 are similar to the implementation manners of steps S11 to S13 in the training method of the friction resistance prediction model after pigging of the crude oil pipeline as described above, and will not be elaborated here.
[0157] The embodiment of the present invention also provides a monitoring method for abnormal working conditions. Refer to Figure 5 as shown, and includes the following steps:
[0158] S51. Obtain the reference friction resistance values of the crude oil pipeline section at multiple future moments obtained by the multi-step prediction method of the friction resistance after pigging of the crude oil pipeline as described above;
[0159] S52. Compare the reference friction resistance values of the crude oil pipeline section at multiple future moments with a preset early warning threshold and / or alarm threshold;
[0160] S53. Determine whether to give an early warning and / or alarm for abnormal working conditions according to the comparison result.
[0161] A flowchart for realizing early warning, alarm and pigging operation of abnormal working conditions by using the friction resistance after pigging of the crude oil pipeline refers to Figure 6 as shown. Using the training data, realize the prediction of the friction resistance trend in the next 72 hours, and compare the predicted multi-step friction resistance data with the thresholds of the early warning and alarm data to determine whether to give an early warning and alarm for abnormal working conditions, and perform pigging operations.
[0162] The thresholds of the early warning and alarm data can be determined, for example, by the friction resistance distribution under historical steady-state working conditions.
[0163] Based on the same inventive concept, the embodiment of the present invention also provides a training device for the prediction model of the friction resistance after pigging of the crude oil pipeline, a multi-step prediction device for the friction resistance after pigging of the crude oil pipeline, and a monitoring device for abnormal working conditions. Since the principles of the problems solved by these devices are similar to those of the multi-step prediction method of the friction resistance after pigging of the crude oil pipeline, the monitoring method for abnormal working conditions and the monitoring method for abnormal working conditions as described above, the implementation of these devices can refer to the implementation of the foregoing methods, and the repeated parts will not be elaborated.
[0164] The embodiment of the present invention provides a training device for the prediction model of the friction resistance after pigging of the crude oil pipeline. Refer to Figure 7 as shown, and includes:
[0165] The first acquisition module 71 is configured to acquire historical sampling data of the throughput of the previous station, the outlet pressure of the previous station, the inlet pressure of the subsequent station, the elevations of the previous station and the subsequent station, and the mileage of the previous station and the subsequent station of the crude oil pipeline segment between two pigging intervals, as well as the corresponding sampling time information;
[0166] The first calculation module 72 is configured to calculate the pipeline friction resistance values corresponding to each sampling time according to the historical sampling data of the throughput of the previous station, the outlet pressure of the previous station, the inlet pressure of the subsequent station, the elevations of the previous station and the subsequent station, and the mileage of the previous station and the subsequent station of the crude oil pipeline segment, and convert them into corresponding reference friction resistance values;
[0167] The first data processing module 73 is configured to form time series data of the reference friction resistance values according to the reference friction resistance values corresponding to each sampling time; divide the time series data of the reference friction resistance values into a training data set and a test data set;
[0168] The training module 74 is configured to iteratively train a preset neural network model using the training data set, and evaluate the error of the predicted values output by the neural network model using the test data set until a preset convergence condition is reached, so as to obtain a prediction model for the friction resistance after pigging of the crude oil pipeline; the predicted values include the reference friction resistance values of the crude oil pipeline segment at multiple moments.
[0169] A multi-step prediction device for the friction resistance after pigging of a crude oil pipeline provided by an embodiment of the present invention, referring to Figure 8 shown, includes:
[0170] The second acquisition module 81 is configured to acquire historical sampling data of the throughput of the previous station, the outlet pressure of the previous station, the inlet pressure of the subsequent station, the elevations of the previous station and the subsequent station, and the mileage of the previous station and the subsequent station of the collected crude oil pipeline segment, as well as the corresponding sampling time information;
[0171] The second calculation module 82 is configured to calculate the pipeline friction resistance values corresponding to each sampling time according to the acquired historical sampling data of the throughput of the previous station, the outlet pressure of the previous station, the inlet pressure of the subsequent station, the elevations of the previous station and the subsequent station, and the mileage of the previous station and the subsequent station of the crude oil pipeline segment, and convert them into corresponding reference friction resistance values; form time series data of the reference friction resistance values according to the reference friction resistance values corresponding to each sampling time;
[0172] The prediction module 83 is configured to, after processing the time series data, input it into a prediction model for the friction resistance after pigging of a crude oil pipeline that has been pre-trained, and output the reference friction resistance values of the crude oil pipeline segment at multiple future moments through the prediction model;
[0173] The prediction model for the friction resistance after pigging of the crude oil pipeline is obtained by the training method of the prediction model for the friction resistance after pigging of the crude oil pipeline as described above.
[0174] A monitoring device for abnormal working conditions provided by an embodiment of the present invention, referring to Figure 9 as shown, includes:
[0175] A third acquisition module 91, configured to acquire the reference friction values of the crude oil pipeline section at multiple future moments obtained by the multi-step prediction method of the friction after pigging of the crude oil pipeline as described above;
[0176] A monitoring module 92, configured to compare the reference friction values of the crude oil pipeline section at the multiple future moments with a preset early warning threshold and / or an alarm threshold; and determine whether to give an early warning and / or an alarm according to the comparison result.
[0177] An embodiment of the present invention provides a computing device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the training method of the friction prediction model after pigging of the crude oil pipeline as described above, or implements the multi-step prediction method of the friction after pigging of the crude oil pipeline as described above, or implements the monitoring method of the friction of the crude oil pipeline section as described above.
[0178] A computer-readable storage medium provided by an embodiment of the present invention, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the training method of the friction prediction model after pigging of the crude oil pipeline as described above, or implements the multi-step prediction method of the friction after pigging of the crude oil pipeline as described above, or implements the monitoring method of the friction of the crude oil pipeline section as described above.
[0179] The training method, multi-step prediction method and device of the friction prediction model after pigging of the crude oil pipeline provided by the embodiment of the present invention use a machine learning-based method to learn the friction of the crude oil pipeline, realize the prediction of the friction at multiple future time points, and can determine the early warning and alarm thresholds according to the friction distribution under historical steady-state working conditions based on the prediction of the friction at multiple future time points, compare the predicted friction values, realize the long-term friction anomaly monitoring and the monitoring of abnormal working conditions, and effectively guide operations such as pipeline pigging.
[0180] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.
[0181] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and combinations of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing device produce means for implementing the functions specified in one flow Figure 1 one flow or more flows and / or blocks Figure 1 or means for implementing the functions specified in one block or more blocks.
[0182] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable memory produce a manufacture including instruction means for implementing the functions specified in one flow Figure 1 one flow or more flows and / or blocks Figure 1 or means for implementing the functions specified in one block or more blocks.
[0183] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operational steps are performed on the computer or other programmable device to produce a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one flow Figure 1 one flow or more flows and / or blocks Figure 1 or means for implementing the functions specified in one block or more blocks.
[0184] Obviously, those skilled in the art can make various modifications and variations to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention is also intended to include these modifications and variations.
Claims
1. A training method for a friction resistance prediction model after pigging in a crude oil pipeline, characterized in that, Including: Obtaining historical sampling data of the throughput of the previous station, the outlet pressure of the previous station, the inlet pressure of the subsequent station, the elevations of the previous station and the subsequent station, and the mileage of the previous station and the subsequent station in the crude oil pipeline section between two pigging intervals, as well as the corresponding sampling time information; Calculating the pipeline friction resistance value corresponding to each sampling time according to the historical sampling data of the throughput of the previous station, the outlet pressure of the previous station, the inlet pressure of the subsequent station, the elevations of the previous station and the subsequent station, and the mileage of the previous station and the subsequent station in the crude oil pipeline section, and converting it into the corresponding reference friction resistance value; The calculating the pipeline friction resistance value corresponding to each sampling time according to the historical sampling data of the throughput of the previous station, the outlet pressure of the previous station, the inlet pressure of the subsequent station, the elevations of the previous station and the subsequent station, and the mileage of the previous station and the subsequent station in the crude oil pipeline section includes: Calculating the pipeline friction resistance value according to the following formula: In the above formula, P c is the outlet pressure of the previous station; P R is the inlet pressure of the next station; ρ is the density of the crude oil transported in the crude oil pipeline section; g is the acceleration due to gravity; H c is the elevation of the said front station; H R is the elevation of the said rear station; L c is the mileage of the said previous station; L R is the mileage of the said subsequent station; Converting the pipeline friction resistance value into the corresponding reference friction resistance value according to the following formula: Q is the throughput of the previous station; Forming time series data of the reference friction resistance value according to the reference friction resistance value corresponding to each sampling time; Dividing the time series data of the reference friction resistance value into a training data set and a test data set; Iteratively training a preset neural network model using the training data set, and evaluating the error of the predicted value output by the neural network model using the test data set until a preset convergence condition is reached, to obtain the friction resistance prediction model after pigging of the crude oil pipeline; The predicted value includes the reference friction resistance values of the crude oil pipeline section at multiple times.
2. The method according to claim 1, characterized in that, The time series data of the reference friction resistance value includes the pipeline friction resistance values at several different sampling times arranged in chronological order; After forming the time series data of the reference friction resistance according to the reference friction resistance value corresponding to each sampling time, the method further includes: Calculating the correlation coefficient between the reference friction resistance value at each time and the reference friction resistance value at the previous time in the time series data; If the correlation coefficient is greater than or equal to a preset threshold, it is confirmed that there is a correlation; Using the time series data of the reference friction resistance value with a correlation as the data of the training data set and the test data set.
3. The method according to claim 2, characterized in that, The correlation coefficient is calculated by the following method: where X0, X -1 , X -n represent the reference friction value at the current moment, the reference friction value at the previous sampling moment, and the reference friction values at the previous n sampling moments, respectively.
4. The method according to any one of claims 1 - 3, characterized in that, The data in the training data set and the test data set are in the form of the following three-dimensional matrix: X n →(x samples ,x step ,x features ); Among them, X n represents the time series sample, and x samples represents the number of input data each time, and x step represents using the data of the reference friction resistance at the previous several moments for prediction, and x features represents the number of predicted features, which is 1.
5. The method according to claim 4, characterized in that, The neural network model is an LSTM neural network model; The LSTM neural network model can predict the reference friction resistance values at the next m times by using the reference friction resistance values at the previous n times.
6. The method according to claim 5, characterized in that, In the LSTM neural network model, a periodic sliding window is adopted, and the predicted value of the test set is replaced with the true value every time a cycle is completed; Within a single cycle, a multi-model cyclic rolling prediction mode is adopted, and the previous predicted value is added to the next input for re-prediction, and so on until the preset prediction step of this cycle is reached.
7. The method according to claim 4, characterized in that, And evaluating the error of the predicted value output by the neural network model using the test data set, including: Evaluating the prediction accuracy of the model by using the mean absolute error MAE or the root mean square error RMSE of the predicted value output by the neural network model; The mean absolute error is as follows: The root mean square error is as follows: is the predicted value, y i is the true value.
8. A multi-step prediction method for the friction resistance after pigging in a crude oil pipeline, characterized in that, Including: Obtain historical sampling data of the throughput of the previous station, the outlet pressure of the previous station, the inlet pressure of the subsequent station, the elevations of the previous and subsequent stations, and the mileage of the previous and subsequent stations of the crude oil pipeline section to be collected, as well as the corresponding sampling time information; According to the historical sampling data of the throughput of the previous station, the outlet pressure of the previous station, the inlet pressure of the subsequent station, the elevations of the previous and subsequent stations, and the mileage of the previous and subsequent stations of the crude oil pipeline section obtained, calculate the pipeline friction resistance values corresponding to each sampling time and convert them into corresponding reference friction resistance values; According to the reference friction resistance values corresponding to each sampling time, form time series data of the reference friction resistance values; After processing the time series data, input it into a pre-trained friction resistance prediction model for the crude oil pipeline after pigging, and output the reference friction resistance values of the crude oil pipeline section at multiple future times through the prediction model; The friction resistance prediction model for the crude oil pipeline after pigging is obtained by the training method of the friction resistance prediction model for the crude oil pipeline after pigging as described in any one of claims 1-7.
9. A monitoring method for abnormal working conditions, characterized in that, Including: Obtain the reference friction resistance values of the crude oil pipeline section at multiple future times obtained by the multi-step prediction method for the friction resistance of the crude oil pipeline after pigging as described in claim 8; Compare the reference friction resistance values of the crude oil pipeline section at the multiple future times with a preset warning threshold and / or alarm threshold; According to the comparison result, determine whether to give a warning and / or alarm for abnormal working conditions.
10. A training device for a friction resistance prediction model after pigging in a crude oil pipeline, characterized in that, Including: A first acquisition module, configured to obtain historical sampling data of the throughput of the previous station, the outlet pressure of the previous station, the inlet pressure of the subsequent station, the elevations of the previous and subsequent stations, and the mileage of the previous and subsequent stations of the crude oil pipeline section between two pigging intervals, as well as the corresponding sampling time information; According to the historical sampling data of the throughput of the previous station, the outlet pressure of the previous station, the inlet pressure of the subsequent station, the elevations of the previous and subsequent stations, and the mileage of the previous and subsequent stations of the crude oil pipeline section, calculate the pipeline friction resistance values corresponding to each sampling time, including: Calculate the pipeline friction resistance value according to the following formula: In the above formula, P c is the outlet pressure of the said previous station; P R is the inlet pressure of the said subsequent station; ρ is the density of the crude oil transported in the crude oil pipeline section; g is the acceleration due to gravity; H c is the elevation of the said front station; H R is the elevation of the said rear station; L c is the mileage of the said previous station; L R is the mileage of the said subsequent station; According to the following formula, convert the pipeline friction resistance value into a corresponding reference friction resistance value: Q is the throughput of the previous station; A first calculation module, configured to calculate the pipeline friction resistance values corresponding to each sampling time according to the historical sampling data of the throughput of the previous station, the outlet pressure of the previous station, the inlet pressure of the subsequent station, the elevations of the previous and subsequent stations, and the mileage of the previous and subsequent stations of the crude oil pipeline section and convert them into corresponding reference friction resistance values; A first data processing module, configured to form time series data of the reference friction resistance values according to the reference friction resistance values corresponding to each sampling time; divide the time series data of the reference friction resistance values into a training data set and a test data set; A training module, configured to iteratively use the training data set to train a preset neural network model, and evaluate the error of the predicted values output by the neural network model using the test data set until a preset convergence condition is reached, to obtain the friction resistance prediction model for the crude oil pipeline after pigging; the predicted values include the reference friction resistance values of the crude oil pipeline section at multiple times.
11. A multi-step prediction device for the friction resistance after pigging in a crude oil pipeline, characterized in that, Including: A second acquisition module, configured to acquire historical sampling data of the upstream throughput, the upstream outlet pressure, the downstream inlet pressure, the elevations of the upstream and downstream stations, and the mileage of the upstream and downstream stations of the collected crude oil pipeline section, as well as the corresponding sampling time information; A second calculation module, configured to calculate the pipeline friction resistance values corresponding to each sampling time according to the acquired historical sampling data of the upstream throughput, the upstream outlet pressure, the downstream inlet pressure, the elevations of the upstream and downstream stations, and the mileage of the upstream and downstream stations of the crude oil pipeline section, and convert them into corresponding reference friction resistance values; and form time-series data of the reference friction resistance values according to the reference friction resistance values corresponding to each sampling time; A prediction module, configured to process the time-series data and then input it into a pre-trained friction resistance prediction model after pigging of the crude oil pipeline, and output the reference friction resistance values of the crude oil pipeline section at multiple future times through the prediction model; The friction resistance prediction model after pigging of the crude oil pipeline is obtained by the training method of the friction resistance prediction model after pigging of the crude oil pipeline according to any one of claims 1-7.
12. A monitoring device for abnormal working conditions, characterized in that, Comprising: A third acquisition module, configured to acquire the reference friction resistance values of the crude oil pipeline section at multiple future times obtained by the multi-step prediction method of the friction resistance after pigging of the crude oil pipeline according to claim 8; A monitoring module, configured to compare the reference friction resistance values of the crude oil pipeline section at the multiple future times with a preset warning threshold and / or an alarm threshold; and determine whether to give a warning and / or an alarm according to the comparison result.
13. A computing device, characterized in that, Comprising: A memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the program, it implements the training method of the friction resistance prediction model after pigging of the crude oil pipeline according to any one of claims 1-7, or implements the multi-step prediction method of the friction resistance after pigging of the crude oil pipeline according to claim 8, or implements the monitoring method of abnormal working conditions according to claim 9.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, it implements the training method of the friction resistance prediction model after pigging of the crude oil pipeline according to any one of claims 1-7, or implements the multi-step prediction method of the friction resistance after pigging of the crude oil pipeline according to claim 8, or implements the monitoring method of abnormal working conditions according to claim 9.
Citation Information
Patent Citations
Fitness evaluation method for high-sulfur natural gas pipeline material in service
CN109596503A
Natural gas pipeline network gas supply reliability detection method and device based on cross entropy theory
CN114091723A