A power grid intelligent question and answer method, device, equipment and storage medium
Patent Information
- Application Number
- CN202611267787.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-20
- Publication Date
- 2026-10-27
AI Technical Summary
属性的原有取值在写入新值时被删除,既无法查询该属性在指定时刻的取值,也无法为答案提供取值来源的追溯依据;当同一属性在同一时段由多个数据源上报不同取值时,系统缺少判定采用何者的依据,仅能按写入的先后次序层层覆盖,出现后写入的低可信取值取代先写入的高可信取值的情形
[0017]本发明在电网实时监控数据进入问答系统之前,从电网实时监控系统获取目标属性的候选取值时,同时获取该数据的传输时延、实际更新频率及来源设备的运行稳定性,将三者按加权几何平均合成为该候选取值的实时置信度,使每一条实时数据均获得可比较的可信度评分,为后续分级处理提供了量化依据;根据实时置信度落入的不同阈值区间执行分级门控,高可信数据直接采用,中可信数据降权采用并附加时效性标识,低可信数据拒绝采用并自动回退至知识图谱中最近的高可信历史版本,确保问答系统在任何情况下均有可靠数据可用;当同一属性存在多源冲突时,以各候选值的实时置信度与数据源权威性加权归一化后择优,避免了传统方案中可信度评估与冲突消解相互割裂、裁决逻辑不一致的问题;最终被采用的值以包含属性值、生效时间戳、数据源标识与实时置信度的四元组形式追加为知识图谱动态属性层的当前版本,原版本归档不删,支持任意时刻的数据回溯与审计。
Smart Images

Figure CN122988205A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to artificial intelligence technology, and more particularly to a smart question-and-answer method, apparatus, device, and storage medium for power grids. Background Technology
[0002] In the operation, maintenance, dispatching, repair, and customer service of power grids, personnel frequently need to query equipment parameters, fault handling procedures, and the current operating status of equipment. Currently, intelligent question-and-answer systems for power grids that combine power grid knowledge graphs with large language models have emerged. These systems pre-construct a power grid knowledge graph based on equipment ledgers, operation and maintenance manuals, fault cases, and standard specifications, treating equipment, faults, parameters, and operations as entities and establishing relationships between them. During system operation, real-time power grid monitoring systems such as Supervisory Control and Data Acquisition (SCADA) and Energy Management Systems (EMS) collect voltage, current, power, load, operating status, and alarm information from equipment at fixed intervals. The collected values are directly written into the attributes of the corresponding equipment entities in the power grid knowledge graph, overwriting the original values of those attributes. Upon receiving a user's question, the system retrieves the relevant entities, relationships, and attributes from the power grid knowledge graph. The retrieved static knowledge, along with the previously collected real-time attribute values, is then input into the large language model as context. The large language model generates the answer and returns it to the terminal.
[0003] The aforementioned prior art has the following technical defects: First, the collected real-time values are adopted without being assessed for reliability. The data acquisition links of the power grid real-time monitoring system suffer from transmission delays, missed data acquisition and frequency reduction during the acquisition cycle, and the acquired equipment itself may be in a state of alarm jitter. Therefore, the obtained values may deviate from the actual state of the equipment. Current technology does not quantify the reliability of the values; all collected values are treated as true values and fed into the large language model, resulting in generated answers that do not match the actual operating state of the equipment.
[0004] Secondly, the real-time value acquisition is processed in a binary manner. For the acquired value, there are only two processing results: "adopt" and "not adopt," lacking a processing method in between. Furthermore, when the acquisition link is interrupted or the value is obviously abnormal and therefore not adopted, the original value of the attribute in the power grid knowledge graph has been overwritten by the new value, and the system has no alternative value. It can only stop responding to the attribute or continue to use the already distorted value.
[0005] Third, real-time values are written in an overwrite manner without retaining source identifiers. The original value of an attribute is deleted when a new value is written, making it impossible to query the value of the attribute at a specified time or to provide traceability of the value's source for the answer. When the same attribute is reported with different values from multiple data sources at the same time, the system lacks a basis for determining which value to use and can only overwrite the values layer by layer according to the order of writing, resulting in a situation where a lower-confidence value written later replaces a higher-confidence value written earlier. Summary of the Invention
[0006] This invention provides a power grid intelligent question-and-answer method, device, equipment, and storage medium to realize the reliable quantitative evaluation and hierarchical gating processing of real-time data reported by the power grid real-time monitoring system. When the real-time data is unreliable, it automatically reverts to a reliable historical version and outputs the processed valid real-time value for power grid intelligent question-and-answer, thereby ensuring that the real-time data entering the question-and-answer system is reliable, the processing process is auditable, and the question-and-answer results are traceable.
[0007] In a first aspect, the present invention provides a method for intelligent question-and-answer data processing in power grids, comprising: In response to a data retrieval request for a target attribute of a target entity, the target entity and the target attribute are determined; The candidate values of the target attribute reported by the real-time power grid monitoring system are obtained, and a real-time confidence score is calculated for each candidate value. The real-time confidence score is synthesized by a weighted geometric average of a normalized transmission delay factor, a normalized update frequency factor, and a device operation stability factor. The values of the normalized transmission delay factor, the normalized update frequency factor, and the device operation stability factor are all in the range of 0 to 1. Based on the threshold range into which the real-time confidence level falls, perform the following hierarchical gating operation: If the real-time confidence level is not less than the first threshold, the candidate value is marked as a high confidence level and participates in subsequent data processing with the first weight. If the real-time confidence level is less than the first threshold and not less than the second threshold, the candidate value is marked as medium confidence level, participates in subsequent data processing with the second weight, and a timeliness identifier is added to the candidate value. The second weight is less than the first weight, and the second threshold is less than the first threshold. If the real-time confidence level is less than the second threshold, the candidate value is rejected, and the most recent historical version of the target attribute with a real-time confidence level not less than the first threshold is read from the power grid knowledge graph. The attribute value of this historical version is used to replace the candidate value for subsequent data processing. When the target attribute has at least two candidate values from different data sources participating in subsequent data processing, the data is normalized by the product of the data source authority weight, real-time confidence level, and corresponding grade weight coefficient of each candidate value, and the candidate value with the largest normalization result is taken as the final value; the grade weight coefficient is the first weight or the second weight. The values to be used in subsequent data processing will be appended as quadruples to the current version of the target attribute in the dynamic attribute layer of the target entity in the power grid knowledge graph, and the original current version of the target attribute will be converted to a historical version. The quadruples include the attribute value, effective timestamp, data source identifier, and real-time confidence. The attributes of each entity in the power grid knowledge graph are divided into the dynamic attribute layer and the static attribute layer. The attribute values of the static attribute layer are not modified by the power grid real-time monitoring system. The attribute value of the current version is output as the valid real-time value of the target attribute for use in smart grid question answering.
[0008] Optionally, the data retrieval request is triggered by a user question, and the method further includes: The user's question was sent by the receiving terminal; The user question is subjected to intent recognition and entity recognition to determine the target entity and target attribute corresponding to the user question, and to query whether the target attribute has a historical version chain, a multi-source identifier, or a cross-device associated edge in the dynamic attribute layer of the power grid knowledge graph; If none of the three exist, the processing type of the user problem is determined as the first processing type, the current value of the target attribute is queried from the power grid real-time monitoring system, and the current value is output as the valid real-time value. If at least one of the three conditions is met, the processing type of the user problem is determined to be the second processing type, and the candidate values of the target attribute reported by the power grid real-time monitoring system and subsequent steps are executed.
[0009] Optionally, the method further includes: Based on the user's question, static knowledge is retrieved from the static attribute layer and static knowledge documents of the power grid knowledge graph. This static knowledge is then assembled with the valid real-time value into a single context and input into the power grid question-and-answer model to obtain an answer, which is then sent to the terminal. The retrieval of static knowledge includes retrieving the nameplate parameters, alarm thresholds, and handling procedures of the target entity. Assembling the static knowledge with the valid real-time value into a single context and inputting it into the power grid question-and-answer model includes: the power grid question-and-answer model comparing the valid real-time value with the alarm threshold to generate the answer. If the valid real-time value originates from the current version of the dynamic attribute layer of the power grid knowledge graph, the static knowledge of the associated entities and the current version of the dynamic attribute layer of the associated entities are recalled along the entity relationships of the target entity, and added to the context.
[0010] Optionally, the normalized transmission delay factor Determine using the following formula: In the formula, The time delay from the generation of the candidate value to its arrival at the server. The maximum allowable delay; The normalized update frequency factor Determine using the following formula: In the formula, The actual reporting frequency of the target attribute. The preset reporting frequency for the target attribute; The equipment operation stability factor Determine using the following formula: In the formula, This represents the total number of samples taken from the target entity within a preset time period. The number of samples without alarms within the preset time period; The real-time confidence level Determine using the following formula: In the formula, w1, w2, and w3 are the weights of the normalized transmission delay factor, the normalized update frequency factor, and the device operation stability factor, respectively, and w1+w2+w3=1. w1, w2, and w3 are determined by grid search from real-time data samples with quality labels.
[0011] Optionally, after selecting the candidate value with the largest normalization result as the final value, the method further includes: If the difference between the largest and second largest normalized results is less than a preset difference threshold, a conflict flag is written for the target attribute. When generating an answer, the conflict marker and the message "This data has multiple sources of disagreement" are attached to the answer.
[0012] Optionally, the power grid knowledge graph is constructed in the following manner: The static power grid data undergoes text cleaning, terminology standardization, and field integrity verification in sequence, and a data quality score is calculated using the following formula. : In the formula, The percentage of valid characters retained after text cleaning relative to the original number of characters. The percentage of terms that match the power grid terminology dictionary out of the total number of identified terms is used. This refers to the proportion of non-empty required fields to the total number of required fields. , , The weights are 1, and the sum of the three is 1. Static power grid data with a quality score not less than a preset qualified threshold are considered valid static data. The BERT model is used to extract equipment entities, fault entities, parameter entities, and operation entities from the effective static data. A graph neural network is used to extract the relationships between the entities from the valid static data; The effective static data is used to supplement the attribute values of the static attribute layer for each entity.
[0013] Optionally, the method further includes: Cache the generated answers and corresponding user questions according to the least recently used strategy; If the received user question hits the cache, read the effective timestamp of the valid real-time value corresponding to the answer in the cache, and compare the effective timestamp with the current time; If the difference between the effective timestamp and the current time is less than a preset duration, the answer in the cache will be sent to the terminal. If the difference between the effective timestamp and the current time is not less than the preset duration, the cache hit is rejected, and the process returns to the step of responding to the data call request for the target attribute of the target entity and determining the target entity and the target attribute.
[0014] Secondly, the present invention also provides a smart grid question-and-answer data processing device, comprising: The data retrieval response module is used to respond to a data retrieval request for a target attribute of a target entity and to determine the target entity and the target attribute. The confidence calculation module is used to obtain the candidate values of the target attribute reported by the real-time power grid monitoring system, and calculate the real-time confidence for each candidate value. The real-time confidence is synthesized by a weighted geometric average of the normalized transmission delay factor, the normalized update frequency factor, and the equipment operation stability factor. The values of the normalized transmission delay factor, the normalized update frequency factor, and the equipment operation stability factor are all in the range of 0 to 1. The hierarchical gating module is used to perform the following hierarchical gating operations based on the threshold range into which the real-time confidence level falls: If the real-time confidence level is not less than the first threshold, the candidate value is marked as a high confidence level and participates in subsequent data processing with the first weight. If the real-time confidence level is less than the first threshold and not less than the second threshold, the candidate value is marked as medium confidence level, participates in subsequent data processing with the second weight, and a timeliness identifier is added to the candidate value. The second weight is less than the first weight, and the second threshold is less than the first threshold. If the real-time confidence level is less than the second threshold, the candidate value is rejected, and the most recent historical version of the target attribute with a real-time confidence level not less than the first threshold is read from the power grid knowledge graph. The attribute value of this historical version is used to replace the candidate value for subsequent data processing. The conflict resolution module is used to normalize the target attribute when there are at least two candidate values from different data sources participating in subsequent data processing, by multiplying the data source authority weight, real-time confidence level and corresponding level weight coefficient of each candidate value, and taking the candidate value with the largest normalization result as the final value; the level weight coefficient is the first weight or the second weight. The versioned storage module is used to append the values to be used in subsequent data processing as quadruples to the current version of the target attribute in the dynamic attribute layer of the target entity in the power grid knowledge graph, and to convert the original current version of the target attribute into a historical version. The quadruples include the attribute value, effective timestamp, data source identifier, and real-time confidence. The attributes of each entity in the power grid knowledge graph are divided into the dynamic attribute layer and the static attribute layer. The attribute values of the static attribute layer are not modified by the power grid real-time monitoring system. The output module is used to output the attribute value of the current version as the valid real-time value of the target attribute for use in smart grid question answering.
[0015] Thirdly, the present invention also provides an electronic device, comprising: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the smart grid question-and-answer data processing method provided in the first aspect of the present invention.
[0016] Fourthly, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the smart grid question-and-answer data processing method as provided in the first aspect of the invention.
[0017] Before real-time power grid monitoring data enters the question-and-answer system, this invention, while retrieving candidate values for target attributes from the real-time power grid monitoring system, simultaneously acquires the data's transmission delay, actual update frequency, and operational stability of the source equipment. These three factors are then weighted and geometrically averaged to form the real-time confidence score of the candidate value, ensuring that each piece of real-time data receives a comparable confidence score, providing a quantitative basis for subsequent tiered processing. Tiered gating is then implemented based on different threshold ranges within which the real-time confidence score falls: high-confidence data is directly adopted, medium-confidence data is adopted with reduced weight and an added timeliness indicator, and low-confidence data is rejected. It automatically reverts to the most recent high-reliability historical version in the knowledge graph, ensuring that the question-answering system has reliable data available under any circumstances. When there are multiple source conflicts for the same attribute, the best candidate value is selected after weighted normalization based on the real-time confidence level and the authority of the data source. This avoids the problems of disconnect between confidence assessment and conflict resolution and inconsistent adjudication logic in traditional solutions. The final adopted value is appended to the current version of the dynamic attribute layer of the knowledge graph in the form of a quadruple containing the attribute value, effective timestamp, data source identifier, and real-time confidence level. The original version is archived and not deleted, supporting data backtracking and auditing at any time.
[0018] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 A flowchart of a smart question-answering method for power grids provided by the present invention; Figure 2 A schematic diagram of the structure of a smart power grid question-and-answer data processing device provided by the present invention; Figure 3 This is a schematic diagram of the structure of an electronic device provided by the present invention.
[0021] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0022] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0023] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0024] Figure 1 This is a flowchart of a smart grid question-answering method provided by the present invention. This embodiment is applicable to scenarios involving the quantitative evaluation and hierarchical gating of candidate device attribute values reported by a real-time power grid monitoring system, and the output of the processed valid real-time values for use in smart grid question-answering. This method can be executed by the smart grid question-answering device provided by the present invention. This device can be implemented in software and / or hardware, and is typically configured in electronic devices, such as... Figure 1 As shown, the intelligent question-and-answer method for the power grid includes the following steps: Step S101: In response to the data retrieval request for the target attribute of the target entity, determine the target entity and the target attribute.
[0025] Data retrieval requests are triggered by user questions or by internal processes within the power grid's intelligent question-and-answer data processing method. For example, when an end user inputs "What is the current load of the #1 main transformer?" via text, voice, or image, the system receives the user's question, performs intent recognition and entity recognition, identifies the target entity as "#1 main transformer" and the target attribute as "current load," and thus generates a data retrieval request. Alternatively, the system backend can periodically trigger data retrieval requests for key equipment attributes for cache preheating or data preprocessing, without waiting for user question input.
[0026] In scenarios triggered by user questions, intent recognition and entity recognition of user questions can be performed in the following ways: target entities and target attributes are extracted from natural language questions through word segmentation, part-of-speech tagging and named entity recognition; if the user question lacks target entities or target attributes, the missing information is supplemented from the historical question and answer records of the same session.
[0027] Step S102: Obtain candidate values of target attributes reported by the real-time power grid monitoring system, and calculate the real-time confidence level for each candidate value.
[0028] Obtain candidate values for the target attributes reported by the power grid real-time monitoring system, and calculate the real-time confidence score for each candidate value. The real-time confidence score is synthesized by a weighted geometric average of a normalized transmission delay factor, a normalized update frequency factor, and an equipment operation stability factor. The values of the normalized transmission delay factor, the normalized update frequency factor, and the equipment operation stability factor all range from 0 to 1. Specifically, this may include the following steps: (1) Obtain candidate values and associated parameters When the target attribute has multiple data sources (such as SCADA master station, sub-station, etc.), each data source reports one candidate value. For each candidate value, its transmission latency is also obtained. Actual update frequency and equipment operation stability factors .
[0029] Transmission delay The candidate value is the time delay from its generation (i.e., the time it is collected by the SCADA / EMS system) to its arrival at the server, in milliseconds, and is derived from the timestamp record of the server's intranet interface log.
[0030] Actual update frequency The actual reporting frequency of the target attribute is the number of times the attribute is reported to the server by the SCADA / EMS system per unit time, which is derived from the statistics of the system collection logs.
[0031] Equipment operation stability factor This is the ratio of the number of times the target device has no alarms within a preset unit time to the total number of samples, derived from the device status monitoring records of the SCADA system.
[0032] (2) Calculate the normalized transmission delay factor Normalized transmission delay factor Determine using the following formula: In the formula, This represents the time delay from the generation of a candidate value to its arrival at the server. This is the preset maximum allowable delay. When Exceed hour, The value is 0.
[0033] The data transmission latency of a power grid real-time monitoring system directly determines the freshness of the data. According to power monitoring system technical specifications, the control closed-loop latency is typically required to be no more than 200ms, and the monitoring closed-loop latency no more than 1s. In this embodiment, It can be set according to specific business scenarios, such as 100ms; when the transmission delay exceeds 100ms, the timeliness factor of the data is reduced to zero, and it no longer has a reliable basis.
[0034] (3) Calculate the normalized update frequency factor Normalized update frequency factor Determine using the following formula: In the formula, The actual reporting frequency of the target attribute. The preset reporting frequency for the target attribute. When Not less than hour, The value is 1.
[0035] Power grid SCADA / EMS systems typically collect data at fixed intervals (e.g., every 10 seconds). In actual operation, due to communication link congestion, high system load, and other reasons, missed data collection or frequency reduction may occur, resulting in F_actual being lower than [the specified value]. This factor reflects the continuity of data collection; the closer the frequency is to the expected value, the more reliable the data.
[0036] (4) Calculate the equipment operation stability factor Equipment operation stability factor Determine using the following formula: In the formula, This represents the total number of times the target entity is sampled within a preset time period. This represents the number of samples taken within a preset time period without any alarms.
[0037] When a device is in an alarm state (such as an overload alarm, temperature alarm, or communication interruption alarm), the data it transmits may be distorted due to the abnormal state of the device itself. This factor reflects the reliability of the data source device; the more stable the device, the more reliable the data it transmits.
[0038] (5) Synthesize real-time confidence level Real-time confidence The normalized transmission delay factor, the normalized update frequency factor, and the equipment operation stability factor are synthesized by a weighted geometric average and determined by the following formula: In the formula, w1, w2, and w3 are the weights of the normalized transmission delay factor, the normalized update frequency factor, and the device operation stability factor, respectively, and w1 + w2 + w3 = 1. The values of w1, w2, and w3 are all between 0 and 1. w1, w2, and w3 are determined by grid search using real-time data samples with quality labels; in a preferred embodiment, w1 = 0.4, w2 = 0.3, and w3 = 0.3 are defaulted to.
[0039] Geometric mean retains the veto property that "if any factor is 0, the whole is 0". When a certain dimension completely fails (such as continuous equipment alarm or link interruption), the confidence level drops to zero, which meets the semantic requirements of high-security power grid scenarios. At the same time, compared with direct multiplication, geometric mean offsets the excessive reduction of values caused by decimal multiplication by taking the nth root. This prevents data with only a single dimension that is moderately low but still usable as a whole from being misjudged as "unusable", thereby avoiding excessive conservatism and reducing the waste of usable data.
[0040] Step S103: Perform the following hierarchical gating operation based on the threshold range into which the real-time confidence level falls.
[0041] Based on real-time confidence level If the threshold range is entered, the following hierarchical gating operations are performed: (1) High credibility level ( ≥ First threshold) If the real-time confidence level is not less than the first threshold (e.g., 0.85), the candidate value is marked as high confidence level and participates in subsequent data processing with the first weight.
[0042] Candidate values with high confidence levels indicate that the data performs well in three dimensions: transmission timeliness, acquisition continuity, and equipment stability, and can be used directly as high-confidence field truth values.
[0043] (2) Medium confidence level (second threshold ≤ <First threshold) If the real-time confidence level is less than the first threshold and not less than the second threshold (e.g., 0.6≤... If the value is less than 0.85, the candidate value will be marked as medium confidence level, participate in subsequent data processing with the second weight, and a timeliness label will be added to the candidate value; the second weight is less than the first weight, and the second threshold is less than the first threshold.
[0044] Candidate values for the medium reliability level indicate that the data has a certain degree of degradation in a certain dimension (such as slightly higher transmission latency, slightly lower collection frequency, or occasional device alarms), but still has some overall reference value. In this case, it is not discarded directly, but is adopted in a downgraded manner, and a "data timeliness reminder" label is added when outputting the answer to remind the user that the reliability of the data is flawed.
[0045] (3) Low trust level ( <Second threshold) If the real-time confidence level is less than the second threshold (e.g., 0.6), the candidate value is rejected, and the most recent historical version of the target attribute with a real-time confidence level not less than the first threshold is read from the power grid knowledge graph. The attribute value of this historical version is used to replace the candidate value for subsequent data processing.
[0046] Candidate values with low confidence levels indicate that the data is severely degraded in at least one dimension (such as transmission latency far exceeding the threshold, insufficient acquisition frequency, or the device being in a continuous alarm state). Direct use of such values may lead to answers that deviate significantly from the actual situation on site. In this case, the system automatically reverts to the most recent high-confidence historical version and adds a "Revert to Historical Version" flag to the output answer.
[0047] The values of the first threshold (e.g., 0.85) and the second threshold (e.g., 0.6) are determined by grid search based on the real-time data quality annotation samples of the power grid, ensuring that the optimal gating effect can be achieved in different power grid business scenarios.
[0048] The power grid knowledge graph is constructed as follows: (1) The BERT model was used to extract equipment entities, fault entities, parameter entities, and operation entities from the static data of the power grid. The BERT (Bidirectional Encoder Representations from Transformers) model is a pre-trained language model based on bidirectional Transformers, which can effectively capture semantic information in text and is suitable for named entity recognition tasks. The static data of the power grid (including equipment operation and maintenance manuals, fault handling cases, industry standards and specifications, equipment parameter ledgers, etc.) was input into the BERT model, and after fine-tuning, the output results labeled with entity types were generated.
[0049] (2) A graph neural network is used to extract the relationships between entities from the static data of the power grid. The graph neural network can process graph structure data and extract relationships such as “transformer-includes-winding”, “line-occurs-tripping fault”, and “fault-corresponding-handling steps” by learning the representation of the edges (relationships) between nodes (entities).
[0050] (3) Supplement the static attribute layer of each entity with static attribute values from the power grid static data, such as the transformer model, capacity, rated voltage, cause of fault, and processing time.
[0051] In a preferred embodiment, the power grid static data undergoes text cleaning, terminology standardization, and field integrity verification sequentially before entity extraction, and a data quality score is calculated using the following formula. : In the formula, The percentage of valid characters retained after text cleaning relative to the original number of characters. The percentage of terms that match the power grid terminology dictionary out of the total number of identified terms is used. This refers to the proportion of non-empty required fields to the total number of required fields. , , The weights are set to a minimum, and the sum of the three is 1. The weight values can be determined by the business priorities in the power grid sector.
[0052] Static power grid data with a quality score not less than a preset qualified threshold (e.g., 0.85) will be used to construct the power grid knowledge graph. Data with a quality score lower than the threshold will be returned for manual review or discarded to avoid low-quality data affecting the accuracy of the knowledge graph.
[0053] Step S104: When the target attribute has at least two candidate values from different data sources participating in subsequent data processing, normalize the data by multiplying the data source authority weight, real-time confidence level, and corresponding grade weight coefficient of each candidate value, and take the candidate value with the largest normalization result as the final value.
[0054] Specifically, the normalization result is calculated using the following formula: In the formula, For the k-th candidate value, The data source authority weight for the k-th candidate value. The real-time confidence level of the k-th candidate value. The weight coefficient (i.e., the first weight or the second weight) is the level weight coefficient corresponding to the k-th candidate value. The comprehensive confidence weight for the k-th candidate value; the final value is... The candidate value corresponding to the maximum.
[0055] Data source authority weight The reliability of the data source can be preset, for example, SCADA master station > sub-station > third-party data source, and Σω is normalized.
[0056] In a preferred embodiment, if the difference between the largest and second-largest normalized results is less than a preset difference threshold (e.g., 0.1), it is determined to be difficult to resolve, and a conflict flag is written to the target attribute. When generating the answer, the conflict flag and the prompt text "This data has multiple source discrepancies" are added to the answer. When the proportion of conflict events exceeds a preset alarm threshold (e.g., 5%), an alarm is triggered, prompting operations and maintenance personnel to analyze high-frequency conflicting data sources and optimize the authority weight configuration of data sources.
[0057] Step S105: The values to be used in subsequent data processing are added as quadruples to the current version of the target attribute in the dynamic attribute layer of the target entity in the power grid knowledge graph, and the original current version of the target attribute is converted to a historical version.
[0058] The four-tuple includes: attribute value, effective timestamp, data source identifier, and real-time confidence level.
[0059] Specifically, each dynamic attribute value is recorded as a quadruple. Where value is the attribute value. The effective timestamp is (i.e., the moment the value is adopted and written into the knowledge graph), src is the data source identifier (which SCADA / EMS data source the value originates from), and conf is the real-time confidence level of the value (i.e., the value calculated in step S102). ).
[0060] Old values are not deleted but archived as historical versions, thus supporting historical backtracking and auditing at any point in time. Each attribute maintains a record based on its effective timestamp. Sorted version chain When it is necessary to query the attribute value at a certain moment T, retrieve... The latest version.
[0061] In the power grid knowledge graph, the attributes of each entity are divided into a dynamic attribute layer and a static attribute layer: Static attribute layer: Stores nameplate parameters such as model, capacity, rated voltage, and wiring method. It is updated only with the static knowledge base and is not modified in real time. Dynamic attribute layer: Stores dynamic data such as real-time voltage, real-time current, real-time power, real-time load, operating status, alarm information, and trip type, which are updated incrementally in real time by the SCADA / EMS system.
[0062] Step S106: Output the current version's attribute value as the valid real-time value of the target attribute for use in smart grid Q&A.
[0063] Before real-time power grid monitoring data enters the question-and-answer system, this invention, while retrieving candidate values for target attributes from the real-time power grid monitoring system, simultaneously acquires the data's transmission delay, actual update frequency, and operational stability of the source equipment. These three factors are then weighted and geometrically averaged to form the real-time confidence score of the candidate value, ensuring that each piece of real-time data receives a comparable confidence score, providing a quantitative basis for subsequent tiered processing. Tiered gating is then implemented based on different threshold ranges within which the real-time confidence score falls: high-confidence data is directly adopted, medium-confidence data is adopted with reduced weight and an added timeliness indicator, and low-confidence data is rejected. It automatically reverts to the most recent high-reliability historical version in the knowledge graph, ensuring that the question-answering system has reliable data available under any circumstances. When there are multiple source conflicts for the same attribute, the best candidate value is selected after weighted normalization based on the real-time confidence level and the authority of the data source. This avoids the problems of disconnect between confidence assessment and conflict resolution and inconsistent adjudication logic in traditional solutions. The final adopted value is appended to the current version of the dynamic attribute layer of the knowledge graph in the form of a quadruple containing the attribute value, effective timestamp, data source identifier, and real-time confidence level. The original version is archived and not deleted, supporting data backtracking and auditing at any time.
[0064] In some embodiments of the present invention, in scenarios triggered by user questions, the smart power grid question-and-answer data processing method further includes: Based on the user's question, static knowledge is retrieved from the static attribute layer and static knowledge documents of the power grid knowledge graph. The static knowledge is then assembled with the effective real-time value into the same context and input into the power grid question-and-answer model to obtain the answer and send it to the terminal.
[0065] This includes recalling static knowledge, such as the nameplate parameters, alarm thresholds, and handling procedures of the target entity; assembling the static knowledge and valid real-time values into the same context and inputting it into the power grid question-and-answer model, including: the power grid question-and-answer model comparing the valid real-time values with the alarm thresholds to generate an answer. For example, when the valid real-time value is "#1 main transformer current load 85MW" and the alarm threshold is "80MW", the model obtains both the real-time value (85MW) and the threshold (80MW) in the context, and can determine that the equipment is in an overload state and generate corresponding alarm prompts and handling suggestions.
[0066] When the valid real-time values are derived from the current version of the dynamic attribute layer of the power grid knowledge graph, the static knowledge of associated entities and the current version of the dynamic attribute layer of associated entities are retrieved along the entity relationships of the target entity, and added to the context. For example, when querying the load of "#1 main transformer", the static parameters and real-time load of the #1 line can be retrieved along the relationship of "#1 main transformer - connection - #1 line", realizing cross-device association reasoning.
[0067] After obtaining the answer, it also includes: labeling the answer with the data source identifier of the valid real-time value, the effective timestamp and real-time confidence level, as well as the source document identifier of the static knowledge, to ensure that every component of the answer is traceable.
[0068] In this embodiment of the invention, the training process of the power grid question-answering model is as follows: (1) Open-source general-purpose large language models such as Qwen are selected as the basic models. Such models have mature natural language understanding and generation capabilities, support transfer learning fine-tuning, and can quickly adapt to the needs of the power grid field.
[0069] (2) Input the static training data of the power grid into the basic large language model for domain pre-training to obtain the domain pre-trained model. The pre-training stage focuses on optimizing the model's ability to understand power grid professional terms, equipment parameters and industry standards. The parameters are set as learning rate 1e-5, batch size 32, training rounds 50, and cross-entropy loss function.
[0070] (3) Input the power grid question-answering training samples into the domain pre-trained model and fine-tune the model to obtain the power grid question-answering model. In the fine-tuning stage, optimize the model for the logic of generating answers to power grid questions, with parameters set as learning rate 5e-6, batch size 16, and training rounds 30.
[0071] The loss function for instruction fine-tuning is: In the formula: Cross-entropy loss is used to ensure the model's ability to generate token-by-token data from static text on the power grid. To compare the learning loss, the InfoNCE approach is adopted, using question-answer pairs as positive samples and different answers to similar questions as negative samples. This approach brings similar questions and correct answers closer together in the representation space and keeps similar questions and incorrect answers further apart, thereby improving the discriminative power of complex fault question-answering. For the power grid domain-specific loss, it is defined as the deviation between the embedding vector of the professional concept in the answer output by the power grid question-answering model and the standard embedding vector of the corresponding concept in the power grid knowledge graph, penalizing errors in professional terms / concepts (such as AGC, SVG, zero-sequence protection, etc.); a and b are weighting coefficients.
[0072] In a preferred embodiment, The weight is fixed at 1 (the baseline language capability cannot be weakened). The weight 'a' is set to 0.6 (to enhance the ability to distinguish between questions and answers). The weight b is set to 0.3 (as a regularization term for professional concepts; excessive weights can sacrifice fluency). The weight value was determined through multiple iterations of training experiments using a large-scale model fine-tuning experiment in the vertical domain of the power grid.
[0073] The validation set data is input into the fine-tuned model to calculate core indicators such as question-answering accuracy and response speed. If the accuracy is lower than the preset threshold (e.g., 90%), the model is automatically decayed according to the learning rate and retrained by increasing the number of training rounds until the indicators meet the target. Finally, a power grid-specific question-answering model is output.
[0074] The present invention also provides an intent recognition and traffic splitting method based on data structure state awareness.
[0075] When a data retrieval request is triggered by a user question, the smart grid question-answering method also includes: 1. User issues received by the receiving terminal; 2. Perform intent recognition and entity recognition on user questions to determine the target entity and target attributes corresponding to the user questions, and query whether the target attributes have historical version chains, multi-source identifiers, and cross-device associated outgoing edges in the dynamic attribute layer of the power grid knowledge graph; 3. If none of the three conditions are met, the user's problem type is determined as the first processing type. The current value of the target attribute is queried from the power grid real-time monitoring system, and the current value is output as the valid real-time value. This path is a "light link," which directly queries the current value of the SCADA / EMS system without knowledge graph storage or versioning. It has low latency and simple processing, and is suitable for problems that only require a certain current value of the device and do not involve historical data or multi-source discrepancies.
[0076] 4. If at least one of the three conditions exists, the user's problem processing type is determined as the second processing type, and the process of obtaining candidate values, calculating confidence, hierarchical gating, multi-source resolution, and versioned storage described in steps S102 to S106 of the aforementioned embodiments is executed. This path is a "re-linked" approach, which deposits real-time data into the knowledge graph after complete confidence calibration, gating, multi-source resolution, and time-series versioning. It is suitable for complex problems involving historical backtracking, multi-source adjudication, auditing, or cross-device correlation reasoning.
[0077] The routing mechanism is not based on manually defined business requirement classifications, but rather on the system's objective query results of the data storage structure in the knowledge graph. The query checks whether the target attribute has a historical version chain (indicating whether historical backtracking is involved), whether it has multi-source identifiers (indicating the possibility of multi-source conflicts), and whether it has cross-device associated outgoing edges (indicating whether cross-device reasoning is involved). If none of these three exist, the attribute's data structure is in its simplest state: "only a single current value, no history, no conflicts, and no associations." In this case, a lightweight routing path is sufficient. If any of these three exist, it indicates that the attribute involves more complex data processing requirements, necessitating a heavyweight routing path to ensure data integrity, verification, and traceability.
[0078] It should be noted that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0079] The present invention also provides a smart power grid question-and-answer data processing device. Figure 2 This is a schematic diagram of the structure of a smart power grid question-and-answer data processing device provided by the present invention, as shown below. Figure 2 As shown, the smart power grid question-and-answer data processing device includes: The data retrieval response module 201 is used to determine the target entity and the target attribute in response to a data retrieval request for the target attribute of the target entity; The confidence calculation module 202 is used to obtain the candidate values of the target attribute reported by the real-time power grid monitoring system, and calculate the real-time confidence for each candidate value. The real-time confidence is synthesized by a weighted geometric average of the normalized transmission delay factor, the normalized update frequency factor and the equipment operation stability factor. The values of the normalized transmission delay factor, the normalized update frequency factor and the equipment operation stability factor are all in the range of 0 to 1. The hierarchical gating module 203 is used to perform the following hierarchical gating operations based on the threshold range into which the real-time confidence level falls: If the real-time confidence level is not less than the first threshold, the candidate value is marked as a high confidence level and participates in subsequent data processing with the first weight. If the real-time confidence level is less than the first threshold and not less than the second threshold, the candidate value is marked as medium confidence level, participates in subsequent data processing with the second weight, and a timeliness identifier is added to the candidate value. The second weight is less than the first weight, and the second threshold is less than the first threshold. If the real-time confidence level is less than the second threshold, the candidate value is rejected, and the most recent historical version of the target attribute with a real-time confidence level not less than the first threshold is read from the power grid knowledge graph. The attribute value of this historical version is used to replace the candidate value for subsequent data processing. The conflict resolution module 204 is used to normalize the target attribute when there are at least two candidate values from different data sources participating in subsequent data processing, by multiplying the data source authority weight, real-time confidence level and corresponding grade weight coefficient of each candidate value, and taking the candidate value with the largest normalization result as the final value; the grade weight coefficient is the first weight or the second weight. The versioned storage module 205 is used to append the values to be used in subsequent data processing as quadruples to the current version of the target attribute in the dynamic attribute layer of the target entity in the power grid knowledge graph, and to convert the original current version of the target attribute into a historical version. The quadruples include the attribute value, the effective timestamp, the data source identifier, and the real-time confidence level. The attributes of each entity in the power grid knowledge graph are divided into the dynamic attribute layer and the static attribute layer. The attribute values of the static attribute layer are not modified by the power grid real-time monitoring system. Output module 206 is used to output the attribute value of the current version as the valid real-time value of the target attribute for use in smart grid question answering.
[0080] In some embodiments of the present invention, the data retrieval request is triggered by a user question, and the device further includes: The problem receiving module is used to receive user problems sent by the terminal; The query module is used to perform intent recognition and entity recognition on the user question, determine the target entity and target attribute corresponding to the user question, and query whether the target attribute exists in the dynamic attribute layer of the power grid knowledge graph, whether it has a historical version chain, whether it has a multi-source identifier, and whether it has cross-device associated outgoing edges. The first type determination module is used to determine the processing type of the user problem as the first processing type if none of the three exist, query the current value of the target attribute from the power grid real-time monitoring system, and output the current value as the valid real-time value. The second type determination module is used to determine the processing type of the user problem as the second processing type if at least one of the three conditions exists, and to execute the acquisition of candidate values of the target attribute reported by the power grid real-time monitoring system and subsequent steps.
[0081] In some embodiments of the present invention, the apparatus further includes: The knowledge assembly module is used to recall static knowledge from the static attribute layer and static knowledge documents of the power grid knowledge graph based on the user's question, assemble the static knowledge and the effective real-time value into the same context and input it into the power grid question-answering model to obtain the answer and send it to the terminal; wherein, the recall of static knowledge includes recalling the nameplate parameters, alarm thresholds and handling procedures of the target entity; the assembly of the static knowledge and the effective real-time value into the same context and inputting it into the power grid question-answering model includes: the power grid question-answering model compares the effective real-time value and the alarm threshold and generates the answer; The context update module is used to recall the static knowledge of the associated entities and the current version of the dynamic attribute layer of the associated entities along the entity relationships of the target entity when the effective real-time value comes from the current version of the dynamic attribute layer of the power grid knowledge graph, and add them to the context.
[0082] In some embodiments of the present invention, the normalized transmission delay factor Determine using the following formula: In the formula, The time delay from the generation of the candidate value to its arrival at the server. The maximum allowable delay; The normalized update frequency factor Determine using the following formula: In the formula, The actual reporting frequency of the target attribute. The preset reporting frequency for the target attribute; The equipment operation stability factor Determine using the following formula: In the formula, This represents the total number of samples taken from the target entity within a preset time period. The number of samples without alarms within the preset time period; The real-time confidence level Determine using the following formula: In the formula, w1, w2, and w3 are the weights of the normalized transmission delay factor, the normalized update frequency factor, and the device operation stability factor, respectively, and w1+w2+w3=1. w1, w2, and w3 are determined by grid search from real-time data samples with quality labels.
[0083] In some embodiments of the present invention, the apparatus further includes: The conflict marker writing module is used to write a conflict marker for the target attribute after taking the candidate value with the largest normalization result as the final value, provided that the difference between the largest normalization result and the second largest normalization result is less than a preset difference threshold. The answer tagging module is used to attach the conflict tag and the prompt text "This data has multiple sources of disagreement" to the answer when it is generated.
[0084] In some embodiments of the present invention, the power grid knowledge graph is constructed in the following manner: The static power grid data undergoes text cleaning, terminology standardization, and field integrity verification in sequence, and a data quality score is calculated using the following formula. : In the formula, The percentage of valid characters retained after text cleaning relative to the original number of characters. The percentage of terms that match the power grid terminology dictionary out of the total number of identified terms is used. This refers to the proportion of non-empty required fields to the total number of required fields. , , The weights are 1, and the sum of the three is 1. Static power grid data with a quality score not less than a preset qualified threshold are considered valid static data. The BERT model is used to extract equipment entities, fault entities, parameter entities, and operation entities from the effective static data. A graph neural network is used to extract the relationships between the entities from the valid static data; The effective static data is used to supplement the attribute values of the static attribute layer for each entity.
[0085] In some embodiments of the present invention, the apparatus further includes: The strategy caching module is used to cache generated answers and corresponding user questions according to the least recently used strategy. The time comparison module is used to read the effective timestamp of the valid real-time value corresponding to the answer in the cache when the received user question hits the cache, and compare the effective timestamp with the current time; The answer delivery module is used to deliver the cached answer to the terminal if the difference between the effective timestamp and the current time is less than a preset duration. The execution module is returned to the step of determining the target entity and the target attribute in response to the data call request for the target entity's target attribute if the difference between the effective timestamp and the current time is not less than the preset duration.
[0086] It should be noted that the module division in the various smart grid question-and-answer data processing devices provided in the above embodiments is illustrative and only represents one logical functional division. In actual implementation, other division methods may also be used. Furthermore, the functional modules in the various embodiments of this invention can be integrated into a single processor, exist as separate physical entities, or be integrated into a single module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0087] If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the technical solution of the embodiments of the present invention can be embodied in the form of a computer program product, which is stored in a computer storage medium and includes several instructions to cause an electronic device or processor to execute all or part of the steps of the methods in the various embodiments of the present invention. The aforementioned computer storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0088] The power grid intelligent question-and-answer data processing device and the power grid intelligent question-and-answer data processing method provided in the above embodiments belong to the same concept. The power grid intelligent question-and-answer data processing device can execute the power grid intelligent question-and-answer data processing method provided in the foregoing embodiments of the present invention, and has the corresponding functional modules and beneficial effects of executing the power grid intelligent question-and-answer data processing method. The specific implementation process is detailed in the method embodiments, and will not be repeated here.
[0089] Figure 3 This is a schematic diagram of an electronic device provided by the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0090] like Figure 3As shown, the electronic device includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer programs stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0091] Multiple components in the electronic device are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, optical disk, etc.; and a communication unit 19, such as a network card, modem, wireless transceiver, etc. The communication unit 19 allows the electronic device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0092] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as the smart grid question-answering data processing method.
[0093] In some embodiments, the smart grid question-and-answer data processing method can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on an electronic device via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the smart grid question-and-answer data processing method described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the smart grid question-and-answer data processing method by any other suitable means (e.g., by means of firmware).
[0094] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0095] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0096] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0097] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0098] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0099] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0100] This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the smart grid question-and-answer data processing method provided in any embodiment of this application.
[0101] In implementing the computer program product, computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof. Programming languages include object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0102] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0103] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for intelligent question-and-answer data processing in power grids, characterized in that, include: In response to a data retrieval request for a target attribute of a target entity, the target entity and the target attribute are determined; The candidate values of the target attribute reported by the real-time power grid monitoring system are obtained, and a real-time confidence score is calculated for each candidate value. The real-time confidence score is synthesized by a weighted geometric average of a normalized transmission delay factor, a normalized update frequency factor, and a device operation stability factor. The values of the normalized transmission delay factor, the normalized update frequency factor, and the device operation stability factor are all in the range of 0 to 1. Based on the threshold range into which the real-time confidence level falls, perform the following hierarchical gating operation: If the real-time confidence level is not less than the first threshold, the candidate value is marked as a high confidence level and participates in subsequent data processing with the first weight. If the real-time confidence level is less than the first threshold and not less than the second threshold, the candidate value is marked as medium confidence level, participates in subsequent data processing with the second weight, and a timeliness identifier is added to the candidate value. The second weight is less than the first weight, and the second threshold is less than the first threshold. If the real-time confidence level is less than the second threshold, the candidate value is rejected, and the most recent historical version of the target attribute with a real-time confidence level not less than the first threshold is read from the power grid knowledge graph. The attribute value of this historical version is used to replace the candidate value for subsequent data processing. When the target attribute has at least two candidate values from different data sources participating in subsequent data processing, the data is normalized by the product of the data source authority weight, real-time confidence level, and corresponding grade weight coefficient of each candidate value, and the candidate value with the largest normalization result is taken as the final value; the grade weight coefficient is the first weight or the second weight. The values to be used in subsequent data processing will be appended as quadruples to the current version of the target attribute in the dynamic attribute layer of the target entity in the power grid knowledge graph, and the original current version of the target attribute will be converted to a historical version. The quadruples include the attribute value, effective timestamp, data source identifier, and real-time confidence. The attributes of each entity in the power grid knowledge graph are divided into the dynamic attribute layer and the static attribute layer. The attribute values of the static attribute layer are not modified by the power grid real-time monitoring system. The attribute value of the current version is output as the valid real-time value of the target attribute for use in smart grid question answering.
2. The power grid intelligent question-and-answer data processing method according to claim 1, characterized in that, The data retrieval request is triggered by a user question, and the method further includes: The user's question was sent by the receiving terminal; The user question is subjected to intent recognition and entity recognition to determine the target entity and target attribute corresponding to the user question, and to query whether the target attribute has a historical version chain, a multi-source identifier, or a cross-device associated edge in the dynamic attribute layer of the power grid knowledge graph; If none of the three exist, the processing type of the user problem is determined as the first processing type, the current value of the target attribute is queried from the power grid real-time monitoring system, and the current value is output as the valid real-time value. If at least one of the three conditions is met, the processing type of the user problem is determined to be the second processing type, and the candidate values of the target attribute reported by the power grid real-time monitoring system and subsequent steps are executed.
3. The power grid intelligent question-and-answer data processing method according to claim 2, characterized in that, Also includes: Based on the user's question, static knowledge is retrieved from the static attribute layer and static knowledge documents of the power grid knowledge graph. This static knowledge is then assembled with the valid real-time value into a single context and input into the power grid question-and-answer model to obtain an answer, which is then sent to the terminal. The retrieval of static knowledge includes retrieving the nameplate parameters, alarm thresholds, and handling procedures of the target entity. Assembling the static knowledge with the valid real-time value into a single context and inputting it into the power grid question-and-answer model includes: the power grid question-and-answer model comparing the valid real-time value with the alarm threshold to generate the answer. If the valid real-time value originates from the current version of the dynamic attribute layer of the power grid knowledge graph, the static knowledge of the associated entities and the current version of the dynamic attribute layer of the associated entities are recalled along the entity relationships of the target entity, and added to the context.
4. The power grid intelligent question-and-answer data processing method according to any one of claims 1-3, characterized in that, The normalized transmission delay factor Determine using the following formula: In the formula, The time delay from the generation of the candidate value to its arrival at the server. The maximum allowable delay; The normalized update frequency factor Determine using the following formula: In the formula, The actual reporting frequency of the target attribute. The preset reporting frequency for the target attribute; The equipment operation stability factor Determine using the following formula: In the formula, This represents the total number of samples taken from the target entity within a preset time period. The number of samples without alarms within the preset time period; The real-time confidence level Determine using the following formula: In the formula, w1, w2, and w3 are the weights of the normalized transmission delay factor, the normalized update frequency factor, and the device operation stability factor, respectively, and w1+w2+w3=1. w1, w2, and w3 are determined by grid search from real-time data samples with quality labels.
5. The power grid intelligent question-and-answer data processing method according to any one of claims 1-3, characterized in that, After selecting the candidate value with the largest normalized result as the final value, the following steps are also included: If the difference between the largest and second largest normalized results is less than a preset difference threshold, a conflict flag is written for the target attribute. When generating an answer, the conflict marker and the message "This data has multiple sources of disagreement" are attached to the answer.
6. The power grid intelligent question-and-answer data processing method according to any one of claims 1-3, characterized in that, The power grid knowledge graph is constructed in the following manner: The static power grid data undergoes text cleaning, terminology standardization, and field integrity verification in sequence, and a data quality score is calculated using the following formula. : In the formula, The percentage of valid characters retained after text cleaning relative to the original number of characters. The percentage of terms that match the power grid terminology dictionary out of the total number of identified terms is used. This refers to the proportion of non-empty required fields to the total number of required fields. , , The weights are 1, and the sum of the three is 1. Static power grid data with a quality score not less than a preset qualified threshold are considered valid static data. The BERT model is used to extract equipment entities, fault entities, parameter entities, and operation entities from the effective static data. A graph neural network is used to extract the relationships between the entities from the valid static data; The effective static data is used to supplement the attribute values of the static attribute layer for each entity.
7. The power grid intelligent question-and-answer data processing method according to any one of claims 1-3, characterized in that, Also includes: Cache the generated answers and corresponding user questions according to the least recently used strategy; If the received user question hits the cache, read the effective timestamp of the valid real-time value corresponding to the answer in the cache, and compare the effective timestamp with the current time; If the difference between the effective timestamp and the current time is less than a preset duration, the answer in the cache will be sent to the terminal. If the difference between the effective timestamp and the current time is not less than the preset duration, the cache hit is rejected, and the process returns to the step of responding to the data call request for the target attribute of the target entity and determining the target entity and the target attribute.
8. A smart power grid question-and-answer data processing device, characterized in that, include: The data retrieval response module is used to respond to a data retrieval request for a target attribute of a target entity and to determine the target entity and the target attribute. The confidence calculation module is used to obtain the candidate values of the target attribute reported by the real-time power grid monitoring system, and calculate the real-time confidence for each candidate value. The real-time confidence is synthesized by a weighted geometric average of the normalized transmission delay factor, the normalized update frequency factor, and the equipment operation stability factor. The values of the normalized transmission delay factor, the normalized update frequency factor, and the equipment operation stability factor are all in the range of 0 to 1. The hierarchical gating module is used to perform the following hierarchical gating operations based on the threshold range into which the real-time confidence level falls: If the real-time confidence level is not less than the first threshold, the candidate value is marked as a high confidence level and participates in subsequent data processing with the first weight. If the real-time confidence level is less than the first threshold and not less than the second threshold, the candidate value is marked as medium confidence level, participates in subsequent data processing with the second weight, and a timeliness identifier is added to the candidate value. The second weight is less than the first weight, and the second threshold is less than the first threshold. If the real-time confidence level is less than the second threshold, the candidate value is rejected, and the most recent historical version of the target attribute with a real-time confidence level not less than the first threshold is read from the power grid knowledge graph. The attribute value of this historical version is used to replace the candidate value for subsequent data processing. The conflict resolution module is used to normalize the target attribute when there are at least two candidate values from different data sources participating in subsequent data processing, by multiplying the data source authority weight, real-time confidence level and corresponding level weight coefficient of each candidate value, and taking the candidate value with the largest normalization result as the final value; the level weight coefficient is the first weight or the second weight. The versioned storage module is used to append the values to be used in subsequent data processing as quadruples to the current version of the target attribute in the dynamic attribute layer of the target entity in the power grid knowledge graph, and to convert the original current version of the target attribute into a historical version. The quadruples include the attribute value, effective timestamp, data source identifier, and real-time confidence. The attributes of each entity in the power grid knowledge graph are divided into the dynamic attribute layer and the static attribute layer. The attribute values of the static attribute layer are not modified by the power grid real-time monitoring system. The output module is used to output the attribute value of the current version as the valid real-time value of the target attribute for use in smart grid question answering.
9. An electronic device, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the smart grid question-and-answer data processing method as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the smart grid question-and-answer data processing method as described in any one of claims 1-7.
