Disclosure of Invention
The invention provides an automatic monitoring method for a closed path in a pipe network section in order to overcome the defects of the technology.
The invention aims to monitor equipment in a factory, and when the equipment is closed to cause one or more pipelines (pipe networks) to enter a closed state, related personnel are prompted to timely take pressure relief treatment, so that the overpressure of the pipelines is avoided, safety accidents are reduced, and meanwhile, the management level of production is improved.
Term interpretation:
1) The pressure-releasing device refers to a device which can release the pressure in the pipeline after the pipeline is communicated with the device. Such as a storage tank, a receiving device, a pressure relief valve, etc.
2) Dividing a complex problem into two or more same or similar sub-problems, dividing the sub-problem into smaller sub-problems until the final sub-problem can be simply and directly solved, and combining the solutions of the original problem, namely the solutions of the sub-problems.
3) The oil pipeline network is a net structure formed by pipelines and connected equipment, and is provided with a corresponding pump and a storage tank according to the requirements of the technological process, so that a complete system is designed and installed for completing the tasks of oil receiving, unloading and transferring.
4) Breadth-first search algorithm, its alias called BFS, belongs to a blind search method, and aims to systematically develop and examine all nodes in the graph to find the result.
5) And DCS Distributed Control System, distributed control system.
6) OMS Oil Movement System, oil product moving system.
The technical scheme adopted for overcoming the technical problems is as follows:
an automatic monitoring method for a closed path in a pipe network interval comprises the following steps:
s1, analyzing and obtaining basic attributes of all devices in a pipe network interval, and sequentially storing the basic attributes of the devices obtained through analysis into single graph nodes;
S2, constructing a bidirectional connection search graph based on the basic attributes of all the devices obtained through analysis, and reading the bit number values of the devices;
And S3, searching equipment in a closed path by adopting a breadth-first searching method, and searching from any one of the non-checked pipelines as a starting point until the current checking node is used as the starting point and the diffuse searching cannot be continued.
Further, in the step S1, the equipment at least comprises a tank, a pump, a valve, a pipeline, a flowmeter, a conveying device, a blind plate and a sealing head, and the basic attribute shared by each equipment comprises equipment codes, equipment types and connection relations among the equipment.
Further, step S0 is further included before step S1, wherein the whole pipe network section comprises n sub-pipe network sections, each sub-pipe network section corresponds to a flow chart, and n is more than or equal to 1.
Further, for the n Zhang Liucheng graphs, n threads are employed to execute step S1 and step S2 in parallel.
Further, in step S2, in the process of reading the device bit number, the bit number of other devices except the PID control valve and the centrifugal pump should be read.
Further, in step S2, the bit number value of the required device is read at one time, and the read bit number value is stored.
Further, in step S3, after the closed path is retrieved, a visual alert and/or an audible and visual alarm is provided by the DCS system.
Further, the step S3 specifically includes the following steps:
S3.1, taking out the queue head node as a current check node;
S3.2, searching reachable nodes of the current check node;
S3.3, judging the detected reachable node, and judging whether the reachable node is a pressure-releasing device or not, if yes, setting all devices in the current search interval to be not in a closed path, and then executing the next step, otherwise, directly executing the next step;
And S3.4, judging whether the reachable node is isolated from other search intervals, wherein the situation that the reachable node is isolated from other search intervals comprises the condition that a valve is in a closed state, a volumetric pump is in a closed state or a blind plate is arranged on the valve, if yes, directly returning to the step S3.1 to continue searching until the diffusion searching cannot be continued by taking the current check node as a starting point, otherwise, adding the reachable node into a queue, and then returning to the step S3.1 to continue searching until the diffusion searching cannot be continued by taking the current check node as the starting point.
Further, the search results are stored by adopting a data structure of a jump table, and the nodes to be accessed are stored by using a data structure of a queue.
Further, in step S3.4, returning to step S3.1 to continue searching is specifically divided into two cases:
1) If the nodes in the queue with the current search interval are not searched, continuing to search the current interval;
2) If the nodes in the queue are empty, searching for another searching interval.
The beneficial effects of the invention are as follows:
1. The invention uses the DCS system as a platform, monitors the closed state of equipment in the pipe network interval in the industrial production process in a program automatic inspection mode, replaces a monitoring operator to manually check the closed state of the equipment in the pipe network interval, can ensure that a pressure relief treatment measure is timely adopted to avoid the overpressure of a pipeline, reduces the occurrence of safety accidents, saves labor consumption, reduces the manual participation degree in the production process, and can also avoid uncertain factors caused by manual control.
2. The plant area is often provided with a plurality of independent sub-pipe network intervals, each sub-pipe network interval corresponds to one flow chart, the program is executed simultaneously by adopting a multithreading method, and the searching is performed by using the dividing and treating thought, so that the searching efficiency is greatly improved.
3. The program background automatically monitors the equipment in the factory, and prompts a monitoring operator in a visual reminding mode in time after the equipment in the closed path is detected.
Detailed Description
The invention will now be described in further detail with reference to the drawings and the specific examples, which are given by way of illustration only and are not intended to limit the scope of the invention, in order to facilitate a better understanding of the invention to those skilled in the art.
The invention discloses an automatic monitoring method of a closed path in a pipe network interval, as shown in fig. 1, comprising the following steps:
and S0, setting a whole pipe network interval to comprise n sub-pipe network intervals, wherein each sub-pipe network interval corresponds to a flow chart, and n is more than or equal to 1.
In a factory of a petrochemical enterprise, the whole pipe network interval is generally provided with a plurality of sub-pipe network intervals, and accordingly, each sub-pipe network interval corresponds to one flow chart, and the number of the sub-pipe network intervals is n, namely, n flow charts are provided, wherein n is more than or equal to 1. In this embodiment, the search closed path is searched by taking the search interval as a unit, but each sub-pipe network interval generally includes more than one search interval, and there may be multiple search intervals, and each search interval is independent, i.e. is not communicated with each other.
S1, analyzing and obtaining basic attributes of all devices in a pipe network interval, and sequentially storing the basic attributes of the devices obtained through analysis into a single graph node.
Specifically, the devices described in the petrochemical enterprise of the present embodiment at least include a tank, a pump, a valve, a pipe, a flowmeter, a conveying device, a blind plate, and a head, wherein the devices that have an influence on the closed path search are the pump and the valve. The pump at least comprises a centrifugal pump, a cam pump, a screw pump and a barrel bag pump, wherein the cam pump and the screw pump are commonly referred to as a volumetric pump, the centrifugal pump and the barrel bag pump are commonly referred to as a centrifugal pump, the valve at least comprises a hand valve, an interlocking valve, a switch type control valve, a switch stop type control valve, an electric control valve and a PID control valve, wherein the PID control valve is automatically switched by the pressure in a pipeline, other valves are manually switched and controlled, and the conveying device at least comprises a wharf and a loading platform.
In this embodiment, the information of the devices and the connection relationship between the devices are stored as xml documents generated by bpmn flowchart by default, so that the basic attributes of all the devices in the pipe network interval are obtained by parsing, that is, the text content in the xml documents is parsed. The device of the entity at least comprises a tank, a pump, a valve, a pipeline, a flowmeter, a conveying device, a blind plate and a sealing head, and the xml document comprises an inter-page connector and an intersection point besides the device of the entity, wherein the inter-page connector is used for connecting a plurality of flowcharts, and the two devices are abstracted by an OMS system and are also stored in the xml document, so that the devices are required to be resolved when resolving.
Since there are multiple devices, the attributes of the various devices are not completely the same, in this embodiment, only the basic attributes of all the devices, that is, the device codes, the device types and the connection relationships, need to be resolved. And sequentially storing the basic attributes of the equipment obtained by analysis as single graph nodes so as to facilitate the subsequent construction of a bidirectional connection search graph, wherein the equipment attributes of the graph nodes are stored by adopting a Map storage structure in order to improve the expandability and the universality of a program, and the reachable equipment graph nodes are stored by adopting a List storage structure.
And S2, constructing a bidirectional connection search graph based on the basic attributes of all the devices obtained through analysis, and reading the bit number value of the device.
The main innovation point of the invention is to complete the search of the bidirectional connection search graph (also called as the connection graph), but the search of the closed path is different from the search of the oil product moving path, and the key point of the search of the closed path is the accessibility judgment from the equipment in the path to the pressure-releasing equipment, so that the step is mainly to construct the bidirectional connection search graph based on the basic attribute of the equipment and the connection relation between the equipment obtained by analysis in the step S1, thereby being convenient for the accessibility judgment in the subsequent step S3.
The reading of the bit number is specifically that the current state of the equipment is read through a lower computer, then the DCS platform obtains the current state of the equipment read by the lower computer, and the general current state of the equipment can be represented by numerical values 1 and 2, for example, the current state can be represented by 1 for representing an on state and 2 for representing an off state, wherein the lower computer is a hardware equipment connected with equipment in a factory. In addition, because of excessive devices in the factory, in order to improve the program execution efficiency, the embodiment adopts one-time reading of the bit number value of the required device, stores the read bit number value, particularly stores in a memory of a server where an OMS system is located, and loads the required bit number from the memory for judgment when searching the device of a closed path later.
In this embodiment, the reading of the bit number is mainly to obtain the on-off state of the valve, the on-off state of the volumetric pump, and the blind plate state of the valve.
In order to improve efficiency, the method of multithreading is adopted in the embodiment, specifically, for n Zhang Liucheng diagrams in a factory, n threads are adopted to execute step S1 and step S2 in parallel, namely, each thread is responsible for a device analysis stage and a bidirectional connection search diagram constructing stage in a flow chart, then thread coordination is carried out through locking and other modes to obtain a total search diagram, a plurality of threads execute construction tasks of the search diagram simultaneously, a dividing and controlling idea is used for searching, and a high-efficiency automatic monitoring method of a closed state of a pipe network interval is constructed. As shown in fig. 2, a schematic diagram of parallel processing of 3 flowcharts using 3 threads is shown.
And S3, searching equipment in a closed path by adopting a breadth-first searching method, and searching from any one of the non-checked pipelines as a starting point until the current checking node is used as the starting point and the diffuse searching cannot be continued.
The key point of the invention is that the search of the connected graph is completed, and for the search of the connected graph, two search algorithms are usually adopted, one is depth-first search and the other is breadth-first search. The main purpose of searching for a closed path is to avoid that the oil pipelines are in a closed state, and all the oil pipelines must be checked, so in this embodiment, accessibility searching is performed by using any one of the unchecked oil pipelines as a starting point device until the current checking node is used as a starting point, and the diffuse searching cannot be continued. The closed state of each search interval is consistent, namely, each time the search is diffused outwards from the starting point until the search cannot be diffused, the search interval is communicated, and whether a pressure-releasing device exists or not is consistent. When the program is executed, the closed state of each search interval is recorded, when the next search interval accesses the search interval with the existing result, the current closed state of the search interval is combined with the closed state of the search interval with the existing result, and the equipment in the search interval with the existing result is not accessed any more, so that each equipment can be ensured to know the closed state of all the equipment only once in a check mode, and the search efficiency is greatly improved.
In addition, the initial default devices are all in a closed path, so that on one hand, pressure relief points possibly exist on the pipeline, an undetected pipeline does not determine whether the pressure relief points exist, and on the other hand, a manual pressure relief valve exists in the system, and the on-off state of the manual pressure relief valve also influences the judgment of whether the pipeline is closed. Therefore, in order to improve scalability and versatility, it is necessary to check the closed state of each pipe, and the initial default device is in the closed path starting from the pipe.
The step S3 specifically includes the following steps, as shown in fig. 3:
And S3.1, taking out the queue head node as a current check node.
And S3.2, searching the reachable node of the current check node.
And S3.3, judging the detected reachable node, and judging whether the reachable node is a pressure-releasing device, if so, setting all devices in the current search interval to be not in a closed path, and then executing the next step, otherwise, directly executing the next step.
And S3.4, judging whether the reachable node is isolated from other search intervals, wherein the situation that the reachable node is isolated from other search intervals comprises the condition that a valve is in a closed state, a volumetric pump is in a closed state or a blind plate is arranged on the valve, if yes, directly returning to the step S3.1 to continue searching until the diffusion searching cannot be continued by taking the current check node as a starting point, otherwise, adding the reachable node into a queue, and then returning to the step S3.1 to continue searching until the diffusion searching cannot be continued by taking the current check node as the starting point.
In this step S3.4, returning to step S3.1 to continue searching is specifically divided into two cases:
1) If the nodes in the queue with the current search interval are not searched, continuing to search the current interval;
2) If the nodes in the queue are empty, searching for another searching interval.
Because the number of devices in the oil refinery area is large, the preferred embodiment is that the search result is stored by adopting a data structure of a jump table, compared with a normal List, the method has higher execution efficiency when processing more data, and the nodes to be accessed are stored by using the data structure of the queue.
In step S3, after the closed path is retrieved, that is, after the device in the closed path is retrieved, a visual alert and/or an audible and visual alert is provided through the DCS system, where the visual alert is to pop up an alert on the operation station, and an operator can view the closed path in the flowchart, and the closed path is generally displayed in red, so that the operator can take measures in time.
In the following, we will describe in detail the principle of the present invention for searching for a closed path in a simple case, as shown in fig. 4, the valves V3 and V5 are set to be opened, the pump P1 is set to be opened, and the other valves (i.e., V1, V2, V4) are set to be closed. A certain pipeline is randomly taken as a starting point. Assuming that the pipeline PI1 is taken as a starting point, the accessible node of the pipeline PI1 is the blind plate B1 and the valve V2 in the closed state, which are not communicated with other devices, and the pipeline PI1 is the closed pipeline. And then a non-accessed pipeline PI2 is randomly fetched, the accessible node of the pipeline PI2 is a valve V1 in a closed state (the valve V2 is accessed and no logic judgment is performed), the valve is not communicated with other equipment, and the pipeline PI2 is a closed pipeline. And then randomly taking an unviewed pipeline PI3, wherein reachable nodes of the pipeline PI3 are a pipeline PI6 and a pipeline PI7, putting the pipeline PI6 and the pipeline PI7 into a queue, taking out a valve V3 with the reachable nodes of the head node PI6 and the pipeline PI6 in the queue in an open state, putting the valve V3 into the queue, taking out the head node PI7 in the queue, taking out the valve V4 with the reachable nodes of the PI7 in a closed state, failing to continue the extended search, not putting into the queue, taking out the reachable nodes of the head nodes V3 and V3 in the queue as PI5, putting the PI5 into the queue, taking out the head node PI5, taking out reachable devices of the head node PI5 as a tank T1, and decompressing the tank, so that all the pipelines PI3, PI5, PI6 and PI7 in the current search interval are in an unsealed state. And then randomly taking a pump P1 with the accessible node of the inaccessible pipeline PI8 and PI8 in an open state, putting P1 into a queue, taking out the accessible node of the current queue head node P1 and P1 as PI9, putting PI9 into the queue, taking out the valve V5 with the accessible node of the current queue head node PI9 and PI9 in an open state, putting V5 into the queue, taking out the accessible node of the current queue head node V5 and V5 as PI10, putting PI10 into the queue, taking out the accessible device of the current queue head node PI10 and PI10 as a tank T2, and releasing pressure by the tank, so that the pipelines PI8, PI9 and PI10 in the current search interval are in an unsealed state.
In the prior art, the monitoring operator is only used for checking the closed state of equipment in an industrial factory by manpower, and the automatic monitoring of the invention not only saves the manpower consumption cost and reduces the manual participation degree in the production process, but also can avoid uncertain factors caused by manual control. The automatic inspection mode can also prompt a monitoring operator to perform pressure relief action on the closed pipe network in time, so that safety accidents are reduced, and the management level of production is improved.
The foregoing has described only the basic principles and preferred embodiments of the present invention, and many variations and modifications will be apparent to those skilled in the art in light of the above description, which variations and modifications are intended to be included within the scope of the present invention.