Remote intelligent control method for gas pipeline multi-branch safety valve based on AI model
By combining AI models with image feature extraction and flow correction, the problem of flow measurement error in gas pipelines has been solved, enabling precise flow control under corrosive conditions and ensuring the safety and stability of the gas transmission system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-03-27
AI Technical Summary
Existing gas pipeline flow sensors suffer from high flow measurement errors after corrosion of the pipeline inner wall, causing the control system to misjudge flow demand and leading to insufficient gas supply or excessive shut-off.
A remote intelligent control method for multi-branch safety valves in gas pipelines based on an AI model is adopted. By acquiring images of the inner wall of the pipeline and flow data, the flow data is corrected using an image feature extraction network and a flow correction calculation network. Based on the corrected data, the control command for the safety valve is calculated and sent to the safety valve actuator of the corresponding branch.
It effectively eliminates the negative impact of corrosion morphology on flow field stability, achieves precise flow control under non-uniform flow field conditions, and ensures the safety and stability of gas transmission.
Smart Images

Figure CN121209293B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of machine learning, in particular to a remote intelligent control method for gas pipeline multi-branch safety valves based on an AI model. BACKGROUND
[0002] Gas pipeline leakage is a core safety hazard in the urban energy transmission and distribution system, directly related to urban operation safety and public interest. After the leakage of gas and air forms an explosive limit mixture, it is easy to cause explosion and fire when encountering a fire source, causing casualties and property losses; unburned gas diffusion can pollute the environment, and continuous leakage can also lead to imbalance of pipe network pressure, triggering regional supply stop, affecting people's livelihood and industrial operation.
[0003] In the gas pipeline designed based on the assumption of uniform flow field, the flow sensor calculates the flow rate by measuring the fluid kinetic energy or pressure difference. When the inner wall of the pipeline is corroded due to long-term use, the smooth streamline flow is destroyed, and the gas flow through these irregular surfaces will cause flow separation, forming a local vortex that rotates continuously. These vortexes change the velocity distribution of the flow field, causing part of the fluid kinetic energy to be converted into ineffective radial rotational motion from the axial main flow. However, the sensor still calculates according to the uniform flow field model, attributing the total kinetic energy containing rotational kinetic energy to the axial flow rate, resulting in a systematic higher detection value than the actual axial volume flow. The control system misjudges that the gas load has surged based on this higher flow data, and issues an instruction to close the valve, ultimately causing the actual gas supply of downstream gas equipment to be insufficient. SUMMARY
[0004] The purpose of the present application is to provide a remote intelligent control method for gas pipeline multi-branch safety valves based on an AI model, which solves the above technical problems.
[0005] The purpose of the present application can be achieved by the following technical solutions:
[0006] The remote intelligent control method for gas pipeline multi-branch safety valves based on an AI model comprises the following steps:
[0007] Obtain the original flow data and pipeline inner wall image data of multiple branches of the gas pipeline;
[0008] Input the original flow data and pipeline inner wall image data into a pre-trained flow correction model to obtain corrected flow data for each branch;
[0009] Based on the corrected flow data, calculate the control instructions for each branch safety valve through a control algorithm, wherein the control instructions include the specific adjustment amount of the safety valve opening degree;
[0010] Send the control instructions to the safety valve execution device of the corresponding branch through a communication network.
[0011] As a further aspect of the present invention: obtaining the corrected flow data includes:
[0012] The flow correction model includes an image feature extraction network and a flow correction calculation network;
[0013] The image feature extraction network processes the image data of the inner wall of the pipe, and the processing includes:
[0014] Multiple convolution kernels are used to perform convolution operations on the image of the pipe's inner wall to generate a basic feature map.
[0015] The basic feature map is input into the feature pyramid network, and feature maps containing information at different scales are generated through top-down paths and lateral connections. Global average pooling is performed on each feature map at each scale, and each feature map is converted into a fixed-length numerical value, which is denoted as a feature value.
[0016] The eigenvalues of all scales are concatenated sequentially to form the erosion feature vector;
[0017] The flow correction calculation network concatenates the erosion feature vector with the original flow data according to the feature dimension to form a fused feature vector. The fused feature vector is then input into the first fully connected layer, and the feature dimension is compressed to half of the input dimension through weight matrix multiplication and bias addition.
[0018] The compressed fused feature vector is input into the second fully connected layer. The feature dimension is kept unchanged by multiplying the weight matrix and adding the bias. The combined feature vector is then input into the third fully connected layer. The single value is output as the correction coefficient by multiplying the weight matrix and adding the bias.
[0019] The correction coefficient is multiplied by the original flow data to obtain the corrected flow data.
[0020] As a further aspect of the present invention: the training process of the flow correction model includes:
[0021] An initial flow correction model is constructed, which includes an image feature extraction network with randomly initialized parameters and a flow correction calculation network.
[0022] A training sample set was collected, which included multiple sets of raw flow data, pipe inner wall image data, and corresponding real flow data collected from pipe sections with different corrosion levels.
[0023] The pipe inner wall image data in the training sample set is size-normalized to adjust the images of different resolutions into pixel arrays with preset width and preset height. The size-normalized pipe inner wall image data is then color-space-converted to convert the original image data from RGB color space to grayscale color space.
[0024] The raw traffic data in the training sample set is normalized. The normalization process is to subtract the average value of all raw traffic data in the training sample set from each raw traffic data, and then divide by the standard deviation of all raw traffic data in the training sample set.
[0025] The preprocessed raw flow data and pipeline inner wall image data are used as training inputs, and the corresponding real flow data is used as the training target. The initial flow correction model is trained using a supervised training method.
[0026] During training, for each training sample, the mean square error between the corrected flow data output by the flow correction model and the real flow data is calculated as the loss value. The parameters of the flow correction model are updated by the gradient descent algorithm. The update process is to calculate the partial derivative of the loss value with respect to each parameter of the flow correction model, and then calculate the value of each parameter of the flow correction model in the opposite direction of the partial derivative.
[0027] Repeat the training process until the change in the loss value is less than a predetermined threshold, and save the parameters of the flow correction model at this time as a pre-trained flow correction model.
[0028] As a further aspect of the present invention: the calculation of control commands for each branch safety valve includes:
[0029] The preset flow rate value of each branch is read from the pipeline control system. The preset flow rate value is set according to the pipeline design parameters and operating requirements.
[0030] Calculate the difference between the corrected flow data and the corresponding preset flow value for each branch. The difference is calculated by subtracting the preset flow value from the corrected flow data.
[0031] The control mode is selected based on the absolute value of the difference. When the absolute value of the difference is less than the first threshold, the maintenance mode is selected. The control command corresponding to the maintenance mode is to keep the current opening degree of the safety valve unchanged.
[0032] When the absolute value of the difference is greater than or equal to the first threshold and less than the second threshold, the adjustment mode is selected. The control command corresponding to the adjustment mode contains the calculated safety valve opening adjustment amount K.
[0033] When the absolute value of the difference is greater than or equal to the second threshold, the protection mode is selected. The control command corresponding to the protection mode is to completely close the safety valve.
[0034] The control mode is combined with the corresponding safety valve opening adjustment amount to form a complete control command. The control command includes the branch identifier, control mode code and opening adjustment amount.
[0035] As a further aspect of the present invention: the calculation process for the safety valve opening adjustment amount K includes:
[0036] The base adjustment amount is obtained by multiplying the difference by the preset scaling factor;
[0037] Read the preset minimum and maximum adjustment values, which are set according to the mechanical characteristics of the safety valve.
[0038] If the basic adjustment amount is less than the minimum adjustment amount, then the basic adjustment amount is set to the minimum adjustment amount, and at this time the minimum adjustment amount is the safety valve opening adjustment amount K;
[0039] If the basic adjustment amount is greater than the maximum adjustment amount, then the basic adjustment amount is set to the maximum adjustment amount, and at this time the maximum adjustment amount is the safety valve opening adjustment amount K;
[0040] If the minimum adjustment amount ≤ the basic adjustment amount ≤ the maximum adjustment amount, then the basic adjustment amount is the safety valve opening adjustment amount K at this time.
[0041] As a further aspect of the present invention: the safety valve actuator that sends control commands to the corresponding branch via a communication network includes:
[0042] The control commands are serialized into a binary data stream. The serialization process includes converting branch identifiers into binary address codes, control mode codes into op codes, and opening adjustment amounts into fixed-point representations.
[0043] A frame start marker is added before the binary data stream, and a frame end marker is added after the binary data stream to form a complete data frame;
[0044] Error control coding is performed on the data frame. The error control coding uses the cyclic redundancy check algorithm to calculate the check code of the data frame and append the check code before the end of frame marker.
[0045] The encoded data frames are sent to the controller of the corresponding branch via the Industrial Ethernet protocol. The sending process includes establishing a TCP connection, transmitting data in segments, and acknowledging receipt.
[0046] After receiving a data frame, the controller first detects the start-of-frame and end-of-frame flags, then recalculates the checksum and compares it with the received checksum.
[0047] If the checksums match, the branch identifier, control mode code, and opening adjustment amount are extracted from the data frame, and the safety valve actuator is driven to complete the corresponding opening adjustment operation.
[0048] As a further aspect of the present invention: the driving safety valve actuator to complete the corresponding opening adjustment operation includes:
[0049] The controller identifies the target safety valve based on the extracted branch identifier, which corresponds to the physical address of the safety valve.
[0050] Parse the control mode code; if the control mode code indicates a sustain mode, then keep the current state of the safety valve unchanged.
[0051] If the control mode code indicates the adjustment mode, then read the safety valve opening adjustment amount K, calculate the target opening value, and the calculation process is to add the safety valve opening adjustment amount K to the current safety valve opening value.
[0052] If the control mode code indicates protection mode, then the target opening value is set to zero, and the corresponding safety valve is completely closed;
[0053] The target opening value is converted into a pulse signal, and the number of pulses in the pulse signal is proportional to the opening adjustment amount.
[0054] The pulse signal is sent to the stepper motor through the drive circuit. The stepper motor rotates at the corresponding angle according to the pulse signal, which drives the valve core of the safety valve to move to the target opening position.
[0055] After adjustment, the actual opening value of the safety valve is read and fed back to the control system via the communication network.
[0056] The beneficial effects of this invention compared to the prior art are as follows:
[0057] This invention introduces an intelligent correction mechanism based on the fusion of visual information and flow data into the flow measurement and control process, effectively correcting measurement errors caused by flow field disturbances resulting from pipeline internal wall corrosion. In the presence of local eddies and abnormal velocity distribution, this invention can automatically identify and compensate for overestimation of sensor readings caused by deviations in fluid kinetic energy distribution, thereby obtaining flow data closer to actual operating conditions. The control system adjusts the safety valve based on the corrected flow results, ensuring the valve opening matches the actual flow demand and preventing valve malfunctions caused by misjudgment of flow rate.
[0058] This invention effectively eliminates the negative impact of corrosion morphology on flow field stability, achieves precise control of gas delivery under non-uniform flow field conditions, and ensures the safety and gas supply stability of the gas pipeline system. Attached Figure Description
[0059] The invention will now be further described with reference to the accompanying drawings.
[0060] Figure 1This is a flowchart illustrating the remote intelligent control method for multi-branch safety valves in gas pipelines based on an AI model, as described in this invention. Detailed Implementation
[0061] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0062] Please see Figure 1 As shown, this invention is a remote intelligent control method for multi-branch safety valves in gas pipelines based on an AI model, comprising the following steps:
[0063] Obtain raw flow data and pipeline inner wall image data for multiple branches of the gas pipeline;
[0064] The original flow data and the pipeline inner wall image data are input into a pre-trained flow correction model to obtain the corrected flow data for each branch.
[0065] In a preferred embodiment of the present invention, obtaining the corrected flow data includes:
[0066] The flow correction model includes an image feature extraction network and a flow correction calculation network;
[0067] The image feature extraction network processes the image data of the inner wall of the pipe, and the processing includes:
[0068] Multiple convolution kernels are used to perform convolution operations on the image of the pipe's inner wall to generate a basic feature map.
[0069] The basic feature map is input into the feature pyramid network, and feature maps containing information at different scales are generated through top-down paths and lateral connections. Global average pooling is performed on each feature map at each scale, and each feature map is converted into a fixed-length numerical value, which is denoted as a feature value.
[0070] The eigenvalues of all scales are concatenated sequentially to form the erosion feature vector;
[0071] The flow correction calculation network concatenates the erosion feature vector with the original flow data according to the feature dimension to form a fused feature vector. The fused feature vector is then input into the first fully connected layer, and the feature dimension is compressed to half of the input dimension through weight matrix multiplication and bias addition.
[0072] The compressed fused feature vector is input into the second fully connected layer. The feature dimension is kept unchanged by multiplying the weight matrix and adding the bias. The combined feature vector is then input into the third fully connected layer. The single value is output as the correction coefficient by multiplying the weight matrix and adding the bias.
[0073] The correction coefficient is multiplied by the original flow data to obtain the corrected flow data.
[0074] It should be noted that by inputting both pipeline inner wall images and flow data into the model, and then using a convolutional network to extract multi-scale corrosion features before fusing them with flow information, the model can simultaneously perceive the correlation between the pipeline's structural state and its hydrodynamic characteristics during the learning process. Corrosion morphology directly affects the flow field distribution, and flow field turbulence determines the deviation pattern of sensor readings. The model establishes this implicit nonlinear correspondence through feature extraction and fully connected mapping, enabling the output correction coefficients to reflect the degree of deviation between the actual and ideal flow states in the pipeline. The flow data obtained through this correction process more closely matches the true axial flow, fundamentally eliminating measurement distortion caused by corrosion. This provides an accurate flow basis for the subsequent control system, ensuring that the safety valve's action matches the actual gas delivery demand and achieving stable and reliable gas delivery control.
[0075] Weight matrix operations and bias addition are the fundamental computational methods for feature mapping and nonlinear transformation in fully connected layers. Each fully connected layer, upon receiving input features, multiplies each value in the input vector by its corresponding weight parameter, then sums all products to form a new feature combination. A bias parameter is then added to adjust the overall output balance, giving the model greater flexibility in handling different input distributions. The dimension of the weight matrix is determined by the dimensions of both the input and output features. While the size of the weight matrix generally differs between layers, the computational principle remains the same. All three fully connected layers perform this "input multiplied by weight plus bias" operation, but each layer performs a different function. The first layer compresses the feature dimension, condensing the original fused features into a more compact representation. The second layer reconstructs the features while maintaining the same dimension, further refining and stabilizing the compressed information. The third layer maps the processed features into a single output value, representing the correction coefficient. These weights and bias parameters are automatically learned through a large amount of sample data during the model training phase. After each calculation of the loss function, the model continuously adjusts the parameters using the gradient descent method to make the predicted output closer to the actual flow value until the training converges.
[0076] In a preferred embodiment, the training process of the flow correction model includes:
[0077] An initial flow correction model is constructed, which includes an image feature extraction network with randomly initialized parameters and a flow correction calculation network.
[0078] A training sample set was collected, which included multiple sets of raw flow data, pipe inner wall image data, and corresponding real flow data collected from pipe sections with different corrosion levels.
[0079] The pipe inner wall image data in the training sample set is size-normalized to adjust the images of different resolutions into pixel arrays with preset width and preset height. The size-normalized pipe inner wall image data is then color-space-converted to convert the original image data from RGB color space to grayscale color space.
[0080] The raw traffic data in the training sample set is normalized. The normalization process is to subtract the average value of all raw traffic data in the training sample set from each raw traffic data, and then divide by the standard deviation of all raw traffic data in the training sample set.
[0081] The preprocessed raw flow data and pipeline inner wall image data are used as training inputs, and the corresponding real flow data is used as the training target. The initial flow correction model is trained using a supervised training method.
[0082] During training, for each training sample, the mean square error between the corrected flow data output by the flow correction model and the real flow data is calculated as the loss value. The parameters of the flow correction model are updated by the gradient descent algorithm. The update process is to calculate the partial derivative of the loss value with respect to each parameter of the flow correction model, and then calculate the value of each parameter of the flow correction model in the opposite direction of the partial derivative.
[0083] Repeat the training process until the change in the loss value is less than a predetermined threshold, and save the parameters of the flow correction model at this time as a pre-trained flow correction model.
[0084] Understandably, supervised training of the model using a large amount of sample data collected under different corrosion levels and flow field conditions allows the model to learn the intrinsic mapping relationship between corrosion morphology, flow readings, and actual flow rates through continuous iteration. Image preprocessing and data normalization ensure that input features have a uniform scale and stable distribution, helping the model to more accurately capture the statistical regularities of visual features and flow deviations. The loss function, by measuring the error between the model output and the actual flow rate, guides the parameters to converge in the optimal direction, enabling the model to adaptively correct sensor readings based on image features. After training, the model can determine the degree of flow field disturbance based on real-time images and output corresponding correction coefficients during operation, achieving automatic compensation for measurement deviations under different corrosion conditions. This provides a long-term, stable, and reliable flow data foundation for the control system, ensuring the accuracy of subsequent valve regulation and the reliability of gas delivery.
[0085] Based on the corrected flow data, the control command for each branch safety valve is calculated by the control algorithm, wherein the control command includes the specific adjustment amount of the safety valve opening.
[0086] In another preferred embodiment of the present invention, the calculation of control commands for each branch safety valve includes:
[0087] The preset flow rate value of each branch is read from the pipeline control system. The preset flow rate value is set according to the pipeline design parameters and operating requirements.
[0088] Calculate the difference between the corrected flow data and the corresponding preset flow value for each branch. The difference is calculated by subtracting the preset flow value from the corrected flow data.
[0089] The control mode is selected based on the absolute value of the difference. When the absolute value of the difference is less than the first threshold, the maintenance mode is selected. The control command corresponding to the maintenance mode is to keep the current opening degree of the safety valve unchanged.
[0090] When the absolute value of the difference is greater than or equal to the first threshold and less than the second threshold, the adjustment mode is selected. The control command corresponding to the adjustment mode contains the calculated safety valve opening adjustment amount K.
[0091] When the absolute value of the difference is greater than or equal to the second threshold, the protection mode is selected. The control command corresponding to the protection mode is to completely close the safety valve.
[0092] The control mode is combined with the corresponding safety valve opening adjustment amount to form a complete control command. The control command includes the branch identifier, control mode code and opening adjustment amount.
[0093] In a preferred embodiment, the calculation process for the safety valve opening adjustment amount K includes:
[0094] The base adjustment amount is obtained by multiplying the difference by the preset scaling factor;
[0095] Read the preset minimum and maximum adjustment values, which are set according to the mechanical characteristics of the safety valve.
[0096] If the basic adjustment amount is less than the minimum adjustment amount, then the basic adjustment amount is set to the minimum adjustment amount, and at this time the minimum adjustment amount is the safety valve opening adjustment amount K;
[0097] If the basic adjustment amount is greater than the maximum adjustment amount, then the basic adjustment amount is set to the maximum adjustment amount, and at this time the maximum adjustment amount is the safety valve opening adjustment amount K;
[0098] If the minimum adjustment amount ≤ the basic adjustment amount ≤ the maximum adjustment amount, then the basic adjustment amount is the safety valve opening adjustment amount K at this time.
[0099] It is worth noting that by comparing the corrected flow rate data with the preset flow rate value and classifying different control modes according to the magnitude of the deviation, the system can dynamically adjust the safety valve opening according to the operating status, achieving a graded response to the gas delivery process. When the deviation is small, the valve remains stable, avoiding mechanical wear and system fluctuations caused by frequent actions; when the deviation is within the adjustable range, the opening adjustment amount calculated according to the proportional coefficient gradually brings the flow rate back to the target value, ensuring the continuity and accuracy of the adjustment; when the deviation is too large, the valve is immediately closed, providing safety protection at the system level; by setting upper and lower limits for the adjustment amount, the control amount is always kept within the valve's tolerance range, preventing mechanical instability or response overshoot due to excessive adjustment. This design enables control commands to balance precise adjustment and safety redundancy under different operating conditions, achieving an orderly transition from error perception to execution action, and truly transforming the corrected flow rate data into stable and reliable execution control behavior, ensuring the safety of pipeline operation and gas supply balance.
[0100] The control command is sent to the safety valve actuator of the corresponding branch via a communication network.
[0101] In another preferred embodiment of the present invention, the safety valve actuator that sends control commands to the corresponding branch via a communication network includes:
[0102] The control commands are serialized into a binary data stream. The serialization process includes converting branch identifiers into binary address codes, control mode codes into op codes, and opening adjustment amounts into fixed-point representations.
[0103] A frame start marker is added before the binary data stream, and a frame end marker is added after the binary data stream to form a complete data frame;
[0104] Error control coding is performed on the data frame. The error control coding uses the cyclic redundancy check algorithm to calculate the check code of the data frame and append the check code before the end of frame marker.
[0105] The encoded data frames are sent to the controller of the corresponding branch via the Industrial Ethernet protocol. The sending process includes establishing a TCP connection, transmitting data in segments, and acknowledging receipt.
[0106] After receiving a data frame, the controller first detects the start-of-frame and end-of-frame flags, then recalculates the checksum and compares it with the received checksum.
[0107] If the checksums match, the branch identifier, control mode code, and opening adjustment amount are extracted from the data frame, and the safety valve actuator is driven to complete the corresponding opening adjustment operation.
[0108] It is important to note that by converting control commands into structured data frames and adding flag bits and verification mechanisms during transmission, the communication process possesses clear boundary identification and error detection capabilities, ensuring that commands can be accurately identified and completely received in complex industrial network environments. Data serialization converts logical control information into binary format, improving transmission efficiency and facilitating unified parsing across different devices. Cyclic redundancy check (CRC) provides dual data integrity protection between the physical and transport layers, preventing malfunctions caused by noise interference or signal loss. The controller performs flag detection and verification comparison on the received data before parsing, ensuring that only verified commands trigger valve actions, maintaining determinism and security in the control process even under remote communication conditions. The overall design achieves reliable closed-loop information transmission from the host system to the actuator, keeping the safety valve's adjustment action synchronized with the control algorithm output, ensuring the correct execution of flow control commands in the network transmission environment, and supporting system stability and security from the communication level.
[0109] In a preferred embodiment, the driving safety valve actuator to complete the corresponding opening adjustment operation includes:
[0110] The controller identifies the target safety valve based on the extracted branch identifier, which corresponds to the physical address of the safety valve.
[0111] Parse the control mode code; if the control mode code indicates a sustain mode, then keep the current state of the safety valve unchanged.
[0112] If the control mode code indicates the adjustment mode, then read the safety valve opening adjustment amount K, calculate the target opening value, and the calculation process is to add the safety valve opening adjustment amount K to the current safety valve opening value.
[0113] If the control mode code indicates protection mode, then the target opening value is set to zero, and the corresponding safety valve is completely closed;
[0114] The target opening value is converted into a pulse signal, and the number of pulses in the pulse signal is proportional to the opening adjustment amount.
[0115] The pulse signal is sent to the stepper motor through the drive circuit. The stepper motor rotates at the corresponding angle according to the pulse signal, which drives the valve core of the safety valve to move to the target opening position.
[0116] After adjustment, the actual opening value of the safety valve is read and fed back to the control system via the communication network.
[0117] It should be noted that by parsing the branch identifiers and control mode codes through the controller and driving the stepper motor accordingly to perform valve regulation, the system can achieve precise positioning and graded action of multi-branch safety valves within a unified logical framework. The stepper motor is driven by pulse signals, with the number of pulses linearly corresponding to the opening adjustment, thus ensuring consistency between the valve core movement angle and the control command and avoiding opening errors caused by mechanical deviations. Different control modes correspond to different execution logics, enabling smooth switching between maintenance, regulation, and protection states, maintaining system continuity while providing emergency protection capabilities. The feedback signal of the opening constitutes a closed-loop control mechanism, allowing the control system to verify the execution results in real time and correct subsequent commands, preventing the accumulation of deviations caused by mechanical lag or environmental interference. This process tightly couples digital control logic with physical execution actions, achieving precise mapping from flow correction results to actual valve regulation, ensuring that the gas delivery system maintains a stable, safe, and highly responsive operating state even under complex conditions.
[0118] The foregoing has provided a detailed description of one embodiment of the present invention, but this description is merely a preferred embodiment and should not be construed as limiting the scope of the invention. All equivalent variations and modifications made within the scope of the present invention should still fall within the scope of the present invention.
Claims
1. A remote intelligent control method for multi-branch safety valves in gas pipelines based on an AI model, characterized in that, Includes the following steps: Obtain raw flow data and pipeline inner wall image data for multiple branches of the gas pipeline; The original flow data and the pipeline inner wall image data are input into a pre-trained flow correction model to obtain the corrected flow data for each branch. Based on the corrected flow data, the control command for each branch safety valve is calculated by the control algorithm, wherein the control command includes the specific adjustment amount of the safety valve opening. The control command is sent to the safety valve actuator of the corresponding branch via a communication network; Obtaining the corrected traffic data includes: The flow correction model includes an image feature extraction network and a flow correction calculation network; The image feature extraction network processes the image data of the inner wall of the pipe, and the processing includes: Multiple convolution kernels are used to perform convolution operations on the image of the pipe's inner wall to generate a basic feature map. The basic feature map is input into the feature pyramid network, and feature maps containing information at different scales are generated through top-down paths and lateral connections. Global average pooling is performed on each feature map at each scale, and each feature map is converted into a fixed-length numerical value, which is denoted as a feature value. The eigenvalues of all scales are concatenated sequentially to form the erosion feature vector; The flow correction calculation network concatenates the erosion feature vector with the original flow data according to the feature dimension to form a fused feature vector. The fused feature vector is then input into the first fully connected layer, and the feature dimension is compressed to half of the input dimension through weight matrix multiplication and bias addition. The compressed fused feature vector is input into the second fully connected layer. The feature dimension is kept unchanged by multiplying the weight matrix and adding the bias. The combined feature vector is then input into the third fully connected layer. The single value is output as the correction coefficient by multiplying the weight matrix and adding the bias. The correction coefficient is multiplied by the original flow data to obtain the corrected flow data.
2. The remote intelligent control method for multi-branch safety valves in gas pipelines based on an AI model according to claim 1, characterized in that, The training process for the flow correction model includes: A flow correction model is constructed, which includes an image feature extraction network with randomly initialized parameters and a flow correction calculation network. A training sample set was collected, which included multiple sets of raw flow data, pipe inner wall image data, and corresponding real flow data collected from pipe sections with different corrosion levels. The pipe inner wall image data in the training sample set is size-normalized to adjust the images of different resolutions into pixel arrays with preset width and preset height. The size-normalized pipe inner wall image data is then color-space-converted to convert the original image data from RGB color space to grayscale color space. The raw traffic data in the training sample set is normalized. The normalization process is to subtract the average value of all raw traffic data in the training sample set from each raw traffic data, and then divide by the standard deviation of all raw traffic data in the training sample set. The preprocessed raw flow data and pipeline inner wall image data are used as training inputs, and the corresponding real flow data is used as the training target. The flow correction model is trained using a supervised training method. During training, for each training sample, the mean square error between the corrected flow data output by the flow correction model and the real flow data is calculated as the loss value. The parameters of the flow correction model are updated by the gradient descent algorithm. The update process is to calculate the partial derivative of the loss value with respect to each parameter of the flow correction model, and then calculate the value of each parameter of the flow correction model in the opposite direction of the partial derivative. Repeat the training process until the change in the loss value is less than a predetermined threshold, and save the parameters of the flow correction model at this time as a pre-trained flow correction model.
3. The remote intelligent control method for multi-branch safety valves in gas pipelines based on an AI model according to claim 1, characterized in that, The control commands for each branch safety valve include: The preset flow rate value of each branch is read from the pipeline control system. The preset flow rate value is set according to the pipeline design parameters and operating requirements. Calculate the difference between the corrected flow data and the corresponding preset flow value for each branch. The difference is calculated by subtracting the preset flow value from the corrected flow data. The control mode is selected based on the absolute value of the difference. When the absolute value of the difference is less than the first threshold, the maintenance mode is selected. The control command corresponding to the maintenance mode is to keep the current opening degree of the safety valve unchanged. When the absolute value of the difference is greater than or equal to the first threshold and less than the second threshold, the adjustment mode is selected. The control command corresponding to the adjustment mode contains the calculated safety valve opening adjustment amount K. When the absolute value of the difference is greater than or equal to the second threshold, the protection mode is selected. The control command corresponding to the protection mode is to completely close the safety valve. The control mode is combined with the corresponding safety valve opening adjustment amount to form a complete control command. The control command includes the branch identifier, control mode code and opening adjustment amount.
4. The remote intelligent control method for multi-branch safety valves in gas pipelines based on an AI model according to claim 3, characterized in that, The calculation process for the safety valve opening adjustment amount K includes: The base adjustment amount is obtained by multiplying the difference by the preset scaling factor; Read the preset minimum and maximum adjustment values, which are set according to the mechanical characteristics of the safety valve. If the basic adjustment amount is less than the minimum adjustment amount, then the basic adjustment amount is set to the minimum adjustment amount, and at this time the minimum adjustment amount is the safety valve opening adjustment amount K; If the basic adjustment amount is greater than the maximum adjustment amount, then the basic adjustment amount is set to the maximum adjustment amount, and at this time the maximum adjustment amount is the safety valve opening adjustment amount K; If the minimum adjustment amount ≤ the basic adjustment amount ≤ the maximum adjustment amount, then the basic adjustment amount is the safety valve opening adjustment amount K at this time.
5. The remote intelligent control method for multi-branch safety valves in gas pipelines based on an AI model according to claim 4, characterized in that, The safety valve actuator that transmits control commands to the corresponding branch via a communication network includes: The control commands are serialized into a binary data stream. The serialization process includes converting branch identifiers into binary address codes, control mode codes into op codes, and opening adjustment amounts into fixed-point representations. A frame start marker is added before the binary data stream, and a frame end marker is added after the binary data stream to form a complete data frame; Error control coding is performed on the data frame. The error control coding uses the cyclic redundancy check algorithm to calculate the check code of the data frame and append the check code before the end of frame marker. The encoded data frames are sent to the controller of the corresponding branch via the Industrial Ethernet protocol. The sending process includes establishing a TCP connection, transmitting data in segments, and acknowledging receipt. After receiving a data frame, the controller first detects the start-of-frame and end-of-frame flags, then recalculates the checksum and compares it with the received checksum. If the checksums match, the branch identifier, control mode code, and opening adjustment amount are extracted from the data frame, and the safety valve actuator is driven to complete the corresponding opening adjustment operation.
6. The remote intelligent control method for multi-branch safety valves in gas pipelines based on an AI model according to claim 5, characterized in that, The actuator that drives the safety valve to complete the corresponding opening adjustment operation includes: The controller identifies the target safety valve based on the extracted branch identifier, which corresponds to the physical address of the safety valve. Parse the control mode code; if the control mode code indicates a sustain mode, then keep the current state of the safety valve unchanged. If the control mode code indicates the adjustment mode, then read the safety valve opening adjustment amount K, calculate the target opening value, and the calculation process is to add the safety valve opening adjustment amount K to the current safety valve opening value. If the control mode code indicates protection mode, then the target opening value is set to zero, and the corresponding safety valve is completely closed; The target opening value is converted into a pulse signal, and the number of pulses in the pulse signal is proportional to the opening adjustment amount. The pulse signal is sent to the stepper motor through the drive circuit. The stepper motor rotates at the corresponding angle according to the pulse signal, which drives the valve core of the safety valve to move to the target opening position. After adjustment, the actual opening value of the safety valve is read and fed back to the control system via the communication network.
Citation Information
Patent Citations
Method for measuring pipeline flow with positron annihilation technology
CN108267186A
Crushed thick and large ore body combined mining method based on medium-length hole blasting and drift type cooperation
CN120211769A