A long oil and gas pipeline defect identification method, device, equipment, medium and product

CN122989604APending Publication Date: 2026-10-27PIPECHINA SOUTH CHINA CO +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611143140.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-30
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

然而,现有方法高度依赖检测人员的专业经验,识别效率较低且易发生漏检

Benefits of technology

[0010]本发明实施例提供的技术方案,通过获取至少一个管道内壁图像以及与管道内壁图像对应的管道信息,并根据每个管道内壁图像的管道信息以及当时设备的运行状态信息,生成该管道内壁图像对应的状态向量。进一步的,基于状态向量确定目标处理方式,并根据目标处理方式所关联的目标模型,对管道内壁图像进行级联缺陷检测,输出管道内壁图像对应的目标缺陷类别。本技术方案,解决了管道内壁图像缺陷检测难以兼顾识别精度与处理效率的技术问题,实现了在保证检测精度的前提下,提升管道内壁图像的整体处理效率的技术效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122989604A_ABST
    Figure CN122989604A_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a long oil and gas pipeline defect identification method, device, equipment, medium and product, the method comprises: acquiring at least one pipeline inner wall image and the pipeline information corresponding to the pipeline inner wall image;For each pipeline inner wall image, generate a state vector based on the pipeline information and the running state information;Determine the target processing mode based on the state vector, and perform cascade defect detection on the pipeline inner wall image according to the target model associated with the target processing mode, and output the target defect category corresponding to the pipeline inner wall image.The technical scheme solves the technical problem that the pipeline inner wall image defect detection cannot consider the recognition accuracy and processing efficiency, and realizes the technical effect of improving the overall processing efficiency of the pipeline inner wall image under the premise of ensuring the detection accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to a method, apparatus, equipment, medium and product for identifying defects in long-distance oil and gas pipelines. Background Technology

[0002] Long-distance oil and gas pipelines are crucial infrastructure for energy transportation, and their safe operation is directly related to energy security. Pipeline inspection technology is a key means of identifying pipeline defects and assessing their safety status.

[0003] Currently, existing methods involve operating an internal detector inside the pipeline to collect pipeline data and convert it into images of the pipeline's inner wall. Inspectors then visually inspect or use annotation tools to identify defects in the pipe's inner wall images to determine if any defects exist. However, existing methods heavily rely on the inspectors' professional experience, resulting in low identification efficiency and a high risk of missed detections. Summary of the Invention

[0004] This invention provides a method, apparatus, equipment, medium, and product for identifying defects in long-distance oil and gas pipelines, in order to improve the overall processing efficiency of pipeline inner wall images while ensuring detection accuracy.

[0005] According to one aspect of the present invention, a method for identifying defects in long-distance oil and gas pipelines is provided, comprising: Acquire at least one image of the inner wall of a pipe and pipe information corresponding to the image, wherein the pipe information includes at least one or more of pipe importance information, detection purpose information, and historical defect information; For each image of the inner wall of the pipe, a state vector is generated based on the pipe information and the operating status information, wherein the operating status information is used to characterize the current load of computing resources; Based on the state vector, the target processing method is determined, and according to the target model associated with the target processing method, cascaded defect detection is performed on the inner wall image of the pipe, and the target defect category corresponding to the inner wall image of the pipe is output. The target model is at least one or more of the first target model, the second target model and the third target model, and the hierarchical structure complexity of the first target model, the second target model and the third target model increases sequentially.

[0006] According to another aspect of the present invention, a long-distance oil and gas pipeline defect identification device is provided, the long-distance oil and gas pipeline defect identification device comprising: An image acquisition module is used to acquire at least one image of the inner wall of a pipe and pipe information corresponding to the image of the inner wall of the pipe, wherein the pipe information includes at least one or more of the following: pipe importance information, detection purpose information, historical defect information, and urgency level. A state vector generation module is used to generate a state vector for each image of the inner wall of the pipe, based on the pipe information and the operating state information, wherein the operating state information is used to characterize the current load of computing resources; The category output module is used to determine the target processing method based on the state vector, and perform cascade defect detection on the pipeline inner wall image according to the target model associated with the target processing method, and output the target defect category corresponding to the pipeline inner wall image. The target model is at least one or more of the first target model, the second target model and the third target model, and the hierarchical structure complexity of the first target model, the second target model and the third target model increases sequentially.

[0007] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform a method for identifying defects in long-distance oil and gas pipelines according to any embodiment of the present invention.

[0008] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions, the computer instructions being configured to cause a processor to execute and implement a method for identifying defects in long-distance oil and gas pipelines as described in any embodiment of the present invention.

[0009] According to another aspect of the present invention, a computer program product is provided, which, when executed by a processor, implements a method for identifying defects in long-distance oil and gas pipelines as described in any of the embodiments of the present invention.

[0010] The technical solution provided by this invention acquires at least one image of the inner wall of a pipe and corresponding pipe information. Based on the pipe information and the current operating status of the equipment in each inner wall image, a state vector is generated for that image. Further, a target processing method is determined based on the state vector, and cascaded defect detection is performed on the inner wall images according to the target model associated with that method, outputting the target defect category corresponding to each inner wall image. This technical solution solves the technical problem of balancing recognition accuracy and processing efficiency in defect detection of inner wall images of pipes, achieving the technical effect of improving the overall processing efficiency of inner wall images of pipes while ensuring detection accuracy.

[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0012] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 A flowchart of a method for identifying defects in long-distance oil and gas pipelines provided in an embodiment of the present invention; Figure 2 A flowchart of a method for identifying defects in long-distance oil and gas pipelines provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the overall scheme of a method for identifying defects in long-distance oil and gas pipelines provided in an embodiment of the present invention. Figure 4 This is a schematic diagram of the structure of a long-distance oil and gas pipeline defect identification device provided in an embodiment of the present invention; Figure 5 A schematic diagram of an electronic device that can be used to implement embodiments of the present invention is shown. Detailed Implementation

[0014] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0015] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0016] It is understood that before using the technical solutions disclosed in the various embodiments of the present invention, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in the present invention and their authorization should be obtained in accordance with relevant laws and regulations through appropriate means.

[0017] Figure 1 This is a flowchart illustrating a method for identifying defects in long-distance oil and gas pipelines according to an embodiment of the present invention. This embodiment is applicable to the identification of defects in long-distance oil pipelines. The method can be executed by a long-distance oil and gas pipeline defect identification device according to an embodiment of the present invention. This device can be implemented using software and / or hardware, such as... Figure 1 As shown, the method specifically includes the following steps: S110. Obtain at least one image of the inner wall of a pipe and pipe information corresponding to the image of the inner wall of the pipe.

[0018] The pipeline information includes at least one or more of the following: pipeline importance information, inspection purpose information, historical defect information, and urgency level.

[0019] In this embodiment, the image of the pipe's inner wall can be an image acquired and processed by an internal detector while the pipe is running inside. This image characterizes the surface condition of the pipe's inner wall. Optionally, the image of the pipe's inner wall can be generated by using sensors to acquire physical signals such as pipe wall thickness, material changes, and surface morphology, and then performing data processing and image reconstruction.

[0020] Pipeline information can be information related to the attributes of the pipeline to be inspected. This information describes the basic characteristics of the pipeline, the background of the inspection task, and its safety status. Optionally, pipeline information includes pipeline importance information, inspection purpose information, and historical defect information. Among them, pipeline importance information can be information characterizing the functional level and importance of the pipeline segment in the pipeline network system. This information can be obtained by pre-setting pipeline categories. Optionally, pipeline importance can be divided into three levels: trunk lines, branch lines, and gathering and transportation pipelines. Among them, trunk lines can be the main pipelines that undertake long-distance, high-volume oil and gas transportation tasks in the pipeline network system. Branch lines can be branch pipelines that branch off from trunk lines. These pipelines are used to transport oil and gas from trunk lines to specific areas. Gathering and transportation pipelines can be pipelines used to collect scattered single wells to processing stations, metering stations, or the beginning of trunk lines.

[0021] The purpose of the inspection can be information that characterizes the triggering reason and target type of the current inspection task. Optionally, the purpose of the inspection includes, but is not limited to, emergency inspection, routine inspection, and verification inspection. Emergency inspection can be understood as an emergency inspection due to a sudden event; routine inspection can be understood as a scheduled regular inspection; verification inspection can be understood as a re-inspection to verify suspected defects or the effectiveness of repairs.

[0022] Historical defect information can be statistical information on defects recorded in the pipeline segment within a preset period of time. Optionally, historical defect information includes three levels: high risk, medium risk, and low risk, and the weights corresponding to the three levels are pre-assigned.

[0023] Urgency level can be used as a quantitative indicator to represent the time-bound urgency of the current detection task. It can be understood as being determined by the length of time between the report submission deadline and the current time. In other words, the closer the deadline, the higher the urgency level. Optionally, the urgency level includes three levels: urgent, normal, and lenient, with pre-assigned weights for each level.

[0024] Specifically, an internal detector operates inside the pipeline, collecting physical signals such as the morphology of the pipeline's inner surface. After preprocessing the collected sensor data, including signal denoising, amplitude correction, and spatial mapping, an image reflecting the condition of the pipeline's inner wall surface is reconstructed. This provides the image data foundation for subsequent defect identification. Furthermore, pipeline information corresponding to the pipeline inner wall image is determined, including one or more of the following: pipeline importance information, detection purpose information, and historical defect information. By acquiring this pipeline information, differentiated defect detection of different pipeline segments can be achieved based on multi-dimensional information such as the pipeline's functional level, the urgency of the detection task, and the historical safety status of the pipe segment, thereby improving the efficiency and accuracy of pipeline identification.

[0025] S120. For each image of the inner wall of the pipe, generate a state vector based on the pipe information and operating status information.

[0026] Among them, the running status information is used to characterize the current load of computing resources.

[0027] In this embodiment, the running status information can characterize the resource load of the computing device currently used to perform defect detection. It should be noted that in edge computing scenarios, the load of computing resources changes dynamically, which can affect task execution efficiency and system stability.

[0028] Optionally, runtime status information includes, but is not limited to, Central Processing Unit (CPU) utilization, Graphics Processing Unit (GPU) utilization, memory usage, and remaining time percentage. CPU utilization can be the percentage of CPU currently in use; GPU utilization can be the percentage of GPU currently in use; memory usage can be the percentage of memory currently in use; and the remaining time percentage can be the ratio of the remaining available time for the task to the total allowed time. By obtaining runtime status information such as CPU utilization, GPU utilization, memory usage, and remaining time percentage, the current utilization level of computing resources can be reflected.

[0029] A state vector can be a multidimensional vector composed of numerically encoded pipeline information and operating status information.

[0030] It should be noted that for large-scale image batch processing scenarios, a dynamic batch adjustment method is adopted, which dynamically adjusts the batch size according to the system load. Large batches are used when resources are sufficient, and small batches are used when resources are scarce, to ensure system stability.

[0031] Specifically, pipeline information, including pipeline importance, detection purpose, and / or historical defect information, is acquired. The various dimensions of this pipeline information are then numerically encoded according to a preset encoding rule to obtain the dimensions representing task attributes in the state vector. Further, real-time operational status information, such as CPU utilization, GPU utilization, processing time, and memory usage, is collected through the system monitoring interface. This data is normalized to values ​​between 0 and 2, thereby obtaining the dimension representing resource load in the state vector. Finally, the encoded task attribute dimension and the normalized resource load dimension are concatenated into a one-dimensional vector or column vector in a preset order to generate the state vector. By combining pipeline information and operational status information into a state vector, collaborative optimization of task scheduling and resource management can be achieved based on the actual system load, maximizing detection efficiency and accuracy while ensuring stable system operation.

[0032] Furthermore, the specific generation process of the state vector is further refined. Optionally, the operating state information includes at least one or more of CPU utilization, GPU utilization, processing time, and memory usage. For each image of the inner wall of the pipe, a state vector is generated based on the pipe information and the operating state information, including: Based on pipeline importance information, detection purpose information, historical defect information, and / or urgency level, determine the task priority corresponding to the pipeline inner wall image; combine task priority, processing time, CPU utilization, GPU utilization, and / or memory usage to obtain a state vector.

[0033] In this embodiment, task priority can be a quantitative indicator used to characterize the urgency and processing order of the current pipeline inner wall image detection task. It should be noted that this indicator can be obtained by comprehensively considering one or more of the following: pipeline importance information, detection objective information, and historical defect information.

[0034] Specifically, pipeline importance information, inspection purpose information, historical defect information, and / or urgency level are numerically encoded according to preset coding rules, and task priorities are calculated, i.e.: ; Where I represents pipeline importance information, O represents detection purpose information, H represents historical defect information, U represents urgency level, w1 represents the weighting coefficient corresponding to pipeline importance information, w2 represents the weighting coefficient corresponding to detection purpose information, w3 represents the weighting coefficient corresponding to historical defect information, and w4 represents the weighting coefficient corresponding to urgency level. P represents task priority.

[0035] For example, parameters are pre-set based on pipeline importance information, such as setting the parameter for trunk lines to 1, branch lines to 0.5, and gathering pipelines to 0.3. Parameters are also pre-set based on the inspection purpose information, such as setting the parameter for emergency inspection to 1, routine inspection to 0.5, and verification inspection to 0.3. High-risk parameters are set to 1, medium-risk parameters to 0.5, and low-risk parameters to 0.3. Urgent parameters are set to 1, normal parameters to 0.5, and lenient parameters to 0.3. Furthermore, weight parameters corresponding to pipeline importance information, inspection purpose information, historical defect information, and urgency level are pre-set, such as setting w1 to 0.3, w2 to 0.3, w3 to 0.2, and w4 to 0.2. Task priorities are then mapped to levels 1-5. For example, P ≥ 0.85 is set as level 5, 0.70 ≤ P < 0.85 as level 4, 0.55 ≤ P < 0.70 as level 3, 0.40 ≤ P < 0.55 as level 2, and P < 0.40 as level 1.

[0036] Finally, the task priority, processing time, CPU utilization, GPU utilization, and / or memory usage are combined to obtain the state vector. By determining the task priority, the model can perceive the urgency of the current task, thereby making scheduling decisions between ensuring detection accuracy and controlling resource consumption.

[0037] S130. Determine the target processing method based on the state vector, and perform cascade defect detection on the pipeline inner wall image according to the target model associated with the target processing method, and output the target defect category corresponding to the pipeline inner wall image.

[0038] The target model is at least one or more of the first target model, the second target model, and the third target model, and the hierarchical complexity of the first target model, the second target model, and the third target model increases sequentially.

[0039] In this embodiment, the target processing method can be the result output by the reinforcement learning model after making a decision based on the input state vector. This result can be used to determine the processing strategy to be adopted for the current pipeline inner wall image. The target model can be the model selected by the reinforcement learning model from multiple candidate sub-models. This model can be used to perform defect detection on the current pipeline inner wall image. Optionally, the target model can be one or more of a first target model, a second target model, and a third target model. Among them, the first target model can be a model with low computational cost and high speed. It should be noted that the hierarchical structure complexity of the first target model, the second target model, and the third target model increases sequentially. Hierarchical structure complexity can be a comprehensive index to measure the depth of the model structure. This index can include network depth, number of parameters, and computational cost, etc. For example, the second target model can be a model with moderate computational cost and moderate accuracy. The third target model can be a model with the highest computational cost and the slowest speed.

[0040] Cascaded defect detection is a method that uses multi-level models to process pipe inner wall images step by step. The target defect category can be any type of defect present in the pipe inner wall image. This category is the final output result of pipe defect detection on the pipe inner wall image.

[0041] Specifically, the target processing method is determined through state vectors. Further, the target model involved in the target processing method is obtained, and the pipeline inner wall image is input into the target model for cascaded defect detection. Finally, the target defect category corresponding to the pipeline inner wall image is output. This approach aims to reduce average inference time and computational resource consumption while ensuring overall detection accuracy, achieving synergistic optimization of detection accuracy and processing efficiency.

[0042] Furthermore, the process of determining the target processing method based on the state vector is further refined. Optionally, determining the target processing method based on the state vector includes: The state vector is input into a pre-trained reinforcement learning model for processing, and the output is attribute values ​​corresponding to multiple candidate processing methods. The candidate processing methods are the first candidate processing method, the second candidate processing method, or the third candidate processing method. The target models associated with the first candidate processing method, the second candidate processing method, and the third candidate processing method are different. Based on each attribute value, the target processing method is determined from the multiple candidate processing methods.

[0043] In this embodiment, the reinforcement learning model can be a neural network model trained based on a reinforcement learning algorithm. This model is used to output a decision result based on the input state vector. Optionally, the reinforcement learning model can be a deep Q-network. Reinforcement learning can be understood as machine learning where an agent learns the optimal decision-making strategy through interaction with the environment. That is, the reinforcement learning model, as an agent, takes the state vector as input, selects candidate processing methods as actions, and uses a preset multi-objective reward function as feedback signals, learning the optimal decision-making strategy under different states through continuous trial and error and parameter updates.

[0044] The candidate processing methods represent a selection of multiple processing strategies that the reinforcement learning model can choose to execute. Optionally, the candidate processing methods can be a first candidate processing method, a second candidate processing method, or a third candidate processing method. It should be noted that the first, second, and third candidate processing methods are associated with different target models. Each of the three candidate processing methods corresponds to a specific processing strategy.

[0045] The attribute value can be a quantified numerical value output by the reinforcement learning model for each candidate processing method. This value is used to characterize the merit of selecting that candidate processing method in the current state represented by the input state vector. The target processing method can be the output result of the reinforcement learning model's decision-making process. It can be understood that after receiving the state vector, the reinforcement learning model outputs attribute values ​​corresponding to the first, second, and third candidate processing methods, respectively, and determines the target processing method based on the attribute values.

[0046] Specifically, after receiving the state vector, the reinforcement learning model models the candidate processing method selection problem as a Markov decision process. The state vector includes six dimensions: task priority, data normalization value, CPU utilization, GPU utilization, memory usage, and processing time. A multi-objective optimization reward function is designed: ; in, As a reward value, This refers to the weighting coefficient for task priority. As a task priority, The weighting coefficient for processing time. This refers to the actual processing time. To preset the maximum allowed processing time, This is a weighting factor for CPU utilization. For CPU utilization, This represents the preset CPU safety limit, and "gpu" refers to GPU utilization. To preset the GPU security limit, ε is the weighting factor for GPU utilization, and ε is the weighting factor for memory usage. For memory usage, This is the upper limit for memory safety.

[0047] Through the above formula, and through the positive excitation term The model is guided to prioritize processing and a negative penalty term is used. To prevent task timeouts and suppress excessively long processing times, negative penalty items are used. , as well as Excessive consumption of computing resources is constrained to prevent edge devices from crashing due to resource overload. By optimizing the reward function as described above, the reinforcement learning model can obtain quantitative feedback after each decision and gradually learn scheduling strategies under different system load states. This ensures the detection quality of high-priority tasks while maximizing the survival rate of edge devices, thereby achieving coordinated optimization of detection accuracy, processing efficiency, and system stability.

[0048] Furthermore, the state vector is processed to output attribute values ​​corresponding to multiple candidate processing methods. Subsequently, based on these attribute values, the candidate processing method can be determined as the first, second, or third processing method, achieving automated and intelligent decision-making, improving the objectivity and consistency of decision-making, and ultimately enhancing decision accuracy.

[0049] The following sections will describe the processing procedures for the pipe inner wall image when the candidate processing methods are the first, second, and third candidate processing methods, respectively.

[0050] First, when the target processing method is the first candidate processing method, the target model associated with the first candidate processing method is determined to process the pipe inner wall image. Optionally, when the target processing method is the first candidate processing method, cascaded defect detection is performed on the pipe inner wall image based on the target model associated with the target processing method, and the target defect category corresponding to the pipe inner wall image is output, including: Defect detection is performed on the inner wall image of the pipe based on the first target model, and the target defect category corresponding to the inner wall image of the pipe is output.

[0051] In this embodiment, the first target model can be the model with the lowest hierarchical complexity among the three target models. The target defect category can be the final classification result output by the first target model after inference on the pipe inner wall image. This result is used to characterize the types of defects present in the pipe inner wall image.

[0052] Specifically, when the target processing method is the first candidate processing method, the first target model serves as the sole model performing defect detection. It receives the image of the pipe's inner wall as input, performs forward inference calculations, and directly outputs the defect category. By directly utilizing the first target model for inference, processing efficiency is maximized while ensuring basic detection accuracy.

[0053] Furthermore, when the target processing method is the second candidate processing method, the target model associated with the second candidate processing method is determined to process the pipe inner wall image. Optionally, when the target processing method is the second candidate processing method, cascaded defect detection is performed on the pipe inner wall image based on the target model associated with the target processing method, and the target defect category corresponding to the pipe inner wall image is output, including: The pipeline inner wall image is coarsely screened globally based on the first target model to determine the first defect category and the corresponding first confidence level. When the first confidence level is greater than the first preset confidence threshold, the first defect category is taken as the target defect category. When the first confidence level is less than or equal to the first preset confidence threshold, the pipeline inner wall image is input into the second target model for defect detection to obtain the second defect category, and the second defect category is taken as the target defect category.

[0054] In this embodiment, the global coarse screening process can be performed by using a first target model to perform global inference on the pipe inner wall image. The first confidence level can be the degree of certainty with which the first target model determines the first defect category. It should be noted that this confidence level can be represented by the maximum value in the category probability distribution output by the first target model.

[0055] The first pre-set confidence threshold can be a preset confidence comparison benchmark value. This benchmark value is used to determine whether the inference result of the first target model is sufficiently reliable to be directly used as the final output. The second target model can be a model with moderate hierarchical structure complexity among the three target models. The network depth, number of parameters, and computational cost of this model are all between those of the first and third target models.

[0056] The first defect category can be the defect category output by the first target model after preliminary inference on the pipe inner wall image. The second defect category can be the defect category output by the second target model after secondary inference on the pipe inner wall image.

[0057] Specifically, when the reinforcement learning model determines the target processing method as the second candidate processing method based on the state vector, it determines to use a two-level cascaded detection strategy to detect defects in the pipe inner wall image based on the correlation between the second candidate processing method and the second target model. That is, the first target model and the second target model are used sequentially for processing. First, the pipe inner wall image is input into the first target model, which performs a one-time global inference on the pipe inner wall image. That is, the first target model receives the pipe inner wall image as input, performs feature extraction and classification layer calculation through the backbone network, and outputs the probability distribution of the pipe inner wall image belonging to each preset defect category. The category with the highest probability value is taken as the first defect category, and the highest probability value is taken as the corresponding first confidence level. After finally determining the first defect category and the first confidence level, the first confidence level is compared with a preset first confidence threshold. If the first confidence level is greater than the first preset confidence threshold, the first defect category is determined as the target defect category, and no further re-examination is performed. If the first confidence level is less than or equal to the first preset confidence threshold, the pipe inner wall image is further re-examined. The image of the pipe's inner wall is input into the second target model for defect detection to obtain a second defect category, which is then used as the target defect category. Through this two-stage cascaded detection mechanism, a balance between efficiency and accuracy is achieved under the second candidate processing method, thereby maximizing computational efficiency and ensuring detection accuracy.

[0058] Furthermore, when the target processing method is the third candidate processing method, the target model associated with the third candidate processing method is determined to process the pipe inner wall image. Optionally, when the target processing method is the third candidate processing method, cascaded defect detection is performed on the pipe inner wall image based on the target model associated with the target processing method, and the target defect category corresponding to the pipe inner wall image is output, including: The pipeline inner wall image is coarsely screened globally based on the first target model to determine the first defect category and the corresponding first confidence level. When the first confidence level is greater than the second preset confidence threshold, the first defect category is taken as the target defect category. When the first confidence level is less than or equal to the second preset confidence threshold, the pipeline inner wall image is input into the third target model for defect detection to obtain the third defect category, which is then taken as the target defect category.

[0059] In this embodiment, the second preset confidence threshold can be a preset confidence comparison benchmark value in the third candidate processing method. This threshold is used to determine whether the inference result of the first target model or the third target model can be used as the final target defect category.

[0060] The third defect category can be the defect category output by the third target model after performing secondary inference on the pipe inner wall image. This defect category is used to characterize the types of defects present in the pipe inner wall image.

[0061] Specifically, when the reinforcement learning model determines the target processing method as the third candidate processing method based on the state vector, a two-level cascaded detection strategy is adopted to detect defects in the pipe inner wall image based on the third candidate processing method. That is, the first target model and the third target model are used sequentially for processing. First, the pipe inner wall image is input into the first target model, which performs global inference on the pipe inner wall image and outputs the probability distribution of the pipe inner wall image belonging to each preset defect category. The category with the highest probability value is taken as the first defect category. After determining the first defect category and the first confidence level, the first confidence level is compared with a second preset confidence threshold.

[0062] If the first confidence level is greater than the second preset confidence threshold, the first defect category is determined as the target defect category, and no further re-inspection is performed. If the first confidence level is less than or equal to the second preset confidence threshold, the pipe inner wall image is further re-inspected. The pipe inner wall image is input into the third target model for defect detection to obtain the third defect category, which is then used as the target defect category. The third candidate processing method, through a two-level cascaded defect detection strategy, optimizes the average processing efficiency while ensuring the highest detection accuracy, and allows for flexible adjustment of accuracy requirements through preset confidence thresholds, thereby achieving a balance between accuracy and efficiency.

[0063] The technical solution provided by this invention acquires at least one image of the inner wall of a pipe and corresponding pipe information. Based on the pipe information and the current operating status of the equipment in each inner wall image, a state vector is generated for that image. Further, a target processing method is determined based on the state vector, and cascaded defect detection is performed on the inner wall images according to the target model associated with that method, outputting the target defect category corresponding to each inner wall image. This technical solution solves the technical problem of balancing recognition accuracy and processing efficiency in defect detection of inner wall images of pipes, achieving the technical effect of improving the overall processing efficiency of inner wall images of pipes while ensuring detection accuracy.

[0064] Figure 2 This is a flowchart illustrating a method for identifying defects in long-distance oil and gas pipelines, provided as an embodiment of the present invention. Based on the above embodiment, the training process of the target model is described in detail.

[0065] like Figure 2 As shown, the method includes: S210. Obtain multiple sample images for training the target model.

[0066] In this embodiment, the sample images can be images of the inner wall of a pipe used to train the target model. It should be noted that the sample images can be generated by collecting raw preference data inside the pipe using an internal detector, followed by denoising, correction, and image reconstruction. Alternatively, they can be obtained from a historical detection database, which is then preprocessed for training. After acquiring the sample images, defect category labeling is performed to determine the sample label category corresponding to each sample image.

[0067] Specifically, an internal detector operates inside the pipeline, collecting physical signals related to the pipeline's interior. The raw sensor data undergoes preprocessing, including signal denoising, amplitude correction, and spatial mapping, to reconstruct an image reflecting the pipeline's inner surface. This image is then used as a sample image. Each sample image is labeled with a defect category using manual or automatic annotation methods, resulting in a corresponding sample label category. This allows the target model to learn defect features in various scenarios during training, giving it a strong defect recognition capability.

[0068] S220. For multiple sample images, the sample images are input into the initial target model so that the initial target model outputs the sample defect category. The initial target model includes a first backbone unit, which is composed of a first convolution branch, a second convolution branch, and a pooling branch connected in parallel.

[0069] In this embodiment, the initial target model can be a target model whose parameters have not been optimized or are in a randomly initialized state before training begins. During training, sample images are input into the initial target model, the difference between its output and the sample label category is calculated, and the model's interpretation is gradually adjusted accordingly until it eventually converges to the trained target model. Optionally, the initial target model can be any of the first, second, or third target models; that is, the first, second, and third target models are all trained using the training method of the initial target model.

[0070] It should be noted that the initial target model includes at least a first backbone unit. This first backbone unit can be a feature extraction network structure within the initial target model. This structure can be used to extract features from the input image. In other words, the feature map output after processing by the first backbone unit can be classified by subsequent classification layers to ultimately obtain the sample defect category. The first backbone unit is composed of a first convolutional branch, a second convolutional branch, and a pooling branch connected in parallel. Both the first and second convolutional branches can be used to perform convolution operations on the input feature map using preset convolutional kernels.

[0071] For example, using a complex multi-branch structure: ; in, Here, x is the network mapping function during the training phase, and x is the input feature map. This is a 1×1 convolution operation (first convolution branch). The first convolution branch uses a 3×3 convolution operation (second convolution branch), while AvgPool uses an average pooling operation (pooling branch). Identity is a skip connection. This can be understood as follows: the first convolution branch uses a 1×1 kernel, processing only one pixel at a time. The second convolution branch uses a 3×3 kernel, processing a 3×3 local region at a time to capture the spatial relationships between adjacent pixels. The pooling branch can process the input feature map using pooling operations. For example, the pooling branch can use average pooling to perform average pooling on the feature map. That is, within a preset pooling window, the average value of all elements within that window is calculated as the output.

[0072] The sample defect category can be the defect category prediction result output by the initial target model after performing forward inference on the input sample image.

[0073] Specifically, to train the model parameters in the initial target model, multiple sample images are input into the initial target model in batches. The sample images first undergo feature extraction by the first backbone unit. After receiving the input sample images, the first backbone unit simultaneously feeds them into the parallel-connected first convolutional branch, second convolutional branch, and pooling branch. These three branches perform parallel computation independently on the same input sample image. The outputs of the three branches are fused into a unified feature map through element-wise addition, which serves as the output of the first backbone unit. Further, the feature map output by the first backbone unit is passed to the classification layer of the initial target model for further feature transformation and mapping, thereby outputting the probability distribution of the sample image belonging to each preset defect category. The category with the highest probability value is taken as the sample defect category. By designing a multi-branch parallel structure, the ability of the target model to recognize multi-scale defects is improved, thereby enhancing the defect recognition accuracy of the target model.

[0074] To prevent system resource overload from causing detection task failure, the real-time collected operating status information is compared with a preset safety threshold. When the operating status information exceeds the preset safety threshold, it indicates that the current system resources are strained, and the target model is replaced. The above process is further refined below. Optionally, when the operating status information is greater than the preset safety threshold, a lightweight target model is used as the target model. This lightweight target model includes a second backbone unit, which is composed of a third convolutional branch. The weight parameters of the third convolutional branch are obtained by fusing the weight parameters of the first convolutional branch, the second convolutional branch, and the pooling branch in the target model.

[0075] In this embodiment, the preset safety threshold can be a pre-defined upper limit for resource load. This threshold is used to determine whether the system is in a safe operating state. When the operating state information exceeds the preset safety threshold, a lightweight target model is used as the target model. The lightweight target model can be a target model with low resource consumption. It should be noted that the lightweight target model includes a second backbone unit. The second backbone unit can be a feature extraction network structure in the lightweight target model. This structure is used to extract features from the input image. Optionally, the second backbone unit consists of a third convolutional branch. The third convolutional branch can be a single convolutional layer in the second backbone unit. The weight parameters in this convolutional branch are obtained by fusing the weight parameters of the three branches in the first backbone unit. The weight parameters can be the strength coefficients of each neuron connection.

[0076] It should be noted that when the CPU utilization and / or GPU utilization of the device are detected to be higher than the preset threshold for a preset time, an overload signal is automatically sent, forcing the use of the first target model for defect identification, and the lightweight target model is used as the first target model for processing, thereby reducing the model's computational load within milliseconds and protecting the hardware device.

[0077] Specifically, during inference, a flexible state is used to dynamically determine whether to perform branch fusion based on runtime status information. When the runtime status information exceeds a preset safety threshold, it indicates that the current system resources are overloaded. Therefore, a lightweight target model is used as the target model to complete defect detection with minimal resource consumption. The lightweight target model includes a second backbone unit, which is composed of a third convolutional branch, namely: ; in, Output results for the second backbone unit. The third convolutional branch is denoted by x, which is the input feature map. The third convolutional branch is a single-path convolutional layer, which is obtained by mathematical transformation and fusion of the weight parameters of the first convolutional branch, the second convolutional branch, and the pooling branch in the target model during the training phase.

[0078] The weights of the second convolutional branch are center-aligned and padded to the same size as the first convolutional branch. The weights of the third convolutional branch are then determined based on the weights of the first convolutional branch, the padded weights of the second convolutional branch, and the weights of the pooling branch. ; in, The weight parameters are those corresponding to the third convolutional branch. These are the weight parameters corresponding to the first convolutional branch. To align the weight parameters of the second convolutional branch after padding, These are the weight parameters corresponding to the pooling branches. It is an identity matrix. By switching from a multi-branch structure in the training phase to a single-path convolutional structure, the computational load is reduced while maintaining the detection accuracy, thus ensuring the stability of the system and the high availability of the task.

[0079] S230. Based on the sample defect category, sample label category, and the loss function corresponding to the initial target model, adjust the model parameters in the initial target model.

[0080] In this embodiment, the loss function can be a mathematical function used to measure the difference between the sample defect category and the sample label category output by the initial target model. This function is used to quantify the prediction error of the current model on the training samples.

[0081] Specifically, after obtaining the defect category for each sample image, the defect category and the sample image are input into a pre-defined loss function, and the loss value is output. Using the backpropagation algorithm, starting from the loss function, the gradient of the loss value with respect to the model parameters of each layer is calculated layer by layer along the reverse of the network structure. Finally, the calculated gradient information is input into a pre-defined optimizer, and the gradient descent algorithm is used to update the model parameters along the negative gradient direction according to a pre-defined learning rate, so that the updated model parameters can produce a smaller loss value in the next forward propagation. As the training epochs increase, the model parameters are gradually adjusted and optimized. Supervised learning enables the model to automatically learn defect recognition capabilities, reducing human intervention.

[0082] S240. When the loss function converges, the initial target model obtained is taken as the target model.

[0083] In this embodiment, loss function convergence can be defined as a state in which the loss value gradually decreases and eventually stabilizes with increasing training epochs during model training, no longer changing significantly with further training. Optionally, the condition for determining loss function convergence can be that the loss value change is less than a preset threshold when several adjacent epochs are considered convergent, or a maximum number of training epochs can be set, and training can be terminated when this number of epochs is reached, with the current state considered convergent.

[0084] Specifically, during training, the model parameters of the initial target model are continuously adjusted and optimized from the initial state. When the training reaches the convergence of the loss function, the model parameters at the current moment are taken as the final optimization result, and the initial target model in the current state is taken as the target model. This ensures that the model is used only after it reaches its optimal performance. The converged target model identifies defects in pipe inner wall images with high accuracy.

[0085] The technical solution of this embodiment involves acquiring multiple sample images for training the target model, inputting these images into the initial target model for defect identification, and outputting the defect category corresponding to each sample image. Further, based on the sample defect category, sample label category, and the loss function corresponding to the initial target model, the model parameters in the initial target model are adjusted. When the loss function converges, the resulting initial target model is used as the target model. This provides a reliable model foundation for the inference stage, ensuring the accuracy of the detection results.

[0086] Figure 3 This is a schematic diagram of the overall scheme of a method for identifying defects in long-distance oil and gas pipelines provided in an embodiment of the present invention. Based on the above embodiment, an optional example is provided, which can be used for scenarios involving defect identification of long-distance oil and gas pipelines.

[0087] like Figure 3 As shown, firstly, an internal detector is used to acquire data from the inner wall of the pipe. After the internal detector returns, the raw data is downloaded. Further, the raw data is cleaned and corrected to remove noise and outliers. After data processing, the data is mapped to the pipe coordinate system to generate an image of the pipe inner wall (input image). After the pipe inner wall image is generated, it is normalized and numbered and stored according to the pipe segment location.

[0088] After acquiring images of the pipe's inner wall, the task priority and resource constraints are evaluated based on the environmental perception module. Pipe information, including its importance, detection objectives, and historical defects, is comprehensively assessed to determine the task priority. Further, images of the pipe's inner wall to be processed are acquired, and resource detection CPU utilization, GPU utilization, memory usage, and remaining time percentage are calculated. This information is combined into a state vector, which is then used as input to the reinforcement learning agent.

[0089] Furthermore, adaptive weight allocation reinforcement learning is performed. The state vector is input into the reinforcement learning model for processing, and the output is attribute values ​​corresponding to multiple candidate processing methods. The candidate processing method with the largest attribute value is selected as the target processing method, thus selecting a multi-granularity network module that is suitable for the current state. The multi-granularity network module includes a lightweight network (first target model), a medium-sized network (second target model), and a precise network (third target model), with the complexity of the three layers increasing sequentially. After the reinforcement learning allocation module selects the target candidate method, it enters the progressive inference module.

[0090] When the target candidate is the second candidate, a lightweight network is used to quickly infer the input image and calculate the confidence level. If the first confidence level is greater than the first preset confidence threshold, the target defect category is directly output without calling a more complex network; if the first confidence level is lower than the first preset confidence threshold, a cascaded upgrade is triggered, and a medium-sized network is used to infer the input image and calculate the confidence level and the second defect category, and the second defect category is used as the target defect category.

[0091] When the target candidate method is the third candidate method, a lightweight network is used to perform a global coarse screening of the pipe inner wall image to determine the first defect category and the first confidence level. Further, the first confidence level is compared with a second preset confidence threshold. When the first confidence level is greater than the second preset confidence threshold, the first defect category is adopted as the target defect category. When the first confidence level is less than or equal to the second preset confidence threshold, the pipe inner wall image is input into the third target model for defect detection to obtain the third defect category, and this third defect category is adopted as the target defect category.

[0092] In the above process, the feature reparameterization module and the knowledge distillation module are used in the training phase of the target model. The feature reparameterization module employs multi-branch parallel processing during training to enhance feature representation capabilities, and merges the multi-branch structure into a single convolutional layer when the runtime state information exceeds a preset safety threshold. The knowledge distillation module is used to transfer knowledge from the precise network to lightweight and medium-weight networks, further improving the recognition accuracy of the lightweight and medium-weight networks during the inference phase.

[0093] Figure 4 This is a schematic diagram of a long-distance oil and gas pipeline defect identification device provided in an embodiment of the present invention. This embodiment is applicable to the identification of defects in long-distance oil and gas pipelines. The device can be implemented using software and / or hardware, and can be integrated into any equipment that provides long-distance oil and gas pipeline defect identification functionality. Figure 4 As shown, a long-distance oil and gas pipeline defect identification device specifically includes: an image acquisition module 310, a state vector generation module 320, and a category output module 330.

[0094] The image acquisition module 310 is used to acquire at least one image of the inner wall of a pipe and pipe information corresponding to the inner wall image. The pipe information includes at least one or more of the following: pipe importance information, detection purpose information, historical defect information, and urgency level. The state vector generation module 320 is used to generate a state vector for each inner wall image of the pipe based on the pipe information and operating status information. The operating status information is used to characterize the current load of computing resources. The category output module 330 is used to determine the target processing method based on the state vector, and perform cascade defect detection on the inner wall image of the pipe based on the target model associated with the target processing method, and output the target defect category corresponding to the inner wall image of the pipe. The target model is at least one or more of a first target model, a second target model, or a third target model, and the number of model parameters of the first target model, the second target model, and the third target model increases sequentially.

[0095] The technical solution provided by this invention acquires at least one image of the inner wall of a pipe and corresponding pipe information. Based on the pipe information and the current operating status of the equipment in each inner wall image, a state vector is generated for that image. Further, a target processing method is determined based on the state vector, and cascaded defect detection is performed on the inner wall images according to the target model associated with that method, outputting the target defect category corresponding to each inner wall image. This technical solution solves the technical problem of balancing recognition accuracy and processing efficiency in defect detection of inner wall images of pipes, achieving the technical effect of improving the overall processing efficiency of inner wall images of pipes while ensuring detection accuracy.

[0096] Based on the above solutions, the running status information includes at least one or more of CPU utilization, GPU utilization, processing time, and memory usage. The state vector generation module includes: The priority determination unit is used to determine the task priority corresponding to the pipeline inner wall image based on the pipeline importance information, the detection purpose information, the historical defect information and / or the urgency level; The state vector acquisition unit is used to combine the task priority, the processing time, the CPU utilization, the GPU utilization and / or the memory usage to obtain the state vector.

[0097] Based on the above solutions, the category output module includes: The attribute value output unit is used to input the state vector into a pre-trained reinforcement learning model for processing and output attribute values ​​corresponding to multiple candidate processing methods. The candidate processing methods are a first candidate processing method, a second candidate processing method, or a third candidate processing method. The target models associated with the first candidate processing method, the second candidate processing method, and the third candidate processing method are different. The target processing method determination unit is used to determine the target processing method from a plurality of candidate processing methods based on each of the attribute values.

[0098] Based on the above solutions, when the target processing method is the first candidate processing method, the category output module includes: The target defect category unit is used to perform defect detection on the inner wall image of the pipe based on the first target model and output the target defect category corresponding to the inner wall image of the pipe.

[0099] Based on the above solutions, when the target processing method is the second candidate processing method, the category output module includes: The first confidence level determination unit is used to perform a global coarse screening of the pipeline inner wall image based on the first target model to determine the first defect category and the corresponding first confidence level. The first defect category determination unit is used to determine the first defect category as the target defect category when the first confidence level is greater than the first preset confidence threshold. The second defect category determination unit is used to input the pipeline inner wall image into the second target model to perform defect detection and obtain a second defect category when the first confidence level is less than or equal to the first preset confidence threshold, and to use the second defect category as the target defect category.

[0100] Based on the above solutions, when the target processing method is the third candidate processing method, the category output module includes: An image coarse screening unit is used to perform global coarse screening on the inner wall image of the pipe based on the first target model, and determine the first defect category and the corresponding first confidence level. The category determination unit is used to determine the first defect category as the target defect category when the first confidence level is greater than the second preset confidence level threshold. The third defect category determination unit is used to input the pipeline inner wall image into the third target model to perform defect detection and obtain a third defect category when the first confidence level is less than or equal to the second preset confidence threshold, and to use the third defect category as the target defect category.

[0101] Based on the above solutions, the model parameters of the target model are obtained in the following manner: The sample image acquisition module is used to acquire multiple sample images for training the target model; The sample defect category output module is used to input the sample images into an initial target model for multiple sample images, so that the initial target model outputs sample defect categories. The initial target model includes a first backbone unit, wherein the first backbone unit is composed of a first convolution branch, a second convolution branch, and a pooling branch connected in parallel. The parameter adjustment module is used to adjust the model parameters in the initial target model based on the sample defect category, the sample label category, and the loss function corresponding to the initial target model. The target model determination module is used to take the initial target model obtained when the loss function converges as the target model.

[0102] Based on the above schemes, the method also includes: A lightweight target model determination module is used to determine the target model when the running status information is greater than a preset safety threshold. The lightweight target model includes a second backbone unit, which is composed of a third convolutional branch. The weight parameters of the third convolutional branch are obtained by fusing the weight parameters of the first convolutional branch, the weight parameters of the second convolutional branch, and the weight parameters of the pooling branch in the target model.

[0103] The above-described products can perform the methods provided in any embodiment of the present invention, and have the corresponding functional modules and beneficial effects for performing the methods.

[0104] Figure 5 A schematic diagram of an electronic device that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0105] like Figure 5As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0106] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0107] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as a method for identifying defects in long-distance oil and gas pipelines.

[0108] In some embodiments, a method for identifying defects in long-distance oil and gas pipelines can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the method for identifying defects in long-distance oil and gas pipelines described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to execute a method for identifying defects in long-distance oil and gas pipelines by any other suitable means (e.g., by means of firmware).

[0109] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0110] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0111] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0112] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0113] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0114] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0115] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0116] This invention also provides a computer program product, including a computer program that, when executed by a processor, implements a method for identifying defects in long-distance oil and gas pipelines according to any embodiment of the invention.

[0117] In implementing the computer program product, computer program code for performing the operations of this invention can be written in one or more programming languages ​​or a combination thereof. Programming languages ​​include object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0118] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for identifying defects in long-distance oil and gas pipelines, characterized in that, include: Acquire at least one image of the inner wall of a pipe and pipe information corresponding to the image, wherein the pipe information includes at least one or more of the following: pipe importance information, detection purpose information, historical defect information, and urgency level. For each image of the inner wall of the pipe, a state vector is generated based on the pipe information and the operating status information, wherein the operating status information is used to characterize the current load of computing resources; Based on the state vector, the target processing method is determined, and according to the target model associated with the target processing method, cascaded defect detection is performed on the inner wall image of the pipe, and the target defect category corresponding to the inner wall image of the pipe is output. The target model is at least one or more of the first target model, the second target model and the third target model, and the hierarchical structure complexity of the first target model, the second target model and the third target model increases sequentially.

2. The method according to claim 1, characterized in that, The operating status information includes at least one or more of CPU utilization, GPU utilization, processing time, and memory usage. For each image of the inner wall of the pipe, a state vector is generated based on the pipe information and the operating status information, including: Based on the pipeline importance information, the detection objective information, the historical defect information, and / or the urgency level, the task priority corresponding to the pipeline inner wall image is determined; The state vector is obtained by combining the task priority, the processing time, the CPU utilization, the GPU utilization, and / or the memory usage.

3. The method according to claim 1, characterized in that, The step of determining the target processing method based on the state vector includes: The state vector is input into a pre-trained reinforcement learning model for processing, and the output is attribute values ​​corresponding to multiple candidate processing methods. The candidate processing methods are a first candidate processing method, a second candidate processing method, or a third candidate processing method. The target models associated with the first candidate processing method, the second candidate processing method, and the third candidate processing method are different. The target processing method is determined from a plurality of candidate processing methods based on each of the attribute values.

4. The method according to claim 3, characterized in that, When the target processing method is the first candidate processing method, the step of performing cascaded defect detection on the pipe inner wall image based on the target model associated with the target processing method, and outputting the target defect category corresponding to the pipe inner wall image, includes: Based on the first target model, defect detection is performed on the inner wall image of the pipe, and the target defect category corresponding to the inner wall image of the pipe is output.

5. The method according to claim 3, characterized in that, When the target processing method is the second candidate processing method, the cascaded defect detection of the pipe inner wall image based on the target model associated with the target processing method, and the output of the target defect category corresponding to the pipe inner wall image, include: Based on the first target model, a global coarse screening is performed on the inner wall image of the pipe to determine the first defect category and the corresponding first confidence level. When the first confidence level is greater than the first preset confidence threshold, the first defect category is taken as the target defect category; When the first confidence level is less than or equal to the first preset confidence threshold, the inner wall image of the pipe is input into the second target model for defect detection to obtain a second defect category, and the second defect category is used as the target defect category.

6. The method according to claim 3, characterized in that, When the target processing method is the third candidate processing method, the cascaded defect detection of the pipe inner wall image is performed based on the target model associated with the target processing method, and the target defect category corresponding to the pipe inner wall image is output, including: Based on the first target model, a global coarse screening is performed on the inner wall image of the pipe to determine the first defect category and the corresponding first confidence level. When the first confidence level is greater than the second preset confidence threshold, the first defect category is taken as the target defect category; When the first confidence level is less than or equal to the second preset confidence threshold, the image of the inner wall of the pipe is input into the third target model to perform defect detection and obtain a third defect category, and the third defect category is used as the target defect category.

7. The method according to claim 1, characterized in that, The model parameters of the target model are obtained in the following manner: Acquire multiple sample images for training the target model; For multiple sample images, the sample images are input into an initial target model so that the initial target model outputs sample defect categories. The initial target model includes a first backbone unit, which is composed of a first convolutional branch, a second convolutional branch, and a pooling branch connected in parallel. Based on the sample defect category, sample label category, and the loss function corresponding to the initial target model, the model parameters in the initial target model are adjusted; When the loss function converges, the initial target model obtained is taken as the target model.

8. The method according to claim 7, characterized in that, The method further includes: When the running status information is greater than the preset safety threshold, a lightweight target model is used as the target model. The lightweight target model includes a second backbone unit, which is composed of a third convolutional branch. The weight parameters of the third convolutional branch are obtained by fusing the weight parameters of the first convolutional branch, the weight parameters of the second convolutional branch, and the weight parameters of the pooling branch in the target model.

9. A defect identification device for long-distance oil and gas pipelines, characterized in that, include: An image acquisition module is used to acquire at least one image of the inner wall of a pipe and pipe information corresponding to the image of the inner wall of the pipe, wherein the pipe information includes at least one or more of pipe importance information, detection purpose information and historical defect information; A state vector generation module is used to generate a state vector for each image of the inner wall of the pipe, based on the pipe information and the operating state information, wherein the operating state information is used to characterize the current load of computing resources; The category output module is used to determine the target processing method based on the state vector, and to perform cascade defect detection on the pipeline inner wall image based on the target model associated with the target processing method, and output the target defect category corresponding to the pipeline inner wall image. The target model is at least one or more of a first target model, a second target model or a third target model, and the number of model parameters of the first target model, the second target model and the third target model increases sequentially.

10. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform a method for identifying defects in long-distance oil and gas pipelines according to any one of claims 1-8.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the method for identifying defects in long-distance oil and gas pipelines as described in any one of claims 1-8.

12. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements a method for identifying defects in long-distance oil and gas pipelines according to any one of claims 1-8.