Power knowledge question-answering system construction method and system in combination with engineering ethical analysis

By introducing an engineering ethics analysis module into the power knowledge question and answer system, and using P-Tuning to fine-tune the large language model, the problem of insufficient analysis of ethical problems in the power industry is solved, and the ethical compliance and safety of technical solutions is improved.

CN119293185APending Publication Date: 2025-01-10STATE GRID HUBEI ELECTRIC POWER INFORMATION & TELECOMMUNICATION COMPANY

Patent Information

Application Number
CN202411425476.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-12
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

The existing power knowledge Q&A system lacks in-depth analysis when dealing with engineering ethical issues in the power industry, resulting in insufficient identification and management of ethical risks, affecting the intelligence level and safety of the system.

Method used

Using a method combined with engineering ethics analysis, the large language model is fine-tuned through P-Tuning, and a problem understanding and classification module, background knowledge retrieval module, engineering ethics analysis module and question-answer generation module are constructed to realize multi-dimensional ethical analysis of power system problems. and technical answers.

Benefits of technology

It improves the model's ability to identify engineering ethical problems, provides comprehensive and ethical and compliant technical solutions, and improves the safety and sustainable development capabilities of the power system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119293185A_ABST
    Figure CN119293185A_ABST
Patent Text Reader

Abstract

The invention discloses an electric power knowledge question-answering system construction method and system combined with engineering ethical analysis, and the construction method comprises the steps: constructing all modules, and carrying out the fine adjustment of a large language model based on a P-Tuning method, so as to construct an electric power system question-answering knowledge base; the question understanding and classification step is responsible for receiving input questions of a user and performing semantic analysis, technical classification and ethical risk identification on the input questions; searching background knowledge; carrying out engineering ethical analysis; generating questions and answers; and a feedback and improvement step: entering a model tuning stage, and carrying out adaptive tuning on the model by adopting a reinforcement learning framework. According to the method, comprehensive engineering ethical analysis can be carried out on technical schemes and operation suggestions, finally, answers generated by the system are accurate and feasible in technology and have ethical compliance at the same time, it is ensured that a user can balance technical requirements and ethical responsibility in practical application, the intelligent level of an electric power knowledge question-answering system is remarkably improved, and the user experience is improved. And important support is provided for safe operation and sustainable development of the power industry.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method for constructing an electric power knowledge question-and-answer system, and specifically to a method for constructing an electric power knowledge question-and-answer system combined with engineering ethics analysis. The present invention also relates to a construction system for the method for constructing an electric power knowledge question-and-answer system, wherein the construction system is based on a large language model and is intended to provide accurate technical answers to aspects such as the operation, inspection, maintenance, and infrastructure of the electric power system, while conducting a comprehensive analysis of the engineering ethics issues involved. Background Art

[0002] The power industry faces increasingly complex technical challenges in daily operations, equipment maintenance, troubleshooting, and new construction projects. Although traditional knowledge question-answering systems can provide technical support, they usually only focus on technical issues and lack systematic analysis of engineering ethics issues. This disconnect between technology and ethics may lead to the neglect of potential ethical risks in the actual operation of power systems, thereby causing safety hazards, conflicts of interest, or environmental damage.

[0003] In recent years, with the development of artificial intelligence technology, especially large language models, natural language processing technology has been increasingly used in power systems. However, current question-answering systems are mostly limited to technical question-answering, and lack in-depth analysis of engineering ethics issues that are prevalent in the power industry, such as technical ethics, interest ethics, responsibility ethics, and environmental ethics. This not only limits the scope of application of question-answering systems, but also makes it impossible for the power industry to identify and manage ethical risks in a timely and effective manner during the decision-making process.

[0004] Related patent documents: CN117609421A discloses a method for constructing an intelligent question-answering system for electric power expertise based on a large language model. The method collects original dialogue data, constructs an electric power professional corpus, performs incremental fine-tuning and migration training on the large language model in the electric power field, and mounts the electric power knowledge base on the model, ultimately achieving efficient search, question-answering and recommendation of electric power expertise. The method improves the performance of the large language model in tasks in the electric power field by constructing an electric power professional corpus, and improves the accuracy of the model in understanding and generating electric power expertise through incremental fine-tuning technology. Although the patent document provides an effective method for constructing an intelligent question-answering system for electric power expertise, it does not introduce engineering ethics analysis and continuous improvement of the support system.

[0005] CN118245586A discloses a large language model generative knowledge question-answering method in the vertical field of power auditing. The method quickly generates a question-answering training set by constructing an automated annotation tool, and uses a collaborative architecture of large and small language models to achieve intelligent question-answering in the vertical field of power auditing. Through the collaborative work of large and small language models, customized responses are provided for different types of user questions. At the same time, mixed training of structured and unstructured data sets is used to improve the model's ability to understand knowledge in the field of power auditing. This patent document lacks consideration of multiple dimensions such as technical ethics, interest ethics, responsibility ethics, and environmental ethics in the field of engineering ethics, and lacks a mechanism for continuous optimization through user feedback.

[0006] The above technologies do not provide specific technical guidance on how to improve the intelligence level of the power knowledge question and answer system. Summary of the invention

[0007] The purpose of the present invention is to provide a method for constructing an electric power knowledge question and answer system combined with engineering ethics analysis, which can conduct a comprehensive engineering ethics analysis of technical solutions and operational suggestions. Ultimately, the answers generated by the system are not only technically accurate and feasible, but also ethically compliant, ensuring that users can balance technical requirements and ethical responsibilities in actual applications, thereby significantly improving the intelligence level of the electric power knowledge question and answer system and providing important support for the safe operation and sustainable development of the power industry.

[0008] To this end, the present invention also provides a system for constructing an electric power knowledge question-answering system combined with engineering ethics analysis.

[0009] In order to solve the above technical problems, the technical solution adopted by the present invention is as follows:

[0010] A method for constructing an electric power knowledge question-answering system combined with engineering ethics analysis, the technical solution of which is that it includes the following steps:

[0011] S1: Construct a model fine-tuning module and fine-tune the large language model based on the P-Tuning method to build a power system question-answering knowledge base. By fine-tuning the open source large language model (such as LLaMA, BERT, Qwen, etc.), enhance the model's ability to extract keywords in the field of engineering ethics in the power system, thereby providing precise basic support for subsequent question-answering and ethical analysis functions.

[0012] S2: Construct a question understanding and classification module. The question understanding and classification step is responsible for receiving the user's input questions, performing semantic analysis, technical classification, and ethical risk identification, and providing necessary semantic information for subsequent knowledge retrieval and question-answer generation. This step uses a combination of multiple natural language processing (NLP) technologies and algorithms to ensure that the system can accurately understand and handle complex power system problems, especially high-risk problems involving engineering ethics.

[0013] S3: Constructing the background knowledge retrieval module, the system first extracts the possible ethical keywords from the comprehensive semantic representation generated in the question understanding step, and uses the same word embedding and TF-IDF algorithm to identify ethical keywords; the background knowledge retrieval step is responsible for extracting technical background information and ethical background information related to the user's question from the question-answering knowledge base. Through this step, the system can provide comprehensive and accurate background support for subsequent question-answering generation, ensuring the accuracy and relevance of the answer content.

[0014] S4: Construct an engineering ethics analysis module. The core function of this step is to conduct a multi-dimensional ethical analysis of power system-related issues to ensure that the system comprehensively considers technical ethics, interest ethics, responsibility ethics, and environmental ethics while providing technical solutions, thereby improving the safety, reliability, and social responsibility of power system operation, and identifying and quantifying environmental risks through environmental impact assessment and life cycle analysis.

[0015] S5: Construct the question-answer generation module. This step is the core output unit of the system. It is responsible for integrating the technical information retrieved and analyzed in the previous steps with the ethical information to generate accurate, understandable and actionable answers that meet user needs. The design of this step includes two parts: comprehensive information integration and the understandability and operability of the answers, ensuring that the system can provide in-depth and practical suggestions on complex power system issues. Natural language generation (NLG) technology is used to optimize the language expression of the answers to ensure that the generated answers are highly consistent with the original semantics of the user's questions.

[0016] S6: Construct the feedback and improvement module. This step continuously optimizes the system's question-answering performance and engineering ethics analysis capabilities by collecting and analyzing user feedback. The feedback and improvement step, based on the feedback analysis, enters the model tuning stage and uses the reinforcement learning (RL) framework to adaptively tune the model. The feedback and improvement step includes three main parts: feedback collection and analysis, model tuning, and knowledge base update. Through this step, the system can continuously learn and evolve to ensure that it always maintains a high level of accuracy, practicality, and ethical compliance when dealing with power system-related issues.

[0017] In the above technical solution, a preferred technical solution may be that step S1 specifically includes:

[0018] S1.1: Prepare a large-scale question-answering dataset covering the field of power systems. The dataset should include various types of power system technical issues, operating procedures, fault case analysis, ethical issues in engineering decision-making processes, etc. These data come from the power industry's technical documents, operating manuals, industry reports, academic papers, and historical case libraries in the power system; in particular, the dataset needs to cover ethical issues involved in the operation, maintenance, overhaul, infrastructure, etc. of the power system, including technical ethics, interest ethics, responsibility ethics, and environmental ethics.

[0019] S1.2: The system uses the P-Tuning method to fine-tune the large language model. By adding specific prompt templates before inputting questions, the model is guided to focus on and extract key content related to power systems and engineering ethics. For example, in power system maintenance questions, the system can design templates containing "safety assessment" or "risk control" prompts. After receiving these prompts, the model can more accurately identify and extract the key points of engineering ethics involved in the question. During the fine-tuning process, P-Tuning can not only improve the model's ability to extract keywords in the field of engineering ethics, but also optimize the model's performance in semantic understanding, contextual reasoning, and ethical analysis. The fine-tuning process of the model requires a lot of iterative training to ensure that it can provide accurate technical answers and effectively identify potential ethical issues when dealing with complex power system problems. To achieve this goal, the system continuously updates and expands the question-answering data set during the fine-tuning process, and adjusts the prompt templates and optimization parameters based on the P-Tuning method.

[0020] In the above technical solution, a preferred technical solution may also be that step S2 specifically includes:

[0021] S2.1: Perform semantic analysis and preprocessing on questions input by users. Input questions are usually expressed in natural language and may contain complex technical terms and ambiguous expressions. Therefore, the system first uses word segmentation technology to segment the input natural language, and identifies key technical terms and ethics-related vocabulary in the questions through part-of-speech tagging and named entity recognition (NER).

[0022] Specifically, suppose the input question is "How to prevent environmental pollution during substation maintenance?" The system first performs word segmentation on the question to obtain the vocabulary sequence {how to prevent environmental pollution during substation maintenance}. Then, the system identifies entities such as "substation", "maintenance", and "environmental pollution" through NER, and further identifies the grammatical functions of keywords through part-of-speech tagging (POStagging) to determine the main content and focus of the question.

[0023] S2.2: After the semantic analysis is completed, the system performs technical classification and multi-layer semantic analysis on the problem. The technical classification maps the problem to the pre-defined power technology field label through deep learning models such as convolutional neural network (CNN) or recurrent neural network (RNN). The multi-layer semantic analysis uses the Transformer-based multi-head attention mechanism to further analyze the logical structure and deep semantics of the problem. The formula is: Where Q, K, and V are query vectors, key vectors, and value vectors respectively. k is the dimension of the key vector.

[0024] Furthermore, the purpose of technical classification is to classify questions into different technical fields of the power system (such as power generation, transmission, distribution, dispatching, maintenance, overhaul, infrastructure, etc.) so as to call the knowledge base of the corresponding field for subsequent retrieval and answering.

[0025] The implementation of technology classification relies on deep learning models such as convolutional neural networks (CNN) or recurrent neural networks (RNN), which can map input questions to predefined labels of power technology fields based on their semantic features. Assuming the vector representation of the input question is X, the classification model generates the probability distribution P of the technology field through a series of convolution operations or recursive operations:

[0026] P = softmax(W · CNN(X) + b)

[0027] Where W is the weight matrix and b is the bias term. By maximizing the value of P, we can determine the technical field to which the problem is most likely to belong.

[0028] In multi-layer semantic analysis, the system further analyzes the logical structure and deep semantics of the question. The system uses a Transformer-based multi-head attention mechanism to perform semantic association analysis on each part of the input question to capture the implicit logical relationship and key content. The formula of the multi-head attention mechanism is as follows:

[0029]

[0030] Among them, Q, K, and V are query vectors, key vectors, and value vectors respectively. k is the dimension of the key vector. In this way, the system can accurately understand the semantic associations in the question and identify key content, such as the technical core of the question and possible ethical issues.

[0031] S2.3: Based on technical classification and semantic analysis, the system identifies ethical risks in the problem, and infers the possible ethical risk types in the problem through a pre-fine-tuned large model and a specially designed ethical risk classifier, using classification algorithms such as Bayesian Network or Support Vector Machine (SVM); the output of the ethical risk classifier is the probability distribution of various ethical risks: P ethics =f classifier (X semantic ), where X semantic is the semantic feature vector of the input question.

[0032] Furthermore, ethical risk identification is a major feature of the present invention, which aims to identify in advance the engineering ethical issues that may be involved in the problem, such as safety hazards, environmental risks, conflicts of interest and improper distribution of responsibilities.

[0033] The system identifies ethical risks by combining a pre-fine-tuned large model (see step S1) with a specially designed ethical risk classifier. The ethical risk classifier uses classification algorithms such as Bayesian Network or Support Vector Machine (SVM) to infer the possible ethical risk types in the problem based on the semantic features of the input problem and the known ethical problem case library.

[0034] Assume that the semantic feature vector of the input question is X ethics , the output of the ethical risk classifier is the probability distribution P of various ethical risks ethics :

[0035] b ethics =softmax(W ethics ·X ethics +b ethics )

[0036] The system determines the ethical risks that the problem may involve based on the highest probability value and labels it as one or more of technical ethics, interest ethics, responsibility ethics or environmental ethics.

[0037] S2.4: Comprehensive semantic representation and output Finally, the question understanding step combines the semantic parsing results, technical classification results, semantic analysis results and ethical risk identification results obtained in the previous steps to generate a comprehensive semantic representation of the question. This comprehensive representation will be input into the subsequent knowledge retrieval and question-answering generation steps in the form of a vector. The generation formula of the comprehensive semantic representation is as follows:

[0038] X final =concat(X,P,P ethics )

[0039] Among them, X is the vector representation of the original problem, P is the probability distribution of technology classification, and P ethics The probability distribution of ethical risk identification. By combining this information, the system can generate a semantic representation that fully reflects the content of the question, ensuring that the subsequent question-answering process can accurately capture all important dimensions of the question.

[0040] In the above technical solution, a preferred technical solution may also be that step S3 specifically includes:

[0041] S3.1: Technical background information retrieval. The system uses the comprehensive semantic representation generated in the question understanding step to extract the technical keywords in the question. The keyword extraction is based on the word embedding model (Word Embedding) and the TF-IDF weight algorithm. Through the inverted index technology, the technical documents and knowledge graph nodes related to the extended keywords are retrieved from the knowledge base; the core formula of the retrieval process is: score(d,q)=∑ k∈q TF(k,d)·IDF(k)·norm(d), where d is the document, q is the query, TF(k,d) is the frequency of keyword k in document d, IDF(k) is the inverse document frequency of keyword k, and norm(d) is the document length normalization factor.

[0042] Furthermore, technical background information retrieval aims to extract technical information related to the user's question from the system question-answering knowledge base. This step ensures that the system can quickly and accurately find the required technical information through keyword extraction and expansion as well as inverted index and retrieval algorithms. Step S3.1 specifically includes:

[0043] S3.1.1: First, the system uses the comprehensive semantic representation generated by the question understanding step to extract the technical keywords in the question. The extraction of keywords is based on the word embedding model (Word Embedding) and the TF-IDF (Term Frequency-Inverse Document Frequency) weight algorithm to ensure that the extracted keywords can represent the technical core of the question to the greatest extent. For each keyword ki, the system calculates its weight wi in the question:

[0044]

[0045] in, is the frequency of occurrence of keyword ki in the current question, N is the total number of documents in the knowledge base, is the number of documents containing the keyword ki. In this way, the system can identify the most important technical keywords for the problem. After keyword extraction, the system further uses the conceptual hierarchy in the synonym dictionary (such as WordNet) to semantically expand the keywords to increase the comprehensiveness of the retrieval. For example, for the keyword "transformer failure", the system may expand related terms such as "equipment failure" and "power equipment maintenance".

[0046] S3.1.2: Next, the system uses the inverted index technology to retrieve technical documents related to the expanded keywords from the knowledge base. The inverted index maps keywords to a collection of documents containing the keywords, thereby speeding up the retrieval process. The core formula of the retrieval process is as follows:

[0047]

[0048] Among them, d is the document, q is the query, TF(k,d) is the frequency of occurrence of keyword k in document d, IDF(k) is the inverse document frequency of keyword k, and norm(d) is the document length normalization factor. Through this scoring formula, the system sorts all relevant documents and selects several documents with the highest scores as the retrieval results.

[0049] S3.2: Ethical background information retrieval. The system first extracts possible ethical keywords from the comprehensive semantic representation generated by the problem understanding step, uses the same word embedding and TF-IDF algorithm to identify ethical keywords, and uses inverted indexing technology to retrieve relevant ethical background information from the ethical literature library and case library. In addition, the system also considers the timeliness, authority and relevance of the literature and cases to ensure that the retrieved ethical information has practical guiding significance.

[0050] Furthermore, the purpose of ethical background information retrieval is to extract engineering ethics information related to the user's question from the question-answering knowledge base, including technical ethics, interest ethics, responsibility ethics, and environmental ethics. This step ensures that the system can identify and analyze the ethical dimensions in the question and provide users with answers with ethical guidance. Step S3.2 specifically includes:

[0051] S3.2.1: In the process of retrieving ethical background information, the system first extracts the ethical keywords that may be involved from the comprehensive semantic representation generated in the problem understanding step. These keywords may include "safety", "conflict of interest", "division of responsibilities", "environmental impact", etc. The system uses the same word embedding and TF-IDF algorithm as S3.1.1 to identify ethical keywords, and uses the hierarchical relationship of ethical concepts for semantic expansion. For example, for the keyword "safety", the system will expand related ethical concepts such as "personnel safety", "equipment safety", and "operational risks", thereby enriching the search scope.

[0052] S3.2.2: The system uses ethical keywords and extended words to retrieve relevant ethical background information from the ethical literature and case library through inverted indexing technology. The system's retrieval process for ethical literature and cases is similar to that for technical background information retrieval, and uses the same scoring formula for document sorting and selection. In addition, the system also considers the timeliness, authority, and relevance of the literature and cases to ensure that the retrieved ethical information has practical guiding significance. For example, when the system retrieves cases related to "environmental impact", it will give priority to research reports and industry guidelines published by authoritative institutions in recent years.

[0053] S3.3: After completing the retrieval of technical background information and ethical background information, the system integrates the two parts of information to generate comprehensive background information. The system uses a weight model to integrate the technical background and ethical background information. The formula is: B=αT+βE, where B is the comprehensive background information, T is the technical background information, E is the ethical background information, α and β are weight factors, which are dynamically adjusted according to the actual situation of the problem.

[0054] Furthermore, the above-mentioned comprehensive background information includes technical data, operating specifications, ethical specifications, historical cases, etc., which is the core basis for generating answers. The system uses a weight model to integrate technical background and ethical background information to ensure that the final generated answer has both technical depth and ethical guidance. The formula is as follows:

[0055] B final =α×B tech +β×B ethics

[0056] Among them, B final To summarize the background information, B tech For technical background information, B ethics is the ethical background information, α and β are weight factors, which are dynamically adjusted according to the actual situation of the problem.

[0057] In the above technical solution, a preferred technical solution may also be that step S4 specifically includes:

[0058] S4.1: Conduct a multi-dimensional ethical analysis of power system-related issues to ensure that the system fully considers technical ethics, interest ethics, responsibility ethics, and environmental ethics while providing technical solutions. Specifically, technical ethics analysis is the first step in engineering ethics analysis, which aims to evaluate the safety, reliability, and potential technical risks of the proposed problems or technical solutions. This analysis uses a series of technical evaluation models and algorithms to conduct an in-depth analysis of the proposed technical solutions or operations to identify possible technical risks and ethical issues. Step S4.1 specifically includes:

[0059] S4.1.1: First, the system uses the Failure Mode and Effects Analysis (FMEA) model to evaluate the safety of the technical solution. FMEA is a systematic method for identifying possible failure modes and their impact on the system. The Risk Priority Number (RPN) calculation formula is as follows:

[0060] RPN=S×O×D

[0061] Among them, S represents the severity of the fault, O represents the frequency of the fault, and D represents the detectability of the fault. By calculating the RPN value, the system can identify and prioritize technical risks that may lead to serious consequences.

[0062] S4.1.2: Based on the technical safety assessment, the system further analyzes the reliability and robustness of the technical solution. Through random process models such as Monte Carlo Simulation or Markov Chain, the system simulates the operation of the technical solution under different conditions and evaluates its long-term stability and fault recovery capabilities. By calculating the failure rate and mean time between failures (MTBF), the system can predict the performance of the technical solution in actual applications and identify potential technical ethical issues.

[0063] S4.1.3: In order to more comprehensively evaluate technical ethics issues, the system uses a Technical Ethics Decision Tree to analyze possible ethical consequences based on different technical choices and operation steps. Each decision node represents a technical choice or operation step, and each branch represents a possible ethical impact (such as safety hazards, technical failure, etc.). By traversing and pruning the decision tree, the system identifies the optimal technical path while trying to avoid the occurrence of technical ethics issues.

[0064] S4.2: Conduct responsibility ethics analysis, identify the main responsible parties in different situations through responsibility chain analysis, and ensure the reasonable distribution of responsibilities; responsibility chain analysis identifies the main responsible parties by calculating the total responsibility value of the responsibility chain. The formula is: R i =w i ·r ij , where R i is the responsibility value between i and j, w i is the responsibility weight of i, r ij is the influence coefficient of i on j.

[0065] Furthermore, the interest ethics analysis aims to identify and evaluate the balance of interests of all parties in the operation, maintenance and construction of the power system, ensure fairness and justice in the decision-making process, and avoid injustice caused by conflicts of interest. This analysis comprehensively considers the interests of all parties and proposes reasonable solutions through methods such as stakeholder analysis models and game theory. Step S4.2 specifically includes:

[0066] S4.2.1: The system first identifies the main stakeholders in power system issues, such as power companies, equipment suppliers, government regulators, the public, and environmental protection organizations. Through the stakeholder analysis model, the system evaluates the interests, needs, and expectations of all parties to ensure that the interests of all parties are reasonably weighed in the decision-making process.

[0067] S4.2.2: In order to deal with conflicts of interest, the system uses a game theory model to analyze the interests of all parties. Through game theory concepts such as Nash Equilibrium, the system simulates the decision-making behavior of all parties under different interest distribution schemes and predicts possible ethical outcomes. The calculation formula for Nash equilibrium is as follows:

[0068]

[0069] Among them, u i is the utility function of stakeholder i, x * is the equilibrium point, x i and x -i are the strategies of i and other stakeholders respectively. Through this analysis, the system can find an optimal strategy that balances the interests of all parties, thus avoiding ethical issues caused by conflicts of interest.

[0070] S4.2.3: After the game theory analysis, the system further evaluates the fairness and justice of the distribution of benefits. Through an algorithm based on the theory of distributive justice, the system analyzes whether the benefits obtained by each party match its input and risk, avoiding ethical issues caused by unfair distribution of benefits. This analysis mainly quantifies factors such as the proportion of resource allocation and the acceptability of the distribution results.

[0071] S4.3: Design corresponding accountability mechanisms, including ex ante responsibility (such as operational responsibility in equipment maintenance), in-process responsibility (such as emergency response responsibility when an accident occurs) and post-event responsibility (such as accident investigation and follow-up responsibility), and match each responsible entity with its corresponding responsibility category and degree through the Responsibility Matrix.

[0072] Furthermore, the core of responsibility ethics analysis is to clarify the responsibilities of all parties in the operation and maintenance of the power system, ensuring that the responsible parties can be quickly identified and appropriate remedial measures can be taken when a failure or accident occurs. This analysis ensures the ethical rationality of the system in responding to emergencies through the design of responsibility allocation models and accountability mechanisms. Step S4.3 specifically includes:

[0073] S4.3.1: The system first evaluates the responsibility allocation in the problem through Responsibility Chain Analysis. The responsibility chain model associates each operation step or decision in the system with its possible ethical responsibility to form a responsibility chain. Each link in the responsibility chain represents a responsible subject, and the responsibility value is calculated by the following formula:

[0074] R ij =P i ×C ij

[0075] Among them, R ij is the responsibility value between i and j, P i is the responsibility weight of i, C ij is the influence coefficient of i on j. By calculating the total responsibility value of the responsibility chain, the system can identify the main responsible parties in different situations and ensure the reasonable distribution of responsibilities.

[0076] S4.3.2: Based on the responsibility chain analysis, the system has designed a corresponding accountability mechanism. This mechanism includes ex ante responsibility (such as operational responsibility in equipment maintenance), in-process responsibility (such as emergency response responsibility when an accident occurs), and ex post responsibility (such as accident investigation and follow-up responsibility). The system matches each responsible entity with its corresponding responsibility category and degree through the Responsibility Matrix, and ensures that when an accident occurs, the accountability mechanism can be quickly activated to deal with the responsible party.

[0077] S4.3.3: In order to support responsibility decisions in complex situations, the system uses fuzzy logic and multi-criteria decision analysis (MCDA) to quantitatively evaluate the rationality of responsibility allocation. Through the attribution function of fuzzy logic and the multi-criteria weights of the decision matrix, the system can provide scientific and reasonable responsibility allocation suggestions to avoid ethical risks caused by unclear or unfair responsibility allocation.

[0078] S4.4: Conduct environmental ethics analysis, identify and quantify environmental risks through environmental impact assessment (EIA) and life cycle analysis (LCA), and provide optimization suggestions. The environmental impact assessment formula is: Among them I i is the i-th environmental impact factor, W i For its weight, E total It is the comprehensive environmental impact value.

[0079] Furthermore, environmental ethics analysis focuses on the impact of the power system on the environment during operation and construction, ensuring that technical solutions and operational decisions meet the requirements of environmental protection and sustainable development. This analysis uses methods such as environmental impact assessment (EIA) and life cycle analysis (LCA) to identify and quantify environmental risks and provide optimization suggestions. Step S4.4 specifically includes:

[0080] S4.4.1: The system first conducts an environmental impact assessment (EIA) on the technical solution in question. EIA identifies the environmental impact factors of the project and assesses its potential impact on the ecosystem, air, water quality, etc. The system uses the Impact Factor Matrix to quantify the weight of each impact factor and calculate its comprehensive environmental impact value:

[0081]

[0082] Among them, I i is the i-th environmental impact factor, W i For its weight, E total The comprehensive environmental impact value is used to identify the links that may have a significant impact on the environment and provide corresponding risk control recommendations.

[0083] S4.4.2: Based on the environmental impact assessment, the system further conducts a life cycle analysis (LCA). LCA aims to evaluate the comprehensive impact of a technology solution or equipment on the environment throughout its life cycle, including manufacturing, transportation, operation, maintenance and disposal. The environmental impact formula of LCA is:

[0084]

[0085] Among them, EI is the life cycle environmental impact index, L j is the life cycle input of stage j, EF j is the corresponding environmental impact coefficient. Through LCA, the system can quantify the environmental impact of each stage and make optimization suggestions to reduce the environmental burden.

[0086] S4.4.3: After completing the environmental impact assessment (EIA) and life cycle analysis (LCA), the system will generate a series of environmental ethics optimization suggestions based on the analysis results, aiming to mitigate the negative impact of technical solutions or operational decisions on the environment and promote sustainable development. Including:

[0087] Environmental risk control measures: For technical solutions or operating procedures that pose significant environmental risks, the system will provide specific risk control measures, such as strengthening environmental monitoring, setting up safety protection devices, improving waste treatment processes, etc., to prevent environmental accidents and reduce the impact on the surrounding environment.

[0088] Ecological compensation and restoration suggestions: In cases where environmental impacts cannot be completely avoided, the system will recommend ecological compensation or restoration measures to balance the environmental losses caused by project implementation. This may include afforestation, wetland restoration, and repair of damaged ecosystems to compensate for the negative impacts on the natural environment caused by project development or operation.

[0089] In the above technical solution, a preferred technical solution may also be that step S5 specifically includes:

[0090] S5.1: Integrate the multi-dimensional information obtained from the technical background retrieval, i.e., background knowledge retrieval in step S3, and the engineering ethics analysis, i.e., step S4. The core goal of comprehensive information integration is to organically combine technical data, ethical analysis results, and the specific needs of the user's questions to generate a logically clear and comprehensive answer.

[0091] Furthermore, the first step of the question-answer generation step is to integrate the multi-dimensional information obtained from the technical background search (step S3) and the engineering ethics analysis (step S4). The core goal of comprehensive information integration is to organically combine technical data, ethical analysis results and the specific needs of the user's questions to generate a logically clear and comprehensive answer. Step S5.1 specifically includes:

[0092] S5.1.1: During the integration process, the system first synthesizes various types of information. Technical background information and ethical analysis information are integrated through weight models to ensure that the generated answers are technically comprehensive and accurate, ethically compliant and socially responsible. The mathematical representation of the integration is as follows:

[0093] A final =α tech ×Atech +β ethics ×A ethics

[0094] Among them, A final is the final generated answer, A tech For technical background information integration results, A ethics To integrate the results of ethical analysis information, α tech and β ethics They are the weight factors for technical information and ethical information, respectively. The weight factors are dynamically adjusted according to the nature of the problem, ensuring that problems with higher technical complexity focus on technical information, while problems with greater ethical risks increase the weight of ethical analysis.

[0095] S5.1.2: After information synthesis, the system optimizes the logical structure of the generated answers to ensure that the content is clear and easy to understand. Logical structure optimization uses a tree structure or graph structure to organize the answer content in a logical order, so that users can gradually understand each aspect of the question.

[0096] S5.2: Ensure that the content of the answer is not only technically and ethically correct, but also understandable and operational. Use natural language generation (NLG) technology to optimize the language expression of the answer and ensure that the generated answer is highly consistent with the original semantics of the user's question. The formula is: Where s is the generated sentence, w i is the conditional probability of the ith word under the vocabulary chain model.

[0097] Furthermore, after generating the answer, the system needs to ensure that the content of the answer is not only technically and ethically correct, but also understandable and operational. This means that the answer generated by the system should be easy for users to understand and can be implemented in actual work. Step S5.2 specifically includes:

[0098] S5.2.1: To improve the comprehensibility of answers, the system uses natural language generation (NLG) technology to optimize the language expression of answers. NLG technology adjusts the language style, sentence structure, and vocabulary selection of the answer content to make the answer content closer to the user's language habits, reduce the use of technical terms or provide explanations for them, and ensure that users can easily understand the answer. The core algorithm of NLG can be expressed as:

[0099]

[0100] Among them, s is the generated sentence, P(w i ∣w i-1 ,w i-2,…) is the conditional probability of the i-th word under the vocabulary chain model. By maximizing the fluency of the sentence, the system can generate more natural and fluent answers. In addition, the system also uses semantic similarity calculation to ensure that the generated answer is highly consistent with the original semantics of the user's question to avoid giving irrelevant answers. Semantic similarity can be calculated using cosine similarity:

[0101]

[0102] Among them, q and a represent the semantic vectors of the user question and the system answer respectively. By calculating the cosine similarity between the two, the system ensures that the answer content is highly relevant to the question.

[0103] S5.2.2: In addition to comprehensibility, the system must ensure that the generated answers are actionable, that is, users can directly apply the suggestions in the answers in actual work. To this end, the system converts the technical operation steps and ethical suggestions in the answers into executable action plans or processes. The key to actionability design is to concretize technical guidance and ethical suggestions.

[0104] For example, for the question "Safety measures during substation maintenance", the answers generated by the system may include: Technical operation: clarify the power-off steps of the equipment, provide a detailed equipment maintenance checklist, and ensure that each operation step complies with safety regulations; Ethical advice: It is recommended to regularly train operators to improve their awareness of safe operations and establish a supervision mechanism to ensure the strict implementation of operating procedures.

[0105] In addition, the system may provide auxiliary tools such as standard operating procedure (SOP) templates and ethical risk assessment forms to help users directly apply the suggestions in the answers to actual work. These tools will be automatically generated based on the questions entered by the user to ensure their pertinence and practicality.

[0106] S5.2.3: After the answer is generated, the system will conduct an initial check on the accuracy and usefulness of the answer through an internal validation step. This includes comparing it with the system's internal expert rule base to ensure that the answer content meets industry standards and best practices.

[0107] At the same time, the system also integrates a user feedback mechanism, allowing users to rate and comment on the accuracy, comprehensibility and operability of answers. The system continuously optimizes the answer generation algorithm and improves the overall performance of the question-answering step by collecting user feedback data. The optimization of the feedback mechanism can be carried out through reinforcement learning. The system uses user feedback as a reward signal and adjusts the generation strategy to improve the quality of future answers. The feedback optimization formula is as follows:

[0108]

[0109] Among them, Q(s,a) is the value function of taking action a in state s, r is the reward value of user feedback, α is the learning rate, and γ is the discount factor. Through continuous learning, the system can gradually improve the quality of generated answers and user satisfaction.

[0110] S5.3: Translate the technical operation steps and ethical recommendations in the answer into executable action plans or processes to ensure that users can directly apply the recommendations in the answer in their actual work.

[0111] In the above technical solution, a preferred technical solution may also be that step S6 specifically includes:

[0112] S6.1: Collect and analyze user feedback to continuously optimize the system’s question-answering performance and engineering ethics analysis capabilities.

[0113] Furthermore, feedback collection and analysis is the starting point for system improvement. When using the system, users can provide feedback on each generated answer, including but not limited to accuracy, comprehensibility, operability, and comprehensiveness of ethical analysis. Through this feedback mechanism, the system obtains users' direct evaluation of system performance and conducts subsequent optimization based on it. Step S6.1 specifically includes:

[0114] S6.1.1: The system can collect feedback through multiple channels, allowing users to provide feedback in different ways. These channels include: a rating system, where users can rate each answer, for example from 1 to 5 stars, reflecting overall satisfaction with the answer; comments and suggestions, where users can provide detailed comments or suggestions based on the rating, pointing out specific improvement needs or problems; problem reports, where users can submit problem reports for obviously wrong or incomplete answers to help the system quickly identify and correct problems. The system records this feedback in real time through the user interface (UI) and stores it in association with the generated answers and user questions.

[0115] S6.1.2: After collecting user feedback, the system performs structured analysis on this data. The goal of structured analysis is to convert users' subjective evaluations into quantifiable improvement goals. The system uses natural language processing (NLP) technology to perform sentiment analysis on user comments, extract positive or negative evaluation features, and quantify them into scoring weights. The core formula of sentiment analysis is:

[0116]

[0117] Among them, w i is the weight of the i-th word, polarity(t i) is the word t i The system uses this scoring mechanism to convert user feedback into parameters that can be used for model tuning. In addition, the system uses clustering analysis to classify similar feedback and identify issues that users are concerned about or system weaknesses. For example, if multiple users report that the ethical analysis of a certain type of problem is insufficient, the system will cluster this feedback into an independent improvement requirement and focus on it during the model tuning process.

[0118] S6.2: Based on the feedback analysis, we enter the model tuning stage and use the reinforcement learning (RL) framework to adaptively tune the model. Using user feedback as a reward signal, the system continuously adjusts the model parameters to optimize the quality of future questions and answers. The basic formula of reinforcement learning is: Q(s,a)←Q(s,a)+α[r+γmax a′ Q(s′,a′)-Q(s,a)], where Q(s,a) is the value function of taking action a in state s, r is the user feedback as the reward value, α is the learning rate, and γ is the discount factor.

[0119] Furthermore, based on the feedback analysis, the system enters the model tuning stage. The core goal of model tuning is to improve the overall performance of the system and user satisfaction by adjusting the algorithm parameters of the question-answer generation and ethical analysis steps. Step S6.2 specifically includes:

[0120] S6.2.1: The system uses a reinforcement learning (RL) framework to adaptively tune the model. By using user feedback as a reward signal, the system continuously adjusts the model parameters to optimize the quality of future questions and answers. The basic formula for reinforcement learning is:

[0121]

[0122] Among them, Q(s,a) is the value function of taking action a in state s, r is the user feedback as the reward value, α is the learning rate, and γ is the discount factor. Through this formula, the system can dynamically adjust the generation strategy and improve the performance of the model in practical applications.

[0123] In addition, the system further improves model performance through automatic hyperparameter optimization. The system uses methods such as Grid Search or Bayesian Optimization to automatically select the optimal model hyperparameter configuration, such as learning rate, weight decay, regularization parameters, etc.

[0124] S6.2.2: The system performs special tuning for the engineering ethics analysis step. Through user feedback, the system identifies possible weaknesses in ethical analysis (such as insufficient coverage of technical ethics, unclear analysis of responsibility ethics, etc.), and adjusts the model's ethical keyword extraction and analysis weights accordingly. In particular, the system uses domain adaptation technology to make the model better adaptable to different types of ethical issues. The goal of domain adaptation is to fine-tune the model so that it performs well in specific ethical scenarios. The process can be expressed as:

[0125]

[0126] in, is the task loss (e.g., accuracy in question-answer generation), is the domain adaptive loss, and λ is the loss weight factor. By optimizing this total loss, the system ensures that the model's analytical ability in different ethical scenarios is always at its best.

[0127] S6.3: Update the knowledge base, expand the knowledge base content by introducing the latest industry standards, laws and regulations, technical documents and engineering ethics research results, and clean and optimize the existing data to remove redundant or outdated content to ensure the accuracy and relevance of the data. The formula is: in and They are the word vector representations of the two documents respectively.

[0128] Furthermore, the last step of feedback and improvement is to update the knowledge base. The knowledge base is the basis for the system to generate answers, and the accuracy, timeliness and comprehensiveness of its content directly affect the performance of the system. Therefore, the knowledge base needs to be updated regularly to ensure that it contains the latest industry knowledge and ethical standards. Step S6.3 specifically includes:

[0129] S6.3.1: The system expands the knowledge base content through various means, including the introduction of the latest industry standards, laws and regulations, technical documents and engineering ethics research results. The introduction of new data includes automatic crawling (Web Crawling), industry report subscriptions and expert knowledge contributions. For each newly introduced data source, the system performs preprocessing and semantic annotation to ensure that it can be seamlessly integrated with the existing data structure.

[0130] In addition, the system conducts in-depth research on specific issues mentioned in user feedback and promptly adds new knowledge to the knowledge base. For example, if user feedback involves the ethical risks of a certain type of emerging power equipment, the system will actively collect relevant literature and add it to the knowledge base to answer related questions in the future.

[0131] S6.3.2: While expanding the knowledge base, the system also cleans and optimizes existing data, removes redundant or outdated content, and ensures data accuracy and relevance. Data cleaning uses natural language processing technology to denoise text data, including deduplication, format normalization, and semantic error correction.

[0132] The system identifies and removes redundant data through TF-IDF (Term Frequency-Inverse Document Frequency) and word vector similarity calculations:

[0133]

[0134] Among them, d1 and d2 are two documents respectively. and is its word vector representation. When the similarity Sim(d1, d2) exceeds the set threshold, the system marks one of the documents as redundant data and removes it.

[0135] S6.3.3: In order to improve the retrieval efficiency and response speed of the knowledge base, the system optimizes the knowledge base structure. Specific measures include establishing an efficient index structure, optimizing query statements, and designing a distributed knowledge base architecture. The system uses inverted index technology to index key fields and speed up the query process. In addition, the system also introduces a distributed knowledge base architecture to improve the system's scalability and processing performance through data sharding and load balancing technologies.

[0136] A system for constructing an electric power knowledge question-answering system combined with engineering ethics analysis, which is based on the method for constructing an electric power knowledge question-answering system combined with engineering ethics analysis. The system for constructing an electric power knowledge question-answering system combined with engineering ethics analysis includes:

[0137] Model fine-tuning module, which is used to fine-tune the large language model based on the P-Tuning method to enhance the model's ability to understand and extract vocabulary related to engineering ethics in power systems;

[0138] The question understanding and classification module is responsible for receiving and processing questions raised by users, achieving semantic analysis, technical classification, and ethical risk identification through natural language processing technology, and providing key information for subsequent knowledge retrieval and answer generation;

[0139] The background knowledge retrieval module uses word embedding technology and TF-IDF algorithm to match and retrieve relevant background knowledge based on the information obtained from the question understanding and classification module, especially the part about ethical keywords;

[0140] Engineering Ethics Analysis Module, which comprehensively considers technical ethics, interest ethics, responsibility ethics and environmental ethics, and uses environmental impact assessment and life cycle analysis methods to identify and quantify potential environmental risks;

[0141] The question-answer generation module uses natural language generation technology to create answers that fit the context of the original question, ensuring that the generated answers are accurate and easy to understand;

[0142] Feedback and improvement module: This module collects user feedback and continuously optimizes the entire question-answering system through a reinforcement learning framework. It consists of three sub-parts: feedback collection and analysis, model tuning, and knowledge base update.

[0143] The present invention provides a method and system for constructing an electric power knowledge question-and-answer system combined with engineering ethics analysis, wherein the (question-and-answer) system is an electric power knowledge question-and-answer system combined with engineering ethics analysis. The system pre-trains a large language model and fine-tunes it in combination with the P-Tuning method to improve the model's ability to extract keywords in the field of engineering ethics. The system can semantically parse and classify power system questions raised by users, and retrieve relevant information from two dimensions: technical background and ethical background. On this basis, the system conducts a comprehensive engineering ethics analysis of technical solutions and operational recommendations, including four aspects: technical ethics, interest ethics, responsibility ethics, and environmental ethics. Ultimately, the answers generated by the system are not only technically accurate and feasible, but also ethically compliant, ensuring that users can balance technical requirements and ethical responsibilities in practical applications. Compared with the prior art, the present invention has the following beneficial effects:

[0144] 1. Improved the model's ability to identify engineering ethics. By introducing the P-Tuning method to fine-tune the large language model, the present invention significantly improves the model's ability to identify engineering ethical issues in the field of power systems. The system can accurately extract keywords and expressions related to technical ethics, interest ethics, responsibility ethics, and environmental ethics, providing a solid foundation for subsequent question-and-answer generation and ethical analysis. This innovative feature enables the present invention to provide more comprehensive and responsible advice when dealing with power system issues involving high risks and ethical complexity.

[0145] 2. Achieved multi-dimensional engineering ethics analysis. The present invention is not limited to providing technical answers, but can also conduct multi-dimensional analysis of power system issues from four perspectives: technical ethics, interest ethics, responsibility ethics, and environmental ethics. This comprehensive ethical analysis capability ensures that all potential ethical risks are fully considered during decision-making and operation, thereby improving the safety, reliability, and social responsibility of power system operation.

[0146] 3. Intelligent background knowledge retrieval and integration. The system can conduct comprehensive knowledge retrieval from the two dimensions of technical background and ethical background, and integrate this information intelligently. Through optimized retrieval algorithms and information weight models, the system ensures that the generated answers have both technical depth and reflect the key elements of the ethical dimension. This design significantly improves the system's ability to handle complex problems, ensuring that users obtain accurate and ethically instructive answers.

[0147] 4. Enhanced the comprehensibility and operability of question and answer generation. The present invention uses natural language generation technology to optimize the question and answer generation steps, ensuring that the answers are not only technically correct and easy to understand in expression, but also highly operable in actual operations. The system helps users apply suggestions directly to actual work through tools such as standard operating procedure (SOP) templates and ethical risk assessment forms. This innovative design makes the system's output results more practical and easy for users to operate and execute in actual scenarios.

[0148] 5. An adaptive feedback and improvement mechanism has been built. The system forms a closed-loop feedback mechanism for continuous optimization through feedback collection and analysis, model tuning, and knowledge base updates. Through reinforcement learning and model tuning based on user feedback, the system can continuously improve the quality of its question-answer generation and ethical analysis, ensuring that it always maintains a high level of performance in a dynamically changing power system environment. Regular updates to the knowledge base ensure that the system can reflect the latest industry standards and ethical norms, providing users with timely and reliable solutions.

[0149] 6. Promotes the sustainable development of the power system. Through systematic engineering ethics analysis, the present invention helps users balance technical requirements and ethical responsibilities in power system operation and decision-making, reducing potential environmental risks and social impacts. This design concept with sustainable development as the core promotes the long-term development of the power system and meets the current industry's requirements for green environmental protection and social responsibility.

[0150] In summary, the (question-and-answer) system described in the present invention is based on a large language model, and is intended to provide accurate technical answers to aspects such as the operation, inspection, maintenance, and infrastructure of the power system, while conducting a comprehensive analysis of the engineering ethical issues involved. By combining advanced natural language processing technology, engineering ethics analysis methods, and user feedback mechanisms, the present invention provides an intelligent, multi-dimensional power knowledge question-and-answer platform to ensure the safety, reliability, and ethical compliance of technical solutions. It can conduct a comprehensive engineering ethics analysis of technical solutions and operational suggestions. Ultimately, the answers generated by the system are not only technically accurate and feasible, but also ethically compliant, ensuring that users can balance technical requirements and ethical responsibilities in actual applications, significantly improving the intelligence level of the power knowledge question-and-answer system, and providing important support for the safe operation and sustainable development of the power industry. BRIEF DESCRIPTION OF THE DRAWINGS

[0151] Figure 1 A reference diagram (block diagram) of the method for constructing an electric power knowledge question-and-answer system combined with engineering ethics analysis according to the present invention.

[0152] Figure 2 This is a workflow diagram of the method for constructing an electric power knowledge question-answering system combined with engineering ethics analysis according to the present invention.

[0153] Figure 3 This is a diagram showing an example of a returned answer of the system building method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0154] The specific implementation of the present invention is further described in detail below in conjunction with the accompanying drawings and examples. The following examples are only used to illustrate the present invention, but are not intended to limit the scope of the present invention.

[0155] Embodiment 1: Specifically, as Figure 1 As shown, a method for constructing an electric power knowledge question-answering system combined with engineering ethics analysis includes the following steps:

[0156] S1: Construct a model fine-tuning module, fine-tune the large language model based on the P-Tuning method to build a power system question-answering knowledge base, and enhance the model's ability to extract keywords in the field of engineering ethics in the power system by fine-tuning the open source large language model (such as LLaMA, BERT, Qwen, etc.), thereby providing accurate basic support for subsequent question-answering and ethical analysis functions. The open source large model has been trained through step S1 to enhance the model's ability to extract keywords in the field of engineering ethics in the power system. Step S1 specifically includes:

[0157] S1.1: Prepare a large-scale question-answering dataset covering the field of power systems. The dataset should include various types of power system technical issues, operating procedures, fault case analysis, ethical issues in engineering decision-making processes, etc. These data come from the power industry's technical documents, operating manuals, industry reports, academic papers, and historical case libraries in the power system; in particular, the dataset needs to cover ethical issues involved in the operation, maintenance, overhaul, infrastructure, etc. of the power system, including technical ethics, interest ethics, responsibility ethics, and environmental ethics.

[0158] S1.2: The system uses the P-Tuning method to fine-tune the large language model. By adding specific prompt templates before inputting questions, the model is guided to focus on and extract key content related to power systems and engineering ethics. For example, in power system maintenance questions, the system can design templates containing "safety assessment" or "risk control" prompts. After receiving these prompts, the model can more accurately identify and extract the key points of engineering ethics involved in the question. During the fine-tuning process, P-Tuning can not only improve the model's ability to extract keywords in the field of engineering ethics, but also optimize the model's performance in semantic understanding, contextual reasoning, and ethical analysis. The fine-tuning process of the model requires a lot of iterative training to ensure that it can provide accurate technical answers and effectively identify potential ethical issues when dealing with complex power system problems. To achieve this goal, the system continuously updates and expands the question-answering data set during the fine-tuning process, and adjusts the prompt templates and optimization parameters based on the P-Tuning method.

[0159] S2: Construct a question understanding and classification module. The question understanding and classification step is responsible for receiving the user's input questions, performing semantic analysis, technical classification, and ethical risk identification, and providing necessary semantic information for subsequent knowledge retrieval and question-answer generation. This step uses a combination of multiple natural language processing (NLP) technologies and algorithms to ensure that the system can accurately understand and handle complex power system problems, especially high-risk problems involving engineering ethics.

[0160] like Figure 2 As shown, assume that the question input by the user is as follows: "When planning a substation expansion project, how can we ensure construction safety while avoiding impacts on the surrounding environment and fairly handle interest disputes with the local community?" The following is the process of how the system handles it through step S2. Step S2 specifically includes:

[0161] S2.1: Perform semantic analysis and preprocessing on questions input by users. Input questions are usually expressed in natural language and may contain complex technical terms and ambiguous expressions. Therefore, the system first uses word segmentation technology to segment the input natural language, and identifies key technical terms and ethics-related vocabulary in the questions through part-of-speech tagging and named entity recognition (NER).

[0162] Specifically, suppose the input question is "How to prevent environmental pollution during substation maintenance?" The system first performs word segmentation on the question to obtain the vocabulary sequence {how to prevent environmental pollution during substation maintenance}. Then, the system identifies entities such as "substation", "maintenance", and "environmental pollution" through NER, and further identifies the grammatical functions of keywords through part-of-speech tagging (POStagging) to determine the main content and focus of the question.

[0163] Step S2.1 further includes: semantic analysis and preprocessing.

[0164] First, the system segments the input natural language questions and decomposes the questions into keyword groups: {“planned”, “substation expansion project”, “construction safety”, “avoid”, “environmental impact”, “fair treatment”, “local community”, “interest dispute”}; then, the system identifies the grammatical function and category of each keyword through part-of-speech tagging: noun (N): “substation expansion project”, “construction safety”, “environmental impact”, “local community”, “interest dispute”; verb (V): “planned”, “avoid”, “handle”; adjective / adverb (ADJ / ADV): ​​“fair”.

[0165] Secondly, the system further identifies the key entities in the problem: {“substation” (facility type), “expansion project” (project type), “construction safety” (safety), “environmental impact” (environmental factor), “interest dispute” (social factor), “local community” (social group)}.

[0166] S2.2: After the semantic analysis is completed, the system performs technical classification and multi-layer semantic analysis on the problem. The technical classification maps the problem to the pre-defined power technology field label through deep learning models such as convolutional neural network (CNN) or recurrent neural network (RNN). The multi-layer semantic analysis uses the Transformer-based multi-head attention mechanism to further analyze the logical structure and deep semantics of the problem. The formula is: Where Q, K, and V are query vectors, key vectors, and value vectors respectively. k is the dimension of the key vector.

[0167] Furthermore, the purpose of technical classification is to classify questions into different technical fields of the power system (such as power generation, transmission, distribution, dispatching, maintenance, overhaul, infrastructure, etc.) so as to call the knowledge base of the corresponding field for subsequent retrieval and answering.

[0168] The implementation of technology classification relies on deep learning models such as convolutional neural networks (CNN) or recurrent neural networks (RNN), which can map input questions to predefined labels of power technology fields based on their semantic features. Assuming the vector representation of the input question is X, the classification model generates the probability distribution P of the technology field through a series of convolution operations or recursive operations:

[0169] P = softmax(W · CNN(X) + b)

[0170] Where W is the weight matrix and b is the bias term. By maximizing the value of P, we can determine the technical field to which the problem is most likely to belong.

[0171] In multi-layer semantic analysis, the system further analyzes the logical structure and deep semantics of the question. The system uses a Transformer-based multi-head attention mechanism to perform semantic association analysis on each part of the input question to capture the implicit logical relationship and key content. The formula of the multi-head attention mechanism is as follows:

[0172]

[0173] Among them, Q, K, and V are query vectors, key vectors, and value vectors respectively. k is the dimension of the key vector. In this way, the system can accurately understand the semantic associations in the question and identify key content, such as the technical core of the question and possible ethical issues.

[0174] Step S2.2 may specifically include: technical classification and multi-layer semantic analysis.

[0175] First, the system determines the technical category of the problem by analyzing the above keywords. Based on the convolutional neural network (CNN) classification model, the vector representation of the problem is processed, and the input vector representation is:

[0176] X = Embedding (“Construction safety of substation expansion project avoids environmental impact and fairly handles local community interest disputes”) The output of the classification model is: P = softmax (W CNN (X) + b)

[0177] The system identified that the issue involved the following technical categories: power infrastructure (primary category); construction safety (secondary category); environmental protection (secondary category)

[0178] Secondly, the system further analyzes the deep semantic structure of the problem and identifies the logical relationship and core content in the problem. The Transformer-based multi-head attention mechanism is used to capture the semantic associations between keywords: Focus: the relationship between the substation expansion project and construction safety, the cross-influence of environmental impact and local community interest disputes; semantic association: construction safety -> substation expansion; environmental impact -> local community interest disputes.

[0179] Finally, the system identified that the core of the problem is how to balance construction safety and environmental protection, and how to fairly handle conflicts of interest in the project.

[0180] S2.3: Based on technical classification and semantic analysis, the system identifies ethical risks in the problem, and infers the possible ethical risk types in the problem through a pre-fine-tuned large model and a specially designed ethical risk classifier, using classification algorithms such as Bayesian Network or Support Vector Machine (SVM); the output of the ethical risk classifier is the probability distribution of various ethical risks: P ethics =f classifier (X semantic ), where X semantic is the semantic feature vector of the input question.

[0181] Furthermore, ethical risk identification is a major feature of the present invention, which aims to identify in advance the engineering ethical issues that may be involved in the problem, such as safety hazards, environmental risks, conflicts of interest and improper distribution of responsibilities.

[0182] The system identifies ethical risks by combining a pre-fine-tuned large model (see step S1) with a specially designed ethical risk classifier. The ethical risk classifier uses classification algorithms such as Bayesian Network or Support Vector Machine (SVM) to infer the possible ethical risk types in the problem based on the semantic features of the input problem and the known ethical problem case library.

[0183] Assume that the semantic feature vector of the input question is X ethics , the output of the ethical risk classifier is the probability distribution P of various ethical risks ethics :

[0184] P ethics =softmax(W ethics ·X ethics +b ethics )

[0185] The system determines the ethical risks that the problem may involve based on the highest probability value and labels it as one or more of technical ethics, interest ethics, responsibility ethics or environmental ethics.

[0186] Step S2.3 may specifically include: identification of ethical risks.

[0187] The system identifies multiple potential ethical risks involved in the problem. By combining a fine-tuned large language model and an ethical risk classifier, the system identifies the following ethical risks: Technical ethics: whether safety regulations can be followed during construction to ensure the safety of workers and equipment; Interest ethics: how to fairly deal with the impact of the expansion project on the local community, especially when it comes to conflicts in interest distribution and resource use; Environmental ethics: whether the construction will have a negative impact on the surrounding environment, such as noise, pollution, etc.; Responsibility ethics: how to clarify and allocate the responsibilities of all parties during the expansion project to avoid buck-passing. At the same time, the system generates the probability distribution of various ethical risks as shown in Table 1.

[0188] Table 1

[0189] Risk Type Risk Probability Technological ethical risks <![CDATA[P tech =0.85]]> Ethical risks of interest <![CDATA[P benefit =0.75 <!-- 16 -->]]> Environmental ethical risks <![CDATA[P environment =0.90]]> Responsibility Ethical Risk <![CDATA[P responsibility =0.70]]>

[0190] S2.4: Comprehensive semantic representation and output Finally, the question understanding step combines the semantic parsing results, technical classification results, semantic analysis results and ethical risk identification results obtained in the previous steps to generate a comprehensive semantic representation of the question. This comprehensive representation will be input into the subsequent knowledge retrieval and question-answering generation steps in the form of a vector. The generation formula of the comprehensive semantic representation is as follows:

[0191] X final =concat(X,P,P ethics )

[0192] Among them, X is the vector representation of the original problem, P is the probability distribution of technology classification, and P ethics The probability distribution of ethical risk identification. By combining this information, the system can generate a semantic representation that fully reflects the content of the question, ensuring that the subsequent question-answering process can accurately capture all important dimensions of the question.

[0193] Step S2.4 may specifically include: generating a comprehensive semantic representation.

[0194] The system integrates the semantic parsing results, technical classification results, semantic analysis results and ethical risk identification results obtained in the previous steps to generate a comprehensive semantic representation of the problem, which is expressed as follows:

[0195] X final =concat(X,P tech ,P benefit ,P environment ,Presponsibility )

[0196] Among them, X is the vector representation of the original problem, P tech , P benefit , P environment , P responsibility They are the probability distribution of technical ethics, interest ethics, environmental ethics, and responsibility ethics risks, respectively. The comprehensive semantic representation generated by the system will be used as input for subsequent background knowledge retrieval and question-answer generation modules. Through this comprehensive representation, the system can fully capture the technical and ethical dimensions of the problem, laying the foundation for subsequent steps.

[0197] This example demonstrates how the system can perform semantic analysis, technical classification, ethical risk identification, and generate a comprehensive semantic representation of a complex power system problem through step S2. This step ensures that the system can accurately understand the complex problems input by users and provide accurate support for subsequent knowledge retrieval and answer generation.

[0198] After completing the semantic analysis and comprehensive semantic representation generation in step S2, the system enters step S3. The constructed module is the background knowledge retrieval module. The following is the process of how the system processes through step S3.

[0199] S3: Constructing the background knowledge retrieval module, the system first extracts the possible ethical keywords from the comprehensive semantic representation generated in the question understanding step, and uses the same word embedding and TF-IDF algorithm to identify ethical keywords; the background knowledge retrieval step is responsible for extracting technical background information and ethical background information related to the user's question from the question-answering knowledge base. Through this step, the system can provide comprehensive and accurate background support for subsequent question-answering generation, ensuring the accuracy and relevance of the answer content.

[0200] Step S3.1: Technical background information retrieval.

[0201] First, the system extracts technology-related keywords from the comprehensive semantic representation generated in step S2. These keywords include "substation expansion project", "construction safety", "environmental impact", etc. Through the word embedding model and TF-IDF weight algorithm, the system further identifies the importance of these keywords in the question. The keyword weight is calculated as follows:

[0202]

[0203] For the keyword "construction safety", the system calculates its weight in the question and expands related terms such as "safety regulations", "equipment safety", "worker protection", etc.

[0204] Secondly, the system uses inverted index technology to quickly retrieve technical documents related to these keywords from the technical database. By matching keywords with documents, the system calculates the relevance score of each document:

[0205]

[0206] The system sorts the documents related to "construction safety" and "substation expansion project" and selects the documents with the highest scores as the search results. These documents may include construction safety standards, safety assessment reports for expansion projects, relevant technical regulations, etc.

[0207] Finally, the system extracts key information related to the problem from the retrieved technical documents. The extracted information may include: construction safety specifications for substation expansion projects, equipment and worker safety protection measures, risk assessment methods during construction, technical solutions to avoid environmental impacts, etc.

[0208] Step S3.2: Ethical background information retrieval.

[0209] First, the system extracts ethics-related keywords from the comprehensive semantic representation, such as "environmental impact", "interest disputes", "community", etc. Through the same TF-IDF algorithm as technical keywords, the system identifies the importance of these keywords and performs semantic expansion to generate a more comprehensive set of ethics keywords. For the keyword "environmental impact", the system can expand related concepts such as "ecological protection", "pollution control", and "noise control".

[0210] Secondly, the system uses inverted indexing technology to retrieve ethical background information related to these keywords from the ethics literature and case library. The retrieval process is similar to that of technical documents. The system scores and ranks the relevance of documents:

[0211]

[0212] The system gives priority to ethical documents and cases involving "the impact of construction on the environment" and "the handling of community interest disputes". These documents may include environmental impact assessment reports, interest coordination cases between communities and power companies, etc.

[0213] Finally, the system extracts key information related to the problem from the retrieved ethical literature and cases. The extracted information may include: analysis of the potential impact of construction on the environment, mediation and handling methods for community interest disputes, ethical norms for environmental risk control, and the principle of fairness in benefit distribution.

[0214] Step S3.3: Generation of comprehensive background information.

[0215] The system integrates technical background information with ethical background information to generate comprehensive background information. The core of information integration is to reasonably allocate the weights of technical information and ethical information to ensure that the generated background information can both meet technical needs and reflect the key elements of the ethical dimension. The weight allocation formula for comprehensive background information is:

[0216] B final =α×B tech +β×B ethics

[0217] Among them B final is the final generated background information, B tech For technical background information, B ethics is the ethical background information, and α and β are weight factors that are dynamically adjusted according to the nature of the problem.

[0218] Finally, the comprehensive background information generated by the system will include the following: detailed construction safety specifications for substation expansion projects, environmental protection technical measures and ethical norms, ethical case analysis and suggestions for handling interest disputes, potential risks of environmental impacts and their control strategies. This background information will be used to construct answers in the subsequent question-answer generation module (step S5) to ensure that the answers have both technical depth and ethical breadth, and provide users with comprehensive, accurate and ethically guiding answers.

[0219] After completing the background knowledge retrieval in step S3, the system proceeds to step S4.

[0220] S4: Construct an engineering ethics analysis module. The core function of this step is to conduct a multi-dimensional ethical analysis of power system-related issues, ensuring that the system comprehensively considers factors such as technical ethics, interest ethics, responsibility ethics, and environmental ethics while providing technical solutions, thereby improving the safety, reliability, and social responsibility of power system operation, and identifying and quantifying environmental risks through environmental impact assessment and life cycle analysis. The module constructed in step S4 is the engineering ethics analysis module. This step includes technical ethics analysis (S4.1), interest ethics analysis (S4.2), responsibility ethics analysis (S4.3), and environmental ethics analysis (S4.4) to comprehensively assess the ethical risks in user issues and make corresponding recommendations.

[0221] S4.1: Conduct a multi-dimensional ethical analysis of power system-related issues to ensure that the system fully considers technical ethics, interest ethics, responsibility ethics, and environmental ethics while providing technical solutions. Specifically, technical ethics analysis is the first step in engineering ethics analysis, which aims to evaluate the safety, reliability, and potential technical risks of the proposed problems or technical solutions. This analysis uses a series of technical evaluation models and algorithms to conduct an in-depth analysis of the proposed technical solutions or operations to identify possible technical risks and ethical issues. Step S4.1 specifically includes:

[0222] S4.1.1: First, the system uses the Failure Mode and Effects Analysis (FMEA) model to evaluate the safety of the technical solution. FMEA is a systematic method for identifying possible failure modes and their impact on the system. The Risk Priority Number (RPN) calculation formula is as follows:

[0223] RPN=S×O×D

[0224] Among them, S represents the severity of the fault, O represents the frequency of the fault, and D represents the detectability of the fault. By calculating the RPN value, the system can identify and prioritize technical risks that may lead to serious consequences.

[0225] S4.1.2: Based on the technical safety assessment, the system further analyzes the reliability and robustness of the technical solution. Through random process models such as Monte Carlo Simulation or Markov Chain, the system simulates the operation of the technical solution under different conditions and evaluates its long-term stability and fault recovery capabilities. By calculating the failure rate and mean time between failures (MTBF), the system can predict the performance of the technical solution in actual applications and identify potential technical ethical issues.

[0226] S4.1.3: In order to more comprehensively evaluate technical ethics issues, the system uses a Technical Ethics Decision Tree to analyze possible ethical consequences based on different technical choices and operation steps. Each decision node represents a technical choice or operation step, and each branch represents a possible ethical impact (such as safety hazards, technical failure, etc.). By traversing and pruning the decision tree, the system identifies the optimal technical path while trying to avoid the occurrence of technical ethics issues.

[0227] Step S4.1 may specifically include: technical ethics analysis.

[0228] The system first uses the Failure Mode and Effects Analysis (FMEA) model to evaluate the construction safety of the substation expansion project. By analyzing the possible failure modes during the construction process (such as equipment failure, worker safety accidents, etc.), the system calculates the risk priority number (RPN) of each failure mode: RPN = S × O × D, where S (severity) represents the severity score of the consequences that may result from equipment failure, O (frequency of occurrence) is the frequency of the failure based on historical data, and D (detectability) is the detectability of the failure before it occurs. Based on the calculation results, the system identifies possible high-risk operations during the construction process and proposes corresponding technical optimization suggestions. For example, it is recommended to use a more advanced safety monitoring system or strengthen safety training for construction personnel to reduce the possibility of failures.

[0229] The system further uses the Technical Ethics Decision Tree to analyze the possible ethical consequences of different technical choices in the substation expansion project. Each decision node represents a technical choice (such as construction method, equipment selection, etc.). The system traverses the decision tree to identify the optimal technical path while avoiding potential technical ethical issues. The system may recommend the selection of low-noise construction equipment to reduce interference with surrounding communities. This recommendation is based on the evaluation results of multiple choices in the technical decision tree and their ethical impact.

[0230] S4.2: Conduct responsibility ethics analysis, identify the main responsible parties in different situations through responsibility chain analysis, and ensure the reasonable distribution of responsibilities; responsibility chain analysis identifies the main responsible parties by calculating the total responsibility value of the responsibility chain. The formula is: R i =w i ·r ij , where R i is the responsibility value between i and j, w i is the responsibility weight of i, r ij is the influence coefficient of i on j.

[0231] Furthermore, the interest ethics analysis aims to identify and evaluate the balance of interests of all parties in the operation, maintenance and construction of the power system, ensure fairness and justice in the decision-making process, and avoid injustice caused by conflicts of interest. This analysis comprehensively considers the interests of all parties and proposes reasonable solutions through methods such as stakeholder analysis models and game theory. Step S4.2 specifically includes:

[0232] S4.2.1: The system first identifies the main stakeholders in power system issues, such as power companies, equipment suppliers, government regulators, the public, and environmental protection organizations. Through the stakeholder analysis model, the system evaluates the interests, needs, and expectations of all parties to ensure that the interests of all parties are reasonably weighed in the decision-making process.

[0233] S4.2.2: In order to deal with conflicts of interest, the system uses a game theory model to analyze the interests of all parties. Through game theory concepts such as Nash Equilibrium, the system simulates the decision-making behavior of all parties under different interest distribution schemes and predicts possible ethical outcomes. The calculation formula for Nash equilibrium is as follows:

[0234]

[0235] Among them, u i is the utility function of stakeholder i, x * is the equilibrium point, x i and x -i are the strategies of i and other stakeholders respectively. Through this analysis, the system can find an optimal strategy that balances the interests of all parties, thus avoiding ethical issues caused by conflicts of interest.

[0236] S4.2.3: After the game theory analysis, the system further evaluates the fairness and justice of the distribution of benefits. Through an algorithm based on the theory of distributive justice, the system analyzes whether the benefits obtained by each party match its input and risk, avoiding ethical issues caused by unfair distribution of benefits. This analysis mainly quantifies factors such as the proportion of resource allocation and the acceptability of the distribution results.

[0237] Step S4.2 may specifically include: interest ethics analysis.

[0238] The system identifies the main stakeholders related to the substation expansion project, including power companies, construction contractors, local community residents, and environmental protection organizations. Through the stakeholder analysis model, the system evaluates the interests and possible conflicts of each party. The system may find that community residents are worried that the expansion project will reduce their quality of life, while the construction contractor is concerned about the project schedule and profits. To deal with these conflicts of interest, the system uses a game theory model for analysis. By simulating the decision-making behavior of each party under different interest distribution schemes, the system seeks an optimal strategy that can balance the interests of all parties. The Nash Equilibrium is used to calculate the utility functions of each party under different strategies: where u i is the utility function of stakeholder i, x *The system may suggest establishing a community benefit fund to improve community infrastructure as compensation for the potential inconvenience caused by the expansion project. After the benefit distribution plan is determined, the system further evaluates its fairness and justice. Through the algorithm of distributive justice theory, the system analyzes whether the benefits obtained by each party match its input and risks, avoiding ethical issues caused by unfair distribution of benefits. For example, the system may adjust the distribution method of the community fund so that residents who are more affected by the expansion project receive more compensation.

[0239] S4.3: Design corresponding accountability mechanisms, including ex ante responsibility (such as operational responsibility in equipment maintenance), in-process responsibility (such as emergency response responsibility when an accident occurs) and post-event responsibility (such as accident investigation and follow-up responsibility), and match each responsible entity with its corresponding responsibility category and degree through the Responsibility Matrix.

[0240] Furthermore, the core of responsibility ethics analysis is to clarify the responsibilities of all parties in the operation and maintenance of the power system, ensuring that the responsible parties can be quickly identified and appropriate remedial measures can be taken when a failure or accident occurs. This analysis ensures the ethical rationality of the system in responding to emergencies through the design of responsibility allocation models and accountability mechanisms. Step S4.3 specifically includes:

[0241] S4.3.1: The system first evaluates the responsibility allocation in the problem through Responsibility Chain Analysis. The responsibility chain model associates each operation step or decision in the system with its possible ethical responsibility to form a responsibility chain. Each link in the responsibility chain represents a responsible subject, and the responsibility value is calculated by the following formula:

[0242] R ij =P i ×C ij

[0243] Among them, R ij is the responsibility value between i and j, P i is the responsibility weight of i, C ij is the influence coefficient of i on j. By calculating the total responsibility value of the responsibility chain, the system can identify the main responsible parties in different situations and ensure the reasonable distribution of responsibilities.

[0244] S4.3.2: Based on the responsibility chain analysis, the system has designed a corresponding accountability mechanism. This mechanism includes ex ante responsibility (such as operational responsibility in equipment maintenance), in-process responsibility (such as emergency response responsibility when an accident occurs), and ex post responsibility (such as accident investigation and follow-up responsibility). The system matches each responsible entity with its corresponding responsibility category and degree through the Responsibility Matrix, and ensures that when an accident occurs, the accountability mechanism can be quickly activated to deal with the responsible party.

[0245] S4.3.3: In order to support responsibility decisions in complex situations, the system uses fuzzy logic and multi-criteria decision analysis (MCDA) to quantitatively evaluate the rationality of responsibility allocation. Through the attribution function of fuzzy logic and the multi-criteria weights of the decision matrix, the system can provide scientific and reasonable responsibility allocation suggestions to avoid ethical risks caused by unclear or unfair responsibility allocation.

[0246] Step S4.3 may specifically include: responsibility ethics analysis.

[0247] The system uses the Responsibility Chain Analysis model to evaluate the responsibility allocation in the substation expansion project. By analyzing each operation step in the construction process, the system clarifies the responsibility value of each responsible party (such as the construction party, the supervision party, the equipment supplier, etc.): ij =P i ×C ij , where R ij is the responsibility value between i and j, P i is the responsibility weight of i, C ij is the influence coefficient of i on j. The system may identify the problem of unclear responsibility allocation in some high-risk operations and recommend strengthening the responsibility of the supervisor to ensure construction safety.

[0248] The system has designed a corresponding accountability mechanism to ensure that the responsible parties can fulfill their responsibilities in a timely manner during the project implementation. The accountability mechanism includes ex ante responsibility (such as responsibility in the construction preparation stage), in-process responsibility (such as emergency response responsibility during construction), and ex post responsibility (such as investigation and compensation responsibility after the accident). For example, the system may recommend installing monitoring equipment at the construction site to monitor high-risk operations in real time and quickly identify the responsible party when problems arise.

[0249] The system provides decision support for responsibility allocation through fuzzy logic and multi-criteria decision analysis (MCDA). The attribution function of fuzzy logic is used to deal with the ambiguity of responsibility in complex situations, and multi-criteria decision analysis helps the system provide scientific and reasonable responsibility allocation suggestions through weight allocation. The system may determine the optimal responsibility allocation plan in the responsibility chain involving multiple parties and recommend corresponding countermeasures.

[0250] S4.4: Conduct environmental ethics analysis, identify and quantify environmental risks through environmental impact assessment (EIA) and life cycle analysis (LCA), and provide optimization suggestions. The environmental impact assessment formula is: Among them I i is the i-th environmental impact factor, W i For its weight, E total It is the comprehensive environmental impact value.

[0251] Furthermore, environmental ethics analysis focuses on the impact of the power system on the environment during operation and construction, ensuring that technical solutions and operational decisions meet the requirements of environmental protection and sustainable development. This analysis uses methods such as environmental impact assessment (EIA) and life cycle analysis (LCA) to identify and quantify environmental risks and provide optimization suggestions. Step S4.4 specifically includes:

[0252] S4.4.1: The system first conducts an environmental impact assessment (EIA) on the technical solution in question. EIA identifies the environmental impact factors of the project and assesses its potential impact on the ecosystem, air, water quality, etc. The system uses the Impact Factor Matrix to quantify the weight of each impact factor and calculate its comprehensive environmental impact value:

[0253]

[0254] Among them, I i is the i-th environmental impact factor, W i For its weight, E total The comprehensive environmental impact value is used to identify the links that may have a significant impact on the environment and provide corresponding risk control recommendations.

[0255] S4.4.2: Based on the environmental impact assessment, the system further conducts a life cycle analysis (LCA). LCA aims to evaluate the comprehensive impact of a technology solution or equipment on the environment throughout its life cycle, including manufacturing, transportation, operation, maintenance and disposal. The environmental impact formula of LCA is:

[0256]

[0257] Among them, EI is the life cycle environmental impact index, Lj is the life cycle input of stage j, EF j is the corresponding environmental impact coefficient. Through LCA, the system can quantify the environmental impact of each stage and make optimization suggestions to reduce the environmental burden.

[0258] S4.4.3: After completing the environmental impact assessment (EIA) and life cycle analysis (LCA), the system will generate a series of environmental ethics optimization suggestions based on the analysis results, aiming to mitigate the negative impact of technical solutions or operational decisions on the environment and promote sustainable development. Including:

[0259] Environmental risk control measures: For technical solutions or operating procedures that pose significant environmental risks, the system will provide specific risk control measures, such as strengthening environmental monitoring, setting up safety protection devices, improving waste treatment processes, etc., to prevent environmental accidents and reduce the impact on the surrounding environment.

[0260] Ecological compensation and restoration suggestions: In cases where environmental impacts cannot be completely avoided, the system will recommend ecological compensation or restoration measures to balance the environmental losses caused by project implementation. This may include afforestation, wetland restoration, and repair of damaged ecosystems to compensate for the negative impacts on the natural environment caused by project development or operation.

[0261] Step S4.4 may specifically include: environmental ethics analysis.

[0262] The system first conducts an environmental impact assessment on the substation expansion project. By identifying the environmental impact factors of the construction project (such as noise, dust, ecological damage, etc.), the system assesses its potential impact on the surrounding environment and quantifies the environmental impact value:

[0263]

[0264] Among them I i is the i-th environmental impact factor, W i The system may identify noise and dust pollution during construction as the main environmental impact factors and propose corresponding risk control measures, such as using sound insulation boards and sprinkling water to reduce dust during construction.

[0265] The system further conducts life cycle analysis to evaluate the comprehensive environmental impact of the substation expansion project throughout its life cycle, including construction, operation, maintenance and abandonment. The system quantifies the environmental impact of each stage and provides optimization suggestions:

[0266]

[0267] Where L j is the life cycle input of stage j, EF jis the corresponding environmental impact coefficient. Through life cycle analysis, the system may recommend the use of renewable materials or low-energy consumption equipment to reduce long-term environmental burden.

[0268] After completing the environmental impact assessment and life cycle analysis, the system generates environmental ethics optimization suggestions based on the analysis results. The system may make the following suggestions: Emission reduction and resource conservation: It is recommended to use environmental protection equipment during the construction process to reduce emissions; Green technology application: It is recommended to use renewable energy or low-carbon technology; Environmental risk control measures: Strengthen environmental monitoring to prevent the spread of pollution; Ecological compensation and restoration: If the impact on the environment is inevitable, it is recommended to carry out ecological restoration or compensation measures, such as afforestation, wetland restoration, etc.

[0269] Through the comprehensive analysis of step S4, the system can comprehensively evaluate the ethical issues of the substation expansion project in four dimensions: technology, benefits, responsibility, and environment, ensuring safety, reliability, and social responsibility during project implementation. The analysis results provided by the system will serve as the basis for the subsequent step (S5) to generate comprehensive and actionable answers.

[0270] After completing the engineering ethics analysis in step S4, the system enters step S5.

[0271] S5: Construct the question-answer generation module. This step is the core output unit of the system. It is responsible for integrating the technical information retrieved and analyzed in the previous steps with the ethical information to generate accurate, understandable and actionable answers that meet user needs. The design of this step includes two parts: comprehensive information integration and the understandability and operability of the answers, ensuring that the system can provide in-depth and practical suggestions on complex power system issues. Natural language generation (NLG) technology is used to optimize the language expression of the answers to ensure that the generated answers are highly consistent with the original semantics of the user's questions.

[0272] The module constructed in step S5 is the question-answer generation module. This step includes comprehensive information integration (S5.1) and the design of the understandability and operability of the answer (S5.2). In this step, the system will combine the previously collected and analyzed information to generate a logically clear, technically reliable, ethically compliant and easy-to-operate answer for users to refer to and execute. Step S5 specifically includes:

[0273] S5.1: Integrate the multi-dimensional information obtained from the technical background retrieval, i.e., background knowledge retrieval in step S3, and the engineering ethics analysis, i.e., step S4. The core goal of comprehensive information integration is to organically combine technical data, ethical analysis results, and the specific needs of the user's questions to generate a logically clear and comprehensive answer.

[0274] Furthermore, the first step of the question-answer generation step is to integrate the multi-dimensional information obtained from the technical background search (step S3) and the engineering ethics analysis (step S4). The core goal of comprehensive information integration is to organically combine technical data, ethical analysis results and the specific needs of the user's questions to generate a logically clear and comprehensive answer. Step S5.1 specifically includes:

[0275] S5.1.1: During the integration process, the system first synthesizes various types of information. Technical background information and ethical analysis information are integrated through weight models to ensure that the generated answers are technically comprehensive and accurate, ethically compliant and socially responsible. The mathematical representation of the integration is as follows:

[0276] A final =α tech ×A tech +β ethics ×A ethics

[0277] Among them, A final is the final generated answer, A tech For technical background information integration results, A ethics To integrate the results of ethical analysis information, α tech and β ethics They are the weight factors for technical information and ethical information, respectively. The weight factors are dynamically adjusted according to the nature of the problem, ensuring that problems with higher technical complexity focus on technical information, while problems with greater ethical risks increase the weight of ethical analysis.

[0278] S5.1.2: After information synthesis, the system optimizes the logical structure of the generated answers to ensure that the content is clear and easy to understand. Logical structure optimization uses a tree structure or graph structure to organize the answer content in a logical order, so that users can gradually understand each aspect of the question.

[0279] Step S5.1 may specifically include: comprehensive information integration.

[0280] The system first integrates multi-dimensional information from technical background (S3.1), ethical background (S3.2) and engineering ethics analysis (S4). Through information synthesis and weight distribution, the system generates a comprehensive draft answer to ensure that the answer content covers both technical requirements and reflects the results of ethical analysis. The formula for comprehensive information integration is: final =α tech ×A tech +β ethics ×A ethics , where A final is the final answer, A tech For comprehensive information on technical background and recommendations, Aethics For comprehensive information on ethical analysis and recommendations, α tech and β ethics They are the weight factors for technical information and ethical information respectively, and their specific values ​​are dynamically adjusted according to the nature of the problem.

[0281] In order to make the answers more logical and hierarchical, the system optimizes the logical structure of the synthesized information. Through a tree structure or a graph structure, the system organizes the answers in a logical order, allowing users to gradually understand each aspect of the question.

[0282] The following are examples of structured responses: 1. Technical suggestions: Use advanced construction safety monitoring systems to ensure the safety of workers and equipment; use low-noise equipment and water sprinkling to reduce dust to reduce the impact on the surrounding environment. 2. Ethical analysis and suggestions: Set up a benefit compensation fund for the local community to fairly deal with the inconvenience caused by construction; clarify the responsibilities of all parties during the construction process and develop emergency response plans; use renewable materials and environmentally friendly technologies to reduce the long-term impact on the environment.

[0283] S5.2: Ensure that the content of the answer is not only technically and ethically correct, but also understandable and operational. Use natural language generation (NLG) technology to optimize the language expression of the answer and ensure that the generated answer is highly consistent with the original semantics of the user's question. The formula is: Where s is the generated sentence, w i is the conditional probability of the ith word under the vocabulary chain model.

[0284] Furthermore, after generating the answer, the system needs to ensure that the content of the answer is not only technically and ethically correct, but also understandable and operational. This means that the answer generated by the system should be easy for users to understand and can be implemented in actual work. Step S5.2 specifically includes:

[0285] S5.2.1: To improve the comprehensibility of answers, the system uses natural language generation (NLG) technology to optimize the language expression of answers. NLG technology adjusts the language style, sentence structure, and vocabulary selection of the answer content to make the answer content closer to the user's language habits, reduce the use of technical terms or provide explanations for them, and ensure that users can easily understand the answer. The core algorithm of NLG can be expressed as:

[0286]

[0287] Among them, s is the generated sentence, P(w i ∣w i-1 ,w i-2,…) is the conditional probability of the i-th word under the vocabulary chain model. By maximizing the fluency of the sentence, the system can generate more natural and fluent answers. In addition, the system also uses semantic similarity calculation to ensure that the generated answer is highly consistent with the original semantics of the user's question to avoid giving irrelevant answers. Semantic similarity can be calculated using cosine similarity:

[0288]

[0289] Among them, q and a represent the semantic vectors of the user question and the system answer respectively. By calculating the cosine similarity between the two, the system ensures that the answer content is highly relevant to the question.

[0290] S5.2.2: In addition to comprehensibility, the system must ensure that the generated answers are actionable, that is, users can directly apply the suggestions in the answers in actual work. To this end, the system converts the technical operation steps and ethical suggestions in the answers into executable action plans or processes. The key to actionability design is to concretize technical guidance and ethical suggestions.

[0291] For example, for the question "Safety measures during substation maintenance", the answers generated by the system may include: Technical operation: clarify the power-off steps of the equipment, provide a detailed equipment maintenance checklist, and ensure that each operation step complies with safety regulations; Ethical advice: It is recommended to regularly train operators to improve their awareness of safe operations and establish a supervision mechanism to ensure the strict implementation of operating procedures.

[0292] In addition, the system may provide auxiliary tools such as standard operating procedure (SOP) templates and ethical risk assessment forms to help users directly apply the suggestions in the answers to actual work. These tools will be automatically generated based on the questions entered by the user to ensure their pertinence and practicality.

[0293] S5.2.3: After the answer is generated, the system will conduct an initial check on the accuracy and usefulness of the answer through an internal validation step. This includes comparing it with the system's internal expert rule base to ensure that the answer content meets industry standards and best practices.

[0294] At the same time, the system also integrates a user feedback mechanism, allowing users to rate and comment on the accuracy, comprehensibility and operability of answers. The system continuously optimizes the answer generation algorithm and improves the overall performance of the question-answering step by collecting user feedback data. The optimization of the feedback mechanism can be carried out through reinforcement learning. The system uses user feedback as a reward signal and adjusts the generation strategy to improve the quality of future answers. The feedback optimization formula is as follows:

[0295]

[0296] Among them, Q(s,a) is the value function of taking action a in state s, r is the reward value of user feedback, α is the learning rate, and γ is the discount factor. Through continuous learning, the system can gradually improve the quality of generated answers and user satisfaction.

[0297] Step S5.2 may specifically include: designing the comprehensibility and operability of the answer.

[0298] In order to improve the comprehensibility of answers, the system uses natural language generation (NLG) technology to optimize the language expression of answers. The system adjusts sentence structure, vocabulary selection, and language style to make the answers closer to the user's language habits and ensure that users can easily understand. The core formula for language optimization is:

[0299]

[0300] Among them, s is the generated sentence, P(w i ∣w i-1 ,w i-2 ,…) is the conditional probability of the i-th word under the vocabulary chain model. After this optimization process, the answers generated by the system are more fluent and the terminology is clear and easy to understand. On the basis of ensuring that the answers are easy to understand, the system further optimizes the operability of the answers. This process includes concretizing technical and ethical recommendations to form executable action plans or operational procedures.

[0301] An example of an operation step is as follows: 1. Construction safety measures: install a real-time safety monitoring system and conduct equipment inspections before each construction; regularly train workers to improve their safety operation awareness. 2. Environmental protection measures: use sound insulation panels and water sprinkling to reduce dust pollution during construction; conduct environmental impact assessments every week during construction and adjust construction strategies in a timely manner. 3. Community relationship management: establish community communication channels, regularly inform local residents of construction progress and environmental protection measures; establish a community interest fund to support community infrastructure construction.

[0302] In addition, the system provides tools such as standard operating procedure (SOP) templates and ethical risk assessment forms to help users directly apply suggestions to actual work.

[0303] Answer verification and feedback: After generating the final answer, the system conducts a preliminary check on the accuracy and practicality of the answer through an internal verification module. The system compares the generated answer with the internal expert rule base to ensure that it meets industry standards and best practices. Users can rate and comment on the answers, and the system continuously optimizes the generated model through this feedback. User feedback data is used for reinforcement learning to further improve the system's performance when dealing with similar problems. The update formula for reinforcement learning is:

[0304]

[0305] Among them, Q(s,a) represents the value function of taking action a in state s, and r is the user feedback as the reward value.

[0306] Finally, the system outputs an answer that comprehensively considers technology, ethics, and operability, ensuring that users can balance technical requirements and ethical responsibilities in practical applications and smoothly implement the substation expansion project. Through step S5, the system provides users with a comprehensive, easy-to-understand, and actionable answer, ensuring that users can effectively apply these suggestions in actual scenarios, achieve technical goals, and take into account all aspects of engineering ethics.

[0307] S5.3: Translate the technical operation steps and ethical recommendations in the answer into executable action plans or processes to ensure that users can directly apply the recommendations in the answer in their actual work.

[0308] After completing step S5, the system generates the final answer and provides it to the user. Next, the system enters step S6, the feedback and improvement module. This module aims to continuously optimize the system's question-answering performance and ethical analysis capabilities by collecting user feedback, tuning models, and updating databases. The following is a detailed process of step S6.

[0309] S6: Construct a feedback and improvement module. This step continuously optimizes the system's question-answering performance and engineering ethics analysis capabilities by collecting and analyzing user feedback. The feedback and improvement step, based on the feedback analysis, enters the model tuning stage and uses the reinforcement learning (RL) framework to adaptively tune the model. The feedback and improvement step includes three main parts: feedback collection and analysis, model tuning, and knowledge base update. Through this step, the system can continuously learn and evolve to ensure that it always maintains a high level of accuracy, practicality, and ethical compliance when dealing with power system-related issues. Step S6 specifically includes:

[0310] S6.1: Collect and analyze user feedback to continuously optimize the system’s question-answering performance and engineering ethics analysis capabilities.

[0311] Furthermore, feedback collection and analysis is the starting point for system improvement. When using the system, users can provide feedback on each generated answer, including but not limited to accuracy, comprehensibility, operability, and comprehensiveness of ethical analysis. Through this feedback mechanism, the system obtains users' direct evaluation of system performance and conducts subsequent optimization based on it. Step S6.1 specifically includes:

[0312] S6.1.1: The system can collect feedback through multiple channels, allowing users to provide feedback in different ways. These channels include: a rating system, where users can rate each answer, for example from 1 to 5 stars, reflecting overall satisfaction with the answer; comments and suggestions, where users can provide detailed comments or suggestions based on the rating, pointing out specific improvement needs or problems; problem reports, where users can submit problem reports for obviously wrong or incomplete answers to help the system quickly identify and correct problems. The system records this feedback in real time through the user interface (UI) and stores it in association with the generated answers and user questions.

[0313] S6.1.2: After collecting user feedback, the system performs structured analysis on this data. The goal of structured analysis is to convert users' subjective evaluations into quantifiable improvement goals. The system uses natural language processing (NLP) technology to perform sentiment analysis on user comments, extract positive or negative evaluation features, and quantify them into scoring weights. The core formula of sentiment analysis is:

[0314]

[0315] Among them, w i is the weight of the i-th word, polarity(t i ) is the word t i The system uses this scoring mechanism to convert user feedback into parameters that can be used for model tuning. In addition, the system uses clustering analysis to classify similar feedback and identify issues that users are concerned about or system weaknesses. For example, if multiple users report that the ethical analysis of a certain type of problem is insufficient, the system will cluster this feedback into an independent improvement requirement and focus on it during the model tuning process.

[0316] Step S6.1 may be: feedback collection and analysis.

[0317] After users view and use the answers, the system provides multiple feedback channels for users to evaluate the generated answers. These feedback channels include: 1. Rating system: users rate their overall satisfaction with the answers, usually ranging from 1 to 5 stars; 2. Comments and suggestions: users can leave specific comments or suggestions, pointing out the advantages of the answers or areas for improvement; 3. Problem reporting: users can report specific errors or deficiencies in the generated answers, such as inaccurate technical content, incomplete ethical analysis, etc. The system records these feedbacks in real time through the user interface (UI) and stores them in association with the generated answers and user questions.

[0318] After collecting feedback, the system performs structured analysis on the data to extract key information that can be used for improvement. The system uses natural language processing (NLP) technology to perform sentiment analysis on user comments and quantify the user's emotional inclination (positive or negative) towards the answer. The sentiment analysis formula is defined as follows:

[0319]

[0320] where w i is the weight of the i-th word, polarity(t i ) is the sentiment polarity score of word ti. The system also classifies similar feedback through cluster analysis to identify the problem points that users focus on. For example, if multiple users feedback that "environmental impact analysis is insufficient", the system will cluster such feedback into an independent improvement requirement.

[0321] S6.2: Based on the feedback analysis, we enter the model tuning stage and use the reinforcement learning (RL) framework to adaptively tune the model. Using user feedback as a reward signal, the system continuously adjusts the model parameters to optimize the quality of future questions and answers. The basic formula of reinforcement learning is: Q(s,a)←Q(s,a)+α[r+γmax a′ Q(s′,a′)-Q(s,a)], where Q(s,a) is the value function of taking action a in state s, r is the user feedback as the reward value, α is the learning rate, and γ is the discount factor.

[0322] Furthermore, based on the feedback analysis, the system enters the model tuning stage. The core goal of model tuning is to improve the overall performance of the system and user satisfaction by adjusting the algorithm parameters of the question-answer generation and ethical analysis steps. Step S6.2 specifically includes:

[0323] S6.2.1: The system uses a reinforcement learning (RL) framework to adaptively tune the model. By using user feedback as a reward signal, the system continuously adjusts the model parameters to optimize the quality of future questions and answers. The basic formula for reinforcement learning is:

[0324]

[0325] Among them, Q(s,a) is the value function of taking action a in state s, r is the user feedback as the reward value, α is the learning rate, and γ is the discount factor. Through this formula, the system can dynamically adjust the generation strategy and improve the performance of the model in practical applications.

[0326] In addition, the system further improves model performance through automatic hyperparameter optimization. The system uses methods such as Grid Search or Bayesian Optimization to automatically select the optimal model hyperparameter configuration, such as learning rate, weight decay, regularization parameters, etc.

[0327] S6.2.2: The system performs special tuning for the engineering ethics analysis step. Through user feedback, the system identifies possible weaknesses in ethical analysis (such as insufficient coverage of technical ethics, unclear analysis of responsibility ethics, etc.), and adjusts the model's ethical keyword extraction and analysis weights accordingly. In particular, the system uses domain adaptation technology to make the model better adaptable to different types of ethical issues. The goal of domain adaptation is to fine-tune the model so that it performs well in specific ethical scenarios. The process can be expressed as:

[0328]

[0329] in, is the task loss (e.g., accuracy in question-answer generation), is the domain adaptive loss, and λ is the loss weight factor. By optimizing this total loss, the system ensures that the model's analytical ability in different ethical scenarios is always at its best.

[0330] Step S6.2 may be: model tuning.

[0331] The system uses the reinforcement learning (RL) framework to adaptively tune the model. Using user feedback as a reward signal, the system adjusts the model parameters to optimize the quality of future questions and answers. The reinforcement learning formula is defined as follows:

[0332]

[0333] Among them, Q(s,a) is the value function of taking action a in state s, r is the reward value of user feedback, α is the learning rate, and γ is the discount factor. Through this formula, the system can dynamically adjust the generation strategy and improve the performance of the model in practical applications.

[0334] The system is specially tuned for the engineering ethics analysis module. The system will adjust the weights of ethical keyword extraction and analysis based on user feedback to ensure that ethical risks can be more accurately identified and analyzed in subsequent questions. The domain adaptive formula is defined as: in For mission loss, is the domain adaptation loss, and λ is the loss weight factor. By optimizing this total loss, the system can make the model better adapt to complex problems in specific ethical scenarios.

[0335] The system also selects the optimal model configuration through automatic hyperparameter optimization, such as GridSearch or Bayesian Optimization, to improve the accuracy of question and answer generation and ethical analysis.

[0336] S6.3: Update the knowledge base, expand the knowledge base content by introducing the latest industry standards, laws and regulations, technical documents and engineering ethics research results, and clean and optimize the existing data to remove redundant or outdated content to ensure the accuracy and relevance of the data. The formula is: in and They are the word vector representations of the two documents respectively.

[0337] Furthermore, the last step of feedback and improvement is to update the knowledge base. The knowledge base is the basis for the system to generate answers, and the accuracy, timeliness and comprehensiveness of its content directly affect the performance of the system. Therefore, the knowledge base needs to be updated regularly to ensure that it contains the latest industry knowledge and ethical standards. Step S6.3 specifically includes:

[0338] S6.3.1: The system expands the knowledge base content through various means, including the introduction of the latest industry standards, laws and regulations, technical documents and engineering ethics research results. The introduction of new data includes automatic crawling (Web Crawling), industry report subscriptions and expert knowledge contributions. For each newly introduced data source, the system performs preprocessing and semantic annotation to ensure that it can be seamlessly integrated with the existing data structure.

[0339] In addition, the system conducts in-depth research on specific issues mentioned in user feedback and promptly adds new knowledge to the knowledge base. For example, if user feedback involves the ethical risks of a certain type of emerging power equipment, the system will actively collect relevant literature and add it to the knowledge base to answer related questions in the future.

[0340] S6.3.2: While expanding the knowledge base, the system also cleans and optimizes existing data, removes redundant or outdated content, and ensures data accuracy and relevance. Data cleaning uses natural language processing technology to denoise text data, including deduplication, format normalization, and semantic error correction.

[0341] The system identifies and removes redundant data through TF-IDF (Term Frequency-Inverse Document Frequency) and word vector similarity calculations:

[0342]

[0343] Among them, d1 and d2 are two documents respectively. and is its word vector representation. When the similarity Sim(d1, d2) exceeds the set threshold, the system marks one of the documents as redundant data and removes it.

[0344] S6.3.3: In order to improve the retrieval efficiency and response speed of the knowledge base, the system optimizes the knowledge base structure. Specific measures include establishing an efficient index structure, optimizing query statements, and designing a distributed knowledge base architecture. The system uses inverted index technology to index key fields and speed up the query process. In addition, the system also introduces a distributed knowledge base architecture to improve the system's scalability and processing performance through data sharding and load balancing technologies.

[0345] Step S6.3 may specifically include: updating the database.

[0346] The system expands the database content through various means to ensure that the information in the database is kept up to date. Ways to introduce new data include automatic crawling (Web Crawling), industry report subscriptions, and expert knowledge contributions. All newly introduced data will be pre-processed and semantically annotated to ensure that it can be seamlessly integrated with existing data. For example, the system may introduce the latest published environmental specifications for the power industry, or the latest construction safety standards. These data will be added to the database as new knowledge to provide a basis for answering future questions.

[0347] The system cleans and optimizes the existing database, removes redundant or outdated content, and ensures the accuracy and relevance of the data. The similarity calculation formula is:

[0348]

[0349] Where d1 and d2 are two documents respectively. and As its word vector representation. When the similarity exceeds the set threshold, the system marks one of the documents as redundant data and removes it.

[0350] In order to improve the efficiency of database retrieval, the system optimizes the database structure. The main measures include establishing an efficient index structure, optimizing query statements, and designing a distributed database architecture. The system uses inverted index technology to index key fields, which significantly speeds up the query process. In addition, through the design of a distributed database architecture, the system can cope with large amounts of data and complex query requirements, ensuring the scalability and processing performance of the system.

[0351] Assuming that the user provides feedback on the previously generated answer "The environmental impact analysis of the substation expansion project is not in-depth enough", the system will take the following actions:

[0352] 1. Collect feedback and conduct structured analysis: The system records the feedback content and performs sentiment analysis and clustering through NLP. It is identified that "insufficient environmental impact analysis" is the main negative feedback content.

[0353] 2. Model tuning: The system adjusts the keyword weights of the (environmental) engineering ethics analysis module through a reinforcement learning mechanism to increase the depth of analysis of environmental factors such as “noise control” and “dust control”.

[0354] 3. Database update: The system introduces the latest environmental impact assessment reports and integrates them into the database to ensure that more detailed environmental analysis can be provided in future answers.

[0355] 4. Output improved answers: The next time a similar problem is encountered, the system will generate a more detailed and in-depth environmental impact analysis and include specific control measures.

[0356] Through the feedback and improvement mechanism of step S6, the system can continuously optimize its ability to generate questions and answers and conduct ethical analysis, ensuring that it always maintains a high level of accuracy and reliability in the face of a dynamically changing power system environment. This continuous improvement mechanism enables the system to continuously evolve and provide more accurate, comprehensive solutions that meet engineering ethics requirements.

[0357] Embodiment 2: A system for constructing an electric power knowledge question-answering system combined with engineering ethics analysis, which is based on the method for constructing an electric power knowledge question-answering system combined with engineering ethics analysis. The system for constructing an electric power knowledge question-answering system combined with engineering ethics analysis includes:

[0358] Model fine-tuning module, which is used to fine-tune the large language model based on the P-Tuning method to enhance the model's ability to understand and extract vocabulary related to engineering ethics in power systems;

[0359] The question understanding and classification module is responsible for receiving and processing questions raised by users, achieving semantic analysis, technical classification, and ethical risk identification through natural language processing technology, and providing key information for subsequent knowledge retrieval and answer generation;

[0360] The background knowledge retrieval module uses word embedding technology and TF-IDF algorithm to match and retrieve relevant background knowledge based on the information obtained from the question understanding and classification module, especially the part about ethical keywords;

[0361] Engineering Ethics Analysis Module, which comprehensively considers technical ethics, interest ethics, responsibility ethics and environmental ethics, and uses environmental impact assessment and life cycle analysis methods to identify and quantify potential environmental risks;

[0362] The question-answer generation module uses natural language generation technology to create answers that fit the context of the original question, ensuring that the generated answers are accurate and easy to understand;

[0363] Feedback and improvement module: This module collects user feedback and continuously optimizes the entire question-answering system through a reinforcement learning framework. It consists of three sub-parts: feedback collection and analysis, model tuning, and knowledge base update.

[0364] In summary, by illustrating the embodiments of the system construction method, the present invention demonstrates its efficiency and comprehensiveness in dealing with complex power system problems. The system can accurately parse user input, combine technical and ethical background information, conduct multi-dimensional engineering ethics analysis, and ultimately generate answers with technical depth, ethical compliance, and operability. In addition, the system ensures the dynamic optimization of its question-and-answer generation and ethical analysis capabilities through a continuous feedback and improvement mechanism, ensuring that accurate and responsible solutions are provided in practical applications, thereby significantly improving the decision-making quality and social responsibility of the power industry.

[0365] The present invention provides a method and system for constructing an electric power knowledge question and answer system combined with engineering ethics analysis, which can conduct a comprehensive engineering ethics analysis of technical solutions and operational suggestions. Ultimately, the answers generated by the system are not only technically accurate and feasible, but also ethically compliant, ensuring that users can balance technical requirements and ethical responsibilities in practical applications, thereby significantly improving the intelligence level of the electric power knowledge question and answer system and providing important support for the safe operation and sustainable development of the power industry.

Claims

1. A method for constructing an electric power knowledge question-answering system combined with engineering ethics analysis, characterized in that It includes the following steps: S1: Build a model fine-tuning module to fine-tune the large language model based on the P-Tuning method to build a power system question-answering knowledge base. By fine-tuning the open source large language model, the model's ability to extract keywords in the field of engineering ethics in the power system is enhanced; S2: Construct a question understanding and classification module. The question understanding and classification module is responsible for receiving user input questions, performing semantic analysis, technical classification, and ethical risk identification, and providing necessary semantic information for subsequent knowledge retrieval and question-answer generation. This step ensures that the system can accurately understand and handle complex power system problems through a combination of multiple natural language processing (NLP) technologies and algorithms. S3: Constructing the background knowledge retrieval module, the system first extracts the possible ethical keywords from the comprehensive semantic representation generated by the question understanding and classification module, and uses the same word embedding and TF-IDF algorithm to identify ethical keywords; S4: Construct an engineering ethics analysis module, comprehensively consider technical ethics, interest ethics, responsibility ethics and environmental ethics, and identify and quantify environmental risks through environmental impact assessment and life cycle analysis; S5: Build a question-answer generation module and use natural language generation (NLG) technology to optimize the language expression of the answer to ensure that the generated answer is consistent with the original semantics of the user's question; S6: Build a feedback and improvement module. Based on the feedback analysis, enter the model tuning stage and use the reinforcement learning (RL) framework to adaptively tune the model. The feedback and improvement module includes three main parts: feedback collection and analysis, model tuning, and knowledge base update.

2. The method for constructing an electric power knowledge question-answering system combined with engineering ethics analysis according to claim 1 is characterized in that Step S1 includes: S1.1: Prepare a large-scale question-answering dataset covering the power system field. The dataset includes various types of power system technical issues, operating procedures, fault case analysis, and ethical issues in the engineering decision-making process. The data comes from the power industry's technical documents, operating manuals, industry reports, academic papers, and historical case libraries in the power system. S1.2: The P-Tuning method is used to fine-tune the large language model. By adding specific prompt templates before inputting questions, the model is guided to focus on and extract key content related to power systems and engineering ethics, so as to improve the model's ability to extract keywords in the field of engineering ethics in power systems and optimize the model's performance in semantic understanding, contextual reasoning and ethical analysis. The fine-tuning process includes a large number of iterative training to ensure that the model can provide accurate technical answers and effectively identify potential ethical issues when dealing with complex power system problems.

3. The method for constructing an electric power knowledge question-answering system combined with engineering ethics analysis according to claim 1 is characterized in that Step S2 includes: S2.1: Perform semantic analysis and preprocessing on the questions input by users, use word segmentation technology to segment the input natural language, and identify the key technical terms and ethics-related words in the questions through part-of-speech tagging and named entity recognition (NER); S2.2: After the semantic analysis is completed, the system performs technical classification and multi-layer semantic analysis on the problem. The technical classification maps the problem to the pre-defined power technology field label through the convolutional neural network (CNN) or recurrent neural network (RNN) deep learning model. The multi-layer semantic analysis uses the Transformer-based multi-head attention mechanism to further analyze the logical structure and deep semantics of the problem. The formula is: Where Q, K, and V are query vectors, key vectors, and value vectors respectively. k is the dimension of the key vector; S2.3: Based on technical classification and semantic analysis, the system identifies ethical risks in the problem, and infers the possible ethical risk types in the problem through a pre-fine-tuned large model and a specially designed ethical risk classifier, using classification algorithms such as Bayesian Network or Support Vector Machine (SVM); the output of the ethical risk classifier is the probability distribution of various ethical risks: P ethics =f classifier (X semantic ), where X semantic is the semantic feature vector of the input question.

4. The method for constructing an electric power knowledge question-answering system combined with engineering ethics analysis according to claim 1 is characterized in that Step S3 includes: S3.1: Technical background information retrieval. The system uses the comprehensive semantic representation generated in the question understanding step to extract the technical keywords in the question. The keyword extraction is based on the word embedding model (Word Embedding) and the TF-IDF weight algorithm. Through the inverted index technology, the technical documents and knowledge graph nodes related to the extended keywords are retrieved from the knowledge base; the core formula of the retrieval process is: score(d,q)=∑ k∈q TF(k,d)·IDF(k)·norm(d), where d is the document, q is the query, TF(k,d) is the frequency of keyword k in document d, IDF(k) is the inverse document frequency of keyword k, and norm(d) is the document length normalization factor; S3.2: Ethical background information retrieval. The system first extracts possible ethical keywords from the comprehensive semantic representation generated in the problem understanding step, uses the same word embedding and TF-IDF algorithm to identify ethical keywords, and uses inverted indexing technology to retrieve relevant ethical background information from the ethical literature and case library. In addition, the system also considers the timeliness, authority and relevance of the literature and cases to ensure that the retrieved ethical information has practical guiding significance. S3.3: After completing the retrieval of technical background information and ethical background information, the system integrates the two parts of information to generate comprehensive background information. The system uses a weight model to integrate the technical background and ethical background information. The formula is: B=αT+βE, where B is the comprehensive background information, T is the technical background information, E is the ethical background information, α and β are weight factors, which are dynamically adjusted according to the actual situation of the problem.

5. The method for constructing an electric power knowledge question-answering system combined with engineering ethics analysis according to claim 1 is characterized in that Step S4 includes: S4.1: Conduct multi-dimensional ethical analysis of power system-related issues to ensure that the system fully considers technical ethics, interest ethics, responsibility ethics and environmental ethics while providing technical solutions; S4.2: Conduct responsibility ethics analysis, identify the main responsible parties in different situations through responsibility chain analysis, and ensure the reasonable distribution of responsibilities; responsibility chain analysis identifies the main responsible parties by calculating the total responsibility value of the responsibility chain. The formula is: R i =w i ·r ij , where R i is the responsibility value between i and j, w i is the responsibility weight of i, r ij is the influence coefficient of i on j; S4.3: Design corresponding accountability mechanisms, including pre-event responsibility, in-event responsibility and post-event responsibility, and match each responsible entity with its corresponding responsibility category and degree through the Responsibility Matrix; S4.4: Conduct environmental ethics analysis, identify and quantify environmental risks through environmental impact assessment (EIA) and life cycle analysis (LCA), and provide optimization suggestions. The environmental impact assessment formula is: Among them I i is the i-th environmental impact factor, W i For its weight, E total It is the comprehensive environmental impact value.

6. The method for constructing an electric power knowledge question-answering system combined with engineering ethics analysis according to claim 1 is characterized in that Step S5 includes: S5.1: Integrate the multi-dimensional information obtained from the technical background search (i.e., background knowledge search in step S3) and the engineering ethics analysis (i.e., step S4). The core goal of comprehensive information integration is to organically combine technical data, ethical analysis results, and the specific needs of the user's questions to generate a logically clear and comprehensive answer; S5.2: Ensure that the content of the answer is not only technically and ethically correct, but also understandable and operational. Use natural language generation (NLG) technology to optimize the language expression of the answer and ensure that the generated answer is highly consistent with the original semantics of the user's question. The formula is: Where s is the generated sentence, w i is the conditional probability of the ith word under the vocabulary chain model.

7. The method for constructing an electric power knowledge question-answering system combined with engineering ethics analysis according to claim 1 is characterized in that Step S6 includes: S6.1: Collect and analyze user feedback to continuously optimize the system’s question-answering performance and engineering ethics analysis capabilities; S6.2: Based on the feedback analysis, we enter the model tuning stage and use the reinforcement learning (RL) framework to adaptively tune the model. Using user feedback as a reward signal, the system continuously adjusts the model parameters to optimize the quality of future questions and answers. The basic formula of reinforcement learning is: Q(s,a)←Q(s,a)+α[r+γmax a′ Q(s′,a′)-Q(s,a)], where Q(s,a) is the value function of taking action a in state s, r is the user feedback as the reward value, α is the learning rate, and γ is the discount factor; S6.3: Update the knowledge base, expand the knowledge base content by introducing the latest industry standards, laws and regulations, technical documents and engineering ethics research results, and clean and optimize the existing data to remove redundant or outdated content to ensure the accuracy and relevance of the data. The formula is: in and They are the word vector representations of the two documents respectively.

8. A system for constructing an electric power knowledge question-answering system combined with engineering ethics analysis, which is based on the method for constructing an electric power knowledge question-answering system combined with engineering ethics analysis as claimed in claim 1, characterized in that The construction system of the power knowledge question-answering system combined with engineering ethics analysis includes: Model fine-tuning module, which is used to fine-tune the large language model based on the P-Tuning method to enhance the model's ability to understand and extract vocabulary related to engineering ethics in power systems; The question understanding and classification module is responsible for receiving and processing questions raised by users, achieving semantic analysis, technical classification, and ethical risk identification through natural language processing technology, and providing key information for subsequent knowledge retrieval and answer generation; The background knowledge retrieval module uses word embedding technology and TF-IDF algorithm to match and retrieve relevant background knowledge based on the information obtained from the question understanding and classification module, especially the part about ethical keywords; Engineering Ethics Analysis Module, which comprehensively considers technical ethics, interest ethics, responsibility ethics and environmental ethics, and uses environmental impact assessment and life cycle analysis methods to identify and quantify potential environmental risks; The question-answer generation module uses natural language generation technology to create answers that fit the context of the original question, ensuring that the generated answers are accurate and easy to understand; Feedback and improvement module: This module collects user feedback and continuously optimizes the entire question-answering system through a reinforcement learning framework. It consists of three sub-parts: feedback collection and analysis, model tuning, and knowledge base update.

Citation Information

Patent Citations

  • Electric power professional knowledge intelligent question answering system construction method based on large language model

    CN117609421A

Cited By

  • Question processing method and device and electronic equipment

    CN119917635A

  • A method, apparatus and electronic device for question processing

    CN119917635B

  • Tourism evaluation data generation method based on multi-stage processing

    CN119990315A

  • Multi-dimensional evaluation and integrated optimization method based on intelligent collaborative decision

    CN120561453A

  • Medical ethical analysis report generation method based on multi-model game

    CN121148723A