A chemical safety operation and maintenance method, device, medium and product based on a knowledge star graph enhanced large language model

By using a knowledge star graph-based approach to enhance the large language model, the problem of low efficiency in entity relationship representation and retrieval in chemical safety operation and maintenance was solved. This approach enables efficient and accurate risk assessment and handling suggestions, thereby improving the auxiliary operation and maintenance effect of chemical safety operation and maintenance.

CN120782428BActive Publication Date: 2025-11-07EAST CHINA UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511300625.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-12
Publication Date
2025-11-07
Estimated Expiration
2045-09-12

AI Technical Summary

Technical Problem

Existing GraphRAG technology cannot accurately represent and store complex entity relationships in the field of chemical safety operation and maintenance, resulting in long entity retrieval time and poor relevance, making it difficult to meet the needs of chemical safety operation and maintenance for efficient and accurate knowledge retrieval.

Method used

This paper adopts a method based on knowledge star graph-enhanced large language model. By collecting text information from the field of chemical safety operation and maintenance, constructing chemical safety knowledge documents and performing structured processing, using a two-level keyword mechanism to perform semantic processing on risk signals, and combining the knowledge star graph library for entity retrieval and content generation to generate risk feedback information.

Benefits of technology

It improved the efficiency and quality of auxiliary operation and maintenance information obtained by chemical safety operation and maintenance personnel, and enabled rapid and accurate risk assessment and handling suggestions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120782428B_ABST
    Figure CN120782428B_ABST
Patent Text Reader

Abstract

The application discloses a chemical safety operation and maintenance method and device based on a knowledge star map enhanced large language model, relates to the field of chemical safety analysis, and comprises the following steps: collecting text information from the field of chemical safety operation and maintenance and constructing a structured knowledge set; dividing the chemical safety knowledge set, identifying and extracting chemical entities in each text block, and constructing a knowledge star map; performing semantic analysis on a risk signal, obtaining high-level and low-level keywords by using a two-level keyword mechanism, and respectively searching for similar entities and determining the type of a target entity; searching for a target knowledge star map, querying the content of a target entity by using the edges between nodes in the graph, and generating corresponding risk feedback by referring to the risk signal and the content of the target entity by using a large language model. The application improves the efficiency and quality of auxiliary operation and maintenance information obtained by chemical safety operation and maintenance personnel.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of chemical safety analysis, in particular to a chemical safety operation and maintenance method, device, medium and product based on a knowledge star graph enhanced large language model. BACKGROUND

[0002] As a pillar industry of the national economy, the rapid development of the petrochemical industry has made outstanding achievements in economic construction. Due to the variety of chemical production processes and the complexity of raw materials and products, various safety risks often occur in chemical processes, which need to be judged and handled in a timely manner, otherwise production accidents may occur. Therefore, a chemical safety operation and maintenance method that can effectively assist operation and maintenance personnel in judging and handling risks is needed.

[0003] In recent years, the rapid development of large language models (LLM) represented by ChatGPT has accelerated the research of natural language processing, and has also derived many applications of artificial intelligence. Using large language models to assist operation and maintenance personnel in judging and handling risks is theoretically a feasible method of chemical safety operation and maintenance. However, the dependence of these models on limited training data and static pre-training knowledge limits their performance in knowledge-intensive applications. As research deepens, general large language models have appeared in more and more professional application scenarios "hallucination" problem, that is, the generated content does not match the question or is not related.

[0004] In order to solve the "hallucination" problem of general large language models in professional field applications, some scholars have proposed a retrieval augmented generation (RAG) technology: users provide knowledge documents in the professional field, use large language models to block and vectorize the documents, and store them in a vector database; When the user asks a question, the question text will be vectorized, and then the relevant text blocks will be retrieved in the vector database according to the vector similarity, these text blocks will be input into the large language model together with the user's question, and finally the answer content of the large language model will be obtained. In this process, RAG enhances the knowledge retrieval and answer generation capabilities of large language models in professional field applications by supplementing professional field knowledge to large language models, and RAG technology has greatly promoted the development of intelligent question and answer systems, educational assistance and intelligent customer service applications.

[0005] In the field of chemical safety operation and maintenance, the knowledge text is mainly composed of HAZOP (Hazard and Operability Study) reports and chemical accident reports. When the text is divided into blocks, the semantic coherence in the text blocks and the information loss are easily caused, which affects the prompting effect of the text blocks on the large language model, and leads to poor performance of the large language model in judging risks and providing processing suggestions.

[0006] Recently, some scholars use a knowledge graph to replace the text block in RAG to provide professional knowledge reference for the large language model, which is called GraphRAG. The large language model extracts entities from the professional field knowledge document provided by the user according to the prompt word, and constructs a professional field knowledge graph. When the user asks a question, the large language model queries the nodes representing the related entities in the knowledge graph according to the entity recognition of the question, and obtains the entity content related to the question. These contents and the user's question are input into the large language model, and finally the answer content of the large language model is obtained.

[0007] The text entities in the field of chemical safety operation and maintenance are clear, have strong correlation and complex relationships, which are very suitable for processing queries using the GraphRAG method. However, on the one hand, due to the complex relationships between these entities, such as the relationship between the causes and consequences of deviation, the relationship between the causes and measures of deviation, and the relationship between the consequences and measures of deviation, the traditional knowledge graph cannot accurately represent and store these complex entity relationships. On the other hand, after inputting the risk information, the traditional method of retrieving related entities is time-consuming and the relevance of the retrieved content is poor due to the lack of clear target, which is not consistent with the requirements of rapid judgment and processing of risks in the field of chemical safety operation and maintenance.

[0008] Therefore, in the field of chemical safety operation and maintenance, the existing GraphRAG technology has obvious defects in the representation and storage of entity relationships, the time consumption and content relevance of entity retrieval, and it is difficult to meet the needs of efficient and accurate knowledge retrieval in the application scenario of chemical safety operation and maintenance. These problems directly affect the auxiliary effect of the chemical safety operation and maintenance method in judging and processing risks, and a new method is needed to effectively solve the above technical problems. SUMMARY

[0009] The purpose of the present application is to provide a chemical safety operation and maintenance method, device, medium and product based on a knowledge star graph enhanced large language model, to improve the efficiency and quality of auxiliary operation and maintenance information obtained by chemical safety operation and maintenance personnel.

[0010] To achieve the above-mentioned purpose, the present application provides the following solutions:

[0011] In a first aspect, the present application provides a chemical safety operation and maintenance method based on a knowledge star map enhanced large language model, comprising:

[0012] Collecting text information from the field of chemical safety operation and maintenance and constructing a chemical safety knowledge document, cleaning the chemical safety knowledge document and performing structured processing to obtain a chemical safety knowledge set; the text information includes a set of chemical safety accident reports, a set of hazard and operability analysis reports, and a set of related literature;

[0013] Performing block and semantic analysis on the chemical safety knowledge set to obtain a plurality of text blocks, and identifying and extracting entities contained in each of the text blocks according to entity prompt words to obtain an entity set corresponding to each of the text blocks, and storing the entities in a vector entity library after vectorization to construct a knowledge star map of each of the text blocks and store it in a knowledge star map library;

[0014] The large language model uses a two-level keyword mechanism to perform semantic processing on the risk signals to obtain high-level keywords and low-level keywords; the risk signals are obtained by using a plurality of sensors;

[0015] Retrieving similar entities from the vector entity library using the high-level keywords to obtain a first vector entity set, and determining a target entity type using the low-level keywords;

[0016] Retrieving a target knowledge star map in the knowledge star map library based on the first vector entity set, querying a target entity using edges between nodes in the target knowledge star map to obtain target entity content; the target knowledge star map is a knowledge star map in the knowledge star map library corresponding to a second vector entity set; the second vector entity set is a vector entity set in the vector entity library with the highest vector cosine similarity to the first vector entity set;

[0017] The large language model generates corresponding risk feedback information based on the target entity content, taking the target entity type as the focus; the risk feedback information includes the cause, consequence, and solution measures of the risk.

[0018] In an embodiment, text information is collected from the field of chemical safety operation and maintenance and a chemical safety knowledge document is constructed, the chemical safety knowledge document is cleaned and structured to obtain a chemical safety knowledge set, specifically comprising:

[0019] Integrating the text information to construct a chemical safety knowledge document;

[0020] Cleaning the chemical safety knowledge document to remove description sentences unrelated to chemical safety to obtain a cleaned chemical safety knowledge document;

[0021] The chemical safety knowledge statements in the cleaned chemical safety knowledge document are structured, so that each statement contains five entity contents of equipment, deviation, cause, consequence and measure, to obtain structured knowledge statements;

[0022] The structured knowledge statements are uniformly formatted as UTF-8 encoding to construct a chemical safety knowledge set.

[0023] In an embodiment, the chemical safety knowledge set is divided into blocks and semantically analyzed to obtain a plurality of text blocks, and entities contained in each text block are recognized and extracted according to entity prompt words to obtain an entity set corresponding to each text block, and the entities are vectorized and stored in a vector entity library to construct a knowledge star graph of each text block and store it in a knowledge star graph library, specifically including:

[0024] The text in the chemical safety knowledge set is divided into blocks using an initialized large language model to obtain text blocks and a text block set;

[0025] According to the language characteristics and entity types in the text blocks, combined with the prompt word engineering, entity prompt words for recognizing and extracting five entities of equipment, deviation, cause, consequence and measure contained in each text block in the text block set are written;

[0026] The entity prompt words are embedded into the initialized large language model to obtain a large language model with entity prompt words;

[0027] Each entity contained in each text block in the text block set is recognized and extracted using the large language model with entity prompt words to obtain an entity set corresponding to each text block, and the entity set is converted into a vector entity set using an embedding model and stored in a vector entity library;

[0028] A knowledge star graph corresponding to each text block is constructed and stored in a knowledge star graph library; the five nodes in the knowledge star graph corresponding to each text block are five vector entities in the vector entity set.

[0029] In an embodiment, the large language model uses a two-level keyword mechanism to semantically process risk signals to obtain high-level keywords and low-level keywords, specifically including:

[0030] The large language model takes the deviation description containing obvious entities in the risk signal as a high-level keyword;

[0031] The large language model takes the inquiry part containing implicit entities in the risk signal as a low-level keyword.

[0032] In an embodiment, the high-level keywords are used to retrieve similar entities from the vector entity library to obtain a first vector entity set, and the low-level keywords are used to determine a target entity type, specifically comprising:

[0033] The high-level keywords are vectorized to obtain a high-level keyword vector set;

[0034] The vector cosine similarity between the high-level keyword vector set and the vector entities in the vector entity library is calculated to obtain similar entities, thereby obtaining the first vector entity set;

[0035] The large language model performs semantic analysis on the low-level keywords to determine the target entity type.

[0036] In an embodiment, the first vector entity set is used to retrieve a target knowledge star graph from the knowledge star graph library, and the target entity content is obtained by querying the target entity through the edges between the nodes in the target knowledge star graph, specifically comprising:

[0037] The vector cosine similarity between the first vector entity set and each vector entity set in the vector entity library is calculated;

[0038] The target knowledge star graph is retrieved from the knowledge star graph library based on the vector cosine similarity;

[0039] According to the target entity type, the target entity content is obtained by querying any vector entity in the first vector entity set through the edges connecting the vector entity nodes and the target entity nodes in the target knowledge star graph.

[0040] In an embodiment, the vector cosine similarity between the first vector entity set and each vector entity set in the vector entity library is calculated, specifically comprising:

[0041] The formula is used to calculate the vector cosine similarity between the first vector entity set and each vector entity set in the vector entity library; wherein, is and The similarity score between them constitutes a similarity matrix; the similarity matrix represents the vector cosine similarity between the first vector entity set and any vector entity set in the vector entity library; represents the i-th data of the first vector entity set; represents the j-th data of any vector entity set in the vector entity library; is the norm of the vector.

[0042] In a second aspect, the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the chemical safety operation and maintenance method based on the knowledge star graph enhanced large language model according to any one of the above.

[0043] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the chemical safety operation and maintenance method based on the knowledge star graph enhanced large language model according to any one of the above.

[0044] In a fourth aspect, the present application provides a computer program product comprising a computer program, wherein the computer program is executed by a processor to implement the chemical safety operation and maintenance method based on the knowledge star graph enhanced large language model according to any one of the above.

[0045] According to the specific embodiments provided by the present application, the present application has the following technical effects:

[0046] The present application provides a chemical safety operation and maintenance method based on a knowledge star graph enhanced large language model, a device, a medium and a product. The method comprises collecting text information from the field of chemical safety operation and maintenance and constructing a chemical safety knowledge document, cleaning the chemical safety knowledge document and performing structured processing to obtain a chemical safety knowledge set; performing block division and semantic analysis on the chemical safety knowledge set to obtain a plurality of text blocks, and identifying and extracting entities contained in each text block according to a set prompt word to obtain an entity set corresponding to each text block, and storing the entities in a vector entity library after vectorization to construct a knowledge star graph of each text block and store it in a knowledge star graph library; a large language model performs semantic processing on a risk signal using a two-level keyword mechanism to obtain high-level keywords and low-level keywords; similar entities are retrieved from the vector entity library using the high-level keywords to obtain a first vector entity set, and a target entity type is determined using the low-level keywords; a target knowledge star graph is retrieved in the knowledge star graph library based on the first vector entity set, and a target entity is queried using edges between nodes in the target knowledge star graph to obtain target entity content; the large language model generates corresponding risk feedback information based on the target entity content, taking the target entity type as the focus. The risk feedback information includes the cause, consequence and solution measures of the risk. The present application realizes optimization of entity retrieval based on a two-level keyword mechanism and a knowledge star graph enhanced large language model, and improves the efficiency and quality of auxiliary operation and maintenance information obtained by chemical safety operation and maintenance personnel. BRIEF DESCRIPTION OF DRAWINGS

[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed in the embodiments. Obviously, the drawings described below only constitute some embodiments of the present application. For those skilled in the art, other drawings can also be obtained from these drawings without creative labor.

[0048] Figure 1 A flowchart of a chemical safety operation and maintenance method based on a knowledge star graph enhanced large language model provided by an embodiment of the present application is shown in the figure.

[0049] Figure 2 A flowchart of a chemical safety operation and maintenance method based on a knowledge star graph enhanced large language model provided by an embodiment of the present application is shown in the figure.

[0050] Figure 3 A knowledge star graph diagram provided by an embodiment of the present application is shown in the figure.

[0051] Figure 4 A complete flowchart of a chemical safety operation and maintenance method based on a knowledge star graph enhanced large language model provided by an embodiment of the present application is shown in the figure.

[0052] Figure 5 A structure diagram of a chemical safety operation and maintenance system based on a knowledge star graph enhanced large language model provided by an embodiment of the present application is shown in the figure.

[0053] Figure 6 A structure diagram of a computer device provided by an embodiment of the present application is shown in the figure. DETAILED DESCRIPTION

[0054] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments only constitute some embodiments of the present application, rather than all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0055] The present application provides a chemical safety operation and maintenance method based on a knowledge star graph enhanced large language model, which is used to solve the defects of the existing knowledge graph enhanced retrieval generation technology in the representation and storage of entity relationships, the time consumption and content relevance of entity retrieval, and to realize the optimization of entity retrieval based on a knowledge star graph enhanced large language model and a two-level keyword mechanism, thereby improving the efficiency and quality of auxiliary operation and maintenance information obtained by chemical safety operation and maintenance personnel and greatly exerting the practical application value of the system.

[0056] The above purposes, features and advantages of the present application will be more apparent and easy to understand. The present application will be described in further detail below with reference to the drawings and specific embodiments.

[0057] In one exemplary embodiment, as shown in Figure 1 and Figure 2 A chemical safety operation and maintenance method based on knowledge star map enhanced large language model is provided, comprising the following steps:

[0058] S1: Collecting text information from the field of chemical safety operation and maintenance and constructing chemical safety knowledge documents, cleaning the chemical safety knowledge documents and performing structured processing to obtain a set of chemical safety knowledge; the text information includes a set of chemical safety accident reports, a set of hazard and operability analysis reports, and a set of related literature. The text information mainly refers to information about chemical risks, such as the set of hazard and operability analysis reports: including equipment, deviation, cause, consequence, and recommended measures. For example: "The pressure of the compressor is too high, which may be caused by compressor failure and feed control failure, which may cause equipment damage, leakage, and explosion accidents, etc. It is recommended to install a pressure safety valve, set up an automatic adjustment system, and perform regular inspection and maintenance. The hydrogen-carbon ratio in the reactor is too low, which may be caused by excessive carbon dioxide content in the raw gas."

[0059] S2: The set of chemical safety knowledge is divided into blocks and semantically analyzed to obtain a plurality of text blocks, and the entities contained in each text block are identified and extracted according to entity prompt words to obtain a set of entities corresponding to each text block, and the entities are vectorized and stored in a vector entity library, and a knowledge star map of each text block is constructed and stored in a knowledge star map library.

[0060] S3: The large language model uses a two-level keyword mechanism to perform semantic processing on the risk signal to obtain high-level keywords and low-level keywords; the risk signal is obtained by using a variety of sensors. The risk signal is captured by a risk identification module, that is, various sensor signals, and after comparison with normal values, it can be known whether there is a risk. If the sensor signal is abnormal, it is input into the system as a risk signal. The high-level keywords are more obvious entities in the risk signal, and the low-level keywords are not obvious entities, which are also target entities. For example, the risk signal: "Why is the temperature in the reactor too high?", the high-level keywords are "reactor" and "temperature too high", and the low-level keyword is "why". The large language model will identify the low-level keyword "why", which corresponds to the cause entity, and this entity type is also the target for retrieval later.

[0061] S4: Using the high-level keywords to retrieve similar entities from the vector entity library to obtain a first set of vector entities, and using the low-level keywords to determine the target entity type.

[0062] S5: Retrieving a target knowledge star graph based on the first set of vector entities in the knowledge star graph library, querying target entities between nodes in the target knowledge star graph to obtain target entity content; the target knowledge star graph is a knowledge star graph in the knowledge star graph library corresponding to the second set of vector entities; the second set of vector entities is the set of vector entities in the vector entity library with the highest vector cosine similarity to the first set of vector entities.

[0063] S6: The large language model generates corresponding risk feedback information based on the target entity content, focusing on the target entity type; the risk feedback information includes the cause, consequence and solution of the risk. The generation process: the large language model uses the retrieved target entity content and the knowledge accumulated during its own pre-training stage to organize and generate feedback information such as the cause, consequence and recommended measures of device bias. Risk feedback information is feedback content for risk identification and handling, usually including the cause, consequence and solution of the risk.

[0064] After processing the chemical safety knowledge documents, the large language model identifies and extracts entities in the text blocks according to the set entity prompt words, and then constructs a knowledge star graph corresponding to each text block and stores it in the knowledge star graph library. The knowledge star graph is shown in Figure 3 , which is composed of entities such as devices, biases, causes, consequences and measures.

[0065] After analyzing the high-level and low-level keywords in the risk signal, the high-level keywords are matched with similar entities, the matched entities are used to retrieve the target knowledge star graph, and the target entity content corresponding to the low-level keywords is obtained by querying the target knowledge star graph. The large language model gives a comprehensive, highly relevant and highly executable risk feedback according to the risk signal and the prompt of the target entity content obtained by querying. The complete flowchart is shown in Figure 4 , which first collects chemical safety knowledge documents to obtain knowledge documents D, processes the knowledge documents D to obtain structured knowledge documents, and obtains a set of chemical safety knowledge K, then performs text blocking on the set of chemical safety knowledge K to obtain a set of chemical safety knowledge containing text blocks (chunks), i.e. text block chunk1, text block chunk2, text block chunk3,..., text block chunkN, then uses LLM to identify and extract entities, and vectorizes the extracted entities to construct corresponding knowledge star graphs. The knowledge star graph is composed of A n , B n , C n , D n and E nComposition, where n is the number of knowledge star maps, A1 is the equipment entity of the first knowledge star map, B1 is the deviation entity of the first knowledge star map, C1 is the cause entity of the first knowledge star map, D1 is the consequence entity of the first knowledge star map, and E1 is the measure entity of the first knowledge star map; A2 is the equipment entity of the second knowledge star map, B2 is the deviation entity of the second knowledge star map, C2 is the cause entity of the second knowledge star map, D2 is the consequence entity of the second knowledge star map, and E2 is the measure entity of the second knowledge star map. n For the device entity of the nth knowledge star map, B n For the deviation entity of the nth knowledge star map, C n For the cause entity of the nth knowledge star map, D n For the consequences entity and E of the nth knowledge star map n For the measure entity of the nth knowledge star map, the knowledge star map is stored in the knowledge graph library, and the vectorized entities are stored in the vector entity library. Based on the entity set in the vector entity library, the target knowledge star map is retrieved from the knowledge graph library. Next, risk signals are generated and transformed to obtain risk issues. High-level keywords and low-level keywords are extracted from the risk issues. Low-level keywords are used for entity queries, and high-level keywords are used for LLM semantic understanding to obtain the target entity type. Based on the target entity type and the retrieved knowledge star map, the entity content is determined. Then, combined with the risk issues, LLM is used to obtain risk feedback, which is then fed back to the chemical safety operation and maintenance personnel.

[0066] This embodiment processes and saves chemical safety knowledge documents as a set of vector entities, and maps these entities to star graph nodes by constructing a knowledge star graph. This enables the visualization of chemical safety knowledge, facilitating the exploration of semantic relationships between different entities. The use of this novel graph structure, the knowledge star graph, effectively adapts to the characteristics of chemical safety knowledge entities with clearly defined types and complex relationships, significantly improving the efficiency and accuracy of entity content queries. Semantic analysis of the obtained risk signals is performed, and risk texts are classified using a two-level keyword mechanism: high-level keywords and low-level keywords. High-level keywords are used to retrieve similar entities, and then the knowledge star graph related to the risk signals is determined based on these similar entities. Semantic understanding of low-level keywords reveals the target entity type corresponding to the risk signals. This not only provides targets for querying the knowledge star graph but also indicates the key aspects that the large language model should focus on in generating feedback, effectively improving query efficiency and accuracy, as well as the quality of the feedback generated by the large language model. The high-quality feedback generated by the large language model helps chemical safety operations and maintenance personnel quickly determine the possible causes and consequences of risks and provides practical measures to assist them in resolving risk issues in a timely manner.

[0067] On the basis of the above-mentioned embodiments, in the present embodiment, the original data in the field of chemical safety operation and maintenance is classified according to the source, and a set of chemical safety accident reports A, a set of hazard and operability analysis reports H and a set of related literature I are obtained. Among them, the set of chemical safety accident reports A includes official accident reports of various types of chemical safety accidents occurring in various countries; the set of hazard and operability analysis H includes network-searchable HAZOP reports and some private HAZOP reports, and the set of related literature I includes the contents related to process safety analysis in the literature of chemical safety analysis in various countries.

[0068] In the present embodiment S1, specifically comprises:

[0069] S11: integrating the text information to construct a chemical safety knowledge document D, D={A, H, I}.

[0070] S12: cleaning the chemical safety knowledge document D to remove the description sentences irrelevant to chemical safety, to obtain the cleaned chemical safety knowledge document D C .

[0071] S13: structuring the chemical safety knowledge sentences in the cleaned chemical safety knowledge document D C , so that each sentence contains five entity contents of equipment, deviation, cause, consequence and measure, to obtain the structured knowledge sentences.

[0072] In the present embodiment, S13, comprises:

[0073] S131: according to the obtained knowledge document content and structured sentence target, combining with the prompt word engineering, writing the structured prompt word S C for the structured and cleaned chemical safety knowledge document D PROMPT .

[0074] According to the knowledge document content and structured sentence target, writing the prompt word S C for the structured and cleaned chemical safety knowledge document D PROMPT , specifically:

[0075] As a senior expert in the chemical industry, I have some knowledge documents in the field of chemical safety operation and maintenance that need your help to process. Specifically, I will give you some sentences from chemical safety accident reports, HAZOP reports and literature in the field of chemical safety operation and maintenance. Please refer to the format and content characteristics of the following sentences:

[0076] The high pressure of the compressor may be caused by compressor failure and feed control failure, which may cause equipment damage, leakage, explosion and other consequences. It is recommended to install a pressure safety valve, set up an automatic adjustment system, and regularly check and maintain.

[0077] Rewrite all the knowledge sentences you gave me in the format and content characteristics of the example sentences. In this process, you need to imitate the format of the example sentences and rearrange the order of the sentences according to the specific content. Finally, output the entire sentence document in segments.

[0078] S132: Rewrite the structured prompt words S PROMPT into a large language model initialized with embedding, obtaining a large language model LLM-S with structured prompt words PROMPT .

[0079] S133: Use the semantic understanding and text processing functions of the large language model LLM-S with structured prompt words PROMPT to rewrite each knowledge sentence in the cleaned chemical safety knowledge document D PROMPT according to the structured prompt words S C template.

[0080] S14: Format the structured knowledge sentences into UTF-8 encoding, and integrate all knowledge sentences to build a chemical safety knowledge set K.

[0081] In an embodiment, S2 specifically includes:

[0082] S21: Use the initialized large language model to block the text in the chemical safety knowledge set K, obtaining text blocks T i and text block set T C , T C ={T1, T2, T3, …, T i}.

[0083] In this embodiment, according to the distribution and length of the text in the chemical safety knowledge set K, the number of characters contained in each text block and the range of context are reasonably set to ensure that the content of the obtained text block is complete.

[0084] The content of the text block should ideally be a sentence containing five entities: equipment, deviation, cause, consequence, and measures, to facilitate the identification and extraction of entities by the large language model.

[0085] S22: According to the language characteristics and entity types in the text block, combined with the prompt word engineering, write entity prompt words E C for identifying and extracting five entities: equipment (Equipment, EQU), deviation (Deviation, DEV), cause (CAUSE), consequence (Consequence, CONSE), and measures (Measure, MEA) contained in each text block T i in the text block set T PROMPT .

[0086] In this embodiment, the number of entities in each text block is five, and the entity categories are equipment, deviation, cause, consequence, and measure.

[0087] Write a program to identify and extract the five entities of equipment (EQU), deviation (DEV), cause (CAUSE), consequence (CONSE), and measure (MEA) from each text block T C i in the text block T PROMPT , specifically:

[0088] As a senior expert in the chemical industry, I need your help to identify and extract the chemical entities I want from some text. Specifically, each text should have five different entities: equipment, deviation, cause, consequence, and measure. Due to the fixed length of the text, each text block may contain content from other text blocks, and when identifying entities, there may be more than one of the five entities. In this case, please follow the "center" principle and only keep the one closest to the middle of the text. Ensure that the identified and extracted entities belong to the target text block. Please refer to the format and content characteristics of the following sentences:

[0089] (1) Ideal case, i.e. the text block to be analyzed does not contain the content of other text blocks:

[0090] The reactor temperature is too high, which may be caused by the failure of the low liquid level interlock of the steam drum, overpressure of the steam drum, dry pot, compressor not pumping, unreasonable adjustment of the reactor inlet flow, and high outlet temperature of the reactor. If not handled in time, it may cause catalyst sintering or even burn out the reactor tube. It is recommended to carry an infrared temperature gun for inspection, and after emergency shutdown, check the reactor. If found to be burned out, repair it in time.

[0091] At this time, the entity identification should be:

[0092] <‘Equipment’, ‘EQU’>: ‘Reactor’.

[0093] <‘Deviation’, ‘DEV’>: ‘Temperature is too high’.

[0094] <‘Cause’, ‘CAUSE’>: ‘Failure of low liquid level interlock of steam drum, overpressure of steam drum, dry pot, compressor not pumping, unreasonable adjustment of reactor inlet flow, and high outlet temperature of reactor’.

[0095] <‘Consequence’, ‘CONSE’>: ‘Catalyst sintering or even burn out of reactor tube’.

[0096] <‘Measure’, ‘MEA’>: ‘Carry an infrared temperature gun for inspection, and after emergency shutdown, check the reactor. If found to be burned out, repair it in time.’. ​

[0097] (2) General case, i.e. the text block to be analyzed contains the content of other text blocks:

[0098] After emergency shutdown, the reactor should be inspected, and if burnout is found, it should be repaired in time. The high pressure of synthesis gas in the compressor may be caused by compressor failure and feed control failure, which may cause equipment damage, leakage, explosion, etc. It is recommended to install a pressure safety valve, set up an automatic adjustment system, and regularly check and maintain. The low hydrogen-carbon ratio of the reaction gas in the reactor may be caused by too much carbon dioxide in the raw material gas.

[0099] At this time, the entity recognition should be:

[0100] <‘device’, ‘EQU’> : ‘compressor’.

[0101] <‘deviation’, ‘DEV’> : ‘high synthesis gas pressure’.

[0102] <‘cause’, ‘CAUSE’> : ‘compressor failure and feed control failure’.

[0103] <‘consequence’, ‘CONSE’> : ‘equipment damage, leakage, explosion’.

[0104] <‘measure’, ‘MEA’> : ‘install pressure safety valve, set up automatic adjustment system, regular inspection and maintenance’.

[0105] This text block contains part of the content of the previous text block and the next text block. At this time, the “center” principle should be followed, and the five entities close to the center are identified and extracted. As mentioned above, ignore the possible measure entity “after emergency shutdown, the reactor should be inspected, and if burnout is found, it should be repaired in time”, the possible device entity “reactor”, the possible deviation entity “low hydrogen-carbon ratio of the reaction gas”, and the possible cause entity “too much carbon dioxide in the raw material gas”.

[0106] Before that, the content in each entity is independent and unique, and the equipment involved in the deviation, cause, consequence and measure should not be identified as a device entity.

[0107] S23: embed the entity prompt word E PROMPT in the initialized large language model to obtain a large language model LLM-E with entity prompt words PROMPT .

[0108] S24: use the large language model LLM-E with entity prompt words PROMPT to identify and extract each text block T C in the text block set T iThe entity set E corresponding to each text block T is obtained i The entity set E is converted into a vector entity set E by using an embedding model i Vi The vector entity set E is stored in a vector entity library E B .

[0109] In this embodiment, a large language model LLM-E with entity prompt words PROMPT Based on the templates in the embedding prompt words and the text block information, five entities in the text block are identified and extracted as an entity set E i E i ={EQU, DEV, CAUSE, CONSE, MEA}.

[0110] The entity text in all entity sets E i is converted into a vector entity set E Vi by a large language model for embedding, and stored in a vector entity library E B .

[0111] S25: Construct a knowledge star graph G i corresponding to each text block T Si , in which five nodes are respectively pointed to by five vector entities in the vector entity set E Vi , and all knowledge star graphs corresponding to the text blocks are constructed in turn and stored in a knowledge star graph library G B .

[0112] In this embodiment, a complete graph containing five endpoints is constructed, which is named "knowledge star graph".

[0113] A complete graph is defined as a simple undirected graph in which every pair of distinct vertices is connected by exactly one edge. A complete graph with n endpoints has n(n-1) / 2 edges, denoted by K n .

[0114] A knowledge star graph is a complete graph containing five endpoints. In the knowledge star graph, each pair of different entities is connected by two edges. When querying entities in the knowledge star graph, this multi-edge structure can shorten the query time.

[0115] The knowledge star graph contains five nodes, and the five entities in the entity set E i corresponding to the text block T i are respectively pointed to the five nodes, completing the construction of the knowledge star graph G Si corresponding to the text block T i .

[0116] All knowledge star graphs are constructed in turn according to the construction method of the knowledge star graph G Si , and saved in a knowledge star graph library G​B In some embodiments, S3 specifically includes:

[0117] In some embodiments, S3 specifically includes:

[0118] S31: The large language model describes the bias description containing the obvious entity in the risk signal as a high-level keyword.

[0119] S32: The large language model describes the inquiry part containing the implicit entity in the risk signal as a low-level keyword.

[0120] In this embodiment, the two-stage keyword mechanism:

[0121] The bias description containing the obvious entity is defined as a high-level keyword High_level Keys.

[0122] The inquiry part containing the implicit entity is defined as a low-level keyword Low_level Keys.

[0123] Risk signal example: "What should I do if the reactor temperature is too high?".

[0124] Risk signal example keyword extraction:

[0125] High_level Keys: ["reactor", "equipment"], ["temperature is too high", "bias"].

[0126] Low_level Keys: ["what should I do"].

[0127] In some embodiments, S4 specifically includes:

[0128] S41: Vectorize the high-level keywords to obtain a high-level keyword vector set H KV .

[0129] S42: Obtain similar entities by calculating the vector cosine similarity between the high-level keyword vector set and the vector entities in the vector entity library, thereby obtaining a first vector entity set.

[0130] In this embodiment, the corresponding first vector entity set E qV is obtained by searching the vector entity library E B through the method of calculating vector cosine similarity.

[0131] The vector cosine similarity is represented by a similarity matrix M1, and the elements in the similarity matrix M1 are ; wherein, is the similarity score between and , and and respectively represent a high-level keyword vector set H Kv the i-th data of the first vector entity set E B the j-th data of the vector entity set E Vi in the vector entity library E is the length of the vector.

[0132] By calculating the vector entity semantic similarity, a high-level keyword vector set H KV corresponding second vector entity set E B in the vector entity library E qV .

[0133] S43: The large language model performs semantic analysis on the low-level keywords to determine the target entity type.

[0134] The large language model performs semantic analysis on the content in Low_level Keys: [“ ”] to determine the target entity type, for example, the target entity type corresponding to Low_level Keys: [“ ”] should be “measure”.

[0135] In an embodiment, S5 specifically comprises:

[0136] S51: Calculate the vector cosine similarity between the first vector entity set and each vector entity set in the vector entity library, specifically comprising:

[0137] The vector cosine similarity between the first vector entity set and each vector entity set in the vector entity library is calculated using the formula ; wherein, is and the similarity score between them, and the similarity score constitutes a similarity matrix; the similarity matrix represents the vector cosine similarity between the first vector entity set and any vector entity set in the vector entity library; represents the i-th data of the first vector entity set; represents the j-th data of any vector entity set in the vector entity library; is the length of the vector.

[0138] S52: Retrieve the target knowledge star graph in the knowledge star graph library based on the vector cosine similarity.

[0139] In this embodiment, by calculating the vector cosine similarity, based on the similarity matrix M2, the first vector entity set E qV is used to retrieve the second vector entity set E gV, with the highest similarity, and then determine the target knowledge star graph G qS.

[0140] wherein the elements in the similarity matrix M2 are denoted as .

[0141] By calculating the vector entity semantic similarity, based on the similarity matrix M2 in the knowledge star graph library G B find the second vector entity set E qV with the highest similarity with the first vector entity set E gV corresponding target knowledge star graph G qS .

[0142] S53: According to the target entity type, by any vector entity in the first vector entity set E qV query the target entity content by the edge connecting the vector entity node and the target entity node in the target knowledge star graph G qS .

[0143] In this embodiment, the target entity corresponding to the risk signal changes according to the needs of the chemical safety operation and maintenance personnel. Taking the risk information "reactor temperature is too high" as an example:

[0144] (1) Need to know the possible reasons for the risk, the target entity type is reason.

[0145] Risk signal example: "Why does the reactor temperature become too high?".

[0146] Risk signal example keyword extraction:

[0147] High_level Keys: ["reactor", "equipment"], ["temperature is too high", "deviation"].

[0148] Low_level Keys: ["why"].

[0149] (2) Need to know the possible consequences of the risk, the target entity type is consequence.

[0150] Risk signal example: "What will happen if the reactor temperature is too high?".

[0151] Risk signal example keyword extraction:

[0152] High_level Keys: ["reactor", "equipment"], ["temperature is too high", "deviation"].

[0153] Low_level Keys: ["what will happen"].

[0154] (3) Need to know the treatment measures of the risk, the target entity type is measure.

[0155] Risk signal example: "What if the reactor temperature is too high?".

[0156] Risk signal example keyword extraction:

[0157] High_level Keys: ["reactor", "equipment"], ["temperature too high", "deviation"].

[0158] Low_level Keys: ["what if"].

[0159] The large language model refers to the target entity content obtained by the risk signal and the retrieved knowledge star map, and takes the entity type corresponding to the low-level keyword as the focus, to generate the corresponding risk feedback information.

[0160] The present application designs a knowledge graph based on a knowledge star map (a complete graph of five endpoints). In the field of chemical safety operation and maintenance, it solves the problem of representing complex entity relationships and multiple query steps of traditional knowledge graphs. Through the mapping of related entities in the chemical safety knowledge set, the five endpoints of the knowledge star map represent five entities: equipment, deviation, cause, consequence, and measures. Each text block contained in the chemical safety knowledge set corresponds to a knowledge star map. This structure of knowledge graph is obviously superior to traditional knowledge graph in knowledge representation and knowledge query. In processing risk signals, the high-level and low-level keywords obtained by risk analysis are used to retrieve similar entities and determine the target entity type, respectively. This mechanism not only improves the efficiency of risk processing, but also enhances the understanding of the large language model for risk statements, ensuring that the final generated risk feedback content is true and reliable.

[0161] In order to verify the feasibility and effectiveness of the present application in the field of chemical safety operation and maintenance, the following will detail the operation process of the knowledge star map enhanced large language model in practical application and its comparison results through a specific scenario.

[0162] A large chemical plant is producing methanol via carbon dioxide hydrogenation. Maintenance personnel monitoring the process observe that the reactor temperature is gradually rising, about to exceed the normal reaction's maximum temperature. At this point, the personnel first need to determine why the reactor temperature is rising, then consider the potential consequences. Finally, based on the identified causes and consequences, they must quickly implement risk assessment and mitigation measures. This involves not only resolving the temperature rise but also checking for potential consequences. Faced with this urgent situation, the personnel hope to obtain information to quickly determine the possible causes and consequences of the temperature increase, enabling them to address the risk issue as soon as possible. However, reviewing existing documentation is too time-consuming, and consulting large language models yields incomplete and inaccurate answers. Ultimately, the personnel must rely on past experience and relevant knowledge to investigate the cause and resolve the risk, thus reducing efficiency and increasing their workload.

[0163] To address the aforementioned issues, the method described in this application can be used to assist in chemical safety operation and maintenance. By introducing a knowledge star map and a two-level keyword mechanism, a chemical safety operation and maintenance system capable of quickly handling risk issues has been established.

[0164] The maintenance personnel wanted to understand the possible causes of the risk after it occurred. Therefore, the signal processing process would generate a related question, "Why is the reactor temperature too high?", based on the risk description text "reactor temperature too high". With the input of this risk question, the chemical safety operation and maintenance system started to work.

[0165] The first step is for the system to analyze the input risk question using a large language model and extract high-level and low-level keywords related to the question. Among them, "reactor" and "excessive temperature" are extracted as high-level keywords, and "why" is extracted as low-level keywords.

[0166] The second step involves the system calculating the semantic similarity between high-level keywords and entities in the vector entity library to determine the standard entity corresponding to the risk issue; the system then uses a large language model to parse low-level keywords and clarify the type of the target entity to be queried.

[0167] The third step involves the system retrieving the corresponding knowledge star map based on the standard entity corresponding to the risk issue, and querying the entity content through the edge between any standard entity corresponding to the risk issue and the node corresponding to the target entity type in the knowledge star map.

[0168] Fourth, the system's large language model generates high-quality feedback information by referencing the retrieved entities and risk content, assisting chemical safety operation and maintenance personnel in handling risks:

[0169] The reasons for the high temperature in the reactor may include: failure of low liquid level interlock of the drum, overpressure of the drum, dry pot, no flow of the compressor, unreasonable adjustment of the reactor inlet flow, and high temperature at the reactor outlet.

[0170] This high temperature condition may cause the catalyst to sinter or even burn out the reaction tube, seriously affecting the normal operation of the equipment and production efficiency.

[0171] Therefore, when such a situation occurs, the following measures are recommended: carry an infrared temperature measuring gun for inspection; in an emergency, stop the car and conduct a comprehensive inspection of the reactor; if damage is found, timely repair is required.

[0172] Through these methods, the high temperature condition can be effectively monitored and prevented from occurring, thereby protecting the safe operation of the equipment.

[0173] To verify the effect of the present application, the system conducted a comparative test in the chemical safety operation scene, used four large language models to comprehensively evaluate the feedback content generated by the original RAG, knowledge graph RAG and the method of the present application, compared the scores of the three methods, and the comparative test results are shown in Table 1.

[0174] Table 1 Comparative test results of the method of the present application and other methods in the chemical safety operation

[0175]

[0176] Among the methods involved in the above comparative test, the original RAG method refers to the method of enhancing a large language model based on a knowledge text block; the knowledge graph RAG method refers to the method of enhancing a large language model based on an ordinary knowledge graph; the method of the present application is the method of enhancing a large language model based on a knowledge star map.

[0177] The comparative test results show that under the same application scene and evaluation standard, the method of the present application can significantly improve the comprehensive level of risk feedback quality and efficiency in chemical safety operation, verifying the advantages of the system in representing and storing knowledge in the field of chemical safety, analyzing risk data text and high-level risk feedback, providing efficient and reliable risk processing assistance for chemical safety operation personnel, and reducing the occurrence of chemical safety accidents.

[0178] The method and system for chemical safety operation and maintenance based on knowledge star graph enhanced large language model provided by the application collect text information from the field of chemical safety operation and maintenance and construct a structured knowledge set; the chemical safety knowledge set is divided into blocks, chemical entities in each text block are identified and extracted, and a knowledge star graph is constructed; semantic analysis is performed on the risk signals, high-level and low-level keywords are obtained by using a two-level keyword mechanism, and the high-level and low-level keywords are used to search for similar entities and determine the type of target entities respectively; the target knowledge star graph is searched, and the content of the target entity is queried by using the edges between the nodes in the graph; and the large language model generates corresponding risk feedback by referring to the risk signals and the content of the target entity. The application realizes the chemical safety operation and maintenance based on the knowledge star graph enhanced large language model, and improves the content quality of the risk feedback of the large language model in the field of chemical safety operation and maintenance.

[0179] A system for chemical safety operation and maintenance based on knowledge star graph enhanced large language model provided by the application is described below, and the system for chemical safety operation and maintenance based on knowledge star graph enhanced large language model described below can be correspondingly referred to the method for chemical safety operation and maintenance based on knowledge star graph enhanced large language model described above.

[0180] As shown in Figure 5 , the system for chemical safety operation and maintenance based on knowledge star graph enhanced large language model comprises:

[0181] A model initialization module configured to pull and initialize a large language model for generation and a large language model for converting text into a vector.

[0182] A document processing module configured to collect text information from the field of chemical safety operation and maintenance and construct a chemical safety knowledge document D, clean the chemical safety knowledge document D and perform structured processing to obtain a chemical safety knowledge set K.

[0183] A graph construction and storage module configured to divide and perform semantic analysis on the chemical safety knowledge set K, and identify and extract entities contained in each text block according to a set prompt word to obtain each text block T i corresponding entity set E i , and store the entities in a vector entity library E B after vectorization, construct a knowledge star graph G Si specific to each text block, and store the knowledge star graph G B in a knowledge star graph library.

[0184] A risk processing module configured to, after obtaining risk data input, perform semantic processing on the input risk data by the large language model, obtain high-level and low-level keywords by using a two-level keyword mechanism, search for similar entities by using the high-level keywords, and determine the type of target entities by using the low-level keywords.

[0185] The retrieval module is configured to obtain a first vector entity set E according to high-level keyword matching qV The retrieval module is configured to obtain a first vector entity set E according to high-level keyword matching qV The retrieval module is configured to obtain a first vector entity set E according to high-level keyword matching qS The retrieval module is configured to obtain a first vector entity set E according to high-level keyword matching

[0186] The feedback module is configured to generate corresponding risk feedback information by combining the target entity content obtained by the large language model and the risk data and the knowledge star graph, and return the risk feedback information to the safety operation personnel of the chemical process.

[0187] In an exemplary embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the above-mentioned chemical safety operation method based on the knowledge star graph enhanced large language model.

[0188] In an exemplary embodiment, a computer readable storage medium is provided, storing a computer program, which is executed by a processor to implement the above-mentioned chemical safety operation method based on the knowledge star graph enhanced large language model.

[0189] In an exemplary embodiment, a computer program product is provided, including a computer program, which is executed by a processor to implement the above-mentioned chemical safety operation method based on the knowledge star graph enhanced large language model.

[0190] In an exemplary embodiment, a computer device is provided, which can be a server or a terminal, and its internal structure diagram can be as shown in Figure 6 The computer device includes a processor, a memory, an input / output interface (I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to communicate with external terminals through network connection. The computer program is executed by the processor to implement a chemical safety operation method based on the knowledge star graph enhanced large language model.

[0191] Those skilled in the art can understand, Figure 6It should be noted that the structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0192] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant regulations.

[0193] It can be understood by those skilled in the art that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. Any reference to memory, database or other medium used in the embodiments provided by the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric memory (Ferroelectric Random Access Memory, FRAM), phase change memory (Phase Change Memory, PCM), graphene memory, etc. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc.

[0194] The database involved in the embodiments provided by the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a blockchain, etc., without being limited thereto. The processor involved in the embodiments provided by the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.

[0195] The technical features of the above embodiments can be combined in any manner. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described, however, as long as the combinations of the technical features do not contradict each other, they should be considered to be within the scope of the present specification.

[0196] The principles and implementation manners of the present application are described herein by using specific examples, and the above embodiments are only used to help understand the method of the present application and its core idea; meanwhile, for those of ordinary skill in the art, the specific implementation manners and application range can be changed according to the idea of the present application. In conclusion, the content of the present specification should not be understood as a limitation of the present application.

Claims

1. A chemical safety operation and maintenance method based on a knowledge star map enhanced large language model, characterized in that, The method comprises the following steps: Collecting text information from the field of chemical safety operation and maintenance and constructing a chemical safety knowledge document, cleaning the chemical safety knowledge document and performing structured processing to obtain a chemical safety knowledge set; the text information includes a set of chemical safety accident reports, a set of hazard and operability analysis reports, and a set of related literature; Performing block and semantic analysis on the chemical safety knowledge set to obtain a plurality of text blocks, and identifying and extracting entities contained in each text block according to entity prompt words to obtain an entity set corresponding to each text block, and storing the entities in a vector entity library after vectorization to construct a knowledge star graph of each text block and store it in a knowledge star graph library; A large language model uses a two-level keyword mechanism to perform semantic processing on risk signals to obtain high-level keywords and low-level keywords; the risk signals are obtained by using a plurality of sensors; Using the high-level keywords to retrieve similar entities from the vector entity library to obtain a first vector entity set, and using the low-level keywords to determine a target entity type; Based on the first vector entity set, a target knowledge star graph is retrieved in the knowledge star graph library, and a target entity is queried in the target knowledge star graph to obtain target entity content; the target knowledge star graph is a knowledge star graph corresponding to a second vector entity set in the knowledge star graph library; the second vector entity set is a vector entity set with the highest vector cosine similarity with the first vector entity set in the vector entity library; Based on the target entity content, a large language model generates corresponding risk feedback information by focusing on the target entity type; The risk feedback information includes the cause, consequence and solution of the risk.

2. The chemical safety operation and maintenance method based on the knowledge star map enhanced large language model according to claim 1, characterized in that, Collecting text information from the field of chemical safety operation and maintenance and constructing a chemical safety knowledge document, cleaning the chemical safety knowledge document and performing structured processing to obtain a chemical safety knowledge set, specifically comprising: Integrating the text information to construct a chemical safety knowledge document; Cleaning the chemical safety knowledge document to remove description sentences unrelated to chemical safety to obtain a cleaned chemical safety knowledge document; Performing structured processing on the chemical safety knowledge sentences in the cleaned chemical safety knowledge document so that each sentence contains five entity contents: equipment, deviation, cause, consequence and measure, to obtain structured knowledge sentences; Uniformly formatting the structured knowledge sentences into UTF-8 encoding to construct a chemical safety knowledge set.

3. The chemical safety operation and maintenance method based on the knowledge star map enhanced large language model according to claim 1, characterized in that, Performing block and semantic analysis on the chemical safety knowledge set to obtain a plurality of text blocks, and identifying and extracting entities contained in each text block according to entity prompt words to obtain an entity set corresponding to each text block, and storing the entities in a vector entity library after vectorization to construct a knowledge star graph of each text block and store it in a knowledge star graph library, specifically comprising: Using an initialized large language model to block the text in the chemical safety knowledge set to obtain text blocks and a text block set; According to the language characteristics and entity categories in the text blocks, combined with prompt word engineering, entity prompt words for identifying and extracting five entities, including devices, biases, causes, consequences and measures, contained in each of the text blocks in the text block set are written; The entity prompt words are embedded into the initialized large language model to obtain a large language model with entity prompt words; The large language model with entity prompt words is used to identify and extract entities contained in each of the text blocks in the text block set to obtain an entity set corresponding to each of the text blocks, and the entity set is converted into a vector entity set by using an embedding model and stored in a vector entity library. A knowledge star graph corresponding to each of the text blocks is constructed and stored in a knowledge star graph library; the five nodes in the knowledge star graph corresponding to each of the text blocks are five vector entities in the vector entity set.

4. The chemical safety operation and maintenance method based on the knowledge star map enhanced large language model according to claim 1, characterized in that, The large language model uses a two-level keyword mechanism to perform semantic processing on the risk signal to obtain high-level keywords and low-level keywords, specifically including: The large language model takes the bias description containing obvious entities in the risk signal as a high-level keyword; The large language model takes the inquiry part containing implicit entities in the risk signal as a low-level keyword.

5. The chemical safety operation and maintenance method based on the knowledge star map enhanced large language model according to claim 1, characterized in that, The high-level keywords are used to retrieve similar entities from the vector entity library to obtain a first vector entity set, and the low-level keywords are used to determine the target entity type, specifically including: The high-level keywords are vectorized to obtain a high-level keyword vector set; The vector cosine similarity between the high-level keyword vector set and the vector entities in the vector entity library is calculated to obtain similar entities, thereby obtaining a first vector entity set; The large language model performs semantic analysis on the low-level keywords to determine the target entity type.

6. The chemical safety operation and maintenance method based on the knowledge star map enhanced large language model according to claim 1, characterized in that, Based on the first vector entity set, a target knowledge star graph is retrieved from the knowledge star graph library, and the target entity is queried based on the edges between the nodes in the target knowledge star graph to obtain target entity content, specifically including: The vector cosine similarity between the first vector entity set and each vector entity set in the vector entity library is calculated; Based on the vector cosine similarity, a target knowledge star graph is retrieved from the knowledge star graph library; According to the target entity type, the target entity content is queried by means of any vector entity in the first vector entity set and the edge connecting the vector entity node and the target entity node in the target knowledge star graph.

7. The chemical safety operation and maintenance method based on the knowledge star map enhanced large language model according to claim 6, characterized in that, The vector cosine similarity between the first vector entity set and each vector entity set in the vector entity library is calculated, specifically including: The vector cosine similarity between the first vector entity set and each vector entity set in the vector entity library is calculated by using the formula The similarity score between the first vector entity set and any vector entity set in the vector entity library is a similarity matrix; the similarity matrix represents the vector cosine similarity between the first vector entity set and any vector entity set in the vector entity library; The i-th data of the first vector entity set is represented by The j-th data of any vector entity set in the vector entity library is represented by The length of the vector is represented by​​​ 8. A computer device comprising: A memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that the processor executes the computer program to implement the chemical safety operation and maintenance method based on the knowledge star graph enhanced large language model of any one of claims 1-7.

9. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the chemical safety operation and maintenance method based on the knowledge star graph enhanced large language model of any one of claims 1-7.

10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the chemical safety operation and maintenance method based on the knowledge star graph enhanced large language model in any one of claims 1-7.

Citation Information

Patent Citations

  • Fluororubber field knowledge graph construction method based on large language model

    CN119647575A

  • A method to provide comprehensive key vocabulary for search

    WO2025027623A1