Question and answer method, device and non-volatile storage medium for electrical fire risk knowledge
By employing a question-and-answer method for knowledge of power fire risks, and utilizing natural language understanding models and intelligent agent technology, the problem of scattered power fire risk information has been solved, enabling efficient and intelligent risk assessment and response, and improving the intelligence and refinement of power fire safety management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- STATE GRID BEIJING ELECTRIC POWER CO
- Filing Date
- 2026-04-15
- Publication Date
- 2026-06-19
AI Technical Summary
The fragmented nature of power fire safety risk information makes it difficult to conduct risk Q&A through natural language interaction. The decision-making process is lengthy, the interaction efficiency is low, and there is a lack of traceable professional evidence, making it impossible to shift from post-event response to pre-event prediction.
The question-and-answer method for electrical fire risk knowledge is adopted. By receiving natural language text, the intent type is determined by a pre-set natural language understanding model. It is then determined whether to reuse existing risk assessment results. Based on the intent type and analysis path, the natural language text is decomposed into sub-tasks, which are then input into the intelligent agent to output the question results.
It has realized intelligent risk assessment based on natural language, which has improved the intelligence level of risk assessment and the efficiency of operation and maintenance response, ensured the timeliness and accuracy of assessment results, and supported the upgrading of power fire safety management towards intelligence, refinement and dialogue.
Smart Images

Figure CN122240791A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power safety technology, and more specifically, to a question-and-answer method, apparatus, and non-volatile storage medium for power fire risk knowledge. Background Technology
[0002] Safe production is the fundamental guarantee for the high-quality development of the energy and power industry. As a typical complex and massive project, the power grid system's operation highly relies on the synergistic effects of various equipment and environmental factors, characterized by its large scale, multiple structural levels, and continuously changing operating states. In the scenario of mega-city power grids, substations are densely distributed, transmission and distribution lines crisscross, and load operation is highly concentrated, resulting in fire safety risks that are highly concealed, have a wide impact, and have serious consequences. Currently, fire risk management generally relies on manual inspections, static reports, and experience-based judgment. Systems often adopt a decentralized construction model, with data on equipment operation monitoring, weather forecasts, vegetation cover, on-site operations, and hazard management distributed across different business systems. This lack of unified data structures, coding rules, and semantic expressions, coupled with a lack of a unified knowledge governance system, makes it difficult to integrate and collaboratively analyze risk information across sources.
[0003] Currently, the human-computer interaction layer only supports passive querying and information display. It cannot understand complex questions raised by users through natural language, such as "Where is the current risk?", "What are the causes of the risk?", "Is there an escalation trend?", and "What measures should be taken?". The decision-making process is lengthy and the interaction efficiency is low. Business personnel need to repeatedly log into multiple systems to compare data, which is highly subjective and prone to overlooking key risk-related clues. In addition, risk assessment lacks traceable professional basis, and the early warning mechanism is mainly passively triggered, failing to realize the transformation from "post-event response" to "pre-event prediction and proactive service." It also cannot generate structured and interpretable risk analysis conclusions, which restricts the upgrading of power grid fire safety management towards intelligence, refinement, and dialogue.
[0004] There is currently no effective solution to the above problems. Summary of the Invention
[0005] This invention provides a question-and-answer method, apparatus, and non-volatile storage medium for electrical fire risk knowledge, in order to at least solve the technical problem that the current dispersed electrical fire risk information makes it difficult to conduct risk question-and-answer through natural language interaction.
[0006] According to one aspect of the present invention, a question-and-answer method for knowledge of electrical fire protection risks is provided, comprising: receiving natural language text input based on a target account; inputting the natural language text into a preset natural language understanding model to determine the intent type; determining, based on the intent type, whether to reuse existing risk assessment results to obtain a judgment result; determining an analysis path based on the judgment result; decomposing the task corresponding to the natural language text into sub-tasks according to the analysis path; and inputting the sub-tasks and natural language text into an intelligent agent to output the question result.
[0007] Optionally, the natural language text is input into a preset natural language understanding model to determine the intent type, including: obtaining the context information corresponding to the natural language text; inputting both the context information and the natural language text into the preset natural language understanding model to determine semantic information, wherein the semantic information includes at least business object entities and comparison relation words; and determining the intent type based on the semantic information, wherein the intent type includes at least one of the following: risk status query, risk cause analysis, risk trend assessment, prevention and control measure suggestions, and result comparison verification.
[0008] Optionally, based on the intent type, a determination is made as to whether to reuse the existing risk assessment results, and the determination result is obtained, including: when the intent type is a risk status query, determining the target business object and target time range based on natural language text; querying the business object and time range corresponding to the existing risk assessment results from a preset database; and determining that the determination result is to reuse the existing risk assessment results if the business object and time range corresponding to the existing risk assessment results match the target business object and target time range.
[0009] Optionally, based on the intent type, a determination is made as to whether to reuse the existing risk assessment result, and the determination result is obtained, including: when the intent type is an intent type other than risk status query, based on a preset database, determining whether the context information corresponding to the natural language text contains business objects and time windows that match the business objects and time ranges corresponding to the existing risk assessment result; when the context information contains business objects and time windows that match the business objects and time ranges corresponding to the existing risk assessment result, obtaining the assessment interval duration with respect to the existing risk assessment result; when the assessment interval duration does not exceed a preset timeliness threshold, determining that the determination result is to reuse the existing risk assessment result; and / or, when the assessment interval duration exceeds the preset timeliness threshold, determining that the determination result is not to reuse the existing risk assessment result.
[0010] Optionally, multi-source data of the power system are collected; the multi-source data are input into the fusion model of the analytic hierarchy process and the fuzzy comprehensive evaluation method, and the fire risk value, the corresponding risk level, and the weight distribution of multiple risk factors are output. Among them, the multiple risk factors include at least equipment aging, ambient temperature and humidity, and combustible gas concentration; the collection period corresponding to the multi-source data is obtained; and the preset database is updated based on the collection period, the fire risk value, the corresponding risk level, and the weight distribution of multiple risk factors.
[0011] Optionally, the process of inputting subtasks and natural language text into an agent and outputting a query result includes: encapsulating the input parameters corresponding to the subtasks and the natural language text to obtain the structured context corresponding to the agent, wherein the agent includes at least one of the following: a fire protection professional knowledge agent, a risk prediction and early warning agent, a chart generation agent, and a report generation agent; inputting the structured context corresponding to the agent into the corresponding agent to obtain the output result corresponding to the agent; and determining the query result based on the output result corresponding to the agent.
[0012] According to another aspect of the present invention, a question-and-answer device for electrical fire risk knowledge is also provided, comprising: a receiving module for receiving natural language text input based on a target account; an input module for inputting the natural language text into a preset natural language understanding model to determine the intent type; a judgment module for determining whether to reuse existing risk assessment results based on the intent type to obtain a judgment result; a determination module for determining an analysis path based on the judgment result; a decomposition module for decomposing the task corresponding to the natural language text into sub-tasks according to the analysis path; and an output module for outputting the question result based on the sub-tasks and the natural language text input into an intelligent agent.
[0013] According to another aspect of the present invention, a non-volatile storage medium is also provided, the non-volatile storage medium including a stored program, wherein, when the program is running, the device where the non-volatile storage medium is located executes any of the above-described question-and-answer methods for electrical fire risk knowledge.
[0014] According to another aspect of the present invention, a computer device is also provided, the computer device including a processor, the processor being configured to run a program, wherein the program, when running, executes any of the above-described question-and-answer methods for electrical fire risk knowledge.
[0015] According to another aspect of the present invention, a computer program product is also provided, including a computer program that, when executed by a processor, implements the question-and-answer method for any of the above-described electrical fire risk knowledge.
[0016] In this embodiment of the invention, a question-and-answer method for power fire risk knowledge is adopted. This method involves receiving natural language text input from a target account; inputting the natural language text into a preset natural language understanding model to determine the intent type; determining whether to reuse existing risk assessment results based on the intent type; determining an analysis path based on the judgment result; decomposing the task corresponding to the natural language text into sub-tasks according to the analysis path; and inputting the sub-tasks and natural language text into an intelligent agent to output the question result. This achieves the goal of interactive question-and-answer based on natural language, thereby improving the intelligence level of risk assessment and the efficiency of operation and maintenance response. Furthermore, it solves the technical problem that the current dispersed power fire risk information makes it difficult to conduct risk question-and-answer through natural language interaction. Attached Figure Description
[0017] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0018] Figure 1 A hardware block diagram of a computer terminal for implementing a question-and-answer method for knowledge of electrical fire risk is shown.
[0019] Figure 2 This is a flowchart illustrating a question-and-answer method for electrical fire safety risk knowledge provided in an embodiment of the present invention.
[0020] Figure 3 This is a structural block diagram of a question-and-answer device for electrical fire risk knowledge provided in an embodiment of the present invention. Detailed Implementation
[0021] 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.
[0022] 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.
[0023] According to an embodiment of the present invention, a method embodiment of a question-and-answer method for electrical fire risk knowledge is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0024] The method embodiment provided in Embodiment 1 of this application can be executed on a mobile terminal, computer terminal, or similar computing device. Figure 1 A hardware block diagram of a computer terminal for implementing a question-and-answer method for knowledge of electrical fire safety risks is shown. Figure 1 As shown, the computer terminal 10 may include one or more processors (shown as 102a, 102b, ..., 102n in the figure) (the processor may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0025] It should be noted that the aforementioned one or more processors and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10. As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0026] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the question-and-answer method for power fire risk knowledge in this embodiment of the invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the above-mentioned question-and-answer method for power fire risk knowledge in the application. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0027] The display can be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10.
[0028] Figure 2 This is a flowchart illustrating a question-and-answer method for electrical fire safety risk knowledge provided in an embodiment of the present invention, as shown below. Figure 2 As shown, the method includes the following steps:
[0029] Step S202: Receive natural language text based on input from the target account.
[0030] In this step, natural language text input by the user based on the target account can be received through a preset interface. This natural language text can be queries, inquiries, or instructions regarding power fire safety risks expressed in natural language. The text may include inquiries about specific equipment (e.g., "What are the recent risks of the 35kV main transformer?"), regions (e.g., "Are the vegetation hazards around the energy storage power station increasing?"), time dimensions (e.g., "What is the risk trend over the past week?"), or prevention and control measures (e.g., "How can this risk be reduced?").
[0031] Step S204: Input the natural language text into the preset natural language understanding model to determine the intent type.
[0032] In this step, the natural language text is input into a pre-defined natural language understanding model. This is achieved through a deep learning-based semantic parsing engine (such as BERT, RoBERTa, or a domain-fine-tuned large language model) deployed at the system's front end, which performs fine-grained semantic analysis on the user's original text. The model first performs word segmentation, syntactic structure recognition, and entity extraction on the text, identifying key elements such as risk objects (device name, location), time range (recent, past week, next three days), behavioral intent (query, analysis, warning, suggestion), and modifiers (such as "why is it high", "how to reduce it", "is there a trend").
[0033] Building upon this foundation, the model integrates a professional semantic system within the power and fire protection field to accurately categorize user intents into preset intent types. These include: risk status queries ("What is the current risk level of a certain substation?"), cause analysis ("Why is this transformer's risk score so high?"), trend assessment ("Has the risk of cable trenches increased in the past month?"), prevention and control suggestions ("What measures should be taken in response to high temperatures?"), result comparison ("Which has a greater risk, station A or station B?"), or report generation ("Generate a fire risk report for the energy storage station this week"). This intent recognition process not only relies on keyword matching but also understands the user's potential needs through contextual modeling. Even if the input statement contains colloquial, elliptical, or ambiguous expressions, the system can still accurately map it to the standard intent category. This provides precise semantic guidance for subsequent analysis path selection, agent scheduling, and knowledge retrieval, ensuring that the system response is highly consistent with the user's true intent and avoiding misjudgments and invalid responses.
[0034] This process does not rely on manual rules or fixed keyword matching, but instead relies on the model to directly understand the inherent semantic structure of natural language expressions, thereby transforming diverse user questions into preset intent type classifications, providing clear instruction guidance for subsequent targeted analysis path generation and agent scheduling.
[0035] Step S206: Based on the intent type, determine whether to reuse the existing risk assessment results and obtain the judgment result.
[0036] In this step, based on the intent type, the system determines whether to reuse existing risk assessment results, thus obtaining a judgment result. The system identifies whether the intent relies on existing risk assessment data based on the user's input intent category, such as risk status query, cause analysis, or trend judgment. If the intent type points to the confirmation of the status or continuity analysis of a known risk object, it determines that the previously calculated risk value, level, and factor weights can be reused. If the intent type involves a completely new object or an unassessed scenario, it determines that the assessment process needs to be retried. This judgment process does not rely on specific algorithm execution or data retrieval; it directly derives the decision on whether to reuse the data based solely on the intent classification result, ultimately forming a clear judgment result to guide the generation of subsequent analysis paths.
[0037] Specifically, after clarifying the user's intent, the system first examines whether the business objects, timeframes, and analytical dimensions involved in the intent are completely or highly similar to the most recently executed risk assessment results already existing in the system in terms of time, space, and semantics. For example, if a user asks, "What is the fire risk level of the 35kV main transformer today?", and the system completed the latest assessment of the main transformer based on real-time monitoring data 10 minutes ago, the result can be directly reused without recalculating the algorithm. Conversely, if a user asks, "What is the fire risk trend of the energy storage power station last Friday?", and the system currently only has today's data, it needs to determine whether there is a historical assessment archive. If so, it is reused; otherwise, a recalculation process is triggered. The system compares the entities, time windows, analytical granularity in the intent with the metadata of existing assessment results (such as assessment ID, timestamp, input data source, and algorithm version), combined with preset timeliness rules (such as "the validity period of the risk assessment result is 15 minutes") and consistency verification logic, and finally outputs two judgment results: "reusable" or "requires recalculation". This mechanism effectively avoids redundant calculations for the same scenario, significantly reduces system load, improves response speed, and ensures the coherence of the dialogue context and the consistency of evaluation results. It is a key decision-making step in achieving efficient, intelligent, and low-latency question-and-answer services.
[0038] Step S208: Based on the judgment result, determine the analysis path.
[0039] In this step, determining the analysis path based on the judgment result means that after the system obtains a clear decision of "reusing existing assessment results" or "recalculation is required," it dynamically constructs a complete execution flow from user intent to final output, i.e., the "analysis path." If the judgment result is "reusable," the system will skip the recalculation stage of the risk assessment algorithm and directly call the latest cached assessment data, such as risk value, level, key factor weights, historical trends, and matched knowledge base, and organize subsequent tasks around this existing data. For example, if the user intent is "to explain why this device has a high risk," the path will directly lead to the "knowledge reasoning agent" and the "interpretive output module," combining the assessment results to generate natural language analysis; if the user intent is "to generate a chart to show the trend over the past 5 days," the path will schedule the "chart generation agent" to draw a line chart using historical assessment data.
[0040] If the judgment result is "recalculation required," the system will initiate a complete analysis path: First, it acquires the latest multi-source monitoring data, such as temperature, smoke detection, work records, and meteorological information. Then, it conducts a dynamic risk assessment, generating new risk quantification results. Next, it sequentially enters sub-processes such as "trend analysis," "knowledge matching," "agent collaboration," and "result fusion," ensuring the timeliness and accuracy of the assessment results. The determination of the entire analysis path depends not only on the judgment result but also on user intent type, contextual state (such as historical dialogues and objects of interest), agent availability, and system resource load, forming an optimal, efficient, and business-logic-compliant execution chain. This achieves an intelligent driving mechanism of "reusing results when available, calculating when no results are available, and guiding when there is demand," thereby ensuring that the system can still provide professional, accurate, and traceable risk analysis services even with millisecond-level response times.
[0041] Step S210: Based on the analysis path, the task corresponding to the natural language text is decomposed into subtasks.
[0042] In this step, the task corresponding to the natural language text is decomposed into sub-tasks according to the analysis path. This is the core mechanism of this invention to achieve a closed loop of intelligent question answering and dynamic risk assessment. The specific implementation process is as follows:
[0043] When the system receives natural language text input from the user (e.g., "Why has the fire risk score of the power distribution room increased from 58 to 82 in the past three days?"), the intent recognition module first performs semantic analysis on the text, identifying it as a composite intent of "cause analysis" and "trend judgment." It then combines this with historical assessment records of the power distribution room stored in the system to determine if a current risk assessment covering the "past three days" time window is available. If the system contains the latest and complete assessment data for that period (e.g., assessment within 24 hours), the analysis path is determined to be "reuse existing results"; otherwise, if no data is available or the data is outdated (e.g., not updated for more than 48 hours), the analysis path is determined to be "reassessment required."
[0044] After determining the analysis path, the system activates the task decomposition module. Based on a pre-defined intent-path template library, it automatically breaks down the user request into a set of atomic subtasks with clearly defined inputs and outputs, execution order, responsible parties, and constraints. This decomposition process is entirely automated by the system logic without manual intervention. The specific steps are as follows:
[0045] Step 1: Extract semantic elements and construct the task context:
[0046] The system extracts structured elements from natural language input: the risk object is "power distribution room", the time range is "the past three days", the analysis target is "the reasons for the risk increase", and associates them with the current dialogue context (such as the user previously querying the "yesterday risk level" of the power distribution room) to form a metadata set containing object ID, time window, intent label, and context reference, which serves as the boundary basis for the subsequent subtask division.
[0047] Step 2: Match the task decomposition template to determine the set of subtasks:
[0048] Based on the intent-path combination of "causal analysis + need for reassessment," the system automatically invokes a pre-defined task template. This template specifies that the following seven sub-tasks must be executed sequentially: data collection, risk assessment, factor extraction, knowledge retrieval, causal explanation generation, chart generation, and result consistency verification. If the path is "trend analysis + result reuse," only three sub-tasks need to be executed: historical data retrieval, trend calculation, and chart generation, achieving dynamic adaptation of task granularity.
[0049] Step 3: Decompose each task into executable atomic subtasks:
[0050] The system transforms abstract task items in the template into unambiguous, concrete operation instructions that can be executed independently by the intelligent agent. Each subtask contains a clearly defined executor, input source, output format, and operational constraints.
[0051] 1. Data Acquisition Subtask: Executed by the data access module, this substation calls the power data platform to acquire equipment operation data (such as busbar temperature, switchgear temperature rise, and cabinet humidity) for the past three days, environmental data (station temperature and humidity, wind speed), fire equipment status (smoke alarm count, fire extinguisher pressure), and surrounding environmental information (vegetation obstruction distance, recent hot work records). The substation is then output as a standardized, time-aligned, and noise-reduced structured dataset.
[0052] 2. Risk Assessment Subtask: This is executed by the risk prediction and early warning intelligent agent. It inputs the above data into an enterprise-level risk assessment algorithm (such as a fusion model based on the analytic hierarchy process and fuzzy comprehensive evaluation) to calculate the daily risk score, risk level (low / medium / high / extremely high) and the weight of each risk factor (such as "insulation aging" accounting for 45%, "poor ventilation" accounting for 30%, and "frequent operation" accounting for 20%), and generates an assessment result set containing three days of time series.
[0053] 3. Key Factor Extraction Subtask: Executed by the risk prediction and early warning intelligent agent, it automatically extracts the top three key risk factors by weight from the assessment results of the third day (the current highest risk day), and marks their values and threshold comparisons (such as "temperature exceeds limit by 12℃") to form an attribution basis list for subsequent reasoning.
[0054] 4. Fire Safety Knowledge Retrieval Subtask: This subtask is executed by a fire safety knowledge agent. It takes the first three extracted risk factors and their descriptions of exceeding the standard as input, and performs semantic vector matching in the constructed fire safety knowledge base through the RAG mechanism (using the cosine similarity algorithm with a threshold of ≥0.85) to retrieve relevant legal provisions and expert governance suggestions. It also ensures that each search result is labeled with its source number and applicable scenario.
[0055] 5. Causal Explanation Generation Subtask: Executed by a fire protection professional knowledge agent, based on the list of key factors and retrieved professional evidence, combined with risk trends (such as "stable increase for three consecutive days"), it generates a natural language explanation according to the prompt word constraints. The content must include: risk change trend, contribution ratio of core factors, reference to standards, and mechanism explanation (such as "insulation aging + poor ventilation together lead to local overheating, which meets the composite risk judgment conditions of GB 50016 Article X"). Subjective assumptions or generalized expressions that are detached from data are prohibited.
[0056] 6. Chart Visualization Subtask: Executed by the chart generation agent, this subtask plots the three days' risk score data into a line chart, plots the weights of the three major factors on the third day into a stacked bar chart, and plots the trends of environmental temperature and load changes into a dual-axis correlation chart. All charts are then labeled with titles, axis labels, data source identifiers, generation time, and unique device codes to ensure strict consistency between the visualization content and the evaluation results.
[0057] 7. Result Consistency Verification and Fusion Subtask: Executed by the Result Fusion and Consistency Control Module, this subtask cross-validates the outputs of the first six subtasks: verifying whether the factor weights are consistent with the evaluation model output, whether the knowledge references truly correspond to the analyzed factors, whether the chart data reflects the original scores, and whether there are any logical contradictions (e.g., one agent says "risk is due to increased temperature," while another says "due to equipment aging" without supporting data). After successful verification, a unified, reliable, and deliverable comprehensive analysis result package is synthesized, including structured JSON, natural language explanations, visualization charts, and a complete list of supporting sources.
[0058] Step 4: Establish a task dependency graph to achieve intelligent scheduling:
[0059] The system constructs a task dependency graph, clearly defining the execution order: data collection is the root node and must be executed first; risk assessment and factor extraction depend on data collection; knowledge retrieval and chart generation can be performed in parallel after factor extraction; causal explanation and consistency verification must be initiated after all prerequisite tasks are completed. Based on this, the system schedules tasks, enabling parallel execution of independent tasks and sequential execution of strongly dependent tasks, thus improving overall response efficiency.
[0060] This invention, through the aforementioned task decomposition process, accurately transforms ambiguous natural language questions into structured, executable, and verifiable intelligent analysis sequences, thereby achieving intelligent response capabilities in power fire protection scenarios.
[0061] Step S212: Input the subtask and natural language text into the agent and output the question result.
[0062] In this step, each agent performs reasoning tasks under strict cue word engineering constraints. For example, the risk prediction and early warning agent only makes objective statements based on the input quantitative assessment results and never adds subjective judgments. The fire protection knowledge agent only cites authoritative text matched and verified by the RAG mechanism and may not fabricate or speculate on its own.
[0063] After all agents complete their outputs, the generated results are uniformly submitted to the result fusion and consistency control module. This module does not perform new inference but only executes three checks: First, rule check, confirming whether the output of each agent conforms to its preset prompt word constraints, such as whether the knowledge agent only uses knowledge base content and whether the chart contains complete metadata; second, logic check, comparing the outputs of different agents for contradictions, such as inconsistencies between risk assessment results and chart trends, or conflicts between factor weights and expert interpretations. If inconsistencies are found, the system automatically marks an anomaly and initiates a backtracking mechanism; third, confidence and source check, verifying whether knowledge citations pass the semantic matching threshold (cosine similarity ≥ 0.85), whether the data comes from a trusted system, and whether there is low-confidence or unverified content. Only when all outputs pass the checks is the system recognized as a reliable final result.
[0064] After confirming the consistency and reliability of the results, the system activates the final response generation module. Using the fused, credible information as its core, and combining it with the user's original natural language question, it constructs a clear, semantically coherent, and authoritative natural language response. Guided by the user's intent, this response organizes its language according to the logical sequence of "direct answer—supporting evidence—trend judgment—prevention and control suggestions—visual prompts," ensuring that the user not only obtains the conclusion but also understands its source and logic.
[0065] While outputting the above response, the system automatically generates an "Analysis and Source Tracing Summary," recording the complete processing chain upon which this response depends: including the original question content, analysis path (e.g., "causal analysis + recalculation required"), all executed sub-tasks and their completion status, the data source system and evaluation model version used, the unique identifier of each fire protection code or case referenced, the names of the participating agents, and the final result of consistency verification. This summary is appended to the end of the response in the form of copyable text or a QR code, ensuring that every intelligent Q&A meets the compliance requirements of "process traceability, verifiable basis, and delineable responsibility" in the power industry's safety management.
[0066] Thus, the system has completed a closed-loop process from natural language input to agent-based collaborative reasoning and structured response output. This process does not rely on human intervention or introduce external subjective judgment. All conclusions are anchored in data, algorithms, standards, and knowledge bases, breaking through the limitations of traditional question-answering systems that rely on keyword matching or static answer databases. It has constructed the first truly agent-driven question-answering system for power fire protection scenarios.
[0067] As an optional embodiment, natural language text is input into a preset natural language understanding model to determine the intent type, including: obtaining context information corresponding to the natural language text; inputting both the context information and the natural language text into the preset natural language understanding model to determine semantic information, wherein the semantic information includes at least business object entities and comparison relation words; and determining the intent type based on the semantic information, wherein the intent type includes at least one of the following: risk status query, risk cause analysis, risk trend assessment, prevention and control measure suggestions, and result comparison verification.
[0068] Optionally, the system will receive raw natural language text input by the user, such as "Why has the fire risk score of a certain 35kV transformer increased from 58 to 82 in the last three days?" Based on this, the system automatically extracts contextual information related to the text from the dialogue state management module. This contextual information includes: the historical rounds of the current dialogue (e.g., if the user previously queried yesterday's risk value for the transformer), the timestamp and score of the equipment's most recent complete risk assessment, the substation number, the current operating condition label (e.g., "operating at full load" or "recent hot work"), and business metadata such as the loaded risk assessment model version. This contextual information is continuously maintained by the system to ensure that semantic understanding has context-aware capabilities.
[0069] Next, the system semantically fuses the original natural language text with the extracted contextual information to construct a unified input sequence, which is then input into a pre-defined natural language understanding model. This model is a deep semantic understanding model based on the Transformer architecture, which has been fine-tuned and reinforced on professional corpora such as fire protection specifications, equipment terminology, and typical risk descriptions in the power industry, and possesses strong generalization capabilities to recognize entities, relationships, and intentions. The model performs semantic encoding and attention analysis on the fused input, outputting a set of high-dimensional semantic representations from which key semantic information is accurately extracted. This includes at least: business object entities, such as entity nouns that clearly point to power facilities or operational scenarios, such as "35kV transformer," "distribution room B area," and "energy storage battery cluster C"; and comparative relation words, such as semantic keywords used to express numerical changes, time comparisons, or state differences, such as "rise," "increase," "compared to last time," "in the last three days," and "from…to…." These semantic elements together constitute the basic semantic unit for intention recognition.
[0070] After extracting semantic information, the system determines the intent type based on preset intent classification rules and the confidence distribution output by the model. This classification process is based on a joint judgment of semantic patterns and contextual clues, and the specific recognition rules are as follows:
[0071] When the semantic information only contains the business object entity and the current risk value or level description, without involving changes, causes, or comparisons, it is judged as a risk status query, such as "What is the current risk level of the main transformer?";
[0072] When semantic information contains business object entities, comparative relation words, and implicitly asks about the reasons for the change (such as "why", "what is the reason", "suddenly increased"), it is judged as a risk cause analysis, such as "Why did the risk rise from 58 to 82 in the past three days?";
[0073] When semantic information contains time span words (such as "the past week" or "the next two days"), trend verbs (such as "continuously rising" or "tending to worsen"), or inquiries about the rate of change, it is judged as a risk trend assessment, such as "Will the risk in this area continue to rise?";
[0074] When the semantic information contains directive or advisory wording (such as "what should be done", "how to prevent and control", "what measures are recommended"), and the semantics point to risk management, it is determined to be a recommendation for prevention and control measures, such as "what measures should be taken in response to this high risk?";
[0075] When semantic information contains explicit comparisons of multiple objects or time points (such as "compared to last month", "compared to the neighboring station", "which is higher"), and the system is required to perform a difference assessment, it is judged as a result comparison verification, such as "how much higher is the risk of this transformer than last year?".
[0076] The system scores the five types of intents in parallel and selects the category with the highest confidence as the intent type of the current request. The system then outputs the tag, the extracted business object entity, the comparison relation words, and the context information in a structured manner as the input basis for the subsequent task decomposition module.
[0077] By integrating context and natural language text, it breaks through the limitations of traditional keyword matching, accurately understands complex semantics that are vague, colloquial, and span time, effectively identifies implicit causal intentions, and improves the accuracy of subsequent results.
[0078] As an optional embodiment, based on the intent type, it is determined whether to reuse the existing risk assessment results to obtain the judgment result, including: when the intent type is a risk status query, determining the target business object and target time range based on natural language text; querying the business object and time range corresponding to the existing risk assessment results from a preset database; and determining the judgment result as reusing the existing risk assessment results if the business object and time range corresponding to the existing risk assessment results match the target business object and target time range.
[0079] Optionally, when the natural language understanding model determines that the user's intent type is a risk status query, that is, when the user's current request is "to obtain the current risk status of a certain device or area at a certain moment or time period", the system will then start the reuse judgment process to avoid redundant calculations, improve response efficiency and ensure assessment consistency.
[0080] Based on the semantic information contained in the current natural language text, the system can accurately extract the target business object and the target time range. The target business object refers to the power equipment or scenario entity explicitly mentioned by the user or implied in the context, such as "35kV main transformer A", "110kV substation east area", "energy storage compartment #3", etc. The target time range is identified through time modifiers or semantic structures in the text, such as "current", "most recent", "last three days", "last Friday 14:00", "April 3, 2025", etc. The system standardizes these into a unified timestamp interval, such as "2025-04-03 00:00:00 to 2025-04-03 23:59:59". Subsequently, based on a preset risk assessment result database, which stores all completed and verified risk assessment records, each record can contain structured fields such as: the identified business object being assessed, the start and end times of the assessment, the output risk value, the risk level, the weight of key factors, the assessment model version, the data source, and the generation timestamp. The system uses the extracted target business object and target time range as query conditions to search for historical assessment records that completely match or highly cover the target time range. During the search, the system employs a fuzzy time alignment mechanism: if a user queries "the last three days," and the database contains complete assessment results from "April 1, 2025 to April 3, 2025," and these results are the latest automatically calculated results, then the time range is considered a match. If a user queries "current," the system automatically matches the latest valid assessment record for that object in the database, regardless of whether its generation time is within 10 minutes; as long as a new data update mechanism is not triggered, it is considered a valid reuse. For business objects, the system supports device aliases, code mapping, and topology attribution identification. When the search results contain one or more historical assessment records whose business objects and target time ranges are completely consistent with or completely cover the target time range within the system's preset tolerance range, the system determines that the existing risk assessment result can be reused and marks the assessment record as "reusable." If no matching record exists, or the historical record is too old, the data source is incomplete, the model version is inconsistent, or the time range is partially missing, then it is determined that "recalculation is required." Once determined to be "reused", the system will directly call the historical assessment result as the core input for subsequent dialogue responses, knowledge reasoning and visualization, and will no longer trigger the risk assessment algorithm to run again.
[0081] The above steps significantly improve response efficiency. For a large number of high-frequency, repetitive risk status queries, the system does not need to repeatedly execute time-consuming risk assessment algorithms, meeting the real-time requirements of high-frequency interaction scenarios such as dispatch centers and maintenance teams.
[0082] As an optional embodiment, based on the intent type, determining whether to reuse existing risk assessment results and obtaining the determination result includes: when the intent type is an intent type other than risk status query, determining, based on a preset database, whether the context information corresponding to the natural language text contains business objects and time windows that match the business objects and time ranges corresponding to the existing risk assessment results; when the context information contains business objects and time windows that match the business objects and time ranges corresponding to the existing risk assessment results, obtaining the assessment interval duration with respect to the existing risk assessment results; when the assessment interval duration does not exceed a preset timeliness threshold, determining that the determination result is to reuse the existing risk assessment results; and / or, when the assessment interval duration exceeds the preset timeliness threshold, determining that the determination result is not to reuse the existing risk assessment results.
[0083] Optionally, when the system determines through a natural language understanding model that the user's intent does not fall under "risk status query," i.e., it identifies the user's current need as in-depth risk analysis, dynamic evolution, causal inference, or strategy recommendations, the system will not directly reuse the results but will need to evaluate the applicability of existing assessment results. First, the system extracts the target business object and the implicit time window from the context information associated with the current natural language text. This business object may be equipment explicitly mentioned by the user (such as "35kV main transformer A"), or it may be an entity referred to in the context (such as "the energy storage compartment mentioned earlier"); the time window needs to be inferred from semantics, such as "the past week," "the last three assessments," "since the last maintenance," "within the past 24 hours," etc., and the system standardizes them into a start and end timestamp range.
[0084] Next, the system accesses the pre-set risk assessment result database to search for whether there are any historical assessment records that have been generated and verified within the time window for the business object. If multiple historical assessment results exist, the system will select the one with the most complete time range and the most recent assessment time as the candidate for reuse. If no matching record is found, it will be directly determined as "not to be reused" and the reassessment process will begin.
[0085] If a matching record exists, the system calculates the evaluation interval for that existing evaluation result, i.e., the time elapsed since the evaluation result was generated. This time is calculated automatically by the system and is expressed in minutes or hours, based on the timeliness requirements of the power fire protection scenario. For example, for areas with stable equipment conditions, the preset timeliness threshold is 6 hours; for areas with frequent hot work operations or significant impacts from sudden weather changes, the threshold is 1 hour; and for high-risk equipment (such as oil-immersed transformers and cable trenches), the threshold is 30 minutes.
[0086] The system then compares the evaluation interval with the preset timeliness threshold:
[0087] If the assessment interval does not exceed the preset timeliness threshold, it indicates that the assessment result is still timely and representative in the current context. The system determines that the result is a reuse of the existing risk assessment result and uses it as the underlying basis for subsequent analysis. For example, if a user asks, "What are the reasons for the recent increase in risk of this transformer?", and the system finds that the most recent assessment was generated 20 minutes ago and is still valid, it will directly call that result and enter the knowledge reasoning and factor analysis process without recalculation, thereby improving response speed and logical consistency.
[0088] If the assessment interval exceeds the preset timeliness threshold, the system determines that the existing risk assessment results will not be reused and triggers the risk assessment algorithm to run again to obtain dynamic assessment results based on the latest monitoring data, ensuring that subsequent causal analysis, trend judgment or prevention and control recommendations are all based on the latest and most accurate data.
[0089] In the case of "not reused", the system will still record the original evaluation results as a contextual reference to compare the differences between the old and new and to help explain the trend of change, but it will no longer be used as a direct basis for the analysis conclusion.
[0090] Through the above steps, in scenarios such as risk cause analysis and trend judgment, using outdated data may incorrectly attribute risks caused by equipment aging to recent operations or underestimate the impact of sudden weather events. By employing a timeliness threshold mechanism, the system ensures that all analyses are based on assessment results "within the validity period," synchronizing reasoning logic with the actual evolution of risks and enhancing the system's decision support capabilities in complex scenarios.
[0091] As an optional embodiment, multi-source data of the power system is collected; the multi-source data is input into a fusion model of the analytic hierarchy process and the fuzzy comprehensive evaluation method, and the fire risk value, the corresponding risk level, and the weight distribution of multiple risk factors are output. Among them, the multiple risk factors include at least equipment aging, ambient temperature and humidity, and combustible gas concentration; the collection period corresponding to the multi-source data is obtained; and the preset database is updated based on the collection period, the fire risk value, the corresponding risk level, and the weight distribution of multiple risk factors.
[0092] Optionally, multi-source heterogeneous data related to fire risks can be automatically collected from various business platforms and sensing terminals within the power system. Data sources include, but are not limited to: substation equipment online monitoring systems (such as transformer oil temperature, winding temperature, and partial discharge data), environmental sensor networks (temperature and humidity sensors, smoke detectors, and combustible gas concentration detectors), equipment inspection records (infrared thermal imaging reports and defect logs), historical fault and fire case databases, work permit management systems (hot work time and area), meteorological service platforms (lightning warnings, wind speed, and precipitation), and equipment lifecycle management systems (service life, maintenance cycles, and replacement records). All data is uniformly accessed through a data platform in structured or semi-structured formats, and timestamp alignment and quality verification are performed to remove outliers, missing values, and duplicate data, ensuring the integrity and reliability of the input data.
[0093] After data collection, the system inputs the preprocessed multi-source data into a hybrid evaluation model that integrates the Analytic Hierarchy Process (AHP) and the Fuzzy Comprehensive Evaluation Method (FCE). This model first constructs a hierarchical evaluation index system based on the experience of power fire protection experts and industry standards. The top layer is the target layer, "Comprehensive Fire Protection Risk," the middle layer consists of primary indicators (such as equipment status, environmental conditions, operational behavior, and management measures), and the bottom layer comprises quantifiable sub-factors, including core factors such as equipment aging (characterized by years of operation, insulation degradation rate, and infrared anomaly frequency), environmental temperature and humidity (mapped from real-time temperature and humidity sensor data combined with equipment tolerance thresholds), and combustible gas concentration (converted from SF6 leak monitoring, hydrogen detector readings, and lower explosive limit percentage). The Analytic Hierarchy Process (AHP) is used to determine the relative weights of indicators at each level. A stable weight vector is generated through expert scoring and consistency testing (CI < 0.1). The fuzzy comprehensive evaluation method transforms the actual observed values of each factor into membership functions. Triangular fuzzy numbers or Gaussian membership functions are used to describe the fuzzy boundaries of "low, medium, and high" risk levels. Weighted synthesis is performed in combination with the weights to finally output a fire risk value between 0 and 100. The corresponding risk level is determined according to the preset level classification rules (e.g., 0–30 is low risk, 31–60 is medium risk, 61–85 is high risk, and 86–100 is extremely high risk). At the same time, the normalized contribution weight of each core factor is output, i.e., the risk factor weight distribution, which clarifies the degree to which each factor drives the overall risk.
[0094] The system synchronously records the data collection period for this assessment, i.e., the time range of all input data, such as "April 3, 2025, 14:00 to 14:15," ensuring that the assessment results have a clear time anchor. This collection period, along with the assessment generation time and model version, is bound to the assessment results as metadata. After completing the assessment calculation, the system writes the obtained fire risk value, risk level, weight distribution of multiple risk factors, and corresponding collection period into a preset risk assessment result database. The database uses a time-series data structure for storage, and each record includes: unique equipment identifier, assessment start and end time, risk value, risk level, equipment aging weight, ambient temperature and humidity weight, combustible gas concentration weight, other auxiliary factor weights, data source identifier, assessment model version number, and system generation timestamp. This database supports high-concurrency writes, time range indexing, and version tracing, ensuring that historical records are searchable, comparable, and traceable. After the update is completed, the system automatically triggers data redundancy verification to confirm that the new record has been persisted and synchronized to the cache layer for subsequent intelligent agents to access. If there are duplicate evaluations of the same device and within the same time window, the system will use the latest evaluation as the basis for overwriting, ensuring the uniqueness and timeliness of the data.
[0095] By integrating multi-source data and using AHP-FCE hybrid modeling, a dynamic risk assessment system with factor analysis capabilities, time binding mechanisms, and database linkage capabilities was constructed, providing a solid, reliable, and scalable quantitative foundation for intelligent question answering, proactive early warning, and decision support.
[0096] As an optional embodiment, the process of inputting subtasks and natural language text into an intelligent agent and outputting a question result includes: encapsulating the input parameters corresponding to the subtasks and the natural language text to obtain the structured context corresponding to the intelligent agent, wherein the intelligent agent includes at least one of the following: a fire protection professional knowledge intelligent agent, a risk prediction and early warning intelligent agent, a chart generation intelligent agent, and a report generation intelligent agent; inputting the structured context corresponding to the intelligent agent into the corresponding intelligent agent to obtain the output result corresponding to the intelligent agent; and determining the question result based on the output result corresponding to the intelligent agent.
[0097] Optionally, when the system decomposes the user's original natural language request into standardized sub-tasks through the task parsing module, such as "retrieving historical risk assessment results," "extracting key risk factors," "retrieving relevant regulatory basis," and "generating trend charts," the system initiates a multi-agent collaborative response process to accurately output structured question results that match the user's intent. First, the input parameters relied upon by each sub-task are semantically fused and formatted with the original natural language text to generate a structured context that conforms to the preset input contract of each agent. The input parameters can include device ID, assessment period, risk value sequence, etc.
[0098] For fire protection knowledge agents: the structured context includes semantic tags such as risk level, key factors, and applicable standards, which are used for knowledge matching.
[0099] For risk prediction and early warning intelligent agents: the structured context includes time-series features such as m-day risk trend data, linear regression slope, and predicted risk value on day n;
[0100] For chart generation agents: the structured context includes visualization parameters such as x-axis and y-axis titles, chart type, etc.
[0101] For the report-generating agent: the structured context includes structured elements such as the assessment object, risk trends, core causes, and recommended measures.
[0102] Each agent defines its input format based on a preset prompt template, ensuring that the structured context can be accurately recognized, thus realizing "input is instruction".
[0103] The system schedules corresponding agents to perform inference based on the dependencies between subtasks. For example, the "risk prediction and early warning agent" needs to be executed after the "historical assessment data" is ready, while the "fire protection expertise agent" can be started in parallel with the "chart generation agent".
[0104] For example, after receiving the structured context, the fire protection knowledge agent retrieves standard clauses, accident cases and prevention and control measures related to "high risk caused by equipment aging" from the fire protection knowledge base through the RAG mechanism, and outputs professional explanation text with cited sources.
[0105] The risk prediction and early warning intelligent agent outputs results based on trend data and prediction models. For example: "The risk value is expected to exceed 85 points (high risk threshold) within the next 48 hours, triggering a yellow warning. It is recommended to arrange special inspections in advance."
[0106] The chart generation agent calls the visualization engine to generate a dynamic line chart with a time axis, risk curve, warning threshold line, and data point markers, and outputs it as a Base64 encoded or URL-linked chart object with accompanying captions.
[0107] The report generation agent integrates the aforementioned outputs and generates a structured document according to a standard report template. This document includes modules such as title, assessment summary, trend analysis, causal basis, prevention and control recommendations, and attached charts and links. The output is a text stream in PDF / Word format.
[0108] Each agent's output includes a confidence score and a source identifier to ensure traceability of the results.
[0109] Finally, the output results from each agent are summarized and fed back.
[0110] Through the above steps, the reliance on human experience is effectively reduced, the objectivity, consistency and interpretability of fire risk assessment results are improved, the credibility of risk control conclusions is enhanced, and complex risk assessment results are output in a visualized and structured manner, reducing the threshold for business personnel to understand and use them, improving the efficiency of risk information transmission, and supporting management decisions and process traceability.
[0111] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0112] Through the above description of the embodiments, those skilled in the art can clearly understand that the question-and-answer method for electrical fire safety risk knowledge according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0113] According to embodiments of the present invention, a question-and-answer device for power fire risk knowledge is also provided for implementing the above-described question-and-answer method for power fire risk knowledge. Figure 3 This is a structural block diagram of a question-and-answer device for electrical fire risk knowledge provided according to an embodiment of the present invention, such as... Figure 3 As shown, the question-and-answer device for electrical fire risk knowledge includes: a receiving module 302, an input module 304, a judgment module 306, a determination module 308, a decomposition module 310, and an output module 312. The question-and-answer device for electrical fire risk knowledge will be described below.
[0114] The receiving module 302 is used to receive natural language text input based on the target account.
[0115] The input module 304, connected to the receiving module 302, is used to input natural language text into a preset natural language understanding model to determine the intent type.
[0116] The judgment module 306, connected to the input module 304, is used to determine whether to reuse the existing risk assessment results based on the intent type, and obtain the judgment result.
[0117] The determination module 308, connected to the judgment module 306, is used to determine the analysis path based on the judgment result.
[0118] The decomposition module 310, connected to the determination module 308, is used to decompose the task corresponding to the natural language text into subtasks according to the analysis path.
[0119] The output module 312, connected to the decomposition module 310, is used to input subtasks and natural language text into the agent and output the query results.
[0120] It should be noted that the receiving module 302, input module 304, judging module 306, determining module 308, decomposing module 310, and output module 312 mentioned above correspond to steps S202 to S212 in the embodiments. Multiple modules implement the same instances and application scenarios as their corresponding steps, but are not limited to the content disclosed in the above embodiments. It should also be noted that the above modules, as part of the device, can run in the computer terminal 10 provided in the embodiments.
[0121] Embodiments of the present invention may provide a computer device. Optionally, in this embodiment, the computer device may be located in at least one of a plurality of network devices in a computer network. The computer device includes a memory and a processor.
[0122] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the question-and-answer method and device for power fire risk knowledge in this embodiment of the invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby realizing the aforementioned question-and-answer method for power fire risk knowledge. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to a computer terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0123] The processor can access information and applications stored in the memory via a transmission device to perform the following steps: receiving natural language text input based on the target account; inputting the natural language text into a preset natural language understanding model to determine the intent type; based on the intent type, determining whether to reuse existing risk assessment results and obtaining a judgment result; based on the judgment result, determining an analysis path; decomposing the task corresponding to the natural language text into subtasks according to the analysis path; and inputting the subtasks and natural language text into the agent to output the question result.
[0124] Optionally, the processor may also execute program code for the following steps: inputting natural language text into a preset natural language understanding model to determine the intent type, including: obtaining context information corresponding to the natural language text; inputting both the context information and the natural language text into the preset natural language understanding model to determine semantic information, wherein the semantic information includes at least business object entities and comparison relation words; and determining the intent type based on the semantic information, wherein the intent type includes at least one of the following: risk status query, risk cause analysis, risk trend assessment, prevention and control measure suggestions, and result comparison verification.
[0125] Optionally, the processor may also execute program code that performs the following steps: based on the intent type, determine whether to reuse the existing risk assessment result and obtain the determination result, including: when the intent type is a risk status query, determining the target business object and target time range based on natural language text; querying the business object and time range corresponding to the existing risk assessment result from a preset database; and determining that the determination result is to reuse the existing risk assessment result if the business object and time range corresponding to the existing risk assessment result match the target business object and target time range.
[0126] Optionally, the processor may also execute program code with the following steps: based on the intent type, determine whether to reuse the existing risk assessment result and obtain a judgment result, including: when the intent type is an intent type other than risk status query, based on a preset database, determine whether the context information corresponding to the natural language text contains a business object and time window that matches the business object and time range corresponding to the existing risk assessment result; when the context information contains a business object and time window that matches the business object and time range corresponding to the existing risk assessment result, obtain the assessment interval duration with the existing risk assessment result; when the assessment interval duration does not exceed a preset timeliness threshold, determine that the judgment result is to reuse the existing risk assessment result; and / or, when the assessment interval duration exceeds the preset timeliness threshold, determine that the judgment result is not to reuse the existing risk assessment result.
[0127] Optionally, the processor may also execute program code for the following steps: collecting multi-source data from the power system; inputting the multi-source data into a fusion model of the analytic hierarchy process and the fuzzy comprehensive evaluation method, and outputting fire risk values, corresponding risk levels, and weight distributions of multiple risk factors, wherein the multiple risk factors include at least equipment aging, ambient temperature and humidity, and combustible gas concentration; obtaining the collection period corresponding to the multi-source data; and updating the preset database based on the collection period, fire risk values, corresponding risk levels, and weight distributions of multiple risk factors.
[0128] Optionally, the processor may also execute program code that performs the following steps: inputting subtasks and natural language text into an agent and outputting a query result, including: encapsulating the input parameters corresponding to the subtasks and the natural language text to obtain the structured context corresponding to the agent, wherein the agent includes at least one of the following: a fire protection professional knowledge agent, a risk prediction and early warning agent, a chart generation agent, and a report generation agent; inputting the structured context corresponding to the agent into the corresponding agent to obtain the output result corresponding to the agent; and determining the query result based on the output result corresponding to the agent.
[0129] This invention provides a question-and-answer method for power fire safety risk knowledge. The method involves receiving natural language text input from a target account; inputting the natural language text into a preset natural language understanding model to determine the intent type; determining whether to reuse existing risk assessment results based on the intent type; determining an analysis path based on the judgment result; decomposing the task corresponding to the natural language text into sub-tasks according to the analysis path; and inputting the sub-tasks and natural language text into an intelligent agent to output the question result. This achieves the goal of interactive question-and-answer based on natural language, thereby improving the intelligence level of risk assessment and the efficiency of operation and maintenance response. It also solves the technical problem that the current dispersed power fire safety risk information makes it difficult to conduct risk question-and-answer through natural language interaction.
[0130] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a non-volatile storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0131] Embodiments of the present invention also provide a non-volatile storage medium. Optionally, in this embodiment, the aforementioned non-volatile storage medium can be used to store the program code executed by the question-and-answer method for electrical fire risk knowledge provided in the above embodiments.
[0132] Optionally, in this embodiment, the non-volatile storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.
[0133] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: receiving natural language text input based on the target account; inputting the natural language text into a preset natural language understanding model to determine the intent type; based on the intent type, determining whether to reuse existing risk assessment results to obtain a judgment result; based on the judgment result, determining an analysis path; decomposing the task corresponding to the natural language text into sub-tasks according to the analysis path; and inputting the sub-tasks and natural language text into the agent to output the question result.
[0134] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: inputting natural language text into a preset natural language understanding model to determine the intent type, including: obtaining context information corresponding to the natural language text; inputting both the context information and the natural language text into the preset natural language understanding model to determine semantic information, wherein the semantic information includes at least business object entities and comparison relation words; and determining the intent type based on the semantic information, wherein the intent type includes at least one of the following: risk status query, risk cause analysis, risk trend assessment, prevention and control measure suggestions, and result comparison verification.
[0135] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: determining whether to reuse existing risk assessment results based on intent type, and obtaining a determination result, including: when the intent type is a risk status query, determining the target business object and target time range based on natural language text; querying the business object and time range corresponding to the existing risk assessment results from a preset database; and determining that the determination result is to reuse the existing risk assessment results when the business object and time range corresponding to the existing risk assessment results match the target business object and target time range.
[0136] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: determining whether to reuse existing risk assessment results based on intent type, and obtaining a determination result, including: when the intent type is an intent type other than risk status query, determining whether the context information corresponding to the natural language text contains business objects and time windows that match the business objects and time ranges corresponding to the existing risk assessment results based on a preset database; when the context information contains business objects and time windows that match the business objects and time ranges corresponding to the existing risk assessment results, obtaining the assessment interval duration with respect to the existing risk assessment results; when the assessment interval duration does not exceed a preset timeliness threshold, determining that the determination result is to reuse the existing risk assessment results; and / or, when the assessment interval duration exceeds the preset timeliness threshold, determining that the determination result is not to reuse the existing risk assessment results.
[0137] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: collecting multi-source data from the power system; inputting the multi-source data into a fusion model of the analytic hierarchy process and the fuzzy comprehensive evaluation method, and outputting fire risk values, corresponding risk levels, and weight distributions of multiple risk factors, wherein the multiple risk factors include at least equipment aging, ambient temperature and humidity, and combustible gas concentration; obtaining the collection period corresponding to the multi-source data; and updating the preset database based on the collection period, fire risk values, corresponding risk levels, and weight distributions of multiple risk factors.
[0138] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: inputting subtasks and natural language text into an agent and outputting a query result, including: encapsulating the input parameters corresponding to the subtasks with the natural language text to obtain the structured context corresponding to the agent, wherein the agent includes at least one of the following: a fire protection professional knowledge agent, a risk prediction and early warning agent, a chart generation agent, and a report generation agent; inputting the structured context corresponding to the agent into the corresponding agent to obtain the output result corresponding to the agent; and determining the query result based on the output result corresponding to the agent.
[0139] Embodiments of the present invention also provide a computer program product, including a computer program. Optionally, in this embodiment, when the computer program is executed by a processor, it can: receive natural language text input based on a target account; input the natural language text into a preset natural language understanding model to determine the intent type; based on the intent type, determine whether to reuse existing risk assessment results and obtain a judgment result; based on the judgment result, determine an analysis path; according to the analysis path, decompose the task corresponding to the natural language text into sub-tasks; and based on the sub-tasks and the natural language text input into the agent, output the question result.
[0140] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0141] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0142] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0143] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0144] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0145] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a non-volatile storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0146] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A question-and-answer method for knowledge of electrical fire safety risks, characterized in that, include: Receive natural language text based on input from the target account; The natural language text is input into a preset natural language understanding model to determine the intent type; Based on the intent type, determine whether to reuse the existing risk assessment results, and obtain the judgment result; Based on the judgment results, the analysis path is determined; Based on the analysis path, the task corresponding to the natural language text is decomposed into sub-tasks; Based on the subtask and the natural language text input, the agent outputs the question result.
2. The method according to claim 1, characterized in that, The step of inputting the natural language text into a preset natural language understanding model to determine the intent type includes: Obtain the context information corresponding to the natural language text; The context information and the natural language text are both input into the preset natural language understanding model to determine semantic information, wherein the semantic information includes at least business object entities and comparison relation words; Based on the semantic information, the intent type is determined, wherein the intent type includes at least one of the following: risk status query, risk cause analysis, risk trend assessment, prevention and control measure suggestion, and result comparison and verification.
3. The method according to claim 2, characterized in that, The step of determining whether to reuse existing risk assessment results based on the intent type, and obtaining the determination result, includes: When the intent type is the risk status query, the target business object and target time range are determined based on the natural language text; From the preset database, query the business objects and time ranges corresponding to existing risk assessment results; If the business object and time range corresponding to the existing risk assessment result match the target business object and the target time range, the judgment result is determined to be a reuse of the existing risk assessment result.
4. The method according to claim 3, characterized in that, The step of determining whether to reuse existing risk assessment results based on the intent type, and obtaining the determination result, includes: When the intent type is an intent type other than the risk status query, based on the preset database, it is determined whether the context information corresponding to the natural language text contains a business object and time window that matches the business object and time range corresponding to the existing risk assessment result; If the context information includes business objects and time windows that match the existing risk assessment results, obtain the assessment interval duration corresponding to the existing risk assessment results; If the assessment interval does not exceed a preset timeliness threshold, the judgment result is determined to be a reuse of the existing risk assessment result; And / or, if the assessment interval exceeds the preset time limit, the judgment result is determined to be that the existing risk assessment result is not to be reused.
5. The method according to claim 3, characterized in that, Also includes: Collect multi-source data from the power system; The multi-source data is input into the fusion model of the analytic hierarchy process and the fuzzy comprehensive evaluation method, and the fire risk value, the corresponding risk level, and the weight distribution of multiple risk factors are output. Among them, the multiple risk factors include at least equipment aging, ambient temperature and humidity, and combustible gas concentration. Obtain the collection time period corresponding to the multi-source data; The preset database is updated based on the data collection period, the fire risk value, the corresponding risk level, and the weight distribution of the multiple risk factors.
6. The method according to any one of claims 1 to 5, characterized in that, The process of inputting the subtask and the natural language text into the agent and outputting the query result includes: The input parameters corresponding to the subtask are encapsulated with the natural language text to obtain the structured context corresponding to the agent, wherein the agent includes at least one of the following: fire protection professional knowledge agent, risk prediction and early warning agent, chart generation agent, and report generation agent; The structured context corresponding to the agent is input into the corresponding agent to obtain the output result of the agent. The question result is determined based on the output of the agent.
7. A question-and-answer device for electrical fire safety knowledge, characterized in that, include: The receiving module is used to receive natural language text input based on the target account; The input module is used to input the natural language text into a preset natural language understanding model to determine the intent type; The judgment module is used to determine, based on the intent type, whether to reuse the existing risk assessment result, and obtain the judgment result; The determination module is used to determine the analysis path based on the judgment result; The decomposition module is used to decompose the task corresponding to the natural language text into subtasks according to the analysis path; The output module is used to output the query result based on the subtask and the natural language text input into the agent.
8. A non-volatile storage medium, characterized in that, The non-volatile storage medium includes a stored program, wherein, when the program is executed, it controls the device containing the non-volatile storage medium to perform the question-and-answer method for electrical fire risk knowledge as described in any one of claims 1 to 6.
9. A computer device, characterized in that, include: Memory and processor The memory stores computer programs; The processor is configured to execute a computer program stored in the memory, wherein when the computer program is executed, the processor performs the question-and-answer method for electrical fire protection risk knowledge as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the question-and-answer method for electrical fire protection risk knowledge as described in any one of claims 1 to 6.