Production data prediction method and system based on large model
By introducing the Transformer model of Block and multi-head two-way self-attention mechanism in the production process such as oilfield collection and transportation, the problems of difficulty in parameter estimation and limited complex dynamic processing capabilities in the existing technology are solved, and efficient and accurate for complex production systems are achieved. Predictive and real-time learning ability.
Patent Information
- Application Number
- CN202411147344.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-08-21
AI Technical Summary
The prior art has problems such as difficulty in predicting production process data such as oilfield collection and transportation, such as oilfield collection and transportation, such as problems, limited ability to deal with complex dynamics, sensitivity to outliers, lack of real-time learning ability and limited ability to predict new forms in the future.
Using a large model-based production data prediction method, the Transformer model with Block and multi-head bidirectional self-attention mechanism is introduced to obtain historical data and predict future data. The pipeline input and output positions of each device to be monitored in the model correspond to one. Block, uses the multi-head bidirectional self-attention mechanism to capture long-term nonlinear dependence and outliers' anti-interference ability.
It realizes efficient and accurate prediction of complex production systems, can capture nonlinear dependence in long-term time series, improves anti-interference ability to outliers, has real-time learning and personalized customization capabilities, and is suitable for prediction of complex dynamic environments.
Smart Images

Figure CN118657178B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of production data prediction, and in particular to a production data prediction method and system based on a large model. Background Art
[0002] The statements in this section merely provide background art related to the present invention and do not necessarily constitute prior art.
[0003] Data prediction based on time series has been widely used in various fields. There are also many prediction models, such as sliding average model, autoregressive model, autoregressive moving average model and autoregressive integrated moving average model, etc. The sliding average model only considers the random disturbance of past observations for prediction, which is suitable for scenarios where the trend in the data is mainly caused by random fluctuations; the autoregressive model predicts the current value based on the linear combination of observations of several periods in the past, which is particularly suitable for processing sequences with autocorrelation characteristics; the autoregressive moving average model combines the characteristics of the autoregressive model and the moving average model, considering both the influence of past observations and the influence of past error terms; the autoregressive integrated moving average model adds a difference link on the basis of the autoregressive moving average model to process non-stationary time series and convert them into stationary series for prediction.
[0004] However, the existing technologies represented by the above prediction models have the following problems when predicting production process data such as oil field gathering and transportation:
[0005] (1) Parameter estimation is difficult. Determining the optimal parameters of the model usually relies on empirical judgment and statistical tests. This process may be subjective and uncertain, especially for complex nonlinear relationships or data with multiple periods. (2) Strict assumptions. Many traditional models, such as the autoregressive integrated moving average model, require that the time series must be stationary. If not, it needs to be converted into a stationary series through means such as differentiation, which may lead to information loss. (3) Limited ability to handle complex dynamics. Traditional models may not work well when dealing with time series containing nonlinear trends, long-range dependencies or complex periodicities. (4) Sensitive to outliers. Traditional models are often sensitive to outliers or noise values in time series. These outliers or noise values may significantly affect the model's fitting effect and prediction accuracy. (5) Lack of real-time learning capabilities. Traditional models usually use static model parameters and cannot adapt to the changing characteristics of data in real time. They have poor adaptability to the environment of dynamic data evolution. (6) Limited ability to predict new forms in the future. When trends or patterns that are significantly different from the distribution of historical data appear in the future, traditional models are difficult to flexibly adjust to adapt to new changes.
[0006] In order to overcome the above problems, some technicians use LSTM model or GRU model. As a variant of recurrent neural network (RNN), LSTM updates its internal state sequentially and does not support large-scale parallel computing, which limits the training speed and hardware utilization. Moreover, LSTM is designed to alleviate the long-distance dependency problem, but in very long sequences, its ability to capture long-distance dependencies is still limited and is susceptible to gradient vanishing or gradient exploding. As the depth of LSTM increases, the optimization difficulty and gradient propagation problems may also become more serious. Summary of the invention
[0007] In order to address the deficiencies of the prior art, the present invention provides a production data prediction method and system based on a large model, which achieves accurate and efficient prediction of production data by introducing Block and Transformer with multi-head bidirectional self-attention mechanism.
[0008] In order to achieve the above object, the present invention adopts the following technical solution:
[0009] In a first aspect, the present invention provides a production data prediction method based on a large model.
[0010] A production data prediction method based on a large model includes the following processes:
[0011] Obtain historical data of the production process before the current moment;
[0012] Based on the historical data before the current moment and the improved Transformer model, the production data at a future moment after the current moment is obtained;
[0013] Among them, the improved Transformer model includes: introducing multi-head bidirectional self-attention in the encoder, the monitoring data of the pipeline input position and the monitoring data of the pipeline output position of each monitored equipment in the production system correspond to a Block respectively, each Block corresponds to at least one measuring point, and each Block generates a Token.
[0014] As a further limitation of the first aspect of the present invention, the equipment to be monitored includes: one or more of a three-phase separator, a buffer tank, a crude oil dehydration pump, a heating furnace, a settling tank, an electric dehydrator, a purified oil tank, a crude oil export pump and an export heating furnace.
[0015] As a further limitation of the first aspect of the present invention, each Block corresponds to a weight vector, and the weight vector is determined by:
[0016] If there are N devices in total, each device has an inlet and an outlet, oil and water enter from device 0 and finally exit from device N-1, then the total number of blocks is 2N, Block_count=2N;
[0017] Block_id ranges from 0 to N-1. If the block whose data needs to be predicted is at position_x,
[0018] When Block_id_s ≥ x, then: the weight of Block_id_s = position_x + Block_count - Block_id_s;
[0019] When Block_id_s<x, then: the weight of Block_id_s = Block_id_s + Block_count – position_x;
[0020] The weight of the obtained Block_id_s is normalized to between 0 and 1, where Block_id_s is a non-x number between 0 and N-1.
[0021] As a further limitation of the first aspect of the present invention, the measuring point is the monitoring data of the pipeline input position of the monitored equipment or the monitoring data of the pipeline output position directly collected; or, the measuring point is the data calculated based on the monitoring data.
[0022] In a second aspect, the present invention provides a production data prediction system based on a large model.
[0023] A production data prediction system based on a large model, comprising:
[0024] The data acquisition unit is configured to: acquire historical data before the current moment of the production process;
[0025] The data prediction unit is configured to: obtain production data at a future moment after the current moment based on the acquired historical data before the current moment and the improved Transformer model;
[0026] Among them, the improved Transformer model includes: introducing multi-head bidirectional self-attention in the encoder, the monitoring data of the pipeline input position and the monitoring data of the pipeline output position of each monitored equipment in the production system correspond to a Block respectively, each Block corresponds to at least one measuring point, and each Block generates a Token.
[0027] As a further limitation of the second aspect of the present invention, in the data prediction unit, the equipment to be monitored includes: one or more of a three-phase separator, a buffer tank, a crude oil dehydration pump, a heating furnace, a settling tank, an electric dehydrator, a purified oil tank, a crude oil export pump and an export heating furnace.
[0028] As a further limitation of the second aspect of the present invention, in the data prediction unit, each Block corresponds to a weight vector, and the weight vector is determined by:
[0029] If there are N devices in total, each device has an inlet and an outlet, oil and water enter from device 0 and finally exit from device N-1, then the total number of blocks is 2N, Block_count=2N;
[0030] Block_id ranges from 0 to N-1. If the block whose data needs to be predicted is at position_x,
[0031] When Block_id_s ≥ x When: Block_id_s weight = position_x + Block_count - Block_id_s;
[0032] When Block_id_s< x When: The weight of Block_id_s = Block_id_s + Block_count – position_x;
[0033] The weight of the obtained Block_id_s is normalized to between 0 and 1, where Block_id_s is a non-zero value between 0 and N-1. x The number of.
[0034] In a third aspect, the present invention provides a computer device, comprising: a processor and a computer-readable storage medium;
[0035] a processor adapted to execute a computer program;
[0036] A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by the processor, the production data prediction method based on the large model as described in the first aspect of the present invention is implemented.
[0037] In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program is suitable for being loaded by a processor and executing the large model-based production data prediction method as described in the first aspect of the present invention.
[0038] In a fifth aspect, the present invention provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the production data prediction method based on a large model as described in the first aspect of the present invention.
[0039] Compared with the prior art, the present invention has the following beneficial effects:
[0040] 1. The multi-head self-attention mechanism of the present invention can consider all positions of the input sequence simultaneously and effectively capture nonlinear dependencies in long-term time series, which is crucial for understanding and predicting the complex dynamic behaviors of production systems, such as production fluctuations over time and equipment aging trends.
[0041] 2. The bidirectional self-attention mechanism of the present invention enables the model to consider past and future contextual information at the same time, which is very helpful for understanding the prediction of future development trends of the production process, and can effectively predict the operating status and efficiency of the gathering and transportation system in a certain period of time in the future.
[0042] 3. The present invention introduces the Transformer with Block and multi-head bidirectional self-attention mechanism, which extracts different types of features through multiple parallel self-attention heads, thereby improving the anti-interference ability against outliers, noise and other uncertain factors. This has good adaptability to fluctuations caused by factors such as sudden failures that may occur in the production system.
[0043] 4. The present invention can efficiently process large-scale data. The model uses the advantages of parallel computing to quickly process massive monitoring data, thereby achieving efficient online monitoring and prediction.
[0044] 5. The present invention can realize personalized customization. Combined with the characteristics of a specific production system, the model can be expanded and adjusted to make refined predictions on the operating data of different levels, different areas, and even a single device, such as energy consumption prediction, equipment maintenance cycle prediction, and pipeline blockage risk warning.
[0045] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0047] Figure 1 A schematic diagram of the arrangement of various measuring points provided in Example 1 of the present invention;
[0048] Figure 2A schematic diagram of Token generation provided in Example 1 of the present invention;
[0049] Figure 3 A schematic diagram of the overall workflow of the Transformer that introduces Block and multi-head bidirectional self-attention mechanism provided in Example 1 of the present invention;
[0050] Figure 4 A schematic diagram of an encoder provided in Embodiment 1 of the present invention;
[0051] Figure 5 Schematic diagram of a decoder provided in Embodiment 1 of the present invention
[0052] Figure 6 A schematic diagram of multi-head bidirectional self-attention provided in Example 1 of the present invention;
[0053] Figure 7 Schematic diagram of masked multi-head self-attention provided in Example 1 of the present invention. DETAILED DESCRIPTION
[0054] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0055] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0056] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.
[0057] Embodiment 1:
[0058] Transformer has completely changed the paradigm of sequence-to-sequence learning through its unique self-attention mechanism, replacing previous models such as RNN (recurrent neural network) and LSTM that rely on sequence recursive structures, and has achieved significant improvements in various NLP tasks such as text translation, text generation, text summarization, and question-answering systems. Because Transformer cannot be directly applied to the field of intelligent manufacturing, some improvements are still needed. Therefore, this implementation proposes a data prediction method for the intelligent manufacturing field of Transformer that introduces Block and multi-head bidirectional self-attention mechanism. Specifically, it includes the following processes:
[0059] S1: Obtain historical measurement point data before the current moment of the production process;
[0060] S2: Based on the historical data before the current moment and the improved Transformer model, the production data at a future moment after the current moment is obtained.
[0061] In this implementation, some of the measuring points are data collected by sensors or meters, and some are measuring point data obtained by calculating basic data.
[0062] Specifically, according to the flow path of crude oil, each device has an inlet position and an outlet position. There are meters and sensors at the inlet position and meters and sensors at the outlet position. Therefore, the collected data and calculated data of the meters and sensors at the inlet position are one type of measuring point, and the collected data and calculated data of the meters and sensors at the outlet position are another type of measuring point.
[0063] A large number of equipment are required in the production process. For example, the incoming liquid passes through a three-phase separator, a buffer tank, a crude oil dehydration pump, a heating furnace, a settling tank, an electric dehydrator, a purified oil tank, a crude oil export pump and an export heating furnace, etc. The processes of different joint stations are different, and the equipment that the crude oil passes through in sequence is different. This is only an illustration and is not a specific limitation.
[0064] The measuring points in this implementation are numerical values obtained through calculation or collection. Taking the sedimentation tank as an example, the following contents may be included: flow rate entering the tank, water content of the liquid entering the tank, pressure of the liquid entering the tank, temperature of the liquid entering the tank, ambient temperature, outlet oil-water flow rate, oil phase water content at the outlet, fluid temperature at the outlet, fluid pressure at the outlet, sewage flow rate, sewage oil content, sewage temperature, sewage pressure, tank height, tank diameter, total heat transfer coefficient of the tank top, total heat transfer coefficient of the tank bottom, total heat transfer coefficient of the tank side, etc.
[0065] like Figure 1 As shown, two measuring points are set at the inlet of the three-phase separator (i.e., measuring point 1 and measuring point 2, and a padding is set), three measuring points are set at the outlet of the three-phase separator (i.e., measuring point 1, measuring point 2 and measuring point 3), two measuring points are set at the inlet of the buffer tank (i.e., measuring point 1 and measuring point 2, and a padding is set), and one measuring point is set at the inlet of the buffer tank (i.e., measuring point 1, and two paddings are set).
[0066] like Figure 2As shown in the figure, the role of end is to distinguish each Block. Each Block contains different measurement points, which verifies the prediction effect of the processing methods of Blocks of the same scale and Blocks of different scales. What is different from the general practice is that in this implementation, one Block generates one Token, rather than one measurement point data generating one Token. The Token is also the position vector. The number of Tokens input to the Transformer encoder is reduced, thereby reducing the spatial and temporal complexity of the model. In the data sequence of this implementation, the first column is time, so the time series of the first column is an independent Block and also generates a Token.
[0067] like Figure 3 As shown in the figure, weights are assigned to each Block. For example, to predict a liquid level measurement point in Block3, the weights of Block2 and Block4 are larger. The strongly correlated data of the equipment measurement points adjacent to the liquid level data of Block3 include inlet flow, outlet flow, etc. The farther away from Block3, the smaller the weight. The original Transformer uses Token embedding and position vector before entering the encoder. This implementation adopts Token embedding, position encoding, time embedding and Block weight encoding.
[0068] Specifically, the method of assigning weights to each Block includes:
[0069] First, the data samples of this implementation are generally presented in a table format. The first column is time, and the second column and onwards are the data of each measurement point. A Block may include multiple measurement points (that is, each Block may include multiple columns of data). The original time series is divided into Blocks according to the method defined by the above device, and padding is added to fill in the missing blocks.
[0070] The arrangement order of the devices is the actual operation process of the joint station devices, such as device 1, device 2, device 3, ..., device N;
[0071] Regarding the weight of each Block, if you want to predict a measurement point in Block 4 at the exit of device 2, you need to ensure that the weight relationship of each Block is as follows:
[0072] The block weight of the device 2 export > the block weight of the device 2 import > the block weight of the device 1 export > the block weight of the device 1 import;
[0073] The block weight of device 2's egress> the block weight of device 3's ingress> the block weight of device 3's egress> the block weight of device 4's ingress>...> the block weight of device N's ingress> the block weight of device N's egress;
[0074] If there are 4 devices in total, each device has an inlet and an outlet, oil and water enter from device 0 and finally exit from device 3, then the total number of blocks is 8, Block_count = 8;
[0075] Block_id ranges from 0 to 7. If the block whose data needs to be predicted is at position 3,
[0076] There are two situations:
[0077] When Block_id_s ≥ 3, then: Block_id_s weight = position 3 + Block_count - Block_id_s;
[0078] When Block_id_s<3, then: the weight of Block_id_s = Block_id_s + Block_count – position 3;
[0079] Finally, it is normalized to between 0 and 1.
[0080] For the measurement points, one attention head is from back to front, and the other attention head is from front to back, focusing on all the measurement points. The original Transformer is designed for sequence generation tasks, and must follow the order of input sequence and output sequence. It is similar to a unidirectional (back-to-front) model, which mainly focuses on generating the next measurement point data given the previous one. All input sequences of the modified model are considered known, and the model is modified to be bidirectional. Because the entire operation process of the joint station conforms to the laws of physics, both the forward process and the reverse process are correct. Our model needs to look forward and backward, and can well observe everything happening in front and behind. If you only look in one direction, you may miss the measurement point on the right. This implementation introduces the Transformer model with Block and multi-head bidirectional self-attention mechanism, which is very suitable for processing production data prediction problems. For example, in an oil field joint station, the model can be used to predict the state variables of key equipment, such as the temperature of a heating furnace or the liquid level of a settling tank. Since these process variables are usually continuously changing and affected by multiple factors, the use of this model can capture long-term dependencies and patterns between data.
[0081] The decoder in this implementation first uses masked multi-head self-attention, such as Figure 4As shown in the figure, the encoder-decoder multi-head bidirectional self-attention is used, and the encoder uses multi-head bidirectional self-attention. The encoder-decoder multi-head bidirectional self-attention is calculated in the same way as the multi-head bidirectional self-attention, which will not be repeated here. At the same time, because the data of this implementation are aligned, unlike the sentence lengths in language processing, batch normalization is used for processing in this implementation.
[0082] The model training of this implementation includes: data collection, data analysis, data preprocessing, model parameter setting, model training, verification and testing, tuning and deployment. The final output layer of the model will generate the corresponding prediction result, which is the value at a certain point in the future. This value is a certain attribute or state of the entire sequence. At the same time, this implementation also performs necessary post-processing on the original output of the model and converts the Block into a usable output value as a backup.
[0083] like Figure 4 and Figure 5 As shown, the input of the encoder is: A1, A2, A3, B1, B2, B3, C1··· at time T1, A1, A2, A3, B1, B2, B3, C1··· at time T2, A1, A2, A3, B1, B2, B3, C1··· at time T3, A1, A2, A3, B1, B2, B3, C1··· at time TN. The number of data items in each row must be the same;
[0084] After input embedding, Block weight encoding, position encoding and time embedding, the first temporary result (i.e. Figure 4 The output of the first temporary result after multi-head bidirectional self-attention is residually connected and batch normalized (i.e. Add&Batch Norm) with the first temporary result to obtain the second temporary result (i.e. Figure 4 The output of the second temporary result after a feed-forward network (i.e., Feed Forward) is connected to the second temporary result through residual connection and batch normalization (i.e., Add&Batch Norm) to obtain the third temporary result (i.e., Figure 4 the top temporary result in );
[0085] Taking the prediction of the value of B2 at a future time as an example, the input of the decoder is B2 at time T1, B2 at time T2, B2 at time T3, and B2 at time Ti, where time Ti is a moment before the current moment. The input of the decoder is embedded and positionally encoded to obtain the fourth temporary result (i.e. Figure 5The first temporary result is the output of the Masked Multi-Head Self-Attention (i.e., Masked Multi-Head Self-Attention) and the fourth temporary result for residual connection and batch normalization (i.e., Add&Batch Norm), and the fifth temporary result (i.e., Figure 5 (interim results in the middle);
[0086] The third temporary result of the encoder is connected to the output of the encoder-decoder multi-head bidirectional self-attention (i.e., Encoder-Decoder Multi-Head Bi-directional Self-Attention) and the fifth temporary result for residual connection and batch normalization (i.e., Add&Batch Norm), and the sixth temporary result (i.e., Figure 5 the top temporary result in );
[0087] The output of the sixth temporary result after being processed by the feedforward network (i.e., Feed Forward) is residually connected and batch normalized (i.e., Add&Batch Norm) with the sixth temporary result, and the output of the decoder is obtained after linear mapping (i.e., Linear Mapping), that is, the predicted value of B2 at the future moment.
[0088] The solution of this implementation method predicts the heating furnace temperature between 1 and 30 minutes at the Xiner Joint Station of a certain oil field, with a maximum error of about 2 degrees Celsius; it predicts the tank liquid level between 1 and 30 minutes, with a maximum error of 0.2m, which plays a good early warning role; in actual applications, if the alarm temperature is 85 degrees Celsius, setting the threshold above 87 degrees Celsius can play a better role.
[0089] like Figure 6 As shown in FIG, a schematic diagram of a specific multi-head bidirectional self-attention is shown, in which the query vector and key vector of the multi-head bidirectional self-attention are respectively input into the Matmul layer, the Scale layer, and the Softmax layer for processing, and the processing result and the value vector are input into a Matmul layer together; Figure 7 As shown in FIG, a schematic diagram of a specific masked multi-head self-attention is shown. The query vector and key vector of the masked multi-head self-attention are respectively input into the Matmul layer, the Mask layer, the Scale layer, and the Softmax layer for processing. The processing result and the value vector are input into a Matmul layer together.
[0090] Embodiment 2:
[0091] This implementation provides a production data prediction system based on a large model, specifically including:
[0092] The data acquisition unit is configured to: acquire historical data before the current moment of the production process;
[0093] The data prediction unit is configured to: obtain production data at a future moment after the current moment based on the acquired historical data before the current moment and the improved Transformer model;
[0094] Among them, the improved Transformer model includes: introducing multi-head bidirectional self-attention in the encoder, the monitoring data of the pipeline input position and the monitoring data of the pipeline output position of each monitored equipment in the production system correspond to a Block respectively, each Block corresponds to at least one measuring point, and each Block generates a Token.
[0095] The specific detailed process is described in Example 1 and will not be repeated here.
[0096] It is understandable that the above-mentioned units can be separately or completely combined into one or several other units to constitute, or one (some) of the units can be further divided into multiple smaller units in function to constitute, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above-mentioned units are divided based on logical functions. In practical applications, the function of one unit can also be implemented by multiple units, or the functions of multiple units can be implemented by one unit. In other embodiments of the present application, the production data prediction system may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.
[0097] According to another embodiment of the present application, the system described in this embodiment can be constructed and the production data prediction method of the embodiment of the present application can be implemented by running a computer program (including program code) capable of executing the steps involved in the corresponding method described in Example 1 on a general computing device such as a computer including processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM). The computer program can be recorded on, for example, a computer-readable recording medium, and loaded into the above-mentioned computing device through the computer-readable recording medium and run therein.
[0098] Embodiment 3:
[0099] This implementation provides an electronic device, which includes a processor, a communication interface, and a computer-readable storage medium, wherein the processor, the communication interface, and the computer-readable storage medium may be connected via a bus or other means.
[0100] Among them, the communication interface is used to receive and send data, the computer-readable storage medium can be stored in the memory of the electronic device, the computer-readable storage medium is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer-readable storage medium.
[0101] A processor (or CPU (Central Processing Unit)) is the computing core and control core of an electronic device, which is suitable for implementing one or more instructions, and specifically suitable for loading and executing one or more instructions to implement corresponding method flows or corresponding functions.
[0102] The processor is configured to perform the following process:
[0103] Obtain historical data before the current moment of the production process;
[0104] Based on the historical data before the current moment and the improved Transformer model, the production data at a future moment after the current moment is obtained;
[0105] Among them, the improved Transformer model includes: introducing multi-head bidirectional self-attention in the encoder, the monitoring data of the pipeline input position and the monitoring data of the pipeline output position of each monitored equipment in the production system correspond to a Block respectively, each Block corresponds to at least one measuring point, and each Block generates a Token.
[0106] The specific detailed process is described in Example 1 and will not be repeated here.
[0107] Embodiment 4:
[0108] This implementation provides a computer-readable storage medium (Memory), which is a memory device in an electronic device for storing programs and data. It is understandable that the computer-readable storage medium here can include both built-in storage media in the electronic device and, of course, extended storage media supported by the electronic device. The computer-readable storage medium provides a storage space that stores the processing system of the electronic device.
[0109] In addition, the storage space also stores one or more instructions suitable for being loaded and executed by the processor, and these instructions may be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage; optionally, it may also be at least one computer-readable storage medium located away from the aforementioned processor.
[0110] In one embodiment, the computer-readable storage medium stores one or more instructions; the processor loads and executes the one or more instructions stored in the computer-readable storage medium to implement the following process:
[0111] Obtain historical data before the current moment of the production process;
[0112] Based on the historical data before the current moment and the improved Transformer model, the production data at a future moment after the current moment is obtained;
[0113] Among them, the improved Transformer model includes: introducing multi-head bidirectional self-attention in the encoder, the monitoring data of the pipeline input position and the monitoring data of the pipeline output position of each monitored equipment in the production system correspond to a Block respectively, each Block corresponds to at least one measuring point, and each Block generates a Token.
[0114] The specific detailed process is described in Example 1 and will not be repeated here.
[0115] Embodiment 5:
[0116] The present implementation provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device performs the following process:
[0117] Obtain historical data before the current moment of the production process;
[0118] Based on the historical data before the current moment and the improved Transformer model, the production data at a future moment after the current moment is obtained;
[0119] Among them, the improved Transformer model includes: introducing multi-head bidirectional self-attention in the encoder, the monitoring data of the pipeline input position and the monitoring data of the pipeline output position of each monitored equipment in the production system correspond to a Block respectively, each Block corresponds to at least one measuring point, and each Block generates a Token.
[0120] The specific detailed process is described in Example 1 and will not be repeated here.
[0121] A person skilled in the art can appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A person skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0122] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted through a computer-readable storage medium. The computer instructions can be transmitted from a website site, a computer, a server or a data center to another website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data processing device such as a server, a data center, etc. that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
[0123] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A production data prediction method based on a large model, characterized in that: The process includes: Obtain historical data before the current moment of the production process; Based on the historical data before the current moment and the improved Transformer model, the production data at a future moment after the current moment is obtained; Among them, the improved Transformer model uses Token embedding, position encoding, time embedding and Block weight encoding; For the measurement points, one attention head focuses on the measurement points from back to front, and the other attention head focuses on all the measurement points from front to back. All input sequences of the improved Transformer model are known. The improved Transformer model includes: introducing multi-head bidirectional self-attention in the encoder, the monitoring data of the pipeline input position and the monitoring data of the pipeline output position of each monitored equipment in the production system correspond to a Block respectively, each Block corresponds to at least one measurement point, and each Block generates a Token; The query vector and key vector of multi-head bidirectional self-attention are input into the Matmul layer, Scale layer, and Softmax layer for processing respectively, and the processing results and the value vector are input into a Matmul layer together; Each Block is distinguished by the end, and the Token is the position vector. In the data sequence, the first column is the time, and its time series is an independent Block, which also generates a Token. Each Block corresponds to a weight vector, and the weight vector is determined by: If there are N devices in total, each device has an inlet and an outlet, oil and water enter from device 0 and finally exit from device N-1, then the total number of blocks is 2N, Block_count=2N; Block_id ranges from 0 to N-1. If the block whose data needs to be predicted is at position_x, When Block_id_s ≥ x When: Block_id_s weight = position_x + Block_count - Block_id_s; When Block_id_s< x When: The weight of Block_id_s = Block_id_s + Block_count – position_x; The weight of the obtained Block_id_s is normalized to between 0 and 1, where Block_id_s is a non-zero value between 0 and N-1. x The number of.
2. The production data prediction method based on a large model according to claim 1, characterized in that: The equipment to be monitored includes: one or more of a three-phase separator, a buffer tank, a crude oil dehydration pump, a heating furnace, a settling tank, an electric dehydrator, a purified oil tank, a crude oil export pump and an export heating furnace.
3. The production data prediction method based on a large model according to claim 1, characterized in that: The measuring point is the monitoring data of the pipeline input position of the equipment to be monitored or the monitoring data of the pipeline output position collected directly; or, the measuring point is the data calculated based on the monitoring data.
4. A production data prediction system based on a large model, characterized in that: include: The data acquisition unit is configured to: acquire historical data before the current moment of the production process; The data prediction unit is configured to: obtain production data at a future moment after the current moment based on the acquired historical data before the current moment and the improved Transformer model; Among them, the improved Transformer model uses Token embedding, position encoding, time embedding and Block weight encoding; For the measurement points, one attention head focuses on the measurement points from back to front, and the other attention head focuses on all the measurement points from front to back. All input sequences of the improved Transformer model are known. The improved Transformer model includes: introducing multi-head bidirectional self-attention in the encoder, the monitoring data of the pipeline input position and the monitoring data of the pipeline output position of each monitored equipment in the production system correspond to a Block respectively, each Block corresponds to at least one measurement point, and each Block generates a Token; The query vector and key vector of multi-head bidirectional self-attention are input into the Matmul layer, Scale layer, and Softmax layer for processing respectively, and the processing results and the value vector are input into a Matmul layer together; Each Block is distinguished by the end, and the Token is the position vector. In the data sequence, the first column is the time, and its time series is an independent Block, which also generates a Token. Each Block corresponds to a weight vector, and the weight vector is determined by: If there are N devices in total, each device has an inlet and an outlet, oil and water enter from device 0 and finally exit from device N-1, then the total number of blocks is 2N, Block_count=2N; Block_id ranges from 0 to N-1. If the block whose data needs to be predicted is at position_x, When Block_id_s ≥ x When: Block_id_s weight = position_x + Block_count - Block_id_s; When Block_id_s< x When: The weight of Block_id_s = Block_id_s + Block_count – position_x; The weight of the obtained Block_id_s is normalized to between 0 and 1, where Block_id_s is a non-zero value between 0 and N-1. x The number of.
5. The production data prediction system based on a large model as claimed in claim 4, characterized in that: In the data prediction unit, the equipment to be monitored includes: one or more of a three-phase separator, a buffer tank, a crude oil dehydration pump, a heating furnace, a settling tank, an electric dehydrator, a purified oil tank, a crude oil export pump and an export heating furnace.
6. The production data prediction system based on a large model as claimed in claim 4, characterized in that: In the data prediction unit, each Block corresponds to a weight vector, and the weight vector is determined by: If there are N devices in total, each device has an inlet and an outlet, oil and water enter from device 0 and finally exit from device N-1, then the total number of blocks is 2N, Block_count=2N; Block_id ranges from 0 to N-1. If the block whose data needs to be predicted is at position_x, When Block_id_s ≥ x When: Block_id_s weight = position_x + Block_count - Block_id_s; When Block_id_s< x When: The weight of Block_id_s = Block_id_s + Block_count–position_x; The weight of the obtained Block_id_s is normalized to between 0 and 1, where Block_id_s is a non-zero value between 0 and N-1. x The number of.
7. A computer device, characterized in that: include: A processor and a computer readable storage medium; a processor adapted to execute a computer program; A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by the processor, the large-model-based production data prediction method according to any one of claims 1 to 3 is implemented.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor and executing the large model-based production data prediction method according to any one of claims 1 to 3.
9. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method for predicting production data based on a large model as claimed in any one of claims 1 to 3 is implemented.
