Method and system for generating architecture time sequence diagram based on LLM
By using an automation method based on large language models in the design of automotive electronic software systems, the architecture timing diagram is generated, and the problem of time-consuming and inaccurate drawing of timing diagrams is solved, and the design efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202510057852.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-14
- Publication Date
- 2025-05-13
Smart Images

Figure CN119991861A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of large language models, and in particular to a method and system for generating an architecture timing diagram based on LLM. Background Art
[0002] In the field of modern automotive electronics, with the development of technologies such as autonomous driving, vehicle networking and smart cockpit, the complexity and integration of automotive electronic systems are constantly increasing. Automotive electronic systems usually involve multiple control units (ECUs), sensors, actuators and communication buses. The interaction and collaboration between these systems are crucial to ensure the safety, reliability and performance of the vehicle.
[0003] In the process of system design and development, sequence diagram is a commonly used modeling tool to describe the interaction and message passing order between different components in the system. Sequence diagram can help engineers understand system behavior, analyze potential problems and optimize system design. However, as the complexity of the system increases, it becomes increasingly difficult and time-consuming to manually draw and maintain sequence diagrams. In the process of modern automotive electronic software system design and development, engineers face the following major technical problems: Complexity and scale: As automotive electronic systems become increasingly complex and their scale increases, the number of ECUs, sensors, actuators, and communication buses involved in the system has increased significantly. Manually drawing and maintaining timing diagrams for these complex systems is not only labor-intensive but also prone to omissions and errors.
[0004] Dynamicity: The design and functional requirements of automotive electronic systems are constantly changing. Frequent design changes require engineers to update the system timing diagram in a timely manner to reflect the latest system status. Manually updating the timing diagram is not only time-consuming, but also easily leads to version management confusion and inconsistent information. Summary of the invention
[0005] In view of the technical problems existing in the prior art, the present invention provides a method and system for generating an architecture timing diagram based on LLM. By utilizing the natural language understanding and generation capabilities of LLM, key information is automatically extracted from text resources such as system design documents and requirement specifications, and an architecture timing diagram of the system is generated. This method can significantly improve the generation efficiency and accuracy of timing diagrams in the design process of automotive electronic software systems and reduce the workload of engineers.
[0006] According to a first aspect of the present invention, a method for generating an architecture timing diagram based on LLM is provided, comprising: Step 1, extracting a standardized requirement document, a system component list, and a software component list based on the requirement file input by the user; Step 2, setting the process and rule conditions for generating the timing diagram; Step 3, extract the information of the standardized requirement document, the system component list and the software component list, input the process and rule conditions for generating the timing diagram as prompt words into the LLM, and the executor outputs the timing diagram based on the LLM and the extracted information of the standardized requirement document, the system component list and the software component list.
[0007] Based on the above technical solution, the present invention can also make the following improvements.
[0008] Optionally, the standardized requirement document in step 1 includes: requirement content, detailed description, verification criteria, status and priority based on target functions; The contents of the system component list include: principles and methods for dividing components; The content of the software component list includes: functional descriptions of sub-components within the component.
[0009] Optionally, the process of generating the timing diagram in step 2 includes: extracting information in a software requirement file; extracting information in a system component list file; extracting information in a software component list file; reading a timing diagram generation rule file; generating and outputting an architecture timing diagram.
[0010] Optionally, the rule conditions for generating the timing diagram in step 2 include: The time sequence diagram should reflect the lifeline information of each participant; During the activation and deactivation of lifelines, the lifeline of each object is activated when receiving a message and deactivated after sending a message. If multiple messages are received in the sequence diagram, it should be activated and deactivated multiple times; Each signal is represented as a separate input on the timing diagram; Use standard PlantUML syntax; Ensure that nothing is omitted from the requirements description in the standardized requirements document.
[0011] Optionally, step 3 includes: Customize tools 1, 2, and 3 to respectively extract information of the standardized requirement document, the system component list, and the software component list, and register the customized tools 1, 2, and 3 with the LLM agent; The LLM agent calls tool 1, tool 2 and tool 3 in sequence according to the process, and outputs a text containing the timing diagram.
[0012] Optionally, the tool 1, tool 2 and tool 3 are respectively obtained by integrating BaseTool in langchain_core.tools in the form of Prompt+LLM.
[0013] Optionally, after step 3, the following steps may be further performed: The timing diagram is extracted using a Python script and stored in a file, and the timing diagram is verified and adjusted.
[0014] According to a second aspect of the present invention, there is provided a system for generating an architecture timing diagram based on LLM, comprising: a structured data generation module and an LLM agent; the LLM agent comprises: an executor, a prompt word and an LLM module; The structured data generation module is used to extract a standardized requirement document, a system component list and a software component list based on the requirement file input by the user; The prompt words include setting the process and rule conditions for generating the timing diagram; the tool is used to extract information of the standardized requirement document, the system component list and the software component list; The prompt words are input into the LLM module, and the executor outputs the timing diagram based on the LLM module and the extracted information of the standardized requirement document, the system component list and the software component list.
[0015] According to a third aspect of the present invention, there is provided an electronic device comprising a memory and a processor, wherein the processor is used to implement the steps of a method for generating an architecture timing diagram based on LLM when executing a computer management program stored in the memory.
[0016] According to a fourth aspect of the present invention, there is provided a computer-readable storage medium on which a computer management program is stored. When the computer management program is executed by a processor, the steps of the method for generating an architecture timing diagram based on LLM are implemented.
[0017] The present invention provides a method, system, electronic device and storage medium for generating an architecture timing diagram based on LLM, and specifically solves the following technical problems: Improve the efficiency and accuracy of timing diagram generation: By automatically generating timing diagrams, the workload and error probability of manual drawing are significantly reduced, ensuring the accuracy and completeness of timing diagrams.
[0018] Dynamically update system timing diagrams: LLM is used to parse the latest design documents and requirement specifications to quickly generate timing diagrams that reflect the latest system status, ensuring that the timing diagram is synchronized with the actual design to avoid information inconsistencies. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 A flowchart of a method for generating an architecture timing diagram based on LLM provided by the present invention; Figure 2 A flowchart of an embodiment of a method for generating an architecture timing diagram based on LLM provided by the present invention; Figure 3 A processing flow chart of an embodiment of a system for generating an architecture timing diagram based on LLM provided by the present invention; Figure 4 A schematic diagram of the hardware structure of a possible electronic device provided by the present invention; Figure 5 A schematic diagram of the hardware structure of a possible computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION
[0020] The principles and features of the present invention are described below in conjunction with the accompanying drawings. The examples given are only used to explain the present invention and are not used to limit the scope of the present invention.
[0021] Figure 1 A flow chart of a method for generating an architecture timing diagram based on LLM provided by the present invention, such as Figure 1 As shown, the method includes: Step 1: extracting a standardized requirement document, a system component list, and a software component list based on the requirement file input by the user.
[0022] Step 2: Set the process and rule conditions for generating the timing diagram.
[0023] Step 3, extract the information of the standardized requirement document, the system component list and the software component list, input the process and rule conditions for generating the timing diagram as prompt words into the LLM, and the executor outputs the timing diagram based on the LLM and the extracted information of the standardized requirement document, the system component list and the software component list.
[0024] LLM can understand and generate natural language text and has shown great application potential in many fields. In the fields of software engineering and system design, LLM can be used to automatically generate documents, code snippets, and other engineering resources.
[0025] In order to deal with the complexity, dynamics and time-consuming manual drawing of timing diagrams in the design of automotive electronic software systems, this paper proposes a method for generating architecture timing diagrams based on LLM, which can significantly improve the generation efficiency and accuracy of timing diagrams in the design of automotive electronic software systems and reduce the workload of engineers. With the continuous development of large language model technology, this method has broad application prospects in the field of automotive electronics.
[0026] Example 1 Embodiment 1 provided by the present invention is an embodiment of a method for generating an architecture timing diagram based on LLM provided by the present invention, such as Figure 2 FIG. 1 is a flowchart of an embodiment of a method for generating an architecture timing diagram based on LLM provided by the present invention, combined with Figure 1 and Figure 2 It can be seen that the embodiment of the method includes: Step 1: extracting a standardized requirement document, a system component list, and a software component list based on the requirement file input by the user.
[0027] In a possible implementation manner, the standardized requirement document in step 1 includes: requirement content based on the target function, detailed description, verification criteria, status and priority.
[0028] The contents of the system component list include: principles and methods for dividing components.
[0029] The contents of the software component list include: functional descriptions of the subcomponents within the component.
[0030] In the specific implementation, the requirement files input by users are various unstructured documents, such as Word, Excel and PDF documents, which are first converted into Markdown format documents manually or through tools, and then the customer's requirement files are extracted manually or through tools to obtain standardized requirement documents, system component lists and software component lists.
[0031] The requirement document mainly extracts the requirement content, detailed description, verification criteria, status and priority of the function after the requirement engineer understands and analyzes the requirement information that has been obtained. The system component list document is mainly a textual description that explains the principles and strategies of the architecture design, such as the principles and methods of dividing components. The software component list document describes the functional description of the sub-components within the large component in more detail.
[0032] Step 2: Set the process and rule conditions for generating the timing diagram.
[0033] In one possible implementation manner, the process of generating a timing diagram in step 2 includes: extracting necessary information from a software requirement file; extracting necessary information from a system component list file; extracting necessary information from a software component list file; reading a timing diagram generation rule file; generating and outputting an architecture timing diagram.
[0034] The purpose of the process Plan is to allow the LLM Agent to execute step by step according to the plan.
[0035] In a possible embodiment, the rule conditions for generating the timing diagram in step 2 include: The time sequence diagram should reflect the lifeline information of each participant.
[0036] During the activation and deactivation of lifelines, the lifeline of each object is activated when a message is received and deactivated after a message is sent. If multiple messages are received in the sequence diagram, it should be activated and deactivated multiple times.
[0037] Each signal is represented as a separate input in the timing diagram.
[0038] Use standard PlantUML syntax.
[0039] Ensure that nothing is omitted from the requirements description in the standardized requirements document.
[0040] The rule conditions are the constraints and rules for LLM to generate timing diagrams.
[0041] Step 3, extract the information of the standardized requirement document, the system component list and the software component list, input the process and rule conditions for generating the timing diagram as prompt words into the LLM, and the executor outputs the timing diagram based on the LLM and the extracted information of the standardized requirement document, the system component list and the software component list.
[0042] In a possible implementation manner, step 3 includes: Customize tools 1, 2, and 3 for respectively extracting information of the standardized requirement document, the system component list, and the software component list, and register the customized tools 1, 2, and 3 in the LLM agent.
[0043] The LLM agent calls Tool 1, Tool 2, and Tool 3 in sequence according to the process and outputs a text containing a timing diagram.
[0044] In a possible implementation manner, tool 1, tool 2 and tool 3 are respectively obtained by integrating BaseTool in langchain_core.tools in the form of Prompt+LLM.
[0045] In the specific implementation, based on the Tool encapsulation method under the Langchain framework, three tools are customized: a tool for extracting necessary information from the software requirement file; a tool for extracting necessary information from the system component list file; and a tool for extracting necessary information from the software component list file. Due to the dense information in the original requirement document and the restrictions of LLM Token, the present invention customizes these three tools to provide key information in the document, corresponding to Tool1, Tool2 and Tool3 in the block diagram.
[0046] In a possible implementation manner, step 3 further includes: Use Python scripts to extract the timing diagram and save it in a file to verify and adjust the timing diagram. Designers can verify or fine-tune the architecture timing diagram to save design time.
[0047] First, the irregular documents input by the customer are parsed manually and by tools to generate Markdown documents. Then, the software requirements document, software component list, system component list and other key information are parsed by LLM, and finally the system architecture sequence diagram is automatically generated. Specifically, this method uses the powerful natural language processing capabilities of LLM to extract key information from the above documents and generate a sequence diagram that complies with the Unified Modeling Language (UML) standard. Developers only need to verify the generated sequence diagram, which greatly reduces the time and workload of manual design and drawing of sequence diagrams.
[0048] The present invention provides an embodiment of a method for generating an architecture timing diagram based on LLM. First, the irregular document input by the customer is parsed manually and by tools to generate a Markdown document. Then, the software requirement document, software component list, system component list and other key information are parsed by LLM. Finally, the architecture timing diagram of the system is automatically generated. Specifically, the method uses the powerful natural language processing capability of LLM to extract key information from the above documents and generate a timing diagram that complies with the Unified Modeling Language (UML) standard. Developers only need to verify the generated timing diagram, which greatly reduces the time and workload of manual design and drawing of timing diagrams.
[0049] This method is developed using the Langchain framework, making full use of the Agent, Prompt, and Tools APIs provided by the Langchain framework for coding. Through these APIs, the system can efficiently parse input documents, extract key information, and generate accurate timing diagrams.
[0050] Example 2 Embodiment 2 provided by the present invention is an embodiment of a system for generating an architecture timing diagram based on LLM provided by the present invention, such as Figure 3 FIG. 1 is a processing flow chart of an embodiment of a system for generating an architecture timing diagram based on LLM provided by the present invention, combined with Figure 1-Figure 3 It can be seen that the embodiment of the system includes: Structured data generation module and LLM Agent. Agent mainly includes executor, prompts, memory, tools and LLM module. In specific implementation, LLM module can call LLM on the public network, such as Deepseek, Wenxinyiyan, GPT3.5 / 4o, etc.
[0051] The structured data generation module is used to extract standardized requirement documents, system component lists and software component lists based on the requirement files input by users.
[0052] The prompt words include setting the process and rule conditions for generating a sequence diagram; the tool is used to extract information of a standardized requirement document, a system component list, and a software component list.
[0053] The prompt words are input into the LLM module, and the executor outputs the timing diagram based on the LLM module and the information of the extracted standardized requirement document, system component list and software component list.
[0054] It can be understood that the system for generating an architecture timing diagram based on LLM provided by the present invention corresponds to the method for generating an architecture timing diagram based on LLM provided in the aforementioned embodiments. The relevant technical features of the system for generating an architecture timing diagram based on LLM can refer to the relevant technical features of the method for generating an architecture timing diagram based on LLM, which will not be repeated here.
[0055] See also Figure 4 , Figure 4 Schematic diagram of an electronic device provided by an embodiment of the present invention. Figure 4 As shown, an embodiment of the present invention provides an electronic device, including a memory 1310, a processor 1320, and a computer program 1311 stored in the memory 1310 and executable on the processor 1320. When the processor 1320 executes the computer program 1311, the following steps are implemented: extracting a standardized requirement document, a system component list, and a software component list based on a requirement file input by a user; setting a process and rule conditions for generating a timing diagram; extracting information of the standardized requirement document, the system component list, and the software component list, and inputting the process and rule conditions for generating the timing diagram as prompt words into the LLM, and the executor outputs the timing diagram based on the LLM and the information of the extracted standardized requirement document, the system component list, and the software component list.
[0056] See also Figure 5 , Figure 5 Schematic diagram of an embodiment of a computer-readable storage medium provided by the present invention. Figure 5 As shown, this embodiment provides a computer-readable storage medium 1400, on which a computer program 1411 is stored. When the computer program 1411 is executed by a processor, the following steps are implemented: based on the requirement file input by the user, a standardized requirement document, a system component list, and a software component list are extracted; the process and rule conditions for generating a timing diagram are set; the information of the standardized requirement document, the system component list, and the software component list are extracted, and the process and rule conditions for generating the timing diagram are input into the LLM as prompt words, and the executor outputs the timing diagram based on the LLM and the information of the extracted standardized requirement document, the system component list, and the software component list.
[0057] The embodiments of the present invention provide a method, system, electronic device and storage medium for generating an architecture timing diagram based on LLM, which can improve the efficiency and accuracy of timing diagram generation: by automatically generating timing diagrams, the workload and error probability of manual drawing are significantly reduced, ensuring the accuracy and completeness of the timing diagrams; the system timing diagrams can be dynamically updated: by using LLM to parse the latest design documents and requirement specifications, a timing diagram reflecting the latest system status can be quickly generated, ensuring that the timing diagram is synchronized with the actual design and avoiding information inconsistency.
[0058] It should be noted that in the above embodiments, the description of each embodiment has its own emphasis, and for parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0059] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0060] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded computer, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0061] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0062] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0063] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0064] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for generating an architecture timing diagram based on LLM, characterized in that: The method comprises: Step 1, extracting a standardized requirement document, a system component list, and a software component list based on the requirement file input by the user; Step 2, setting the process and rule conditions for generating the timing diagram; Step 3, extract the information of the standardized requirement document, the system component list and the software component list, input the process and rule conditions for generating the timing diagram as prompt words into the LLM, and the executor outputs the timing diagram based on the LLM and the extracted information of the standardized requirement document, the system component list and the software component list.
2. The method according to claim 1, characterized in that The standardized requirement document in step 1 includes: requirement content, detailed description, verification criteria, status and priority based on target functions; The contents of the system component list include: principles and methods for dividing components; The content of the software component list includes: functional descriptions of sub-components within the component.
3. The method according to claim 1, characterized in that The process of generating the timing diagram in step 2 includes: extracting information from a software requirement file; extracting information from a system component list file; extracting information from a software component list file; reading a timing diagram generation rule file; generating and outputting an architecture timing diagram.
4. The method according to claim 1, characterized in that: The rule conditions for generating the timing diagram in step 2 include: Reflect the lifeline information of each participant in the sequence diagram; In the process of activating and deactivating lifelines, each object’s lifeline is activated when receiving a message and deactivated after sending a message; Each signal is represented as a separate input on the timing diagram; Use standard PlantUML syntax; Ensure that nothing is omitted from the requirements description in the standardized requirements document.
5. The method according to claim 1, characterized in that The step 3 comprises: Customize tools 1, 2, and 3 to respectively extract information of the standardized requirement document, the system component list, and the software component list, and register the customized tools 1, 2, and 3 with the LLM agent; The LLM agent calls tool 1, tool 2 and tool 3 in sequence according to the process, and outputs a text containing the timing diagram.
6. The method according to claim 1, characterized in that The tool 1, tool 2 and tool 3 are respectively obtained by integrating BaseTool in langchain_core.tools in the form of Prompt+LLM.
7. The method according to claim 1, characterized in that The step 3 further includes: The timing diagram is extracted using a Python script and stored in a file, and the timing diagram is verified and adjusted.
8. A system for generating an architecture timing diagram based on LLM, characterized in that: The system includes: a structured data generation module and an LLM agent; the LLM agent includes: an executor, a prompt word and an LLM module; The structured data generation module is used to extract a standardized requirement document, a system component list and a software component list based on the requirement file input by the user; The prompt words include setting the process and rule conditions for generating the timing diagram; the tool is used to extract information of the standardized requirement document, the system component list and the software component list; The prompt words are input into the LLM module, and the executor outputs the timing diagram based on the LLM module and the extracted information of the standardized requirement document, the system component list and the software component list.
9. An electronic device, characterized in that: It comprises a memory and a processor, wherein the processor is used to implement the steps of the method for generating an architecture timing diagram based on LLM as described in any one of claims 1 to 7 when executing a computer management program stored in the memory.
10. A computer-readable storage medium, characterized in that: A computer management program is stored thereon, and when the computer management program is executed by a processor, the steps of the method for generating an architecture timing diagram based on LLM as described in any one of claims 1 to 7 are implemented.