A method and medium for intelligent agent service in power distribution networks based on semantic understanding and knowledge graphs.
By combining semantic understanding models and knowledge graphs in the distribution network intelligent dispatch system, accurate semantic embedding of power industry terms and accurate reasoning of equipment status are achieved, improving the intelligence and accuracy of power grid operation and maintenance decisions and solving the problem of insufficient semantic understanding and knowledge graph adaptation in existing technologies.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NARI TECH CO LTD
- Filing Date
- 2026-01-22
- Publication Date
- 2026-05-26
AI Technical Summary
Existing intelligent dispatch systems for power distribution networks suffer from insufficient semantic understanding and inadequate knowledge graph reasoning when processing natural language commands in the power sector. This results in weak equipment status reasoning capabilities, an inability to accurately identify technical terms and equipment relationships, and an impact on the stable operation of the power grid.
We adopt a semantic understanding and knowledge graph-based approach. Through a semantic understanding model, we transform natural language instructions into word-level representation sequences and aggregate them into sentence-level semantic vectors. These vectors are then mapped to entities and relationships in the power distribution network knowledge graph to perform device status reasoning and generate operation and maintenance decisions. We use a dual-path adaptive word embedding layer, a Transformer encoder, and an attention pooling layer for deep fusion and precise embedding.
It achieves accurate semantic understanding of natural language commands and device status reasoning in the intelligent dispatch system of power distribution network, improves the accuracy and intelligence level of operation and maintenance decision-making, and solves the problem of insufficient semantic understanding and knowledge graph adaptation in existing technologies.
Smart Images

Figure CN122089327A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method and medium for intelligent distribution network operator based on semantic understanding and knowledge graph, belonging to the field of intelligent distribution network operator technology. Background Technology
[0002] With socio-economic development, the importance of electricity as a fundamental energy source is increasingly prominent. As a crucial link directly facing end users, the scale and complexity of the distribution network continue to increase with urbanization, the integration of distributed energy resources, and growing user demand. Equipment types encompass transformers, switches, lines, distributed power sources, and energy storage devices, forming a vast and complex network. The randomness and intermittency of distributed energy resources exacerbate the difficulty of load forecasting, potentially leading to voltage fluctuations and harmonic pollution. Currently, distribution network dispatch centers still rely on human operators to complete core tasks such as voice reporting, instruction transmission, and operation ticket confirmation, serving as a vital support for ensuring stable grid operation. In the field of semantic understanding technology, existing solutions mostly focus on general scenarios like internet search, financial customer service, and social networks, lacking semantic embedding models tailored to the unique terminology, industry standards, and business processes specific to power distribution networks, such as busbars, disconnectors, and feeders. Knowledge graph reasoning mechanisms also have limitations in the power sector, failing to fully adapt to the precise reasoning needs arising from complex logic such as equipment relationships, operating rules, and fault modes.
[0003] Current human operator models have significant shortcomings in handling on-site telephone voice messages: limited by the limitations of human hearing and attention, they are prone to missing or mishearing in situations with large amounts of voice information or noisy environments such as substation equipment noise and construction noise, leading to decreased accuracy in information transmission. For example, unclear fault information may be misrepresented, affecting subsequent processing. General semantic understanding models, not optimized for the professional characteristics of the power industry, struggle to accurately identify the specific meanings of terms such as busbar and disconnector in the power context, resulting in insufficient semantic understanding of natural language commands. Existing knowledge graph reasoning mechanisms do not fully consider the correlation requirements of historical fault records, operating status, and operating procedures of equipment specific to the power industry, resulting in insufficient accuracy and reliability of reasoning results and weak equipment status reasoning capabilities. Furthermore, the lack of effective solutions for deeply integrating semantic understanding with knowledge graphs prevents the realization of deep understanding of natural language, knowledge logic reasoning, and multimodal information fusion in the power distribution network field, hindering the application of artificial intelligence technology in distribution network intelligent operators and the improvement of intelligence levels. Summary of the Invention
[0004] The purpose of this invention is to provide a distribution network intelligent agent method and medium based on semantic understanding and knowledge graph. The method uses a semantic understanding model to convert instructions into sentence-level semantic vectors and map them to entities and relationships in the distribution network knowledge graph. It then performs equipment status reasoning to generate intelligent operation and maintenance decisions, thereby solving the problem of insufficient semantic understanding of natural language instructions in existing distribution network intelligent agents, which leads to insufficient equipment status reasoning capabilities.
[0005] To solve the above-mentioned technical problems, the present invention is implemented using the following technical solution.
[0006] In a first aspect, the present invention provides a method for intelligent distribution network agent based on semantic understanding and knowledge graph, comprising:
[0007] Natural language instructions are obtained and input into a pre-trained semantic understanding model to process the natural language instructions into word-level representation sequences and aggregate them into sentence-level semantic vectors.
[0008] The sentence-level semantic vectors are mapped to corresponding entities or relations in the power distribution network knowledge graph to obtain semantic entity mapping results;
[0009] Based on the distribution network knowledge graph and the semantic entity mapping results, device status reasoning is performed to generate operator maintenance decisions;
[0010] The entity includes at least a device entity, an operation entity, and a status entity;
[0011] The relationships include at least topological relationships, functional relationships, and state relationships.
[0012] Furthermore, the semantic understanding model includes a dual-path adaptive word embedding layer, a Transformer encoder, and an attention pooling layer;
[0013] The dual-path adaptive word embedding layer is used to convert the lexical units in natural language instructions into distribution network domain-aware word embedding vectors.
[0014] The Transformer encoder is used to process the word embedding vectors of the distribution network domain awareness into a word-level representation sequence;
[0015] The attention pooling layer is used to aggregate word-level representation sequences into sentence-level semantic vectors.
[0016] Furthermore, the lexical units in the natural language instructions are transformed into distribution network-aware word embedding vectors, including:
[0017] Obtain the lexical units in the language instructions as a general word embedding vector;
[0018] Calculate the domain word embedding vector of the power distribution network using the domain embedding matrix and indicator function;
[0019] By fusing general word embedding vectors and distribution network domain word embedding vectors with learnable gating vectors, a distribution network domain-aware word embedding vector is obtained.
[0020] The term "distribution network domain word embedding" is represented as follows:
[0021] ;
[0022] In the formula, This represents the embedding vector of domain terms in the power distribution network, which is the domain term. Embedded representation in the field of power distribution networks Represents the domain embedding matrix. Indicates the domain term used for judgment Does it belong to the domain thesaurus? Indicator functions, Domain words of coding, This indicates a conditional statement "if". This indicates "other cases" in a conditional statement.
[0023] The learnable gated vector is represented as:
[0024] ;
[0025] In the formula, This represents a learnable gating vector used to control the general word embedding vector. With distribution network domain word embedding vector The fusion ratio, This represents the Sigmoid activation function. Represents the gate weight matrix. This represents embedding a general word into a vector. With distribution network domain word embedding vector To splice, Indicates the gating bias term;
[0026] The word embedding vector representation of the distribution network domain perception is as follows:
[0027] ;
[0028] In the formula, Represents word embedding vectors for domain-aware distribution networks. This indicates element-wise multiplication.
[0029] Furthermore, the Transformer encoder is composed of stacked coding layers with the same L-layer structure, and each coding layer sequentially includes a multi-head self-attention sub-layer, a feedforward neural network sub-layer, a residual connection, and layer normalization;
[0030] The input and output of the coding layer are respectively represented as follows:
[0031] ;
[0032] ;
[0033] In the formula, Indicates the first The input of the layer coding layer, This represents the input to the first coding layer. Indicates the first The output of the layer coding layer, Indicates the first The output of the layer coding layer, This represents the output after sequentially passing through the multi-head self-attention sub-layer and the feedforward neural network sub-layer. This represents residual connection and layer normalization operations;
[0034] The multi-head self-attention sublayer calculates the output of each attention head through an attention function, expressed as:
[0035] ;
[0036] In the formula, Represents the attention function. The query matrix, obtained from the input sequence of the coding layer through a linear transformation, is used to calculate the correlation with other locations. The key matrix, obtained from the input sequence of the coding layer through a linear transformation, is used for query matching. The value matrix, obtained from the input sequence of the coding layer through a linear transformation, is used for weighted summation to generate the output of each attention head. Indicates the first The dimension of each key vector is used to scale the dot product, preventing the gradient from being too large or too small. This represents the normalized exponential function, which transforms the attention scores into a probability distribution. Indicates transpose;
[0037] The multi-head self-attention sublayer includes The attention heads of parallel computation, where the first... The output of each attention head is represented as:
[0038] ;
[0039] In the formula, Indicates the first The output of each attention head, They represent the first The query matrix, key matrix, and value matrix of each attention head;
[0040] The output of the multi-head self-attention sublayer is obtained by concatenating and linearly projecting the outputs of all attention heads, as follows:
[0041] ;
[0042] In the formula, This represents the output of the multi-head self-attention sublayer. Indicates the first The output of each attention head, This represents the output of the second attention head. Indicates the first The output of each attention head, Represents a learnable linear projection matrix;
[0043] The output of the feedforward neural network sublayer is represented as:
[0044] ;
[0045] In the formula, This represents the output of a sublayer in a feedforward neural network. Represents the activation function of the Gaussian error linear unit. These represent the weight matrix and bias vector of the first linear layer, respectively. These represent the weight matrix and bias vector of the second linear layer, respectively.
[0046] Furthermore, the word-level representation sequence is aggregated into a sentence-level semantic vector based on the attention weight of each word in the word-level representation sequence. The formula for calculating the attention weight of each word in the word-level representation sequence is as follows:
[0047] ;
[0048] In the formula, Word level indicates the first word in the sequence. Attention weight of each word This represents an exponential function used to convert attention scores into positive numbers. Represents the query vector With hyperbolic tangent activation function dot product, This represents a learnable weight matrix used to learn the weights of the first... Word-level representation vectors Perform a linear transformation. This represents a learnable bias vector used for adjustment after linear transformation. Indicates the first Word-level representation vectors of words, The word level indicates the number of words in the sequence.
[0049] Furthermore, the training method for the semantic understanding model includes:
[0050] Acquire text corpus in the power distribution network field;
[0051] Based on the data distribution network domain text corpus, at least three domain adaptive prediction tasks are constructed, including a domain terminology masking language model task, a device relationship prediction task, and a contrastive learning task based on sentence-level semantic vector similarity.
[0052] The semantic understanding model is trained by using the weighted sum of the domain term mask language model task loss, relation prediction task loss, and contrastive learning task loss based on sentence-level semantic vector similarity as the training objective, and a pre-trained semantic understanding model is obtained.
[0053] The weighted sum is represented as:
[0054] ;
[0055] In the formula, Indicates a weighted sum. This represents the loss of the domain terminology mask language model task. These represent the losses from the relation prediction task, respectively. The weighting coefficients and the loss of the contrastive learning task based on sentence-level semantic vector similarity. The weighting coefficients.
[0056] Furthermore, mapping the sentence-level semantic vector to the corresponding entity in the power distribution network knowledge graph includes:
[0057] By performing vector space embedding learning on the knowledge graph, pre-stored vector representations of all entities or relationships in the power distribution network knowledge graph are obtained;
[0058] Calculate the cosine similarity between the sentence-level semantic vector and the pre-stored vector;
[0059] Based on the cosine similarity, the sentence-level semantic vector is mapped to the corresponding entity or relation with the highest similarity in the power distribution network knowledge graph;
[0060] The formula for calculating the cosine similarity is as follows:
[0061] ;
[0062] In the formula, Sentence-level semantic vectors With pre-stored vector , Sentence-level semantic vectors With pre-stored vector The angle between The cosine value, Indicates the modulus length.
[0063] Furthermore, based on the distribution network knowledge graph and the semantic entity mapping results, device status reasoning is performed to generate operator maintenance decisions, including:
[0064] Construct a knowledge query triplet based on the semantic entity mapping result. The set is used to obtain the query representation, where, For connector entity Tail-end entity Relationship;
[0065] Based on the query representation and the vectorized representation of the distribution network knowledge graph, reasoning and searching are performed in the vector space to obtain a set of candidate entities;
[0066] Based on the candidate entity set and its relationship in the distribution network knowledge graph, multi-hop reasoning and evidence aggregation are performed to obtain the risk score result of the equipment status;
[0067] Based on the risk scoring results and preset decision rules, corresponding call center operation and maintenance decisions are generated.
[0068] The distribution network knowledge graph is a directed labeled multi-graph represented by a three-dimensional adjacency tensor. ,in, Represents a finite set of entities. Represents a finite set of relations. Represents all knowledge query triples A set of.
[0069] Furthermore, the three-dimensional adjacency tensor is represented as:
[0070]
[0071] In the formula, | | and | | represent the number of entities and the number of relations, respectively. A tensor element in a three-dimensional adjacency tensor, used to represent the first... The entity and the first Does a relationship exist between these entities? .
[0072] In a second aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the intelligent distribution network agent method based on semantic understanding and knowledge graph as described in the first aspect.
[0073] Compared with the prior art, the beneficial effects achieved by the present invention are as follows:
[0074] 1. This invention processes natural language instructions into word-level representation sequences and aggregates them into sentence-level semantic vectors through a semantic understanding model. These vectors are then mapped to device entities, operation entities, state entities, and topological, functional, and state relationships in the distribution network knowledge graph. This achieves accurate semantic entity mapping. Furthermore, based on the knowledge graph and mapping results, device state reasoning is used to generate operator maintenance decisions. This effectively solves the problems of insufficient semantic understanding of natural language instructions, inaccurate mapping of knowledge graph entities / relationships, and insufficient device state reasoning capabilities in distribution network intelligent operators, significantly improving the accuracy and intelligence level of distribution network operation and maintenance decisions.
[0075] 2. This invention transforms natural language instruction lexical units into distribution network domain-aware word embedding vectors through a dual-path adaptive word embedding layer. These vectors are then processed into word-level representation sequences by a Transformer encoder and aggregated into sentence-level semantic vectors by an attention pooling layer. This achieves accurate semantic embedding of distribution network professional terms such as "bus," "disconnector," and "feeder" in the power context, solving the problem of insufficient understanding of power domain terms by general semantic models.
[0076] 3. This invention calculates cosine similarity based on sentence-level semantic vectors and pre-stored vector representations of equipment entities, operation entities, state entities, topological relationships, functional relationships, and state relationships in the power distribution network knowledge graph. It maps the cosine similarity to the corresponding entity or relationship with the highest similarity and combines the vectorized representation of the three-dimensional adjacency tensor to achieve multi-hop reasoning and evidence aggregation, thus overcoming the shortcomings of existing knowledge graph reasoning mechanisms in adapting to the special characteristics of the power field.
[0077] 4. This invention relies on a semantic understanding model trained and optimized by domain adaptive prediction task, combined with knowledge query triple construction and vector space reasoning, to generate equipment status risk scoring results, and generates operator maintenance decisions according to preset decision rules, realizing full-link intelligence from semantic understanding to equipment status reasoning, breaking through the bottleneck of insufficient combination of semantic understanding and knowledge graph in existing technologies. Attached Figure Description
[0078] Figure 1 This is a flowchart illustrating a method for intelligent distribution network agent based on semantic understanding and knowledge graph provided in an embodiment of the present invention.
[0079] Figure 2 This is a flowchart of the three-level semantic coding process of dual-path embedding-Transformer-attention pooling provided in the embodiments of the present invention;
[0080] Figure 3 This is a flowchart of semantic vector mapping of distribution network knowledge graph based on cosine similarity provided in an embodiment of the present invention;
[0081] Figure 4 This is a flowchart of semantically enhanced distribution network knowledge graph reasoning and decision-making process provided in an embodiment of the present invention. Detailed Implementation
[0082] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solution of the present invention, rather than limitations thereof. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.
[0083] The term "and / or" simply describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0084] Example 1
[0085] like Figure 1 As shown, this embodiment introduces a method for intelligent agent management in power distribution networks based on semantic understanding and knowledge graphs, including:
[0086] Step 1: Obtain natural language instructions, input them into a pre-trained semantic understanding model to process the natural language instructions into word-level representation sequences and aggregate them into sentence-level semantic vectors.
[0087] This invention transforms natural language instruction lexical units into distribution network domain-aware word embedding vectors through a dual-path adaptive word embedding layer. These vectors are then processed into word-level representation sequences by a Transformer encoder and aggregated into sentence-level semantic vectors by an attention pooling layer. This enables accurate semantic embedding of distribution network professional terms such as "bus," "disconnector," and "feeder" in the power context, solving the problem of insufficient understanding of power domain terms by general semantic models and providing high-quality semantic input for subsequent knowledge graph mapping.
[0088] Step 2: Map the sentence-level semantic vectors to the corresponding entities or relations in the power distribution network knowledge graph to obtain the semantic entity mapping results.
[0089] This invention calculates cosine similarity based on sentence-level semantic vectors and pre-stored vector representations of equipment entities, operation entities, state entities, topological relationships, functional relationships, and state relationships in the power distribution network knowledge graph. It maps these similarities to the corresponding entity or relationship with the highest similarity and combines the vectorized representation of the three-dimensional adjacency tensor to achieve multi-hop reasoning and evidence aggregation. This overcomes the shortcomings of existing knowledge graph reasoning mechanisms in adapting to the special characteristics of the power field and ensures the accuracy and reliability of semantic mapping.
[0090] Step 3: Based on the distribution network knowledge graph and the semantic entity mapping results, perform device status reasoning to generate operator maintenance decisions.
[0091] This invention relies on a semantic understanding model trained and optimized by domain adaptive prediction tasks, combined with knowledge query triple construction and vector space reasoning, to generate equipment status risk scoring results, and generates operator maintenance decisions according to preset decision rules, realizing full-link intelligence from semantic understanding to equipment status reasoning, improving the accuracy of equipment status reasoning and the level of decision intelligence, and breaking through the bottleneck of insufficient combination of semantic understanding and knowledge graph in existing technologies.
[0092] In this embodiment, the entities include at least device entities, operation entities, and state entities, and the relationships include at least topological relationships, functional relationships, and state relationships.
[0093] Example 2
[0094] Based on the same inventive concept as Embodiment 1, this embodiment introduces the implementation steps of a power distribution network intelligent agent method based on semantic understanding and knowledge graph, including:
[0095] Step 1: As Figure 2 As shown, natural language instructions are obtained and input into a pre-trained semantic understanding model to process the natural language instructions into word-level representation sequences and aggregate them into sentence-level semantic vectors.
[0096] In this embodiment, the semantic understanding model includes a dual-path adaptive word embedding layer, a Transformer encoder, and an attention pooling layer. The dual-path adaptive word embedding layer is used to transform the lexical units in natural language instructions into distribution network domain-aware word embedding vectors, achieving deep fusion of general semantics and domain semantics. The Transformer encoder is used to process the distribution network domain-aware word embedding vectors into word-level representation sequences, capturing long-distance dependencies between lexical units. The attention pooling layer is used to aggregate the word-level representation sequences into sentence-level semantic vectors, highlighting the contribution of key information to the overall semantics.
[0097] In this embodiment, the Transformer encoder is composed of stacked coding layers with the same L-layer structure, where L is an integer greater than 1. Each coding layer sequentially includes a multi-head self-attention sub-layer, a feedforward neural network sub-layer, a residual connection, and layer normalization.
[0098] In this embodiment, the input and output of the coding layer are respectively represented as:
[0099] ;
[0100] ;
[0101] In the formula, Indicates the first The input of the layer coding layer, This represents the input to the first coding layer. Indicates the first The output of the layer coding layer, Indicates the first The output of the layer coding layer, This represents the output after sequentially passing through the multi-head self-attention sub-layer and the feedforward neural network sub-layer. This indicates residual connection and layer normalization operations.
[0102] In this embodiment, the multi-head self-attention sublayer calculates the output of each attention head using an attention function, as shown below:
[0103] ;
[0104] In the formula, Represents the attention function. The query matrix, obtained from the input sequence of the coding layer through a linear transformation, is used to calculate the correlation with other locations. The key matrix, obtained from the input sequence of the coding layer through a linear transformation, is used for query matching. The value matrix, obtained from the input sequence of the coding layer through a linear transformation, is used for weighted summation to generate the output of each attention head. Indicates the first The dimension of each key vector is used to scale the dot product, preventing the gradient from being too large or too small. This represents the normalized exponential function, which transforms the attention scores into a probability distribution. This indicates transpose.
[0105] In this embodiment, the multi-head self-attention sublayer includes The attention heads of parallel computation, where the first... The output of each attention head, wherein the number of attention heads computed in parallel is preferably 8, is expressed as:
[0106] ;
[0107] In the formula, Indicates the first The output of each attention head, They represent the first The query matrix, key matrix, and value matrix of each attention head.
[0108] In this embodiment, the output of the multi-head self-attention sub-layer is obtained by splicing and linearly projecting the outputs of all attention heads, as shown below:
[0109] ;
[0110] In the formula, This represents the output of the multi-head self-attention sublayer. Indicates the first The output of each attention head, This represents the output of the second attention head. Indicates the first The output of each attention head, This represents a learnable linear projection matrix.
[0111] In this embodiment, the output of the feedforward neural network sublayer is represented as:
[0112] ;
[0113] In the formula, This represents the output of a sublayer in a feedforward neural network. Represents the activation function of the Gaussian error linear unit. These represent the weight matrix and bias vector of the first linear layer, respectively. These represent the weight matrix and bias vector of the second linear layer, respectively.
[0114] In this embodiment, the training method of the semantic understanding model includes: acquiring distribution network domain text corpus; constructing at least three domain adaptive prediction tasks based on the distribution network domain text corpus, wherein the at least three domain adaptive prediction tasks include a domain terminology masking language model task, a device relationship prediction task, and a contrastive learning task based on sentence-level semantic vector similarity; training the semantic understanding model with the weighted sum of the domain terminology masking language model task loss, the relationship prediction task loss, and the contrastive learning task loss based on sentence-level semantic vector similarity as the training objective, thereby obtaining a pre-trained semantic understanding model; the weighted sum is expressed as:
[0115] ;
[0116] In the formula, Indicates a weighted sum. This represents the loss of the domain terminology mask language model task. These represent the losses from the relation prediction task, respectively. The weighting coefficients and the loss of the contrastive learning task based on sentence-level semantic vector similarity. The weighting coefficients.
[0117] In this embodiment, the domain terminology masking language model task includes: randomly masking distribution network domain terms such as "busbar" and "disconnector" in the corpus, allowing the model to predict the masked terms and enhance the model's semantic understanding of domain terms; the equipment relationship prediction task includes: extracting triples such as equipment-relationship-equipment and equipment-relationship-state from the corpus, allowing the model to predict missing elements in the triples based on context, such as the known "transformer" and "overload", and predicting the relationship "is", thereby improving the model's ability to capture domain relationships; the contrastive learning task based on sentence-level semantic vector similarity includes: using semantically similar sentences such as "10kV line trip" and "10kV feeder fault disconnection" as positive sample pairs, and semantically unrelated sentences as negative sample pairs, optimizing the representation effect of sentence-level semantic vectors through contrastive learning, and ensuring that semantically similar instructions are mapped to similar vector spaces.
[0118] Step 1.1: Obtain the lexical units in the language instructions as general word embedding vectors.
[0119] Step 1.2: Calculate the domain word embedding vector of the distribution network using the domain embedding matrix and indicator function.
[0120] In this embodiment, calculating the distribution network domain term embedding vector using a domain embedding matrix and an indicator function can accurately capture the domain-specific meanings of professional terms such as "busbar" and "disconnector". The distribution network domain term embedding is represented as follows:
[0121] ;
[0122] In the formula, This represents the embedding vector of domain terms in the power distribution network, which is the domain term. Embedded representation in the field of power distribution networks Represents the domain embedding matrix. Indicates the domain term used for judgment Does it belong to the domain thesaurus? Indicator functions, Domain words of coding, This indicates a conditional statement "if". This indicates the "other cases" conditional statement.
[0123] Step 1.3: By fusing the general word embedding vector and the distribution network domain word embedding vector through learnable gating vectors, we obtain the distribution network domain-aware word embedding vector.
[0124] In this embodiment, L is an integer greater than 1, preferably L=6. Each encoding layer sequentially includes a multi-head self-attention sub-layer, a feedforward neural network sub-layer, a residual connection, and layer normalization, which can ensure model depth and training stability. The learnable gating vector is represented as follows:
[0125] ;
[0126] In the formula, This represents a learnable gating vector used to control the general word embedding vector. With distribution network domain word embedding vector The fusion ratio, This represents the Sigmoid activation function. Represents the gate weight matrix. This represents embedding a general word into a vector. With distribution network domain word embedding vector To splice, This indicates the gating bias term.
[0127] In this embodiment, the word embedding vector of the distribution network domain perception is represented as:
[0128] ;
[0129] In the formula, Represents word embedding vectors for domain-aware distribution networks. This indicates element-wise multiplication.
[0130] In this embodiment, the word-level representation sequence is aggregated into a sentence-level semantic vector based on the attention weight of each word in the word-level representation sequence. This highlights key terms such as "fault," "trip," and the semantic contribution of core operations. The formula for calculating the attention weight of each word in the word-level representation sequence is as follows:
[0131] ;
[0132] In the formula, Word level indicates the first word in the sequence. Attention weight of each word This represents an exponential function used to convert attention scores into positive numbers. Represents the query vector With hyperbolic tangent activation function dot product, This represents a learnable weight matrix used to learn the weights of the first... Word-level representation vectors Perform a linear transformation. This represents a learnable bias vector used for adjustment after linear transformation. Indicates the first Word-level representation vectors of words, The word level indicates the number of words in the sequence.
[0133] Step 2: As Figure 3As shown, the sentence-level semantic vectors are mapped to the corresponding entities or relations in the power distribution network knowledge graph to obtain the semantic entity mapping results.
[0134] In this embodiment, the entities include at least device entities, operation entities, and state entities, and the relationships include at least topological relationships, functional relationships, and state relationships.
[0135] Step 2.1: By performing vector space embedding learning on the knowledge graph, obtain the pre-stored vector representations of all entities or relationships in the power distribution network knowledge graph.
[0136] Step 2.2: Calculate the cosine similarity between the sentence-level semantic vector and the pre-stored vector.
[0137] Step 2.3: Based on the cosine similarity, map the sentence-level semantic vector to the corresponding entity or relation with the highest similarity in the distribution network knowledge graph.
[0138] In this embodiment, the formula for calculating the cosine similarity is expressed as follows:
[0139] ;
[0140] In the formula, Sentence-level semantic vectors With pre-stored vector , Sentence-level semantic vectors With pre-stored vector The angle between The cosine value, Indicates the modulus length.
[0141] Step 3: As Figure 4 As shown, device status reasoning is performed based on the distribution network knowledge graph and the semantic entity mapping results to generate operator maintenance decisions.
[0142] Step 3.1: Construct knowledge query triples based on the semantic entity mapping results. The set is used to obtain the query representation, where, For connector entity Tail-end entity The relationship.
[0143] Step 3.2: Based on the query representation and the vectorized representation of the distribution network knowledge graph, reasoning and searching are performed in the vector space to obtain a set of candidate entities.
[0144] Step 3.3: Perform multi-hop reasoning and evidence aggregation based on the candidate entity set and its relationship in the distribution network knowledge graph to obtain the risk score result of the equipment status.
[0145] Step 3.4: Generate corresponding call center operation and maintenance decisions based on the risk scoring results and preset decision rules.
[0146] In this embodiment, the distribution network knowledge graph is a directed labeled multigraph represented by a three-dimensional adjacency tensor. ,in, Represents a finite set of entities. Represents a finite set of relations. Represents all knowledge query triples A set of.
[0147] In this embodiment, the three-dimensional adjacency tensor is represented as:
[0148]
[0149] In the formula, | | and | | represent the number of entities and the number of relations, respectively. A tensor element in a three-dimensional adjacency tensor, used to represent the first... The entity and the first Does a relationship exist between these entities?
[0150] Example 3
[0151] Based on the same inventive concept as other embodiments, this embodiment describes a computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of the methods of Embodiment 1 or 2 described above.
[0152] In summary, this invention processes natural language instructions into word-level representation sequences and aggregates them into sentence-level semantic vectors through a semantic understanding model. These vectors are then mapped to device entities, operation entities, state entities, and topological, functional, and state relationships within the distribution network knowledge graph. This achieves accurate semantic entity mapping. Furthermore, based on the knowledge graph and mapping results, device state reasoning is used to generate operator maintenance decisions. This effectively solves the problems of insufficient semantic understanding of natural language instructions, inaccurate mapping of knowledge graph entities / relationships, and insufficient device state reasoning capabilities in distribution network intelligent operators, significantly improving the accuracy and intelligence level of distribution network operation and maintenance decisions.
[0153] This invention transforms natural language instruction lexical units into distribution network domain-aware word embedding vectors through a dual-path adaptive word embedding layer. These vectors are then processed into word-level representation sequences by a Transformer encoder and aggregated into sentence-level semantic vectors by an attention pooling layer. This achieves accurate semantic embedding of distribution network professional terms such as "bus," "disconnector," and "feeder" in the power context, solving the problem of insufficient understanding of power domain terms by general semantic models.
[0154] This invention calculates cosine similarity based on sentence-level semantic vectors and pre-stored vector representations of equipment entities, operation entities, state entities, topological relationships, functional relationships, and state relationships in the power distribution network knowledge graph. It maps the cosine similarity to the corresponding entity or relationship with the highest similarity and combines the vectorized representation of the three-dimensional adjacency tensor to achieve multi-hop reasoning and evidence aggregation, thus overcoming the shortcomings of existing knowledge graph reasoning mechanisms in adapting to the special characteristics of the power field.
[0155] This invention relies on a semantic understanding model trained and optimized by domain adaptive prediction tasks, combined with knowledge query triple construction and vector space reasoning, to generate equipment status risk scoring results, and generates operator maintenance decisions according to preset decision rules, realizing full-link intelligence from semantic understanding to equipment status reasoning, and breaking through the bottleneck of insufficient combination of semantic understanding and knowledge graph in existing technologies.
[0156] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0157] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0158] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0159] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0160] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.
Claims
1. A method for intelligent network configuration service based on semantic understanding and knowledge graph, characterized in that, include: Natural language instructions are obtained and input into a pre-trained semantic understanding model to process the natural language instructions into word-level representation sequences and aggregate them into sentence-level semantic vectors. The sentence-level semantic vectors are mapped to corresponding entities or relations in the power distribution network knowledge graph to obtain semantic entity mapping results; Based on the distribution network knowledge graph and the semantic entity mapping results, device status reasoning is performed to generate operator maintenance decisions; The entity includes at least a device entity, an operation entity, and a status entity; The relationships include at least topological relationships, functional relationships, and state relationships. 2.The semantic understanding and knowledge graph-based network configuration intelligent agent method according to claim 1, characterized in that, The semantic understanding model includes a dual-path adaptive word embedding layer, a Transformer encoder, and an attention pooling layer; The dual-path adaptive word embedding layer is used to convert the lexical units in natural language instructions into distribution network domain-aware word embedding vectors. The Transformer encoder is used to process the word embedding vectors of the distribution network domain awareness into a word-level representation sequence; The attention pooling layer is used to aggregate word-level representation sequences into sentence-level semantic vectors.
3. The intelligent agent method for power distribution networks based on semantic understanding and knowledge graphs according to claim 2, characterized in that, Transforming lexical units in natural language instructions into distribution network-aware word embedding vectors includes: Obtain the lexical units in the language instructions as a general word embedding vector; Calculate the domain word embedding vector of the power distribution network using the domain embedding matrix and indicator function; By fusing general word embedding vectors and distribution network domain word embedding vectors with learnable gating vectors, a distribution network domain-aware word embedding vector is obtained. The term "distribution network domain word embedding" is represented as follows: ; In the formula, This represents the embedding vector of domain terms in the power distribution network, which is the domain term. Embedded representation in the field of power distribution networks Represents the domain embedding matrix. Indicates the domain term used for judgment Does it belong to the domain thesaurus? Indicator functions, Domain words of coding, This indicates a conditional statement "if". This indicates "other cases" in a conditional statement. The learnable gated vector is represented as: ; In the formula, This represents a learnable gating vector used to control the general word embedding vector. With distribution network domain word embedding vector The fusion ratio, This represents the Sigmoid activation function. Represents the gate weight matrix. This represents embedding a general word into a vector. With distribution network domain word embedding vector To splice, Indicates the gating bias term; The word embedding vector representation of the distribution network domain perception is as follows: ; In the formula, Represents word embedding vectors for domain-aware distribution networks. This indicates element-wise multiplication.
4. The intelligent agent method for power distribution networks based on semantic understanding and knowledge graphs according to claim 2, characterized in that, The Transformer encoder is composed of stacked coding layers with the same L-layer structure. Each coding layer includes, in sequence, a multi-head self-attention sub-layer, a feedforward neural network sub-layer, a residual connection, and layer normalization. The input and output of the coding layer are respectively represented as follows: ; ; In the formula, Indicates the first The input of the layer coding layer, This represents the input to the first coding layer. Indicates the first The output of the layer coding layer, Indicates the first The output of the layer coding layer, This represents the output after sequentially passing through the multi-head self-attention sub-layer and the feedforward neural network sub-layer. This represents residual connection and layer normalization operations; The multi-head self-attention sublayer calculates the output of each attention head through an attention function, expressed as: ; In the formula, Represents the attention function. The query matrix, obtained from the input sequence of the coding layer through a linear transformation, is used to calculate the correlation with other locations. The key matrix, obtained from the input sequence of the coding layer through a linear transformation, is used for query matching. The value matrix, obtained from the input sequence of the coding layer through a linear transformation, is used for weighted summation to generate the output of each attention head. Indicates the first The dimension of each key vector is used to scale the dot product, preventing the gradient from being too large or too small. This represents the normalized exponential function, which transforms the attention scores into a probability distribution. Indicates transpose; The multi-head self-attention sublayer includes The attention heads of parallel computation, where the first... The output of each attention head is represented as: ; In the formula, Indicates the first The output of each attention head, They represent the first The query matrix, key matrix, and value matrix of each attention head; The output of the multi-head self-attention sublayer is obtained by concatenating and linearly projecting the outputs of all attention heads, as follows: ; In the formula, This represents the output of the multi-head self-attention sublayer. Indicates the first The output of each attention head, This represents the output of the second attention head. Indicates the first The output of each attention head, Represents a learnable linear projection matrix; The output of the feedforward neural network sublayer is represented as: ; In the formula, This represents the output of a sublayer in a feedforward neural network. Represents the activation function of the Gaussian error linear unit. These represent the weight matrix and bias vector of the first linear layer, respectively. These represent the weight matrix and bias vector of the second linear layer, respectively.
5. The intelligent agent method for power distribution networks based on semantic understanding and knowledge graphs according to claim 2, characterized in that, The word-level representation sequence is aggregated into a sentence-level semantic vector based on the attention weight of each word in the word-level representation sequence. The formula for calculating the attention weight of each word in the word-level representation sequence is expressed as follows: ; In the formula, Word level indicates the first word in the sequence. Attention weight of each word This represents an exponential function used to convert attention scores into positive numbers. Represents the query vector With hyperbolic tangent activation function dot product, This represents a learnable weight matrix used to learn the weights of the first... Word-level representation vectors Perform a linear transformation. This represents a learnable bias vector used for adjustment after linear transformation. Indicates the first Word-level representation vectors of words, The word level indicates the number of words in the sequence.
6. The intelligent agent method for power distribution networks based on semantic understanding and knowledge graphs according to claim 1, characterized in that, The training methods for the semantic understanding model include: Acquire text corpus in the power distribution network field; Based on the data distribution network domain text corpus, at least three domain adaptive prediction tasks are constructed, including a domain terminology masking language model task, a device relationship prediction task, and a contrastive learning task based on sentence-level semantic vector similarity. The semantic understanding model is trained by using the weighted sum of the domain term mask language model task loss, relation prediction task loss, and contrastive learning task loss based on sentence-level semantic vector similarity as the training objective, and a pre-trained semantic understanding model is obtained. The weighted sum is represented as: ; In the formula, Indicates a weighted sum. This represents the loss of the domain terminology mask language model task. These represent the losses from the relation prediction task, respectively. The weighting coefficients and the loss of the contrastive learning task based on sentence-level semantic vector similarity. The weighting coefficients.
7. The intelligent agent method for power distribution networks based on semantic understanding and knowledge graphs according to claim 1, characterized in that, Mapping the sentence-level semantic vectors to corresponding entities in the power distribution network knowledge graph includes: By performing vector space embedding learning on the knowledge graph, pre-stored vector representations of all entities or relationships in the power distribution network knowledge graph are obtained; Calculate the cosine similarity between the sentence-level semantic vector and the pre-stored vector; Based on the cosine similarity, the sentence-level semantic vector is mapped to the corresponding entity or relation with the highest similarity in the power distribution network knowledge graph; The formula for calculating the cosine similarity is as follows: ; In the formula, Sentence-level semantic vectors With pre-stored vector , Sentence-level semantic vectors With pre-stored vector The angle between The cosine value, Indicates the modulus length.
8. The intelligent agent method for power distribution networks based on semantic understanding and knowledge graphs according to claim 7, characterized in that, Based on the distribution network knowledge graph and the semantic entity mapping results, device status reasoning is performed to generate operator maintenance decisions, including: Construct a knowledge query triplet based on the semantic entity mapping result. The set is used to obtain the query representation, where, For connector entity Tail-end entity Relationship; Based on the query representation and the vectorized representation of the distribution network knowledge graph, reasoning and searching are performed in the vector space to obtain a set of candidate entities; Based on the candidate entity set and its relationship in the distribution network knowledge graph, multi-hop reasoning and evidence aggregation are performed to obtain the risk score result of the equipment status; Based on the risk scoring results and preset decision rules, corresponding call center operation and maintenance decisions are generated. The distribution network knowledge graph is a directed labeled multi-graph represented by a three-dimensional adjacency tensor. ,in, Represents a finite set of entities. Represents a finite set of relations. Represents all knowledge query triples A set of.
9. The intelligent agent method for power distribution networks based on semantic understanding and knowledge graphs according to claim 8, characterized in that, The three-dimensional adjacency tensor is represented as: In the formula, | | and | | represent the number of entities and the number of relations, respectively. A tensor element in a three-dimensional adjacency tensor, used to represent the first... The entity and the first Does a relationship exist between these entities? .
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the intelligent agent method for power distribution networks based on semantic understanding and knowledge graphs as described in any one of claims 1-9.