Control loop identification method and device based on PID drawing

By applying the object detection model and control loop recognition model in the P&ID drawings, the control loop is automatically identified and constructed, and the problem of poor identification efficiency and accuracy in the prior art is solved, and efficient and accurate control loop recognition is achieved.

CN119479003APending Publication Date: 2025-02-18SUPCON TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411585178.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The prior art has poor efficiency and accuracy when identifying control loops within P&ID drawings, especially when dealing with large-scale or complex integrated process devices.

Method used

By obtaining P&ID drawing images, using the pre-trained object detection model to identify component categories, filter out target components related to the control loop, build a directed graph, and use the pre-trained control loop identification model to identify controls from the directed graph Loop.

Benefits of technology

The control loop identification process without manual participation is realized, the recognition efficiency and accuracy are improved, and the problem of poor efficiency and accuracy during manual identification is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119479003A_ABST
    Figure CN119479003A_ABST
Patent Text Reader

Abstract

The invention discloses a method based on Pamp; the invention discloses a control loop identification method and device of an ID drawing. Comprising the following steps: acquiring a first Pamp; an ID drawing image; using the target detection model to detect the first Pamp; performing device category identification on each component in the ID drawing image to obtain the device category of each component, and screening out a plurality of target components related to the control loop from the plurality of components according to the device category; a directed graph is constructed according to each target component, the directed graph comprises a plurality of nodes and a plurality of directed edges, one node corresponds to one target component, and the directed edge connecting the two nodes represents the flow direction of a pipeline between the target components corresponding to the two nodes; identifying a first Pamp from the directed graph by using a control loop identification model; and a target control loop in the ID drawing image. According to the method and the device, the problem that the Pamp is identified manually in related technologies is solved; and a control loop in an ID drawing causes poor identification efficiency and accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a control loop identification method and device based on P&ID drawings. Background Art

[0002] P&ID (Piping and Instrumentation Diagram) drawings are key engineering materials used to display in detail the configuration of industrial system pipelines and equipment in industries such as chemical and petroleum refining. They not only accurately record the detailed information of pipeline layout and automatic control instruments, but also map the design results of the entire process flow. Usually, P&ID drawings range from dozens to hundreds of pages, including a large number of equipment, pipelines, DCS instruments, valves, pumps, compressors, heat exchangers and other legend symbols. In particular, the control loops in the P&ID drawings are used to reveal the layout and interconnection relationships of various instruments and equipment for automatic control of process operations. The complexity of these relationships is particularly prominent in large or highly integrated process units. In order to accurately understand and operate these equipment, technicians usually have to spend a lot of time carefully analyzing the details in the P&ID drawings.

[0003] Currently, when relevant technicians identify control loops in P&ID drawings, they usually convert P&ID drawings into FBD (function block diagram) control programs. However, since this conversion process is usually performed manually, it is not only time-consuming but also prone to errors, especially when dealing with P&ID drawings of large-scale or complex integrated process equipment.

[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0005] The embodiment of the present application provides a control loop identification method and device based on P&ID drawings, so as to at least solve the technical problem that the related technology identifies the control loops in the P&ID drawings manually, resulting in poor identification efficiency and accuracy.

[0006] According to one aspect of an embodiment of the present application, a control loop identification method based on a P&ID drawing is provided, comprising: obtaining a first P&ID drawing image, wherein the first P&ID drawing image is at least used to reflect the identifiers, location information and location information of pipelines connecting the components in a process flow; using a pre-trained target detection model to identify the device category of each component in the first P&ID drawing image to obtain the device category of each component, and based on the device category, screen out multiple target components related to the control loop from the multiple components; constructing a directed graph based on each target component, wherein the directed graph includes multiple nodes and multiple directed edges, one node corresponds to one target component, and the directed edge connecting two nodes represents the flow direction of the pipeline between the target components corresponding to the two nodes; using the pre-trained control loop identification model to identify the target control loop in the first P&ID drawing image from the directed graph.

[0007] Optionally, the training process of the target detection model includes: constructing a first initial learning model; obtaining a first training sample set and a first sample label set, wherein the first training sample set includes multiple P&ID drawing sub-images as first training samples, and the first sample label set includes the equipment type corresponding to each P&ID drawing sub-image as the first sample label, and the P&ID drawing sub-image is obtained by dividing the P&ID drawing image sample; using the first training sample set and the first sample label set to iteratively train the first initial learning model to obtain the target detection model.

[0008] Optionally, multiple target components related to the control loop are screened out from multiple components based on device category, including: screening out multiple initial components of a first device category related to the control loop from multiple components based on device category; for each initial component, determining description information of the initial component, and judging whether the description information contains keywords related to the control loop, and if so, determining that the initial component is a target component related to the control loop.

[0009] Optionally, before constructing a directed graph from each target component, the method further includes using an optical character recognition algorithm to identify all identifiers in the first P&ID drawing image, and determining target components whose area ratio in the first P&ID drawing image is not less than a preset area ratio threshold, deleting all identifiers and all target components in the first P&ID drawing image to obtain a second P&ID drawing image; determining components of a second device category in the second P&ID drawing image, and converting the components of the second device category into pipelines to obtain a third P&ID drawing image, wherein the second device category includes at least one of the following: : valves, filters, separators; using a preset pipeline detection technology to identify multiple pipelines in the third P&ID drawing image, and determining the pipeline distance between each pipeline based on the position information of each pipeline, and constructing a pipeline connection relationship matrix based on the pipeline distance between each pipeline, wherein the rows and columns of the pipeline connection relationship matrix represent multiple pipelines in the third P&ID drawing image, respectively, and each matrix element in the pipeline connection relationship matrix is ​​used to represent the pipeline distance between two pipelines in the corresponding row and column; determining the connectivity between each target component based on the position information of each target component and the pipeline connection relationship matrix.

[0010] Optionally, using a preset detection technology to detect multiple pipelines in the third P&ID drawing image includes: using a preset image processing technology to process the third P&ID drawing image to remove invalid information in the third P&ID drawing image, wherein the image processing technology includes at least one of the following: Gaussian filtering, corrosion enhancement; using a straight line segment detection algorithm to identify the processed third P&ID drawing image to obtain multiple pipelines in the third P&ID drawing image.

[0011] Optionally, the connectivity status between each target component is determined based on the position information of each target component and the pipeline connection relationship matrix, including: for each target component, searching the pipeline connection relationship matrix for at least one first pipeline with the current target component as an endpoint based on the position information of the current target component; using a preset search algorithm to determine in the pipeline connection relationship matrix a second pipeline whose pipeline distance from each first pipeline is less than a preset distance threshold; determining whether the component corresponding to the endpoint of the second pipeline is the target component, and when the component corresponding to the endpoint of the second pipeline is the target component, determining that the current target component and the target component corresponding to the endpoint of the second pipeline are in a connectivity state.

[0012] Optionally, the training process of the control loop identification model includes: constructing a second initial learning model; obtaining a second training sample set and a second sample label set, wherein the second training sample set includes multiple component samples as second training samples, and the second sample label set includes the type of control loop to which the component samples belong as the second sample label, and different types of control loop samples include different numbers and device categories of components; and using the second training sample set and the second sample label set to iteratively train the second initial learning model to obtain control loop identification.

[0013] Optionally, a pre-trained control loop identification model is used to identify a target control loop in a first P&ID drawing image from a directed graph, including: using a pre-trained control loop identification model to classify each node in the directed graph to obtain the type of control loop to which each node belongs; forming a control loop by multiple nodes belonging to the same type of control loop and directed edges connecting the multiple nodes to obtain at least one control loop; performing compliance verification on each control loop according to preset control logic rules, and using the control loop that passes the verification as the target control loop in the first P&ID drawing image.

[0014] According to another aspect of an embodiment of the present application, a control loop identification device based on a P&ID drawing is also provided, including: an acquisition module, used to acquire a first P&ID drawing image, wherein the first P&ID drawing image is at least used to reflect the identifiers, position information and position information of pipelines connecting the components in the process flow; a determination module, used to use a pre-trained target detection model to identify the device category of each component in the first P&ID drawing image, obtain the device category of each component, and filter out multiple target components related to the control loop from multiple components based on the device category; a construction module, used to construct a directed graph based on each target component, wherein the directed graph includes multiple nodes and multiple directed edges, one node corresponds to one target component, and the directed edge connecting two nodes represents the flow direction of the pipeline between the target components corresponding to the two nodes; an identification module, used to use a pre-trained control loop identification model to identify the target control loop in the first P&ID drawing image from the directed graph.

[0015] According to another aspect of an embodiment of the present application, a computer program product is further provided, the computer program product comprising a stored computer program, wherein when the computer program is executed by a processor, the above-mentioned control loop identification method based on P&ID drawings is implemented.

[0016] In an embodiment of the present application, the recognition system uses a target detection model to identify the device category of each component in the first P&ID drawing image, obtains the device category of each component, and selects multiple target components related to the control loop from multiple components based on the device category; then a directed graph is constructed using these target components, and the control loop recognition model is used to identify the target control loop in the first P&ID drawing image from the directed graph. The above control loop recognition process does not require human participation, and the entire process is controlled by computer intelligence, thereby solving the technical problem that the related technology uses manual methods to identify the control loop in the P&ID drawing, resulting in poor recognition efficiency and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0018] Figure 1 It is a hardware structure block diagram of a computer terminal (or mobile device) for implementing a control loop identification method based on a P&ID drawing according to an embodiment of the present application;

[0019] Figure 2 It is a flow chart of an optional control loop identification method based on P&ID drawings according to an embodiment of the present application;

[0020] Figure 3 It is a structural schematic diagram of an optional control loop identification device based on P&ID drawings according to an embodiment of the present application;

[0021] Figure 4 It is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0022] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0023] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0024] In addition, the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. For example, an interface is set up between this system and the relevant user or organization. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or organization.

[0025] In order to better understand the embodiments of the present application, the technical terms involved in the embodiments of the present application are explained as follows:

[0026] P&ID (Piping and Instrumentation Diagram) drawings: refers to drawings that show in detail the relationship and layout of the pipe connections, valves, pumps, heat exchangers, pressure vessels and other instrumentation equipment within the industrial system according to the requirements of the process flow diagram (PFD). Therefore, P&ID drawings are important tools in engineering design and factory operations, used to guide the installation, maintenance and operation of industrial facilities to ensure the safe and efficient operation of the system.

[0027] Optical Character Recognition (OCR) algorithm is a technology that converts text in an image into editable and searchable text. It determines the shape of the text by detecting dark and light patterns in the image and then translates it into computer-recognizable text.

[0028] Example 1

[0029] According to an embodiment of the present application, a method embodiment of a control loop identification method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0030] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 The hardware structure block diagram of a computer terminal (or mobile device) for implementing a control loop identification method based on P&ID drawings is shown. Figure 1 As shown, the computer terminal 10 (or mobile device 10) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0031] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0032] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the control loop identification method based on P&ID drawings in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the control loop identification method based on P&ID drawings of the above-mentioned application is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0033] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0034] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).

[0035] In the above operating environment, Figure 2 is a flow chart of an optional control loop identification method based on P&ID drawings according to an embodiment of the present application, such as Figure 2 As shown, the method at least includes steps S202-S208, wherein:

[0036] Step S202, obtaining a first P&ID drawing image.

[0037] In the technical solution provided in step S202, the first P&ID drawing image is an image collected according to the P&ID drawing, which can be obtained by directly photographing the P&ID drawing or from other devices such as a server. In addition, the first P&ID drawing image is used to at least reflect the identifiers and position information of each of the multiple components in the process flow, as well as the position information of the pipelines connecting the components, wherein the position information is the coordinates of the center or boundary of the component or pipeline in the P&ID drawing image, and the position information in the specific embodiment of the present application can be determined by the boundary box of the component or pipeline.

[0038] Step S204, using the pre-trained target detection model to identify the component category of each component in the first P&ID drawing image, obtain the component category of each component, and filter out multiple target components related to the control loop from multiple components based on the component category.

[0039] In the technical solution provided in step S204, the recognition system can first use a sliding window to segment the first P&ID drawing image to obtain multiple P&ID drawing sub-images (also called cut images), that is, each movement of the sliding window will generate a corresponding cut image until the sliding window traverses every pixel in the first P&ID drawing image. The sliding window is a rectangular window set by applying the sliding window technology, and the size of the sliding window is set according to specific needs and the size of the first P&ID drawing image. The cut images obtained by using the sliding window segmentation are images of the same size as the sliding window cut out from the first P&ID drawing image; then, the target detection model is used to identify each P&ID drawing sub-image to obtain the device category of each component, wherein the input of the target detection model is an image, and the output is the identified feature, which at least includes the device category and may also include the device location; then, according to the device category of each component identified above, multiple target components related to the control loop are screened out from multiple components in the first P&ID drawing image.

[0040] Step S206, constructing a directed graph according to each target component.

[0041] In the technical solution provided in step S206, the directed graph includes multiple nodes and multiple directed edges, wherein one node corresponds to one target component, and the directed edge connecting two nodes represents the pipeline and its flow direction between the target components corresponding to the two nodes. Therefore, the directed graph can reflect the connection relationship between each target component and the pipeline.

[0042] Step S208: using the pre-trained control loop identification model to identify the target control loop in the first P&ID drawing image from the directed graph.

[0043] In the technical solution provided in step S208, the identification system can input the directed graph into the control loop identification model, and the control loop identification model analyzes the control loops to which each node in the directed graph belongs, and then organizes the target components corresponding to multiple nodes and the control loops composed of pipelines corresponding to the directed edges between each node to obtain the control loop identification result of the first P&ID drawing image, and the control loop identification result records the various devices (including components and pipelines) contained in each control loop in the first P&ID drawing and the connection relationship between different devices.

[0044] The above method of this embodiment is further introduced below.

[0045] As an optional implementation, in the technical solution provided in the above step S204, the training process of the target detection model may include:

[0046] Step S11, constructing a first initial learning model. The first initial learning model may be a YOLOv8 model. The first initial learning model is only used as an example for explanation. The specific model selection may be selected according to the actual application scenario.

[0047] Step S12, obtaining a first training sample set and a first sample label set.

[0048] The first training sample set includes a plurality of P&ID drawing sub-images as first training samples, and the first sample label set includes the equipment type corresponding to each P&ID drawing sub-image as the first sample label;

[0049] Step S13, iteratively training the first initial learning model using the first training sample set and the first sample label set to obtain a target detection model.

[0050] Specifically, in the technical solution provided in the above step S13, it can be implemented in the following way: for each training batch in the iterative training process, each training sample of the training batch is input into the first initial learning model to obtain each device type output by the first initial learning model, and a first target loss function is constructed using the device type and the corresponding sample label, and the model parameters of the first initial learning model are adjusted according to the first target loss function.

[0051] As an optional implementation, in the technical solution provided in the above step S204, the identification system can screen out multiple target components related to the control loop according to the following method, including:

[0052] Step 1: Selecting a plurality of initial components of a first component category related to a control loop from a plurality of components according to the component category.

[0053] Generally speaking, the control loop in the P&ID drawing refers to a series of connected devices and components used to achieve automatic control of specific process variables (such as temperature, pressure, flow, liquid level, etc.). Therefore, the first device category of the initial components related to the control loop includes but is not limited to: sensors (such as temperature sensors, pressure sensors, flow sensors, liquid level sensors), transmitters (that is, converting sensor signals into standard signals), controllers (such as programmable logic controllers PLCs, distributed control systems DCS), actuators (such as electric actuators, pneumatic actuators, hydraulic actuators), control elements (such as frequency converters, pumps, fans, etc.), display and recording instruments (such as indicators and recorders on the dashboard), etc.

[0054] Step 2: For each initial component, determine the description information of the initial component, and judge whether the description information contains keywords related to the control loop. If so, determine that the initial component is a target component related to the control loop.

[0055] Considering that only the device category is used for screening, there may be inaccurate screening. Therefore, the present application also proposes a secondary screening, that is, screening based on whether the description information of the initial components contains keywords related to the control loop. This process can be achieved through regular expressions. Specifically, a regular expression containing keywords related to the control loop is pre-set, and then the description information of each initial component is matched with the regular expression. If the match is successful, it means that the description information of the initial component contains keywords related to the control loop. At this time, the initial component is determined to be the target component related to the control loop; conversely, if the match fails, it means that the description information of the initial component does not contain keywords related to the control loop. At this time, it is determined that the initial component is not the target component related to the control loop.

[0056] Furthermore, in order to identify the accuracy of the control loop in the future, the connectivity between the target components can be analyzed through the following steps:

[0057] Step 1: Use an optical character recognition algorithm to identify all identifiers in the first P&ID drawing image, and determine the target components whose area share in the first P&ID drawing image is not less than a preset area share threshold, delete all identifiers and all target components in the first P&ID drawing image, and obtain a second P&ID drawing image.

[0058] Generally, in addition to the diagrams of components and pipelines, the P&ID drawings also include annotation information such as processes and numbers. Therefore, the recognition system can first pre-process the first P&ID drawing image, including adjusting contrast, removing noise, image enhancement, tilt correction, etc.; then, use the optical character recognition algorithm to recognize all identifiers in the first P&ID drawing image, and the identifiers include text, symbols, etc. At the same time, determine the target components (i.e., the large target components of the first P&ID drawing image, such as towers, tanks, etc.) whose area ratio in the first P&ID drawing image is not less than the preset area ratio threshold; finally, call the preset image processing library (OpenCV) or image editing software (Photoshop) to delete all identifiers and all target components in the first P&ID drawing image to obtain the second P&ID drawing image.

[0059] Step 2: Determine the components of the second device category in the second P&ID drawing image, and convert the components of the second device category into pipelines to obtain a third P&ID drawing image.

[0060] The second device category includes but is not limited to: valves (such as gate valves, ball valves, butterfly valves, etc.), filters, separators, sampling points, safety devices (such as safety valves, bursting discs, etc.), connectors (such as flanges, joints, etc.), small heat exchangers used as heat exchangers in the process, small sensors, small actuators, etc. By converting the components of the second device category in the P&ID drawings into pipelines, the P&ID drawings can more clearly display the pipeline layout of the entire process flow, ensuring the continuity of the pipelines and the smoothness of the process.

[0061] Through the first and second steps above, it can be ensured that only pipeline content is retained in the third P&ID drawing image, so as to facilitate pipeline identification in the next step.

[0062] Step 3: Use the preset pipeline detection technology to identify multiple pipelines in the third P&ID drawing image, determine the pipeline distance between each pipeline based on the position information of each pipeline, and construct a pipeline connection relationship matrix based on the pipeline distance between each pipeline.

[0063] In the technical solution provided in the third step above, multiple pipelines in the third P&ID drawing image can be identified by the following method: the third P&ID drawing image is processed by a preset image processing technology to remove invalid information in the third P&ID drawing image, wherein the image processing technology includes at least one of the following: Gaussian filtering and corrosion enhancement; the processed third P&ID drawing image is identified by a straight line segment detection algorithm to obtain multiple pipelines (including horizontal lines and / or vertical lines) in the third P&ID drawing image, wherein the straight line segment detection algorithm can be an EDlines algorithm, an LSD (LineSegment Detector) algorithm, a CannyLine algorithm, etc.

[0064] Then, for any two pipelines, the positional relationship between the two pipelines is first determined based on their respective position information (i.e., the position coordinates of the two endpoints); if the positional relationship between the two pipelines is a parallel relationship, the distance between them can be calculated using the straight-line to straight-line distance formula; if the positional relationship between the two pipelines is an intersecting relationship, it means that the distance between the two pipelines is 0.

[0065] Finally, a plurality of pipelines in the third P&ID drawing image are identified as rows and columns, and the pipeline distances between pipelines corresponding to the rows and columns are used as matrix elements, so as to construct a pipeline connection relationship matrix.

[0066] Step 4: Determine the connectivity status between each target component based on the location information of each target component and the pipeline connection relationship matrix.

[0067] In the technical solution provided in the fourth step above, the connectivity status between the target components can be determined according to the following method, including:

[0068] First, for each target component, at least one first pipeline with the current target component as an endpoint is searched in the pipeline connection relationship matrix according to the position information of the current target component.

[0069] Then, a preset search algorithm (such as a depth-first search algorithm, etc.) is used to determine in the pipeline connection relationship matrix the second pipelines whose pipeline distances to the first pipelines are less than a preset distance threshold.

[0070] Finally, determine whether the component corresponding to the endpoint of the second pipeline is the target component, and if the component corresponding to the endpoint of the second pipeline is the target component, determine that the current target component is connected to the target component corresponding to the endpoint of the second pipeline.

[0071] As an optional implementation, in the technical solution provided in the above step S208, the training process of the above control loop identification model may include:

[0072] Step S21, constructing a second initial learning model, wherein the second initial learning model may be a Transformer model. The second initial learning model is only used as an example for explanation here, and the specific model selection may be selected according to the actual application scenario.

[0073] Step S22: Obtain a second training sample set and a second sample label set.

[0074] The second training sample set includes a plurality of component samples as second training samples, the second sample label set includes the type of control loop to which the component sample belongs as the second sample label, and different types of control loop samples include different numbers and types of components;

[0075] Step S23, iteratively training the second initial learning model using the second training sample set and the second sample label set to obtain control loop identification.

[0076] Specifically, in the technical solution provided in the above step S23, it can be implemented in the following way: for each training batch in the iterative training process, each training sample of the training batch is input into the second initial learning model, and the type of the control loop to which each component sample output by the second initial learning model belongs is obtained, and the second target loss function is constructed using the type of the control loop to which the component sample belongs and the corresponding sample label, and the model parameters of the second initial learning model are adjusted according to the second target loss function.

[0077] Furthermore, in the technical solution provided in the above step S208, the recognition system can use the above pre-trained control loop model to recognize the target control loop in the first P&ID drawing image, including:

[0078] Step S2081, using the pre-trained control loop identification model to classify each node in the directed graph, to obtain the type of control loop to which each node belongs.

[0079] Step S2082: A control loop is formed by a plurality of nodes belonging to the same type of control loop and directed edges connecting the plurality of nodes to obtain at least one control loop.

[0080] Step S2083: Perform compliance check on each control loop according to preset control logic rules, and use the control loop that passes the check as the target control loop in the first P&ID drawing image.

[0081] In this embodiment, since the control loop in the P&ID drawing refers to a closed loop composed of a series of connected devices and components for realizing automatic control of specific process variables (such as temperature, pressure, flow, liquid level, etc.), different types of control loops contain different numbers and types of components, and the same component may belong to different types of control loops. Therefore, multiple nodes belonging to the same type of control loop and directed edges connecting these nodes form a control loop to obtain at least one control loop in the first P&ID drawing image. Further, for each control loop identified, the control loop is checked for compliance using a preset control logic rule to determine whether the control loop conforms to the correct control logic. If so, it means that the control loop passes the compliance check. At this time, the control loop that passes the compliance check is output as a control loop identification result, wherein the control loop identification result can be saved and output in SVG file format for subsequent use by downstream tasks.

[0082] Based on the scheme defined in the above steps S202 to S208, it can be known that in the embodiment, the recognition system uses the target detection model to identify the device category of each component in the first P&ID drawing image, obtains the device category of each component, and selects multiple target components related to the control loop from multiple components based on the device category; then constructs a directed graph through these target components, and uses the control loop recognition model to identify the target control loop in the first P&ID drawing image from the directed graph. Compared with the prior art, the above control loop recognition process has the following advantages:

[0083] (1) The control loop identification method provided in the embodiment of the present application adopts a deep learning model (including a target detection model and a control loop identification model), which has stronger learning and adaptability and can process P&ID drawings of different sizes, layouts and various complex backgrounds;

[0084] (2) The control loop identification method provided in the embodiment of the present application can identify and analyze the information in the P&ID drawing with higher accuracy through processes such as image filtering (deleting identifiers and large target components), pipeline detection, and component connectivity analysis, thereby improving the efficiency and accuracy of identifying control loops from the P&ID drawing;

[0085] (3) The control loop identification method provided in the embodiment of the present application verifies the control loop identified by the control loop identification model through engineering experience to ensure that the control loop identification result conforms to the actual engineering control logic and rules, thereby improving the reliability and practicality of the control loop identification result.

[0086] Example 2

[0087] Based on the first embodiment of the present application, an embodiment of a control loop identification device based on P&ID drawings is also provided. When the device is running, the control loop identification method based on P&ID drawings of the above embodiment is executed. Figure 3 is a schematic structural diagram of an optional control loop identification device based on P&ID drawings according to an embodiment of the present application, such as Figure 3 As shown, the control loop identification device based on the P&ID drawing includes at least an acquisition module 32, a determination module 34, a construction module 36 and an identification module 38, wherein:

[0088] The acquisition module 32 is used to acquire a first P&ID drawing image, wherein the first P&ID drawing image is used to reflect at least the identifiers and position information of each of the multiple components in the process flow and the position information of the pipelines connecting the components;

[0089] A determination module 34 is used to identify the component category of each component in the first P&ID drawing image using a pre-trained target detection model to obtain the component category of each component, and select multiple target components related to the control loop from multiple components according to the component category;

[0090] A construction module 36 is used to construct a directed graph according to each target component, wherein the directed graph includes a plurality of nodes and a plurality of directed edges, one node corresponds to one target component, and a directed edge connecting two nodes represents the flow direction of the pipeline between the target components corresponding to the two nodes;

[0091] The identification module 38 is used to identify the target control loop in the first P&ID drawing image from the directed graph using the pre-trained control loop identification model.

[0092] It should be noted that the various modules in the above-mentioned control loop identification device based on P&ID drawings can be program modules (for example, a set of program instructions that implement a certain specific function) or hardware modules. For the latter, it can be expressed in the following forms, but is not limited to this: the expression form of each of the above-mentioned modules is a processor, or the functions of each of the above-mentioned modules are implemented by a processor.

[0093] Example 3

[0094] According to an embodiment of the present application, a non-volatile storage medium is also provided, in which a program is stored, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the control loop identification method based on the P&ID drawing in Example 1.

[0095] Optionally, the device where the non-volatile storage medium is located implements the following steps by running the program: obtaining a first P&ID drawing image, wherein the first P&ID drawing image is at least used to reflect the identifiers, location information and location information of pipelines connecting the components of a plurality of components in the process flow; using a pre-trained target detection model to identify the device category of each component in the first P&ID drawing image to obtain the device category of each component, and based on the device category, screening out a plurality of target components related to the control loop from the plurality of components; constructing a directed graph based on each target component, wherein the directed graph includes a plurality of nodes and a plurality of directed edges, a node corresponds to a target component, and a directed edge connecting two nodes represents the flow direction of the pipeline between the target components corresponding to the two nodes; using a pre-trained control loop recognition model to identify the target control loop in the first P&ID drawing image from the directed graph.

[0096] According to an embodiment of the present application, a computer program product is also provided, which includes a stored computer program, wherein when the computer program is executed by a processor, the control loop identification method based on the P&ID drawing in Example 1 is implemented.

[0097] Optionally, the computer program executes the following steps: obtaining a first P&ID drawing image, wherein the first P&ID drawing image is at least used to reflect the identifiers, location information and location information of pipelines connecting the components in the process flow; using a pre-trained target detection model to identify the device category of each component in the first P&ID drawing image to obtain the device category of each component, and based on the device category, filter out multiple target components related to the control loop from the multiple components; constructing a directed graph based on each target component, wherein the directed graph includes multiple nodes and multiple directed edges, one node corresponds to one target component, and the directed edge connecting two nodes represents the flow direction of the pipeline between the target components corresponding to the two nodes; using a pre-trained control loop recognition model to identify the target control loop in the first P&ID drawing image from the directed graph.

[0098] According to an embodiment of the present application, a processor is also provided, which is used to run a program, wherein the control loop identification method based on the P&ID drawing in Example 1 is executed when the program is running.

[0099] Optionally, when the program is running, the following steps are executed: obtaining a first P&ID drawing image, wherein the first P&ID drawing image is at least used to reflect the identifiers, location information and location information of pipelines connecting the components of a plurality of components in the process flow; using a pre-trained target detection model to identify the device category of each component in the first P&ID drawing image, and obtain the device category of each component, and filter out a plurality of target components related to the control loop from the plurality of components based on the device category; constructing a directed graph based on each target component, wherein the directed graph includes a plurality of nodes and a plurality of directed edges, a node corresponds to a target component, and a directed edge connecting two nodes represents the flow direction of the pipeline between the target components corresponding to the two nodes; using a pre-trained control loop recognition model to identify the target control loop in the first P&ID drawing image from the directed graph.

[0100] According to an embodiment of the present application, an electronic device is also provided, wherein: Figure 4 is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present application, such as Figure 4 As shown, the electronic device includes one or more processors; a memory for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors are enabled to run the programs, wherein the programs are configured to execute the control loop identification method based on the P&ID drawing in the above-mentioned embodiment 1 when running.

[0101] Optionally, the processor is configured to execute the following steps through a computer program: obtaining a first P&ID drawing image, wherein the first P&ID drawing image is at least used to reflect the identifiers, location information and location information of pipelines connecting the components in the process flow; using a pre-trained target detection model to identify the device category of each component in the first P&ID drawing image, obtain the device category of each component, and filter out multiple target components related to the control loop from the multiple components based on the device category; constructing a directed graph based on each target component, wherein the directed graph includes multiple nodes and multiple directed edges, one node corresponds to one target component, and the directed edge connecting two nodes represents the flow direction of the pipeline between the target components corresponding to the two nodes; using a pre-trained control loop identification model to identify the target control loop in the first P&ID drawing image from the directed graph.

[0102] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0103] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0104] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0105] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0106] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0107] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc. Various media that can store program codes.

[0108] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A control loop identification method based on P&ID drawings, characterized in that: include: Acquire a first piping and instrumentation diagram (P&ID) drawing image, wherein the first P&ID drawing image is used to at least reflect the identifiers and location information of each of a plurality of components in the process flow and the location information of pipelines connecting the components; Using a pre-trained target detection model to identify the component category of each component in the first P&ID drawing image, obtain the component category of each component, and filter out multiple target components related to the control loop from the multiple components according to the component category; Constructing a directed graph according to each of the target components, wherein the directed graph includes a plurality of nodes and a plurality of directed edges, one of the nodes corresponds to one of the target components, and a directed edge connecting two of the nodes represents the flow direction of the pipeline between the target components corresponding to the two nodes; A target control loop in the first P&ID drawing image is identified from the directed graph using a pre-trained control loop identification model.

2. The method according to claim 1, characterized in that The training process of the target detection model includes: constructing a first initial learning model; Acquire a first training sample set and a first sample label set, wherein the first training sample set includes a plurality of P&ID drawing sub-images as first training samples, the first sample label set includes a device type corresponding to each of the P&ID drawing sub-images as a first sample label, and the P&ID drawing sub-images are obtained by dividing P&ID drawing image samples; The first initial learning model is iteratively trained using the first training sample set and the first sample label set to obtain the target detection model.

3. The method according to claim 1, characterized in that Screening out a plurality of target components related to the control loop from the plurality of components according to the component category includes: Screening out a plurality of initial components of a first component category related to the control loop from the plurality of components according to the component category; For each of the initial components, the description information of the initial component is determined, and it is judged whether the description information contains keywords related to the control loop. If so, the initial component is determined to be a target component related to the control loop.

4. The method according to claim 1, characterized in that: Before constructing a directed graph using each of the target components, the method further includes: Using an optical character recognition algorithm to identify all identifiers in the first P&ID drawing image, and determining target components whose area ratio in the first P&ID drawing image is not less than a preset area ratio threshold, deleting all identifiers and all target components in the first P&ID drawing image, and obtaining a second P&ID drawing image; Determine components of a second device category in the second P&ID drawing image, and convert the components of the second device category into pipelines to obtain a third P&ID drawing image, wherein the second device category includes at least one of the following: valves, filters, and separators; Using a preset pipeline detection technology to identify multiple pipelines in the third P&ID drawing image, and determining the pipeline distance between each pipeline according to the position information of each pipeline, and constructing a pipeline connection relationship matrix according to the pipeline distance between each pipeline, wherein the rows and columns of the pipeline connection relationship matrix respectively represent the multiple pipelines in the third P&ID drawing image, and each matrix element in the pipeline connection relationship matrix is ​​used to represent the pipeline distance between two pipelines in the corresponding row and column; The connectivity status between the target components is determined according to the position information of the target components and the pipeline connection relationship matrix.

5. The method according to claim 4, characterized in that Detecting the plurality of pipelines in the third P&ID drawing image using a preset detection technology includes: Processing the third P&ID drawing image using a preset image processing technology to remove invalid information in the third P&ID drawing image, wherein the image processing technology includes at least one of the following: Gaussian filtering, corrosion enhancement; The processed third P&ID drawing image is identified using a straight line segment detection algorithm to obtain a plurality of pipelines in the third P&ID drawing image.

6. The method according to claim 4, characterized in that Determining the connectivity between the target components according to the position information of the target components and the pipeline connection relationship matrix includes: For each of the target components, searching, according to the position information of the current target component, in the pipeline connection relationship matrix for at least one first pipeline with the current target component as an endpoint; Using a preset search algorithm to determine in the pipeline connection relationship matrix a second pipeline whose pipeline distance to each of the first pipelines is less than a preset distance threshold; Determine whether the component corresponding to the endpoint of the second pipeline is the target component, and if the component corresponding to the endpoint of the second pipeline is the target component, determine whether the current target component is connected to the target component corresponding to the endpoint of the second pipeline.

7. The method according to claim 1, characterized in that The training process of the control loop identification model includes: constructing a second initial learning model; Acquire a second training sample set and a second sample label set, wherein the second training sample set includes a plurality of component samples as second training samples, the second sample label set includes the type of control loop to which the component samples belong as a second sample label, and different types of control loop samples include different numbers and types of components; The second initial learning model is iteratively trained using the second training sample set and the second sample label set to obtain the control loop identification.

8. The method according to claim 1, characterized in that Using a pre-trained control loop identification model to identify a target control loop in the first P&ID drawing image from the directed graph includes: Using a pre-trained control loop identification model to classify each node in the directed graph, and obtain the type of control loop to which each node belongs; A control loop is formed by a plurality of nodes belonging to the same type of control loop and directed edges connecting the plurality of nodes to obtain at least one control loop; A compliance check is performed on each of the control loops according to preset control logic rules, and the control loop that passes the check is used as the target control loop in the first P&ID drawing image.

9. A control circuit identification device based on P&ID drawings, characterized in that: include: An acquisition module, used to acquire a first P&ID drawing image, wherein the first P&ID drawing image is used to reflect at least the identifiers and position information of each of a plurality of components in the process flow and the position information of pipelines connecting the components; a determination module, configured to identify the component category of each component in the first P&ID drawing image by using a pre-trained target detection model, obtain the component category of each component, and select a plurality of target components related to the control loop from the plurality of components according to the component category; A construction module, used to construct a directed graph according to each of the target components, wherein the directed graph includes a plurality of nodes and a plurality of directed edges, one of the nodes corresponds to one of the target components, and a directed edge connecting two of the nodes represents the flow direction of the pipeline between the target components corresponding to the two nodes; The identification module is used to identify the target control loop in the first P&ID drawing image from the directed graph by using a pre-trained control loop identification model.

10. A computer program product, characterized in that include: A computer program, wherein when the computer program is executed by a processor, the control loop identification method based on P&ID drawings as described in any one of claims 1 to 8 is implemented.