Method and device for determining time lag of time-space fusion depth prediction model of high water content analyzer

By constructing an energy model and calculating the Shapley value, the optimal time lag order of the spatiotemporal fusion depth prediction model for the crude oil high water content analyzer is determined, which solves the problem of insufficient interpretability of the time lag determination method in the existing technology and improves the prediction accuracy and real-time monitoring effect.

CN120654087APending Publication Date: 2025-09-16DAQING OILFIELD CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410289885.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-14
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

The existing time lag determination method of the spatiotemporal fusion depth prediction model for crude oil high water content analyzers relies on human experience or information criteria, lacks interpretability, and results in low prediction accuracy.

Method used

By collecting the operating parameter data of the crude oil high water content analyzer, an energy model is constructed, and the contribution of each time lag order is determined using the Shapley value calculation formula. The optimal time lag order is selected to improve the prediction accuracy.

Benefits of technology

The accuracy of water content prediction results of high water content analyzers is improved, and the effectiveness and interpretability of real-time monitoring are achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120654087A_ABST
    Figure CN120654087A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of oil and gas metering, in particular to a method and a device for determining time lag of a time-space fusion depth prediction model of a high-water-content analyzer. The method comprises the following steps: training an established space-time fusion depth prediction model according to collected operation parameter data of the crude oil high water content analyzer within preset time; determining a Shapley value under each time delay order according to the constructed energy model and the prediction model; respectively determining the ratio of the Shapley value of each time delay order number; and finding a time delay order corresponding to a ratio value which is greater than or equal to a preset ratio and has a minimum difference value with the preset ratio in all the ratios as an optimal time delay order of the space-time fusion depth prediction model. The problems that an existing time lag determination method of a space-time fusion depth prediction model of a crude oil high water content analyzer depends on modes such as human experience or information criteria, the accuracy of time lag cannot be guaranteed, interpretability is lacked, and the precision of a prediction result is low are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of oil and gas metering, and in particular to a method and device for determining the time lag of a spatiotemporal fusion depth prediction model of a high water content analyzer. Background Art

[0002] To ensure the accuracy of high-water-content crude oil analyzers in oil and gas metering, the collected moisture meter data must be monitored during operation. Common monitoring methods include multivariate statistical analysis and univariate monitoring. Because the data collected by each moisture analyzer can be obtained in real time and has strong temporal correlation, a prediction solution based on an autoregressive model can effectively implement univariate monitoring of moisture analyzers.

[0003] With the development of deep learning, some deep learning-based time series prediction models have gained widespread attention in the field of process monitoring due to their ability to effectively predict future trends in time series data. Among deep learning-based time series prediction models, the autoregressive spatiotemporal fusion deep prediction model has been widely applied for its ability to handle the prediction of univariate data. For example, this spatiotemporal fusion deep prediction model can predict the water content of crude oil high-moisture analyzers and enable real-time monitoring of high-moisture analyzers by comparing the predicted and actual water content.

[0004] However, deep prediction models that combine spatiotemporal fusion require determining the model's time lag during prediction. Traditional methods often analyze data collected from actual operating conditions and manually determine the model's time lag based on practical factors such as the operating environment. In data-driven monitoring models, the order of the model's time lag is typically determined using the Akaike Information Criterion (AIC) or the Bayesian Information Criterion (BIC). However, these criteria fail to consider the contribution of time lags in determining the time lag, and therefore lack interpretability. In addition to ensuring good prediction accuracy for deep spatiotemporal fusion prediction models, it is also necessary to ensure that the determination of the model's time lag is interpretable. Summary of the Invention

[0005] The present invention proposes a method and device for determining the time lag of a spatiotemporal fusion depth prediction model for a high-water-content analyzer, in order to solve the problem that the existing method for determining the time lag of a spatiotemporal fusion depth prediction model for a high-water-content analyzer for crude oil relies on human experience or information criteria, the accuracy of the time lag cannot be guaranteed, and the model lacks interpretability, resulting in low accuracy of the prediction results.

[0006] According to one aspect of the present invention, a method for determining the time lag of a spatiotemporal fusion depth prediction model for a high water content analyzer is provided, comprising:

[0007] Collecting operating parameter data of the crude oil high water content analyzer within a predetermined time period, and training the established spatiotemporal fusion depth prediction model based on the operating parameter data to obtain a trained spatiotemporal fusion depth prediction model;

[0008] Constructing an energy model, and determining the Shapley value at each time lag order based on the energy model and the trained spatiotemporal fusion depth prediction model;

[0009] Determining the proportion of the Shapley value for each time delay order respectively;

[0010] Find the value that is greater than or equal to the predetermined proportion among all the proportions. Among all the proportion values ​​that are greater than or equal to the predetermined proportion, the time lag order corresponding to the proportion value with the smallest difference from the predetermined proportion is the optimal time lag order of the spatiotemporal fusion depth prediction model.

[0011] Preferably, the operating parameter data at least include: ambient temperature, pressure, crude oil flow rate and water content.

[0012] Preferably, the method of training the established spatiotemporal fusion depth prediction model according to the operating parameter data to obtain the trained spatiotemporal fusion depth prediction model includes:

[0013] Establish a spatiotemporal fusion depth prediction model;

[0014] Dividing the operating parameter data into a training set and a test set according to a predetermined ratio, and normalizing the data set;

[0015] The normalized training set and test set are used to train and test the spatiotemporal fusion depth prediction model to obtain a trained spatiotemporal fusion depth prediction model.

[0016] Preferably, the method of constructing an energy model and determining the Shapley value at each time lag order based on the energy model and the trained spatiotemporal fusion depth prediction model includes:

[0017] According to the energy model and the spatiotemporal fusion depth prediction model, the Shapley value calculation formula is used to determine the Shapley value at each time lag order;

[0018] The Shapley value calculation formula is:

[0019]

[0020] Where: φ irepresents the Shapley value of the i-th time lag, D is the set under p time lags, that is, D = {1, 2, ..., p}, |D| is the number of all subsets in the set D, S is a specific subset and S does not contain the i-th element, is the complement of S, |S| is the number of elements in set S, and h(·) is the spatiotemporal fusion depth prediction model.

[0021] Preferably, the energy model includes:

[0022]

[0023] Where: C is the energy function, θ is the parameter contained in this energy function, x S is the value of S corresponding to sample x, for The normalization parameter of .

[0024] Preferably, the loss function of the energy model is:

[0025]

[0026] Where: θ is the parameter included in the energy function, x S is the value of S corresponding to sample x, For a known x S Down The true conditional probability of For a known x S Down The generated conditional probability of .

[0027] Preferably, the method of respectively determining the proportion of the Shapley value of each time delay order includes:

[0028] Using formula (4), determine the proportion of the Shapley value of each time delay order;

[0029]

[0030] Where: CPV i is the proportion of Shapely values ​​at the i-th time lag, φ i represents the Shapley value of the i-th time lag.

[0031] Preferably, after obtaining the optimal time lag order, the water content of the high water content analyzer is predicted using the optimal time lag order, and the method includes:

[0032] The obtained optimal time lag order is substituted into the trained spatiotemporal fusion depth prediction model to predict the water content of the high water content analyzer to obtain a prediction result.

[0033] Preferably, the spatiotemporal fusion depth prediction model includes:

[0034]

[0035] Where: is the predicted value at time t, h(·) is the established spatiotemporal fusion deep prediction model, f(·) is the autoregressive gated recurrent unit, which is used to extract the temporal information in the data, and g(·) is the convolutional neural network, which is used to extract the spatial information in the data.

[0036] According to one aspect of the present invention, a device for determining the time lag of a spatiotemporal fusion depth prediction model for a high water content analyzer is provided, comprising:

[0037] A prediction model training unit is used to collect operating parameter data of the crude oil high water content analyzer within a predetermined time period, and train the established time-space fusion depth prediction model based on the operating parameter data to obtain a trained time-space fusion depth prediction model;

[0038] A Shapley value determination unit is used to construct an energy model and determine the Shapley value at each time lag order based on the energy model and the trained spatiotemporal fusion depth prediction model;

[0039] a proportion determining unit, configured to respectively determine the proportion of the Shapley value of each time delay order;

[0040] The optimal time lag determination unit is used to find a value greater than or equal to a predetermined proportion among all the proportions. Among all the proportion values ​​greater than or equal to the predetermined proportion, the time lag order corresponding to the proportion value with the smallest difference from the predetermined proportion is the optimal time lag order of the spatiotemporal fusion depth prediction model.

[0041] The present invention has at least the following beneficial effects:

[0042] This paper proposes a method and device for determining time lags in a spatiotemporal fusion depth prediction model for high-water-cut analyzers. This method determines the Shapley value for each time lag order, uses the Shapley value to determine the contribution of each time lag, and finally determines the optimal time lag based on the Shapley value ratio. This method is interpretable and can effectively improve the accuracy of water-cut prediction results, thereby enhancing the effectiveness of real-time monitoring by high-water-cut analyzers. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The accompanying drawings herein are incorporated into and constitute a part of the specification. These drawings illustrate embodiments consistent with the present invention and, together with the specification, are used to explain the technical solutions of the present invention.

[0044] Figure 1 A flow chart showing a method for determining the time lag of a spatiotemporal fusion depth prediction model for a high water content analyzer according to an embodiment of the present invention is shown;

[0045] Figure 2 A schematic diagram of the structure of a spatiotemporal fusion depth prediction model according to an embodiment of the present invention is shown;

[0046] Figure 3 A statistical diagram of Shapley values ​​under various time lags according to an embodiment of the present invention is shown;

[0047] Figure 4 A graph showing cumulative Shapley values ​​and 85% of Shapley value proportions according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0048] Various exemplary embodiments, features, and aspects of the present invention will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise indicated.

[0049] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0050] The term "and / or" herein simply describes an association relationship between associated objects, indicating that three relationships can exist. For example, "A and / or B" can represent the existence of three situations: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" herein refers to any combination of at least two of any one or more of a plurality of items. For example, "at least one of A, B, and C" can represent any one or more elements selected from the set consisting of A, B, and C.

[0051] In addition, numerous specific details are provided in the following detailed description to better illustrate the present invention. Those skilled in the art will appreciate that the present invention may be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art have not been described in detail in order to highlight the main points of the present invention.

[0052] Figure 1 A flow chart showing a method for determining the time lag of a spatiotemporal fusion depth prediction model for a high water content analyzer according to an embodiment of the present invention is shown; Figure 2 A schematic diagram of the structure of a spatiotemporal fusion depth prediction model according to an embodiment of the present invention is shown; Figure 3 A statistical diagram of Shapley values ​​under various time lags according to an embodiment of the present invention is shown; Figure 4: shows the cumulative Shapley value and the 85% Shapley value ratio according to an embodiment of the present invention. Figure 1-4 As shown, a method for determining the time lag of a spatiotemporal fusion depth prediction model for a high water content analyzer includes: step S01: collecting operating parameter data of a crude oil high water content analyzer within a predetermined time, and training the established spatiotemporal fusion depth prediction model according to the operating parameter data to obtain a trained spatiotemporal fusion depth prediction model; step S02: constructing an energy model, and determining the Shapley value under each time lag order according to the energy model and the trained spatiotemporal fusion depth prediction model; step S03: respectively determining the proportion of the Shapley value for each time lag order; step S04: finding a value greater than or equal to a predetermined proportion among all the proportions, and the time lag order corresponding to the proportion value with the smallest difference from the predetermined proportion among all the proportion values ​​greater than or equal to the predetermined proportion is the optimal time lag order of the spatiotemporal fusion depth prediction model.

[0053] The method for determining the time lag of the spatiotemporal fusion depth prediction model for a high water content analyzer provided in an embodiment of the present invention specifically includes the following steps:

[0054] Step S01: collecting operating parameter data of a crude oil high water content analyzer within a predetermined time period, and training an established spatiotemporal fusion depth prediction model based on the operating parameter data to obtain a trained spatiotemporal fusion depth prediction model.

[0055] In the present invention, the operating parameter data at least include: ambient temperature, pressure, crude oil flow rate and water content.

[0056] In the present invention, the method of training the established spatiotemporal fusion depth prediction model according to the operating parameter data to obtain the trained spatiotemporal fusion depth prediction model includes: establishing the spatiotemporal fusion depth prediction model; dividing the operating parameter data into a training set and a test set according to a predetermined ratio, and normalizing the data set; using the normalized training set and test set to train and test the spatiotemporal fusion depth prediction model to obtain the trained spatiotemporal fusion depth prediction model.

[0057] In the embodiment of the present invention, before training the established spatiotemporal fusion depth prediction model, the collected operating parameter data needs to be divided into a training set x train and the test set x test , the division ratio of the training set and the test set is 70% and 30% respectively. The training set and test set data after division are uniformly normalized, wherein the normalization formula includes:

[0058]

[0059] Where: is the normalized data, x min is the minimum value of the collected data, x max is the maximum value among the collected data.

[0060] Establishing a spatiotemporal fusion depth prediction model includes:

[0061] An autoregressive prediction model (Formula (7)) is established, assuming that the order of the autoregressive model is p and t is the time series index of the data x.

[0062]

[0063] Where: f(·) is a specific depth prediction model that uses the historical data points x of the high water content analyzer. t-1 ,x t-2 ,...,x t-p To get the predicted value at time t

[0064] Among the many deep prediction models, neural networks based on gated recurrent units (GRUs) have attracted widespread attention due to their ability to capture dynamic information from historical data. These models also have a small number of parameters and are fast to train. Therefore, GRUs can be used as a deep prediction model to perform time prediction for crude oil high-water-cut analyzers.

[0065] During the normal operation of the crude oil high water content analyzer, there are also some environmental variables and flow variables that affect the water content value of the water content analyzer, including u1, u2, u3, ..., u n , such as ambient temperature, pressure, crude oil flow rate and other influencing factors. In order to improve the prediction accuracy of the model and realize spatiotemporal prediction, these variables are passed into the convolutional neural network g(·) for feature extraction, and the time prediction results of the gated cycle unit of the crude oil water content analyzer are flattened and spliced. Then, the fully connected neural network is used to output the final prediction result, which is the spatiotemporal fusion prediction result. The process is as follows Figure 2 As shown, Figure 2 Where t is the number of GRUs, r is the reset gate, z is the update gate, and W r To reset the gate parameters, W z is the update gate parameter, σ is the sigmoid activation function, tanh is the activation function, h is the output state, W h is the state parameter, is the updated state. The entire spatiotemporal fusion depth prediction model can be expressed as:

[0066] In the present invention, the spatiotemporal fusion depth prediction model includes:

[0067]

[0068] Where: is the predicted value at time t, h(·) is the established spatiotemporal fusion deep prediction model, f(·) is the autoregressive gated recurrent unit, which is used to extract the temporal information in the data, and g(·) is the convolutional neural network, which is used to extract the spatial information in the data.

[0069] The normalized training set data is input into the established spatiotemporal fusion depth prediction model to train the model, and the normalized test set data is used to test the model, and finally the trained spatiotemporal fusion depth prediction model is obtained.

[0070] Step S02: constructing an energy model, and determining the Shapley value at each time lag order based on the energy model and the trained spatiotemporal fusion depth prediction model.

[0071] In the present invention, the method of constructing an energy model and determining the Shapley value at each time lag order based on the energy model and the trained spatiotemporal fusion depth prediction model includes: determining the Shapley value at each time lag order using a Shapley value calculation formula based on the energy model and the spatiotemporal fusion depth prediction model;

[0072] The Shapley value calculation formula is:

[0073]

[0074] Where: φ i represents the Shapley value of the i-th time lag, D is the set under p time lags, that is, D = {1, 2, ..., p}, |D| is the number of all subsets in the set D, S is a specific subset and S does not contain the i-th element, is the complement of S, |S| is the number of elements in set S, and h(·) is the spatiotemporal fusion depth prediction model.

[0075] In the embodiment of the present invention, formula (1) represents the weighted sum of the difference between the model prediction values ​​calculated from the other variables after removing the variable with the i-th time lag and the model prediction values ​​calculated from these variables after adding the i-th time lag variable. This weighted sum can be used to describe the contribution of each time lag. Where h(S) can be expressed as:

[0076]

[0077] Where: E[.] represents the expectation, K is the number of sampling times, is the conditional probability, x Sis the value of S corresponding to the sample x, and d is the differential sign.

[0078] Formula (1-1) is expressed as S Under known conditions, that is, under the condition that the variable set S is known, the size of h(S).

[0079] However, directly using formula (1) to calculate the Shapley value of each time lag will be affected by the curse of dimensionality. In order to effectively solve this problem, a Shapley value estimation method based on the energy model is proposed. The energy model can be specifically expressed as:

[0080] In the present invention, the energy model includes:

[0081]

[0082] Where: C is the energy function, θ is the parameter contained in this energy function, x S is the value of S corresponding to sample x, for The normalization parameter of .

[0083] In the embodiment of the present invention, formula (2) can be used to estimate Thus, h(S) and the Shapley value of the corresponding time lag are calculated.

[0084] It is very difficult to directly calculate the normalization parameter in formula (2), so it is necessary to estimate the normalization parameter through the importance sampling method. That is, using a proposed conditional distribution Approximating the true conditional distribution Thus calculate The specific expressions are as follows:

[0085]

[0086] Where: C is the energy function, θ is the parameter contained in this energy function, x S is the value of S corresponding to sample x, d is the differential sign, and K is the number of sampling times.

[0087] Generally speaking, the proposed conditional distribution The closer to the true conditional distribution In the present invention, the mixed Gaussian model is used as the proposed conditional distribution Models are adapted to mixture distributions of different data.

[0088] In order for the energy model proposed by formula (2) to calculate the conditional probability distribution of any set of time delays, the combination of time delay sets must be arbitrary. Therefore, the loss function of the energy model can be expressed as follows:

[0089] In the present invention, the loss function of the energy model is:

[0090]

[0091] Where: θ is the parameter included in the energy function, x S is the value of S corresponding to sample x, For a known x S Down The true conditional probability of For a known x S Down The generated conditional probability of .

[0092] In this embodiment of the present invention, the energy model obtained by formula (2) is trained using formula (3) to estimate the conditional distribution of different time-lag combinations, thereby calculating the Shapley value of each time-lag. In particular, because the proposed energy model calculates the conditional probability distribution of all variable combinations, there is no need to repeatedly train the energy model during subsequent testing. Instead, the Shapley value of each time-lag can be calculated by simply inputting the relevant variable combinations and corresponding sample points into the energy model.

[0093] Step S03: respectively determining the proportion of the Shapley value of each time delay order.

[0094] In the present invention, the method of respectively determining the proportion of the Shapley value of each time delay order includes: using formula (4) to determine the proportion of the Shapley value of each time delay order;

[0095]

[0096] Where: CPV i is the proportion of Shapely values ​​at the i-th time lag, φ i represents the Shapley value of the i-th time lag.

[0097] Step S04: Find the value that is greater than or equal to the predetermined proportion among all the proportions. Among all the proportion values ​​that are greater than or equal to the predetermined proportion, the time lag order corresponding to the proportion value with the smallest difference from the predetermined proportion is the optimal time lag order of the spatiotemporal fusion depth prediction model.

[0098] In the embodiment of the present invention, the optimal time lag can be determined based on the determined Shapley proportion. Specifically, the optimal proportion is set to α (predetermined proportion), and then the variables with the highest Shapley value proportion are sorted downwards and accumulated, that is, formula (4), to obtain the proportion corresponding to each time lag; when the proportion CPV of a certain time lag order isi If the ratio α is reached or just exceeded, it means that the time delay is the optimal time delay.

[0099] In the present invention, after obtaining the optimal time lag order, the water content of the high water content analyzer is predicted using the optimal time lag order. The method includes: substituting the obtained optimal time lag order into the trained spatiotemporal fusion deep prediction model, predicting the water content of the high water content analyzer, and obtaining a prediction result.

[0100] In an embodiment of the present invention, after the optimal time lag is determined, the time lag order is substituted back into the established time-space fusion depth prediction model to calculate the predicted data of the crude oil high water content analyzer, thereby realizing real-time monitoring of the high water content analyzer.

[0101] In the embodiment of the present invention, the actual working process of a high-water analyzer in a certain oil field is taken as an example. The average water content of the crude oil is approximately 70%, with a total of 1,000 sample points, of which the first 700 sample points are used as training samples (training set) of the model, and the last 300 sample points are used as test samples (test set) of the model.

[0102] Formula (6) is used to normalize the training samples and test samples.

[0103] A spatiotemporal fusion depth prediction model is established, the initial time lag order p is set to 10, and the spatiotemporal fusion depth prediction model is trained using the training set and the test set based on the time lag order of 10.

[0104] Construct an energy model and use it to calculate the Shapley value of each time lag of the trained spatiotemporal fusion depth prediction model. These Shapley values ​​are used as the contribution value of each time lag to the entire depth prediction model. The results are as follows: Figure 3 shown.

[0105] The time lag corresponding to the Shapley value ratio of 85% is set as the optimal time lag (predetermined ratio), that is, the predetermined ratio value; the Shapley value ratios of each time lag are calculated and accumulated in order from large to small, that is, formula (4); the time lag order corresponding to the ratio that is greater than or equal to the predetermined ratio and closest to the predetermined ratio is determined as the optimal time lag.

[0106] The corresponding proportions of each time delay order are obtained as follows: Figure 4 As shown, Figure 4 The lag orders corresponding to a proportion greater than or equal to 85% are 7 to 10, among which the lag order corresponding to the proportion value with the smallest difference from the predetermined proportion is 7. That is, after the 7th lag is accumulated, the overall Shapley value exceeds 85% of the predetermined proportion, indicating that the optimal lag order is 7.

[0107] It can be understood that the above-mentioned various method embodiments mentioned in the present invention can be combined with each other to form combined embodiments without violating the principle logic. Due to space limitations, the present invention will not elaborate on them.

[0108] The execution subject of the method for determining the time lag of the spatiotemporal fusion depth prediction model of a high water content analyzer may be a device for determining the time lag of the spatiotemporal fusion depth prediction model of a high water content analyzer. For example, the method for determining the time lag of the spatiotemporal fusion depth prediction model of a high water content analyzer may be executed by a terminal device or a server or other processing device, wherein the terminal device may be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. In some possible implementations, the method for determining the time lag of the spatiotemporal fusion depth prediction model of a high water content analyzer may be implemented by a processor calling computer-readable instructions stored in a memory.

[0109] Those skilled in the art will understand that in the above-mentioned method of the specific implementation method, the writing order of each step does not mean a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0110] In the present invention, a time lag determination device for a spatiotemporal fusion depth prediction model of a high water content analyzer includes: a prediction model training unit, used to collect operating parameter data of a crude oil high water content analyzer within a predetermined time, and train the established spatiotemporal fusion depth prediction model based on the operating parameter data to obtain a trained spatiotemporal fusion depth prediction model; a Shapley value determination unit, used to construct an energy model, and determine the Shapley values ​​under each time lag order based on the energy model and the trained spatiotemporal fusion depth prediction model; a proportion determination unit, used to respectively determine the proportion of the Shapley values ​​of each time lag order; an optimal time lag determination unit, used to find a value greater than or equal to a predetermined proportion among all the proportions, and the time lag order corresponding to the proportion value with the smallest difference from the predetermined proportion among all the proportion values ​​greater than or equal to the predetermined proportion is the optimal time lag order of the spatiotemporal fusion depth prediction model.

[0111] In some embodiments, the functions or modules and units included in the device provided by the embodiment of the present invention can be used to execute the method described in the above method embodiment. Its specific implementation can refer to the description of the above method embodiment. For the sake of brevity, it will not be repeated here.

[0112] The spatiotemporal fusion deep prediction model is a key model in the time series prediction model. With the rise of deep learning models, the spatiotemporal fusion deep prediction model has also gradually merged with the deep learning model. In order to be able to more reasonably explain and determine the time lag in the spatiotemporal fusion deep prediction model, the present invention takes the Shapley value as the basis for determining the time lag from the perspective of a cooperative game. By analyzing the Shapley size of each time lag in the deep prediction model, the contribution of each time lag is determined to determine the time lag of the overall prediction model, so that a model with a smaller number of parameters can be constructed to obtain more accurate crude oil high water content analyzer prediction results. However, the computational complexity of the Shapley value will increase exponentially with the increase of the variable dimension. In order to improve the estimation efficiency of the Shapley value, the present invention uses an energy model to estimate the conditional distribution between each variable, and calculates the Shapley value through the conditional distribution to improve the computational efficiency. The method of the present invention can effectively solve the problem of time lag uncertainty in the spatiotemporal fusion deep prediction model, and proposes a feasible solution for the time lag calculation method of the spatiotemporal fusion deep prediction model. At the same time, this method is also applicable to the determination of the time lag order of all deep prediction models containing autoregression, and has important development significance for promoting industrial big data technology, especially oil and gas metering technology.

[0113] By adopting the above solution, the method was deployed in the working status monitoring system of a crude oil high-water content analyzer. A spatiotemporal fusion deep prediction model based on the fusion of long-short-term memory neural networks and convolutional neural networks was established. The time lag of the crude oil high-water content analyzer was determined, thereby reducing model parameters and computation time. After modifying the proportion, the model prediction goodness of fit reached 94.25%, greatly improving the model prediction performance and ensuring the smooth operation of crude oil production. In addition, the method of the present invention was also applied to the anomaly identification of tobacco moisture meters used extensively on a company's cigarette production line. For the spatiotemporal fusion deep prediction model used in the cigarette production process, the prediction goodness of fit reached 95.85% after modifying the time lag parameter.

[0114] While various embodiments of the present invention have been described above, the above descriptions are intended to be illustrative, non-exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is selected to best explain the principles of the embodiments, their practical applications, or technological improvements in the marketplace, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A method for determining the time lag of a spatiotemporal fusion depth prediction model for a high water content analyzer, characterized in that: include: Collecting operating parameter data of the crude oil high water content analyzer within a predetermined time period, and training the established spatiotemporal fusion depth prediction model based on the operating parameter data to obtain a trained spatiotemporal fusion depth prediction model; Constructing an energy model, and determining the Shapley value at each time lag order based on the energy model and the trained spatiotemporal fusion depth prediction model; Determining the proportion of the Shapley value for each time delay order respectively; Find the value that is greater than or equal to the predetermined proportion among all the proportions. Among all the proportion values ​​that are greater than or equal to the predetermined proportion, the time lag order corresponding to the proportion value with the smallest difference from the predetermined proportion is the optimal time lag order of the spatiotemporal fusion depth prediction model.

2. The method for determining the time lag of the spatiotemporal fusion depth prediction model for a high water content analyzer according to claim 1, characterized in that: The operating parameter data at least include: ambient temperature, pressure, crude oil flow rate and water content.

3. The method for determining the time lag of the spatiotemporal fusion depth prediction model of a high water content analyzer according to claim 1, characterized in that: The method of training the established spatiotemporal fusion depth prediction model according to the operating parameter data to obtain the trained spatiotemporal fusion depth prediction model includes: Establish a spatiotemporal fusion depth prediction model; Dividing the operating parameter data into a training set and a test set according to a predetermined ratio, and normalizing the data set; The normalized training set and test set are used to train and test the spatiotemporal fusion depth prediction model to obtain a trained spatiotemporal fusion depth prediction model.

4. The method for determining the time lag of the spatiotemporal fusion depth prediction model of a high water content analyzer according to claim 1, characterized in that: The method of constructing an energy model and determining the Shapley value at each time lag order based on the energy model and the trained spatiotemporal fusion depth prediction model includes: According to the energy model and the spatiotemporal fusion depth prediction model, the Shapley value calculation formula is used to determine the Shapley value at each time lag order; The Shapley value calculation formula is: Where: φ i represents the Shapley value of the i-th time lag, D is the set under p time lags, that is, D = {1, 2, ..., p}, |D| is the number of all subsets in the set D, S is a specific subset and S does not contain the i-th element, is the complement of S, |S| is the number of elements in set S, and h(·) is the spatiotemporal fusion depth prediction model.

5. The method for determining the time lag of the spatiotemporal fusion depth prediction model of a high water content analyzer according to any one of claims 1 to 4, characterized in that: The energy model includes: Where: C is the energy function, θ is the parameter contained in this energy function, x S is the value of S corresponding to sample x, for The normalization parameter of .

6. The method for determining the time lag of the spatiotemporal fusion depth prediction model of a high water content analyzer according to claim 5, characterized in that: The loss function of the energy model is: Where: θ is the parameter included in the energy function, x S is the value of S corresponding to sample x, For a known x S Down The true conditional probability of For a known x S Down The generated conditional probability of .

7. The method for determining the time lag of the spatiotemporal fusion depth prediction model of a high water content analyzer according to claim 1, characterized in that: The method of respectively determining the proportion of the Shapley value of each time delay order includes: Using formula (4), determine the proportion of the Shapley value of each time delay order; Where: CPV i is the proportion of Shapely values ​​at the i-th time lag, φ i represents the Shapley value of the i-th time lag.

8. The method for determining the time lag of the spatiotemporal fusion depth prediction model for a high water content analyzer according to any one of claims 1 to 4, 6 to 7, characterized in that: After obtaining the optimal time lag order, the water content of the high water content analyzer is predicted using the optimal time lag order, and the method includes: The obtained optimal time lag order is substituted into the trained spatiotemporal fusion depth prediction model to predict the water content of the high water content analyzer to obtain a prediction result.

9. The method for determining the time lag of the spatiotemporal fusion depth prediction model of a high water content analyzer according to claim 8, characterized in that: The spatiotemporal fusion depth prediction model includes: Where: is the predicted value at time t, h(·) is the established spatiotemporal fusion deep prediction model, f(·) is the autoregressive gated recurrent unit, which is used to extract the temporal information in the data, and g(·) is the convolutional neural network, which is used to extract the spatial information in the data.

10. A device for determining the time lag of a spatiotemporal fusion depth prediction model for a high water content analyzer, characterized in that: include: A prediction model training unit is used to collect operating parameter data of the crude oil high water content analyzer within a predetermined time period, and train the established time-space fusion depth prediction model based on the operating parameter data to obtain a trained time-space fusion depth prediction model; A Shapley value determination unit is used to construct an energy model and determine the Shapley value at each time lag order based on the energy model and the trained spatiotemporal fusion depth prediction model; a proportion determining unit, configured to respectively determine the proportion of the Shapley value of each time delay order; The optimal time lag determination unit is used to find a value greater than or equal to a predetermined proportion among all the proportions. Among all the proportion values ​​greater than or equal to the predetermined proportion, the time lag order corresponding to the proportion value with the smallest difference from the predetermined proportion is the optimal time lag order of the spatiotemporal fusion depth prediction model.