Oil and gas pipeline maintenance method, device and equipment based on Transform architecture
By applying a risk assessment model based on the Transformer architecture in oil and gas pipeline maintenance, the problems of inaccurate risk assessment and low efficiency in the existing technology are solved, and more efficient and safe oil and gas pipeline maintenance is achieved.
Patent Information
- Application Number
- CN202510273983.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-10
- Publication Date
- 2025-06-06
AI Technical Summary
The existing oil and gas pipeline maintenance methods have insufficient accuracy and inefficiency in risk assessment and maintenance strategy determination, resulting in safety risks.
The pre-trained risk assessment model based on the Transformer architecture is adopted to accurately identify the target risk type and its risk level by extracting and predicting the oil and gas pipeline data, and to automatically determine the maintenance strategy.
It improves the efficiency and accuracy of the determination of maintenance strategies, enhances the safety of oil and gas pipeline maintenance, and ensures the safe operation of oil and gas pipelines.
Smart Images

Figure CN120106822A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of oil and gas pipeline safety technology, and in particular to a Transformer architecture-based oil and gas pipeline maintenance method, device and equipment. Background Art
[0002] As global energy demand continues to grow, oil and gas pipelines, as important energy transportation infrastructure, are directly related to the stability of national energy supply due to their safety and reliability. However, as oil and gas pipelines are buried underground for a long time, they are affected by environmental corrosion, geological changes, human damage and other factors, and there are high risks.
[0003] At present, when performing maintenance on oil and gas pipelines, it is necessary to first assess the risks and then perform maintenance on the oil and gas pipelines based on the risks. In traditional risk assessment methods, qualitative assessment methods, semi-quantitative assessment methods, and quantitative assessment methods are usually used. When carrying out pipeline maintenance operations, it is usually necessary to manually determine the corresponding maintenance strategy based on the risk type assessed, and then implement the maintenance operation accordingly.
[0004] Although existing risk assessment methods can identify risks to a certain extent, they are obviously insufficient in processing complex data and capturing nonlinear relationships, resulting in inaccurate risk types. In addition, relying solely on manual methods to determine maintenance strategies is not only inefficient, but may also lead to inaccurate maintenance operations. Therefore, existing oil and gas pipeline maintenance methods have certain safety hazards. Summary of the invention
[0005] The present invention provides an oil and gas pipeline maintenance method based on a Transformer architecture, so as to perform efficient and accurate maintenance on the oil and gas pipeline.
[0006] According to a first aspect of the present invention, there is provided a method for maintaining an oil and gas pipeline, comprising:
[0007] Obtain oil and gas pipeline data for each collection period within a specified time range;
[0008] Using a pre-trained risk assessment model based on the Transformer architecture to predict the oil and gas pipeline data to obtain the target risk type within a specified time range;
[0009] The risk level corresponding to the target risk type is determined, and a maintenance strategy for the oil and gas pipeline is determined based on the target risk type and the corresponding risk level.
[0010] According to another aspect of the present invention, a maintenance device for an oil and gas pipeline based on a Transformer architecture is provided, comprising:
[0011] The oil and gas pipeline data acquisition module is used to obtain the oil and gas pipeline data of each acquisition period within a specified time range;
[0012] A target risk type acquisition module, used to predict the oil and gas pipeline data using a pre-trained risk assessment model based on a Transformer architecture to obtain a target risk type within a specified time range;
[0013] The maintenance strategy determination module is used to determine the risk level corresponding to the target risk type, and determine the maintenance strategy of the oil and gas pipeline according to the target risk type and the corresponding risk level.
[0014] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0015] at least one processor; and
[0016] a memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores a computer program that can be executed by the at least one processor. The computer program is executed by the at least one processor so that the at least one processor can perform the method described in any embodiment of the present invention.
[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method described in any embodiment of the present invention when executed.
[0019] The technical solution of the embodiment of the present invention adopts the powerful feature extraction and processing capabilities of the risk assessment model to achieve accurate assessment of oil and gas pipeline risks, and automatically determines the maintenance strategy for the oil and gas pipeline based on the accurately identified target risk type and the corresponding risk level, thereby improving the efficiency and accuracy of determining the maintenance strategy, improving the safety of oil and gas pipeline maintenance, and ensuring the safe operation of the oil and gas pipeline.
[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 It is a flowchart of a maintenance method of an oil and gas pipeline based on a Transformer architecture provided according to Embodiment 1 of the present invention;
[0023] Figure 2 is a flow chart of a maintenance method for an oil and gas pipeline based on a Transformer architecture provided according to Embodiment 2 of the present invention;
[0024] Figure 3 This is a schematic diagram of the structure of a maintenance device for an oil and gas pipeline based on a Transformer architecture provided according to Embodiment 3 of the present invention;
[0025] Figure 4 It is a schematic diagram of the structure of an electronic device provided by Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] Embodiment 1
[0029] Figure 1 A flowchart of a method for maintaining an oil and gas pipeline based on a Transformer architecture is provided for the first embodiment of the present invention. This embodiment is applicable to the maintenance of an oil and gas pipeline. The method can be performed by a maintenance device for an oil and gas pipeline, and the device can be implemented in the form of hardware and / or software. Figure 1 As shown, the method includes:
[0030] Step S101, obtaining oil and gas pipeline data of each collection period within a specified time range.
[0031] Specifically, the specified time range in this embodiment can be one minute, and different collection periods are set within one minute. For example, 2 seconds of oil and gas pipeline data are collected every 18 seconds. Therefore, three oil and gas pipeline data can be collected within one minute, and the overall target risk type of the one minute can be determined based on the risk assessment results of the three oil and gas pipeline data. Of course, this embodiment is only an example, and the specific values of the specified time range and collection period are not limited. The user can limit it according to the specific situation of the risk assessment. Among them, the oil and gas pipeline data includes pipeline material performance parameters, environmental monitoring data, operating status data, historical maintenance records and operation logs. For example, pipeline material performance parameters include toughness strength, pipe wall thickness, yield strength, ductility, corrosion resistance and temperature resistance; environmental detection data include temperature, pressure, corrosive substance concentration, combustible gas concentration and traffic load impact; operating status data includes valve and compressor status, power system parameters and flow, etc. Of course, this embodiment is only an example, and the specific content of the oil and gas pipeline data is not limited.
[0032] Optionally, after acquiring the oil and gas pipeline data of each collection period within a specified time range, the method further includes: performing preprocessing operations on the oil and gas pipeline data, wherein the preprocessing operations include cleaning operations and denoising operations; and normalizing the oil and gas pipeline data after the preprocessing operations to acquire unit-unified oil and gas pipeline data.
[0033] Among them, in this embodiment, after obtaining the oil and gas pipeline data, some preprocessing operations will be performed, such as cleaning operations and denoising operations, to delete abnormal values and obtain oil and gas pipeline data without noise interference. It can be seen from the specific content of the oil and gas pipeline data exemplified above that due to the diverse content and unit forms of the oil and gas pipeline data, the difficulty of data calculation is increased in the subsequent processing process. Therefore, in this embodiment, the preprocessed oil and gas pipeline data will be normalized to ensure that data of different dimensions are compared and analyzed on the same scale, thereby improving the efficiency of data analysis. Of course, this embodiment is only an example for illustration, and does not limit the specific processing method of the oil and gas pipeline data. As long as the efficiency of subsequent data analysis can be improved, it is within the protection scope of this application, and this embodiment does not limit it.
[0034] Step S102, using a pre-trained risk assessment model based on the Transformer architecture to predict the oil and gas pipeline data to obtain the target risk type within a specified time range.
[0035] Optionally, a pre-trained risk assessment model based on the Transformer architecture is used to predict the oil and gas pipeline data to obtain the target risk type within a specified time range, including: using a pre-trained risk assessment model based on the Transformer architecture to predict the oil and gas pipeline data of each collection period to obtain the risk type of the oil and gas pipeline in each collection period; determining the target risk type within the specified time range based on the risk type of each collection period.
[0036] Specifically, the risk assessment model used in this embodiment adopts the Transformer architecture, and the use of the Transformer architecture in the field of natural language processing has achieved remarkable results. The core mechanism of the Transformer architecture is the self-attention mechanism, which enables it to effectively capture long-distance dependencies. Therefore, applying this powerful deep learning model to oil and gas pipeline risk assessment can significantly improve the accuracy and timeliness of risk prediction. The core factors of the risk assessment model based on the Transformer architecture mainly include the encoder layer, the decoder layer, the multi-head self-attention mechanism, the feedforward neural network, the position encoding and the residual connection and layer normalization. Among them, the encoder layer includes a self-attention mechanism and a feedforward neural network. The self-attention mechanism can take into account all elements in the sequence when processing the current element, thereby capturing global dependencies, and the feedforward neural network is used to further process the output of the self-attention mechanism; the decoder layer also includes an encoder-decoder attention mechanism and a self-attention mechanism, and realizes dynamic alignment between input and output through a multi-head attention mechanism. The multi-head self-attention mechanism: captures different relationships through multiple attention heads with different projections to improve the model's expressiveness; the feedforward neural network usually contains two layers of linear transformations and nonlinear activation functions, which are used to further process the output of the self-attention mechanism; position coding needs to be added to maintain the order information of the sequence because the self-attention mechanism cannot capture the position information of the sequence; residual connection and layer normalization, residual connection can alleviate the gradient vanishing problem in deep networks, and layer normalization is used to normalize the input of each layer to improve training stability.
[0037] It should be noted that the main reason why the risk assessment model based on the Transformer architecture is applied to the risk assessment of oil and gas pipelines in this application is that: first, traditional pipeline risk assessment methods usually rely on regularized models or statistical analysis, which have limitations when dealing with complex and nonlinear relationships. In this application, the risk assessment model based on the Transformer architecture is integrated into the pipeline risk assessment system. Since the risk assessment model based on the Transformer architecture has a strong global modeling capability, it can capture the complex dependencies between multiple variables in the pipeline system, such as geological conditions, climate factors, pipeline materials, operating status, etc. It can simultaneously process time series data, such as historical monitoring data and spatial distribution data, such as environmental characteristics along the pipeline, so as to achieve a more comprehensive risk assessment. Therefore, the risk assessment model based on the Transformer architecture has a data-driven global modeling capability. Second, traditional risk assessment methods are usually static and difficult to adapt to the dynamic changes in the pipeline operating environment. The risk assessment model based on the Transformer architecture of this application can process long-term series data and realize dynamic prediction of future risks through its encoder-decoder architecture. Combined with real-time monitoring data, such as pressure, temperature, vibration, etc., it can quickly identify potential risks and issue warnings to improve the response speed of the system. Therefore, the risk assessment model based on the Transformer architecture can perform dynamic risk prediction. Third, abnormal events in pipeline systems, such as leakage, corrosion, earthquake impact, etc., are often sparse and complex, and traditional methods are difficult to effectively detect and analyze. The self-attention mechanism of the risk assessment model based on the Transformer architecture of this application can capture the long-range dependencies between sparse events, thereby improving the accuracy of anomaly detection, and the causal reasoning model based on the Transformer architecture can analyze the causal relationship between risk events and help formulate more effective preventive measures. Therefore, the risk assessment model based on the Transformer architecture of this application can perform anomaly detection and causal reasoning. Fourth, the traditional risk assessment system requires a lot of manual intervention and is inefficient. The risk assessment model based on the Transformer architecture of this application can realize the automation of the entire process from data collection, feature extraction to risk assessment. Combined with reinforcement learning or active learning technology, the system can continuously optimize its own performance and gradually achieve fully intelligent risk assessment. Because the risk assessment model based on the Transformer architecture of this application can be automated and intelligently upgraded.
[0038] Optionally, a pre-trained risk assessment model based on the Transformer architecture is used to predict the oil and gas pipeline data of each collection period to obtain the risk type of the oil and gas pipeline in each collection period, including: encoding the oil and gas pipeline data of each collection period according to a specified encoding method to obtain encoded data, wherein the specified encoding method includes one-hot encoding and label encoding; using a pre-trained risk assessment model based on the Transformer architecture to extract features of the encoded data using a self-attention mechanism to obtain high-dimensional representation features; using a pre-trained risk assessment model based on the Transformer architecture to perform predictive analysis on the high-dimensional representation features to obtain the risk type of the oil and gas pipeline in each collection period.
[0039] Specifically, in this embodiment, after obtaining the normalized oil and gas pipeline data, the pre-trained risk assessment model based on the Transformer architecture will be used to predict the oil and gas pipeline data of each acquisition period to obtain the corresponding risk type. When making predictions, the pre-trained risk assessment model based on the Transformer architecture will encode the oil and gas pipeline data in a unique hot encoding or label encoding manner to adapt to the input requirements of the risk assessment model, and then use the self-attention mechanism of the pre-trained risk assessment model based on the Transformer architecture to extract features from the encoded data. The self-attention mechanism can automatically learn the complex patterns and dependencies in the input data, thereby extracting high-dimensional representation features that are useful for risk assessment, and then predicting based on the extracted high-dimensional representation features to obtain the risk type of the oil and gas pipeline in each acquisition period. Among them, since the risk assessment model includes multiple Transformer layers, each layer is responsible for capturing feature information at different levels, so that the extracted high-dimensional representation features are more accurate. And the encoders and decoders involved in feature extraction are composed of convolutional networks. For example, the convolutional network corresponding to the encoder is defined as follows: 1) Conv(in→we,11,4,5)+ReLU+MaxPool(2,2); 2) Conv(we+in1→3*we,5,1,2)+ReLU+MaxPool(2,2); 3) Conv(3*we+in2→6*we,3,1,1)+ReLU; 4) Conv(6*we+in2→4*we,3,1,1)+ReLU; 5) Conv(4*we+in2→we,3,1,1)+ReLU; 6) Conv(we+in2→L,1,1,0)+ReLU+MaxPool(2,2). Correspondingly, the convolutional network corresponding to the decoder is defined as follows: 1) Conv(L→wd,1,1,0)+ReLU+Up(4,2,nearest); 2) Conv(wd+L→wd,3,1,1)+ReLU+Up(2,2,nearest); 3) Conv(wd+L→wd,3,1,1)+ReLU+Up(2,2,nearest); 4) Conv(wd+L→wd,3,1,1)+ReLU+Up (2,2,nearest); 5)Conv(wd+L→wd,3,1,1)+ReLU+Up(2,2,nearest); 6)Conv(wd+L→wd,3,1,1)+ReLU+Up( 2,2,bilinear); 7)Conv(wd+L→wd,5,1,2)+ReLU; 8)Conv(wd+L→wd,3,1,1)+ReLU; 9)Conv(wd→in,3,1,1).Of course, this implementation is only an example and does not limit the specific structure of the convolutional network structure of the encoder and decoder involved in feature extraction. As long as the high-dimensional representation features can be accurately captured, they are within the scope of protection of this application.
[0040] Optionally, the target risk type within the specified time range is determined based on the risk type of each collection period, including: determining whether the risk type of each collection period includes the specified risk type; if so, displaying the risk type of each collection period to the user, and determining the target risk type based on the user's filtering instructions; otherwise, determining the target risk type based on the frequency of occurrence of the target risk type.
[0041] Specifically, after obtaining the oil and gas pipeline data within the specified time range, if all the data are used to directly perform prediction, only one risk type of the oil and gas pipeline within the specified time range can be obtained. However, since the risk type obtained has no comparative reference, it is impossible to judge the accuracy of the risk type obtained, thereby reducing the accuracy of the risk type. The specified time range of the present application cannot be too long, because the risk state of the oil and gas pipeline does not change much within a sufficiently short time range. Therefore, by performing multiple predictions within the specified time range, a comprehensive evaluation is performed based on the multiple prediction results to obtain the target prediction result corresponding to the specified time range, and different collection time periods can be set within the specified time range, such as the above-mentioned collection of 2 seconds of oil and gas pipeline data every 18 seconds within one minute, and predictions are performed based on the three oil and gas pipeline data collected within one minute, respectively, to obtain the risk type corresponding to each collection time period, wherein the risk types include explosion, leakage, corrosion, and loose parts, etc. The specific content of the risk type is not limited in this embodiment. In addition, after obtaining the risk types corresponding to different collection time periods within one minute, when it is determined that there are risk types that cause losses to life and property safety among multiple risk types, such as explosion, since this risk type affects the safety of the entire oil and gas pipeline system and the safety of nearby workers, once it occurs, relatively large losses will occur. Therefore, it will be pre-set that when this risk type with a relatively high safety factor occurs, all risk types for each time period need to be displayed on the front-end page to display to the user. When the user sees that the displayed information includes explosion, the entire system of the oil and gas pipeline and the surrounding environment data will be comprehensively checked. After determining that the safety risk has been eliminated based on the inspection results, a more accurate risk type will be screened out from the displayed risk types based on the screening results as the target risk type. However, when the risk types corresponding to each collection period do not match the specified risk types pre-set by the system, the target risk type will be determined based on the frequency of occurrence of the target risk type. For example, if the risk types corresponding to the three collection periods include one leakage and two corrosions, corrosion will be used as the target risk type. Of course, this implementation is only an example and does not limit the specific method of determining the target risk type. As long as the target risk type can be accurately obtained under the premise of ensuring safety, it is within the scope of protection of this application.
[0042] Step S103, determining the risk level corresponding to the target risk type, and determining the maintenance strategy of the oil and gas pipeline according to the target risk type and the corresponding risk level.
[0043] Optionally, determining the risk level corresponding to the target risk type includes: obtaining a risk level list, wherein the risk level list includes a correspondence between risk types and risk levels; and querying the risk level list to obtain a risk level matching the target risk type.
[0044] Specifically, after determining the target risk type, this implementation method also needs to maintain the oil and gas pipeline according to the target risk type. However, currently, the maintenance strategy is mainly determined manually, and the oil and gas pipeline is manually maintained based on the maintenance strategy. The method of manually analyzing and determining the maintenance strategy obviously reduces the maintenance efficiency of the oil and gas pipeline, thereby increasing the safety risk factor of the oil and gas pipeline. After obtaining the target risk type, this implementation method will query from the pre-configured risk level list to obtain the risk level of the risk type, wherein the risk level list includes the corresponding relationship between the risk type and the risk level. The following Table 1 shows an example of the risk level list:
[0045] Table 1
[0046] Risk Type Risk Level explode High (Level 4) leakage Higher (Level 3) corrosion Medium (Level 2) High pressure operation Low (Level 1) Loose parts Low (Level 1) … …
[0047] Due to space limitations, Table 1 only uses the risk levels corresponding to the four risk types as examples for illustration, and the number of risk types and risk levels included in the risk level list is not limited in this implementation. In addition, in the risk level list, the same risk level may include multiple risk types, for example, high-pressure operation and loose parts are both included in the first risk level, and the number of risk types included in each risk level is not limited in this implementation.
[0048] Optionally, the maintenance strategy of the oil and gas pipeline is determined according to the target risk type and the corresponding risk level, including: judging whether the risk level is within the specified level range, if so, providing a risk warning of the target risk type to the user, and determining the maintenance strategy for the oil and gas pipeline according to the user's operating instructions; otherwise, directly sending the target risk type to the cloud server, and receiving the maintenance strategy fed back by the cloud server based on the target risk type.
[0049] Specifically, in this embodiment, after obtaining the target risk type and risk level, the maintenance strategy corresponding to the target risk type can be determined automatically. However, when it is determined that the risk type affects the safety of the oil and gas pipeline and personnel, manual intervention can also be used. When determining the maintenance strategy, first determine whether the risk level is within the specified level range, for example, level three to level four. The specified level range means that the appearance of the target risk type has affected the safety of the oil and gas pipeline and personnel. Therefore, when it is within the specified level range, an alarm prompt will be generated, and the target risk type will be included in the alarm prompt. At this time, the user can determine the maintenance strategy for the oil and gas pipeline according to the alarm prompt. When determining the maintenance strategy, the user can check the oil and gas pipeline according to the alarm prompt and formulate the maintenance strategy according to the actual situation on site. When the risk level is not within the specified level range, for example, below level two, the target risk type will not affect the safety of the oil and gas pipeline and personnel, but will only affect the normal operation of the oil and gas pipeline. At this time, the target risk type will be sent to the cloud server. Since the maintenance strategy corresponding to each risk type is recorded in the cloud server, the cloud server will match the target risk type to determine the maintenance strategy. In this embodiment, when determining the maintenance strategy, the automatic and manual methods are combined, so as to accurately determine the maintenance strategy while ensuring safety, so as to facilitate efficient maintenance of the oil and gas pipeline.
[0050] In the implementation mode of the present application, the powerful feature extraction and processing capabilities of the risk assessment model based on the Transformer architecture are adopted to achieve accurate assessment of oil and gas pipeline risks, and automatically determine the maintenance strategy for the oil and gas pipeline based on the accurately identified target risk type and the corresponding risk level, thereby improving the efficiency and accuracy of determining the maintenance strategy, improving the safety of oil and gas pipeline maintenance, and ensuring the safe operation of the oil and gas pipeline.
[0051] Embodiment 2
[0052] Figure 2 The second embodiment of the present invention provides a flow chart of a maintenance method for oil and gas pipelines based on the Transformer architecture. This embodiment is based on the above embodiment, and determines the maintenance strategy of the oil and gas pipeline according to the target risk type and the corresponding risk level, and also includes: maintaining the oil and gas pipeline according to the maintenance strategy; obtaining the oil and gas pipeline data after maintenance, and updating the risk assessment model according to the oil and gas pipeline data after maintenance. Figure 2 As shown, the method includes:
[0053] Step S201, obtaining oil and gas pipeline data of each collection period within a specified time range.
[0054] Optionally, after acquiring the oil and gas pipeline data of each collection period within a specified time range, the method further includes: performing preprocessing operations on the oil and gas pipeline data, wherein the preprocessing operations include cleaning operations and denoising operations; and normalizing the oil and gas pipeline data after the preprocessing operations to acquire unit-unified oil and gas pipeline data.
[0055] Step S202, using a pre-trained risk assessment model based on the Transformer architecture to predict the oil and gas pipeline data to obtain the target risk type within a specified time range.
[0056] Optionally, a pre-trained risk assessment model based on the Transformer architecture is used to predict the oil and gas pipeline data to obtain the target risk type within a specified time range, including: using a pre-trained risk assessment model based on the Transformer architecture to predict the oil and gas pipeline data of each collection period to obtain the risk type of the oil and gas pipeline in each collection period; determining the target risk type within the specified time range based on the risk type of each collection period.
[0057] Optionally, a pre-trained risk assessment model based on the Transformer architecture is used to predict the oil and gas pipeline data of each collection period to obtain the risk type of the oil and gas pipeline in each collection period, including: encoding the oil and gas pipeline data of each collection period according to a specified encoding method to obtain encoded data, wherein the specified encoding method includes one-hot encoding and label encoding; using a pre-trained risk assessment model based on the Transformer architecture to extract features of the encoded data using a self-attention mechanism to obtain high-dimensional representation features; using a pre-trained risk assessment model based on the Transformer architecture to perform predictive analysis on the high-dimensional representation features to obtain the risk type of the oil and gas pipeline in each collection period.
[0058] Optionally, the target risk type within the specified time range is determined based on the risk type of each collection period, including: determining whether the risk type of each collection period includes the specified risk type; if so, displaying the risk type of each collection period to the user, and determining the target risk type based on the user's filtering instructions; otherwise, determining the target risk type based on the frequency of occurrence of the target risk type.
[0059] Step S203, determining the risk level corresponding to the target risk type, and determining the maintenance strategy of the oil and gas pipeline according to the target risk type and the corresponding risk level.
[0060] Optionally, determining the risk level corresponding to the target risk type includes: obtaining a risk level list, wherein the risk level list includes a correspondence between risk types and risk levels; and querying the risk level list to obtain a risk level matching the target risk type.
[0061] Optionally, the maintenance strategy of the oil and gas pipeline is determined according to the target risk type and the corresponding risk level, including: judging whether the risk level is within the specified level range, if so, providing a risk warning of the target risk type to the user, and determining the maintenance strategy for the oil and gas pipeline according to the user's operating instructions; otherwise, directly sending the target risk type to the cloud server, and receiving the maintenance strategy fed back by the cloud server based on the target risk type.
[0062] Step S204: maintaining the oil and gas pipeline according to the maintenance strategy.
[0063] Among them, in this embodiment, after determining the maintenance strategy, the maintenance strategy will be identified. When it is determined that no manual intervention is required, automatic maintenance will be performed according to the maintenance strategy. However, when it is determined that manual intervention is required, a maintenance prompt will be generated and the user will access the maintenance. However, in general, manual intervention is a situation with high risks. In most cases, the target risk types that appear can be maintained automatically. Compared with the existing maintenance method that relies entirely on manual labor, this application significantly improves the maintenance efficiency.
[0064] In a specific implementation, after evaluating the risk type and maintenance strategy of the oil and gas pipeline, the oil and gas pipeline can be maintained based on the maintenance strategy. The oil and gas pipeline can be maintained automatically. For example, when the risk type is determined to be high-pressure operation, the corresponding maintenance strategy is to reduce the pressure. When the terminal device determines that the maintenance strategy is to reduce the pressure, it can obtain the normal operating pressure and automatically adjust the pressure of the oil and gas pipeline to the normal pressure. At this time, no human intervention is required. When the risk type is determined to be loose parts, the automatic control method cannot be used at this time. At this time, human intervention is required to dispatch professional personnel to tighten and fix the parts at the designated location.
[0065] Step S205, obtaining the oil and gas pipeline data after maintenance, and updating the risk assessment model according to the oil and gas pipeline data after maintenance.
[0066] Specifically, after the maintenance of the oil and gas pipeline is completed, the oil and gas pipeline can operate normally. At this time, the data of the oil and gas pipeline after maintenance will be obtained. Since the relevant parameters of the oil and gas pipeline after maintenance will change, in order to ensure the accuracy of subsequent model predictions, the data of the oil and gas pipeline after maintenance will be re-collected, and the risk assessment model will be updated based on the data of the oil and gas pipeline after maintenance. Among them, this embodiment mainly adopts the following aspects when updating the risk assessment model: according to the operating conditions of the oil and gas pipeline and changes in the external environment, timely collect new data, and update and optimize the model; adopt online learning methods to continuously learn from new data to improve the accuracy and timeliness of predictions; according to the latest data and feedback, continuously adjust and optimize the parameters and structure of the model to improve the performance of the model. Constantly try different model architectures, hyperparameter settings, and regularization methods to obtain the best risk assessment effect.
[0067] It is worth mentioning that in this implementation, the powerful feature extraction and processing capabilities of the risk assessment model based on the Transformer architecture are used to achieve accurate assessment of oil and gas pipeline risks. This architecture improves the accuracy and timeliness of oil and gas pipeline risk assessment and reduces the impact of human subjective factors. In addition, the accuracy and timeliness of oil and gas pipeline risk assessment are improved, and the impact of human subjective factors is minimized while ensuring safety; the powerful feature extraction and processing capabilities of the risk assessment model can capture complex risk factor correlations and improve the comprehensiveness and depth of risk identification; dynamic assessment and real-time early warning of oil and gas pipeline risks are achieved, providing timely and effective decision support for the safe operation and maintenance of pipelines; this architecture has good scalability and versatility, and can be applied to other similar energy infrastructure risk assessments.
[0068] In the implementation mode of the present application, the powerful feature extraction and processing capabilities of the risk assessment model based on the Transformer architecture are adopted to achieve accurate assessment of oil and gas pipeline risks, and automatically determine the maintenance strategy for the oil and gas pipeline based on the accurately identified target risk type and the corresponding risk level, thereby improving the efficiency and accuracy of determining the maintenance strategy, improving the safety of oil and gas pipeline maintenance, and ensuring the safe operation of the oil and gas pipeline.
[0069] Embodiment 3
[0070] Figure 3 A schematic diagram of the structure of a maintenance device for an oil and gas pipeline provided in Embodiment 3 of the present invention. Figure 3 As shown, the device includes: an oil and gas pipeline data acquisition module 310, a target risk type acquisition module 320 and a maintenance strategy determination module 330.
[0071] Among them, the oil and gas pipeline data acquisition module 310 is used to obtain the oil and gas pipeline data of each acquisition period within a specified time range;
[0072] The target risk type acquisition module 320 is used to predict the oil and gas pipeline data using a pre-trained risk assessment model based on the Transformer architecture to obtain the target risk type within a specified time range;
[0073] The maintenance strategy determination module 330 is used to determine the risk level corresponding to the target risk type, and determine the maintenance strategy of the oil and gas pipeline according to the target risk type and the corresponding risk level.
[0074] Optionally, the oil and gas pipeline data includes pipeline material performance parameters, environmental monitoring data, operating status data, historical maintenance records and operation logs;
[0075] The device also includes an oil and gas pipeline data processing module, which is used to perform preprocessing operations on the oil and gas pipeline data, wherein the preprocessing operations include cleaning operations and denoising operations;
[0076] The oil and gas pipeline data after preprocessing is normalized to obtain unified oil and gas pipeline data.
[0077] Optionally, the target risk type acquisition module includes:
[0078] A risk type determination unit is used to predict the oil and gas pipeline data of each collection period using a pre-trained risk assessment model based on the Transformer architecture to obtain the risk type of the oil and gas pipeline in each collection period;
[0079] The target risk type determination unit is used to determine the target risk type within a specified time range according to the risk type of each collection period.
[0080] Optionally, a risk type determination unit is used to encode the oil and gas pipeline data of each collection period according to a specified encoding method to obtain encoded data, wherein the specified encoding method includes one-hot encoding and label encoding;
[0081] By adopting the pre-trained risk assessment model based on the Transformer architecture, the self-attention mechanism is used to extract features from the encoded data to obtain high-dimensional representation features;
[0082] By adopting a pre-trained risk assessment model based on the Transformer architecture, high-dimensional representation features are predicted and analyzed to obtain the risk type of oil and gas pipelines in each collection period.
[0083] Optionally, a target risk type determination unit is used to determine whether the risk type of each collection period includes a specified risk type. If so, the risk type of each collection period is displayed to the user, and the target risk type is determined according to the user's screening instruction.
[0084] Otherwise, the target risk type is determined according to the frequency of occurrence of the target risk type.
[0085] Optionally, the maintenance strategy determination module includes a risk level determination unit, which is used to obtain a risk level list, wherein the risk level list includes a correspondence between risk types and risk levels;
[0086] Query the risk level list to obtain the risk level that matches the target risk type.
[0087] Optionally, the maintenance strategy determination module includes a maintenance strategy determination unit for determining whether the risk level is within a specified level range, and if so, providing a risk warning of the target risk type to the user, and determining a maintenance strategy for the oil and gas pipeline according to the user's operation instruction;
[0088] Otherwise, the target risk type is directly sent to the cloud server, and the maintenance strategy fed back by the cloud server based on the target risk type is received.
[0089] Optionally, the device further comprises a risk assessment model updating module for maintaining the oil and gas pipeline according to the maintenance strategy;
[0090] The data of the oil and gas pipeline after maintenance is obtained, and the risk assessment model is updated according to the data of the oil and gas pipeline after maintenance.
[0091] The oil and gas pipeline maintenance device provided in the third embodiment of the present invention can execute the oil and gas pipeline maintenance method based on the Transformer architecture provided in any third embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0092] Embodiment 4
[0093] Figure 4 The present invention is a block diagram of an electronic device 10 that can be used to implement an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0094] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0095] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0096] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the maintenance method of the oil and gas pipeline based on the Transformer architecture.
[0097] In some embodiments, the maintenance method for oil and gas pipelines based on the Transformer architecture can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the maintenance method for oil and gas pipelines based on the Transformer architecture described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the maintenance method for oil and gas pipelines based on the Transformer architecture in any other appropriate manner (for example, by means of firmware).
[0098] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0099] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0100] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0101] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0102] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0103] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0104] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0105] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A maintenance method for oil and gas pipelines based on Transformer architecture, characterized in that: include: Obtain oil and gas pipeline data for each collection period within a specified time range; Using a pre-trained risk assessment model based on the Transformer architecture to predict the oil and gas pipeline data to obtain the target risk type within a specified time range; The risk level corresponding to the target risk type is determined, and a maintenance strategy for the oil and gas pipeline is determined based on the target risk type and the corresponding risk level.
2. The method according to claim 1, characterized in that The oil and gas pipeline data includes pipeline material performance parameters, environmental monitoring data, operating status data, historical maintenance records and operation logs; After obtaining the oil and gas pipeline data of each acquisition period within the specified time range, the method further includes: Performing a preprocessing operation on the oil and gas pipeline data, wherein the preprocessing operation includes a cleaning operation and a denoising operation; The oil and gas pipeline data after the preprocessing operation is normalized to obtain oil and gas pipeline data with unified units.
3. The method according to claim 1, characterized in that The pre-trained risk assessment model based on the Transformer architecture is used to predict the oil and gas pipeline data to obtain the target risk type within a specified time range, including: A pre-trained risk assessment model based on the Transformer architecture is used to predict the oil and gas pipeline data in each collection period to obtain the risk type of the oil and gas pipeline in each collection period; The target risk type within the specified time range is determined according to the risk type of each collection period.
4. The method according to claim 3, characterized in that The pre-trained risk assessment model based on the Transformer architecture is used to predict the oil and gas pipeline data in each collection period to obtain the risk type of the oil and gas pipeline in each collection period, including: Encoding the oil and gas pipeline data of each acquisition period according to a specified encoding method to obtain encoded data, wherein the specified encoding method includes one-hot encoding and label encoding; Using the Transformer architecture-based pre-trained risk assessment model, a self-attention mechanism is used to extract features from the encoded data to obtain high-dimensional representation features; The high-dimensional representation features are predicted and analyzed by using the pre-trained risk assessment model based on the Transformer architecture to obtain the risk type of the oil and gas pipeline in each collection period.
5. The method according to claim 3, characterized in that: The determining the target risk type within the specified time range according to the risk type of each collection period includes: Determine whether the risk type of each collection period includes a specified risk type. If so, display the risk type of each collection period to the user, and determine the target risk type according to the user's screening instruction. Otherwise, the target risk type is determined according to the occurrence frequency of the target risk type.
6. The method according to claim 1, characterized in that Determining the risk level corresponding to the target risk type includes: Obtaining a risk level list, wherein the risk level list includes a correspondence between risk types and risk levels; A query is performed from the risk level list to obtain the risk level matching the target risk type.
7. The method according to claim 1, characterized in that Determining the maintenance strategy of the oil and gas pipeline according to the target risk type and the corresponding risk level includes: Determine whether the risk level is within a specified level range. If so, provide a risk warning to the user of the target risk type and determine a maintenance strategy for the oil and gas pipeline according to the user's operation instructions; Otherwise, the target risk type is directly sent to the cloud server, and the maintenance strategy fed back by the cloud server based on the target risk type is received.
8. The method according to claim 1, characterized in that After determining the maintenance strategy of the oil and gas pipeline according to the target risk type and the corresponding risk level, the method further includes: Maintaining the oil and gas pipeline according to the maintenance strategy; The oil and gas pipeline data after maintenance is acquired, and the risk assessment model is updated according to the oil and gas pipeline data after maintenance.
9. A maintenance device for oil and gas pipelines based on Transformer architecture, characterized in that: include: The oil and gas pipeline data acquisition module is used to obtain the oil and gas pipeline data of each acquisition period within a specified time range; A target risk type acquisition module, used to predict the oil and gas pipeline data using a pre-trained risk assessment model based on a Transformer architecture to obtain a target risk type within a specified time range; The maintenance strategy determination module is used to determine the risk level corresponding to the target risk type, and determine the maintenance strategy of the oil and gas pipeline according to the target risk type and the corresponding risk level.
10. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so as to enable the at least one processor to perform the method according to any one of claims 1 to 9.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method according to any one of claims 1 to 9 when executed.