JSA operation safety analysis method and system based on AI agent
By automating JSA analysis through an AI intelligent agent system, the problem of reliance on manual labor is solved, information standardization and comprehensive analysis are achieved, and high-quality security reports are generated.
Patent Information
- Application Number
- CN202511705666.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-20
- Publication Date
- 2026-02-10
AI Technical Summary
The existing JSA (Job Safety Analysis) process relies on human experience, which is inefficient, results in unstable information quality, lacks comprehensiveness and specificity in the analysis results, and makes it difficult to integrate information from multiple sources, leading to inconsistencies in the report logic.
An AI intelligent agent system is adopted to acquire information through user-level interaction, convert it into structured data, dynamically call tools for analysis, combine historical experience and general knowledge to resolve information conflicts, and generate unified analytical conclusions.
It automates and standardizes JSA analysis, improves information collection efficiency, ensures the integrity and consistency of analysis, enhances the depth and accuracy of risk identification, and generates high-quality security analysis reports.
Smart Images

Figure CN121503907A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of petroleum and petrochemical safety, specifically to a JSA (Job Safety Analysis) method and system based on AI agents. Background Technology
[0002] Job Safety Analysis (JSA) is an important tool for risk management and accident prevention in high-risk industries such as oil and petrochemicals. Its core lies in breaking down specific work tasks into steps, identifying potential hazards in each step, and developing corresponding control measures to ensure that the work process is safe and controllable.
[0003] In existing technologies, the preparation process of JSA is usually highly dependent on manual labor. The collection of operational information requires on-site personnel to manually fill out forms. This process is not only inefficient, but also often results in inconsistent quality of submitted information due to differences in the experience and expression habits of the personnel filling out the forms. There are cases of missing key information or non-standard descriptions. The non-standardization of input directly affects the accuracy of subsequent risk analysis.
[0004] Secondly, in the risk identification phase, the depth and breadth of the analysis are largely limited by the personal experience and knowledge level of the analysts. Analysts mainly rely on their own professional knowledge and memory to make judgments, making it difficult to systematically combine the lessons learned from historical accident cases or similar operations accumulated within the company. This results in risk analysis remaining at a general level, with blind spots in the identification of some uncommon but serious risks, or specific risks that have been exposed in specific historical cases, leading to insufficient depth and lack of specificity in the analysis.
[0005] Furthermore, during the analysis process, there is a lack of safety information from different sources. For example, there may be inconsistencies or even conflicts between general safety procedures and lessons learned from specific historical cases. Existing technologies lack a systematic method to verify and integrate this information to resolve potential contradictions. The reliability of the analysis depends entirely on the personal judgment of the analysts, which may result in logical inconsistencies or content conflicts in the final JSA report, reducing its credibility as a field safety guidance document.
[0006] Therefore, how to automate the entire JSA process and ensure the comprehensiveness, relevance, and reliability of the analysis results is a technical problem that urgently needs to be solved in this field. Summary of the Invention
[0007] To address the shortcomings of existing technologies, this invention provides a JSA (Job Safety Analysis) method and system based on AI agents. This solves the problems of low efficiency, difficulty in knowledge reuse, and inconsistent analysis quality due to individual skill differences in the existing JSA process, which largely relies on human experience. In particular, the unstructured historical documents are difficult to retrieve and reference effectively, leading to incomplete risk identification.
[0008] To achieve the above objectives, the first aspect of this invention provides a JSA (Job Safety Analysis) method based on AI agents, comprising the following steps: S1. Receive the initial job description from the user through the user layer. If it is determined that key information is missing, request supplementary information from the user to obtain the complete context information required to complete the JSA analysis. Through a human-computer interaction loop, provide complete and accurate input data for subsequent analysis steps.
[0009] S2. Process the complete context information to extract key information about the job name, job location, job description, and equipment / tools, and convert the key information into a structured data format. Standardize the unstructured natural language input to facilitate unified and accurate automated processing by subsequent modules.
[0010] S3. Based on the key information extracted in step S2, and combined with preset logical rules and an understanding of the tool's functions, an ordered sequence of tool calls is generated. Through task planning, the system can autonomously decide and arrange subsequent processing flows according to specific task content, achieving dynamic adaptation of the analysis path.
[0011] S4. Following the tool call sequence in step S3, sequentially call the corresponding tools in the tool layer and obtain the returned results; verify and evaluate the multiple obtained results. If conflicts are detected between results from different sources, execute the preset conflict resolution strategy, generate corrected analysis results, and integrate all verified and corrected results to form a unified analysis conclusion. Through the evaluation and conflict resolution mechanism, multi-source information is integrated to ensure the consistency and completeness of the analysis conclusion.
[0012] S5. Invoke the formatted output tool to fill the unified analysis conclusions integrated in step S4 into the preset JSA document template, generating a structured job safety analysis report, and presenting it to the user through the user layer. This achieves automated and standardized output of analysis results. In a specific implementation, steps S1 and S3 are executed by a proxy layer, which is responsible for parsing user input, determining the integrity of information, and performing task planning based on the extracted key information to generate the ordered tool call sequence.
[0013] In a specific implementation, the tools called in step S4 include historical experience retrieval tools and job safety analysis tools. By combining historical cases with general safety knowledge for analysis, the analysis results not only include past lessons learned but also have universal applicability.
[0014] To resolve information conflicts from different tool sources, the conflict resolution strategy specifically includes: The historical cases returned by the historical experience retrieval tool are compared with the preliminary analysis content generated by the job safety analysis tool to identify content conflicts; Generate a correction instruction for the content conflict; The correction command is used as new input to re-invoke the job safety analysis tool and obtain the corrected analysis results. This ensures that specific key risks in historical cases are fully absorbed and reflected, avoiding omissions in the general analysis model. For example, when the content conflict manifests as a general risk description generated by the job safety analysis tool being inconsistent with the specific hazards emphasized in historical cases returned by the historical experience retrieval tool, it guides the job safety analysis tool to supplement the analysis content regarding the specific hazards.
[0015] To support the retrieval of historical experience, this method also includes a step of processing historical JSA job security analysis documents using data processing tools. The data processing tools segment the historical documents into text fragments and map these text fragments into vectors using a text embedding model before storing them in a vector database. Based on this, the historical experience retrieval tool converts the current job description into a query vector and retrieves text fragments containing similar historical cases from the vector database by calculating similarity, providing relevant historical case references for the analysis.
[0016] During the output phase, the formatted output tool parses the unified analysis conclusions and accurately fills the information about work steps, hazard identification, and control measures into the corresponding structured fields in the JSA document template, generating a uniformly formatted report.
[0017] A second aspect of the present invention provides a JSA job security analysis system based on AI intelligent agents, comprising: a user layer, a memory storage layer, a tool layer, and an agent layer.
[0018] The user layer is configured to receive an initial job description input by the user and present the final generated structured job safety analysis report.
[0019] The memory storage layer is configured to store the history of multi-turn dialogues between the user and the system, providing support for the agent layer to understand the context and perform coherent interactions.
[0020] The tool layer contains one or more functional tools that are invoked by the proxy layer, configured to perform specific tasks and return the results to the proxy layer. These functional tools include data processing tools, historical experience retrieval tools, job safety analysis tools, and formatted output tools.
[0021] The proxy layer, acting as the system's control center, establishes communication connections with the user layer, memory storage layer, and tool layer, respectively. It is configured for: The system receives an initial job description from the user layer, combines it with the multi-turn dialogue history obtained from the memory storage layer to form complete context information, and requests supplementation through the user layer when it is determined that the information is missing. The acquired complete context information is processed to extract key information and convert it into a structured data format; Based on the extracted key information, an ordered sequence of tool calls is generated for invoking the tool layer. The corresponding tools in the tool layer are invoked according to the tool invocation sequence, and the returned multiple results are verified and evaluated, as well as conflicts are resolved, and then integrated into a unified analysis conclusion. Finally, the formatted output tool in the tool layer is invoked to generate a structured job safety analysis report from the unified analysis conclusions, which is then presented through the user layer.
[0022] This invention provides a JSA (Job Safety Analysis) method and system based on AI intelligent agents. It has the following beneficial effects: 1. This invention automates and standardizes the acquisition of initial information for JSA through an interactive information completion mechanism between the user layer and the agent layer, as well as key information extraction and standardization processing. This replaces the traditional manual filling and verification, not only improving the efficiency of information collection, but also ensuring the completeness and consistency of the input information required for subsequent analysis, laying the foundation for generating high-quality analysis reports.
[0023] 2. This invention dynamically calls historical experience retrieval tools and operational safety analysis tools through task planning, combining the enterprise's internal historical case experience with general safety knowledge for analysis. This makes risk identification no longer limited to general models, but can be combined with specific historical cases for comprehensive analysis, improving the pertinence and depth of the analysis, and helping to discover specific risks that are easily overlooked in traditional methods.
[0024] 3. The conflict resolution strategy proposed in this invention enables the agent layer to verify and evaluate the results from different tools. When an inconsistency is detected between the specific harm in a historical case and the general analysis results, the system actively integrates the conflict information by generating a correction instruction and calling the analysis tool again, ultimately forming a unified analysis conclusion. This ensures the logical consistency and reliability of the analysis results, avoids information piling up and potential contradictions, and improves the accuracy and credibility of the final JSA report. Attached Figure Description
[0025] Figure 1 This is a schematic diagram of the system architecture of the present invention; Figure 2 This is a schematic diagram of the method flow of the present invention. Detailed Implementation
[0026] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0027] Please see the appendix Figure 1 This invention provides a JSA job security analysis system based on AI intelligent agents, comprising: a user layer, an agent layer, a memory storage layer, and a tool layer.
[0028] The oil and petrochemical safety user layer is configured to provide an interactive interface to receive natural language information from users regarding job safety analysis. This natural language information may include job type, job location, job description, and the equipment and tools used. The oil and petrochemical safety user layer forwards the received information to the agent layer for processing. Simultaneously, the oil and petrochemical safety user layer is also configured to receive and present to the user supplementary information requests returned by the agent layer, or the final generated structured job safety analysis report.
[0029] The oil and petrochemical security agent layer, as the main function of the system, establishes communication connections with the user layer, memory storage layer, and tool layer. The oil and petrochemical security agent layer is configured to receive and parse information from the user layer, and combine this information with historical dialogue context obtained from the memory storage layer to perform task understanding and planning.
[0030] Based on the task planning results, the oil and petrochemical safety agent layer generates and executes tool invocation instructions, which can invoke one or more functional tools in the tool layer. After receiving the results returned by the tool layer, the oil and petrochemical safety agent layer evaluates, verifies, and integrates the results to form a final analysis conclusion, which is then presented through the user layer, or, if necessary, generates a supplementary information request and returns it to the user layer.
[0031] The oil and petrochemical security memory storage layer is configured to persistently store the history of multi-turn dialogues between users and the system. When the agent layer processes new user input, internal modules can query the oil and petrochemical security memory storage layer to obtain complete contextual information, ensuring a coherent and accurate understanding of the user's intent.
[0032] The oil and petrochemical safety tool layer contains a set of functional tools designed for JSA analysis. These tools are invoked as needed by the agent layer. The tool layer may include data processing tools, historical experience retrieval tools, job safety analysis tools, and formatted output tools. Each tool performs a specific task and returns the results to the agent layer. For example, the historical experience retrieval tool is used to retrieve similar cases from the database, and the job safety analysis tool is used to generate risk identification and control measures.
[0033] During system operation, the data flow path is as follows: User input information is passed from the user layer to the agent layer; the agent layer queries the memory storage layer to obtain the context and calls the tool layer according to the task plan; the tool layer executes the task and returns the result to the agent layer; after integrating the information, the agent layer returns the final result or intermediate interaction information to the user through the user layer, thus forming a complete closed-loop workflow. See attached document Figure 2 This invention provides a JSA (Job Safety Analysis) method based on an AI agent. This method is executed through the aforementioned system and specifically includes the following steps: Step S1 receives user input and information completion. The petroleum and petrochemical safety system receives the initial job description input by the user through the user layer. The agent layer performs a completeness judgment on the received information. If it is determined that there is a missing key information, the agent layer generates an inquiry interaction and requests the user to supplement the information through the user layer until the complete context information required to complete the JSA analysis is obtained.
[0034] The S2 step involves key information extraction and standardization. The agent layer processes the complete context information of oil and petrochemical safety, extracts key information such as operation name and operation location, and converts it into a structured data format.
[0035] In step S3, task planning and tool invocation decisions are made. Based on the key information extracted from step S2, the agent layer combines preset logical rules and its understanding of tool functions to generate an ordered tool invocation sequence. This sequence defines the tools that need to be invoked subsequently and their execution order.
[0036] Step S4 involves tool invocation, result evaluation, and integration. Following the tool sequence determined in step S3, the proxy layer sequentially invokes the corresponding tools in the tool layer and retrieves the returned results. The proxy layer verifies and evaluates the multiple results, resolves any conflicts, and ultimately integrates all results into a unified analytical conclusion.
[0037] In step S5, the agent layer calls the formatted output tool to populate the analysis conclusions integrated in step S4 into a preset JSA document template, generating a structured job safety analysis report. Finally, this report is presented to the user through the user layer. See attached document Figure 1 The user layer is a human-computer interaction component provided by the petroleum and petrochemical safety system of this invention. Its implementation is to guide user input and clearly present system output.
[0038] The petroleum and petrochemical safety user layer specifically includes interface elements for receiving user input. These interface elements can be designed as multiple input fields corresponding to the key information required for JSA analysis, such as text boxes or form fields for inputting job type, job location, job description, and equipment / tools, respectively. When the user inputs natural language information in these interface elements, the petroleum and petrochemical safety user layer will collect this input information.
[0039] The collected information is then encapsulated by the oil and petrochemical security user layer into a data structure in a predetermined format, such as a data object containing multiple key-value pairs, where the key corresponds to the information category and the value corresponds to the specific text content entered by the user. The data structure is formatted to ensure that the proxy layer can parse it accurately. After encapsulation, the oil and petrochemical security user layer sends the data structure to the proxy layer through a preset communication interface.
[0040] When the proxy layer needs to supplement information during processing, it sends an interactive request to the user layer. The petroleum and petrochemical safety user layer is configured with logic to receive and parse such requests. After receiving the request, it presents the content of the request to the user on the interface and provides an input mechanism for the user to answer. After the user answers, the petroleum and petrochemical safety user layer encapsulates the new input information again and sends it to the proxy layer, thus completing one interactive information completion cycle.
[0041] After the agent layer completes all the analysis and integration work, it will send the final structured JSA analysis report data to the user layer. After receiving the structured data, the oil and petrochemical safety user layer will call the internal presentation logic to render the data content into a standardized document or table view with good readability and display it to the user.
[0042] The petroleum and petrochemical security memory storage layer is a data storage unit in the petroleum and petrochemical security system of the present invention used to achieve dialogue context continuity. It is configured to persistently record the interaction history between the user and the system in a complete JSA analysis session.
[0043] Specifically, the oil and petrochemical safety memory storage layer stores each interaction as an independent entry. Each entry contains identification information to distinguish whether the source of the information is the user or the system itself, as well as the specific content of the information. For example, an entry can be constructed as a data unit containing a role (such as a user or assistant) and content (such as text entered by the user or a response returned by the system).
[0044] To manage different analysis tasks, the oil and petrochemical security memory storage layer assigns a unique session identifier to each session that begins with a user request. All interaction entries belonging to the same session are associated with this session identifier. These entries are organized and stored in chronological order of their occurrence, forming an ordered dialogue sequence.
[0045] The petroleum and petrochemical safety memory storage layer provides a data query interface for the agent layer to call. When the agent layer's historical dialogue module needs to obtain the context, it will initiate a request through this interface and carry the current session identifier. After receiving the request, the petroleum and petrochemical safety memory storage layer retrieves and returns the complete dialogue sequence associated with the session identifier and sorted by time.
[0046] In this way, the oil and petrochemical security memory storage layer ensures that the agent layer can obtain all historical information up to the current interaction point, thereby providing a complete and accurate contextual basis for subsequent intent understanding, information completion and task planning. The data stored in the oil and petrochemical security memory storage layer is written to non-volatile storage media to ensure that historical information is not lost after system restart or session interruption.
[0047] The petroleum and petrochemical safety agent layer is the main control function of the petroleum and petrochemical safety system of this invention. It integrates multiple logic modules that work together to understand, plan, execute and respond to user requests.
[0048] The operation of the oil and petrochemical security agent layer is based on a preset system cue word, which is a structured set of instructions loaded into a large language model used by the agent layer. This set of instructions establishes the operational framework before the task begins. Specifically, the instruction set defines the professional role of the AI agent, the task objectives and standard procedures to be completed, and behavioral boundaries, such as prohibiting fabricated information. The instruction set also includes specifications for the output format and a small number of input-output examples to guide the model in understanding the task.
[0049] Upon receiving new input from the user layer, the historical dialogue module in the oil and petrochemical security agent layer is first activated. This module queries the memory storage layer to retrieve all historical interaction records associated with the current session identifier. Subsequently, the historical dialogue module integrates these historical records with the user's latest input to form a complete, chronologically ordered dialogue context.
[0050] The inference module in the oil and petrochemical security agent layer receives the complete dialogue context and system prompts. Utilizing the processing power of a large language model, the inference module analyzes the user intent reflected in the context and, by comparing it with the registered tools and their functional descriptions in the system prompts, generates an ordered tool invocation plan to solve the current task. This ordered tool invocation plan is output in the form of structured data (e.g., JSON format), explicitly specifying the name of the tool to be invoked and the input parameters required to execute it. If, after analysis, the inference module determines that the context information is insufficient to generate a complete tool invocation plan, it generates a specific question and sends it to the user through the user layer.
[0051] The tool invocation module in the oil and petrochemical safety agent layer is responsible for executing the tool invocation plan generated by the inference module. The tool invocation module parses the structured data in the plan, extracts the target tool name and corresponding parameters for each step, and then calls the corresponding specific functional tools in the tool layer in sequence according to the order defined in the plan, and passes the extracted parameters to these tools. After each tool is executed, the tool invocation module collects its return value.
[0052] After collecting the return values from all tools, the agent layer evaluates and integrates these results. This process resolves potential conflicts between information from different sources. For example, if the cases returned by the historical experience retrieval tool contradict the general risks generated by the job safety analysis tool, the agent layer will use these conflicting points as new input, along with instructions to resolve the conflicts, and then call the job safety analysis tool again for correction. Finally, the integrated and verified analysis conclusions are formed and submitted to the formatted output tool for processing.
[0053] The petroleum and petrochemical safety tool layer is a collection of software modules that can be called by the proxy layer and encapsulate specific functions in the petroleum and petrochemical safety system of this invention. Each tool is designed to perform an independent subtask and return the execution result to the proxy layer.
[0054] The oil and petrochemical safety tool layer includes data processing tools. The function of these tools is to convert the company's existing, unstructured historical JSA (Job Safety Analysis) documents into a format that can be efficiently retrieved by machines.
[0055] In its implementation, the data processing tool first extracts and preprocesses the input historical documents (such as text files and database records) to remove irrelevant formatting information such as document headers, footers, and non-text tags. Then, it segments the continuous text content into multiple text fragments with independent semantics. Each text fragment is mapped into a high-dimensional real vector through a pre-trained text embedding model. These vectors, along with their corresponding original text fragments, are stored together in a vector database.
[0056] The oil and petrochemical safety tool layer includes a historical experience retrieval tool. This tool retrieves the most similar historical cases from a vector database based on the current job description. During execution, the historical experience retrieval tool first receives the processed current job description text from the proxy layer and uses the same text embedding function as the data processing tool to convert the description text into a query vector. Then, the historical experience retrieval tool searches the vector database, comparing the query vector with all stored vectors in the database. The cosine similarity between the vectors is used to quantify their relevance. Finally, the historical experience retrieval tool selects the few vectors with the highest similarity scores and returns their corresponding original text fragments as retrieval results to the proxy layer.
[0057] The oil and petrochemical safety tool layer includes a job safety analysis tool, which is the core functional module for generating Job Safety Analysis (JSA) content. This tool receives comprehensive input from the agent layer, including current job information provided by the user, similar case texts returned by historical experience retrieval tools, and specific analysis instructions added by the agent layer based on assessment needs. Internally, the job safety analysis tool integrates a large language model. Based on the aforementioned comprehensive input, this model performs a series of analysis tasks, such as job decomposition, hazard identification, and control measure recommendation, to generate the main content of the JSA. For example, it decomposes the job description into ordered steps and, for each step, identifies potential hazards by combining historical cases and general safety knowledge.
[0058] The petroleum and petrochemical safety tool layer includes a formatted output tool. The function of the formatted output tool is to organize the JSA analysis content finally integrated and confirmed by the agent layer into a structured document that conforms to predetermined specifications. In terms of implementation, the formatted output tool has one or more built-in JSA standard table templates. It receives the analysis text generated by the job safety analysis tool and integrated by the agent layer, parses the content, and accurately fills in the corresponding fields or cells in the JSA standard table template with information such as job steps, hazard descriptions, risk levels, and control measures. The output of the formatted output tool is a structured data object or document that can be directly rendered and displayed by the user layer.
[0059] The following will provide a detailed description of the JSA (Job Safety Analysis) method based on AI agents provided by the present invention through a specific embodiment.
[0060] In step S1, the user logs into the system through the petroleum and petrochemical safety user layer and enters an initial job description in the designated input interface, such as: preparing to perform hot work for pipeline replacement in workshop A. The petroleum and petrochemical safety user layer then transmits this input information to the agent layer.
[0061] After receiving the information, the agent layer's internal reasoning module analyzes the information. Based on its built-in knowledge and rules, the reasoning module determines that although the current description specifies the job type and location, it lacks the key information necessary for JSA analysis, namely, it does not clearly specify the specific equipment or tools to be used.
[0062] Based on this judgment, the proxy layer generates an interactive query for information completion. The specific content of the interactive query is: In order to conduct a comprehensive JSA analysis, please provide details about the specific equipment and tools (e.g., welding machine, angle grinder, etc.) that will be used in this hot work operation. This query is sent from the proxy layer to the user layer and then presented to the user by the user layer.
[0063] After receiving the inquiry, the user can enter supplementary information through the user interface, such as: using an inverter DC welder and a handheld angle grinder.
[0064] The petroleum and petrochemical safety user layer transmits this supplementary information to the agent layer again. The historical dialogue module in the agent layer integrates this supplementary information with the user's initial input information and calls the memory storage layer to update it, forming a complete context that includes the work location, work content, and specific equipment and tools.
[0065] At this point, the information completion and intent clarification steps are complete. The system has obtained the complete information required for subsequent analysis and is ready to proceed to the next step.
[0066] In step S2, after the information is completed, the oil and petrochemical security agent layer begins to process the integrated and complete context information, which is executed by the inference module within the oil and petrochemical security agent layer.
[0067] The inference module receives complete information containing details about preparing for hot work on pipe replacement in Workshop A, and the use of an inverter DC welding machine and a handheld angle grinder. Based on its built-in natural language processing capabilities, the inference module parses this text to identify and extract predefined key information entities.
[0068] In this embodiment, the reasoning module extracts the following information from the text: the work location is identified as workshop A, the work content is identified as hot work for pipe replacement, and the equipment and tools used are identified as an inverter DC welding machine and a handheld angle grinder.
[0069] The extracted information is then organized into a structured data object, which is stored in the form of key-value pairs. For example, a data structure containing the following content is generated: (Work location: Workshop A; Work content: hot work for pipe replacement; Equipment and tools: inverter DC welding machine, handheld angle grinder).
[0070] Through the S2 step, unstructured natural language input is converted into a standardized, machine-readable data format. The structured data object will be used as the unified input for subsequent task planning and tool invocation, ensuring data consistency and accuracy in subsequent processing steps.
[0071] In step S3, after completing the extraction and standardization of key information, the inference module in the petroleum and petrochemical security agent layer receives the structured data object and begins to execute task planning.
[0072] The petroleum and petrochemical safety reasoning module makes decisions based on preset operating logic. This logic stipulates that for requests containing a clear work type and equipment tools, historical similar cases should be retrieved first for analysis reference. Therefore, the first instruction generated by the reasoning module is to call the historical experience retrieval tool and use the key information extracted in step S2, such as hot work, inverter DC welding machine, and handheld angle grinder, as query parameters for similarity matching in the vector database.
[0073] After planning the historical experience retrieval, the reasoning module continues to plan subsequent steps. After obtaining historical cases, the decision-making module will call the job safety analysis tool. The input of the job safety analysis tool is set to include the user's original input information and the historical case content retrieved in the previous step to ensure the comprehensiveness of the analysis.
[0074] The result of the entire task planning is solidified into an ordered sequence of tool invocations by the oil and petrochemical safety inference module. This sequence explicitly defines the order in which the tools are invoked and the sources of the input parameters required for each tool. This sequence is then passed to the tool invocation module in the agent layer for execution.
[0075] In step S4, the tool invocation module in the petroleum and petrochemical safety agent layer begins to execute the invocation operation based on the tool invocation sequence generated in step S3.
[0076] First, the tool calling module calls the historical experience retrieval tool in the tool layer, passing key information such as hot work and inverter DC welding machine as parameters to the historical experience retrieval tool.
[0077] The petroleum and petrochemical safety historical experience retrieval tool performs a search and returns a highly similar historical case. The text fragment of the case states: During hot work in a storage tank area, an operator was electrocuted because the grounding of the welding machine casing was not checked. The tool's calling module receives this returned result.
[0078] Next, the tool invocation module invokes the job safety analysis tool in the tool layer, passing the user's complete input information and the text fragments of the aforementioned historical cases as input to the job safety analysis tool. After execution, the job safety analysis tool generates a preliminary JSA analysis.
[0079] After receiving this preliminary analysis, the agent layer evaluated it and found that the preliminary risk generated by the job safety analysis tool only included a general description of electric shock risk, but did not explicitly point out the specific hazard of leakage current from the welding machine casing, which was emphasized in the cases returned by the historical experience retrieval tool. This difference was identified by the agent layer as a content conflict or omission.
[0080] In response to this discrepancy, the agent layer generates a correction instruction: Based on historical cases, supplement and emphasize the specific hazards and control measures for leakage current in the casing of inverter DC welding machines. Subsequently, the agent layer uses a combination of inputs including the user's original information, historical cases, and the correction instruction to re-invoke the job safety analysis tool.
[0081] After receiving the correction instruction, the safety analysis tool for oil and petrochemical operations generates updated analysis content, including specific control measures such as checking whether the grounding wire of the welding machine casing is intact and reliably connected. The agent layer integrates this updated content with other analysis results to form a verified and unified analysis conclusion, which is then ready for final formatted output.
[0082] Step S5: After step S4 is completed, the oil and petrochemical safety agent layer will integrate the unified analysis conclusions and call the formatted output tool in the tool layer to execute the final report generation.
[0083] The petroleum and petrochemical safety formatted output tool receives analysis conclusions from the agent layer. The formatted output tool has a built-in JSA standard form template, which predefines multiple structured fields, including work steps, hazard identification, and control measures. The petroleum and petrochemical safety formatted output tool performs a parsing operation, matching and mapping the specific content in the received analysis conclusion text with the fields in the JSA standard form template.
[0084] After matching and mapping are completed, the petroleum and petrochemical safety formatting output tool will parse the content, such as pre-operation inspection, hazard: electric shock caused by welding machine casing not being grounded, and measures: check that the grounding wire of the welding machine casing is intact and reliably connected, and fill it into the corresponding fields in the template one by one, generating a structured JSA analysis report data object, and return it to the agent layer.
[0085] After receiving the structured JSA analysis report data object, the oil and petrochemical safety agent layer sends it to the user layer through a preset interface. The oil and petrochemical safety user layer calls its internal interface rendering logic to visualize the content of the data object in the style of a standard JSA table, forming the final and complete job safety analysis report, which is then displayed to the user.
Claims
1. A JSA (Job Safety Analysis) method based on AI intelligent agents, characterized in that, Includes the following steps: S1. Receive the initial job description input by the user through the user layer. If it is determined that there is missing key information, request the user to supplement the information and obtain the complete context information required to complete the JSA analysis. S2. Process the complete context information to extract key information about the job name, job location, job description, and equipment tools, and convert the key information into a structured data format; S3. Based on the key information extracted in step S2, and combined with preset logical rules and the understanding of tool functions, an ordered tool call sequence is generated. S4. Following the tool call sequence described in step S3, call the corresponding tools in the tool layer in sequence and obtain multiple return results; The system verifies and evaluates the multiple returned results. If a conflict is detected between results from different sources, a preset conflict resolution strategy is executed to generate a corrected analysis result. All verified and corrected results are then integrated to form a unified analysis conclusion. S5. Call the formatted output tool to fill the unified analysis conclusions integrated in step S4 into the preset JSA document template, generate a structured job safety analysis report, and present it to the user through the user layer.
2. The JSA job safety analysis method based on AI intelligent agents according to claim 1, characterized in that, In step S1, the agent layer performs a completeness check on the received information. If it is determined that key information is missing, the agent layer generates an inquiry interaction and requests supplementary information from the user through the user layer.
3. The JSA job safety analysis method based on AI intelligent agents according to claim 1, characterized in that, In step S3, the proxy layer generates the ordered tool call sequence based on the key information extracted in step S2, combined with preset logical rules and its understanding of tool functions.
4. The JSA job safety analysis method based on AI intelligent agents according to claim 1, characterized in that, The tools used in step S4 include historical experience retrieval tools and job safety analysis tools.
5. The JSA job safety analysis method based on AI intelligent agents according to claim 4, characterized in that, The conflict resolution strategies specifically include: The historical cases returned by the historical experience retrieval tool are compared with the preliminary analysis content generated by the job safety analysis tool to identify content conflicts. Generate a correction instruction for the content conflict; Using the correction command as new input, the job safety analysis tool is invoked again to obtain the corrected analysis results.
6. The JSA job safety analysis method based on AI intelligent agents according to claim 5, characterized in that, The content conflict is as follows: A content conflict is determined when the general risk description generated by the job safety analysis tool is inconsistent with the specific hazards emphasized in the historical cases returned by the historical experience retrieval tool.
7. The JSA job safety analysis method based on AI intelligent agents according to claim 1, characterized in that, It also includes the step of processing historical JSA job safety analysis documents using data processing tools; The data processing tool segments historical documents into text fragments, and then maps the text fragments into vectors using a text embedding model before storing them in a vector database.
8. The JSA job safety analysis method based on AI intelligent agents according to claim 4, characterized in that, The historical experience retrieval tool converts the current job description into a query vector and retrieves text fragments containing similar historical cases by calculating similarity in the vector database.
9. The JSA job safety analysis method based on AI intelligent agents according to claim 1, characterized in that, In step S5, the formatted output tool parses the unified analysis conclusion and fills the information about work steps, hazard identification and control measures into the corresponding structured fields in the JSA document template.
10. A JSA (Job Safety Analysis) system based on AI intelligent agents, characterized in that, include: User layer, memory storage layer, tool layer, and proxy layer; The user layer is configured to receive an initial job description input by the user and present the final generated structured job safety analysis report; The memory storage layer is configured to store the history of multi-turn conversations between the user and the system; The tool layer contains one or more functional tools that are invoked by the proxy layer, configured to perform specific tasks and return the results to the proxy layer; The proxy layer establishes communication connections with the user layer, memory storage layer, and tool layer respectively, and is configured for: The system receives an initial job description from the user layer, combines it with the multi-turn dialogue history obtained from the memory storage layer to form complete context information, and requests supplementation through the user layer when it is determined that the information is missing. The acquired complete context information is processed to extract key information and convert it into a structured data format; Based on the extracted key information, an ordered sequence of tool calls is generated for invoking the tool layer. The corresponding tools in the tool layer are invoked according to the tool invocation sequence, and the returned multiple results are verified and evaluated, as well as conflicts are resolved, and then integrated into a unified analysis conclusion. The formatted output tool in the tool layer is invoked to generate a structured job safety analysis report from the unified analysis conclusions, which is then presented through the user layer.