A pipeline stray current control method, device, equipment and storage medium

By constructing a model based on historical detection information and equivalent circuit principles on buried metal pipelines, and dynamically adjusting the grounding electrode combination, the problem of stray current protection in complex environments is solved. This achieves precise diversion and uniform distribution of stray current, improving protection efficiency and response speed.

CN122315591APending Publication Date: 2026-06-30PIPECHINA SOUTH CHINA CO +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610540364.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-22
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing technologies cannot dynamically adjust the diversion scheme according to the real-time changes of stray current, resulting in buried metal pipelines being unable to be effectively protected in complex environments. In particular, under the interference of mixed AC and DC stray currents, the pipeline coating is prone to corrosion, which can lead to perforation failure in severe cases.

Method used

By acquiring stray current distribution information of each zone along the pipeline, and using a preset model constructed based on historical detection information and the equivalent circuit principle of stray current diversion and grounding, the target grounding electrode is automatically output to achieve dynamic diversion and ensure that stray current is guided into the soil.

Benefits of technology

It enables targeted and dynamic diversion of stray currents, improves the intelligence level and response speed of protection, reduces the risk of corrosion caused by local current concentration and potential fluctuations, and enhances the long-term protection effect of pipelines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122315591A_ABST
    Figure CN122315591A_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, device, and storage medium for controlling stray current in pipelines, relating to the field of stray current protection technology. The method includes: acquiring real-time stray current distribution information for each pipeline section along the pipeline. The distribution information includes the stray current intensity flowing through each pipeline section. The distribution information is input into a preset first model, and the target grounding electrode is output from the candidate grounding electrodes corresponding to each pipeline section. The first model is constructed based on historical detection information and the equivalent circuit principle of stray current diversion and grounding, used to determine the target grounding electrode. The historical detection information includes historical stray current distribution information and corresponding historical target grounding electrodes. The target grounding electrode is then activated, used to guide the stray current into the soil.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of stray current protection technology for pipelines, and in particular to a method, apparatus, equipment and storage medium for controlling stray current in pipelines. Background Technology

[0002] With the rapid development of infrastructure such as oil and gas pipelines, high-voltage power transmission lines and urban rail transit, buried metal pipelines are susceptible to stray current interference during operation, which can cause electrochemical corrosion at the damaged coating and, in severe cases, lead to pipeline perforation and failure.

[0003] To address the problem of stray current corrosion, multiple sensors are typically installed along the pipeline to detect the pipe-to-ground potential and current density. At the same time, sacrificial anode grounding, single-point or multi-point grounding, and drainage devices are installed to divert stray currents into the soil.

[0004] However, the configuration of the grounding and current diversion system remains fixed, and the current diversion scheme cannot be adjusted in real time according to stray currents. Summary of the Invention

[0005] This application provides a method, apparatus, device, and storage medium for controlling stray current in pipelines, used to configure a diversion scheme based on the real-time stray current.

[0006] Firstly, this application provides a method for controlling stray current in a pipeline. This method is applied to an electronic device. The executing entity of the method can be an electronic device, a component or device applied to the electronic device (e.g., a processor, chip, or chip system), or a logic module or software capable of implementing all or part of the functions of the electronic device, including: Obtain real-time stray current distribution information for each pipeline section along the pipeline; the distribution information includes the stray current intensity flowing through each pipeline section; The distribution information is input into the preset first model, and the target grounding electrode is output from the candidate grounding electrodes corresponding to each pipeline partition. The first model is constructed based on historical detection information and the equivalent circuit principle of stray current diversion and grounding, and is used to determine the target grounding electrode. The historical detection information includes historical stray current distribution information and the corresponding historical target grounding electrode. Enable the target grounding electrode, which is used to guide stray currents into the soil.

[0007] In the first aspect, by acquiring the stray current intensity and other distribution information of each pipeline section along the pipeline, and inputting this distribution information into a preset first model constructed based on historical detection information and the equivalent circuit principle of stray current diversion and grounding, the model automatically outputs the target grounding electrode to be activated from the candidate grounding electrodes of each section. Subsequently, the target grounding electrode is activated to guide the stray current into the soil. Because the first model integrates the learning ability of historical detection data and the physical equivalent circuit principle, it utilizes data-driven methods and follows basic electrical laws. It can accurately determine the most suitable combination of grounding electrodes for the current working conditions based on real-time distribution information, thereby realizing targeted and dynamic diversion of stray current in different sections, significantly improving the intelligence level and response speed of stray current protection.

[0008] In conjunction with the first aspect, in one possible implementation, the first model is a model constructed with at least one of the following constraints, aiming to minimize the sum of the square of the deviation between the current flowing into each pipe section and the target current flowing into the pipe section and the grounding resistance of each pipe section: The current draw of the grounding electrode corresponding to each pipeline section is within the preset current range. The resistance of the grounding electrode branch corresponding to each pipeline section is less than or equal to the upper limit of the design resistance of that grounding electrode section.

[0009] In this implementation, the first model aims to minimize the squared deviation between the current diversion of each pipeline section and the target current, as well as the sum of the grounding electrode resistances of each section. Constraints are imposed, including that the current diversion of each section is within a preset range and that the resistance of each section's grounding electrode branch is less than or equal to the upper limit of the design resistance. This first model ensures that the current diversion and grounding resistance of each section do not exceed safety and design boundaries, while simultaneously pursuing uniform current distribution and minimizing grounding impedance. This effectively suppresses localized current concentration and reduces the risk of accelerated pipeline corrosion caused by uneven current distribution.

[0010] In conjunction with the first aspect, in one possible implementation, the first model is a model constructed with at least one of the following constraints, aiming to minimize the sum of the squares of the deviations between the current flowing into each pipe section and the target current flowing into the pipe section and the squares of the deviations from the grounding potential of each pipe section: The current draw of the grounding electrode corresponding to each pipeline section is within the preset current range. The grounding potential of the grounding electrode corresponding to each pipeline section is less than or equal to the upper limit of the design potential of that grounding electrode section.

[0011] In this implementation, the first model aims to minimize the sum of the squared deviations of the diversion current from the target diversion current in each pipeline section and the squared deviations of the grounding potential in each section. It also imposes constraints such as ensuring the diversion current in each section is within a preset range and that the grounding potential of the grounding electrode in each section is less than or equal to the upper limit of the design potential. By simultaneously optimizing both current and potential deviations, the first model not only focuses on the uniform distribution of the diversion current but also actively limits the fluctuation range of the grounding potential, avoiding risks induced by excessively high potentials.

[0012] In conjunction with the first aspect, in one possible implementation, the first model is a fuzzy control model. The fuzzy control model uses the direction of stray current in each pipeline section along the pipeline as input for fuzzification processing, outputs the dredging current corresponding to each candidate grounding electrode, and then filters out the target grounding electrode corresponding to each pipeline section based on the dredging current. The fuzzy rules for fuzzification processing are constructed based on historical detection information.

[0013] In this implementation, the first model employs a fuzzy control model. This model uses the stray current direction of each pipeline section along the pipeline as input for fuzzification processing, and outputs the diversion current corresponding to each candidate grounding electrode based on fuzzy rules constructed from historical detection information. Then, based on this diversion current, the target grounding electrode corresponding to each pipeline section is selected. The fuzzy control model converts directional information into membership degrees through fuzzification processing and uses rules extracted from historical data for reasoning, quickly outputting a reasonable diversion current allocation without requiring precise analytical expressions. Therefore, this method can adapt to scenarios with variable stray current directions and mixed AC / DC interference sources.

[0014] In conjunction with the first aspect, in one possible implementation, the first model is constructed based on historical detection information and the equivalent circuit principle of stray current diversion and grounding, including: The parameters required for the first model to run are obtained by treating the grounding electrodes around the pipeline as multiple parallel impedance branches, analyzing the impedance characteristics of each grounding electrode, and calculating the proportion of the diversion current of each grounding electrode. The first model is constructed based on the parameters required for running the first model and historical detection information.

[0015] In this implementation, the grounding electrodes around the pipeline are treated as multiple parallel impedance branches. The impedance characteristics of each grounding electrode are analyzed, and the proportion of the current diverted by each grounding electrode is calculated to obtain the parameters required for the operation of the first model. The first model is then constructed based on these parameters and historical detection information. The historical detection information is used to calibrate or train the model, thus compensating for the shortcomings of pure physical models in adapting to complex real-world environments.

[0016] In conjunction with the first aspect, in one possible implementation, the method further includes: After the stray current is directed into the soil, the drainage current of each pipe section is continuously monitored; When the deviation between the detected current and the target current exceeds a set threshold, the enabled grounding electrode is updated based on the updated stray current distribution information and the first model.

[0017] In this implementation, after stray current is guided to the soil, the current diversion in each pipeline section is continuously monitored. Once the deviation between the current diversion and the target current exceeds a set threshold, the activated grounding electrode is recalculated and updated based on the updated stray current distribution information and the first model. This mechanism allows the activation status of the grounding electrode to automatically adjust with the dynamic changes in stray current. When external interference sources or soil conditions change, causing abnormal current distribution, it can respond promptly and re-optimize the grounding configuration, thereby always keeping the current diversion in each section close to the target value, providing long-term, adaptive, and efficient protection for the pipeline.

[0018] In conjunction with the first aspect, in one possible implementation, the pipeline sections are spaced apart along the pipeline axis, and a physical isolation layer is provided between the soil of adjacent pipeline sections. The physical isolation layer is used to prevent stray currents from flowing between the grounding electrodes of adjacent pipe sections.

[0019] In this implementation, the pipeline sections are spaced apart along the pipeline axis, and a physical isolation layer is installed between the soil layers of adjacent pipeline sections. This physical isolation layer is specifically designed to prevent stray currents from flowing between the grounding electrodes of adjacent sections. Through the blocking effect of the physical isolation layer, the grounding electrode of each pipeline section operates independently, avoiding interference and coupling effects caused by stray currents flowing laterally from one section into adjacent sections, thus facilitating independent control of each section.

[0020] In conjunction with the first aspect, in one possible implementation, the grounding electrode includes an upper grounding electrode and a lower grounding electrode, wherein the upper grounding electrode is used to drain DC stray current and the lower grounding electrode group is used to drain AC stray current.

[0021] In this implementation, the grounding electrode includes an upper grounding electrode and a lower grounding electrode. The upper grounding electrode is used to drain DC stray currents, and the lower grounding electrode is used to drain AC stray currents. By spatially separating the drainage paths of DC and AC stray currents, and having them handled by grounding electrodes at different locations, the nonlinear coupling effect caused by the superposition of mixed AC and DC currents on the same grounding electrode is avoided. This allows both DC and AC components to have optimized discharge channels. This collaborative structural design not only improves the overall drainage efficiency of the grounding electrode for mixed AC and DC stray currents but also reduces the risk of a single grounding electrode failing due to simultaneously bearing AC and DC currents.

[0022] Secondly, this application provides a stray current control device for pipelines, comprising: The information acquisition module is used to acquire real-time stray current distribution information of each pipeline section along the pipeline; the distribution information includes the stray current intensity flowing through each pipeline section. The electrode determination module is used to input the distribution information into a preset first model and output the target grounding electrode among the candidate grounding electrodes corresponding to each pipeline partition. The first model is constructed based on historical detection information and the equivalent circuit principle of stray current diversion and grounding, and is used to determine the target grounding electrode. The historical detection information includes historical stray current distribution information and the corresponding historical target grounding electrode. The current diversion module is used to activate the target grounding electrode, which is used to guide stray currents into the soil.

[0023] In conjunction with the second aspect, in one possible implementation, the first model is a model constructed with the objective of minimizing the sum of the square of the deviation between the current flowing into each pipe section and the target current flowing into the pipe section and the grounding resistance of each pipe section, and with at least one of the following constraints: The current draw of the grounding electrode corresponding to each pipeline section is within the preset current range. The resistance of the grounding electrode branch corresponding to each pipeline section is less than or equal to the upper limit of the design resistance of that grounding electrode section.

[0024] In conjunction with the second aspect, in one possible implementation, the first model is a model constructed with at least one of the following constraints, aiming to minimize the sum of the squares of the deviations between the current flowing into each pipe section and the target current flowing into the pipe section, and the squares of the deviations in the grounding potential of each pipe section: The current draw of the grounding electrode corresponding to each pipeline section is within the preset current range. The grounding potential of the grounding electrode corresponding to each pipeline section is less than or equal to the upper limit of the design potential of that grounding electrode section.

[0025] In conjunction with the second aspect, in one possible implementation, the current diversion module is also used to continuously detect the diversion current of each pipe section after the stray current is diverted into the soil. When the deviation between the detected current and the target current exceeds a set threshold, the enabled grounding electrode is updated based on the updated stray current distribution information and the first model.

[0026] In conjunction with the second aspect, in one possible implementation, the first model is a fuzzy control model. The fuzzy control model uses the direction of stray current in each pipeline section along the pipeline as input for fuzzification processing, outputs the dredging current corresponding to each candidate grounding electrode, and then filters out the target grounding electrode corresponding to each pipeline section based on the dredging current. The fuzzy rules for fuzzification processing are constructed based on historical detection information.

[0027] In conjunction with the second aspect, in one possible implementation, the parameters required for the first model to run, the electrode determination module is also used to analyze the impedance characteristics of each grounding electrode and calculate the proportion of the diversion current of each grounding electrode by treating the grounding electrodes around the pipe as multiple parallel impedance branches. The first model is constructed based on the parameters required for running the first model and historical detection information.

[0028] In conjunction with the second aspect, in one possible implementation, each pipeline section is spaced apart along the pipeline axis, and a physical isolation layer is provided between the soil of adjacent pipeline sections. The physical isolation layer is used to prevent stray currents from flowing between the grounding electrodes of adjacent pipe sections.

[0029] In conjunction with the second aspect, in one possible implementation, the grounding electrode includes an upper grounding electrode and a lower grounding electrode, wherein the upper grounding electrode is used to drain DC stray current and the lower grounding electrode group is used to drain AC stray current.

[0030] Thirdly, this application provides an electronic device comprising: a processor and a memory; the memory storing processor-executable instructions; when the processor is configured to execute the instructions, causing the electronic device to implement the method of the first aspect described above.

[0031] Fourthly, this application provides a computer-readable storage medium comprising: computer software instructions; which, when executed in an electronic device, cause the electronic device to implement the method described in the first aspect.

[0032] Fifthly, this application provides a computer program product comprising a computer program; when the computer program is run in an electronic device, it causes the electronic device to implement the method described in the first aspect.

[0033] The beneficial effects of the second to fifth aspects mentioned above are described in the corresponding description of the first aspect and will not be repeated here. Attached Figure Description

[0034] Figure 1 This is a schematic diagram illustrating the application environment of a pipeline stray current control method provided in an embodiment of this application. Figure 2 A schematic diagram of a pipeline stray current control system architecture is provided for an embodiment of this application; Figure 3 A schematic flowchart of a pipeline stray current control method provided in an embodiment of this application; Figure 4 This is a schematic diagram of parallel current shunting of grounding electrodes provided in an embodiment of this application; Figure 5 This is a schematic diagram of the grounding electrode structure provided in an embodiment of this application; Figure 6 This is a schematic diagram of the soil in the grounding electrode zone provided in an embodiment of this application; Figure 7 This is a schematic diagram of the composition of a pipeline stray current control device provided in an embodiment of this application; Figure 8 This is a schematic diagram of the composition of an electronic device provided in an embodiment of this application. Detailed Implementation

[0035] The following is a detailed description, with reference to the accompanying drawings, of a method, apparatus, device, and storage medium for controlling stray current in a pipeline provided in this application.

[0036] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.

[0037] The terms "first" and "second," etc., used in the specification and drawings of this application are used to distinguish different objects or to distinguish different treatments of the same object, rather than to describe a specific order of objects.

[0038] Furthermore, the terms "comprising" and "having," and any variations thereof, used in the description of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus.

[0039] It should be noted that in the embodiments of this application, the words "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the words "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0040] To facilitate a clear description of the technical solutions of the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish the same or similar items with essentially the same function and effect. Those skilled in the art can understand that the terms "first" and "second" are not intended to limit the quantity or execution order.

[0041] In the description of this application, unless otherwise stated, "a plurality of" means two or more.

[0042] With the rapid development of infrastructure such as oil and gas pipelines, high-voltage power transmission lines, and urban rail transit, buried metal pipelines are inevitably affected by stray currents during operation. Existing research shows that stray currents originating from DC power transmission systems, rail transit traction return currents, and AC power transmission lines often act on the pipeline system in a mixed AC / DC form, causing severe electrochemical corrosion problems at pipeline coating defects or locations of potential abrupt changes. Related literature indicates that stray current interference is one of the important causes of localized corrosion and perforation failure in buried steel pipelines. To address these issues, existing technologies mainly focus on two aspects: stray current detection and corrosion mitigation measures. In terms of detection, the degree of stray current interference is usually assessed by collecting pipe-to-ground potential, current density, or electromagnetic field parameters; in terms of protection, methods such as sacrificial anode grounding, single-point or multi-point grounding, and drainage devices are often used to guide stray currents.

[0043] However, the above-mentioned solutions still have significant shortcomings: First, stray current detection results are usually only used for condition assessment and are difficult to directly guide real-time adjustments of the diversion or grounding system; detection and mitigation methods are independent of each other. Second, most protection schemes are designed separately for DC or AC stray currents, without fully considering the coupling effect of mixed AC and DC stray currents in actual engineering. Third, existing grounding and diversion systems are mostly statically configured, making it difficult to dynamically optimize them according to changes in soil environment, external interference sources, and operating conditions. Therefore, there is an urgent need for a collaborative control method that can combine stray current detection results with diversion and grounding measures and is applicable to mixed AC and DC stray current conditions, in order to improve the long-term protection effect and operational safety of facilities such as oil and gas pipelines in complex environments.

[0044] To address the aforementioned technical problems, this application provides a method, apparatus, device, and storage medium for controlling stray current in pipelines. The approach involves acquiring stray current intensity and distribution information for each section of the pipeline along its length, and inputting this information into a pre-defined first model constructed based on historical detection information and the equivalent circuit principle of stray current diversion and grounding. The model automatically outputs the target grounding electrode to be activated from among the candidate grounding electrodes for each section, and then activates this target grounding electrode to guide the stray current into the soil. Because the first model integrates the learning capability of historical detection data with the principle of physical equivalent circuits, it utilizes data-driven methods while adhering to fundamental electrical laws. It can accurately determine the most suitable combination of grounding electrodes for the current operating conditions based on real-time distribution information, thereby achieving targeted and dynamic diversion of stray current in different sections, significantly improving the intelligence level and response speed of stray current protection.

[0045] The embodiments provided in this application will now be described in detail with reference to the accompanying drawings.

[0046] The stray current control method for pipelines provided in this application can be applied to, for example... Figure 1 The application environment shown. For example... Figure 1 As shown, the application environment includes: like Figure 1 As shown, the application environment may include a terminal device 100 and a server 101. Optionally, the application environment may also include a database system 103 that is communicatively connected to the server 101. They cooperate with each other through an application program 102 that supports stray current control in pipelines to jointly implement the stray current control method in pipelines.

[0047] The terminal device 100 includes a client application 102 that supports stray current control in pipelines. This client provides users with an interface for detecting and controlling stray current in pipelines, which can be accessed via a World Wide Web (Web) page through a browser. The terminal is specifically User Equipment (UE), and its types include, but are not limited to, smartphones, tablets, laptops, desktop computers, industrial control terminals, and Internet of Things (IoT) terminals. The terminal accesses the access network via a wireless air interface, possessing the capability to carry voice services, data transmission services, and multimedia services. Furthermore, it can achieve direct communication between different terminals based on Device to Device (D2D) direct connection technology.

[0048] The stray current control method for pipelines provided in this application can be applied to server 101. Server 101 runs an application program 102 that supports stray current control for pipelines. This program is responsible for processing stray current detection and control requests sent by clients, and executing core logic such as stray current distribution information analysis, first model calculation, and target grounding electrode decision. Server 101 is deployed with a preset first model, which is constructed based on historical detection information and the equivalent circuit principle of stray current diversion and grounding, and is used to determine the target grounding electrode. The historical detection information includes historical stray current distribution information and the corresponding historical target grounding electrode. Optionally, the first model is a fuzzy control model; the fuzzy control model uses the direction of stray current in each pipeline section along the pipeline as input for fuzzification processing, outputs the diversion current corresponding to each candidate grounding electrode, and then filters out the target grounding electrode corresponding to each pipeline section based on the diversion current; wherein, the fuzzy rules for fuzzification processing are constructed based on historical detection information. Optionally, the parameters required for the operation of the first model are obtained by treating the grounding electrodes around the pipeline as multiple parallel impedance branches, analyzing the impedance characteristics of each grounding electrode, and calculating the proportion of the current diverted by each grounding electrode; the first model is constructed based on the parameters required for the operation of the first model and historical detection information.

[0049] In an optional embodiment, the terminal device 100 and the server 101, and the server 101 and the database system 103, can be interconnected via wired or wireless networks. These connections support the transmission of program instructions and data between the components. The server 101 includes a first memory and a first processor. The first memory stores a stray current control program for pipelines; this stray current control program is invoked and executed by the first processor to implement the stray current control method provided in this application. The first memory may include, but is not limited to, the following: Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read Only Memory (PROM), Erasable Programmable Read Only Memory (EPROM), and Electrically Erasable Programmable Read Only Memory (EEPROM). The first processor may consist of one or more integrated circuit chips. Optionally, the first processor may be a general-purpose processor, such as a Central Processing Unit (CPU) or a Network Processor (NP). Optionally, the first processor can implement the stray current control method for pipelines provided in this application by running a program or code.

[0050] The stray current control method for pipes provided in this application can be executed by server 101. Server 101 is used to provide stray current detection and control services for the stray current control system of terminal device 100. Optionally, server 101 undertakes the main computing work, and terminal device 100 undertakes the secondary computing work; or, server 101 undertakes the secondary computing work, and terminal device 100 undertakes the main computing work; or, server 101 and terminal device 100 use a distributed computing architecture for collaborative computing. Server 101 can be a single server, a server cluster composed of multiple servers, or a cloud computing service center. Optionally, server 101 includes a second memory and a second processor. The second memory stores the stray current control program for pipes; the stray current control program is called by the second processor to implement the stray current control method for pipes provided in this application. Optionally, the second memory can include, but is not limited to, the following: RAM, ROM, PROM, EPROM, EEPROM. Optionally, the second processor can be a general-purpose processor, such as a CPU or NP.

[0051] Database system 103 is deployed on a dedicated server to store data related to stray current control in pipelines, including historical stray current distribution information, grounding electrode parameters for each pipeline zone, soil resistivity data, training data and model parameters of the first model, and real-time detection data generated during the control process. Database system 103 includes a distributed database, such as Elasticsearch (ES), and a relational database, such as MySQL. The distributed database is used for efficient storage and retrieval of stray current time-series data, while the relational database is used to store pipeline zone configuration information, grounding electrode attribute information, and model parameters.

[0052] In the actual deployment of this embodiment, multiple detection units and multiple grounding electrode zones are set along the buried pipeline to be protected. Specifically, as shown in the example... Figure 1 As shown, three zones, 1, 2, and 3, are spaced apart along the pipeline axis. Each zone is equipped with an upper grounding electrode and a lower grounding electrode. Zone 1 corresponds to upper grounding electrode 1, lower grounding electrode 1, and lower grounding electrode 2; Zone 2 corresponds to upper grounding electrode 2 and lower grounding electrode 3; and Zone 3 corresponds to upper grounding electrode 3 and lower grounding electrode 4. The upper grounding electrode is used to divert DC stray current, and the lower grounding electrode group is used to divert AC stray current. The grounding electrode in each zone is electrically connected to its corresponding pipeline section, forming an independent diversion branch. To prevent stray currents from flowing between adjacent zones, a physical isolation layer is installed between the soil layers of adjacent pipeline zones. For example, a high-damping insulation board or a sand layer.

[0053] To monitor the distribution of stray currents in real time, multiple detection units, including detection unit 1, detection unit 2, detection unit 3, detection unit 4, and detection unit 5, are deployed along the pipeline. These detection units are used to collect parameters such as pipe-to-ground potential, current density, and voltage gradient in each pipeline section, thereby obtaining real-time stray current intensity information flowing through each pipeline section. Each detection unit is equipped with a wireless communication module, enabling it to establish a data connection with server 101 via a wireless network. Server 101 sends data acquisition commands to each detection unit wirelessly via application program 102 that supports pipeline stray current control, and receives the real-time stray current detection data transmitted back by the units.

[0054] During the control process, server 101 first acquires real-time stray current distribution information of each pipeline section along the pipeline, collected by detection units 1 to 5, via wireless communication. This distribution information includes the stray current intensity flowing through section 1, section 2, and section 3. Subsequently, server 101 inputs the above distribution information into a pre-trained first model.

[0055] After calculation, the first model outputs a decision result, such as: enabling the upper grounding electrode 1 and lower grounding electrode 1 of zone 1, enabling the upper grounding electrode 2 of zone 2, enabling the lower grounding electrode 4 of zone 3, while other grounding electrodes remain disabled. The server 101 then sends control commands via the wireless communication network to the controllable switches or intelligent grounding electrode devices of the corresponding zones, enabling the selected target grounding electrodes. These enabled target grounding electrodes guide stray currents within the corresponding pipe zones into the soil, achieving balanced distribution and effective drainage of stray currents.

[0056] This application embodiment also provides a stray current control system for pipelines, which can be set in... Figure 1 In the application environment shown, such as Figure 2 As shown, the stray current control system 200 for pipelines may include: The front end 201 of the pipeline stray current control system is used for: It provides a visual user interface to display real-time stray current distribution information for each pipeline section along the pipeline, including the stray current intensity flowing through each section. It receives user configuration commands, including pipeline section parameters, grounding electrode parameters, and training or adjustment parameters for the first model. It displays the activation status of the target grounding electrode, real-time descent current detection data, and alarm information.

[0057] The back end 202 of the pipeline stray current control system is used for: Current Acquisition Engine 2021: Used to acquire real-time stray current distribution information from distributed sensors deployed in various pipeline sections along the pipeline. The distribution information includes the stray current intensity flowing through each pipeline section, and the acquired current signal is filtered, amplified, and converted from analog to digital.

[0058] Data Analysis Engine 2022: Used to extract features from the collected stray current distribution information, calculate the deviation between the current and the target current in each pipeline section, as well as parameters such as grounding electrode resistance and grounding potential deviation.

[0059] Model Processing Engine 2023: Internally stores a preset first model, constructed based on historical detection information and the equivalent circuit principle of stray current diversion and grounding, used to determine the target grounding electrode. The historical detection information includes historical stray current distribution information and corresponding historical target grounding electrodes. This engine inputs the distribution information processed by Data Analysis Engine 2022 into the first model and outputs the target grounding electrode from the candidate grounding electrodes corresponding to each pipe section.

[0060] The first model is a model constructed with the objective of minimizing the sum of the square of the deviation between the current diverted by each pipe section and the target current diverted by the grounding electrode resistance of each pipe section, and with at least one of the following constraints: the current diverted by the grounding electrode corresponding to each pipe section is within a preset current range; the resistance of the grounding electrode branch corresponding to each pipe section is less than or equal to the upper limit of the design resistance of the grounding electrode section; the current diverted by the stray current and the grounding electrode resistance of each pipe section are determined according to the parallel current splitting relationship.

[0061] Alternatively, the first model is a model constructed with the objective of minimizing the sum of the square of the deviation between the current and the target current of each pipe section and the square of the deviation of the grounding potential of each pipe section, and with at least one of the following constraints: the current of the grounding electrode corresponding to each pipe section is within a preset current range; the grounding potential of the grounding electrode corresponding to each pipe section is less than or equal to the upper limit of the design potential of that grounding electrode section.

[0062] Alternatively, the first model is a fuzzy control model; the fuzzy control model uses the direction of stray current in each pipeline section along the pipeline as the input quantity for fuzzification processing, outputs the dredging current corresponding to each candidate grounding electrode, and then filters out the target grounding electrode corresponding to each pipeline section based on the dredging current; wherein, the fuzzy rules for fuzzification processing are constructed based on historical detection information.

[0063] Optionally, the parameters required for the operation of the first model are obtained by treating the grounding electrodes around the pipeline as multiple parallel impedance branches, analyzing the impedance characteristics of each grounding electrode, and calculating the proportion of the current diverted by each grounding electrode; the first model is constructed based on the parameters required for the operation of the first model and historical detection information.

[0064] Grounding Control Engine 2024: Based on the target grounding electrode output by Model Processing Engine 2023, it generates control commands to enable the target grounding electrode, which is used to guide stray currents into the soil. The grounding electrode includes an upper grounding electrode and a lower grounding electrode, where the upper grounding electrode is used to guide DC stray currents and the lower grounding electrode group is used to guide AC stray currents.

[0065] Dynamic adjustment engine 2025: After stray current is guided into the soil, the current acquisition engine 2021 continuously detects the current of each pipe section; when the deviation between the detected current and the target current exceeds a set threshold, the model processing engine 2023 is triggered to redetermine the target grounding electrode based on the updated stray current distribution information and the first model, and the grounding control engine 2024 updates the enabled grounding electrode.

[0066] Database system 203 is used to: store configuration information for each pipeline section along the pipeline route, including the position of each pipeline section at intervals along the pipeline axis, and the parameters of the physical isolation layer set between adjacent pipeline sections in the soil. The physical isolation layer is used to prevent stray currents from flowing between the grounding electrodes corresponding to adjacent pipeline sections. It stores the geometric parameters, material resistivity, soil resistivity, upper limit of design resistance, and upper limit of design potential of the candidate grounding electrodes corresponding to each pipeline section. It stores historical stray current distribution information, historical diversion current data, and historical target grounding electrode activation records. It stores the training data, model parameters, and version information of the first model. It stores real-time detection data for display by the front-end 201 and for reading and writing by the various engines in the back-end 202.

[0067] It should be noted that the system architecture described in the embodiments of this application is for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and does not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of system architecture, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0068] See Figure 3 This is a flowchart illustrating a stray current control method for pipelines provided in an embodiment of this application. Figure 3 As shown, the pipeline stray current control method provided in this application can be implemented through the aforementioned server, specifically including the following steps S300~S302.

[0069] S300: The server obtains real-time stray current distribution information for each pipeline section along the pipeline.

[0070] The pipeline route refers to the continuous area traversed by the protected buried metal pipeline. Pipeline sections are multiple independent segments divided along the pipeline axis, with each pipeline section corresponding to an independent set of grounding electrodes. Stray currents originate from DC transmission systems, rail transit traction return currents, and AC transmission line induction. These currents act on the pipeline system in the form of a superposition of DC and AC components, forming a mixed AC / DC stray current. The server collects raw data in real time from the detection units distributed along the pipeline route via a wireless sensor network or wired transmission module. Each detection unit includes a current sensing unit and a potential acquisition unit, arranged laterally along the pipeline at different depths to obtain raw parameters such as pipe-to-ground potential, current density, and voltage gradient. The server processes the above raw parameters and calculates the stray current intensity value on each pipeline section. The stray current distribution information includes the stray current intensity flowing through each pipeline section. The stray current intensity represents the magnitude of the current flowing through the pipeline section, and the stray current direction represents the path of the current flowing along the pipeline. The server uses the mixed AC / DC current model, as shown in equation (1): (1) in, This is the DC stray current component. For the amplitude of AC stray current, The angular frequency of alternating current. This is the phase angle.

[0071] The purpose of obtaining the above distribution information is to provide basic data for subsequently determining which grounding electrodes need to be activated, so that stray current diversion measures can be precisely controlled according to the actual current distribution.

[0072] S301. The server inputs the distribution information into the preset first model and outputs the target grounding electrode among the candidate grounding electrodes corresponding to each pipeline partition.

[0073] The first model is constructed based on historical detection information and the equivalent circuit principle of stray current diversion and grounding. It is used to determine the target grounding electrode. The historical detection information includes historical stray current distribution information and the corresponding historical target grounding electrode.

[0074] The first model is based on historical detection information and the equivalent circuit principle of stray current diversion and grounding. Historical detection information refers to the historical stray current distribution information and corresponding historical target grounding electrodes recorded by the server during past operations. This data provides samples for model learning or parameter fitting. The equivalent circuit principle refers to a physical model that treats the grounding electrodes around the pipeline as multiple parallel impedance branches, analyzes the impedance characteristics of each branch, and calculates the current distribution ratio. This principle ensures the electrical rationality of the first model's output. The first model outputs the target grounding electrode from the candidate grounding electrodes corresponding to each pipeline section. Candidate grounding electrodes refer to multiple pre-set available grounding electrodes for each pipeline section. These grounding electrodes are physically independent and can be individually enabled or disabled by the server. The target grounding electrode is one or more selected from the candidate grounding electrodes to undertake the stray current diversion task for that section. The server performs input and output operations to transform the real-time detected stray current distribution information into specific grounding electrode activation decisions, thereby providing accurate control commands for subsequent diversion actions and achieving precise matching of stray current protection measures.

[0075] S302. The server enables the target grounding electrode, which is used to guide stray currents into the soil.

[0076] The target grounding electrode is one or more grounding electrodes selected by the server from the candidate grounding electrodes corresponding to each pipeline section. Each target grounding electrode has a defined physical location and structural parameters. Activation refers to the server sending a conduction command to the control device of the target grounding electrode, electrically connecting the target grounding electrode to the drainage loop formed between the pipeline and the soil. The server controls the connection or disconnection of the target grounding electrode via a control switch or relay. The target grounding electrode is used to guide stray currents into the soil. Guiding refers to utilizing the low-impedance path between the grounding electrode and the soil to allow stray currents accumulated on the pipeline to flow into the earth along the grounding electrode, preventing stray currents from concentrating and releasing at pipeline coating defects, thus avoiding electrochemical corrosion. The grounding electrode material can be selected from zinc (Zn), magnesium (Mg), or copper (Cu) and their alloys, determined based on soil resistivity and stray current characteristics. Zinc grounding electrodes have good conductivity and moderate corrosion resistance, making them suitable for neutral or slightly acidic soils. Magnesium grounding electrodes have a more negative potential and can quickly conduct high-intensity stray currents under the action of electrochemical sacrificial anodes, but their corrosion resistance is lower, making them suitable for short-term rapid protection or use in combination with other materials. Copper grounding electrodes have high conductivity and good durability, making them particularly suitable for high resistivity soils and ensuring long-term stable grounding performance. Therefore, alloy materials can more flexibly adapt to complex soil environments (such as high salinity, high acidity / alkalinity, or strong stray current interference), achieving a balance between the durability and conductivity of the grounding electrode.

[0077] In this embodiment, stray current intensity and other distribution information of each pipeline section along the pipeline are obtained, and this distribution information is input into a preset first model constructed based on historical detection information and the equivalent circuit principle of stray current diversion and grounding. The model automatically outputs the target grounding electrode that needs to be activated from the candidate grounding electrodes of each section, and then activates the target grounding electrode to guide the stray current into the soil. Since the first model integrates the learning ability of historical detection data and the physical equivalent circuit principle, it utilizes data-driven methods and follows basic electrical laws. It can accurately determine the most suitable combination of grounding electrodes for the current working conditions based on real-time distribution information, thereby realizing targeted and dynamic diversion of stray current in different sections, significantly improving the intelligence level and response speed of stray current protection.

[0078] In one embodiment, the first model is a model constructed with the objective of minimizing the sum of the square of the deviation between the drain current and the target drain current of each pipe section and the grounding resistance of each pipe section, and constrained by at least one of the following: The current draw of the grounding electrode corresponding to each pipeline section is within the preset current range.

[0079] The resistance of the grounding electrode branch corresponding to each pipeline section is less than or equal to the upper limit of the design resistance of that grounding electrode section.

[0080] The first model is established by minimizing an objective function, which is the sum of the square of the deviation between the current diverted by each pipe section and the target current diverted by, and the grounding electrode resistance of each pipe section. The current diverted by, is the stray current actually flowing through the corresponding grounding electrode branch of the pipe section after the target grounding electrode is activated. The target current diverted by is an ideal current value pre-set based on the upper limit of the allowable safe current for the pipe section or the principle of balanced current distribution. This value ensures that excessive electrochemical corrosion will not occur in the pipe section. For example, the target current diverted by can be the arithmetic mean obtained by dividing the total stray current by the total number of grounding electrode sections.

[0081] The grounding electrode resistance represents the resistance of a single grounding electrode to current flow, including both the electrode body resistance and the soil contact resistance. The square of the deviation is used to quantify the difference between the diverted current and the target diverted current; the larger the deviation, the faster the square value increases, prompting the model to prioritize reducing larger deviations.

[0082] The sum of the grounding electrode resistances reflects the connection resistance value. Adding an objective function can guide the model to satisfy current balance while also considering a low grounding resistance. The first model also introduces constraints, including that the current diversion of the grounding electrode corresponding to each pipeline section is within a preset current range. The preset current range is determined by the upper and lower limits of the current based on the grounding electrode material and soil thermal stability. The upper limit prevents the grounding electrode from overheating or the soil from drying out due to excessive current, while the lower limit ensures that the grounding electrode works effectively. Another constraint is that the resistance of the grounding electrode branch corresponding to each pipeline section is less than or equal to the upper limit of the design resistance of that grounding electrode section. The upper limit of the design resistance is calculated in advance based on the grounding standard and corrosion protection requirements to ensure that the grounding system has sufficient current diversion capacity. The optimization objective of the first model is shown in formula (2): , (2) In the formula, the zone diversion current , To divert the target current, These are the weighting coefficients. For grounding electrode resistance, This is the upper limit value for the designed resistance.

[0083] In this embodiment, the first model aims to minimize the square of the deviation between the current diversion of each pipeline section and the target current, as well as the sum of the grounding electrode resistances of each section. Constraints are imposed, including that the current diversion of each section is within a preset range and the resistance of each section's grounding electrode branch is less than or equal to the upper limit of the design resistance. This first model ensures that the current diversion and grounding resistance of each section do not exceed safety and design boundaries, while simultaneously pursuing uniform current distribution and minimizing grounding impedance. This effectively suppresses localized current concentration and reduces the risk of accelerated pipeline corrosion caused by uneven current distribution.

[0084] In one embodiment, the first model is a model constructed with at least one of the following constraints, aiming to minimize the sum of the square of the deviation between the current flowing into and the target current flowing into each pipe section and the square of the deviation between the ground potentials of each pipe section: The current draw of the grounding electrode corresponding to each pipeline section is within the preset current range.

[0085] The grounding potential of the grounding electrode corresponding to each pipeline section is less than or equal to the upper limit of the design potential of that grounding electrode section.

[0086] The first model is established by minimizing an objective function, which is the sum of the square of the deviation between the current diversion and the target current in each pipeline section and the square of the grounding potential deviation in each pipeline section. The square of the deviation quantifies the difference between the current diversion and the target current; the larger the deviation, the faster the square value increases, prompting the model to prioritize reducing larger deviations. Grounding potential refers to the potential difference between the grounding electrode of the pipeline section and the surrounding soil. The grounding potential deviation is the difference between the actual grounding potential and the preset target potential, and the square of the grounding potential deviation quantifies the degree to which the potential deviates from the ideal state. By adding the square of the current diversion deviation and the square of the grounding potential deviation as the objective function, the model optimizes current distribution while considering the stability of the grounding potential, avoiding local potential anomalies caused by excessive pursuit of current balance.

[0087] The first model also introduces constraints, including that the current draw of the grounding electrode corresponding to each pipeline section is within a preset current range. The preset current range is the upper and lower limits of the current determined based on the grounding electrode material and the thermal stability of the soil. The upper limit prevents the grounding electrode from overheating or the soil from drying out due to excessive current, while the lower limit ensures that the grounding electrode works effectively. Another constraint is that the grounding potential of the grounding electrode corresponding to each pipeline section is less than or equal to the upper limit of the design potential of that grounding electrode section. The upper limit of the design potential is a potential threshold calculated in advance based on the corrosion resistance of the pipeline and the cathodic protection criteria. Exceeding this threshold may cause electrolyte breakdown or coating peeling. There is a coupling relationship between the grounding potential and the draw current. When the draw current increases, the grounding potential usually increases accordingly. Therefore, the model needs to find the grounding electrode activation combination that minimizes the objective function under the dual constraints of the current range and the upper limit of the potential. Through the above objective function and constraints, the first model can output a set of target grounding electrodes so that the stray current distribution of each section along the pipeline is close to the ideal equilibrium state, and the grounding potential is controlled within a safe range, thereby achieving effective drawdown of stray current and synergistic reduction of pipeline corrosion risk. The optimization objective of the first model is shown in formula (3): , , (3) In the formula, These are the weighting coefficients. For grounding electrode resistance, It is a grounding potential deviation. It is the grounding potential deviation, which is the target grounding potential deviation.

[0088] In this embodiment, the first model aims to minimize the sum of the squared deviations of the current diversion from the target current in each pipeline section and the squared deviations of the grounding potential in each section. Constraints are imposed, including that the current diversion in each section is within a preset range and the grounding potential of the grounding electrode in each section is less than or equal to the upper limit of the design potential. By simultaneously optimizing both current and potential deviations, the first model not only focuses on the uniform distribution of the current diversion but also actively limits the fluctuation range of the grounding potential, avoiding risks induced by excessively high potentials.

[0089] In one embodiment, the pipe stray current control method further includes: S303. After directing stray current into the soil, the server continuously monitors the current diversion in each pipe section.

[0090] The stray current refers to the actual current flowing from the pipeline into the soil through the activated target grounding electrode. This current reflects the grounding electrode's effectiveness in guiding stray currents. The server collects stray current data in real time through detection units distributed within each pipeline section. These detection units include current sensing units and potential acquisition units, arranged laterally along the pipeline at different depths. Continuous monitoring means the server periodically reads the output values ​​of the detection units at preset time intervals, or actively reports data when the detection units detect current changes exceeding a set threshold, forming a continuous current detection data stream. The server records the stray current values ​​of each pipeline section at different times and stores this data in internal memory or a remote database. The purpose of continuously monitoring the stray current in each pipeline section is to monitor the actual operating status of the grounding system during stray current guidance, providing real-time evidence for subsequent judgments on whether the stray current deviates from the target value, thereby ensuring the closed-loop operation of the entire stray current control system.

[0091] S304. When the deviation between the detected current and the target current exceeds the set threshold, the server updates the enabled grounding electrode based on the updated stray current distribution information and the first model.

[0092] The set threshold is a pre-stored maximum allowable deviation value on the server. This value is determined based on pipeline corrosion protection requirements and grounding system adjustment accuracy, for example, set to 10% of the target current or a fixed current difference. When the deviation is less than or equal to the set threshold, the server determines that the current current diversion effect meets the requirements and does not perform any adjustment operations. When the deviation exceeds the set threshold, the server determines that the current grounding electrode configuration can no longer effectively control stray current and a new decision is required.

[0093] The updated stray current distribution information refers to the latest stray current intensity and direction data that the server immediately re-collects and calculates from the detection units along the pipeline after detecting excessive deviations. Since the sources of stray currents (such as DC transmission systems and rail transit traction return current) may change over time, the updated distribution information reflects the current actual interference state. The first model is a pre-built computational model used to output the target grounding electrode based on the distribution information. This model is based on historical data and can employ neural networks or fuzzy control. The server inputs the updated stray current distribution information into the first model, which recalculates the optimal selection from the candidate grounding electrodes corresponding to each pipeline section and outputs the new target grounding electrode.

[0094] Updating and activating grounding electrodes refers to the server sending a disconnect command to the previously activated grounding electrode, removing it from the current-carrying loop, and simultaneously sending a conduction command to the newly output target grounding electrode, putting the new grounding electrode into operation. Through this update operation, the server dynamically adjusts the combination of grounding electrodes in operation in the grounding system, so that the current-carrying current approaches the target current again, thereby eliminating deviations. The purpose of updating and activating grounding electrodes is to adjust the protection strategy in a timely manner when stray current conditions change or the original grounding electrode's current-carrying capacity is insufficient, maintaining the balance of stray current distribution along the pipeline and the effectiveness of the grounding system.

[0095] In this embodiment, after the stray current is guided to the soil, the current diversion of each pipeline section is continuously monitored. Once the deviation between the current diversion and the target current exceeds a set threshold, the activated grounding electrode is recalculated and updated based on the updated stray current distribution information and the first model. This mechanism enables the activation status of the grounding electrode to automatically adjust with the dynamic changes of the stray current. When changes in external interference sources or soil conditions cause abnormal current distribution, it can respond promptly and re-optimize the grounding configuration, thereby always keeping the current diversion of each section close to the target value, providing long-term, adaptive, and efficient protection for the pipeline.

[0096] In one embodiment, the first model is a fuzzy control model. The fuzzy control model uses the stray current direction of each pipeline section along the pipeline as input for fuzzification processing, outputs the dredging current corresponding to each candidate grounding electrode, and then filters out the target grounding electrode corresponding to each pipeline section based on the dredging current. The fuzzy rules for fuzzification processing are constructed based on historical detection information.

[0097] The server first extracts the correspondence between stray current intensity and direction and the corresponding activated grounding electrode from historical detection information. This historical information includes multiple records, each containing the stray current intensity and direction of a pipe section at a specific moment, as well as the actual activated target grounding electrode at that time. Using these records as samples, the server determines the input and output variable ranges of the fuzzy controller through statistical analysis. The input variable is the stray current direction, and the output variable is the current flowing through each candidate grounding electrode. The server divides the input variable into multiple fuzzy intervals based on engineering experience or clustering methods. Similarly, the output variable is divided into multiple levels, such as small current, medium current, and large current. Fuzzy rules are formulated such that if the input direction belongs to a certain fuzzy label, then the output current flowing through it belongs to a certain level. The confidence level of each rule is calculated based on the frequency of that condition in the historical detection information. The server then deploys the fuzzy control model to the application environment. During operation, the server inputs the stray current direction obtained in real time into the fuzzy control model. The model activates multiple rules based on the current direction value, obtains the drainage current value corresponding to each candidate grounding electrode through weighted synthesis, and then selects one or more candidate grounding electrodes with the largest drainage current as the target grounding electrode output.

[0098] In one possible implementation, the first model is a neural network model.

[0099] When building the neural network model, the server first prepares a training dataset. The training dataset is derived from historical detection information, and each training sample contains two parts: input and output. The input part is the stray current distribution information of each pipe section along the pipeline, including the stray current intensity and direction of each section. The output part is the actual target grounding electrode identifier activated at the corresponding time. The server encodes the input part into a set of numerical vectors and the output part into the corresponding expected output vector. The server uses the training dataset to iteratively train the neural network model. During each training iteration, the server inputs samples into the network, calculates the error between the network output and the expected output, and adjusts the connection weights and bias parameters of each layer in the network based on the error. This process is repeated until the model's error on the validation set no longer decreases significantly. After training, the server saves the neural network model and deploys it to the application environment. During runtime, the server encodes the stray current distribution information collected in real time and inputs it into the neural network model, and the server selects candidate grounding electrodes as the target grounding electrode output.

[0100] In this embodiment, the first model employs a fuzzy control model. This model uses the stray current direction of each pipeline section along the pipeline as input for fuzzification processing, and outputs the diversion current corresponding to each candidate grounding electrode based on fuzzy rules constructed from historical detection information. Then, based on this diversion current, the target grounding electrode corresponding to each pipeline section is selected. The fuzzy control model converts directional information into membership degrees through fuzzification processing and uses rules extracted from historical data for reasoning, quickly outputting a reasonable diversion current allocation without requiring precise analytical expressions. Therefore, this method can adapt to scenarios with variable stray current directions and mixed AC / DC interference sources.

[0101] In another possible implementation, the first model is a rule-based logic model.

[0102] When constructing the rule logic model, the server predefines a set of judgment rules based on the equivalent circuit principle of stray current diversion and grounding, as well as engineering experience. Each rule contains a condition part and a conclusion part. The condition part describes the stray current distribution characteristics of a pipe section, such as whether the current intensity exceeds a preset threshold or whether the current direction points to a specific area. The conclusion part specifies the target grounding electrode number or combination to be enabled. During online operation, the server sequentially matches the stray current distribution information acquired in real time with the rules in the rule base, according to the priority from high to low. When the condition of a rule is met, the server immediately executes the conclusion part of that rule, outputs the corresponding target grounding electrode, and stops matching subsequent rules. If the conditions of all rules are not met, the server outputs a default grounding electrode combination or disables any grounding electrode.

[0103] In one embodiment, the parameters required for the first model to run are obtained by treating the grounding electrodes around the pipe as multiple parallel impedance branches, analyzing the impedance characteristics of each grounding electrode, and calculating the proportion of the drainage current of each grounding electrode.

[0104] The server analyzes the impedance characteristics of each grounding electrode and calculates the proportion of current diverted by each grounding electrode as multiple parallel impedance branches to obtain the parameters required for the first model to run. Parallel impedance branches refer to treating each grounding electrode zone as an independent electrical branch. These branches are interconnected in the circuit structure to collectively carry the total stray current collected on the pipeline. The impedance characteristics include the resistive and inductive reactance components of each branch. The resistive component consists of the resistance of the grounding electrode conductor and the soil contact resistance, while the inductive reactance component originates from the electromagnetic induction effect generated when alternating current passes through the conductor. The current diverted is determined based on the stray current and the resistance values ​​of the grounding electrodes in each pipeline zone according to the parallel current-sharing relationship.

[0105] For example, the grounding electrode impedance Zn can be expressed by the AC component calculation formula (4): (4) In the formula, This is the grounding resistance value. It is the equivalent inductance of the ground electrode.

[0106] like Figure 4 As shown, the grounding electrodes of each zone can be combined according to the current distribution calculation formula (5): (5) in For the first n The stray current borne by each grounding electrode zone This represents the total stray current in the pipeline.

[0107] In one possible implementation, the grounding electrode resistance is determined based on the grounding electrode's geometric parameters, material resistivity, and soil resistivity.

[0108] like Figure 5 As shown, the grounding electrode adopts a rod-shaped, tubular, or strip-shaped structure. A 0.3-0.5 mm anti-corrosion layer is coated on the surface of the grounding electrode to reduce self-corrosion, but the drainage surface must directly contact the soil to ensure drainage efficiency. The resistance of a single rod-shaped, tubular, or strip-shaped grounding electrode can be calculated using the following formula (6): (6) in, Let L be the soil resistivity (Ω·m), and L be the length of the grounding electrode (m). d , d The equivalent diameter (m) of the grounding electrode is taken as half the width of the corresponding horizontal strip equivalent diameter.

[0109] For a horizontal strip grounding electrode, the grounding resistance is calculated according to the following formula (7): (7) in, h Burial depth (m). A The shape factor is -0.6 to -0.18 for linear shapes, 1.69 for closed squares, 0.48 for closed circles, and 0.89 for crosses.

[0110] When multiple identical grounding electrodes are used in parallel, due to the electric field shielding effect, the total grounding resistance is calculated according to the following formula (8): (8) in, n This refers to the number of grounding electrodes. η The utilization factor is generally taken as 0.7 to 0.8.

[0111] For a closed grounding grid mainly composed of horizontal grounding electrodes, the equivalent square method can be used to estimate the grounding resistance: (9) in, C represents the total area of ​​the grounding grid (m²).

[0112] In one possible implementation, the first model is constructed based on the parameters required for operation and historical detection information.

[0113] Historical monitoring information includes stray current distribution data under different operating conditions recorded by the server during past operations, as well as records of the target grounding electrodes actually activated at the corresponding times. The server compares and analyzes the calculated equivalent impedance, diversion current ratio, total stray current, and other parameters with the actual operating data in the historical monitoring information. For example, the first model uses a fuzzy control model. Based on the variation range of the above parameters under different operating conditions, combined with the current balance target and potential control threshold specified in the pipeline corrosion protection requirements, the server formulates fuzzy control rules. For example, when the impedance of a certain zone is too low, resulting in excessive diversion current, the rule output reduces the activation degree of the grounding electrode in that zone. For example, the first model uses a neural network algorithm. The server uses the above parameters and historical monitoring information to form a training sample set. The input of each sample is the impedance value of each zone and the total stray current under the current operating condition, and the output is the combination of target grounding electrodes that performs well in actual operation. Through iterative training, the neural network learns the mapping relationship from operating condition parameters to the optimal diversion scheme. Regardless of the model used, the server ensures that the first model has the ability to accurately optimize the diversion scheme based on the real-time stray current distribution, thereby realizing the decision on the activation of the grounding electrode.

[0114] In this embodiment, the grounding electrodes around the pipeline are treated as multiple parallel impedance branches. The impedance characteristics of each grounding electrode are analyzed, and the proportion of current diverted by each grounding electrode is calculated to obtain the parameters required for the operation of the first model. Based on these parameters and historical detection information, the first model is constructed. The historical detection information is then used to calibrate or train the model, compensating for the shortcomings of purely physical models in adapting to complex real-world environments.

[0115] In one embodiment, the pipe sections are spaced apart along the pipe axis, and a physical isolation layer is provided between the soil of adjacent pipe sections.

[0116] The pipeline axis refers to the direction of the buried metal pipeline's length. Spacing refers to maintaining a certain distance between two adjacent pipeline zones, typically 10 to 15 meters. A physical isolation layer is installed between the soil layers of adjacent pipeline zones. This physical isolation layer is an isolation component filled in the soil at the boundary between adjacent zones, using high-damping insulating plates or sand layers. The physical isolation layer prevents stray currents from flowing between the grounding electrodes of adjacent pipeline zones. Preventing cross-current means blocking the path of stray current flowing laterally from one zone's grounding electrode into the grounding electrode of an adjacent zone. Cross-current will cause the independent current diversion function of each zone to fail, leading to unbalanced current distribution and increased risk of localized corrosion. By electrically isolating the soil of each zone through the physical isolation layer, each zone's grounding electrode only diverts stray currents from the pipelines in its own zone, thereby maintaining the independence of zone control and the accuracy of current distribution.

[0117] In this embodiment, the pipeline sections are spaced apart along the pipeline axis, and a physical isolation layer is provided between the soil of adjacent pipeline sections. This physical isolation layer is specifically designed to prevent stray currents from flowing between the grounding electrodes of adjacent sections. Through the blocking effect of the physical isolation layer, the grounding electrode of each pipeline section operates independently, avoiding interference and coupling effects caused by stray currents flowing laterally from one section into adjacent sections, thus facilitating independent control of each section.

[0118] In one embodiment, the grounding electrode includes an upper grounding electrode and a lower grounding electrode, wherein the upper grounding electrode is used to drain DC stray current and the lower grounding electrode group is used to drain AC stray current.

[0119] The upper grounding electrode is an electrode structure buried in the soil above the pipeline, while the lower grounding electrode group is a combination unit composed of multiple electrodes buried in the soil below the pipeline. The upper grounding electrode is used to divert DC stray current. DC stray current originates from the grounding electrode of the DC transmission system or the DC component of the traction return current from rail transit; this current has a constant direction and flows longitudinally along the pipeline. The upper grounding electrode guides the DC stray current into the soil through sacrificial anode materials or low-impedance paths. The lower grounding electrode group is used to divert AC stray current. AC stray current originates from the AC voltage and current generated on the pipeline by electromagnetic induction from high-voltage AC transmission lines; this current changes periodically over time. The lower grounding electrode group utilizes multiple electrodes connected in parallel to reduce AC impedance, efficiently discharging the AC stray current to the ground. By assigning the DC diversion task to the upper grounding electrode and the AC diversion task to the lower grounding electrode group, the electrochemical interference and reduced diversion efficiency problems caused by a single type of grounding electrode simultaneously handling mixed AC and DC currents are avoided, achieving multi-path coordinated control of mixed AC and DC stray currents.

[0120] like Figure 6As shown, a zone is set every 10–15m, and each zone includes an upper grounding electrode group and a lower grounding electrode group. Physical isolation layers (such as high-damping insulation boards or sand layers) are set between zones to ensure the independence of current zones and prevent stray current interference across zones.

[0121] The upper grounding electrode (G1) is mainly used to divert the DC component, while the lower grounding electrode (G2) is mainly used to divert the AC component. Each zone can be activated independently or adjusted in combination to achieve zone-level current balance. Examples of zone parameters are shown in Table 1, and can be adjusted according to the actual soil environment, pipe diameter, and stray current intensity. Table 1 Parameter Table for a Single Grounding Electrode

[0122] In this embodiment, the grounding electrode includes an upper grounding electrode and a lower grounding electrode. The upper grounding electrode is used to drain DC stray current, and the lower grounding electrode is used to drain AC stray current. By spatially separating the drainage paths of DC and AC stray currents, and having them handled by grounding electrodes at different locations, the nonlinear coupling effect caused by the superposition of mixed AC and DC currents on the same grounding electrode is avoided, allowing both DC and AC components to have optimized discharge channels. This collaborative structural design not only improves the overall drainage efficiency of the grounding electrode for mixed AC and DC stray currents but also reduces the risk of a single grounding electrode failing due to simultaneously bearing AC and DC currents.

[0123] As can be seen, the above mainly describes the solutions provided by the embodiments of this application from a methodological perspective. To achieve the above functions, the embodiments of this application provide corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the modules and algorithm steps of the various examples described in the embodiments disclosed herein, the embodiments of this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this invention.

[0124] This application embodiment can divide the pipeline stray current control device into functional modules according to the above method example. For example, each function can be divided into a separate functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. Optionally, the module division in this application embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.

[0125] In some embodiments, this application also provides a pipe stray current control device. This pipe stray current control device may include one or more functional modules for implementing the pipe stray current control method of the above method embodiments.

[0126] For example, Figure 7 This is a schematic diagram illustrating the composition of a stray current control device for a pipeline, as provided in an embodiment of this application. Figure 7 As shown, the stray current control device 400 for pipelines includes: an information acquisition module 401, an electrode determination module 402, and a current diversion module 403.

[0127] The information acquisition module 401 is used to acquire real-time stray current distribution information of each pipeline section along the pipeline. The distribution information includes the stray current intensity flowing through each pipeline section.

[0128] The electrode determination module 402 is used to input the distribution information into a preset first model and output the target grounding electrode among the candidate grounding electrodes corresponding to each pipeline partition. The first model is constructed based on historical detection information and the equivalent circuit principle of stray current diversion and grounding, and is used to determine the target grounding electrode. The historical detection information includes historical stray current distribution information and the corresponding historical target grounding electrode.

[0129] The current diversion module 403 is used to enable the target grounding electrode, which is used to divert stray current into the soil.

[0130] In one embodiment, the first model is a model constructed with the objective of minimizing the sum of the square of the deviation between the drain current and the target drain current of each pipe section and the grounding resistance of each pipe section, and constrained by at least one of the following: The current draw of the grounding electrode corresponding to each pipeline section is within the preset current range.

[0131] The resistance of the grounding electrode branch corresponding to each pipeline section is less than or equal to the upper limit of the design resistance of that grounding electrode section.

[0132] In one embodiment, the first model is a model constructed with at least one of the following constraints, aiming to minimize the sum of the square of the deviation between the current flowing into and the target current flowing into each pipe section and the square of the deviation between the ground potentials of each pipe section: The current draw of the grounding electrode corresponding to each pipeline section is within the preset current range.

[0133] The grounding potential of the grounding electrode corresponding to each pipeline section is less than or equal to the upper limit of the design potential of that grounding electrode section.

[0134] In one embodiment, the current diversion module 403 is also used to continuously detect the diversion current of each pipe section after the stray current is diverted into the soil.

[0135] When the deviation between the detected current and the target current exceeds a set threshold, the enabled grounding electrode is updated based on the updated stray current distribution information and the first model.

[0136] In one embodiment, the first model is a fuzzy control model. The fuzzy control model uses the stray current direction of each pipeline section along the pipeline as input for fuzzification processing, outputs the dredging current corresponding to each candidate grounding electrode, and then filters out the target grounding electrode corresponding to each pipeline section based on the dredging current. The fuzzy rules for fuzzification processing are constructed based on historical detection information.

[0137] In one embodiment, the parameters required for the first model to run are obtained by the electrode determination module by analyzing the impedance characteristics of each grounding electrode and calculating the proportion of the draining current of each grounding electrode, by treating the grounding electrodes around the pipe as multiple parallel impedance branches.

[0138] The first model is constructed based on the parameters required for running the first model and historical detection information.

[0139] In one embodiment, the pipe sections are spaced apart along the pipe axis, and a physical isolation layer is provided between the soil of adjacent pipe sections.

[0140] The physical isolation layer is used to prevent stray currents from flowing between the grounding electrodes of adjacent pipe sections.

[0141] In one embodiment, the grounding electrode includes an upper grounding electrode and a lower grounding electrode, wherein the upper grounding electrode is used to drain DC stray current and the lower grounding electrode group is used to drain AC stray current.

[0142] When implementing the functions of the integrated modules described above in hardware, this embodiment of the invention provides a possible schematic diagram of the electronic device involved in the above embodiments. For example... Figure 8 As shown, the electronic device 500 includes: a processor 502, a communication interface 503, and a bus 504. Optionally, the electronic device 500 may also include a memory 501.

[0143] Processor 502 may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 502 may be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 502 may also be a combination that implements computing functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.

[0144] Communication interface 503 is used to connect to other devices via a communication network. This communication network can be Ethernet, wireless access network, wireless local area network (WLAN), etc.

[0145] The memory 501 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), disk storage medium or other magnetic storage device, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto.

[0146] As one possible implementation, the memory 501 can exist independently of the processor 502. The memory 501 can be connected to the processor 502 via a bus 504 and is used to store instructions or program code. When the processor 502 calls and executes the instructions or program code stored in the memory 501, it can implement the pipeline stray current control method provided in this embodiment of the invention.

[0147] In another possible implementation, the memory 501 can also be integrated with the processor 502.

[0148] Bus 504 can be an extended industry standard architecture (EISA) bus, etc. Bus 504 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 8 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0149] Through the above description of the implementation methods, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the service calling device can be divided into different functional modules to complete all or part of the functions described above.

[0150] This application also provides a computer-readable storage medium. All or part of the processes in the above method embodiments can be executed by computer instructions instructing related hardware. The program can be stored in the aforementioned computer-readable storage medium, and when executed, it can include the processes of the above method embodiments. The computer-readable storage medium can be any of the foregoing embodiments or memory. The aforementioned computer-readable storage medium can also be an external storage device of the aforementioned service invocation device, such as a plug-in hard drive, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the aforementioned service invocation device. Further, the aforementioned computer-readable storage medium can include both internal storage units of the aforementioned service invocation device and external storage devices. The aforementioned computer-readable storage medium is used to store the aforementioned computer program and other programs and data required by the aforementioned service invocation device. The aforementioned computer-readable storage medium can also be used to temporarily store data that has been output or will be output.

[0151] This application also provides computer instructions. All or part of the processes in the above method embodiments can be executed by computer instructions to instruct related hardware (such as computers, processors, network devices, and terminals). The program can be stored in the aforementioned computer-readable storage medium.

[0152] This application also provides a computer program product that, when run on a computer, causes the above-described method embodiments to be executed.

[0153] This application also provides a chip system. The chip system may be composed of chips or may include chips and other discrete devices, without limitation. The chip system includes a processor and a transceiver. All or part of the processes in the above method embodiments can be completed by this chip system, such as the chip system being used to implement the functions performed by the network devices or terminals in the above method embodiments.

[0154] In one possible design, the chip system further includes a memory for storing program instructions and / or data. When the chip system is running, the processor executes the program instructions stored in the memory to enable the chip system to perform the functions performed by the network device or terminal in the above method embodiments.

[0155] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for controlling stray current in a pipeline, characterized in that, include: Obtain real-time stray current distribution information for each pipeline section along the pipeline; The distribution information includes the stray current intensity flowing through each of the pipe sections; The distribution information is input into a preset first model, and the target grounding electrode is output from the candidate grounding electrodes corresponding to each pipeline partition. The first model is constructed based on historical detection information and the equivalent circuit principle of stray current diversion and grounding, and is used to determine the target grounding electrode. The historical detection information includes historical stray current distribution information and the corresponding historical target grounding electrode. The target grounding electrode is activated to guide the stray current into the soil.

2. The method according to claim 1, characterized in that, The first model is a model constructed with the objective of minimizing the sum of the square of the deviation between the current flowing into and the target current in each pipe section and the grounding resistance of each pipe section, and with at least one of the following constraints: The current draw of the grounding electrode corresponding to each pipeline section is within the preset current range. The resistance of the grounding electrode branch corresponding to each pipeline section is less than or equal to the upper limit of the design resistance of that grounding electrode section.

3. The method according to claim 1, characterized in that, The first model is constructed with the objective of minimizing the sum of the square of the deviation between the current flowing into and the target current flowing into each pipe section and the square of the deviation between the grounding potentials of each pipe section, and is constrained by at least one of the following: The current draw of the grounding electrode corresponding to each pipeline section is within the preset current range. The grounding potential of the grounding electrode corresponding to each pipeline section is less than or equal to the upper limit of the design potential of that grounding electrode section.

4. The method according to claim 1, characterized in that, The first model is a fuzzy control model; the fuzzy control model uses the direction of stray current in each pipeline section along the pipeline as the input quantity for fuzzification processing, outputs the dredging current corresponding to each candidate grounding electrode, and then filters out the target grounding electrode corresponding to each pipeline section based on the dredging current; wherein, the fuzzy rules for the fuzzification processing are constructed based on the historical detection information.

5. The method according to claim 1, characterized in that, The first model is constructed based on historical detection information and the equivalent circuit principle of stray current diversion and grounding, including: The parameters required for the first model to run are obtained by treating the grounding electrodes around the pipeline as multiple parallel impedance branches, analyzing the impedance characteristics of each grounding electrode, and calculating the proportion of the diversion current of each grounding electrode. The first model is constructed based on the parameters required for its operation and the historical detection information.

6. The method according to claim 1, characterized in that, The method further includes: After the stray current is directed into the soil, the current flow in each pipe section is continuously monitored. When the detected deviation between the current and the target current exceeds a set threshold, the enabled grounding electrode is updated based on the updated stray current distribution information and the first model.

7. The method according to claim 1, characterized in that, The pipeline sections are spaced apart along the pipeline axis, and a physical isolation layer is provided between the soil of adjacent pipeline sections. The physical isolation layer is used to prevent stray currents from flowing between the grounding electrodes of adjacent pipe sections.

8. The method according to claim 1, characterized in that, The grounding electrode includes an upper grounding electrode and a lower grounding electrode, wherein the upper grounding electrode is used to drain DC stray current and the lower grounding electrode group is used to drain AC stray current.

9. A stray current control device for pipelines, characterized in that, include: The information acquisition module is used to acquire real-time stray current distribution information of each pipeline section along the pipeline; The distribution information includes the stray current intensity flowing through each of the pipe sections; The electrode determination module is used to input the distribution information into a preset first model and output the target grounding electrode among the candidate grounding electrodes corresponding to each pipeline partition. The first model is constructed based on historical detection information and the equivalent circuit principle of stray current diversion and grounding, and is used to determine the target grounding electrode. The historical detection information includes historical stray current distribution information and the corresponding historical target grounding electrode. A current diversion module is used to activate the target grounding electrode, which is used to guide the stray current into the soil.

10. An electronic device, characterized in that, It includes a processor and a memory, the processor being coupled to the memory; the memory is used to store computer instructions, which are loaded and executed by the processor to enable the computer device to implement the pipe stray current control method as described in any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes computer-executable instructions that, when executed on a computer, cause the computer to perform the pipeline stray current control method as described in any one of claims 1 to 8.

12. A computer program product, characterized in that, The computer program product includes a computer program that, when run on an electronic device, causes the electronic device to perform the pipe stray current control method as described in any one of claims 1 to 8.