An automatic control method and device for oil and gas pipeline detection, an electronic device, and a storage medium
By constructing a multi-head attention TCN network and a factor graph model, and combining time decay and redundancy value factors, the problem of unreasonable resource allocation in the scheduling of oil and gas pipeline inspection tasks was solved, and the accuracy of inspection tasks and efficient utilization of resources were achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU YUANJING SECURITY EVALUATION & TESTING CO LTD
- Filing Date
- 2025-08-11
- Publication Date
- 2026-04-17
AI Technical Summary
The current scheduling of oil and gas pipeline inspection tasks does not fully consider the physical properties of the pipeline and the status of the inspection equipment, resulting in unreasonable allocation of inspection resources, equipment running out of power or overloading midway, lack of ability to respond to dynamic changes, and failure to scientifically assess scheduling risks and priorities.
By collecting physical properties of oil and gas pipelines and status parameters of detection equipment, a multi-head attention TCN network is constructed for status prediction. Probability analysis is performed using a factor graph model to calculate the time decay factor and redundancy value factor. The Hungarian algorithm is then used for task scheduling decisions to achieve real-time feedback and dynamic adjustment.
It improves the accuracy of testing tasks and the utilization rate of resources, can cope with dynamic changes, optimize task priority ranking, and ensure that the capabilities of testing equipment are matched with resources.
Smart Images

Figure CN120991243B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of oil and gas pipeline inspection and intelligent scheduling technology, and in particular to an automatic control method, device, electronic equipment and storage medium for oil and gas pipeline inspection, which realizes dynamic task scheduling based on the physical properties of oil and gas pipelines and the status parameters of inspection equipment. Background Technology
[0002] As a critical infrastructure for energy transportation, the safe and stable operation of oil and gas pipelines is directly related to national energy security and environmental security. With increasing pipeline service life, factors such as corrosion, third-party damage, and geological disasters can easily lead to pipeline failure. Therefore, regular comprehensive inspections using testing equipment (such as intelligent pipeline pigs and robotic inspection systems) are necessary.
[0003] Current oil and gas pipeline inspection task scheduling relies heavily on experience-based planning or simple rule-based scheduling, which has the following shortcomings:
[0004] 1. The impact of differences in pipeline physical properties, such as diameter, material, burial depth, and operating pressure, on testing requirements was not fully considered, resulting in an unreasonable allocation of testing resources;
[0005] 2. Insufficient perception of the real-time status of the detection equipment, such as real-time power, remaining power, and maximum power limit, can easily lead to situations where the equipment runs out of power or is overloaded midway through operation;
[0006] 3. Lack of accurate prediction capabilities for pipeline and equipment conditions, making it difficult to cope with dynamically changing monitoring environments;
[0007] 4. The lack of a scientific probability analysis model makes it impossible to quantify the execution risks of different scheduling schemes;
[0008] 5. The lack of time decay effect and power redundancy value assessment led to unreasonable task priority allocation and low equipment utilization.
[0009] To address the aforementioned issues, this invention proposes an automatic control method, device, electronic equipment, and storage medium for oil and gas pipeline inspection. By integrating pipeline physical properties, equipment status parameters, predictive analysis, and probabilistic modeling, it achieves intelligent and precise scheduling of inspection tasks. Summary of the Invention
[0010] To address the above problems, this invention provides an automatic control method for oil and gas pipeline inspection, specifically including the following steps:
[0011] Step 1: Data Acquisition and Preprocessing: Collect physical property data of oil and gas pipelines and status parameters of detection equipment. After cleaning and normalization, the data is fused into pipeline feature vectors and equipment feature vectors. The pipeline physical property data includes pipeline diameter, material, burial depth, wall thickness, operating pressure, laying years, historical corrosion rate and segment length, and geographical coordinates. The detection equipment status parameters include inherent parameters such as maximum power and rated power, as well as real-time power, remaining power, operating time, and distance from the target detection segment. Normalization is achieved by mapping parameter values to the [0,1] interval. The mapping formula is determined based on the minimum and maximum values of the parameters, providing standardized features for subsequent model input.
[0012] Step 2: TCN network state prediction based on multi-head attention: Construct a network with a TCN layer containing 3 layers of causal dilated convolution and an 8-head attention mechanism. Take the feature vector time sequence from Step 1 as input, and after training, output the predicted values of the pipeline state and the detection device state in the future preset time period.
[0013] The expansion coefficients of the TCN layer are 1, 2, and 4 respectively. The attention layer calculates weights through the query matrix, key matrix, and value matrix to focus on key temporal features. The prediction results provide temporal basis for subsequent probabilistic analysis.
[0014] Step 3: Factor graph model state probability analysis: Define pipeline state variables, equipment state variables, and observation variables, construct factor functions to quantify the probabilistic relationships between variables, calculate the posterior probability through the belief propagation algorithm, and obtain the probability of successful detection, insufficient power, and power overload. The factor function parameters are related to pipeline material, operating pressure, maximum power of equipment, and remaining power. The probability results provide a quantitative basis for scheduling risk assessment.
[0015] Step 4: Calculation of Time Decay Factor and Redundancy Value Factor: Based on the prediction results of Step 2, the urgency weight of pipeline detection and the key time point weight of equipment power redundancy are calculated through the TCN attention layer. The time decay factor is calculated in combination with the pipeline importance coefficient, and the redundancy value factor is calculated in combination with the redundancy power and power fluctuation characteristics. The parameters of the two factors are related to the predicted value of pipeline leakage risk and the predicted fluctuation of equipment power, providing dynamic quantitative indicators for scheduling priority.
[0016] Step 5: Task scheduling decision: Based on the probability results of Step 3 and the factors of Step 4, calculate the comprehensive score of the task-device combination, achieve optimal task allocation through the Hungarian algorithm, and output scheduling instructions including start time and path; the score integrates detection success probability, safety probability, time decay factor, redundancy factor and device distance weight to ensure that resource allocation matches task priority and device capabilities.
[0017] Step 6: Real-time feedback and dynamic adjustment: Update equipment and pipeline status data every preset time interval, incrementally update the network model in step 2, repeat steps 3-5 to adjust the scheduling scheme, adapt to real-time status changes, and ensure scheduling timeliness.
[0018] Specifically, in step 1, the pipeline feature vector is fused with the normalized values of the pipeline's physical attributes and the normalized values of its geographical coordinates, and the equipment feature vector is fused with the normalized values of the equipment's status parameters. The normalization formula is the difference between the parameter value and the minimum parameter value divided by the difference between the maximum parameter value and the minimum parameter value.
[0019] Specifically, in step 2, the network training uses the Adam optimizer with an initial learning rate of 0.001 and a loss function of mean squared error. A training set is constructed based on historical data of a preset number of years. The input is a feature sequence of a preset duration, and the output is the state prediction value for the next 6 hours. The remaining power prediction value is calculated by the difference between the initial value of the remaining power and the cumulative consumption rate.
[0020] Specifically, in step 3, the pipeline condition factor function parameters include the material corrosion sensitivity coefficient, the operating pressure influence coefficient, and the laying age aging coefficient; the equipment condition factor function parameters include the ratio of predicted power to maximum power, the ratio of remaining power to rated power, and the detection success probability is calculated by combining the equipment normal operation probability and the pipeline condition detectability.
[0021] Specifically, in step 4, the time decay factor formula is constructed based on future time points, attention weights, and pipeline importance coefficients, and increases with time; the redundancy value factor formula is constructed based on the ratio of redundant power to rated power, attention weights, and time difference index, and is positively correlated with redundant power and affected by power fluctuations.
[0022] Specifically, in step 5, the candidate task set is generated by screening pipeline sections with leakage risk or severe corrosion probability exceeding the threshold. The sum of the comprehensive score weight coefficients is 1. Task allocation is achieved through bipartite graph maximum weight matching. Conflict adjustment is completed by reducing the weight of low-scoring tasks and rematching.
[0023] The present invention also provides an automatic control device for oil and gas pipeline inspection, specifically including the following modules: a data acquisition and preprocessing module, a TCN network state prediction module based on multi-head attention, a factor graph model state probability analysis module, a time decay factor and redundancy value factor calculation module, a task scheduling decision module, and a real-time feedback and dynamic adjustment module.
[0024] The data acquisition and preprocessing module is used for data acquisition and preprocessing: acquiring physical property data of oil and gas pipelines and status parameters of detection equipment, which are then cleaned, normalized, and fused into pipeline feature vectors and equipment feature vectors. The pipeline physical property data includes pipeline diameter, material, burial depth, wall thickness, operating pressure, laying years, historical corrosion rate and segment length, and geographical coordinates. The detection equipment status parameters include inherent parameters such as maximum power and rated power, as well as real-time power, remaining power, operating time, and distance from the target detection segment. Normalization is achieved by mapping parameter values to the [0,1] interval. The mapping formula is determined based on the minimum and maximum values of the parameters, providing standardized features for subsequent model input.
[0025] The TCN network state prediction module based on multi-head attention is used for TCN network state prediction based on multi-head attention: a network with a TCN layer containing 3 layers of causal dilated convolution and an 8-head attention mechanism is constructed. The feature vector time sequence from step 1 is used as input, and after training, the predicted values of the pipeline state and the detection device state within a preset time period are output.
[0026] The expansion coefficients of the TCN layer are 1, 2, and 4 respectively. The attention layer calculates weights through the query matrix, key matrix, and value matrix to focus on key temporal features. The prediction results provide temporal basis for subsequent probabilistic analysis.
[0027] The factor graph model state probability analysis module is used to define pipeline state variables, equipment state variables, and observation variables, construct factor functions to quantify the probabilistic relationships between variables, and calculate the posterior probability through the belief propagation algorithm to obtain the probability of successful detection, insufficient power, and power overload. The factor function parameters are related to pipeline material, operating pressure, maximum power of equipment, and remaining power. The probability results provide a quantitative basis for scheduling risk assessment.
[0028] The time decay factor and redundancy value factor calculation module is used to calculate the pipeline detection urgency weight and the equipment power redundancy key time point weight through the TCN attention layer based on the prediction results of the TCN network state prediction module. The time decay factor is calculated by combining the pipeline importance coefficient and the redundancy value factor is calculated by combining the redundancy power and power fluctuation characteristics. The two factor parameters are related to the pipeline leakage risk prediction value and the equipment power prediction fluctuation, providing dynamic quantitative indicators for scheduling priority.
[0029] The task scheduling decision module is used to calculate the comprehensive score of the task-equipment combination based on the probability results of the factor graph model state probability analysis module and the factors of the time decay factor and redundancy value factor calculation module. It achieves optimal task allocation through the Hungarian algorithm and outputs scheduling instructions containing start time and path. The score integrates detection success probability, safety probability, time decay factor, redundancy factor and equipment distance weight to ensure that resource allocation matches task priority and equipment capability.
[0030] Real-time feedback and dynamic adjustment are used to update equipment and pipeline status data at preset time intervals, incrementally update the network model in the TCN network status prediction module based on multi-head attention, repeat the adjustment and scheduling scheme of the above modules, adapt to real-time status changes, and ensure scheduling timeliness.
[0031] In the TCN network state prediction module based on multi-head attention, the network training uses the Adam optimizer with an initial learning rate of 0.001 and a loss function of mean squared error. The training set is constructed based on historical data of a preset number of years. The input is a feature sequence of a preset duration, and the output is the state prediction value for the next 6 hours. The remaining power prediction value is calculated by the difference between the initial value of the remaining power and the cumulative consumption rate.
[0032] In the factor graph model state probability analysis module, the pipeline state factor function parameters include the material corrosion sensitivity coefficient, the operating pressure influence coefficient, and the laying age aging coefficient. The equipment state factor function parameters include the ratio of predicted power to maximum power and the ratio of remaining power to rated power. The detection success probability is calculated by combining the equipment normal operation probability and the pipeline state detectability.
[0033] The present invention also provides a computer device, characterized in that the computer device includes a processor and a memory: the memory is used to store program code and transmit the program code to the processor, the processor is used to execute the above-described automatic control method for oil and gas pipeline detection according to the instructions in the program code.
[0034] The present invention also provides a computer-readable storage medium, characterized in that the computer-readable storage medium is used to store program code and transmit the program code to a processor, the processor being used to execute the above-described automatic control method for oil and gas pipeline detection according to the instructions in the program code.
[0035] This invention achieves comprehensiveness and accuracy in scheduling decisions by collecting physical properties of oil and gas pipelines and multi-dimensional state parameters of detection equipment. The TCN network based on multi-head attention effectively captures the temporal dependencies between pipeline and equipment states, improving the accuracy of state prediction and providing a reliable basis for scheduling decisions. The factor graph model enables probabilistic quantitative analysis of pipeline and equipment states, scientifically assessing the execution risks of detection tasks. The introduction of time decay factors and remaining power redundancy value factors considers the dynamic changes in task urgency and equipment power redundancy, optimizing task priority ranking. Through real-time feedback and dynamic adjustment mechanisms, the scheduling scheme can adapt to state changes during the detection process, improving detection efficiency and resource utilization. Attached Figure Description
[0036] Figure 1 This is a schematic diagram of an automatic control method for detecting oil and gas pipelines;
[0037] Figure 2 This is a schematic diagram of an automatic control device for detecting oil and gas pipelines. Detailed Implementation
[0038] Example 1
[0039] like Figure 1 As shown, the present invention provides an automatic control method for oil and gas pipeline inspection, specifically including the following steps:
[0040] Step 1: Data Acquisition and Preprocessing
[0041] In step 1, physical property data of oil and gas pipelines and status parameters of detection equipment are collected. After cleaning and normalization, they are fused into pipeline feature vectors and equipment feature vectors. The pipeline physical property data includes pipeline diameter, material, burial depth, wall thickness, operating pressure, laying years, historical corrosion rate and segment length, and geographical coordinates. The detection equipment status parameters include inherent parameters such as maximum power and rated power of the detection equipment, as well as dynamic parameters such as real-time power, remaining power, working time, and distance from the target detection segment. Normalization is achieved by mapping parameter values to the [0,1] interval. The mapping formula is determined based on the minimum and maximum values of the parameters, providing standardized features for subsequent model input.
[0042] Specifically, step 1 includes:
[0043] Step 1.1 Collect physical property data of oil and gas pipelines, specifically including:
[0044] Step 1.1.1 Collect basic pipeline parameters. For example, collect physical property data of oil and gas pipelines, including pipeline diameter D (unit: mm), pipeline material M, such as X80 steel, L360 steel, etc., with pipeline material M represented by numerical code, pipeline burial depth H (unit: m), pipeline wall thickness W (unit: mm), pipeline operating pressure P (unit: MPa), pipeline transport medium type, such as crude oil, natural gas, refined oil, etc., and represented by numerical code, pipeline laying years Y (unit: years), and pipeline historical corrosion rate C0 (unit: mm / year).
[0045] Step 1.1.2 Collect pipeline segment information: Divide the target pipeline into N inspection segments, each with a length L. n (n = 1, 2, ..., N), and record the geographical coordinates of each detection segment, wherein the geographical coordinates of each detection segment are (longitude λ) n ,latitude ).
[0046] Step 1.2 Collect the status parameters of the detection equipment, specifically including:
[0047] Step 1.2.1 Collect inherent parameters of the testing equipment: including the equipment model K, the maximum power P of the testing equipment. max (Unit: W), Rated power of testing equipment (Q) nom (Unit: Ah), Sensor accuracy of detection equipment σ (Unit: %), Historical average power consumption of detection equipment P ave (Unit: W).
[0048] Step 1.2.2 Real-time acquisition of dynamic parameters of the detection equipment: including the current remaining power Q of the detection equipment. t (Unit: Ah), where t is the current time and the real-time power P of the detection device. t (Unit: W), Continuous working time of the testing equipment (t) on (Unit: h) Straight-line distance S between the detection equipment and the target detection section t (Unit: m)
[0049] Step 1.3 Data preprocessing, specifically including
[0050] Step 1.3.1 Data Cleaning: Remove outliers, for example, when the power of the detection device exceeds 0-P. max The range of values or negative values of the power are filled with missing values using linear interpolation.
[0051] Step 1.3.2 Data Normalization: Normalize the pipeline physical property data and the status parameters of the testing equipment, mapping the values to the [0,1] interval. Specifically, for parameter X, the normalized value is:
[0052]
[0053] Specifically, X min and X max These are the minimum and maximum values of the parameter, respectively.
[0054] Step 1.3.3 Feature Fusion: The physical attributes of the pipeline segments are fused with the corresponding geographical location information to form a pipeline feature vector F_pipe. n And the fusion of the detection equipment status parameters into the detection equipment feature vector F_equip t Specifically:
[0055]
[0056] F_equip t =[K′, P t ′, P max ′, Q t ′, Q nom ′,σ′,P ave ′, t on ′, S t ′]
[0057] The superscript ' for each parameter indicates the normalized value, and the parameters have been explained in steps 1.1-1.2.
[0058] Understandably, the physical properties of pipelines, such as material and corrosion rate, determine the urgency of inspection. Pipelines with poor corrosion resistance should be inspected first. Meanwhile, the status parameters of the inspection equipment, such as remaining power and real-time power, determine whether the equipment can complete the task. Without collecting this data, subsequent predictions, probabilistic analysis, and scheduling will lack a basis. Preprocessing can eliminate outlier interference, and normalization can ensure that parameters of different magnitudes, such as burial depth in meters and pressure in MPa, are treated uniformly, avoiding bias in data analysis due to differences in numerical ranges.
[0059] Furthermore, the processed feature vector provided in step 1 is the input to the TCN network in step 2. Without clean and standardized feature data, model training and state prediction will lose accuracy, and subsequent probability analysis, factor calculation and scheduling decisions will also be distorted.
[0060] Step 2: TCN network state prediction based on multi-head attention:
[0061] Specifically, in step 2, a network with a 3-layer causal dilated convolutional TCN layer and an 8-head attention mechanism is constructed. Using the time-series feature vector from step 1 as input, the network is trained and outputs predicted pipeline conditions within a preset future time period. These predicted conditions include the pipeline corrosion rate and leakage risk, as well as predicted equipment conditions, including real-time power and remaining power consumption rate. For example, the dilation coefficients of the TCN layer are 1, 2, and 4 respectively. The attention layer calculates weights using a query matrix, key matrix, and value matrix to focus on key temporal features. The prediction results provide a temporal basis for subsequent probabilistic analysis.
[0062] Specifically, step 2 includes the following steps:
[0063] Step 2.1 Network structure design, specifically including:
[0064] Step 2.1.1 Temporal Convolutional Network (TCN) Layer: A 3-layer causal convolutional structure is adopted, each layer containing dilated convolution operations, with the first layer having a dilation coefficient of 2. 0 =1, kernel size is 3, number of output channels is 64; the dilation coefficient of the second layer is 2. 1 =2, kernel size is 3, number of output channels is 128; the dilation coefficient of the 3rd layer is 2. 2 =4, kernel size is 3, and output channels are 256. Each convolutional layer is followed by a batch normalization layer and a ReLU activation function, and then added to the input features through residual connections.
[0065] Step 2.1.2 Multi-head Attention Layer: Set up 8 attention heads, each with an input dimension of 256 / 8 = 32. Perform a linear transformation on the feature matrix output by the TCN layer to obtain the query matrix, key matrix, and value matrix, each with dimensions of (sequence length, 8, 32). Calculate the attention weights for each attention head: For any attention head, the weight matrix is as follows. Where · denotes matrix multiplication. The scaling factor is used; the weight matrix of any attention head is multiplied by the value matrix to obtain the output of that attention head; the outputs of the eight attention heads are concatenated and then subjected to a linear transformation to obtain the final output of the multi-head attention layer.
[0066] Step 2.1.3 Output Layer: A fully connected layer is used to map the output of the multi-head attention layer to the prediction results, including pipeline state prediction values and detection equipment state prediction values.
[0067] Step 2.2 Network training and state prediction, specifically including
[0068] Step 2.2.1 Training data preparation: For example, select historical pipeline inspection data from the past 5 years, which includes pipeline physical properties and status labels such as corrosion rate and leakage risk for the corresponding time period, as well as inspection equipment operation data, which includes equipment status parameters and labels such as power change and power consumption for the corresponding time period. Construct a training sample set, where the input is a feature sequence of length T = 24 hours, sampled once per hour, and the output is the state prediction value for the future Δt = 6 hours.
[0069] Step 2.2.2 Model Training: The Adam optimizer is used with an initial learning rate of 0.001. The learning rate decays with each training epoch, with a decay coefficient of 0.95. The training epochs are 100, and the batch size is 32. The mean squared error (MSE) loss function is used, where the loss function Loss is:
[0070]
[0071] Specifically, among them For the predicted value, y i is the true label, and N is the number of samples.
[0072] Step 2.2.3 Pipeline State Prediction: Predict the pipeline feature vector F_equip t The time-series data is input into the trained network, which outputs a predicted corrosion rate for the detected segment over the next 6 hours. (Unit: mm / year), and simultaneously outputs the predicted probability value of leakage risk. in The value range of τ is [0, 1], and τ = 1, 2, 3...6 represents the τth hour in the future.
[0073] Step 2.2.4 Predicting the state of the detection equipment: Predict the feature vector F_equip of the detection equipment. t The time series sequence is input into the trained network, and the output is the real-time power prediction value of the device for the next 6 hours. (Unit: W) and predicted rate of remaining power consumption (Unit: Ah / h), and calculate the predicted remaining power in the next τ hours based on the remaining power consumption rate:
[0074]
[0075] Specifically, Δt′ = 1 hour is the sampling interval.
[0076] Understandably, the TCN layer uses three layers of causal dilated convolutions, which can capture temporal dependencies, while the multi-head attention layer, which involves eight attention heads, can capture the importance of different features. The output layer maps to the prediction results. The model is trained with historical data, with Adam as the optimizer and MSE as the loss function. The input is the current feature sequence, which predicts the pipeline status for the next 6 hours, such as corrosion rate and leakage risk, as well as the status of the detection equipment, such as real-time power and remaining power.
[0077] Understandably, pipeline and equipment conditions exhibit strong temporal characteristics; for example, corrosion intensifies over time, and power decreases with operating hours. TCN's dilated convolution can effectively capture long-term temporal dependencies, while multi-head attention can highlight key features. For instance, pipeline operating pressure has a greater impact on leakage risk than burial depth, thus improving prediction accuracy. Without condition prediction, subsequent analysis can only be based on the current state and cannot address future changes, such as the possibility that monitoring equipment may run out of power in a few hours, leading to short-sighted scheduling plans.
[0078] Therefore, the prediction results of step 2, such as the corrosion rate and remaining power in the next 6 hours, are the core inputs for the factor graph probability analysis in step 3. The factor graph needs to calculate the probability based on the future state, and it is also the basis for calculating the time decay factor and redundancy value factor in step 4. For example, the time decay factor depends on the changes in future leakage risk.
[0079] Step 3: Factor Graphical Model State Probability Analysis: Define pipeline state variables, including normal, slight corrosion, severe corrosion, and leakage. Simultaneously, equipment state variables include idle, normal operation, power overload, insufficient power, and observed variables.
[0080] The probabilistic relationships between variables are then quantified by constructing factor functions, and the posterior probabilities are calculated using the belief propagation algorithm to obtain the probability of successful detection, the probability of insufficient power, and the probability of power overload. The parameters of the factor functions are related to the pipe material, operating pressure, maximum power of the equipment, and remaining power. The probability results provide a quantitative basis for scheduling risk assessment.
[0081] Specifically, step 3 includes the following steps:
[0082] Step 3.1 Factor graph node definition, specifically including:
[0083] Step 3.1.1 Pipeline State Variables: Define the state variable X for each pipeline inspection segment n. n The values include {normal, slight corrosion, severe corrosion, leakage}, corresponding to the values [0, 1, 2, 3].
[0084] Step 3.1.2 Detection Equipment State Variables: Define the state variable Y for each detection device m. mThe values include {idle, normal operation, power overload, low battery}, corresponding to the values [0, 1, 2, 3].
[0085] Step 3.1.3 Observation Variables: Define the pipeline observation variable O n The pipeline observation variable O n The values are taken from the measured corrosion rate, the leak sensor signal, etc., and the observed variable Z of the detection equipment is defined. m The detection equipment observes variable Z. m The values are real-time power, measured remaining power, etc.
[0086] Step 3.2: Defining the factor function, specifically including:
[0087] Step 3.2.1 Pipeline State Factor Function: For each pipeline inspection segment n, the factor function... This indicates that, given the observation value O n Pipe physical properties F_pipe n Predicting corrosion rate and leakage risk In the case of state variable X n The probability distribution.
[0088] For example, the corrosion sensitivity coefficient α is determined based on the pipe material M, such as α = 0.8 for X80 steel and α = 0.0 for L360 steel. The pressure influence coefficient β = P / P is determined based on the operating pressure P. max -pipe, where P max -pipe represents the maximum allowable pressure of the pipeline, then X n The probability of "severe corrosion" and Proportional to the probability of "leakage" and It is directly proportional, where Y is the laying period, reflecting the impact of pipeline aging.
[0089] Step 3.2.2 Detection Equipment State Factor Function: For each detection equipment m, the factor function is... This means that, given the observed value Z m Device attribute F_equip m Predicted power and remaining battery power In this case, the state variable Y of the detection device m The probability distribution.
[0090] For example, the state variable Y of the detection device m The probability of "power overload" and It is directly proportional because the cube can reflect the nonlinear risk of power overload in the detection equipment, representing the probability of "insufficient power" as a function of the cube. It is directly proportional, and the exponential function can reflect that the risk of insufficient power increases sharply as the remaining power decreases.
[0091] Step 3.2.3 Correlation Factor Function: Define the factor function h mn =(X n Y m ), the h mn This represents the correlation between the detection capability of each detection device m and each pipeline inspection section n. Its value is inversely proportional to the sensor accuracy σ of the detection device; that is, the smaller the sensor accuracy σ, the lower the factor function h. mn The larger the value, the greater the distance S from the detection equipment to the detection section. t Inversely proportional, that is, the distance S from the detection equipment to the detection section t The smaller the factor function h mn The larger.
[0092] Step 3.3 Factor graph reasoning, specifically includes:
[0093] Step 3.3.1 Initialization: Initialize the variable node X for each factor function. n Y m Assign an initial probability distribution.
[0094] Step 3.3.2 Message Passing: The belief propagation algorithm is used to pass messages between the variable nodes and factor nodes. For the pipeline variable X... n , to factor node f n The message being transmitted is:
[0095] μ_X n →f n (X n ) = Π(Messages from other related factor nodes)
[0096] Furthermore, factor node f n To X n The message being transmitted is:
[0097]
[0098] It is understandable that the state variable Y of the detection device m The message transmission method is the same.
[0099] Step 3.3.3 Posterior probability calculation: After multiple rounds of message passing, the posterior probability of each pipeline state variable is calculated as follows:
[0100] P(X n (All observations and forecasts) =
[0101] (1 / Z)·μ_X n →X n (Xn )·Π(from other related factors h mn (News)
[0102] Where Z is the normalization constant; similarly, the posterior probability P(Y) of the state variable of the detection equipment is calculated. m (All observations and forecasts).
[0103] Step 3.4 Detection probability calculation, specifically including:
[0104] Step 3.4.1 The probability P_succ of detection equipment m successfully detecting pipe segment n. nm Based on the factor graph reasoning result P_succ nm =P(Y m = Normal work)·P(X) n Can be detected | Y m =Normal work) Calculation shows that P(X) n Can be detected | Y m = Normal operation) and pipeline status X n The severity is positively correlated with, for example, the detectability probability of a leak is 0.95, severe corrosion is 0.85, slight corrosion is 0.7, and normal is 0.1, and is negatively correlated with the sensor accuracy σ of the detection device.
[0105] Step 3.4.2 Probability that the detection device m cannot complete the detection due to insufficient power.
[0106]
[0107] Where Q_req nm The minimum electrical charge required to detect pipe segment n, namely Q_req nm =(L n / v)·(P ave / U), where v is the detection speed of the detection equipment (m / h) and U is the operating voltage of the equipment (V).
[0108] Step 3.4.3 Probability that the detection device m cannot complete the detection due to power overload
[0109]
[0110] Understandably, step 3 defines factor graph nodes: pipeline state variables (normal / corrosion / leakage, etc.), equipment state variables (idle / overload / insufficient power, etc.), and observation variables (measured corrosion rate, real-time power, etc.). It also defines factor functions to quantify the probabilistic relationships between nodes, such as the probability of "severe corrosion" in a pipeline being related to the predicted corrosion rate and material, and the probability of "power overload" in equipment being related to the predicted power and maximum power. Furthermore, it uses factor graph inference to calculate the posterior probabilities of pipeline and equipment states, such as the probability of successful detection and the probability of insufficient power, using a belief propagation algorithm.
[0111] It is understandable that the condition of pipelines and equipment is uncertain; for example, the predicted corrosion rate may be inaccurate. Factor graphs can quantify this uncertainty through probabilistic reasoning, transforming "whether it can be detected" into "the probability of successful detection," avoiding black-and-white judgments. For instance, when the remaining power of equipment is slightly higher than the demand, a factor graph can calculate "the probability of insufficient power due to a sudden increase in power consumption," which is more reasonable than simply judging "can / cannot be completed."
[0112] Therefore, the probability results output in step 4, such as the success probability and overload probability, are the key basis for calculating the scheduling score in step 5. The score needs to weigh the success probability and risk. At the same time, it provides quantitative data on the "power shortage risk" for the calculation of the redundancy value factor in step 4. For example, the redundancy factor needs to consider the probability of power shortage.
[0113] Step 4: Calculation of Time Decay Factor and Redundancy Value Factor: Based on the prediction results of Step 2, the urgency weight of pipeline detection and the key time point weight of equipment power redundancy are calculated through the TCN attention layer. Combined with the pipeline importance coefficient, the time decay factor is calculated. It can be understood that the time decay factor can reflect the value loss of task delay. By combining the time decay factor with the characteristics of redundant power and power fluctuation, the redundancy value factor is calculated, which can reflect the dynamic value of power redundancy. These two factor parameters are related to the predicted value of pipeline leakage risk and the predicted fluctuation of equipment power, providing dynamic quantitative indicators for scheduling priority.
[0114] Specifically, step 4 includes the following steps:
[0115] Step 4.1 Calculation of the time decay factor, specifically including:
[0116] Step 4.1.1 Attention-based TCN input features: Constructing temporal feature vectors Where τ represents the future τ-th hour (τ = 1, 2, 3, 4, 5, 6), and the time feature vector T_feat n (τ) reflects the urgency of inspection of pipeline segment n at different time points.
[0117] Step 4.1.2 Attention Weight Calculation: Calculate the attention weights for T_feat n (τ) Input the attention layer of the multi-head attention TCN network constructed in step 2 to obtain the attention weight ω at each time point τ. n (τ), and satisfy ∑ω n (τ)=1Σ, which can be understood as the attention weight ω at each time point τ. n The larger the (τ) value, the higher the urgency of detection at that point in time.
[0118] Step 4.1.3 Time decay factor λ n The calculation process for (τ) is as follows:
[0119] λ n (τ)=1-exp(-τ·ω n (τ)·γ n )
[0120] Where, γ n This refers to the pipeline importance coefficient, which can be understood as γ. n Based on the type of transported medium and geographical importance, an example is the natural gas trunk pipeline γ. n =0.3, crude oil pipeline γ n =0.15, λ n The value of (τ) ranges from [0, 1), and increases with the increase of τ. It can be further understood that the longer the task is delayed, the faster its value decays, that is, the more it needs to be executed first.
[0121] Step 4.2 Calculation of the remaining power redundancy value factor, specifically including:
[0122] Step 4.2.1 Redundancy Calculation: Calculate the redundancy Q_red of the detection device m in the next τ hours. m (τ), that is It should also be noted that Otherwise Q_red m (τ)=0
[0123] Step 4.2.2 Attention-based TCN input features: Constructing the battery feature vector Q_feat m (τ), specifically:
[0124]
[0125] Specifically, Q_feat m (τ) reflects the power redundancy correlation characteristics of the detection equipment m at different time points.
[0126] Step 4.2.3 Attention Weight Calculation: Calculate the attention weights from the battery feature vector Q_feat. m(τ) Input the attention layer of the multi-head attention TCN network to obtain the battery attention weight η at each time point τ. m (τ), and satisfy ∑η m (τ) = 1, where the weight η m The larger (τ) is, the more critical the power redundancy at that point in time is to the task execution.
[0127] Step 4.2.4 Calculate the redundancy value factor ρ m (τ): The specific calculation process is ρ m (τ)=(Q_red m (τ) / Q nom )·[1+∑η m [(τ′)·exp(-|τ-τ′|)], where τ′ is a future time point, ρ m (τ) takes values in the range [0, 1], is positively correlated with redundant power, and is affected by power fluctuations. It can be understood that the η corresponding to the time point with large power prediction fluctuations is... m (τ) is relatively large and can enhance the value weight of redundant power.
[0128] Understandably, the calculation of the time decay factor is based on the future leakage risk, corrosion rate, etc. predicted in step 2. The urgency weight of each time point is obtained using the attention layer of TCN. Then, the decay factor is calculated by formulas such as combining the pipeline importance coefficient. It can be seen that the larger the value, the higher the value loss of the task delay. The calculation of the redundancy value factor is based on the future remaining power predicted in step 2. Combined with real-time power fluctuations, the key time point weight of power redundancy is obtained using the attention layer. The redundancy factor is calculated. It can be seen that the larger the value, the higher the value of power redundancy.
[0129] Understandably, the time decay factor compensates for the deficiency of "only considering the current risk." Since the risk of pipeline leakage increases over time—for example, if the risk is predicted to double in 6 hours—delaying detection significantly increases the probability of an accident. Therefore, the factor needs to reflect the "value of early detection." The redundancy value factor compensates for the deficiency of "only considering whether the remaining power is sufficient." Power fluctuations in the detection equipment may cause actual power consumption to exceed expectations. The value of redundant power varies with the degree of power fluctuation; that is, when fluctuations are large, redundant power is more important. This value needs to be quantified to avoid mission interruption.
[0130] Therefore, the calculation of the two factors depends on the time-series prediction results of step 2, such as the risk of future time, the amount of electricity, and the probability distribution of step 3, such as the probability of power fluctuation. The calculation results will serve as the core indicators for the scheduling score in step 5. For example, the score should reflect the "urgency of the task" and the "reliability of power redundancy", so that the scheduling decision is more in line with the actual dynamic scenario.
[0131] Step 5: Task scheduling decision: Based on the probability results of Step 3 and the factors of Step 4, calculate the comprehensive score of the task-equipment combination, achieve optimal task allocation through the Hungarian algorithm, and output scheduling instructions including start time and path; the score integrates detection success probability, safety probability, time decay factor, redundancy factor and equipment distance weight to ensure that resource allocation matches task priority and equipment capability.
[0132] Specifically, step 5 includes the following steps:
[0133] Step 5.1 Generation of candidate task set, including:
[0134] Step 5.1.1 Determine the pipe section to be inspected: Screen out or P(X) n Pipe sections with a leakage rate greater than 0.1 are considered as the target detection set T = {T1, T2, ..., T...}. n , ...T N}, where n≤N, and N represents the target pipeline being divided into N detection sections.
[0135] Step 5.1.2 Task Parameter Definition: For each task T n Includes the detection time t_req n =l n / v, (unit: h), and synchronously obtain the required minimum charge Q_req according to step 3.4.2. nm At the same time, the required maximum power is obtained. (Unit: W), calculate the baseline value for task priority. It is understandable that this is in the calculation of priority baseline value B. n An initial priority is required, and B n Leakage risk and corrosion rate are positively correlated, and leaks and corrosion should be addressed as soon as they are detected.
[0136] Step 5.2 Scheduling score calculation, specifically including:
[0137] Step 5.2.1 For each task T to be detected n And the available testing equipment m, calculate the comprehensive score S nm ,Right now:
[0138] S nm =α1·P_succ nm +α2·(1-P_lowQ m )+α3·(1-P_overP m )+α4·(1-λ n (t_req n )+α5·ρ m (t_req n)+α6·(1-S t / L max )
[0139] Where α1-α6 are weighting coefficients, and they add up to 1. It can be understood that appropriate weight settings need to be made according to the actual situation during the detection process. Further, 1-λ n (t_req n ) represents the value retention of a task completed within a specified time, 1-S t / L max L represents the weight of the distance between the device and the mission location. max This represents the total length of the pipeline.
[0140] Step 5.3 Task allocation optimization, specifically including:
[0141] Step 5.3.1 Construct a bipartite graph: With task set T as the left node and detection device set M as the right node, the comprehensive score S... nm Set as edge weight.
[0142] Step 5.3.2 Hungarian Algorithm Solution: The Hungarian algorithm is used to find the maximum weight matching in the bipartite graph, ensuring that each task is assigned to the device with the highest score, and each device is assigned at most one task. If the device has enough remaining power to support multiple tasks, multiple task allocation can be achieved by splitting the tasks.
[0143] Step 5.3.3 Conflict Detection and Adjustment: If the allocation results show that the detection device m is simultaneously assigned multiple tasks and the total power required exceeds its remaining power, or the total time required exceeds the device's continuous working limit, then reduce the weight of the low-scoring task and repeat step 5.3.2 until there are no conflicts.
[0144] Step 5.4: Output the scheduling scheme, which specifically includes:
[0145] Step 5.4.1 Generate scheduling instructions: Output the corresponding detection task T for each detection device m. n This includes the task start time t_start, the detection path planned based on geographic coordinates, and the expected completion time t_tnd = t_start + t_req. n .
[0146] Step 5.4.2 Resource reservation: Based on the power and energy required for the task, reserve power and energy resources for the detection device m to avoid conflict allocation.
[0147] Understandably, this step involves generating a candidate task set: filtering out pipe sections with leakage risk or severe corrosion probability exceeding a threshold, such as leakage risk > 0.1; calculating a scheduling score: for each task-equipment combination, integrating detection success probability, power / electricity safety probability, time decay factor, redundancy factor, etc., to obtain a comprehensive score; task allocation: using the Hungarian algorithm to find the maximum weight match in the task-equipment bipartite graph to avoid resource conflicts; and outputting scheduling instructions, such as start time, path, etc.
[0148] Understandably, candidate task set selection ensures resources are concentrated on high-priority tasks, such as pipelines about to leak. Scheduling scoring quantifies multi-dimensional metrics (probability, time, power consumption) into a single score, making different task-device combinations comparable. The Hungarian algorithm can find the optimal allocation in multi-task, multi-device scenarios, such as matching high-success-rate devices with high-risk tasks, avoiding the subjectivity and inefficiency of manual allocation.
[0149] Understandably, in this step, the candidate task set is based on the probability analysis in step 3, such as leakage risk. The scoring calculation depends on the probability results in step 3 and the factors in step 4. The allocation results need to be adjusted in real time in step 6 to adapt to actual changes, and finally an executable scheduling scheme is output.
[0150] Step 6: Real-time feedback and dynamic adjustment: Update equipment and pipeline status data every preset time interval, incrementally update the network model in step 2, repeat steps 3-5 to adjust the scheduling scheme, adapt to real-time status changes, and ensure scheduling timeliness.
[0151] Specifically, step 6 includes the following steps:
[0152] Step 6.1 Real-time data update: Collect the status parameters of the detection equipment every Δt = 30 minutes, exemplarily including P t Q t S t Parameters and temporary pipeline observation data, such as sudden corrosion signals, are used to update the feature vector F_pipe in real time. n and F_equip t .
[0153] Step 6.2 Incremental Model Update: Based on the newly collected data, the multi-head attention TCN network is incrementally trained for 10 training rounds with a learning rate of 0.1 times the initial value, and the state prediction model is updated.
[0154] Step 6.3 Re-optimize the scheduling scheme: Repeat steps 3-5, recalculate the scheduling score based on the updated state prediction results and probability analysis, and adjust the task allocation scheme. If the current task has been executed more than 50%, then the task will not be adjusted.
[0155] 6.1 Real-time data updates: Collect real-time power, remaining power, and temporary pipeline signals (such as sudden corrosion) every 30 minutes to update the feature vector; 6.2 Incremental model updates: Fine-tune the TCN network with new data (few training rounds, low learning rate) to avoid model obsolescence; 6.3 Re-optimize scheduling scheme: Recalculate scores and adjust allocations based on updated predictions and probability analysis (no adjustment is made for tasks that have been executed more than 50%).
[0156] Understandably, during the testing process, equipment may experience sudden power overloads, such as when encountering complex terrain or when pipelines experience sudden and severe corrosion. Relying on initial data for decision-making can lead to a disconnect between the scheduling plan and reality. For example, tasks assigned according to initial predictions may fail to be completed due to accelerated equipment power consumption. Real-time updates can capture these dynamic changes, incremental model updates ensure prediction accuracy, and re-optimization ensures that the plan always adapts to the current state.
[0157] Understandably, this step addresses the limitations of static scheduling by connecting steps 1 (data update), 2 (model update), and 3-5 (reanalysis and decision-making) through feedback, ensuring that the entire process from data acquisition to solution execution can cope with the uncertainties of real-world scenarios.
[0158] Understandably, this application employs the following steps: Step 1 provides basic data → Step 2 predicts future states based on the data → Step 3 transforms the prediction into a probability distribution → Step 4 calculates dynamic factors based on probability → Step 5 achieves optimal scheduling using probability and factors → Step 6 maintains scheduling timeliness through real-time feedback. Each step relies on the output of the preceding step and provides input for subsequent steps, forming a complete closed loop of "data-prediction-analysis-decision-feedback," ultimately achieving intelligent scheduling that balances pipeline risks and monitoring equipment capabilities.
[0159] Example 2
[0160] like Figure 2 As shown, this invention provides an automatic control device for oil and gas pipeline inspection, specifically including the following modules: a data acquisition and preprocessing module, a TCN network state prediction module based on multi-head attention, a factor graph model state probability analysis module, a time decay factor and redundancy value factor calculation module, a task scheduling decision module, and a real-time feedback and dynamic adjustment module; wherein:
[0161] The data acquisition and preprocessing module is used to collect physical property data of oil and gas pipelines and status parameters of detection equipment. After cleaning and normalization, the data is fused into pipeline feature vectors and equipment feature vectors. The pipeline physical property data includes pipeline diameter, material, burial depth, wall thickness, operating pressure, laying years, historical corrosion rate, segment length, and geographical coordinates. The detection equipment status parameters include inherent parameters such as maximum power and rated power of the detection equipment, as well as dynamic parameters such as real-time power, remaining power, operating time, and distance from the target detection segment. Normalization is achieved by mapping parameter values to the [0,1] interval. The mapping formula is determined based on the minimum and maximum values of the parameters, providing standardized features for subsequent model input.
[0162] Specifically, the data acquisition and preprocessing module includes:
[0163] Collect physical property data of oil and gas pipelines, specifically including:
[0164] Collect basic pipeline parameters. For example, collect physical property data of oil and gas pipelines, including pipeline diameter D (unit: mm), pipeline material M, such as X80 steel, L360 steel, etc., with pipeline material M represented by numerical code, pipeline burial depth H (unit: m), pipeline wall thickness W (unit: mm), pipeline operating pressure P (unit: MPa), pipeline transport medium type, such as crude oil, natural gas, refined oil, etc., also represented by numerical code, pipeline laying years Y (unit: years), and pipeline historical corrosion rate C0 (unit: mm / year).
[0165] Collect pipeline segment information: Divide the target pipeline into N inspection segments, each with a length L. n (n = 1, 2, ..., N), and record the geographical coordinates of each detection segment, wherein the geographical coordinates of each detection segment are (longitude λ) n ,latitude ).
[0166] The status parameters of the collected detection equipment include:
[0167] Collect the inherent parameters of the testing equipment: including the equipment model K, the maximum power P of the testing equipment. max (Unit: W), Rated power of testing equipment (Q) nom (Unit: Ah), Sensor accuracy of detection equipment σ (Unit: %), Historical average power consumption of detection equipment P ave (Unit: W).
[0168] Real-time acquisition of dynamic parameters of the testing equipment: including the current remaining power Q of the testing equipment. t (Unit: Ah), where t is the current time and the real-time power P of the detection device. t(Unit: W), Continuous working time of the testing equipment (t) on (Unit: h) Straight-line distance S between the detection equipment and the target detection section t (Unit: m)
[0169] Data preprocessing, specifically including
[0170] Data cleaning: removing outliers, for example when the power of the detection device exceeds 0-P. max The range of values or negative values of the power are filled with missing values using linear interpolation.
[0171] Data normalization: The physical property data of the pipeline and the status parameters of the testing equipment are normalized, mapping the values to the [0,1] interval. Specifically, for parameter X, the normalized value is:
[0172]
[0173] Specifically, X min and X max These are the minimum and maximum values of the parameter, respectively.
[0174] Feature fusion: The physical attributes of pipeline segments are fused with their corresponding geographical location information to form a pipeline feature vector F_pipe. n And the fusion of the detection equipment status parameters into the detection equipment feature vector F-equip t Specifically:
[0175]
[0176] F_equip t =[K′, P t ′, P max ′, Q t ′, Q nom ′,σ′,P ave ′, t on ′, S t ′]
[0177] The superscript ' for each parameter indicates the normalized value, and the parameters have been explained in the modules mentioned above.
[0178] Understandably, the physical properties of pipelines, such as material and corrosion rate, determine the urgency of inspection. Pipelines with poor corrosion resistance should be inspected first. Meanwhile, the status parameters of the inspection equipment, such as remaining power and real-time power, determine whether the equipment can complete the task. Without collecting this data, subsequent predictions, probabilistic analysis, and scheduling will lack a basis. Preprocessing can eliminate outlier interference, and normalization can ensure that parameters of different magnitudes, such as burial depth in meters and pressure in MPa, are treated uniformly, avoiding bias in data analysis due to differences in numerical ranges.
[0179] Furthermore, this module provides processed feature vectors as input to the TCN network for all subsequent modules. Without clean and standardized feature data, model training and state prediction will lose accuracy, and subsequent probability analysis, factor calculation, and scheduling decisions will also be distorted.
[0180] The TCN network state prediction module based on multi-head attention is used to construct a network with a TCN layer containing 3 layers of causal dilated convolution and an 8-head attention mechanism. It takes the feature vector time sequence as input, and after training, outputs the predicted value of the pipeline state within a preset time period, including the pipeline corrosion rate and leakage risk, as well as the predicted value of the equipment state, including real-time power and remaining power consumption rate.
[0181] For example, the expansion coefficients of the TCN layer are 1, 2, and 4 respectively. The attention layer calculates weights through the query matrix, key matrix, and value matrix to focus on key temporal features. The prediction results provide temporal basis for subsequent probability analysis.
[0182] Specifically, network architecture design includes:
[0183] Temporal Convolutional Network (TCN) Layers: Employs a 3-layer causal convolutional structure, with each layer containing dilated convolution operations. The dilation coefficient of the first layer is 2. 0 =1, kernel size is 3, number of output channels is 64; the dilation coefficient of the second layer is 2. 1 =2, kernel size is 3, number of output channels is 128; the dilation coefficient of the 3rd layer is 2. 2 =4, kernel size is 3, and output channels are 256. Each convolutional layer is followed by a batch normalization layer and a ReLU activation function, and then added to the input features through residual connections.
[0184] Multi-head attention layer: Eight attention heads are set, each with an input dimension of 256 / 8 = 32. A linear transformation is performed on the feature matrix output by the TCN layer to obtain the query matrix, key matrix, and value matrix, each with dimensions (sequence length, 8, 32). The attention weights for each attention head are calculated: For any attention head, the weight matrix is... Where · denotes matrix multiplication. The scaling factor is used; the weight matrix of any attention head is multiplied by the value matrix to obtain the output of that attention head; the outputs of the eight attention heads are concatenated and then subjected to a linear transformation to obtain the final output of the multi-head attention layer.
[0185] Output layer: A fully connected layer is used to map the output of the multi-head attention layer to the prediction results, including pipeline status predictions and detection equipment status predictions.
[0186] Network training and state prediction, specifically including:
[0187] Training data preparation: For example, historical pipeline inspection data from the past 5 years are selected, which includes pipeline physical properties and status labels such as corrosion rate and leakage risk for the corresponding time period, as well as inspection equipment operation data, which includes equipment status parameters and labels such as power change and power consumption for the corresponding time period. A training sample set is constructed, where the input is a feature sequence of length T = 24 hours, sampled once per hour, and the output is the state prediction value for the next Δt = 6 hours.
[0188] Model training: The Adam optimizer was used with an initial learning rate of 0.001. The learning rate decayed with each training epoch, with a decay coefficient of 0.95. The training epochs were 100, and the batch size was 32. The mean squared error (MSE) loss function was used, with the loss function Loss as follows:
[0189]
[0190] Specifically, among them For the predicted value, y i is the true label, and N is the number of samples.
[0191] Pipeline state prediction: The pipeline feature vector F_equip t The time-series data is input into the trained network, which outputs a predicted corrosion rate for the detected segment over the next 6 hours. (Unit: mm / year), and simultaneously outputs the predicted probability value of leakage risk. in The value range of τ is [0, 1], and τ = 1, 2, 3...6 represents the τth hour in the future.
[0192] Equipment status prediction: Predict the equipment status using the feature vector F_equip. t The time series sequence is input into the trained network, and the output is the real-time power prediction value of the device for the next 6 hours. (Unit: W) and predicted rate of remaining power consumption (Unit: Ah / h), and calculate the predicted remaining power in the next τ hours based on the remaining power consumption rate:
[0193]
[0194] Specifically, Δt′ = 1 hour is the sampling interval.
[0195] Understandably, the TCN layer uses three layers of causal dilated convolutions, which can capture temporal dependencies, while the multi-head attention layer, which involves eight attention heads, can capture the importance of different features. The output layer maps to the prediction results. The model is trained with historical data, with Adam as the optimizer and TCN as the loss function. The input is the current feature sequence, which predicts the pipeline status for the next 6 hours, such as corrosion rate and leakage risk, as well as the status of the detection equipment, such as real-time power and remaining power.
[0196] Understandably, pipeline and equipment conditions exhibit strong temporal characteristics; for example, corrosion intensifies over time, and power decreases with operating hours. TCN's dilated convolution can effectively capture long-term temporal dependencies, while multi-head attention can highlight key features. For instance, pipeline operating pressure has a greater impact on leakage risk than burial depth, thus improving prediction accuracy. Without condition prediction, subsequent analysis can only be based on the current state and cannot address future changes, such as the possibility that monitoring equipment may run out of power in a few hours, leading to short-sighted scheduling plans.
[0197] Therefore, the prediction results of this module, such as the corrosion rate and remaining power in the next 6 hours, are the core inputs of the factor graph probability analysis. The factor graph needs to calculate the probability based on the future state, and it is also the basis for calculating the time decay factor and the redundancy value factor. For example, the time decay factor depends on the changes in future leakage risk.
[0198] The factor graph model state probability analysis module is used to define pipeline state variables, including normal, minor corrosion, severe corrosion, and leakage. Equipment state variables include idle, normal operation, power overload, insufficient power, and observation variables.
[0199] The probabilistic relationships between variables are then quantified by constructing factor functions, and the posterior probabilities are calculated using the belief propagation algorithm to obtain the probability of successful detection, the probability of insufficient power, and the probability of power overload. The parameters of the factor functions are related to the pipe material, operating pressure, maximum power of the equipment, and remaining power. The probability results provide a quantitative basis for scheduling risk assessment.
[0200] Specifically, pipeline state variables: Define the state variable X for each pipeline inspection segment n. n The values include {normal, slight corrosion, severe corrosion, leakage}, corresponding to the values [0, 1, 2, 3].
[0201] Detection equipment state variables: Define the state variable Y for each detection device m. mThe values include {idle, normal operation, power overload, low battery}, corresponding to the values [0, 1, 2, 3].
[0202] Observed variable: Define the pipeline observed variable O n The pipeline observation variable O n The values are taken from the measured corrosion rate, the leak sensor signal, etc., and the observed variable Z of the detection equipment is defined. m The detection equipment observes variable Z. m The values are real-time power, measured remaining power, etc.
[0203] The factor function is defined, specifically including:
[0204] Pipeline state factor function: For each pipeline inspection segment n, the factor function is... This indicates that, given the observation value O n Pipe physical properties F_pipe n Predicting corrosion rate and leakage risk In the case of state variable X n The probability distribution.
[0205] For example, the corrosion sensitivity coefficient α is determined based on the pipe material M, such as α = 0.8 for X80 steel and α = 1.0 for L360 steel. The pressure influence coefficient β = P / P is determined based on the operating pressure P. max -pipe, where P max -pipe represents the maximum allowable pressure of the pipeline, then X n The probability of "severe corrosion" and Proportional to the probability of "leakage" and It is directly proportional, where Y is the laying period, reflecting the impact of pipeline aging.
[0206] Detection equipment state factor function: For each detection device m, the factor function is... This means that, given the observed value Z m Device attribute F_equip m Predicted power and remaining battery power In this case, the state variable Y of the detection device m The probability distribution.
[0207] For example, the state variable Y of the detection device m The probability of "power overload" and It is directly proportional because the cube can reflect the nonlinear risk of power overload in the detection equipment, representing the probability of "insufficient power" as a function of the cube. It is directly proportional, and the exponential function can reflect that the risk of insufficient power increases sharply as the remaining power decreases.
[0208] Correlation factor function: Define factor function h mn =(X n Y m ), the h mn This represents the correlation between the detection capability of each detection device m and each pipeline inspection section n. Its value is inversely proportional to the sensor accuracy σ of the detection device; that is, the smaller the sensor accuracy σ, the lower the factor function h. mn The larger the value, the greater the distance S from the detection equipment to the detection section. t Inversely proportional, that is, the distance S from the detection equipment to the detection section t The smaller the factor function h mn The larger.
[0209] Factor graph reasoning specifically includes:
[0210] Initialization: Variable node X for each factor function n Y m Assign an initial probability distribution.
[0211] Message passing: A belief propagation algorithm is used to pass messages between the variable nodes and factor nodes. For the pipeline variable X... n , to factor node f n The message being transmitted is:
[0212] μ_X n →f n (X n ) = Π(Messages from other related factor nodes)
[0213] Furthermore, factor node f n To X n The message being transmitted is:
[0214]
[0215] It is understandable that the message transmission method for the status variables of the detection devices is the same.
[0216] Posterior probability calculation: After multiple rounds of message passing, the posterior probability of each pipeline state variable is calculated as follows:
[0217] P(X n (All observations and forecasts) =
[0218] (1 / Z)·μ_X n →X n (X n )·Π(from other related factors h mn (News)
[0219] Where Z is the normalization constant; similarly, the posterior probability P(Y) of the state variable of the detection equipment is calculated. m (All observations and forecasts).
[0220] The detection probability calculation specifically includes:
[0221] The probability P_succ of detection equipment m successfully detecting pipe segment n nm Based on the factor graph reasoning result P_succ nm =P(Y m = Normal work)·P(X) n Can be detected | Y m =Normal work) Calculation shows that P(X) n Y can be detected m = Normal operation and pipeline status X n The severity is positively correlated with, for example, the detectability probability of a leak is 0.95, severe corrosion is 0.85, slight corrosion is 0.7, and normal is 0.1, and is negatively correlated with the sensor accuracy σ of the detection device.
[0222] The probability that the testing device m cannot complete the test due to insufficient power.
[0223]
[0224] Where Q_req nm The minimum electrical charge required to detect pipe segment n, namely Q_req nm =(L n / v)·(P ave / U), where v is the detection speed of the detection equipment (m / h) and U is the operating voltage of the equipment (V).
[0225] The probability that the testing equipment m cannot complete the test due to power overload.
[0226]
[0227] Understandably, this module implements the definition of factor graph nodes: pipeline state variables (normal / corrosion / leakage, etc.), equipment state variables (idle / overload / insufficient power, etc.), and observation variables (measured corrosion rate, real-time power, etc.). It also quantifies the probabilistic relationships between nodes by defining factor functions, such as the probability of "severe corrosion" in a pipeline being related to the predicted corrosion rate and material, and the probability of "power overload" in equipment being related to the predicted power and maximum power. Furthermore, it uses factor graph inference to calculate the posterior probabilities of pipeline and equipment states, such as the probability of successful detection and the probability of insufficient power, using a belief propagation algorithm.
[0228] It is understandable that the condition of pipelines and equipment is uncertain; for example, the predicted corrosion rate may be inaccurate. Factor graphs can quantify this uncertainty through probabilistic reasoning, transforming "whether it can be detected" into "the probability of successful detection," avoiding black-and-white judgments. For instance, when the remaining power of equipment is slightly higher than the demand, a factor graph can calculate "the probability of insufficient power due to a sudden increase in power consumption," which is more reasonable than simply judging "can / cannot be completed."
[0229] Therefore, the output probability results, such as the probability of successful detection and the probability of overload, are the key basis for calculating the scheduling score. The score needs to weigh the success probability and the risk. At the same time, it provides quantitative data on the "power shortage risk" for the calculation of the redundancy value factor. For example, the redundancy factor needs to consider the probability of power shortage.
[0230] The module for calculating time decay factor and redundancy value factor is used to calculate the prediction results of the TCN network state prediction module based on multi-head attention. It calculates the urgency weight of pipeline detection and the key time point weight of equipment power redundancy through the TCN attention layer, and combines this with the pipeline importance coefficient to calculate the time decay factor. This reflects the value loss due to task delays. The redundancy value factor is calculated by combining the time decay factor with redundant power and power fluctuation characteristics, reflecting the dynamic value of power redundancy. These two factor parameters are correlated with the predicted pipeline leakage risk and the predicted equipment power fluctuation, providing dynamic quantitative indicators for scheduling priority.
[0231] Specifically, the calculation of the time decay factor includes:
[0232] Attention-based TCN input features: constructing a temporal feature vector Where τ represents the future τ-th hour (τ = 1, 2, 3, 4, 5, 6), and the time feature vector T_feat n (τ) reflects the urgency of inspection of pipeline segment n at different time points.
[0233] Attention weight calculation: T_feat n (τ) Input the attention layer of the constructed multi-head attention TCN network to obtain the attention weight ω at each time point τ. n (τ), and satisfy ∑ω n (τ)=1Σ, which can be understood as the attention weight ω at each time point τ. n The larger the (τ) value, the higher the urgency of detection at that point in time.
[0234] Time decay factor λ n The calculation process for (τ) is as follows:
[0235] λ n (τ)=1-exp(-τ·ωn (τ)·γ n )
[0236] Where, γ n This refers to the pipeline importance coefficient, which can be understood as γ. n Based on the type of transported medium and geographical importance, an example is the natural gas trunk pipeline γ. n =0.3, crude oil pipeline γ n =0.15, λ n The value of (τ) ranges from [0, 1), and increases with the increase of τ. It can be further understood that the longer the task is delayed, the faster its value decays, that is, the more it needs to be executed first.
[0237] The calculation of the remaining power redundancy value factor specifically includes:
[0238] Redundant power calculation: Calculate the redundant power Q_red of the detection device m in the next τ hours. m (τ), that is
[0239] At the same time, it is important to note that Otherwise Q_re m (τ)=0
[0240] Attention-based TCN input features: Constructing the battery feature vector Q_feat m (τ), specifically:
[0241]
[0242] Specifically, Q_feat m (τ) reflects the power redundancy correlation characteristics of the detection equipment m at different time points.
[0243] Attention weight calculation: The battery feature vector Q_feat m (τ) Input the attention layer of the multi-head attention TCN network to obtain the battery attention weight η at each time point τ. m (τ), and satisfy ∑η m (τ) = 1, where the weight η m The larger (τ) is, the more critical the power redundancy at that point in time is to the task execution.
[0244] Calculate the redundancy value factor ρ m (τ): The specific calculation process is ρ m (τ)=(Q_red m (τ) / Q nom )·[1+∑η m [(τ′)·exp(-|τ-τ′|)], where τ′ is a future time point, ρm (τ) takes values in the range [0, 1], is positively correlated with redundant power, and is affected by power fluctuations. It can be understood that the η corresponding to the time point with large power prediction fluctuations is... m (τ) is relatively large and can enhance the value weight of redundant power.
[0245] Understandably, the calculation of the time decay factor is based on the predicted future leakage risk, corrosion rate, etc. The attention layer of TCN is used to obtain the urgency weight of each time point, and then the decay factor is calculated by formulas such as combining the pipeline importance coefficient. It can be seen that the larger the value, the higher the value loss of the task delay. The calculation of the redundancy value factor is based on the predicted future remaining power, combined with real-time power fluctuations, and the attention layer is used to obtain the key time point weight of power redundancy. The redundancy factor is calculated, and it can be seen that the larger the value, the higher the value of power redundancy.
[0246] Understandably, the time decay factor compensates for the deficiency of "only considering the current risk." Since the risk of pipeline leakage increases over time—for example, if the risk is predicted to double in 6 hours—delaying detection significantly increases the probability of an accident. Therefore, the factor needs to reflect the "value of early detection." The redundancy value factor compensates for the deficiency of "only considering whether the remaining power is sufficient." Power fluctuations in the detection equipment may cause actual power consumption to exceed expectations. The value of redundant power varies with the degree of power fluctuation; that is, when fluctuations are large, redundant power is more important. This value needs to be quantified to avoid mission interruption.
[0247] Therefore, the calculation of the two factors depends on the time-series prediction results, such as the risk, power consumption, and probability distribution of future time, such as the probability of power fluctuations. The calculation results will serve as the core indicators for scheduling scoring. For example, the scoring needs to reflect "task urgency" and "power redundancy reliability" to make scheduling decisions more in line with actual dynamic scenarios.
[0248] The task scheduling decision module is used to calculate the comprehensive score of the task-equipment combination based on the probability results and factors of the factor graph model state probability analysis module. It achieves optimal task allocation through the Hungarian algorithm and outputs scheduling instructions containing start time and path. The score integrates detection success probability, safety probability, time decay factor, redundancy factor and equipment distance weight to ensure that resource allocation matches task priority and equipment capability.
[0249] Candidate task set generation includes:
[0250] Identify the pipe section to be inspected: Filter out P(X) n =Severe corrosion) >0.3
[0251] or P(X) n Pipe sections with a leakage rate greater than 0.1 are considered as the target detection set T = {T1, T2, ..., T...}. n ,..TN}, where n≤N, and N represents the target pipeline being divided into N detection sections.
[0252] Task parameter definition: Each task T n Includes the detection time t_req n =l n / v, (unit: h), and synchronously obtain the required minimum charge Q_req according to step 3.4.2. nm At the same time, the required maximum power is obtained. (Unit: W), calculate the baseline value for task priority. It is understandable that this is in the calculation of priority baseline value B. n An initial priority is required, and B n Leakage risk and corrosion rate are positively correlated, and leaks and corrosion should be addressed as soon as they are detected.
[0253] The scheduling score calculation specifically includes:
[0254] For each task T to be detected n And the available testing equipment m, calculate the comprehensive score S nm ,Right now:
[0255] S nm =α1·P_succ nm +α2·(1-P_lowQ m )+α3·(1-P_overP m )+α4·(1-λ n (t_req n )+α5·ρ m (t_req n )+α6·(1-S t / L max )
[0256] Where α1-α6 are weighting coefficients, and they add up to 1. It can be understood that appropriate weight settings need to be made according to the actual situation during the detection process. Further, 1-λ n (t_req n ) represents the value retention of a task completed within a specified time, 1-S t / L max L represents the weight of the distance between the device and the mission location. max This represents the total length of the pipeline.
[0257] Task allocation optimization includes:
[0258] Construct a bipartite graph: with task set T as the left node and detection device set M as the right node, and the comprehensive score S... nm Set as edge weight.
[0259] Solution using the Hungarian algorithm: The Hungarian algorithm is used to find the maximum weight matching in the bipartite graph, ensuring that each task is assigned to the device with the highest score, and each device is assigned at most one task. If the device has enough remaining power to support multiple tasks, task splitting can be used to achieve multi-task allocation.
[0260] Conflict detection and adjustment: If the allocation results show that a detection device m is simultaneously assigned multiple tasks and the total power required exceeds its remaining power, or the total time required exceeds the device's continuous working limit, then the weight of the low-scoring task is reduced, and the above function is re-executed until there are no conflicts.
[0261] The scheduling scheme output includes:
[0262] Generate scheduling instructions: Output the corresponding detection task T for each detection device m. n This includes the task start time t_start, the detection path planned based on geographic coordinates, and the expected completion time t_end = t_start + t_req. n .
[0263] Resource reservation: Based on the power and energy required for the task, reserve power and energy resources for the detection device m to avoid conflict allocation.
[0264] Understandably, this module generates a candidate task set: filtering out pipe sections with leakage risk or severe corrosion probability exceeding a threshold, such as leakage risk > 0.1; calculates a scheduling score: for each task-equipment combination, it integrates the probability of successful detection, power / electricity safety probability, time decay factor, redundancy factor, etc., to obtain a comprehensive score; assigns tasks: using the Hungarian algorithm to find the maximum weight match in the task-equipment bipartite graph to avoid resource conflicts; and outputs scheduling instructions, such as start time and path.
[0265] Understandably, candidate task set selection ensures resources are concentrated on high-priority tasks, such as pipelines about to leak. Scheduling scoring quantifies multi-dimensional metrics (probability, time, power consumption) into a single score, making different task-device combinations comparable. The Hungarian algorithm can find the optimal allocation in multi-task, multi-device scenarios, such as matching high-success-rate devices with high-risk tasks, avoiding the subjectivity and inefficiency of manual allocation.
[0266] Understandably, the candidate task set in this module is based on probability analysis, such as leakage risk. The scoring calculation depends on the probability results and the calculated factors. The allocation results need to be adjusted in real time to adapt to actual changes, and finally an executable scheduling scheme is output.
[0267] The real-time feedback and dynamic adjustment module is used to update the status data of equipment and pipelines at preset time intervals, incrementally update the network model of the TCN network status prediction module based on multi-head attention, and repeat the adjustment of the scheduling scheme by other modules to adapt to real-time status changes and ensure scheduling timeliness.
[0268] The real-time feedback and dynamic adjustment module includes real-time data updates: it collects the status parameters of the detection equipment every Δt = 30 minutes, exemplarily including P... t Q t S t Parameters and temporary pipeline observation data, such as sudden corrosion signals, are used to update the feature vector F_pipe in real time. n and F_equip t .
[0269] Incremental model update: Based on newly collected data, the multi-head attention TCN network is incrementally trained for 10 training rounds with a learning rate of 0.1 times the initial value to update the state prediction model.
[0270] Re-optimize the scheduling scheme: Repeat the above functional process, recalculate the scheduling score based on the updated status prediction results and probability analysis, and adjust the task allocation scheme. If the current task has been executed more than 50%, then the task will not be adjusted.
[0271] Understandably, the following measures are implemented: 6.1 Real-time data updates: real-time power consumption, remaining power, and temporary pipeline signals (such as sudden corrosion) are collected every 30 minutes to update the feature vector; 6.2 Incremental model updates: the TCN network is fine-tuned with new data, using a small number of training epochs and a low learning rate to avoid model obsolescence; 6.3 Re-optimized scheduling scheme: based on the updated predictions and probability analysis, the scores are recalculated and the allocation is adjusted, while tasks that have been executed more than 50% are not adjusted.
[0272] Understandably, during the testing process, equipment may experience sudden power overloads, such as when encountering complex terrain or when pipelines experience sudden and severe corrosion. Relying on initial data for decision-making can lead to a disconnect between the scheduling plan and reality. For example, tasks assigned according to initial predictions may fail to be completed due to accelerated equipment power consumption. Real-time updates can capture these dynamic changes, incremental model updates ensure prediction accuracy, and re-optimization ensures that the plan always adapts to the current state.
[0273] Understandably, this module addresses the limitations of static scheduling through the aforementioned functional modules, ensuring that the entire process from data acquisition to solution execution can cope with the uncertainties of real-world scenarios.
[0274] Understandably, this application employs a data acquisition and preprocessing module to provide basic data → a TCN network state prediction module based on multi-head attention to predict future states based on the data → a factor graph model state probability analysis module to transform the predictions into probability distributions → a time decay factor and redundancy value factor calculation module to calculate dynamic factors based on probability → a task scheduling decision module to achieve optimal scheduling using probability and factors → and a real-time feedback and dynamic adjustment module to maintain scheduling timeliness through real-time feedback. Each module relies on the output of the preceding module and also provides input for subsequent modules, forming a complete closed loop of "data-prediction-analysis-decision-feedback," ultimately achieving intelligent scheduling that balances pipeline risks and detection equipment capabilities.
[0275] The present invention also relates to a computer device, characterized in that the computer device includes a processor and a memory: the memory is used to store program code and transmit the program code to the processor, the processor being used to execute an automatic control method for oil and gas pipeline detection as described in the above method embodiments according to the instructions in the program code.
[0276] The present invention also relates to a computer-readable storage medium, characterized in that the computer-readable storage medium is used to store program code and transmit the program code to a processor, the processor being used to execute an automatic control method for oil and gas pipeline detection as described in the above method embodiments according to the instructions in the program code.
[0277] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
Claims
1. A method of automatic control of oil and gas pipeline inspection, characterized in that: Includes the following steps: Step 1: Data Acquisition and Preprocessing. Physical property data of oil and gas pipelines and status parameters of detection equipment are collected. After cleaning and normalization, these are fused into pipeline feature vectors and equipment feature vectors. Pipeline physical property data includes pipeline diameter, material, burial depth, wall thickness, operating pressure, laying years, historical corrosion rate, segment length, and geographical coordinates. Detection equipment status parameters include maximum power, rated power inherent parameters and real-time power, remaining power, operating time, and distance from the target detection segment. Normalization is achieved by mapping parameter values to the [0,1] interval. The mapping formula is determined based on the minimum and maximum values of the parameters, providing standardized features for subsequent model input. Step 2: Multi-head attention based TCN Network state prediction, constructing a 3-layer causal dilated convolution. TCN The network with 8 layers and an 8-head attention mechanism takes the feature vector time sequence from step 1 as input, and outputs the predicted values of the pipeline state and the predicted values of the detection device state in the future preset time period after training. The TCN The layer expansion coefficients are 1, 2, and 4 respectively. The attention layer calculates weights through the query matrix, key matrix, and value matrix to focus on key temporal features. The prediction results provide temporal basis for subsequent probabilistic analysis. Step 3: Factor graph model state probability analysis. Define pipeline state variables, equipment state variables, and observation variables. Construct factor functions to quantify the probabilistic relationships between variables. Calculate the posterior probability using the belief propagation algorithm to obtain the probability of successful detection, insufficient power, and power overload. The factor function parameters are related to pipeline material, operating pressure, maximum equipment power, and remaining power. The probability results provide a quantitative basis for scheduling risk assessment. Step 4: Calculation of time decay factor and redundancy value factor, based on the prediction results of Step 2, through... TCN The attention layer calculates the urgency weight of pipeline inspection and the key time point weight of equipment power redundancy, respectively. It also calculates the time decay factor by combining the pipeline importance coefficient and the redundancy value factor by combining the redundancy power and power fluctuation characteristics. The parameters of the two factors are related to the predicted value of pipeline leakage risk and the predicted fluctuation of equipment power, providing dynamic quantitative indicators for scheduling priority. Step 5: Task scheduling decision. Based on the probability results of Step 3 and the factors of Step 4, calculate the comprehensive score of the task-device combination, achieve optimal task allocation through the Hungarian algorithm, and output scheduling instructions containing start time and path. The score integrates detection success probability, safety probability, time decay factor, redundancy factor and device distance weight to ensure that resource allocation matches task priority and device capability. Step 6: Real-time feedback and dynamic adjustment. Update equipment and pipeline status data every preset time period, incrementally update the network model in Step 2, and repeat Steps 3-5 to adjust the scheduling scheme to adapt to real-time status changes and ensure scheduling timeliness.
2. The method according to claim 1, characterized in that, In step 1, the pipeline feature vector is fused with the normalized values of the pipeline's physical attributes and the normalized values of its geographical coordinates, and the equipment feature vector is fused with the normalized values of the equipment's status parameters. The normalization formula is the difference between the parameter value and the minimum parameter value divided by the difference between the maximum parameter value and the minimum parameter value.
3. The automatic control method for oil and gas pipeline inspection according to claim 1, characterized in that: In step 2, network training adopts... The optimizer has an initial learning rate of 0.001 and a loss function of mean squared error. It constructs a training set based on historical data over a preset number of years. The input is a feature sequence of a preset duration, and the output is the state prediction value for the next 6 hours. The remaining power prediction value is calculated by the difference between the initial remaining power value and the cumulative consumption rate.
4. The automatic control method for oil and gas pipeline inspection according to claim 1, characterized in that: In step 3, the pipeline condition factor function parameters include the material corrosion sensitivity coefficient, the operating pressure influence coefficient, and the laying age aging coefficient. The equipment condition factor function parameters include the ratio of predicted power to maximum power and the ratio of remaining power to rated power. The detection success probability is calculated by combining the equipment normal operation probability and the pipeline condition detectability.
5. The automatic control method for oil and gas pipeline inspection according to claim 1, characterized in that: In step 4, the time decay factor formula is constructed based on future time points, attention weights, and pipeline importance coefficients, and increases with time; the redundancy value factor formula is constructed based on the ratio of redundant power to rated power, attention weights, and time difference index, and is positively correlated with redundant power and affected by power fluctuations.
6. The automatic control method for oil and gas pipeline inspection according to claim 1, characterized in that: In step 5, the candidate task set is generated by screening pipeline sections with leakage risk or severe corrosion probability exceeding the threshold. The sum of the comprehensive score weight coefficients is 1. Task allocation is achieved through bipartite graph maximum weight matching. Conflict adjustment is completed by reducing the weight of low-scoring tasks and rematching.
7. An automatic control device for detecting oil and gas pipelines, specifically comprising the following modules: Data acquisition and preprocessing module, multi-head attention based TCN The module includes: network state prediction module, factor graph model state probability analysis module, time decay factor and redundancy value factor calculation module, task scheduling decision module, and real-time feedback and dynamic adjustment module. The data acquisition and preprocessing module is used for data acquisition and preprocessing: acquiring physical property data of oil and gas pipelines and status parameters of detection equipment, which are then cleaned, normalized, and fused into pipeline feature vectors and equipment feature vectors. The pipeline physical property data includes pipeline diameter, material, burial depth, wall thickness, operating pressure, laying years, historical corrosion rate and segment length, and geographical coordinates. The detection equipment status parameters include maximum power, rated power inherent parameters and real-time power, remaining power, operating time, and distance from the target detection segment. Normalization is achieved by mapping parameter values to the [0,1] interval. The mapping formula is determined based on the minimum and maximum values of the parameters, providing standardized features for subsequent model input. Based on multi-head attention TCN The network state prediction module is used for multi-head attention-based... TCN Network state prediction: Constructing a network with 3 layers of causal dilated convolutions TCN The network with 8 layers and an 8-head attention mechanism takes the feature vector time sequence from step 1 as input, and outputs the predicted values of the pipeline state and the predicted values of the detection device state in the future preset time period after training. The TCN The layer expansion coefficients are 1, 2, and 4 respectively. The attention layer calculates weights through the query matrix, key matrix, and value matrix to focus on key temporal features. The prediction results provide temporal basis for subsequent probabilistic analysis. The factor graph model state probability analysis module is used to define pipeline state variables, equipment state variables, and observation variables, construct factor functions to quantify the probabilistic relationships between variables, and calculate the posterior probability through the belief propagation algorithm to obtain the probability of successful detection, insufficient power, and power overload. The factor function parameters are related to pipeline material, operating pressure, maximum power of equipment, and remaining power. The probability results provide a quantitative basis for scheduling risk assessment. The time decay factor and redundancy value factor calculation module is used to calculate the multi-head attention-based ... TCN The prediction results of the network state prediction module are obtained through... TCN The attention layer calculates the urgency weight of pipeline inspection and the key time point weight of equipment power redundancy, respectively. It also calculates the time decay factor by combining the pipeline importance coefficient and the redundancy value factor by combining the redundancy power and power fluctuation characteristics. The parameters of the two factors are related to the predicted value of pipeline leakage risk and the predicted fluctuation of equipment power, providing dynamic quantitative indicators for scheduling priority. The task scheduling decision module is used to calculate the comprehensive score of the task-equipment combination based on the probability results of the factor graph model state probability analysis module and the factors of the time decay factor and redundancy value factor calculation module. It achieves optimal task allocation through the Hungarian algorithm and outputs scheduling instructions containing start time and path. The score integrates detection success probability, safety probability, time decay factor, redundancy factor and equipment distance weight to ensure that resource allocation matches task priority and equipment capability. The real-time feedback and dynamic adjustment module is used to update equipment and pipeline status data at preset time intervals, with incremental updates based on multi-head attention. TCN The network model in the network state prediction module, the state probability analysis module of the repeatability factor graph model, the time decay factor and redundancy value factor calculation module, and the task scheduling decision module adjust the scheduling scheme to adapt to real-time state changes and ensure scheduling timeliness.
8. The automatic control device for oil and gas pipeline detection according to claim 7, characterized in that: The multi-head attention-based TCN In the network state prediction module, network training adopts... The optimizer has an initial learning rate of 0.001 and a loss function of mean squared error. It constructs a training set based on historical data over a preset number of years. The input is a feature sequence of a preset duration, and the output is the state prediction value for the next 6 hours. The remaining power prediction value is calculated by the difference between the initial remaining power value and the cumulative consumption rate.
9. The automatic control device for oil and gas pipeline detection according to claim 7, characterized in that: In the factor graph model state probability analysis module, the pipeline state factor function parameters include the material corrosion sensitivity coefficient, the operating pressure influence coefficient, and the laying age aging coefficient. The equipment state factor function parameters include the ratio of predicted power to maximum power and the ratio of remaining power to rated power. The detection success probability is calculated by combining the equipment normal operation probability and the pipeline state detectability.
10. A computer device, characterized in that, The computer device includes a processor and a memory: the memory is used to store program code and transmit the program code to the processor, the processor is used to execute the automatic control method for oil and gas pipeline detection according to any one of claims 1-6 according to the instructions in the program code.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store program code and transmit the program code to a processor, the processor being used to execute the automatic control method for oil and gas pipeline detection according to any one of claims 1-6 based on the instructions in the program code.
Citation Information
Patent Citations
Natural gas data management method and system
CN119962975A
Distributed computing environment using real-time scheduling logic and time deterministic architecture
US20030140172A1