A method, system, device and medium for predicting total wax deposition in a mixed transport pipeline

By combining the improved sparrow search optimization algorithm with the long-short time neural network, the wax deposition prediction model was optimized, which solved the problem of difficult determination of the number of hidden layers and learning rate, and achieved efficient prediction of the total amount of wax deposition in multiphase mixed pipelines.

CN116306200BActive Publication Date: 2025-10-17CHINA UNIV OF PETROLEUM (BEIJING)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211100540.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-09
Publication Date
2025-10-17
Estimated Expiration
2042-09-09

AI Technical Summary

Technical Problem

In the existing technology, the number of hidden layers and the number of hidden layer elements of long- and short-time neural networks are difficult to determine, and the learning rate and number of iterations are difficult to determine, resulting in insufficient accuracy in predicting the total amount of wax deposition. The traditional swarm intelligence algorithm has poor initialization population diversity and is prone to falling into local optimality, which affects the prediction effect.

Method used

An improved sparrow search optimization algorithm based on Sine chaotic mapping and Gaussian mutation is adopted, combined with a long short-term memory neural network (LSTM). The optimal prediction model is found by optimizing hyperparameters, a two-layer unidirectional long short-term memory neural network is constructed, the population is initialized using Sine chaotic mapping, and Sine chaotic perturbation and Gaussian mutation are introduced to improve the algorithm performance.

Benefits of technology

The accuracy and stability of the prediction of the total amount of wax deposition are improved, the population diversity is enhanced, the local optimal state is avoided, and the effective prediction of the total amount of wax deposition in multiphase mixed pipelines is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116306200B_ABST
    Figure CN116306200B_ABST
Patent Text Reader

Abstract

The application discloses a kind of mixed transport pipeline wax deposition total amount prediction method, system, equipment and medium, construct the wax deposition total amount prediction model of additive multiphase mixed transport pipeline based on long short-term memory neural network;Based on the data set obtained, the hyperparameters of the prediction model are optimized using the improved sparrow search optimization algorithm based on Sine chaos mapping and referring to Sine chaos disturbance and Gaussian variation, and the optimal prediction model is determined based on the optimized hyperparameters to predict the wax deposition total amount under the current working condition.The application uses the improved sparrow search optimization algorithm to optimize long short-term neural network, and introduces it to the wax deposition total amount prediction of additive (multiphase) mixed transport pipeline.The application can be widely applied to oil and gas storage and transportation engineering technical field.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of oil and gas storage and transportation engineering, and particularly relates to a mixed transportation pipeline wax deposition total amount prediction method, system, device and medium, and especially to a wax deposition total amount prediction method, system, device and medium for a multi-phase mixed transportation pipeline based on an intelligent algorithm. BACKGROUND

[0002] At present, wax deposition in the process of pipeline mixed transportation has become an important problem affecting the safety production and economic benefits of oilfields. In recent years, many scholars have proposed many methods for predicting the total amount of wax deposition. However, there is a very complex nonlinear relationship between the influencing factors of the total amount of wax deposition, and it is difficult to explore theoretically. So far, the law of wax deposition total amount prediction is obtained by mathematical model regression after a large number of field or experimental data. However, wax deposition experiments are very complex, and generally do not get enough and effective data, and there is no widely used prediction model.

[0003] In recent years, with the development of computer technology, models for predicting the total amount of wax deposition based on artificial neural networks, swarm algorithms and other intelligent algorithms have been applied and popularized. The common feature of this kind of method is that it does not need to explore the specific mechanism of wax deposition in detail, but through the use of appropriate machine learning algorithms, based on the input of original data, the relationship between the total amount of wax deposition and various influencing factors is simulated and trained, and thus the total amount of wax deposition is predicted.

[0004] In non-parametric methods, neural networks are most widely used because of their distributed storage, self-organization, self-regulation and non-linear fitting capabilities. Although neural networks have the above advantages, their prediction ability is limited for long time series, so long short-term memory (LSTM) is proposed, which is an improved time recurrent neural network that can learn long and short term information of time series. Because it contains a time memory unit, it is suitable for processing and predicting the interval and delay time in time series. However, it still has two shortcomings: one is that the number of hidden layers and the number of hidden layer neurons are difficult to determine; the other is that the learning rate and the number of iterations are difficult to determine. The number of hidden layers and the number of hidden layer neurons directly determine the fitting ability of the model, and the learning rate and the number of iterations affect the training process and effect of the model.

[0005] In summary, in practical applications, the existing technology has the following problems and defects:

[0006] (1) The prediction ability of long time series neural network is limited; and the number of hidden layers and the number of hidden layer neurons of long short-term memory (LSTM) are difficult to determine, and the learning rate and the number of iterations are difficult to determine.

[0007] (2) The number of hidden layers and the number of hidden layer neurons directly determine the fitting ability of the model, and the learning rate and the number of iterations affect the training process and effect of the model.

[0008] (3) In practical applications, these parameters are determined based on experience and have a high degree of randomness, which greatly reduces the predictive effect of the model.

[0009] (4) The initial population diversity of traditional swarm intelligence algorithms is poor and they are prone to falling into local optimality. When determining the above parameters, if the traditional swarm intelligence algorithm without improvement is used, the optimal parameter set cannot be obtained. Summary of the Invention

[0010] In response to the above problems, the purpose of the present invention is to provide a method, system, equipment and medium for predicting the total amount of wax deposition in mixed pipelines. By using a sparrow search optimization algorithm based on Sine chaotic mapping and citing Sine chaotic perturbation and Gaussian variation, the established prediction model based on the long short-term neural network (LSTM) is subjected to hyperparameter optimization, thereby realizing the prediction of the total amount of wax deposition in multiphase mixed pipelines.

[0011] To achieve the above object, the present invention adopts the following technical solutions:

[0012] In a first aspect, the present invention provides a method for predicting the total amount of wax deposition in a mixed pipeline, comprising the following steps:

[0013] Construct a prediction model for the total amount of wax deposition in additive-added multiphase mixed pipelines based on long short-term memory neural networks;

[0014] Based on the acquired data set, an improved sparrow search optimization algorithm based on Sine chaos mapping and citing Sine chaos perturbation and Gaussian mutation is used to optimize the hyperparameters of the prediction model. The optimal prediction model is determined based on the optimized hyperparameters to predict the total amount of wax deposition under the current working conditions.

[0015] Furthermore, the prediction model is composed of a double-layer unidirectional long short-term memory neural network layer, and the input parameters of the prediction model include the density of the pipeline fluid, the viscosity of the pipeline fluid, the oil flow temperature, the pipe wall temperature, the liquid holdup and the pressure; the output parameter is the total amount of wax deposition.

[0016] Furthermore, the method for predicting the total amount of wax deposition under current working conditions by optimizing the hyperparameters of the prediction model based on the acquired data set using an improved sparrow search optimization algorithm based on Sine chaos mapping and citing Sine chaos perturbation and Gaussian variation, and determining the optimal prediction model based on the optimized hyperparameters, includes:

[0017] S21. Use Sine chaotic map to initialize the population, and set iter = 1; where iter represents the number of iterations and iter is a positive integer;

[0018] S22, establish the fitness function of the improved sparrow search optimization algorithm based on the constructed prediction model, calculate the fitness of each individual in the population based on the obtained data set, and sort them in descending order;

[0019] S23, update the positions of the discoverer, joiner and alarm;

[0020] S24, calculate the fitness value of each individual after updating and the average fitness value of the entire population, determine whether to introduce Gaussian mutation and chaos disturbance, and obtain the latest individual;

[0021] S25, add 1 to iter, and determine whether iter is greater than the preset iteration number; if yes, execute step S26, and if no, return to step S22;

[0022] S26, output the current optimization result as the hyperparameters of the prediction model, including the learning rate, the number of iterations, the number of neurons in the first hidden layer and the number of neurons in the second hidden layer;

[0023] S27, determine the optimal prediction model based on the output hyperparameters, predict the total amount of wax deposition under the current working condition, and obtain the prediction result of the total amount of wax deposition under the current working condition.

[0024] Further, the data set acquisition method comprises the following steps:

[0025] Obtain the actual field data as the original data set, and the original data set comprises the density of the pipe fluid, the viscosity of the pipe fluid, the oil flow temperature, the pipe wall temperature, the liquid holdup, the pressure and the total amount of wax deposition;

[0026] Process the original data set to obtain a training set and a test set, comprising:

[0027] Determine a preset number of sample data sets, and each subset in the sample data set comprises the density of the pipe fluid, the viscosity of the pipe fluid, the oil flow temperature, the pipe wall temperature, the liquid holdup, the pressure and the total amount of wax deposition;

[0028] Normalize the data in the data set;

[0029] Divide the normalized data set into a training set and a test set according to a preset ratio.

[0030] Further, the fitness function of the improved sparrow search optimization algorithm based on the constructed prediction model is that the mean square error of the prediction result corresponding to the training set and the actual data in the training set is added as the fitness function.

[0031] Further, the position updating formula of the discoverer is as follows:

[0032]

[0033] w = (exp(2(1-(t / M))-exp(-2(1-(t / M)))) / (exp(2(1-(t / M)))+exp(-2(1-(t / M))))

[0034] Wherein, X i,j (t+1) and X i,j (t) represent the position information value of the i-th sparrow at the j-dimensional iteration number t+1 and t, respectively; t represents the current iteration number; w represents the adaptive coefficient; f min represents the global optimal solution of the last generation; M represents the maximum iteration number; α represents a random number, and α∈(0,1]; R represents a warning value, and R∈[0,1]; ST represents a safety value, and ST∈[0.5,1]; Q represents a random number subject to normal distribution; L represents a single-row d-dimensional matrix, wherein each element inside is 1;

[0035] The position updating formula of the joiner is as follows:

[0036]

[0037] Wherein, X p (t+1) represents the position with the optimal fitness in the current discoverer, and X worst (t) represents the position with the worst global fitness; A + =A T (AA T ) -1 , A represents a column vector with the same dimension as the sparrow individual, and the internal elements are randomly composed of 1 and-1;

[0038] The position updating formula of the alarm is as follows:

[0039]

[0040] Wherein, X best (t) is the current global optimal position, β is a step control parameter, is a random number subject to normal distribution with a mean of 0 and a variance of 1; K∈[-1,1] is a random number, f i is the fitness value of the current sparrow individual, f g and f w are the current global best and worst fitness values, respectively, and ε is a constant.

[0041] Further, the method for calculating the fitness value of each individual after updating and the average fitness value of the entire population, determining whether to introduce Gaussian mutation and chaos disturbance, and obtaining the latest individual, comprises:

[0042] Randomly select the first pNum sparrows with the optimal fitness as the discoverers, and the remaining as joiners, and randomly select sNum sparrows from the entire sparrow population as the sentinels;

[0043] With the updated position information, the fitness value fi of each sparrow and the average fitness value favg of the sparrow population are recalculated;

[0044] When fi < favg, Gaussian mutation is performed, and if the individual after mutation is better than the individual before mutation, the individual after mutation replaces the individual before mutation, otherwise the original individual remains unchanged;

[0045] When fi >= favg, Sine chaos disturbance is performed, and if the individual after disturbance is better than the individual before disturbance, the individual after disturbance replaces the individual before disturbance, otherwise the original individual remains unchanged.

[0046] In a second aspect, the present application provides a mixed transportation pipeline wax deposition total amount prediction system, comprising:

[0047] A model construction module is configured to construct a wax deposition total amount prediction model of a multiphase mixed transportation pipeline based on a long short-term memory neural network.

[0048] A prediction module is configured to optimize the hyperparameters of the prediction model by using an improved sparrow search optimization algorithm based on Sine chaos mapping and referring to Sine chaos disturbance and Gaussian mutation based on the obtained data set, and determine the optimal prediction model based on the optimized hyperparameters to predict the wax deposition total amount under the current working condition.

[0049] In a third aspect, the present application provides a computer device, which comprises a memory and a processor, and the memory stores a computer program, and the computer program is executed by the processor to make the processor execute the mixed transportation pipeline wax deposition total amount prediction method.

[0050] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to make the processor execute the mixed transportation pipeline wax deposition total amount prediction method.

[0051] The present application has the following advantages due to the above technical solutions:

[0052] 1. The present application proposes a sparrow search optimization algorithm based on Sine chaos mapping and referring to Sine chaos disturbance and Gaussian variation, and the hyperparameters of the prediction model based on long short-term neural network (LSTM) are optimized based on the improved algorithm, so as to realize the prediction of the wax deposition total amount of the multiphase mixed transportation pipeline.

[0053] 2, the first step of the swarm intelligence algorithm is to initialize the population, and a certain number of population individuals will be generated through the given upper limit and lower limit. The traditional population initialization is in the form of random numbers, and the population diversity is poor. Therefore, the population initialization is carried out by using Sine chaos mapping, the population diversity is enriched, and the global search range of the population is increased.

[0054] 3, the algorithm search performance and development performance are improved by introducing Sine chaos disturbance and Gaussian variation, and local optimum is avoided.

[0055] 4, the present application takes data model as the breakthrough point, selects the main factors affecting wax deposition from the wax deposition mechanism, and combines the wax deposition mechanism model and the data model by using the technical scheme of combining swarm intelligence algorithm and neural network, so as to realize the prediction of the total amount of wax deposition in multiphase mixed transportation pipeline.

[0056] Therefore, the present application can be widely applied to the field of oil and gas storage and transportation engineering. BRIEF DESCRIPTION OF DRAWINGS

[0057] Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The accompanying drawings are included to provide a description of the preferred embodiments and are not meant to limit the present application. Throughout the drawings, the same reference designators are used to denote like elements. In the drawings:

[0058] Figure 1 is the improved sparrow search optimization method flow chart provided by the embodiment of the present application;

[0059] Figure 2 is the improved sparrow search optimization method flow chart provided by the embodiment of the present application;

[0060] Figure 3 is the benchmark test function F1 optimization result provided by the embodiment of the present application;

[0061] Figure 4 is the benchmark test function F2 optimization result provided by the embodiment of the present application;

[0062] Figure 5 is the benchmark test function F3 optimization result provided by the embodiment of the present application;

[0063] Figure 6 is the benchmark test function F4 optimization result provided by the embodiment of the present application;

[0064] Figure 7 is the benchmark test function F5 optimization result provided by the embodiment of the present application;

[0065] Figure 8 is a benchmark function F6 optimization result provided by the embodiment of the application;

[0066] Figure 9 is a comparison chart of the predicted result and the actual result provided by the embodiment of the application;

[0067] Figure 10 is the error of the training set and the test set provided by the embodiment of the application. DETAILED DESCRIPTION

[0068] To make the objectives, technical solutions and advantages of the embodiments of the application clearer, the technical solutions of the embodiments of the application will be described clearly and completely below with reference to the drawings of the embodiments of the application. Obviously, the described embodiments are some but not all of the embodiments of the application. All other embodiments obtained by a person of ordinary skill in the art based on the described embodiments of the application belong to the scope of protection of the application.

[0069] It should be noted that the terms used herein are only intended to describe specific embodiments, and are not intended to limit the exemplary embodiments according to the present application. As used herein, the singular form is intended to include the plural form unless the context clearly indicates otherwise, and it should also be understood that when the terms "comprise" and / or "include" are used in the specification, there is a presence of the features, steps, operations, devices, components and / or combinations thereof.

[0070] Briefly speaking, the present application mainly involves three main concept modules of "sparrow search algorithm", "long short-term neural network (LSTM)" and "wax deposition".

[0071] (1) About wax deposition:

[0072] At present, the research on the mechanism of wax deposition at home and abroad mainly focuses on molecular diffusion, and the old chemical theory has gradually been recognized in recent years, but the influence of shear action has not reached a consensus, and the influence of gravity settling and Brownian diffusion can be ignored.

[0073] The molecular diffusion theory believes that, in the pipe transportation process, if the environmental temperature is lower than the wax precipitation point temperature of the crude oil, and the oil temperature at the pipe wall is reduced to below the wax precipitation point, the wax molecules dissolved in the crude oil near the pipe wall will first precipitate and deposit near the pipe wall, forming a wax deposition layer. Due to the different temperature differences between the oil and the wall, the wax molecules in the oil flow continuously diffuse and deposit under the concentration gradient from the center of the pipe flow to the pipe wall. The temperature difference between the mixed transportation fluid and the pipe wall determines the diffusion of wax molecules from the oil flow to the deposition layer and the back diffusion of low molecular weight hydrocarbons in the deposition layer, which is the main influencing factor of wax deposition. When the pipe wall temperature is lower than the wax precipitation point temperature, the greater the temperature difference between the pipe wall and the oil flow, the greater the concentration gradient of the wax molecules, and the stronger the molecular diffusion effect.

[0074] For gas-containing pipeline systems, typical multiphase flow thermodynamic calculation models show that the change of oil temperature in the pipeline is affected by the pressure drop of the pipeline due to the throttling effect of the gas in the pipeline during flow.

[0075] For multiphase (oil-gas-water three-phase) mixed transportation systems, the cross-sectional liquid holdup and water cut are in dynamic change, both of which affect the wax deposition in the pipeline. The presence of dispersed water droplets in the system reduces the deposition mass, because the dispersed water droplets hinder the diffusion of wax molecules in the oil to the surface of the deposition layer, and with the further increase of the water cut, a water film is easily formed on the pipe wall, which weakens the contact and combination of wax and the pipeline, which shows that the increase of water cut will reduce the wax deposition rate of the pipeline. In addition, due to the periodic alternating flow of the gas phase and the liquid phase, the wetting area of the liquid phase is reduced, so the deposition surface is uneven, and the deposition thickness changes with the cross-sectional liquid holdup. This is due to the change of liquid film shape with the increase of gas-oil ratio, the increase of wetting area, the increase of contact area between oil phase and pipe wall, and the increase of wax deposition rate of the pipeline.

[0076] The properties of the pipeline fluid also change with the flow state. Through the study of gas-liquid pipeline flow, Xiao-Shawn-Briel expressed the density and viscosity of the gas-liquid mixture as a calculation formula related to the liquid holdup; Kahn et al. tested and analyzed the oil-gas mixture sample, and obtained a calculation formula of the viscosity of crude oil under different pressure conditions.

[0077] According to the above analysis, the main factors affecting the wax deposition of the multiphase mixed transportation pipeline are summarized as follows: (1) the density of the pipeline fluid; (2) the viscosity of the pipeline fluid; (3) the temperature of the oil flow; (4) the temperature of the pipe wall; (5) the liquid holdup; (6) the pressure; (7) the total amount of wax deposition. As can be seen, the total amount of wax deposition of the multiphase mixed transportation pipeline is affected by many factors, and these factors have complex nonlinear relationship with the total amount of wax deposition.

[0078] (2) About long and short time neural network (LSTM)

[0079] The fundamental purpose of the present application is to realize the prediction of the total amount of wax deposition of the multiphase mixed transportation pipeline, and the total amount of wax deposition of the multiphase mixed transportation pipeline changes with time, generally showing that the total amount of wax deposition will gradually increase over time. It can be seen that the total amount of wax deposition has a strong correlation with time. The long and short time neural network (LSTM) has excellent effect in processing time series data (data with time dependence), therefore, the present application considers using LSTM to predict the total amount of wax deposition.

[0080] (3) About sparrow search algorithm

[0081] The super parameters (learning rate, iteration number and number of each hidden layer, etc.) in any neural network often need to be set artificially, and the set super parameters directly affect the prediction effect of the neural network, therefore, determining the optimal super parameter becomes the most important link in the neural network construction process. The swarm intelligence algorithm is a kind of probability search algorithm, has strong self-learning, self-adaptability and self-organization, has simple algorithm structure, high convergence speed, good global convergence and is easy to expand and has less running overhead. In view of the above advantages, the sparrow search algorithm is adopted to optimize the fitness function in the LSTM.

[0082] In the conventional sparrow search algorithm, individuals are usually divided into discoverers, joiners and sentinels, and each individual position corresponds to a solution. According to the algorithm setting, the proportion of the sentinel in the population is 10% to 20%, and the discoverer and the joiner are dynamically changed, that is, one individual becoming a discoverer means that another individual becomes a joiner. According to the division of labor, the discoverer mainly provides the foraging direction and area for the whole population, the joiner forages following the discoverer, and the sentinel is responsible for monitoring the foraging area. In the foraging process, the resource acquisition is completed by constantly updating the positions of the three. However, the conventional sparrow search algorithm is easy to fall into local extremum and has poor optimization ability, therefore, an improved sparrow search algorithm is proposed in the present application to improve the conventional sparrow search algorithm from the aspects of enriching population diversity and breaking through local extremum.

[0083] The main rules of the improved sparrow search optimization algorithm proposed in the present application are as follows:

[0084] a. The discoverer usually has higher energy reserves and is responsible for searching the area with rich food in the whole population, and provides the foraging area and direction for all joiners. In the model establishment, the height of the energy reserve depends on the good or bad of the fitness value corresponding to the sparrow individual.

[0085] b. Once the sparrow discovers the predator, the individual starts to emit chirping as an alarm signal. When the alarm value is greater than the safety value, the discoverer will take the joiner to other safe areas for foraging.

[0086] c. The identities of the discoverer and the joiner are dynamically changed. As long as a better food source can be found, each sparrow can become a discoverer, but the proportion of the discoverer and the joiner in the whole population is unchanged. That is, one sparrow becoming a discoverer means that another sparrow becomes a joiner.

[0087] d. The lower the energy of the joiner, the worse the foraging position of the joiner in the whole population. Some hungry joiners are more likely to fly to other places to forage to obtain more energy.

[0088] e. During foraging, joiners are always able to search for the finder that provides the best food, and then obtain food from the best food or forage around the finder. At the same time, some joiners may constantly monitor the finder to increase their predation rate and compete for food resources.

[0089] f. When aware of danger, sparrows at the edge of the group will quickly move to a safe area to gain a better position, while sparrows in the middle of the group will move randomly to get closer to other sparrows.

[0090] Based on the above analysis, in some embodiments of the present invention, a method for predicting wax deposition in a mixed pipeline is provided, which combines a sparrow search optimization algorithm based on Sine chaotic mapping and citing Sine chaotic perturbation and Gaussian variation with a long short-time neural network (LSTM), thereby realizing the prediction of the total amount of wax deposition in a multiphase mixed pipeline.

[0091] Correspondingly, in other embodiments of the present invention, a system, device and medium for predicting the total amount of wax deposition in a mixed pipeline are provided.

[0092] Example 1

[0093] like Figure 1 As shown, this embodiment provides a method for predicting the total amount of wax deposition in a mixed pipeline, comprising the following steps:

[0094] S1. Construct a prediction model for the total amount of wax deposition in additive-added multiphase mixed pipelines based on long short-term memory neural networks;

[0095] S2. Based on the acquired data set, the hyperparameters of the prediction model are optimized using an improved sparrow search optimization algorithm based on Sine chaos mapping and citing Sine chaos perturbation and Gaussian mutation. The optimal prediction model is determined based on the optimized hyperparameters to predict the total amount of wax deposition under the current working conditions.

[0096] Preferably, in the above step S1, since the long short-term neural network is an improved neural network, it can discover the relationship between the influencing factors and the total amount of wax deposition in the multiphase mixed pipeline, and can make predictions more effectively based on historical data. Therefore, in this embodiment, a prediction model for the total amount of wax deposition in the additive multiphase mixed pipeline is constructed based on the long short-term memory neural network. The prediction model is composed of a two-layer unidirectional LSTM model consisting of a first hidden layer and a second hidden layer, and hyperparameters such as the number of neurons in the first hidden layer, the number of neurons in the second hidden layer, the learning rate and the number of iterations are all determined by an improved sparrow search optimization algorithm.

[0097] More preferably, the prediction model constructed in the embodiment takes the density of the pipe fluid, the viscosity of the pipe fluid, the oil flow temperature, the pipe wall temperature, the liquid holdup and the pressure as the input of the prediction model, and takes the total amount of wax deposition as the output of the prediction model.

[0098] Preferably, in the step S2, based on the obtained data set, the hyperparameters of the prediction model are optimized by using an improved sparrow search optimization algorithm based on Sine chaotic mapping and referring to Sine chaotic disturbance and Gaussian variation, and the optimal prediction model is determined based on the optimized hyperparameters to predict the total amount of wax deposition under the current working condition, specifically including the following steps:

[0099] S21, population initialization is performed using Sine chaotic mapping, that is, the hyperparameters of the prediction model are initialized, and iter is set to 1; wherein iter represents the iteration number and iter is a positive integer;

[0100] S22, based on the constructed prediction model, the fitness function of the improved sparrow search optimization algorithm is established, and based on the obtained data set, the fitness of each individual in the population is calculated and sorted in descending order;

[0101] S23, the positions of the discoverer, the joiner and the alarm are updated;

[0102] S24, the fitness values of the updated individuals and the average fitness value of the entire population are calculated, it is determined whether Gaussian variation and chaotic disturbance need to be introduced, and the latest individual is obtained;

[0103] S25, iter is increased by 1, and it is determined whether iter is greater than the preset iteration number; if yes, step S26 is performed, and if no, step S22 is returned;

[0104] S26, the current optimization result is output as the hyperparameters of the prediction model, which include the learning rate, the iteration number, the number of neurons in the first hidden layer and the number of neurons in the second hidden layer;

[0105] S27, based on the output hyperparameters, the optimal prediction model is determined to predict the total amount of wax deposition under the current working condition, and the prediction result of the total amount of wax deposition under the current working condition is obtained.

[0106] Preferably, in the step S21, chaos is a kind of nonlinear phenomenon existing in nature, and because the chaotic variable has the characteristics of randomness, ergodicity and regularity, it is used in optimization search problems by many scholars, which not only effectively maintains the diversity of the population, but also helps the algorithm to jump out of the local optimum and improve the global search ability. Therefore, the population is initialized by using Sine chaotic mapping in the present application, and Sine chaotic mapping is a model with infinite folding times. The one-dimensional mapping expression of Sine chaotic mapping is as follows:

[0107]

[0108] wherein: x n represents the value of the n-th dimension, x n+1 represents the value of the n+1-th dimension; a represents a chaos parameter, and a e (0, 4], and N represents the dimension of data.

[0109] Preferably, in the step S22, the method for obtaining the data set comprises the following steps.

[0110] S221, obtaining field actual data as an original data set, wherein the original data set comprises the density of the pipe-transported fluid, the viscosity of the pipe-transported fluid, the oil flow temperature, the pipe wall temperature, the liquid holdup, the pressure and the total amount of wax deposition, and in the embodiment, the density of the pipe-transported fluid, the viscosity of the pipe-transported fluid, the oil flow temperature, the pipe wall temperature, the liquid holdup and the pressure are taken as operating parameters, i.e. the inputs of the prediction model, and the total amount of wax deposition is taken as an evaluation parameter, i.e. the output of the prediction model.

[0111] S222, processing the original data set to obtain a training set and a test set.

[0112] Specifically, the method for processing the original data set can be realized through the following steps.

[0113] determining a preset number of sample data sets, each subset in the sample data set comprising the density of the pipe-transported fluid, the viscosity of the pipe-transported fluid, the oil flow temperature, the pipe wall temperature, the liquid holdup, the pressure and the total amount of wax deposition;

[0114] normalizing the data in the data set, and the calculation formula is:

[0115]

[0116] wherein: x represents the normalized value, x i represents the value to be normalized, lb represents the minimum value of the value range of the current value, and ub represents the maximum value of the value range of the current value.

[0117] S223, dividing the normalized data set into a training set and a test set according to a preset ratio.

[0118] Preferably, in the step S22, the fitness function of the improved sparrow search optimization algorithm is established based on the constructed prediction model, which means that the mean square error between the prediction result corresponding to the training set and the actual data in the training set is added as the fitness function during training (and the mean square error between the prediction result corresponding to the test set and the actual data in the test set is added as the fitness function during testing), so as to ensure that the optimal hyperparameters are obtained while the error between the predicted wax deposition total amount and the actual wax deposition total amount is minimized.

[0119] Preferably, in the step S23, the position update formulas of the discoverer, the joiner and the alarm are respectively:

[0120] The position update formula of the discoverer is as follows:

[0121]

[0122] w = (exp(2(1-(t / M))-exp(-2(1-(t / M)))) / (exp(2(1-(t / M))+exp(-2(1-(t / M))))

[0123] wherein, X i,j (t+1) and X i,j (t) represent the position information value of the ith sparrow at the iteration number t+1 and t in j dimensions respectively; t represents the current iteration number; w represents the adaptive coefficient; f min represents the global optimal solution of the last generation; M represents the maximum iteration number; a represents a random number, and a ∈ (0, 1]; R represents the warning value, and R ∈ [0, 1]; ST represents the safety value, and ST ∈ [0.5, 1]; Q represents a random number subject to normal distribution; and L represents a single-row d-dimensional matrix, wherein each element in the interior is 1. When R < ST, it means that there is no predator around, and the discoverer can perform large-scale search; when R ≥ ST, it means that the alarm discovers the predator, and immediately sends an alarm signal, and all sparrows quickly fly to other safe areas.

[0124] In the position update formula of the discoverer, the global optimal solution of the last generation is introduced to dynamically and adaptively update the weight value. When the population does not discover the existence of the predator or other dangers, it indicates that the search environment is relatively safe, and the discoverer can search more widely to guide the population to obtain higher fitness.

[0125] The position update formula of the joiner is as follows:

[0126]

[0127] wherein, X p (t+1) represents the position of the discoverer with the optimal fitness, and Xworst (t) represents the current worst global fitness position; A + = A T (AA T ) -1 A represents a column vector with the same dimension as the sparrow individual, and the internal elements are randomly composed of 1 and -1. When , the joiner will actively follow the finder to move to a better foraging position; when , the joiner will combine the exp function characteristics to get rid of the current poor foraging position.

[0128] The position update formula of the alarm is as follows:

[0129]

[0130] Where, X best (t) is the current global optimal position, β is the step control parameter, is a random number obeying normal distribution with mean 0 and variance 1. K ∈ [-1, 1] is a random number, f i is the fitness value of the current sparrow individual. f g and f w are the current global best and worst fitness values, respectively, and ε is a small constant to avoid the denominator from being 0. When f i > f g , it means that the sparrow is in the marginal position of the population and is easy to be attacked by predators; when f i = f g , it means that the sparrow in the middle position of the population realizes the danger, so it needs to approach other sparrows to reduce the probability of being preyed upon.

[0131] Preferably, in the above step S24, in order to improve the search performance and development performance of the algorithm and avoid falling into local optimum, the embodiment introduces Sine chaotic disturbance and Gaussian variation. The judgment method includes the following steps:

[0132] S241, randomly select the first pNum sparrows with optimal fitness as finders, and the remaining as joiners, and randomly select sNum sparrows from the entire sparrow population as alarmers;

[0133] S242、with the updated position information, the fitness value fi of each sparrow and the average fitness value fav of the sparrow population are recalculated, when fi < fav, it indicates that the "aggregation" phenomenon occurs, and Gaussian mutation is needed, if the individual after mutation is better than the individual before mutation, the individual after mutation replaces the individual before mutation, otherwise the original individual remains unchanged; when fi >= fav, it indicates that the "divergence" phenomenon occurs, and the individual i is subjected to Sine chaotic disturbance, if the individual after disturbance is better than the individual before disturbance, the individual after disturbance replaces the individual before disturbance, otherwise the original individual remains unchanged.

[0134] wherein the Sine chaotic disturbance is based on a variable generated by Sine chaotic mapping, and the individual is subjected to chaotic disturbance according to the following formula:

[0135] X n '=(X n +X0) / 2,n∈[1,POP]

[0136] wherein X n represents the individual that needs to be subjected to chaotic disturbance, X0 represents the chaotic disturbance amount generated, X n ' is the individual generated after chaotic disturbance, and POP is the population size.

[0137] The Gaussian mutation is derived from Gaussian distribution, specifically, when the mutation operation is performed, a random number conforming to a normal distribution with mean μ and variance σ 2 is used to replace the original value. Specifically, the formula of Gaussian mutation is as follows:

[0138] Gm(x)=x(1+N(0,1))

[0139] wherein x represents the individual that needs to be subjected to Gaussian mutation, N(0,1) represents a normal distribution random number with expectation 0 and standard deviation 1, and Gm(x) is the new individual generated after Gaussian mutation.

[0140] (2) Constructing a neural network model.

[0141] A wax deposition total amount prediction model of the multiphase mixed transportation pipeline based on the long short-term memory neural network is constructed. The model constructed is trained through the training set generated in step (1) until the model passes the test of the test set. The model after passing the test is the prediction model. The positions of the discoverer, the joiner and the alarmer are updated by using the improved sparrow algorithm. The best position and the fitness are updated through continuous iterative calculation. After the iteration is completed, the result is subjected to inverse normalization operation, and the pressure drop of the experimental section can be obtained, and then the wax deposition thickness can be obtained.

[0142] Example 2

[0143] In order to demonstrate the creativity and technical value of the technical solution of the present invention, this embodiment is used to apply Example 1 to specific products or related technologies.

[0144] (1) Improved sparrow search algorithm optimization ability test

[0145] Simulation experiments were conducted on six benchmark functions. As shown in Table 1, these are three high-dimensional unimodal functions F1-F3 and three high-dimensional multimodal functions F4-F6. These two categories, high-dimensional unimodal and high-dimensional multimodal, allow us to fully examine the feasibility, superiority, and optimization capabilities of the improved sparrow search algorithm proposed in this paper.

[0146] Table 1 Simulation experiments

[0147]

[0148] like Figures 2 to 8 As shown, after testing on two types of functions, high-dimensional unimodal and high-dimensional multimodal, it can be found that the improved sparrow search algorithm proposed in this embodiment is better than the traditional algorithm in terms of optimization effect.

[0149] (2) Using the improved sparrow search algorithm to determine the optimal hyperparameters and predict the total amount of wax deposition

[0150] Using actual field data from a pipeline in an oil field, we extracted the density and viscosity of the pipeline fluid, oil flow temperature, pipe wall temperature, liquid holdup, pressure, and total wax deposition data from all the field data. After arranging the data, we constructed a data set.

[0151] Table 2 Pipeline structure data

[0152] Parameter name Specific value Pipe diameter (mm) 234.9 Wall thickness (mm) 19.1 Pipe length (m) 10000

[0153] Table 3 Operation data

[0154] Inlet temperature (°C) 85.8 Outlet pressure (MPa) 0.64 Oil phase flow rate (m 3 / day) 3873.5 Gas phase flow (m 3 / day) 6197.6 Water phase flow rate (m 3 / day) 173.2 Wax content (%) 3.53 Wax precipitation point (°C) 18.27

[0155] like Figure 9 and Figure 10 The figures shown are respectively a comparison of the predicted results and the actual results provided by the embodiment of the present invention, and the errors between the training set and the test set. It can be seen that the present invention can effectively improve the accuracy of the prediction of the total amount of wax deposition.

[0156] Example 3

[0157] The above-mentioned Example 1 provides a method for predicting the total amount of wax deposits in mixed pipelines. Correspondingly, this embodiment provides a system for predicting the total amount of wax deposits in mixed pipelines. The system provided in this embodiment can implement the method for predicting the total amount of wax deposits in mixed pipelines of Example 1. The system can be implemented through software, hardware, or a combination of software and hardware. For example, the system can include integrated or separate functional modules or functional units to perform the corresponding steps in each method of Example 1. Because the system of this embodiment is basically similar to the method embodiment, the description of the process in this embodiment is relatively simple. For relevant details, please refer to the partial description of Example 1. The embodiment of the system provided in this embodiment is merely illustrative.

[0158] This embodiment provides a system for predicting the total amount of wax deposits in mixed pipelines, including:

[0159] A model building module is used to build a prediction model for the total amount of wax deposition in additive multiphase mixed pipelines based on a long short-term memory neural network;

[0160] The prediction module is used to optimize the hyperparameters of the prediction model based on the acquired data set using an improved sparrow search optimization algorithm based on Sine chaos mapping and citing Sine chaos perturbation and Gaussian mutation, and to determine the optimal prediction model based on the optimized hyperparameters to predict the total amount of wax deposition under the current working conditions.

[0161] Example 4

[0162] This embodiment provides a processing device corresponding to the method for predicting the total amount of wax deposition in mixed pipelines provided in this embodiment 1. The processing device can be a processing device for a client, such as a mobile phone, laptop computer, tablet computer, desktop computer, etc., to execute the method of embodiment 1.

[0163] The processing device includes a processor, a memory, a communication interface, and a bus. The processor, memory, and communication interface are connected via the bus to facilitate communication between them. The memory stores a computer program executable by the processor. When the processor executes the computer program, it executes the method for predicting the total amount of wax deposit in a mixed pipeline provided in Example 1.

[0164] In some embodiments, the memory may be a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory.

[0165] In other embodiments, the processor may be a central processing unit (CPU), a digital signal processor (DSP), or other general-purpose processors, which are not limited herein.

[0166] Example 5

[0167] The wax deposition total amount prediction method for mixed transportation pipelines of this embodiment 1 can be embodied as a computer program product, which can include a computer readable storage medium, on which computer readable program instructions for executing the wax deposition total amount prediction method for mixed transportation pipelines described in this embodiment 1 are loaded.

[0168] The computer readable storage medium can be a tangible device that maintains and stores instructions for use by an instruction execution device. The computer readable storage medium can be, for example but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any combination thereof.

[0169] It should be noted that the embodiments of the present application can be realized by hardware, software, or a combination of software and hardware. The hardware part can be realized by special logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or a specially designed hardware. Those skilled in the art can understand that the above-mentioned devices and methods can be realized by computer executable instructions and / or included in processor control code, such as carrier media, such as magnetic disk, CD or DVD-ROM, programmable memory, such as read-only memory (firmware), or data carrier, such as optical or electronic signal carrier. The devices of the present application and their modules can be realized by hardware circuit, such as ultra-large scale integrated circuit or gate array, semiconductor, such as logic chip, transistor, etc., or programmable hardware device, such as field programmable gate array, programmable logic device, etc., or by software executed by various types of processors, or by a combination of the above hardware circuit and software, such as firmware.

[0170] Finally, it should be noted that: the above examples are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing examples, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing examples, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for predicting the total amount of wax deposition in a mixed pipeline, characterized in that: It includes the following steps: Construct a prediction model for the total wax deposition in the additive multiphase pipeline based on the long short-term memory neural network; The prediction model is composed of a double-layer unidirectional long short-term memory neural network layer, and the input parameters of the prediction model include the density of the pipeline fluid, the viscosity of the pipeline fluid, the oil flow temperature, the wall temperature, the liquid holdup rate, and the pressure; the output parameter is the total wax deposition; Based on the obtained data set, use an improved sparrow search optimization algorithm based on Sine chaotic mapping and introducing Sine chaotic perturbation and Gaussian mutation to optimize the hyperparameters of the prediction model, and determine the optimal prediction model based on the optimized hyperparameters to predict the total wax deposition under the current working conditions. Specifically: S21. Use Sine chaotic mapping for population initialization, and let iter = 1; where, iter represents the number of iterations and iter is a positive integer; S22. Based on the constructed prediction model, establish a fitness function for the improved sparrow search optimization algorithm, and based on the obtained data set, calculate the fitness of each individual in the population and sort them in descending order; S23. Update the positions of the discoverers, joiners, and vigilantes; S24. Calculate the fitness values of each updated individual and the average fitness value of the entire population, determine whether Gaussian mutation and chaotic perturbation need to be introduced, and obtain the latest individuals, including: Randomly select the top pNum sparrows with the best fitness as discoverers, and the remaining as joiners, and randomly select sNum sparrows from the entire sparrow population as vigilantes; Based on the updated position information, recalculate the fitness value fi of each sparrow and the average fitness value favg of the sparrow population; When fi < favg, Gaussian mutation is performed. If the individual after mutation is better than the individual before mutation, the individual after mutation is used to replace the individual before mutation, otherwise the original individual remains unchanged; When fi >= favg, Sine chaotic perturbation is performed. If the individual after perturbation is better than the individual before perturbation, the individual after perturbation is used to replace the individual before perturbation, otherwise the original individual remains unchanged; S25. Add 1 to iter, and determine whether iter is greater than the preset number of iterations; if so, execute step S26, if not, return to step S22; S26. Output the current optimization result as the hyperparameters of the prediction model, and the hyperparameters include the learning rate, the number of iterations, the number of neurons in the first hidden layer, and the number of neurons in the second hidden layer; S27. Determine the optimal prediction model based on the output hyperparameters, and predict the total wax deposition under the current working conditions to obtain the prediction result of the total wax deposition under the current working conditions.

2. The method for predicting the total amount of wax deposition in a mixed pipeline according to claim 1, wherein: The method for obtaining the data set includes the following steps: Obtain the on-site actual data as the original data set, and the original data set includes the density of the pipeline fluid, the viscosity of the pipeline fluid, the oil flow temperature, the wall temperature, the liquid holdup rate, the pressure, and the total wax deposition; Process the original data set to obtain the training set and the test set, including: Determine a preset number of sample data sets, and each subset in the sample data set includes the density of the pipeline fluid, the viscosity of the pipeline fluid, the oil flow temperature, the wall temperature, the liquid holdup rate, the pressure, and the total wax deposition; Normalize the data in the dataset; Divide the normalized dataset into a training set and a test set according to a preset ratio.

3. The method for predicting the total amount of wax deposition in a mixed pipeline according to claim 1, wherein: Based on the constructed prediction model, establishing the fitness function of the improved sparrow search optimization algorithm means adding the mean square error between the prediction results corresponding to the training set and the actual data in the training set as the fitness function.

4. The method for predicting the total amount of wax deposition in a mixed pipeline according to claim 1, wherein: The position update formula of the discoverer is as follows: in, and Respectively represent i A sparrow in The number of iterations is +1 and The position information value at time ; represents the adaptive coefficient; represents the global optimal solution of the previous generation; Indicates the current iteration number; Indicates the maximum number of iterations; represents a random number, and ; represents the warning value, and ; represents a safe value, and ; represents random numbers that follow a normal distribution; Represents a single-row d-dimensional matrix, where each element inside is 1; The position update formula of the joiner is as follows: in, Indicates the position with the best fitness among the current discoverers, Indicates the position with the worst current global fitness; , represents a column vector with the same dimension as the individual sparrows, with internal elements consisting of random 1s and -1s; The position update formula of the vigilant is as follows: in, is the current global optimal position, is the step size control parameter, which is a random number that obeys a normal distribution with a mean of 0 and a variance of 1; is a random number, is the fitness value of the current sparrow individual, and are the current global best and worst fitness values, respectively. is a constant.

5. A mixed pipeline wax deposition total amount prediction system, characterized by: Include: A model construction module for constructing a total wax deposition prediction model for an additive multiphase pipeline based on a long short-term memory neural network; the prediction model consists of a double-layer unidirectional long short-term memory neural network layer, and the input parameters of the prediction model include the density of the pipeline fluid, the viscosity of the pipeline fluid, the oil flow temperature, the wall temperature, the liquid holdup rate and the pressure; the output parameter is the total wax deposition; A prediction module for optimizing the hyperparameters of the prediction model by using an improved sparrow search optimization algorithm based on Sine chaotic mapping and introducing Sine chaotic perturbation and Gaussian mutation based on the obtained dataset, and determining the optimal prediction model based on the optimized hyperparameters to predict the total wax deposition under the current working conditions, specifically: S21. Use Sine chaotic mapping for population initialization, and set iter = 1; where iter represents the number of iterations and iter is a positive integer; S22. Based on the constructed prediction model, establish the fitness function of the improved sparrow search optimization algorithm, and calculate the fitness of each individual in the population based on the obtained dataset and sort them in descending order; S23. Update the positions of the discoverer, joiner and vigilant; S24. Calculate the fitness values of each updated individual and the average fitness value of the entire population, determine whether Gaussian mutation and chaotic perturbation need to be introduced, and obtain the latest individuals, including: Randomly select the top pNum sparrows with the best fitness as discoverers, and the remaining as joiners, and randomly select sNum sparrows from the entire sparrow population as vigilants; Based on the updated position information, recalculate the fitness value fi of each sparrow and the average fitness value favg of the sparrow population; When fi < favg, then perform Gaussian mutation. If the individual after mutation is better than the individual before mutation, then replace the individual before mutation with the individual after mutation, otherwise keep the original individual unchanged; When fi >= favg, then perform Sine chaotic perturbation. If the individual after perturbation is better than the individual before perturbation, then replace the individual before perturbation with the individual after perturbation, otherwise keep the original individual unchanged; S25. Add 1 to iter, and judge whether iter is greater than the preset number of iterations; if so, execute step S26, if not, return to step S22; S26. Output the current optimization result as the hyperparameters of the prediction model, and the hyperparameters include the learning rate, the number of iterations, the number of neurons in the first hidden layer and the number of neurons in the second hidden layer; S27. Determine the optimal prediction model based on the output hyperparameters, predict the total wax deposition under the current working conditions, and obtain the prediction result of the total wax deposition under the current working conditions.

6. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the method for predicting the total amount of wax deposition in a mixed pipeline according to any one of claims 1 to 4.

7. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the method for predicting the total amount of wax deposition in a mixed pipeline according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Rolling bearing early fault intelligent diagnosis method based on improved sparrow search and acoustic emission

    CN114969995A

  • Crude oil pipeline wax deposition rate prediction method based on improved SSA-BPNN

    CN115017795A