Urban gas pipeline risk assessment method based on knowledge graph
By establishing a knowledge map of urban gas pipeline-risk source and collecting pipeline operation status information in real time, the problem of difficulty in predicting gas pipeline accidents in advance in the existing technology is solved, early warning and real-time response to accidents are achieved, and the efficiency and scientific nature of emergency management are improved.
Patent Information
- Application Number
- CN202510097523.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-22
- Publication Date
- 2025-05-16
AI Technical Summary
The existing technology is difficult to predict urban gas pipeline accidents in advance, which poses a major threat to society when the accident occurs.
Using a knowledge graph-based method, we collect gas pipeline accident history information, images, videos and text reports, conduct multi-modal fusion, establish urban gas pipeline-risk source knowledge graph, and collect pipeline operation status information in real time for risk assessment.
It has achieved early warning and real-time response to gas pipeline accidents, improved the efficiency and scientific nature of emergency management, and reduced the impact of accidents on society.
Smart Images

Figure CN120013242A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of emergency management technology, and in particular to a risk assessment method for urban gas pipelines based on a knowledge graph. Background Art
[0002] Gas pipelines are mainly laid under urban roads in densely built-up areas with large populations. At the same time, due to the large scale of gas pipelines, the long service life of some pipelines, geological disasters, construction damage and other reasons, gas pipeline accidents (such as gas pipeline leaks) occur from time to time, posing a major threat to society.
[0003] The safe operation of urban gas pipelines is crucial to the normal operation of cities and the lives of residents. However, factors such as pipeline aging, natural disasters, and third-party damage have led to frequent gas pipeline accidents, and emergency management work is facing tremendous pressure.
[0004] At present, accident consequence analysis is an important means of gas pipeline risk management, but it mainly focuses on post-event analysis, that is, evaluating the consequences after the accident occurs, and cannot achieve pre-event prediction. Once an accident occurs in a gas pipeline, it is easy to endanger the safety of people's lives and property. Summary of the invention
[0005] In order to solve the deficiencies of the prior art, the present invention provides a city gas pipeline risk assessment method based on knowledge graph, comprising the following steps:
[0006] Step 1: Collect historical information on gas pipeline accidents, including detailed information on the cause, type, and consequences of the accident, and collect images, videos, and text reports of the accident scene. After identifying and extracting the required information, perform multimodal fusion to obtain a comprehensive feature vector and establish a knowledge graph of urban gas pipeline-risk sources.
[0007] Step 2: Construct a digital model of the city gas pipeline.
[0008] Step 3: Collect information related to the operation status of the city gas pipeline in real time and input it into the city gas pipeline-risk source knowledge map for risk assessment. For risk points that may pose risks, mark prompts on the city gas pipeline digital model and / or generate alarm information.
[0009] Furthermore, the method of identifying and extracting the required information in step 1 includes:
[0010] (1) Using a target detection algorithm for image recognition, the target detection algorithm includes a loss function shown in Formula 1:
[0011]
[0012] Among them, loss is the total loss, S is the number of grids, B is the number of anchor boxes for each grid, classes is the number of categories, i is the grid index, j is the anchor box index, and c is the category index. is the probability that the jth anchor box of the ith grid predicted by the model belongs to the cth category, is the probability that the jth anchor box in the i-th grid belongs to the c-th category, λ coord is the weight of the position loss, is the x-coordinate of the j-th anchor box in the i-th grid predicted by the model, is the x-coordinate of the j-th anchor box of the i-th grid, w and h are the width and height, is an indicator of whether the jth anchor box of the true i-th grid has an object (1 for existence, 0 for non-existence), The probability of whether the jth anchor box of the i-th grid predicts the existence of an object is, The probability of whether the jth anchor box of the i-th grid predicts the presence of background.
[0013] (2) A model with self-attention mechanism as the core is used for named entity recognition:
[0014]
[0015] Among them, Attention is the self-attention mechanism, Q is the query, K is the key, V is the value, and d k is the dimension of the key, and softmax is the soft maximum function.
[0016] (3) Using a sequence labeling model based on a probabilistic graphical model to identify entities and relations in a text sequence, the conditional probability formula of the sequence labeling model based on a probabilistic graphical model is as follows:
[0017]
[0018] Among them, p(y|x) is the conditional probability of sequence y given input y, n is the sequence length, m is the number of feature functions, and y i is the i-th label in the sequence, y i-1 is the i-1th label in the sequence, x i is the i-th input in the sequence, x i-1 is the i-1th input in the sequence, y j is the jth characteristic function, λ j is the weight of the jth feature function, and Y is the label set.
[0019] Furthermore, the multimodal fusion described in step 1 is: using formula 4 to splice the feature vectors of different modal data to form a comprehensive feature vector.
[0020] F=[F v ,F t ,F s Formula 4
[0021] Among them, F is the comprehensive feature vector, F v is the visual feature vector, F t is the text feature vector, F s is the sensor feature vector.
[0022] Furthermore, the method for establishing the city gas pipeline-risk source knowledge graph in step 1 includes:
[0023] Step 1.1 defines key classes, and establishes relationships and attributes between key classes, wherein the relationships and attributes include: connection relationships, monitoring relationships, cause relationships, and response relationships.
[0024] Step 1.2 uses machine learning and natural language processing technology to extract entities, relationships, and attributes from historical information on gas pipeline accidents, images, videos, and text reports of accident sites, and construct a knowledge graph.
[0025] Step 1.3 uses a high-performance graph database to store the knowledge graph, and adopts the B+ tree index mechanism to achieve fast query and analysis.
[0026] Furthermore, step 1.2 specifically includes:
[0027] Step 1.2.1 Knowledge extraction:
[0028] Use machine learning and natural language processing techniques to extract entities, relationships, and attributes from structured, semi-structured, and unstructured data.
[0029] Use formula 5 to perform rule matching and identify specific patterns in the text:
[0030] match = re.match(pattern,text) Formula 5
[0031] Among them, match is the matching result, pattern is the regular expression pattern, and text is the text to be matched.
[0032] Step 1.2.2 Knowledge fusion:
[0033] (1) Entity alignment: Use Formula 6 to perform entity alignment, calculate the similarity between two strings, and determine whether they point to the same entity:
[0034] similarity=sim(string1,string2) Formula 6
[0035] Among them, similarity is the similarity between two strings, and string1 and string2 are the strings to be compared.
[0036] (2) Relationship merging: The confidence ranking is used to merge relationships using Formula 7. Relationships are sorted according to their confidence, and relationships with high confidence are preferentially selected for merging:
[0037] merged_relations=sort(relations,confidence) Formula 7
[0038] Among them, merged_relations is the merged relation set, relations is the original relation set, and confidence is the confidence of the relation.
[0039] Step 1.2.3 integrates the knowledge fusion results to obtain the knowledge graph.
[0040] Furthermore, the method for constructing a digital model of a city gas pipeline in step 2 includes:
[0041] Step 2.1 uses image recognition technology to identify the city gas pipeline route map, extract the route location, category, key location information, and extract the text information of the route. The key locations include: valve location, pressure regulating station, historical accident location, and emergency resource storage point.
[0042] Step 2.2: Acquire the geographic information corresponding to the city gas pipeline map in conjunction with the geographic information system.
[0043] Step 2.3 integrates the line location, category, key location information, text information, and geographic information into a digital model of the city gas pipeline.
[0044] Furthermore, the real-time collection of the city gas pipeline operation status information described in step 3 includes: obtaining real-time pressure, flow, temperature data and historical operation data from the gas pipeline monitoring system, analyzing the current operation status data of the city gas pipeline, and combining the linear equation fitted by the least squares method to obtain the operation trend data of the city gas pipeline.
[0045] Furthermore, the method for risk assessment in combination with the city gas pipeline-risk source knowledge graph described in step 3 includes:
[0046] Step 3.1: Obtain the current operating status data and operating trend data of the city gas pipeline, and obtain the geographic data and real-time meteorological data of the pipeline and its surrounding areas.
[0047] Step 3.2 substitutes the data obtained in step 3.1 into the city gas pipeline-risk source knowledge graph obtained in step 1, and obtains the possibility of an accident occurring in the city gas pipeline based on formula eight.
[0048]
[0049] Among them, f(x) is the prediction function, k is the category, T k is the set of trees belonging to category k, and I is the indicator function.
[0050] Step 3.3 When the probability of an accident in a city gas pipeline exceeds the preset risk threshold, the location of the accident in the city gas pipeline is output, and the type and probability of the possible accident are marked at the corresponding location of the city gas pipeline digital model obtained in step 2.
[0051] Use formula 9 to set the risk threshold:
[0052]
[0053] Among them, P(B|A) is the probability of A when B is known, P(B|A) is the probability of B when A is known, P(A) is the probability of A, and P(B) is the probability of B.
[0054] Furthermore, the method of combining the city gas pipeline-risk source knowledge graph for risk assessment described in step 3 also includes: when a risk warning is triggered or an accident occurs, the association relationship of the city gas pipeline-risk source knowledge graph is used to perform risk tracing analysis through formula ten.
[0055] MATCH path = (start)-[*]->(end)RETURN path Formula 10
[0056] Among them, path is the traversal path, start is the starting node, and end is the ending node.
[0057] Furthermore, it also includes:
[0058] Step 4: Form emergency response and decision support based on the possible accidents and types or the types of accidents that are happening. Including:
[0059] Step 4.1 Accident scenario analysis:
[0060] Based on the pipeline information of the accident site, the surrounding geographical environment information and the type of accident, an accident scenario model is constructed to simulate the accident development process and predict possible accident consequences.
[0061] Step 4.2 Emergency plan development:
[0062] According to the results of the accident scenario analysis and emergency resource information, an emergency response plan is formed based on the corresponding accident processing information in the urban gas pipeline-risk source knowledge graph, including emergency rescue process, resource allocation plan and personnel evacuation route planning.
[0063] Step 4.3 Regulatory standards compliance check:
[0064] Based on the regulatory and standard knowledge in the urban gas pipeline-risk source knowledge graph, check whether the emergency response measures obtained in step 4.2 comply with relevant laws, regulations and standards.
[0065] Step 4.4 Dynamic monitoring of resources:
[0066] Based on the key location information in the digital model of the urban gas pipeline, the distribution, quantity, status and usage of emergency resources are obtained, including the location and availability of rescue equipment, the standby status and skills of rescue personnel, and the storage and consumption of emergency materials.
[0067] Step 4.5 Intelligent resource allocation:
[0068] According to the type, severity and on-site needs of the accident, determine the type and quantity of emergency resources required based on the corresponding accident processing information in the urban gas pipeline-risk source knowledge graph, and formulate a resource allocation plan based on the dynamic resource monitoring results of step 4.4.
[0069] Step 4.6 Resource supplement and optimization:
[0070] After the emergency response is completed, analyze the resource replenishment needs and formulate a replenishment plan based on the resource usage and loss level, replenish the consumed emergency materials in a timely manner, repair or replace the damaged rescue equipment, and ensure the sustainability of emergency resources.
[0071] Step 4.7 Accident simulation and training:
[0072] Construct accident simulation scenarios, conduct emergency drills and training, and evaluate and improve training results.
[0073] The beneficial effect of the present invention is that the present invention realizes early warning and real-time response to gas pipeline accidents through advanced knowledge graph technology, thereby improving the overall emergency management efficiency and scientificity. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] Figure 1 This is a flow chart of the urban gas pipeline risk assessment method based on knowledge graph of the present invention. DETAILED DESCRIPTION
[0075] The present invention will now be described in further detail with reference to the accompanying drawings.
[0076] Example 1
[0077] A risk assessment method for urban gas pipelines based on knowledge graph, such as Figure 1 As shown, the following steps are included:
[0078] Step 1 collects historical information on gas pipeline accidents, including detailed information on the cause of the accident (such as corrosion, external force damage), type (such as leakage, explosion), and consequences (such as casualties, property losses, and environmental impact), and collects images, videos, and text reports of the accident site (such as emergency rescue records, accident investigation and analysis reports). After identifying and extracting the required information, multimodal fusion is performed to obtain a comprehensive feature vector, and a knowledge graph of urban gas pipeline-risk sources is established.
[0079] Step 2: Construct a digital model of the city gas pipeline.
[0080] Step 3: Collect information related to the operation status of the city gas pipeline in real time and input it into the city gas pipeline-risk source knowledge map for risk assessment. For risk points that may pose risks, mark prompts on the city gas pipeline digital model and / or generate alarm information.
[0081] The present invention uses advanced knowledge graph technology to achieve early warning and real-time response to gas pipeline accidents, thereby improving the overall efficiency and scientificity of emergency management.
[0082] Example 2
[0083] Based on the knowledge graph-based urban gas pipeline risk assessment method of Example 1, the method of identifying and extracting required information in step 1 includes:
[0084] (1) Using a target detection algorithm for image recognition, the target detection algorithm includes a loss function shown in Formula 1:
[0085]
[0086] Among them, loss is the total loss, S is the number of grids, B is the number of anchor boxes for each grid, classes is the number of categories, i is the grid index, j is the anchor box index, and c is the category index. is the probability that the jth anchor box of the ith grid predicted by the model belongs to the cth category, is the probability that the jth anchor box in the i-th grid belongs to the c-th category, λ coord is the weight of the position loss, is the x-coordinate of the j-th anchor box in the i-th grid predicted by the model, is the x-coordinate of the j-th anchor box of the i-th grid, w and h are the width and height, It is an indicator of whether there is a target in the j-th anchor box of the i-th real grid (1 means there is, 0 means there is not). It is the probability that there is a target in the j-th anchor box of the i-th grid predicted by the model. It is the probability that there is background in the j-th anchor box of the i-th grid predicted by the model.
[0087] This method has the advantages of fast detection speed, high accuracy, strong robustness, etc.
[0088] (2) Use a model with self-attention mechanism as the core including Equation 2 for named entity recognition:
[0089]
[0090] Among them, Attention is the self-attention mechanism, Q is the query, K is the key, V is the value, and d k is the dimension of the key, and softmax is the softmax function.
[0091] The self-attention mechanism model is a deep learning model based on the self-attention mechanism, which can effectively capture long-distance dependencies in the text and extract text features. As the core part of the model, Equation 2 can more accurately identify entities and relationships in the text.
[0092] (3) Use a sequence labeling model based on a probabilistic graphical model to identify entities and relationships in the text sequence. The conditional probability formula of the sequence labeling model based on the probabilistic graphical model is Equation 3:
[0093]
[0094] Among them, p(y|x) is the conditional probability of sequence y under the given input y, n is the sequence length, m is the number of feature functions, y i is the i-th label in the sequence, y i-1 is the (i - 1)-th label in the sequence, x i is the i-th input in the sequence, x i-1 is the (i - 1)-th input in the sequence, y j is the j-th feature function, λ j is the weight of the j-th feature function, and Y is the label set.
[0095] Through the above method, target recognition, entity and relationship extraction can be accurately performed, and a knowledge graph with more accurate relationships can be constructed.
[0096] Example 3
[0097] Based on the knowledge graph-based urban gas pipeline risk assessment method of Example 1, the multimodal fusion described in step 1 is: using formula 4 to splice the feature vectors of different modal data to form a comprehensive feature vector.
[0098] F=[F v ,F t ,F s Formula 4
[0099] Among them, F is the comprehensive feature vector, F v is the visual feature vector, F t is the text feature vector, F s is the sensor feature vector.
[0100] This method concatenates the feature vectors of different modal data to form a comprehensive feature vector, and inputs it into the subsequent model for processing. It is simple and easy to implement, and can effectively integrate the features of different modal data and improve the performance of the model.
[0101] Example 4
[0102] Based on the knowledge graph-based urban gas pipeline risk assessment method of Example 1, the method of establishing the urban gas pipeline-risk source knowledge graph in step 1 includes:
[0103] Step 1.1 defines key classes, and establishes relationships and attributes between key classes, wherein the relationships and attributes include: connection relationships, monitoring relationships, cause relationships, and response relationships.
[0104] For example, define the following key classes:
[0105] Pipeline class: Contains the basic properties of the pipeline (such as number, length, material), operating status (such as normal operation, leakage, rupture) and location information (such as starting point coordinates, end point coordinates).
[0106] Accident category: covers various types of gas pipeline accidents, records the time, location, and severity of the accident, and establishes an association with the pipeline category (such as the accident occurred on a certain pipeline).
[0107] Emergency resource category: including personnel, equipment, materials, etc., clarify the resource type, quantity, availability, and establish a response relationship with the accident category (such as a certain equipment is used to handle a specific type of accident).
[0108] Environmental category: Describes the geographical and meteorological environment around the pipeline, as well as the mutual influence between pipeline category and accident category (e.g. mountainous terrain may increase the difficulty of pipeline inspection, and heavy rain may cause landslides and affect pipeline safety).
[0109] For example, define the following relations and attributes:
[0110] Connection relationship: Indicates the connection status between pipelines, such as one pipeline is connected to another pipeline.
[0111] Monitoring relationship: describes the monitoring correspondence between the sensor and the pipeline, such as a pressure sensor monitoring the pressure of a certain section of the pipeline.
[0112] Causal relationship: used to indicate the causal relationship between the cause of an accident and the accident, such as corrosion leading to pipeline leakage.
[0113] Response relationship: Clarify the deployment and use relationship between emergency resources and accidents, such as a rescue team responding to a certain accident.
[0114] Corresponding attributes can also be defined for other categories and relationships, such as the service life of the pipeline, the procurement time of emergency resources, the loss assessment of the accident, etc., to enrich the semantic information of the knowledge graph.
[0115] Step 1.2 uses machine learning and natural language processing technology to extract entities, relationships, and attributes from historical information on gas pipeline accidents, images, videos, and text reports of accident sites, and construct a knowledge graph.
[0116] Step 1.2 specifically includes:
[0117] Step 1.2.1 Knowledge extraction:
[0118] Use machine learning and natural language processing techniques to extract entities, relationships, and attributes from structured (such as pipeline operation data in a database), semi-structured (such as accident reports in XML format), and unstructured data (such as text descriptions of accident scene images).
[0119] Use formula 5 to perform rule matching and identify specific patterns in the text:
[0120] match = re.match(pattern,text) Formula 5
[0121] Among them, match is the matching result, pattern is the regular expression pattern, and text is the text to be matched.
[0122] Step 1.2.2 Knowledge fusion:
[0123] (1) Entity alignment: Use Formula 6 to perform entity alignment, calculate the similarity between two strings, and determine whether they point to the same entity:
[0124] similarity=sim(string1,string2) Formula 6
[0125] Among them, similarity is the similarity between two strings, and string1 and string2 are the strings to be compared.
[0126] (2) Relationship merging: The confidence ranking is used to merge relationships using Formula 7. Relationships are sorted according to their confidence, and relationships with high confidence are preferentially selected for merging:
[0127] merged_relations=sort(relations,confidence) Formula 7
[0128] Among them, merged_relations is the merged relation set, relations is the original relation set, and confidence is the confidence of the relation.
[0129] Step 1.2.3 integrates the knowledge fusion results to obtain the knowledge graph.
[0130] Step 1.3 uses a high-performance graph database to store the knowledge graph, and adopts the B+ tree index mechanism to achieve fast query and analysis.
[0131] For example: using high-performance graph database Neo4j for storage, and using B+ tree index mechanism for fast query and analysis. Neo4j is a high-performance graph database that can effectively store and manage knowledge graph data and supports Cypher query language. It has the advantages of high performance, ease of use, and support for complex queries. B+ tree index is an efficient index structure that can quickly find entities or relationships with specific attribute values, and supports range queries and sorting operations, thereby significantly improving the query efficiency of knowledge graphs.
[0132] According to one embodiment of the present invention, after the city gas pipeline-risk source knowledge graph is constructed, the integrity and consistency evaluation of the knowledge graph is performed, including:
[0133] Completeness assessment: The completeness of the knowledge graph is assessed by formulating a set of capability questions (CQs). For example, "query the operating status of all gas pipelines in a certain area", "find historical cases and treatment measures for specific accident types", etc. These CQs are converted into SPARQL query statements and executed in the knowledge graph. If accurate and comprehensive answers can be returned, it means that the knowledge graph has good completeness in the corresponding aspects. At the same time, experts and emergency management personnel in the field of gas pipelines are invited to participate in the assessment to determine whether the knowledge graph covers key information based on their professional knowledge and actual work needs. For example, experts may be concerned about whether the relevant information of special structural parts of the pipeline (such as elbows and tees) is reflected in the knowledge graph.
[0134] Consistency assessment: Develop a series of SHACL rules to check the consistency of the knowledge graph. These rules cover object type attributes (such as ensuring that the "material" attribute value of the "pipeline class" conforms to the predefined material type) and data type attributes (such as whether the format of the "accident time" is correct). Run these rules in the knowledge graph. If no violations are returned, it means that the knowledge graph has good consistency. In addition, check whether there are logical conflicts in the knowledge graph, such as the same pipeline being marked as different materials or operating states in different data sources. Ensure the consistency and accuracy of the data through a comprehensive inspection and analysis of the knowledge graph.
[0135] Example 5
[0136] Based on the knowledge graph-based city gas pipeline risk assessment method of Example 1, the method for constructing a city gas pipeline digital model in step 2 includes:
[0137] Step 2.1 uses image recognition technology to identify the city gas pipeline route map, extract the route location, category, key location information, and extract the text information of the route. The key locations include: valve location, pressure regulating station, historical accident location, and emergency resource storage point.
[0138] Specifically, Stanford CoreNLP is used for text parsing. Stanford CoreNLP is an open source natural language processing tool that can perform tasks such as word segmentation, part-of-speech tagging, and named entity recognition. Its core is the NLP pipeline, which can be configured with different NLP components. Stanford CoreNLP is comprehensive, easy to use, and open source and free, making it suitable for use in text parsing tasks for urban gas pipeline emergency management. It can effectively extract key information from text, such as pipeline name, accident location, accident type, etc.
[0139] Specifically, image recognition uses OpenCV for image processing. OpenCV is an open source computer vision library that provides a wealth of image processing and computer vision algorithms. OpenCV provides a variety of image processing functions, such as:
[0140] cv2.resize(image,(width,height)): resizes the image.
[0141] cv2.cvtColor(image,cv2.COLOR_BGR2GRAY): Converts the image to grayscale.
[0142] cv2.threshold(image,thresh,maxval,type): Binarize the image.
[0143] cv2.findContours(image,mode,method): Finds contours in an image.
[0144] And a variety of computer vision algorithms, such as:
[0145] cv2.HoughLines(image,rho,theta,threshold): Hough transform detects straight lines.
[0146] cv2.HoughCircles(image,dp,minDist,param1,param2): detect circles using Hough transform.
[0147] cv2.minEnclosingCircle(points): Calculates the minimum circumscribed circle.
[0148] Among them, image is the image object, (width, height) is the image width and height, thresh is the threshold, maxval is the maximum value, type is the binarization type, points is the contour point set, rho is the line segment distance accuracy, theta is the line segment angle accuracy, dp is the circle detection resolution, minDist is the minimum distance between the center of the circle, and (param1, param2) is the Hough transform parameter. OpenCV is rich in functions, easy to use, open source and free, suitable for image recognition tasks in urban gas pipeline emergency management, and can effectively perform image processing and analysis, such as image scaling, grayscale, binarization, contour detection, line detection, circle detection, etc.
[0149] Step 2.2 combines the geographic information system to obtain the geographic information corresponding to the urban gas pipeline route map. The geographic information system (GIS) can exemplarily use PostGIS as the GIS database. PostGIS is an open source GIS database extension that can store geographic information data in the PostgreSQL database and provide spatial query and analysis functions. PostGIS supports a variety of spatial data types, such as points (POINT), lines (LINESTRING), polygons (POLYGON), etc., and provides a wealth of spatial functions, such as:
[0150] ST_Distance(point1,point2): Calculates the distance between two points.
[0151] ST_Within(point,polygon): Determines whether a point is inside a polygon.
[0152] ST_Intersection(geometry1,geometry2): Computes the intersection of two geometries.
[0153] Among them, point1 and point2 are point objects, polygon is a polygon object, geometry1 and geometry2 are geometric objects. PostGIS is powerful and easy to use. It is suitable for use in the POI management mechanism of urban gas pipeline emergency management. It can effectively store and manage geographic information data and support spatial query and analysis functions, such as calculating distance, judging position relationship, analyzing spatial distribution, etc.
[0154] Step 2.3 integrates the line location, category, key location information, text information, and geographic information into a digital model of the city gas pipeline.
[0155] Example 6
[0156] Based on the urban gas pipeline risk assessment method based on the knowledge graph of Example 5, a POI (point of interest) management mechanism is established. The POI management mechanism is an important part of the knowledge graph of the present invention. In the emergency management of urban gas pipelines, POIs can represent key locations of pipelines (such as valves, pressure regulating stations), accident sites, emergency resource storage points, etc. Through the analysis of visual or text messages, the POI management mechanism can create or update POI information. For example, when a text message is received about a leak in a certain section of the pipeline, the mechanism can extract relevant information, such as the coordinates of the leak location, the scope of impact, etc., and create or update the corresponding POI so that emergency personnel can quickly locate and handle it.
[0157] According to an embodiment of the present invention, after the POI management mechanism is established, the following method is used to evaluate the POI management mechanism:
[0158] 1. Evaluation Metrics and Datasets: The performance of the POI management mechanism is evaluated using metrics such as precision, recall, and F1 score. Precision measures the accurate proportion of POIs created or updated by the mechanism, recall measures the proportion of POIs that should actually be created or updated that are successfully processed, and the F1 score takes both precision and recall into account.
[0159] 2. Construct an evaluation dataset: Construct a dataset containing visual and text messages for evaluation. The messages in the dataset simulate various gas pipeline emergency scenarios, such as pipeline leak reports, accident scene image descriptions, etc. The information in each message is marked as key information for creating or updating POIs, as well as the actual POI status changes.
[0160] 3. Analysis of evaluation results:
[0161] Visual Message: The accuracy and completeness of the analysis mechanism when extracting key information (such as leak location, impact range) and creating or updating POI. For example, check whether the coordinates of the leak point identified from the pipeline leak image are accurate, and whether the updated POI contains the correct accident type and impact range information.
[0162] Text messages: Evaluate the mechanism’s understanding of the emergency events described in the text and its POI creation / update capabilities. For example, analyze whether the accident location, related objects, and personnel information extracted from the accident report text are accurately reflected in the POI, and the mechanism’s ability to update dynamic information in the text (such as the expansion of the accident impact area).
[0163] Example 7
[0164] Based on the knowledge graph-based urban gas pipeline risk assessment method of Example 1, the real-time collection of urban gas pipeline operation status information in step 3 includes: obtaining real-time pressure, flow, temperature data and historical operation data from the gas pipeline monitoring system, analyzing the current operation status data of the urban gas pipeline, and combining the linear equation fitted by the least squares method to obtain the operation trend data of the urban gas pipeline. Furthermore, it is also possible to collect information such as pipeline design parameters and construction records to understand the basic conditions such as pipeline material, pipe diameter, and laying path, so as to provide basic data for the construction of the knowledge graph.
[0165] The method for performing risk assessment in combination with the city gas pipeline-risk source knowledge graph described in step 3 includes:
[0166] Step 3.1 Obtain the current operating status data and operating trend data of the city gas pipeline, obtain the geographical information of the pipeline and its surroundings, such as topography, building distribution, etc., and analyze the impact of these factors on pipeline safety and emergency response. At the same time, collect meteorological data, such as temperature, humidity, wind speed, etc., because extreme weather conditions may cause or aggravate gas pipeline accidents.
[0167] Step 3.2 substitutes the data obtained in step 3.1 into the city gas pipeline-risk source knowledge graph obtained in step 1, and obtains the possibility of an accident occurring in the city gas pipeline based on formula eight.
[0168]
[0169] Among them, f(x) is the prediction function, k is the category, T k is the set of trees belonging to category k, and I is the indicator function. This method is an ensemble learning algorithm based on decision trees, which can effectively predict complex nonlinear relationships and has good generalization ability.
[0170] Step 3.3 When the probability of an accident in a city gas pipeline exceeds the preset risk threshold, the location of the accident in the city gas pipeline is output, and the type and probability of the possible accident are marked at the corresponding location of the city gas pipeline digital model obtained in step 2.
[0171] Use formula 9 to set the risk threshold:
[0172]
[0173] Among them, P(A|B) is the probability of A when B is known, P(B|A) is the probability of B when A is known, P(A) is the probability of A, and P(B) is the probability of B.
[0174] This method can analyze uncertainty and determine the best decision. Through this method, a risk threshold is set. When the risk index exceeds the threshold, an early warning message is issued in time to remind relevant departments to take preventive measures, such as strengthening pipeline inspections and adjusting operating parameters.
[0175] Example 8
[0176] Based on the urban gas pipeline risk assessment method based on the knowledge graph of Example 1, the method for risk assessment in combination with the urban gas pipeline-risk source knowledge graph described in step 3 also includes: when a risk warning is triggered or an accident occurs, the association relationship of the urban gas pipeline-risk source knowledge graph is used to perform risk tracing analysis through Formula 10.
[0177] MATCH path = (start)-[*]->(end)RETURN path Formula 10
[0178] Among them, path is the traversal path, start is the starting node, and end is the ending node.
[0179] This method can quickly trace the causes of risks through risk tracing analysis, conduct comprehensive analysis from multiple aspects such as the pipeline itself (such as pipe quality, construction defects), external factors (such as third-party construction damage, natural disasters), and operation management (such as inadequate maintenance, operational errors), determine the source of risk, and further improve the knowledge graph.
[0180] Example 9
[0181] The urban gas pipeline risk assessment method based on the knowledge graph based on Example 1 also includes:
[0182] Step 4: Form emergency response and decision support based on the possible accidents and types or the types of accidents that are happening. Including:
[0183] Step 4.1 Accident scenario analysis:
[0184] According to the pipeline information of the accident site, the surrounding geographical environment information and the accident type, the accident scenario model is constructed to simulate the accident development process and predict possible accident consequences, such as the gas diffusion range, explosion impact area, etc. Combined with the historical accident case library, the successful emergency response experience and failure lessons in similar accident scenarios are analyzed to provide reference for emergency decision-making of current accidents.
[0185] Step 4.2 Emergency plan development:
[0186] According to the accident scene analysis results and emergency resource information, an emergency response plan is formed based on the corresponding accident processing information in the urban gas pipeline-risk source knowledge map, including emergency rescue process (such as plugging leaks first or evacuating residents first), resource allocation plan (such as which equipment and personnel to deploy to the scene) and personnel evacuation route planning. The plan is optimized and evaluated, the best plan is selected, and the plan is dynamically adjusted and improved according to the actual situation during the emergency response process.
[0187] Step 4.3 Regulatory standards compliance check:
[0188] Based on the regulatory standards knowledge in the urban gas pipeline-risk source knowledge graph, check whether the emergency response measures obtained in step 4.2 comply with the relevant laws, regulations and standards. This method can check whether the emergency response measures comply with the relevant laws, regulations and standards, ensure the legality and standardization of emergency actions, and avoid the expansion of accidents or legal liabilities due to illegal operations. At the same time, it provides regulatory standards consulting services to answer regulatory standards issues encountered by emergency management personnel in the emergency response process, and ensure the scientificity and correctness of emergency decision-making.
[0189] Step 4.4 Dynamic monitoring of resources:
[0190] Based on the key location information in the digital model of the city gas pipeline, the distribution, quantity, status and use of emergency resources are obtained, including the location and availability of rescue equipment, the standby status and skills of rescue personnel, and the storage and consumption of emergency materials. A dynamic resource update mechanism is established to timely reflect the allocation and use of resources and ensure the accuracy and timeliness of resource information.
[0191] Step 4.5 Intelligent resource allocation:
[0192] According to the type, severity and on-site needs of the accident, determine the type and quantity of emergency resources required based on the handling information of the corresponding accident in the urban gas pipeline-risk source knowledge map, and formulate a resource allocation plan in combination with the resource dynamic monitoring results of step 4.4. Combined with the distribution and availability information of resources, optimize the resource combination and improve the efficiency of emergency rescue. For example, in a fire accident, fire trucks, fire extinguishing equipment and firefighters are deployed at the same time to ensure the effective implementation of firefighting work.
[0193] Step 4.6 Resource supplement and optimization:
[0194] After the emergency response is completed, according to the resource usage and loss, the resource replenishment needs are analyzed, a replenishment plan is formulated, the consumed emergency materials are replenished in time, and the damaged rescue equipment is repaired or replaced to ensure the sustainability of emergency resources. Based on the knowledge graph, the emergency resource management is optimized and analyzed, the rationality and effectiveness of resource allocation are evaluated, the resource reserve structure and distribution strategy are adjusted, and the resource management level is improved.
[0195] Step 4.7 Accident simulation and training:
[0196] Construct accident simulation scenarios, conduct emergency drills and training, and evaluate and improve training results.
[0197] Specifically include:
[0198] 1. Accident simulation scenario construction: Use information such as pipeline facilities, environmental factors, and accident types in the knowledge graph to construct a variety of accident simulation scenarios. The simulation scenarios include different types of gas pipeline accidents (such as single leaks, multiple leaks, explosions and fires, etc.) and accidents under different environmental conditions (such as pipeline accidents in mountainous areas and pipeline accidents in urban bustling areas). Set the parameters of the simulation scenario, such as the location, time, and severity of the accident, to provide emergency personnel with a realistic simulation exercise environment.
[0199] 2. Emergency drills and training: Organize emergency personnel to conduct emergency drills in simulated scenarios, including accident response, emergency rescue, personnel evacuation, medical rescue and other links. During the drill, use the knowledge graph to provide decision support and information query services to simulate the information acquisition and decision-making in the real emergency response process. Through data recording and analysis during the drill, use the knowledge graph to evaluate the operating skills, decision-making ability and teamwork level of emergency personnel. Provide personalized training and improvement suggestions for problems found in the drill to improve the comprehensive quality of emergency personnel.
[0200] 3. Training effect evaluation and improvement: Establish a training effect evaluation indicator system, and conduct a quantitative evaluation of the training effect of emergency personnel based on the emergency knowledge and drill data in the knowledge graph. The evaluation indicators include emergency response time, decision-making accuracy, resource coordination rationality, etc. According to the evaluation results, use the knowledge graph to analyze the weak links in the training process, improve the training content and methods in a targeted manner, continuously optimize the training plan, and improve the ability of emergency personnel to respond to actual accidents.
[0201] Based on the above ideal embodiments of the present invention, the relevant staff can make various changes and modifications without departing from the technical concept of the present invention through the above description. The technical scope of the present invention is not limited to the contents of the specification, and its technical scope must be determined according to the scope of the claims.
Claims
1. A city gas pipeline risk assessment method based on knowledge graph, characterized in that: The steps include: Step 1: Collect historical information on gas pipeline accidents, including detailed information on the cause, type, and consequences of the accident, and collect images, videos, and text reports of the accident scene. After identifying and extracting the required information, perform multimodal fusion to obtain a comprehensive feature vector and establish a knowledge graph of urban gas pipeline-risk sources. Step 2: construct a digital model of the city gas pipeline; Step 3 collects information related to the operation status of the city gas pipeline in real time and inputs it into the city gas pipeline-risk source knowledge graph for risk assessment; for risk points that may pose risks, annotates them on the city gas pipeline digital model and / or generates alarm information.
2. The urban gas pipeline risk assessment method based on knowledge graph according to claim 1 is characterized in that: The method of identifying and extracting the required information in step 1 includes: (1) Using a target detection algorithm for image recognition, the target detection algorithm includes a loss function shown in Formula 1: Among them, loss is the total loss, S is the number of grids, B is the number of anchor boxes for each grid, classes is the number of categories, i is the grid index, j is the anchor box index, and c is the category index. The probability that the jth anchor box of the i-th grid belongs to the c-th category is predicted by the model. is the probability that the jth anchor box in the i-th grid belongs to the c-th category, λ coord is the weight of the position loss, is the x-coordinate of the j-th anchor box of the i-th grid predicted by the model, is the x-coordinate of the j-th anchor box of the i-th grid, w and h are the width and height, is the indicator of whether the jth anchor box of the true i-th grid has an object, is the probability of whether there is an object in the jth anchor box of the i-th grid predicted by the model, The probability of whether the jth anchor box of the i-th grid predicts the presence of background; (2) A model with self-attention mechanism as the core is used for named entity recognition: Among them, Attention is the self-attention mechanism, Q is the query, K is the key, V is the value, and d k is the dimension of the key, and softmax is the soft maximum function; (3) Using a sequence labeling model based on a probabilistic graphical model to identify entities and relations in a text sequence, the conditional probability formula of the sequence labeling model based on a probabilistic graphical model is as follows: Among them, p(y|x) is the conditional probability of sequence y given input y, n is the sequence length, m is the number of feature functions, and y i is the i-th label in the sequence, y i-1 is the i-1th label in the sequence, x i is the i-th input in the sequence, x i-1 is the i-1th input in the sequence, y j is the jth characteristic function, λ j is the weight of the jth feature function, and Y is the label set.
3. The urban gas pipeline risk assessment method based on knowledge graph according to claim 1 is characterized in that: The multimodal fusion described in step 1 is: using formula 4 to splice the feature vectors of different modal data to form a comprehensive feature vector; F=[F v ,F t ,F s ] Formula 4 Among them, F is the comprehensive feature vector, F v is the visual feature vector, F t is the text feature vector, F s is the sensor feature vector.
4. The urban gas pipeline risk assessment method based on knowledge graph according to claim 1 is characterized in that: The method for establishing the city gas pipeline-risk source knowledge graph described in step 1 includes: Step 1.1 defines key classes, and establishes relationships and attributes between key classes, wherein the relationships and attributes include: connection relationships, monitoring relationships, cause relationships, and response relationships; Step 1.2: Use machine learning and natural language processing technology to extract entities, relationships, and attributes from historical information of gas pipeline accidents, images, videos, and text reports of accident sites, and construct a knowledge graph; Step 1.3 uses a high-performance graph database to store the knowledge graph, and adopts the B+ tree index mechanism to achieve fast query and analysis.
5. The urban gas pipeline risk assessment method based on knowledge graph according to claim 4 is characterized in that: Step 1.2 specifically includes: Step 1.2.1 Knowledge extraction: Use machine learning and natural language processing techniques to extract entities, relationships, and attributes from structured, semi-structured, and unstructured data; Use formula 5 to perform rule matching and identify specific patterns in the text: match = re.match(pattern,text) Formula 5 Among them, match is the matching result, pattern is the regular expression pattern, and text is the text to be matched; Step 1.2.2 Knowledge fusion: (1) Entity alignment: Use Formula 6 to perform entity alignment, calculate the similarity between two strings, and determine whether they point to the same entity: similarity=sim(string1,string2) Formula 6 Among them, similarity is the similarity between two strings, string1 and string2 are the strings to be compared; (2) Relationship merging: The confidence ranking is used to merge relationships using Formula 7. Relationships are sorted according to their confidence, and relationships with high confidence are preferentially selected for merging: merged_relations=sort(relations,confidence) Formula 7 Among them, merged_relations is the merged relationship set, relations is the original relationship set, and confidence is the confidence of the relationship; Step 1.2.3 integrates the knowledge fusion results to obtain the knowledge graph.
6. The urban gas pipeline risk assessment method based on knowledge graph according to claim 1 is characterized in that: The method for constructing a digital model of a city gas pipeline in step 2 includes: Step 2.1 uses image recognition technology to identify the city gas pipeline route map, extract the route location, category, key location information, and extract the text information of the route; the key locations include: valve location, pressure regulating station, historical accident location, and emergency resource storage point; Step 2.2: Acquire geographic information corresponding to the city gas pipeline route map by combining the geographic information system; Step 2.3 integrates the line location, category, key location information, text information, and geographic information into a digital model of the city gas pipeline.
7. The urban gas pipeline risk assessment method based on knowledge graph according to claim 1 is characterized in that: The real-time collection of the city gas pipeline operation status information described in step 3 includes: obtaining real-time pressure, flow, temperature data and historical operation data from the gas pipeline monitoring system, analyzing the current operation status data of the city gas pipeline, and combining the linear equation fitted by the least squares method to obtain the operation trend data of the city gas pipeline.
8. The urban gas pipeline risk assessment method based on knowledge graph according to claim 1 is characterized in that: The method for risk assessment in combination with the city gas pipeline-risk source knowledge graph described in step 3 includes: Step 3.1 Obtain the current operating status data and operating trend data of the city gas pipeline, and obtain the geographic data and real-time meteorological data of the pipeline and its surrounding areas; Step 3.2: Substitute the data obtained in step 3.1 into the city gas pipeline-risk source knowledge graph obtained in step 1, and obtain the possibility of an accident occurring in the city gas pipeline based on formula 8; Among them, f(x) is the prediction function, k is the category, T k is the set of trees belonging to category k, I is the indicator function; Step 3.3: When the probability of an accident in a city gas pipeline exceeds a preset risk threshold, the location of the accident in the city gas pipeline is output, and the type and probability of the possible accident are marked at the corresponding location of the city gas pipeline digital model obtained in step 2; wherein: Use formula 9 to set the risk threshold: Among them, P(B|A) is the probability of A when B is known, P(B|A) is the probability of B when A is known, P(A) is the probability of A, and P(B) is the probability of B.
9. The urban gas pipeline risk assessment method based on knowledge graph according to claim 1 is characterized in that: The method for risk assessment in combination with the city gas pipeline-risk source knowledge graph described in step 3 further includes: when a risk warning is triggered or an accident occurs, using the association relationship of the city gas pipeline-risk source knowledge graph, risk tracing analysis is performed through formula 10; MATCH path = (start)-[*]->(end)RETURN path Formula 10 Among them, path is the traversal path, start is the starting node, and end is the ending node.
10. The urban gas pipeline risk assessment method based on knowledge graph according to claim 1 is characterized in that: Also includes: Step 4: Form emergency response and decision support based on the possible accidents and types or the types of accidents that are occurring; including: Step 4.1 Accident scenario analysis: Construct an accident scenario model based on the pipeline information of the accident site, the surrounding geographical environment information and the accident type, simulate the accident development process and predict possible accident consequences; Step 4.2 Emergency plan development: According to the accident scenario analysis results and emergency resource information, an emergency response plan is formed based on the corresponding accident processing information in the urban gas pipeline-risk source knowledge graph, including emergency rescue process, resource allocation plan and personnel evacuation route planning; Step 4.3 Regulatory standards compliance check: Based on the regulatory standards knowledge in the urban gas pipeline-risk source knowledge graph, check whether the emergency response measures obtained in step 4.2 comply with relevant laws, regulations and standards; Step 4.4 Dynamic monitoring of resources: Based on the key location information in the digital model of the city gas pipeline, the distribution, quantity, status and usage of emergency resources are obtained, including the location and availability of rescue equipment, the standby status and skills of rescue personnel, and the storage and consumption of emergency materials; Step 4.5 Intelligent resource allocation: According to the accident type, severity and on-site needs, determine the type and quantity of emergency resources required based on the corresponding accident processing information in the city gas pipeline-risk source knowledge map, and formulate a resource allocation plan in combination with the resource dynamic monitoring results of step 4.4; Step 4.6 Resource supplement and optimization: After the emergency response is completed, analyze the resource replenishment needs and formulate a replenishment plan based on the resource usage and loss, replenish the consumed emergency materials in a timely manner, repair or replace the damaged rescue equipment, and ensure the sustainability of emergency resources; Step 4.7 Accident simulation and training: Construct accident simulation scenarios, conduct emergency drills and training, and evaluate and improve training results.
Citation Information
Cited By
Image monitoring-based ferry in-cabin inspection system and abnormity positioning method
CN120496002A
Method and system for evaluating service life of key accessory of gas appliance
CN120688266A
A method and system for evaluating the life of a key fitting of a gas appliance
CN120688266B
Urban lifeline gas pipeline flood emergency prevention and control system and method based on large model
CN120907083A
Automatic data operation and maintenance management method and system for gas management
CN121501886A