Ontology identification method and device in electric power scene

Through the large language model that combines the entity recognition model and the search tool, the problems of insufficient rules and poor learning effect of ontology recognition in the power scenario are solved, and higher recognition accuracy and intelligence are achieved.

CN120780890APending Publication Date: 2025-10-14STATE GRID INFORMATION & TELECOMM BRANCH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410413134.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-08
Publication Date
2025-10-14

AI Technical Summary

Technical Problem

Traditional ontology recognition technology in power scenarios has problems such as insufficient rules, rule conflicts and poor scalability. Ontology recognition technology based on machine learning also has the contradiction between the universality of the learning model and the learning effect, and cannot meet the intelligent needs of power equipment.

Method used

An entity recognition model is used for text recognition, combined with a search tool for encyclopedia search, and the recognition results and related information are merged and used as input to a pre-trained large language model to output the power ontology, including entity names, attributes, relationships, events, and constraints.

Benefits of technology

By expanding the sample, the accuracy of entity recognition is improved to meet the intelligent needs of power equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120780890A_ABST
    Figure CN120780890A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of electric power intelligentization, and particularly provides an ontology recognition method and device in an electric power scene, and the method comprises the steps: carrying out the entity recognition of an input text through an entity recognition model, and obtaining a recognition result; performing encyclopedia search on the recognition result by adopting a search tool to obtain related information corresponding to the recognition result; combining the recognition result and the corresponding related information, and taking the combined result as the input of a pre-trained large language model to obtain a power ontology output by the pre-trained large language model; wherein the power ontology comprises an entity name, an entity attribute, an entity relationship, an event and an entity constraint. According to the technical scheme provided by the invention, the samples are expanded, so that the sample information is enriched, and the ontology recognition accuracy is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of power intelligence, in particular to a power scenario ontology recognition method and device. BACKGROUND

[0002] The power device is a complex and dynamic device, involving power supply, load scheduling, energy management and other aspects. The traditional power device often uses rule-based ontology recognition technology or machine learning-based ontology recognition technology to identify and manage the power scenario.

[0003] However, with the development and intelligentization of the power device, the amount of data in the power scenario is increasing, and the traditional rule-based ontology recognition technology has the defects of insufficient rules, rule conflicts and poor scalability. The machine learning-based ontology recognition technology also has the contradiction between the learning model universality and the learning effect. The traditional data processing method cannot meet the intelligentization demand of the power device. SUMMARY

[0004] In order to overcome the above defects, the present application provides a power scenario ontology recognition method and device.

[0005] In a first aspect, a power scenario ontology recognition method is provided, which comprises:

[0006] using an entity recognition model to perform entity recognition on input text to obtain a recognition result;

[0007] using a search tool to perform encyclopedia search on the recognition result to obtain related information corresponding to the recognition result;

[0008] merging the recognition result and the related information corresponding thereto, and taking the merged result as the input of a pre-trained large language model to obtain a power ontology output by the pre-trained large language model;

[0009] wherein the power ontology comprises entity name, entity attribute, entity relationship, event and entity constraint.

[0010] Preferably, the entity name comprises power plant, transformer substation, power transmission line, power distribution equipment, load and electric meter; the entity attribute comprises voltage, current, power, energy consumption and equipment state; the entity relationship comprises connection relationship and dependency relationship; the entity event comprises fault event, alarm event and scheduling event; and the entity constraint comprises power line capacity constraint and load demand constraint.

[0011] Preferably, the encyclopedia search using the search tool on the recognition result to obtain the related information corresponding to the recognition result comprises:

[0012] Merge the recognition result with the preset search seed URL to obtain the required URL;

[0013] Search for the content corresponding to the required URL through the scrapy web page downloader and download the web page;

[0014] The downloaded web page is parsed according to the established format by the parsel parsing tool to obtain relevant information corresponding to the recognition result.

[0015] Preferably, the training process of the pre-trained large language model includes:

[0016] Construct training data using power domain texts labeled with power ontology;

[0017] The initial large language model is trained using the training data to obtain the pre-trained large language model.

[0018] Furthermore, before using the training data to train the initial large language model, a dimensionality reduction operation is performed on the median vector matrix of the attention mechanism of the initial large language model;

[0019] After the initial large language model is trained using the training data, a dimension-increasing operation is performed on the median vector matrix of the attention mechanism of the initial large language model.

[0020] Furthermore, in the process of training the initial large language model using the training data, the loss function used is as follows:

[0021]

[0022] In the above formula, J is the loss value, m is the number of samples, n is the number of classifications, and y ij is the actual label value of the i-th sample for the j-th class, a ij is the predicted label value of the i-th sample for the j-th class.

[0023] In a second aspect, a device for identifying an entity in an electric power scenario is provided, the device comprising:

[0024] The recognition module is used to perform entity recognition on the input text using the entity recognition model to obtain the recognition result;

[0025] A search module, configured to use a search tool to perform an encyclopedia search on the recognition result to obtain relevant information corresponding to the recognition result;

[0026] an analysis module, configured to merge the recognition results and their corresponding related information, and use the merged results as input to a pre-trained large language model to obtain an electric power ontology output by the pre-trained large language model;

[0027] The power ontology includes: entity name, entity attributes, entity relationships, events and entity constraints.

[0028] In a third aspect, a computer device is provided, comprising: one or more processors;

[0029] The processor is configured to store one or more programs;

[0030] When the one or more programs are executed by the one or more processors, the method for ontology identification in the power scenario is implemented.

[0031] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed, the method for entity identification in the power scenario is implemented.

[0032] The above one or more technical solutions of the present invention have at least one or more of the following beneficial effects:

[0033] The present invention provides a method and apparatus for ontology recognition in an electric power scenario, comprising: using an entity recognition model to perform entity recognition on input text to obtain a recognition result; using a search tool to perform an encyclopedia search on the recognition result to obtain relevant information corresponding to the recognition result; combining the recognition result and its corresponding relevant information, and using the combined result as input to a pre-trained large language model to obtain an electric power ontology output by the pre-trained large language model; wherein the electric power ontology includes entity names, entity attributes, entity relationships, events, and entity constraints. The technical solution provided by the present invention further improves the accuracy of ontology recognition by expanding the sample, thereby enriching the sample information. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 This is a flow chart of the main steps of the ontology identification method in the power scenario according to an embodiment of the present invention. DETAILED DESCRIPTION

[0035] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.

[0036] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0037] As disclosed in the background, the power device is a complex and dynamic device involving power supply, load scheduling, energy management and other aspects. The traditional power device often identifies and manages the power scene based on rule-based ontology recognition technology or machine learning-based ontology recognition technology.

[0038] However, with the development and intelligentization of the power device, the amount of data in the power scene is increasing, the traditional rule-based ontology recognition technology has the defects of insufficient rules, rule conflicts and poor extension, and the machine learning-based ontology recognition technology also has the contradiction between the learning model universality and the learning effect. The traditional data processing method cannot meet the intelligentization demand of the power device.

[0039] In order to improve the above problems, the present application provides an ontology recognition method and device under a power scene, comprising: using an entity recognition model to perform entity recognition on input text to obtain a recognition result; using a search tool to perform encyclopedia search on the recognition result to obtain related information corresponding to the recognition result; merging the recognition result and the related information corresponding thereto, and taking the merging result as an input of a pre-trained large language model to obtain a power ontology output by the pre-trained large language model; wherein the power ontology comprises: entity name, entity attribute, entity relationship, event and entity constraint. The technical scheme provided by the present application enriches the sample information by expanding the sample, thereby further improving the ontology recognition accuracy.

[0040] The above scheme will be described in detail below.

[0041] Embodiment 1

[0042] Reference is made to the accompanying drawings Figure 1 , Figure 1 is the main step flow diagram of the ontology recognition method under the power scene of an embodiment of the present application. As shown in Figure 1 , the ontology recognition method under the power scene in the embodiment of the present application mainly comprises the following steps:

[0043] Step S101: using an entity recognition model to perform entity recognition on input text to obtain a recognition result;

[0044] Step S102: using a search tool to perform encyclopedia search on the recognition result to obtain related information corresponding to the recognition result;

[0045] Step S103: merging the recognition result and the related information corresponding thereto, and taking the merging result as an input of a pre-trained large language model to obtain a power ontology output by the pre-trained large language model;

[0046] The power ontology includes: entity name, entity attributes, entity relationships, events and entity constraints.

[0047] In this embodiment, the entity names include: power plant, substation, transmission line, distribution equipment, load, and meter; the entity attributes include: voltage, current, power, energy consumption, and equipment status; the entity relationships include: connection relationship and dependency relationship; the entity events include: fault event, alarm event, and scheduling event; the entity constraints include: capacity constraint of the power line and load demand constraint.

[0048] In a specific embodiment, the power ontology is defined as follows:

[0049] Entity name: The power ontology describes various entities in the power system, such as power plants, substations, transmission lines, distribution equipment, loads, meters, etc. Each entity can have attributes and relationships to describe its characteristics and associations with other entities.

[0050] Entity attributes: The power ontology defines attributes that describe power system entities, such as voltage, current, power, energy consumption, and device status. Attributes can be used to measure and describe the characteristics of entities and provide key data for querying and reasoning.

[0051] Entity Relationships: The power ontology defines relationships between entities to describe their connections and dependencies. For example, a power plant and substation can have a transmission relationship, and a load and distribution equipment can have a supply relationship. Relationships can be used to represent the topology and operating mechanisms of the power system.

[0052] Events: The power ontology can include concepts that describe events that occur in the power system, such as faults, alarms, and dispatch instructions. Events can be used to record state changes and abnormal conditions in the power system and provide processing and responses to these events.

[0053] Entity constraints: The power ontology can include constraints on entities and relationships to define restrictions and rules between them. For example, the capacity of a power line cannot exceed the rated value, and load demand must meet the power supply capacity. Constraints can be used to ensure the operational safety and compliance of the power system.

[0054] In this embodiment, the use of a search tool to perform an encyclopedia search on the recognition result to obtain relevant information corresponding to the recognition result includes:

[0055] Merge the recognition result with the preset search seed URL to obtain the required URL;

[0056] Search for the content corresponding to the required URL through the scrapy web page downloader and download the web page;

[0057] The downloaded webpage is parsed according to a predetermined format by a parsel analysis tool to obtain relevant information corresponding to the recognition result.

[0058] In this embodiment, the training process of the pre-trained large language model includes:

[0059] The training data is constructed by using the power field text marked with power ontology.

[0060] The initial large language model is trained using the training data to obtain the pre-trained large language model.

[0061] In one embodiment, before the initial large language model is trained using the training data, a dimension reduction operation is performed on the value vector matrix in the attention mechanism of the initial large language model.

[0062] After the initial large language model is trained using the training data, a dimension increase operation is performed on the value vector matrix in the attention mechanism of the initial large language model.

[0063] In a specific embodiment, the present application adds a new path next to the original large language model. By multiplying the two matrices A and B, the first matrix A is responsible for dimension reduction, and the second matrix B is responsible for dimension increase. The intermediate layer dimension is r, thereby simulating the so-called intrinsic rank. The trainable layer dimension and the pre-trained model layer dimension are consistent, which is d. The dimension d is first reduced to r through a fully connected layer, and then mapped back to the d dimension through a fully connected layer, where r << d, r is the rank of the matrix. In this way, the matrix calculation changes from d x d to d x r + r x d, and the number of parameters is greatly reduced.

[0064] During downstream task training, only the weight parameters of the two newly added matrices are optimized, and the results of the PLM and the newly added path are added together as the final result. The weight parameters of the first matrix A are initialized by a Gaussian function, while the weight parameters of the second matrix B are initialized as a zero matrix. In this way, the newly added path BA = 0 at the beginning of training has no effect on the model result.

[0065] During inference, the results of the left and right parts are added together, so as long as the matrix product BA after training is added to the original weight matrix W as a new weight parameter to replace the original model weight matrix. For inference, no additional computing resources are added.

[0066] In one embodiment, during the process of training the initial large language model using the training data, the loss function used is as follows:

[0067]

[0068] In the above formula, J is the loss value, m is the number of samples, n is the number of classifications, and y ij is the actual label value of the i-th sample for the j-th class, a ij is the predicted label value of the i-th sample for the j-th class.

[0069] Example 2

[0070] Based on the same inventive concept, the present invention further provides a device for identifying an entity in an electric power scenario, the device comprising:

[0071] The recognition module is used to perform entity recognition on the input text using the entity recognition model to obtain the recognition result;

[0072] A search module, configured to use a search tool to perform an encyclopedia search on the recognition result to obtain relevant information corresponding to the recognition result;

[0073] an analysis module, configured to merge the recognition results and their corresponding related information, and use the merged results as input to a pre-trained large language model to obtain an electric power ontology output by the pre-trained large language model;

[0074] The power ontology includes: entity name, entity attributes, entity relationships, events and entity constraints.

[0075] Preferably, the entity names include: power plant, substation, transmission line, distribution equipment, load, and electric meter; the entity attributes include: voltage, current, power, energy consumption, and equipment status; the entity relationships include: connection relationship and dependency relationship; the entity events include: fault event, alarm event, and scheduling event; the entity constraints include: capacity constraint of power lines and load demand constraint.

[0076] Preferably, the step of using a search tool to perform an encyclopedia search on the recognition result to obtain relevant information corresponding to the recognition result includes:

[0077] Merge the recognition result with the preset search seed URL to obtain the required URL;

[0078] Search for the content corresponding to the required URL through the scrapy web page downloader and download the web page;

[0079] The downloaded web page is parsed according to the established format by the parsel parsing tool to obtain relevant information corresponding to the recognition result.

[0080] Preferably, the training process of the pre-trained large language model includes:

[0081] Construct training data using power domain texts labeled with power ontology;

[0082] The initial large language model is trained using the training data to obtain the pre-trained large language model.

[0083] Furthermore, before using the training data to train the initial large language model, a dimensionality reduction operation is performed on the median vector matrix of the attention mechanism of the initial large language model;

[0084] After the initial large language model is trained using the training data, a dimension-increasing operation is performed on the median vector matrix of the attention mechanism of the initial large language model.

[0085] Furthermore, in the process of training the initial large language model using the training data, the loss function used is as follows:

[0086]

[0087] In the above formula, J is the loss value, m is the number of samples, n is the number of classifications, and y ij is the actual label value of the i-th sample for the j-th class, a ij is the predicted label value of the i-th sample for the j-th class.

[0088] Example 3

[0089] Based on the same inventive concept, the present invention also provides a computer device, which includes a processor and a memory, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions in the computer storage medium to implement the corresponding method flow or corresponding function, so as to implement the steps of the entity identification method in an electric power scenario in the above embodiment.

[0090] Example 4

[0091] Based on the same inventive concept, the present invention also provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device for storing programs and data. It can be understood that the computer-readable storage medium here can include both built-in storage media in the computer device and, of course, extended storage media supported by the computer device. The computer-readable storage medium provides a storage space, which stores the operating device of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor are also stored in the storage space. These instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the steps of the entity identification method in an electric power scenario in the above embodiment.

[0092] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, apparatus, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0093] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (apparatus), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as a combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0094] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1The function specified in one or more boxes.

[0095] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0096] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered by the scope of protection of the claims of the present invention.

Claims

1. A method for ontology recognition in power scenarios, characterized in that: The method comprises: Use the entity recognition model to perform entity recognition on the input text and obtain the recognition result; Using a search tool to perform an encyclopedia search on the recognition result to obtain relevant information corresponding to the recognition result; Merging the recognition results and corresponding related information, and using the merged results as input to a pre-trained large language model to obtain an electric power ontology output by the pre-trained large language model; The power ontology includes: entity name, entity attributes, entity relationships, events and entity constraints.

2. The method according to claim 1, wherein The entity names include: power plant, substation, transmission line, distribution equipment, load, and meter; the entity attributes include: voltage, current, power, energy consumption, and equipment status; the entity relationships include: connection relationship and dependency relationship; the entity events include: fault event, alarm event, and scheduling event; the entity constraints include: capacity constraint of power lines and load demand constraint.

3. The method according to claim 1, wherein The use of a search tool to perform an encyclopedia search on the recognition result to obtain relevant information corresponding to the recognition result includes: Merge the recognition result with the preset search seed URL to obtain the required URL; Search for the content corresponding to the required URL through the scrapy web page downloader and download the web page; The downloaded web page is parsed according to the established format by the parsel parsing tool to obtain relevant information corresponding to the recognition result.

4. The method according to claim 1, wherein The training process of the pre-trained large language model includes: Construct training data using power domain texts labeled with power ontology; The initial large language model is trained using the training data to obtain the pre-trained large language model.

5. The method according to claim 4, wherein Before training the initial large language model using the training data, performing a dimensionality reduction operation on the median vector matrix of the attention mechanism of the initial large language model; After the initial large language model is trained using the training data, a dimension-increasing operation is performed on the median vector matrix of the attention mechanism of the initial large language model.

6. The method according to claim 4, wherein In the process of training the initial large language model using the training data, the loss function used is as follows: In the above formula, J is the loss value, m is the number of samples, n is the number of classifications, and y ij is the actual label value of the i-th sample for the j-th class, a ij is the predicted label value of the i-th sample for the j-th class.

7. A device based on the method for identifying entities in power scenarios according to any one of claims 1 to 6, characterized in that: The device comprises: The recognition module is used to perform entity recognition on the input text using the entity recognition model to obtain the recognition result; A search module, configured to use a search tool to perform an encyclopedia search on the recognition result to obtain relevant information corresponding to the recognition result; an analysis module, configured to merge the recognition results and their corresponding related information, and use the merged results as input to a pre-trained large language model to obtain an electric power ontology output by the pre-trained large language model; The power ontology includes: entity name, entity attributes, entity relationships, events and entity constraints.

8. A computer device, characterized in that: include: one or more processors; The processor is configured to execute one or more programs; When the one or more programs are executed by the one or more processors, the ontology identification method in the power scenario according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium, characterized in that A computer program is stored thereon, and when the computer program is executed, the method for entity identification in the power scenario as described in any one of claims 1 to 6 is implemented.