System context graph generation method and device, processor and storage medium

Through the large language model extracting and mapping system description information, the system context diagram is automatically generated, which solves the problem of long-term manual drawing and high error rate, and improves the drawing efficiency and accuracy.

CN119127160APending Publication Date: 2024-12-13NEUSOFT CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411298784.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-14
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

In the prior art, system context diagrams are usually created manually, which take a long time and are prone to drawing errors, resulting in a high drawing error rate.

Method used

By obtaining the system description information of the target system, input it into the large language model, using the information extractor to extract key information, and map it into the target source code through the intelligent mapper, and finally render it into the system context diagram to achieve automated drawing.

Benefits of technology

It improves the drawing efficiency of system context diagrams, reduces the drawing error rate, and achieves high-accurate system context diagram drawing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119127160A_ABST
    Figure CN119127160A_ABST
Patent Text Reader

Abstract

The invention discloses a system context graph generation method and device, a processor and a storage medium. According to the scheme, system description information of a target system is obtained; the system description information comprises text information for describing architecture and functions of the target system; inputting the system description information into the large language model, and extracting key information required for creating a system context graph of the target system from the system description information through an information extractor in the large language model; mapping the key information into a target source code through an intelligent mapper in a large language model; and rendering the target source code into a system context graph. According to the technical scheme, high-accuracy drawing of the system context graph is achieved in an automatic mode, the drawing efficiency of the system context graph is improved, and the drawing error rate of the system context graph is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, processor and storage medium for generating a system context graph. Background Art

[0002] Architecture diagrams are important tools for understanding and communicating the structure of software systems. As a hierarchical view, the C4 (Context, Containers, Components, and Code) architecture diagram can clearly display the system's components, containers, classes, and their interactions. Among them, the C1 diagram (system context diagram) provides an understanding of the system context, providing a macro perspective and foundation for the C4 architecture diagram, which can help developers maintain consistency with the overall system goals and external environment when designing the internal structure of the system.

[0003] Currently, C1 diagrams are usually created manually. However, manually creating C1 diagrams is not only time-consuming, but also prone to drawing errors. Summary of the invention

[0004] Based on the above problems, the present application provides a method, device, processor and storage medium for generating a system context graph, with the aim of achieving high-accuracy drawing of the system context graph in an automated manner, improving the drawing efficiency of the system context graph, and reducing the drawing error rate of the system context graph.

[0005] The embodiments of the present application disclose the following technical solutions:

[0006] In a first aspect of the present application, a method for generating a system context graph is provided, the method comprising:

[0007] Obtaining system description information of the target system; the system description information includes text information describing the architecture and functions of the target system;

[0008] Input the system description information into the large language model, and extract key information required for creating a system context diagram of the target system from the system description information through an information extractor in the large language model;

[0009] Map key information to target source code through intelligent mappers in large language models;

[0010] Renders the target source code as a system context diagram.

[0011] In an optional implementation, the key information required to create the system context diagram of the target system is extracted from the system description information by an information extractor in the large language model, including:

[0012] The information extractor identifies the system boundary of the target system and the external elements corresponding to the target system according to the first constraint rule and the system description information; the external elements at least include the external system that interacts with the target system for data; the first constraint rule is a rule that defines the system boundary;

[0013] The information extractor extracts the system name of the target system from the system description information according to the second constraint rule; the second constraint rule is a rule for defining the system name;

[0014] The key information is determined by the information extractor based on the system boundary, external elements and system name.

[0015] In an optional implementation, the information extractor determines key information based on the system boundary, external elements, and system name, including:

[0016] The information extractor identifies the main participants in the system description information according to the system boundary and the third constraint rule; the main participants are users who directly interact with the target system; the third constraint rule is a rule that defines the main participants;

[0017] The information extractor identifies the external system in the system description information according to the external elements and the fourth constraint rule; the fourth constraint rule is a rule for defining the external system;

[0018] The information extractor determines the description information of the interactive relationship between the target system and the main participants and the external system based on the system name, the main participants, the external system and the fifth constraint rule; the fifth constraint rule is a rule defining the data interaction mode between the target system and the main participants and the external system;

[0019] The key information is determined by the information extractor based on the description information of the system name, main participants, external systems and interaction relationships.

[0020] In an optional implementation, the information extractor determines key information based on the description information of the system name, main participants, external systems, and interaction relationships, including:

[0021] The information extractor performs a form conversion on the system name according to the second constraint rule to obtain a converted system name;

[0022] The information extractor performs a form conversion on the name of the main participant according to the third constraint rule to obtain a converted name of the main participant;

[0023] The information extractor performs a form conversion on the name of the external system according to the fourth constraint rule to obtain a converted external system name;

[0024] The information extractor performs a form conversion on the description information of the interaction relationship according to the fifth constraint rule to obtain converted description information of the interaction relationship;

[0025] The information extractor takes the converted system name, the converted main participant name, the converted external system name and the converted interaction relationship description information as key information.

[0026] In an optional implementation, the key information is mapped to the target source code by an intelligent mapper in the large language model, including:

[0027] The intelligent mapper maps the converted system name into a first code statement according to a first coding rule; the first coding rule is a coding rule corresponding to the converted system name;

[0028] The intelligent mapper maps the converted main participant name into a second code statement according to a second coding rule; the second coding rule is a coding rule corresponding to the converted main participant name;

[0029] The intelligent mapper maps the converted external system name into a third code statement according to a third encoding rule; the third encoding rule is an encoding rule corresponding to the converted external system name;

[0030] The intelligent mapper maps the converted interaction relationship description information into a fourth code statement according to a fourth coding rule; the fourth coding rule is a coding rule corresponding to the converted interaction relationship description information;

[0031] The intelligent mapper generates a target source code according to the first code statement, the second code statement, the third code statement, and the fourth code statement.

[0032] In an optional implementation, the intelligent mapper maps the converted system name into a first code statement according to the first encoding rule, including:

[0033] The intelligent mapper determines the system identifier and system function of the target system according to the converted system name;

[0034] The intelligent mapper maps the system identifier, the system function, and the system name into a first code statement according to a first encoding rule;

[0035] The intelligent mapper maps the converted main participant name into a second code statement according to the second encoding rule, including:

[0036] The intelligent mapper determines the identifier of the main participant and the function of the main participant according to the converted main participant name;

[0037] The intelligent mapper maps the identifier of the main participant, the name of the main participant, and the function of the main participant into a second code statement according to a second encoding rule;

[0038] The intelligent mapper maps the converted external system name into a third code statement according to the third encoding rule, including:

[0039] The intelligent mapper determines the identifier of the external system and the function of the external system according to the converted external system name;

[0040] The intelligent mapper maps the identifier of the external system, the name of the external system, and the function of the external system into a third code statement according to the third encoding rule.

[0041] In an optional implementation, the intelligent mapper maps the converted interaction relationship description information into a fourth code statement according to the fourth encoding rule, including:

[0042] The intelligent mapper determines the initiator of the data interaction, the receiver of the data interaction and the type of the data interaction according to the converted interaction relationship description information;

[0043] The intelligent mapper maps the initiator of the data interaction, the receiver of the data interaction, and the data interaction type into a fourth code statement based on the fourth encoding rule.

[0044] In a second aspect of the present application, a device for generating a system context graph is provided, the device comprising:

[0045] An acquisition module is used to acquire system description information of a target system; the system description information includes text information describing the architecture and functions of the target system;

[0046] An information extraction module is used to input the system description information into the large language model, and extract key information required for creating a system context diagram of the target system from the system description information through an information extractor in the large language model;

[0047] A code mapping module, used to map key information into target source code through an intelligent mapper in a large language model;

[0048] The context graph rendering module is used to render the target source code into a system context graph.

[0049] In a third aspect of the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the method for generating a system context diagram introduced in the first aspect above is implemented.

[0050] In a fourth aspect of the present application, a processor is provided for running a computer program, and when the computer program is running, the method for generating a system context graph introduced in the first aspect is executed.

[0051] Compared with the prior art, this application has the following beneficial effects:

[0052] In the technical solution of the present application, first, system description information of the target system is obtained; the system description information includes text information describing the architecture and functions of the target system; secondly, the system description information is input into a large language model, and the key information required for creating a system context diagram of the target system is extracted from the system description information through an information extractor in the large language model; then, the key information is mapped to the target source code through an intelligent mapper in the large language model; finally, the target source code is rendered into a system context diagram, which can realize the drawing of a high-accuracy system context diagram in an automated manner, avoiding the time-consuming and high drawing error rate problems caused by manually drawing the system context diagram, thereby improving the drawing efficiency of the system context diagram and reducing the drawing error rate of the system context diagram. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0054] Figure 1 A flowchart of a method for generating a system context graph provided in an embodiment of the present application;

[0055] Figure 2 A flowchart of another method for generating a system context graph provided in an embodiment of the present application;

[0056] Figure 3 A flowchart of a process for extracting key information provided by an embodiment of the present application;

[0057] Figure 4 A flowchart of another process of extracting key information provided by an embodiment of the present application;

[0058] Figure 5 A flowchart of a process of mapping key information to target source code provided by an embodiment of the present application;

[0059] Figure 6 A schematic diagram of a system context diagram provided in an embodiment of the present application;

[0060] Figure 7 A schematic diagram of the structure of a device for generating a system context graph provided in an embodiment of the present application. DETAILED DESCRIPTION

[0061] As described above, the current C1 diagram (i.e., system context diagram) is usually created manually. However, manually creating a C1 diagram is not only time-consuming, but also prone to drawing errors.

[0062] After research, the inventors proposed to achieve the drawing of high-accuracy system context diagrams in an automated manner, specifically by obtaining text information (i.e., system description information) describing the architecture and functions of the target system, inputting the system description information into a large language model, and extracting key information required for creating a system context diagram of the target system from the system description information through an information extractor in the large language model; then, the key information is mapped into target source code through an intelligent mapper in the large language model, and the target source code is rendered into a system context diagram, thereby avoiding the problems of long time consumption and high drawing error rate caused by manually drawing the system context diagram, thereby improving the drawing efficiency of the system context diagram and reducing the drawing error rate of the system context diagram.

[0063] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0064] Keyword definitions:

[0065] Large Language Model: (LLM) refers to a machine learning model with a large number of parameters. These models are trained with large-scale data and can understand and generate human language.

[0066] PlantUML: is a simplified markup language for creating UML (Unified Modeling Language) diagrams and other types of diagrams. PlantUML allows the content and layout of a diagram to be defined through simple text descriptions and converted into visual graphics.

[0067] System boundary: It is the boundary that defines the scope of a system. It clarifies the boundary between the inside and outside of the system. The system boundary is used to distinguish which components, functions and services belong to the system internally and which belong to external elements.

[0068] Method Embodiment

[0069] The present application provides an embodiment of a method for generating a system context diagram. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions. In addition, although the logical order is shown in the flowchart, it is only an example order provided. In some cases, the steps shown or described can be executed in a different order than here.

[0070] Figure 1 A flowchart of a method for generating a system context graph provided in an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:

[0071] Step S101, obtaining system description information of the target system.

[0072] In an optional embodiment, a system for generating a system context graph can be used as the execution subject of the method for generating a system context graph in the embodiment of the present application. For the convenience of description, the system for generating a system context graph is referred to as a system below.

[0073] In step S101, the system description information includes text information describing the architecture and functions of the target system. For example, the system description information may include text information 1 as follows:

[0074] Text information 1: "The private banking network system is an online service platform that allows private banking users to manage accounts, transfer money, pay bills, and view transaction history through web pages or mobile applications. The main user groups of the private banking network system include private banking users and bank employees. Bank employees are responsible for system management and customer service. After the private banking user performs a specific operation, the private banking network system automatically sends transaction confirmations, security notifications and other emails to the user. After receiving the API request from the private banking network system, the email system sends the email to the corresponding private banking user." Among them, the target system can be the above-mentioned private banking network system.

[0075] Step S102: input the system description information into the large language model, and extract key information required for creating a system context diagram of the target system from the system description information through an information extractor in the large language model.

[0076] In order to achieve the drawing of high-accuracy system context diagram in an automated manner, the system in this application can use the prompt word technology to give full play to the ability of the large language model to understand the system context diagram, so that the large language model can act as a business analyst, whose task is to extract the key information required to create the system context diagram of the target system from the system description information. By setting the key information extraction process that needs to be thought about and executed in the large language model, the information extractor in the large language model can execute the key information extraction process and automatically extract key information from the input system description information. Figure 2 As shown, when the system description information is input into the large language model, the information extractor in the large language model can execute a key information extraction process of identifying system boundaries and system names, identifying major participants, identifying external systems, and determining descriptive information of interactive relationships, thereby extracting key information from the system description information.

[0077] Taking the above-mentioned text information 1 as an example, the text information 1 is input into the large language model, and the key information extracted by the information extractor in the large language model is shown in key information 1:

[0078] Key message 1:

[0079] {

[0080] “System”: “Private Banking Network System”,

[0081]

[0082] In order to improve the accuracy of key information extraction and provide data preparation for subsequent code mapping and automatic generation of system context diagrams, this application sets constraint rules in the information extractor of the large language model so that the information extractor in the large language model can execute the key information extraction process according to the constraint rules and extract accurate key information from the input system description information. This process can be seen in Figure 3 , Figure 3 A flowchart of a process for extracting key information provided by an embodiment of the present application, the process includes the following steps:

[0083] Step S301: an information extractor identifies a system boundary of a target system and external elements corresponding to the target system according to a first constraint rule and system description information.

[0084] In step S301, the external elements at least include the external system that interacts with the target system for data. For example, in the above text message 1, the external system in the text message is the "mail system". In addition to the external system, the external elements may also include external services and external participants that interact with the target system for data.

[0085] Optionally, the first constraint rule is a rule for defining a system boundary. For example, the first constraint rule is "all points where users interact with the target system are called system boundaries. The system boundary is used to distinguish which components, functions, and services belong to the system and which belong to external elements."

[0086] Step S302: The information extractor extracts the system name of the target system from the system description information according to the second constraint rule.

[0087] In step S302, the second constraint rule is a rule defining the system name. For example, the second constraint rule is "the system name is a unique identifier of the target system, which is usually a brief description of the system function or purpose; if the system name is identified, the system name is represented in the form of System: "system name"". The system can extract the system name of the target system as "private banking network system" from the above text information 1 by the information extractor according to the second constraint rule.

[0088] Step S303: The information extractor determines key information based on the system boundary, external elements and system name.

[0089] Optionally, in order to further improve the accuracy of key information extraction, the system of the present application can Figure 4 The process of extracting key information shown in the figure determines the key information. Figure 4 As shown, the process includes the following steps:

[0090] Step S401: The information extractor identifies the main participants in the system description information according to the system boundary and the third constraint rule.

[0091] In step S401, the main actor is a user or user group that directly interacts with the target system, for example, "private banking users" and "bank employees" in the above text information 1. The third constraint rule is a rule that defines the main actor, for example, the third constraint rule is "the main actor is a key user or user group that interacts with the system. Determine which users or user groups will directly interact with the target system for data. If the main actor is identified, it is expressed in the form of Main_Actor: "name of the main actor"".

[0092] Step S402: The information extractor identifies the external system in the system description information according to the external elements and the fourth constraint rule.

[0093] In step S402, the fourth constraint rule is a rule for defining an external system. For example, the fourth constraint rule is "external systems refer to components that interact with the system but do not belong to the system itself, such as external services, third-party applications, or user groups. If an external system is identified, it is expressed in the form of External_Entity: "name of the external system"."

[0094] Step S403: The information extractor determines the description information of the interactive relationship of data interaction between the target system and the main participant and the external system according to the system name, the main participant, the external system and the fifth constraint rule.

[0095] In step S403, the fifth constraint rule is a rule defining the data interaction mode between the target system and the main participants and external systems. For example, the fifth constraint rule is "For each main participant or external system, describe the data interaction mode and purpose between them and the system, including API calls, message passing, data exchange, service requests, etc. When identifying the interactive relationship of data interaction, express the description information of the interactive relationship in the form of Main_Interaction: [{from: A; to: B; type: x}]". In this embodiment, the description information of the interactive relationship of data interaction between the target system and the main participants and external systems may include the information or data exchanged between the target system and the main participants and external systems. The data interaction is directional, that is, it is necessary to identify that the interactive data flow is from A to B.

[0096] Step S404: The information extractor determines key information based on the system name, main participants, external systems and description information of the interaction relationship.

[0097] In this embodiment, the system determines key information by an information extractor based on the description information of the system name, main participants, external systems and interaction relationships, including the following steps:

[0098] Step 1: The information extractor performs a form conversion on the system name according to the second constraint rule to obtain a converted system name.

[0099] For example, when the system name is the above-mentioned "Private Banking Network System", the system can convert the system name into the form of "System": "Private Banking Network System" (ie the converted system name) through the information extractor according to the second constraint rule.

[0100] Step 2: The information extractor performs a format conversion on the name of the main participant according to the third constraint rule to obtain a converted name of the main participant.

[0101] For example, when the main participants are the above-mentioned "private banking users" and "bank employees", the system can convert the names of the above-mentioned main participants into the form of "Main_Actor": "Private Banking User", "Main_Actor": "Bank Employee" (i.e. the converted names of the main participants) through the information extractor according to the third constraint rule.

[0102] Step three: the information extractor converts the name of the external system into a format according to the fourth constraint rule to obtain a converted external system name.

[0103] For example, when the external system is the above-mentioned "mail system", the system can convert the name of the external system into the form of "External_Entity": "mail system" (ie, the converted external system name) through the information extractor according to the fourth constraint rule.

[0104] Step 4: The information extractor performs a form conversion on the description information of the interaction relationship according to the fifth constraint rule to obtain the converted description information of the interaction relationship.

[0105] For example, when the description information of the interactive relationship is the above-mentioned "interaction of user operations between private banking users and private banking network systems", the system can convert the description information of the interactive relationship into the form of from: "private banking users", to: "private banking network system", type: "user operation" (i.e. the name of the external system after conversion) through the information extractor according to the fifth constraint rule. For another example, when the description information of the interactive relationship is the above-mentioned "interaction of management and services between bank employees and private banking network systems", the system can convert the description information of the interactive relationship into the form of from: "bank employees", to: "private banking network system", type: "management and service" through the information extractor according to the fifth constraint rule.

[0106] In step five, the information extractor takes the converted system name, the converted main participant name, the converted external system name and the converted interaction relationship description information as key information.

[0107] It should be noted that the key information obtained by the system through the steps of converting the system name according to the second constraint rule and converting the name of the main participant according to the third constraint rule through the information extractor can provide data preparation for subsequent code mapping, so that the intelligent mapper can map the key information into the target source code.

[0108] Step S103 : Mapping the key information into target source code through the intelligent mapper in the large language model.

[0109] In order to further achieve the purpose of drawing high-accuracy system context diagrams in an automated manner, the system in the present application sets coding rules in a large language model. For example, PlantUML coding specifications (i.e., coding rules) are set in the large language model so that the large language model understands the coding specifications for drawing system context diagrams using PlantUML, and maps key information into target source code based on the coding specifications through an intelligent mapper in the large language model.

[0110] Take the key information 1 output by the above information extractor as an example, Figure 2 As shown, the system can input the key information into the intelligent mapper, and the intelligent mapper maps the key information into the target source code 1 based on the PlantUML code specification. The target source code can be as follows:

[0111] @startuml

[0112] ! include https… / c4-PlantUML / master / C4_Context.puml

[0113] System(SystemPrivateBank, "Private Bank Network System", "Provide Online Banking Services")

[0114] Person(PersonUser, "Private Banking User", "Using Private Banking Network System to Conduct Transactions")

[0115] Person(PersonBankEmployee, "Bank employee", "Manages private banking network systems and provides customer service")

[0116] System_Ext(SystemEmail, "Mail system", "Send email notification to user")

[0117] Rel(PersonUser, SystemPrivateBank, "UserAction")

[0118] Rel(PersonBankEmployee, SystemPrivateBank, "Management and Services")

[0119] Rel(SystemPrivateBank, SystemEmail, "API Request")

[0120] Rel(SystemEmail, PersonUser, "Mail Notification")

[0121] @enduml

[0122] Optionally, Figure 5 A flowchart of a process of mapping key information to target source code provided by an embodiment of the present application is as follows: Figure 5 As shown, the process includes the following steps:

[0123] Step S501: The intelligent mapper maps the converted system name into a first code statement according to a first encoding rule.

[0124] In step S501, the first coding rule is a coding rule corresponding to the converted system name, for example, the first coding rule is "the target system is represented by a code statement of System (system identifier, system name, system function)".

[0125] In this embodiment, the system can determine the system identifier and system function of the target system according to the converted system name by the intelligent mapper; and the intelligent mapper maps the system identifier, system function, and system name into the first code statement according to the first encoding rule.

[0126] For example, when the converted system name is "System: "Private Bank Network System"", the system can represent the system name as SystemPrivateBank through the large language model, and use SystemPrivateBank as the system identifier of "Private Bank Network System"; then the system can use the large language model to analyze the system name based on the system name to determine that the system function of "Private Bank Network System" is "providing online banking services"; finally, the system can use the intelligent mapper to map the system identifier, system function, and system name into the first code statement according to the above-mentioned first encoding rule: System(SystemPrivateBank, "Private Bank Network System", "Providing online banking services").

[0127] It should be noted that since the target system is the core element in the system context diagram, it is usually a software system or service. Therefore, by specifying the system identifier, system name and system function of the target system, the subsequently generated system context diagram can clearly identify the target system, thereby providing a clear macro perspective and foundation for the C4 architecture diagram, which can help developers maintain consistency with the overall system goals and external environment when designing the internal structure of the system.

[0128] Step S502: The intelligent mapper maps the converted main participant name into a second code statement according to a second encoding rule.

[0129] In step S502, the second encoding rule is an encoding rule corresponding to the converted name of the main participant. For example, the second encoding rule is "representing the main participant with a code statement of Person (identifier of the main participant, name of the main participant, function of the main participant)".

[0130] In this embodiment, the system can determine the identifier of the main participant and the function of the main participant based on the converted name of the main participant by an intelligent mapper; and the intelligent mapper can map the identifier of the main participant, the name of the main participant and the function of the main participant into a second code statement based on the second encoding rule.

[0131] For example, when the name of the main participant after conversion is "Main_Actor: "Private Banking User"", the system can represent the name of the main participant as "PersonUser" through the large language model, and use "PersonUser" as the identifier of the main participant "Private Banking User"; then the system can use the large language model to analyze the function of the main participant based on the name of the main participant as "using the private banking network system to conduct transactions"; finally, the system can use the intelligent mapper to map the identifier of the main participant, the name of the main participant and the function of the main participant into a second code statement according to the above-mentioned second encoding rule: Person(PersonUser, "Private Banking User", "Using the Private Banking Network System to Conduct Transactions").

[0132] For another example, when the name of the main participant after conversion is "Main_Actor: "Bank Employee", the system can represent the name of the main participant as "PersonBankEmployee" through the large language model, and use "PersonBankEmployee" as the identifier of the main participant "Bank Employee"; then the system can use the large language model to analyze the main participant's function as "managing private banking network systems and providing customer service" based on the name of the main participant; finally, the system can use the intelligent mapper to map the main participant's identifier, the main participant's name and the main participant's function into a second code statement according to the above-mentioned second encoding rule: Person(PersonBankEmployee, "Bank Employee", "Managing private banking network systems and providing customer service").

[0133] It should be noted that the main participants in this application are usually users or system administrators. By specifying the main participant's identifier, the main participant's name and the main participant's function, the subsequently generated system context diagram can clearly indicate the parties interacting with the target system, thereby further providing a clear macro perspective and foundation for the C4 architecture diagram.

[0134] Step S503: The intelligent mapper maps the converted external system name into a third code statement according to a third encoding rule.

[0135] In step S503, the third coding rule is a coding rule corresponding to the converted external system name. For example, the third coding rule is "the external system is represented by a code statement System_Ext (external system identifier, external system name, external system function)".

[0136] In this embodiment, the system can determine the identifier of the external system and the function of the external system based on the converted external system name by the intelligent mapper; and the intelligent mapper can map the identifier of the external system, the name of the external system and the function of the external system into a third code statement according to the third encoding rule.

[0137] For example, when the name of the converted external system is "External_Entity: "Mail System"", the system can represent the name of the external system as "SystemEmail" through the large language model, and use "SystemEmail" as the identifier of the external system; then the system can analyze the function of the external system as "send email notification to the user" based on the name of the external system through the large language model; finally, the system can map the identifier of the external system, the name of the external system, and the function of the external system into a third code statement according to the third encoding rule: System_Ext(SystemEmail, "Mail System", "Send Email Notification to the User").

[0138] It should be noted that the external system is an external software system, service or hardware device. By specifying the identifier of the external system, the name of the external system and the function of the external system, the subsequently generated system context diagram can distinguish between the internal system and the external system, thereby further providing a clear macro perspective and foundation for the C4 architecture diagram.

[0139] Step S504: The intelligent mapper maps the converted interaction relationship description information into a fourth code statement according to a fourth encoding rule.

[0140] In step S504, the fourth encoding rule is an encoding rule corresponding to the converted interaction relationship description information. For example, the fourth encoding rule is "representing the interaction relationship with the code statement of Rel (identifier of the initiator of the data interaction, identifier of the recipient of the data interaction, and data interaction type)".

[0141] In this embodiment, the system can determine the initiator of the data interaction, the receiver of the data interaction and the data interaction type based on the converted interaction relationship description information by an intelligent mapper; and the intelligent mapper maps the initiator of the data interaction, the receiver of the data interaction and the data interaction type to a fourth code statement based on the fourth encoding rule.

[0142] For example, when the converted interaction relationship description information is "from: "Private Bank User", to: "Private Bank Network System", type: "User Operation"", the system can analyze through the large language model that the initiator of the data interaction is "Private Bank User", the recipient of the data interaction is "Private Bank Network System", and the data interaction type is "User Operation". Then the system can use the intelligent mapper to map the initiator of the data interaction, the recipient of the data interaction, and the data interaction type into the fourth code statement based on the fourth encoding rule: Rel(PersonUser, SystemPrivateBank, "User Operation").

[0143] For another example, when the converted interaction relationship description information is "from: "Private Bank Network System", to: "Email System", type: "API Request", the system can analyze through the large language model that the initiator of the data interaction is "Private Bank Network System", the recipient of the data interaction is "Email System", and the data interaction type is "API Request". Then the system can use the intelligent mapper to map the initiator of the data interaction, the recipient of the data interaction, and the data interaction type into the fourth code statement based on the fourth encoding rule: Rel(SystemPrivateBank, SystemEmail, "API Request").

[0144] It should be noted that by converting the data interaction between the target system and the main participants and external systems into code statements, the subsequently generated system context diagram can represent the interaction relationship between the main participants, the target system and the external system, which helps to provide a clear macro perspective and foundation for the C4 architecture diagram, and further help developers understand the communication methods and functions between different entities.

[0145] Step S505 : The intelligent mapper generates a target source code according to the first code statement, the second code statement, the third code statement, and the fourth code statement.

[0146] In this embodiment, the system can introduce macro definitions according to coding rule 1 by the intelligent mapper. For example, coding rule 1 is "use import (keyword) to introduce external PlantUML macro definitions". Among them, macro definitions usually include some predefined components and styles, such as the representation methods of UML elements such as main participants, target systems, and data interactions. Introducing macro definitions can simplify the writing of PlantUML codes, so that the created system context diagram can meet the standards. The system can also introduce the starting instruction @startuml and the ending instruction @enduml of the code according to coding rule 2 by the intelligent mapper, so as to obtain a complete target source code that can be used to generate a system context diagram. Among them, coding rule 2 is "the coding starts with @startuml and ends with @enduml".

[0147] It should be noted that the above steps 301-302, 401-403, and 501-504 are merely example execution sequences provided in this embodiment. In some cases, the steps shown or described may be executed in an order different from that shown here, so no specific limitation is made here.

[0148] Step S104: Render the target source code into a system context graph.

[0149] In order to further achieve the purpose of drawing a highly accurate system context diagram in an automated manner and avoid the time-consuming and high error rate problems of manually drawing the system context diagram, in this embodiment, the system can automatically render the target source code into a system context diagram through a graphics rendering tool. For example, taking the above target source code 1 as an example, the system can render the target source code into Figure 6 The system context diagram shown clearly demonstrates the interaction relationships, functions, and data interaction types among the private banking network system, private banking users, bank employees, and email systems through the system context diagram.

[0150] Based on the scheme introduced in the above steps S101 to S104, it can be known that in the present application, the system description information of the target system is first obtained; the system description information includes text information describing the architecture and functions of the target system; secondly, the system description information is input into the large language model, and the key information required for creating the system context diagram of the target system is extracted from the system description information through the information extractor in the large language model; then the key information is mapped to the target source code through the intelligent mapper in the large language model; finally, the target source code is rendered into the system context diagram, thereby realizing the drawing of the system context diagram with high accuracy in an automated manner, avoiding the problems of long time consumption and high drawing error rate caused by manually drawing the system context diagram, thereby improving the drawing efficiency of the system context diagram and reducing the drawing error rate of the system context diagram.

[0151] Device Embodiment

[0152] The embodiment of the present application provides a device for generating a system context graph, wherein: Figure 7 A schematic diagram of the structure of a device for generating a system context graph provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, the device includes: an acquisition module 11, an information extraction module 12, a code mapping module 13 and a context graph rendering module 14. Figure 7 You can see the connection relationship between several modules.

[0153] The acquisition module 11 is used to acquire system description information of the target system; the system description information includes text information describing the architecture and functions of the target system;

[0154] An information extraction module 12, used to input the system description information into the large language model, and extract key information required for creating a system context diagram of the target system from the system description information through an information extractor in the large language model;

[0155] A code mapping module 13, used to map key information into target source code through an intelligent mapper in a large language model;

[0156] The context graph rendering module 14 is used to render the target source code into a system context graph.

[0157] Optionally, the information extraction module includes: a first identification unit, a first extraction unit and a first determination unit.

[0158] The first identification unit is used for the information extractor to identify the system boundary of the target system and the external elements corresponding to the target system according to the first constraint rule and the system description information; the external elements at least include the external system that interacts with the target system for data; the first constraint rule is a rule that defines the system boundary;

[0159] A first extraction unit is used for extracting the system name of the target system from the system description information by the information extractor according to a second constraint rule; the second constraint rule is a rule for defining the system name;

[0160] The first determining unit is used to determine key information according to the system boundary, external elements and system name by the information extractor.

[0161] Optionally, the first determination unit includes: a second identification unit, a third identification unit, a second determination unit and a third determination unit.

[0162] The second identification unit is used for the information extractor to identify the main participants in the system description information according to the system boundary and the third constraint rule; the main participants are users who directly interact with the target system; the third constraint rule is a rule for defining the main participants;

[0163] A third identification unit is used for the information extractor to identify the external system in the system description information according to the external elements and the fourth constraint rule; the fourth constraint rule is a rule for defining the external system;

[0164] A second determination unit is used for determining, by the information extractor, descriptive information of the interactive relationship of data interaction between the target system and the main participant and the external system according to the system name, the main participant, the external system and the fifth constraint rule; the fifth constraint rule is a rule defining the data interaction mode between the target system and the main participant and the external system;

[0165] The third determining unit is used to determine the key information based on the description information of the system name, main participants, external systems and interaction relationships by the information extractor.

[0166] Optionally, the third determining unit includes: a first converting unit, a second converting unit, a third converting unit, a fourth converting unit and a fourth determining unit.

[0167] The first conversion unit is used for the information extractor to perform a form conversion on the system name according to the second constraint rule to obtain a converted system name;

[0168] A second conversion unit is used for performing a form conversion on the name of the main participant according to the third constraint rule by the information extractor to obtain a converted name of the main participant;

[0169] A third conversion unit is used for the information extractor to perform a form conversion on the name of the external system according to the fourth constraint rule to obtain a converted external system name;

[0170] A fourth conversion unit, configured to convert the description information of the interaction relationship according to the fifth constraint rule by the information extractor to obtain converted description information of the interaction relationship;

[0171] The fourth determining unit is configured to use the converted system name, the converted main participant name, the converted external system name and the converted interaction relationship description information as key information by the information extractor.

[0172] Optionally, the code mapping module includes: a first mapping unit, a second mapping unit, a third mapping unit, a fourth mapping unit and a code generating unit.

[0173] The first mapping unit is used to map the converted system name into a first code statement according to a first coding rule by the intelligent mapper; the first coding rule is a coding rule corresponding to the converted system name;

[0174] A second mapping unit is used for mapping the converted main participant name into a second code statement by the intelligent mapper according to a second coding rule; the second coding rule is a coding rule corresponding to the converted main participant name;

[0175] A third mapping unit is used for the intelligent mapper to map the converted external system name into a third code statement according to a third encoding rule; the third encoding rule is an encoding rule corresponding to the converted external system name;

[0176] A fourth mapping unit, configured to map the converted interaction relationship description information into a fourth code statement by the intelligent mapper according to a fourth coding rule; the fourth coding rule is a coding rule corresponding to the converted interaction relationship description information;

[0177] The code generation unit is used for generating a target source code by the intelligent mapper according to the first code statement, the second code statement, the third code statement and the fourth code statement.

[0178] Optionally, the first mapping unit includes: a first determining subunit and a first mapping subunit.

[0179] Wherein, the first determination subunit is used for determining the system identifier and system function of the target system according to the converted system name by the intelligent mapper;

[0180] A first mapping subunit, configured to map the system identifier, the system function, and the system name into a first code statement by an intelligent mapper according to a first encoding rule;

[0181] Optionally, the second mapping subunit includes: a second determining subunit and a second mapping subunit.

[0182] Wherein, the second determination subunit is used for determining the identifier of the main participant and the function of the main participant according to the converted main participant name by the intelligent mapper;

[0183] A second mapping subunit, configured to map the identifier of the main participant, the name of the main participant, and the function of the main participant into a second code statement by the intelligent mapper according to a second encoding rule;

[0184] Optionally, the third mapping subunit includes: a third determining subunit and a third mapping subunit.

[0185] The third determining subunit is used for determining the identifier of the external system and the function of the external system according to the converted external system name by the intelligent mapper;

[0186] The third mapping subunit is used to map the identifier of the external system, the name of the external system and the function of the external system into a third code statement by the intelligent mapper according to a third encoding rule.

[0187] Optionally, the fourth mapping subunit includes: a fourth determining subunit and a fourth mapping subunit.

[0188] The fourth determination subunit is used for determining the initiator of the data interaction, the receiver of the data interaction and the type of the data interaction by the intelligent mapper according to the converted interaction relationship description information;

[0189] The fourth mapping subunit is used to map the initiator of the data interaction, the receiver of the data interaction, and the data interaction type into a fourth code statement based on a fourth encoding rule by the intelligent mapper.

[0190] Storage Medium Embodiments

[0191] The embodiment of the present application provides a computer-readable storage medium, on which a program is stored, wherein when the program is executed by a processor, some or all of the steps in the method for generating a system context graph described in the aforementioned method embodiment of the present application are implemented. The storage medium can be a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes.

[0192] Processor Embodiments

[0193] An embodiment of the present application provides a processor for running a program, wherein part or all of the steps in the method for generating a system context graph introduced in the aforementioned method embodiment are executed when the program is running.

[0194] It should be noted that each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described above is merely schematic, in which the unit described as a separate component may or may not be physically separated, and the component prompted as a unit may or may not be a physical unit, that is, it may be located in one place, or it may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.

[0195] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for generating a system context diagram, characterized in that: include: Obtaining system description information of the target system; the system description information includes text information describing the architecture and functions of the target system; Inputting the system description information into a large language model, and extracting key information required for creating a system context diagram of the target system from the system description information through an information extractor in the large language model; Mapping the key information into target source code by an intelligent mapper in the large language model; The target source code is rendered as the system context graph.

2. The method according to claim 1, characterized in that The extracting key information required for creating the system context diagram of the target system from the system description information by the information extractor in the large language model includes: The information extractor identifies the system boundary of the target system and the external elements corresponding to the target system according to the first constraint rule and the system description information; the external elements at least include an external system that interacts with the target system for data; the first constraint rule is a rule that defines the system boundary; The information extractor extracts the system name of the target system from the system description information according to a second constraint rule; the second constraint rule is a rule defining the system name; The key information is determined by the information extractor according to the system boundary, the external elements and the system name.

3. The method according to claim 2, characterized in that The information extractor determines the key information according to the system boundary, the external elements and the system name, including: The information extractor identifies the main participants in the system description information according to the system boundary and the third constraint rule; the main participants are users who directly interact with the target system; and the third constraint rule is a rule that defines the main participants; The information extractor identifies the external system in the system description information according to the external elements and a fourth constraint rule; the fourth constraint rule is a rule for defining the external system; The information extractor determines, based on the system name, the main participant, the external system and a fifth constraint rule, descriptive information of the interactive relationship of data interaction between the target system and the main participant and the external system; the fifth constraint rule is a rule defining a data interaction mode between the target system and the main participant and the external system; The key information is determined by the information extractor based on the system name, the main participants, the external system and the description information of the interaction relationship.

4. The method according to claim 3, characterized in that The determining of the key information by the information extractor based on the system name, the main participants, the external system and the description information of the interaction relationship includes: The information extractor performs a form conversion on the system name according to the second constraint rule to obtain a converted system name; The information extractor performs a form conversion on the name of the main participant according to the third constraint rule to obtain a converted name of the main participant; The information extractor performs a form conversion on the name of the external system according to the fourth constraint rule to obtain a converted external system name; The information extractor performs a form conversion on the description information of the interaction relationship according to the fifth constraint rule to obtain converted description information of the interaction relationship; The information extractor uses the converted system name, the converted main participant name, the converted external system name and the converted interaction relationship description information as the key information.

5. The method according to claim 4, characterized in that Mapping the key information into target source code by the intelligent mapper in the large language model includes: The intelligent mapper maps the converted system name into a first code statement according to a first encoding rule; the first encoding rule is an encoding rule corresponding to the converted system name; The intelligent mapper maps the converted main participant name into a second code statement according to a second coding rule; the second coding rule is a coding rule corresponding to the converted main participant name; The intelligent mapper maps the converted external system name into a third code statement according to a third encoding rule; the third encoding rule is an encoding rule corresponding to the converted external system name; The intelligent mapper maps the converted interaction relationship description information into a fourth code statement according to a fourth coding rule; the fourth coding rule is a coding rule corresponding to the converted interaction relationship description information; The target source code is generated by the intelligent mapper according to the first code statement, the second code statement, the third code statement and the fourth code statement.

6. The method according to claim 5, characterized in that The intelligent mapper maps the converted system name into a first code statement according to a first encoding rule, including: The intelligent mapper determines the system identifier and system function of the target system according to the converted system name; The intelligent mapper maps the system identifier, the system function, and the system name into the first code statement according to the first encoding rule; The intelligent mapper maps the converted main participant name into a second code statement according to a second encoding rule, including: The intelligent mapper determines the identifier of the main participant and the function of the main participant according to the converted main participant name; The intelligent mapper maps the identifier of the main participant, the name of the main participant and the function of the main participant into the second code statement according to a second encoding rule; The intelligent mapper maps the converted external system name into a third code statement according to a third encoding rule, including: The intelligent mapper determines the identifier of the external system and the function of the external system according to the converted external system name; The intelligent mapper maps the identifier of the external system, the name of the external system and the function of the external system into the third code statement according to the third encoding rule.

7. The method according to claim 5, characterized in that The intelligent mapper maps the converted interaction relationship description information into a fourth code statement according to a fourth encoding rule, including: The intelligent mapper determines the initiator of the data interaction, the receiver of the data interaction and the type of the data interaction according to the converted interaction relationship description information; The intelligent mapper maps the initiator of the data interaction, the receiver of the data interaction, and the data interaction type to the fourth code statement based on the fourth encoding rule.

8. A system context diagram generation device, characterized in that: include: An acquisition module, used to acquire system description information of a target system; the system description information includes text information describing the architecture and functions of the target system; An information extraction module, used for inputting the system description information into a large language model, and extracting key information required for creating a system context diagram of the target system from the system description information through an information extractor in the large language model; A code mapping module, used for mapping the key information into a target source code through an intelligent mapper in the large language model; A context graph rendering module is used to render the target source code into the system context graph.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for generating a system context diagram according to any one of claims 1 to 7 is implemented.

10. A processor, characterized in that: Used to run a computer program, which, when running, executes the method for generating a system context diagram according to any one of claims 1 to 7.