Comprehensive pipe gallery hidden danger risk prediction method based on knowledge graph
By combining knowledge graphs and generative language models in comprehensive pipeline risk prediction, and using historical dynamic monitoring data to train the model, the problems of high subjectivity and poor real-time performance in risk prediction in the existing technology are solved, and fast and accurate risk prediction is achieved.
Patent Information
- Application Number
- CN202410764449.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-06-14
AI Technical Summary
The existing technology relies on manual comparison of text standard files in comprehensive pipeline risk prediction, which cannot effectively utilize dynamic monitoring data. Moreover, the knowledge graph-based method cannot utilize historical data in the time dimension, resulting in highly subjective risk prediction and poor real-time performance. Low efficiency.
A comprehensive pipe corridor hidden danger risk prediction method based on knowledge graph is adopted. The entity recommendation network and response generation network are combined with a generative language model. Historical dynamic monitoring data is used to train the model to generate probability rankings of risk components and predict risk types quickly and accurately.
It improves the accuracy and real-time nature of risk prediction, can effectively utilize historical data, reduce manual intervention, and improves the processing speed and real-time nature of prediction.
Smart Images

Figure CN118656674A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of pipeline corridor hidden danger risk prediction, and in particular to a comprehensive pipeline corridor hidden danger risk prediction method based on knowledge graph. Background Art
[0002] During the operation of underground utility corridors, pipeline aging, leakage, and corridor settlement and deformation are prone to occur, leading to serious operational and economic consequences. Identifying and predicting hidden risks can provide a decision-making basis for operation and maintenance risk management and effectively reduce the probability of risk occurrence. Building operation and maintenance risk prediction mainly refers to the process of predicting safety hazards of utility corridors based on dynamic monitoring data combined with relevant standards. The existing methods still have the following problems:
[0003] 1. The risk prediction of traditional integrated pipe corridors relies on text standard documents. The comparison of collected monitoring data with standards relies on manual work, and the risk conclusions obtained are highly subjective, and the dynamic changes of monitoring data cannot be effectively utilized;
[0004] 2. The dynamic risk assessment method based on knowledge graph requires the construction of a complex knowledge graph. The conclusion of risk prediction is generated through a fixed template query statement, and it is impossible to make reasonable decisions by utilizing the fluctuation of historical monitoring data in the time dimension.
[0005] 3. The number of nodes in the knowledge graph of the integrated pipeline corridor is huge, and the database execution efficiency of using conditional statements to query risk ranking is very low, resulting in expensive time expenditure and low real-time prediction. Summary of the invention
[0006] The present invention aims to at least solve the technical problems existing in the prior art, and in particular innovatively proposes a method for predicting hidden dangers in an integrated pipeline corridor based on a knowledge graph.
[0007] In order to achieve the above-mentioned object of the present invention, the present invention provides a method for predicting hidden danger risks of an integrated pipe gallery based on a knowledge graph, which is characterized by comprising the following steps:
[0008] S1, obtaining an abnormal monitoring data type sequence, wherein the abnormal monitoring data type sequence includes a plurality of type tags;
[0009] S2, input the anomaly monitoring data type sequence into the entity recommendation network and the response generation network to predict the probability ranking of risk components;
[0010] S3, perform weighted summation of the risk component probabilities obtained by the entity generation network and the response generation network to obtain the final risk component probability, and finally determine the risk: select the risk component with a risk component probability higher than the set threshold or select the risk component with the highest ranking, and finally obtain the hidden risk type of the integrated pipeline corridor corresponding to the risk component.
[0011] Further, obtaining the risk component probability through the entity recommendation network includes the following steps:
[0012] S2-1, apply the graph convolutional network RGCN to encode the entire knowledge graph and obtain the embedded representation of each knowledge graph entity node;
[0013] S2-2, exhaustively match each type label in the monitoring data category sequence with the name of each entity in the knowledge graph to identify K entities in the monitoring data category sequence;
[0014] S2-3, for the embedding of K entities in the monitoring data category sequence, an attention mechanism is used to obtain an attention vector, and the attention vector is multiplied by the corresponding entity embedding matrix in the monitoring data category sequence, so as to obtain a condensed representation of the entity appearing in the monitoring data category sequence;
[0015] S-4, matching the condensed representation of the entity appearing in the monitoring data category sequence of step S2-3 with the embedded representation of each knowledge graph entity node of step S2-1 to obtain the probability of the component entity.
[0016] Furthermore, the attention mechanism is used to obtain the attention vector, which is obtained in the following way:
[0017]
[0018] Among them, SoftMax() is the SoftMax activation function;
[0019] Indicates H E The transpose of H E The entity embedding matrix representing K entities;
[0020] W K and W q is a learnable parameter;
[0021] Thus, we get the entity condensed representation C that appears in the monitoring data category sequence E :
[0022] C E =αH E .
[0023] Further, obtaining the risk component probability through the response generation network includes the following steps:
[0024] S201, using a Transformer encoder to encode the abnormal monitoring data type sequence word by word to obtain an output of the encoder;
[0025] S202, then use the Transformer decoder to decode: concatenate the output of the encoder with the condensed representation of the entity generated by the entity recommendation network, pass the concatenation result through two fully connected layers, and then pass it through the softmax function to obtain the probability distribution of the components at the context level;
[0026] P res =SoftMax(W v W a [s j :C E ])
[0027] Among them, P res Represents the probability distribution of the entire vocabulary, including the probability distribution of all components;
[0028] W v is the word embedding matrix shared with the encoder;
[0029] W a is a trainable linear projection;
[0030] [s j :C E ] indicates the decoder status, that is, s j With C E Concatenate (concatenate); train the network using cross entropy at each decoder time step.
[0031] s j represents the output of the encoder;
[0032] C E A condensed representation of entities that appear in a sequence of risk categories.
[0033] Furthermore, the method further includes: obtaining the final risk component probability through the entity package loss:
[0034] First, for each time step of the decoder of the response generation network, we calculate the scores r for all M entities in the knowledge graph j :
[0035] r j =HW b [s j :C E ]+b ent
[0036] Among them, r j represents the score matrix of all M entities at decoding time step j;
[0037] H represents the embedding of all knowledge graph entities generated by RGCN;
[0038] Wb is a trainable matrix for dimension alignment and bias;
[0039] b ent Indicates bias;
[0040] Then, it is determined whether the predicted component entity m has a first-order neighbor. If so, it has a label 0; if not, it has a label 1. The cross entropy loss function is used to calculate the difference between the label value and the score value, thereby updating the score r. j ;
[0041] Get the probability of component entity m being predicted in the response generation network:
[0042]
[0043] Where, L is the response length;
[0044] r jm Yes j The mth component of ;
[0045] m is an entity among M component entities, and M is the number of all entities;
[0046] sigmoid() is the sigmoid function;
[0047] Finally, we get the risk component probability distribution P of the response generation network: all :
[0048] P all =P res +λ3P BOE
[0049] Where λ3 is a hyperparameter.
[0050] Furthermore, after obtaining the output of the encoder, before the decoder, word and entity embedding alignment is performed:
[0051] s=W v[E] W c C E +b align
[0052] Among them, W v[E] Only select W v The matrix obtained by the rows corresponding to the entity tags in ;
[0053] W c is a trainable matrix;
[0054] b align is bias;
[0055] s stands for C E Follow Wc The similarity score of each word;
[0056] Alignment loss L align It is expressed as:
[0057] L align =||sq|| 2
[0058] Where q represents the indicator vector;
[0059] ||.|| represents the norm.
[0060] Furthermore, the objective function of the response generation network is:
[0061] L total =L gen +λ1L BOE +λ2L align
[0062] Among them, L gen In response to network loss;
[0063] L BOE is the first-order neighbor loss;
[0064] L align is the alignment loss;
[0065] λ1 and λ2 are two hyperparameters.
[0066] In summary, due to the adoption of the above technical solutions, the present invention proposes to apply the comprehensive pipeline corridor operation and maintenance risk knowledge map, combine with the generative model, use the historical dynamic monitoring data training, and infer and generate risk analysis conclusions based on the input dynamic monitoring data to obtain the top-ranked hidden danger risks. The method of the present invention can quickly and accurately predict the risk type of pipeline corridor operation and maintenance risks, thereby providing operation and maintenance decision support based on risk information.
[0067] Compared with the existing methods, the present invention has the following advantages and improvements:
[0068] 1. Model the risk prediction based on dynamic data as a sequence generation process, use generative language model training, effectively utilize historical prediction data, and fully capture the potential relationship between the changing characteristics of dynamic data and hidden risks;
[0069] 2. Using knowledge graph embedding instead of knowledge graph query overcomes the defects of rigid templates based on database operations and reliance on manual experience, and uses training data to fit the best risk prediction logic, thereby improving the accuracy of risk prediction;
[0070] 3. Combining knowledge graph with lightweight model reasoning further improves the processing speed and real-time performance of risk prediction.
[0071] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0073] Figure 1 It is a schematic diagram of the overall construction process of the present invention.
[0074] Figure 2 It is a framework diagram of the risk prediction method for hidden dangers in an integrated pipeline corridor based on the knowledge graph of the present invention.
[0075] Figure 3 It is an example diagram of the risk component entity of the present invention.
[0076] Figure 4 It is an example diagram of the risk classification entity of the present invention.
[0077] Figure 5 It is a schematic diagram of the application of the model of the present invention. DETAILED DESCRIPTION
[0078] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0079] The risk prediction of the integrated pipeline corridor is defined as: inputting the abnormal data category of the dynamic risk monitoring of the specified components, and outputting the ranking of the components involved in the risk.
[0080] In the present invention, the overall process of constructing the comprehensive pipeline corridor risk prediction method based on the knowledge graph is as follows: Figure 1 As shown in the figure: First, the historical sensor data is summarized and sorted, and the data is marked after expert evaluation to form a risk monitoring data set. In terms of the knowledge graph of the operation and maintenance of the integrated pipe corridor, entity classification and entity extraction are carried out according to relevant laws and regulations, expert knowledge, and historical sensor data, and basic triples (including nodes and attribute data, and relationships) are abstracted. The risk monitoring data set is combined with the knowledge graph of the operation and maintenance of the integrated pipe corridor to train the model, and finally a risk prediction method for hidden dangers in the integrated pipe corridor based on the knowledge graph is obtained.
[0081] A knowledge graph-based risk prediction method framework for comprehensive pipeline corridor hazards Figure 2 As shown in Figure 1, the risk prediction task is defined as: using the entity recommendation network f(X,G) and the response generation network g(X,G,f(X,G)) to predict the probability ranking of risk components. The overall goal of the risk prediction of the integrated pipeline corridor is to predict the relevant component entities with potential risks based on the risk entity category information of the real-time monitoring data and the integrated pipeline corridor operation and maintenance knowledge graph. The specific steps are: Represent the input abnormal monitoring data type sequence as a sequence of length n: X = <x1,x2,x3…x n >. Input the abnormal monitoring data type sequence into the entity recommendation network and the response generation network to obtain the risk component probability ranking, and then perform weighted summation of the risk component probabilities obtained by the entity generation network and the response generation network to obtain the final risk component probability. Among them, the risk component probability obtained by the entity recommendation network is realized by searching and matching the knowledge graph; the knowledge graph G = <v h ,r,v t >, where the entity set is E and the head entity is the monitoring data category v h ∈E, as Figure 3 The tail entity is the risk component v t ∈E, as Figure 4 As shown in Figure 2, r represents the corresponding relationship set. The risk component probability obtained by the response generation network is encoded and decoded through the Transformer encoder and decoder architecture.
[0082] (1) Entity Recommendation Network: First, we apply the graph convolutional network RGCN to encode the entire knowledge graph and obtain the embedding of each knowledge graph entity node. Next, each word in the risk category sequence X is exhaustively matched with the name of each entity in the knowledge graph. In this way, we identify K entities from the risk category sequence and sort them according to their original positions, thereby obtaining the D-dimensional entity embedding matrix H of the K entities. E ∈R K ×D .
[0083] Then, we apply the attention mechanism to obtain the attention vector α, where the attention mechanism is constructed through two fully connected layers (FC):
[0084]
[0085] C E =αH E
[0086] Among them, SoftMax() is the SoftMax activation function;
[0087] Indicates HE The transpose of H E The entity embedding matrix representing K entities;
[0088] In the formula, W K and W q are learnable parameters.
[0089] The resulting C E ∈R D is a condensed representation of the entities that appear in the sequence of risk categories.
[0090] At this time, C E Each word (risk component) in is exhaustively matched with the name of each entity in the knowledge graph to achieve classification, thereby obtaining the probability P of risk component i being recommended rec (i), and in addition, softmax is used to map the probability of risk component i being recommended to 0~1:
[0091]
[0092] Among them, e i Represents the entity embedding of risk component i;
[0093] P rec (i) represents the probability that risk component i is recommended;
[0094] Represents C E The transpose of C E A condensed representation of entities that appear in a sequence of risk categories;
[0095] ∝ means proportional to, that is, P rec (i) with It is a K-fold relationship, where K is a positive integer.
[0096] In addition, the entity recommendation network is trained using cross entropy loss.
[0097] (2) Response Generation Network: The response generation network predicts the risk component based on the risk category sequence. The entire risk category sequence is encoded using the classic Transformer encoder and decoder architecture. The encoder encodes the entire sequence input word by word. At decoding time step j, the output s of the Transformer encoder is j Condensed representation of entity C E Cascade, then pass the cascade result through two fully connected layers in sequence, and then use the softmax function to calculate.
[0098] Therefore, the component prediction probability distribution corresponding to the response generation network is obtained:
[0099] Pres =SoftMax(W v W a [s j :C E ])
[0100] In the formula, P res represents the probability distribution of the entire vocabulary, i.e. the overall component vocabulary; where the mth probability is a component of the word list probability;
[0101] W v is the word embedding matrix shared with the encoder;
[0102] W a is a trainable linear projection.
[0103] [s j :C E ] indicates the decoder status, that is, s j With C E Concatenate (concatenate); train the network using cross entropy at each decoder time step.
[0104] s j represents the output of the encoder;
[0105] C E A condensed representation of entities that appear in a sequence of risk categories.
[0106] (3) Bag-of-Entity Loss: Although the response generation network trained with cross entropy at each step is able to predict risky components, the risk entity concepts associated with the components are rarely mentioned. To this end, the Bag-of-Entity loss (BOE) is introduced, which forces the decoder state to include additional information about the first-order neighbors of the real connection on the associated knowledge graph. Since there is no exact constraint on the scope of the component entities in the prediction of the response generation network, the word-level scores are aggregated.
[0107] The loss of a physical packet causes the decoder state [s j :C E ] contains additional information about the first-order neighbors of the real recommendations on the knowledge graph. The specific process is as follows:
[0108] First, for each time step of the decoder of the response generation network, we calculate the scores r for all M entities in the knowledge graph j , r j ∈R M :
[0109] r j =HW b [s j :C E ]+bent
[0110] Among them, r j represents the score matrix of all M entities at decoding time step j;
[0111] H represents the embedding of all knowledge graph entities generated by RGCN;
[0112] W b is a trainable matrix for dimension alignment and bias;
[0113] b ent Indicates bias;
[0114] Then, determine whether entity m has a first-order neighbor. If so, it has label 0. If not, it has label 1. And update the score r according to labels 0 and 1. j For example, if the true label is 0 and the predicted value (score) is 0.731, the loss function will calculate the difference between the predicted value and 0, thereby obtaining a loss value. This loss value indicates the difference between the model's current prediction and the actual situation. The model will adjust the parameters based on this loss value so that the next prediction value is closer to 0, thereby reducing the loss value. The loss function is the cross entropy loss.
[0115] Since there is no exact constraint on which word in the generation should contain information, we aggregate the word-level scores into a component-wise sigmoid function, the probability of entity m being predicted in the response generation network:
[0116]
[0117] Where L is the response length;
[0118] r jm Yes j The mth component of ;
[0119] m is an entity among M component entities, and M is the number of all entities;
[0120] Thus, the probability distribution P of the risk component of the response generation network at time step j is obtained all as follows:
[0121] P all =P res +λ3P BOE
[0122] Where λ3 is a hyperparameter.
[0123] (4) Word and entity embedding alignment: The entity recommendation network and the response generation network apply two types of token embeddings. The first type corresponds to the words that appear in the risk category sequence, and the second type represents the entities that appear in the knowledge graph. In order to link the RGCN encoding of the knowledge graph with the Transformer encoding, an alignment loss strategy is applied here:
[0124] s=W v[E] W c C E +b align
[0125] Among them, W v[E] Only select W v The matrix obtained by the rows corresponding to the entity tags in ;
[0126] W c is a trainable matrix;
[0127] b align is bias;
[0128] s stands for C E Follow W c The similarity score of each word;
[0129] Alignment loss L align is s and an indicator vector q∈{0,1} |E| The mean square error between: (E represents the entities that appear in the risk category sequence. If there are four E, s has four similarity scores, and the dimension of q is 4. If the risk category sequence can correspond to the entity in the knowledge graph, then the component is 1, otherwise it is 0. The significance of this is that if the words in the risk category sequence cannot find the entity on the knowledge graph, the loss value needs to be increased.)
[0130] L align =||sq|| 2
[0131] Specifically, if there is an entity e in the sequence (entity e indicates that the risk category sequence can correspond to an entity in the knowledge graph), the component corresponding to q is set to 1. Otherwise, the component is 0. Finally, in order to learn the parameters of the response generation network, we minimize the following objective function:
[0132] L total =L gen +λ1L BOE +λ2L align
[0133] Among them, L gen In response to network loss;
[0134] LBOE is the first-order neighbor loss;
[0135] L align is the alignment loss;
[0136] λ1 and λ2 are two hyperparameters.
[0137] The schematic diagram of the application of the model of the present invention is as follows Figure 5 First, input the sample: <poor ventilation, cracks, abnormal humidity, poor drainage, electromagnetic interference>, and then the comprehensive pipeline corridor hidden danger risk prediction model based on the knowledge graph; finally, the predicted risk probability is obtained: drainage system risk 0.9, gas pipeline risk 0.7.
[0138] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
Claims
1. A risk prediction method for comprehensive pipeline corridor hazards based on knowledge graph, It is characterized in that The following steps are involved: S1, obtaining an abnormal monitoring data type sequence, wherein the abnormal monitoring data type sequence includes a plurality of type tags; S2, input the anomaly monitoring data type sequence into the entity recommendation network and the response generation network to predict the probability ranking of risk components; S3, perform weighted summation of the risk component probabilities obtained by the entity generation network and the response generation network to obtain the final risk component probability, select the risk component with a risk component probability higher than the set threshold or select the risk component with the highest ranking, and finally obtain the hidden risk type of the comprehensive pipeline corridor corresponding to the risk component.
2. According to the method for predicting hidden dangers of integrated pipe gallery based on knowledge graph according to claim 1, It is characterized in that Obtaining the risk component probability through the entity recommendation network includes the following steps: S2-1, apply the graph convolutional network RGCN to encode the entire knowledge graph and obtain the embedded representation of each knowledge graph entity node; S2-2, exhaustively match each type label in the monitoring data category sequence with the name of each entity in the knowledge graph to identify K entities in the monitoring data category sequence; S2-3, for the embedding of K entities in the monitoring data category sequence, an attention mechanism is used to obtain an attention vector, and the attention vector is multiplied by the corresponding entity embedding matrix in the monitoring data category sequence, so as to obtain a condensed representation of the entity appearing in the monitoring data category sequence; S-4, matching the condensed representation of the entity appearing in the monitoring data category sequence of step S2-3 with the embedded representation of each knowledge graph entity node of step S2-1 to obtain the probability of the component entity.
3. According to the method for predicting hidden dangers of integrated pipe gallery based on knowledge graph according to claim 1, It is characterized in that The attention mechanism is used to obtain the attention vector, which is obtained in the following way: Among them, SoftMax() is the SoftMax activation function; Indicates H E The transpose of H E The entity embedding matrix representing K entities; W K and W q is a learnable parameter; Thus, we get the entity condensed representation C that appears in the monitoring data category sequence E : C E =αH E 。 4. According to the method for predicting hidden dangers of integrated pipe gallery based on knowledge graph according to claim 1, It is characterized in that The risk component probability is obtained through the response generation network, including the following steps: S201, using a Transformer encoder to encode the abnormal monitoring data type sequence word by word to obtain an output of the encoder; S202, then use the Transformer decoder to decode: concatenate the output of the encoder with the condensed representation of the entity generated by the entity recommendation network, pass the concatenation result through two fully connected layers, and then pass it through the softmax function to obtain the probability distribution of the components at the context level; P res =SoftMax(W v W a [s j :C E ]) Among them, P res Represents the probability distribution of the entire vocabulary, including the probability distribution of all components; W v is the word embedding matrix shared with the encoder; W a is a trainable linear projection; [s j :C E ] indicates the decoder status; s j represents the output of the encoder; C E A condensed representation of entities that appear in a sequence of risk categories.
5. According to the method for predicting hidden dangers of integrated pipe gallery based on knowledge graph according to claim 1, It is characterized in that Also includes: The final risk component probability is obtained through the entity package loss: First, for each time step of the decoder of the response generation network, we calculate the scores r for all M entities in the knowledge graph j : r j =HW b [s j :C E ]+b ent Among them, r j represents the score matrix of all M entities at decoding time step j; H represents the embedding of all knowledge graph entities generated by RGCN; W b is a trainable matrix for dimension alignment and bias; b ent Indicates bias; Then, it is determined whether the predicted component entity m has a first-order neighbor. If so, it has a label 0; if not, it has a label 1. The cross entropy loss function is used to calculate the difference between the label value and the score value, thereby updating the score r. j ; Get the probability of component entity m being predicted in the response generation network: Where, L is the response length; r jm Yes j The mth component of ; m is an entity among M component entities, and M is the number of all entities; sigmoid() is the sigmoid function; Finally, we get the risk component probability distribution P of the response generation network: all : P all =P res +λ 3 P BOE Where λ 3 is a hyperparameter.
6. According to the method for predicting hidden dangers of integrated pipe gallery based on knowledge graph in claim 3, It is characterized in that After getting the output of the encoder, perform word and entity embedding alignment: s=W v[E] W c C E +b align Among them, W v[E] Only select W v The matrix obtained by the rows corresponding to the entity tags in ; W c is a trainable matrix; b align is bias; s stands for C E Follow W c The similarity score of each word; Alignment loss L align It is expressed as: L align =||s-q|| 2 Where q represents the indicator vector; ||.|| represents the norm.
7. According to the method for predicting hidden dangers of integrated pipe gallery based on knowledge graph in claim 1, It is characterized in that The objective function of the response generation network is: L total =L gen +λ 1 L BOE +λ 2 L align Among them, L gen In response to network loss; L BOE is the first-order neighbor loss; L align is the alignment loss; λ 1 and λ 2 are two hyperparameters.
Citation Information
Patent Citations
Comprehensive pipe gallery operation and maintenance dynamic risk evaluation method driven by monitoring data
CN113256160A
Urban underground comprehensive pipe gallery abnormal event early warning method
CN114118202A
Cited By
Progressive knowledge injection pipe gallery early warning system and model construction method
CN120744637A
A progressive knowledge-injected early warning system for utility tunnels and its model construction method
CN120744637B
Operation and maintenance command processing method and device, equipment, storage medium and program product
CN120872679A
