System document generation method and device, electronic equipment and storage medium

By adding annotation information and generating system documents when the source code of the business system is changed, the problem of insufficient real-timeness of system documents in the existing technology is solved, real-time document updates after source code changes are realized, and the real-timeness and accuracy of documents are improved. .

CN118733111APending Publication Date: 2024-10-01QI AN XIN TECHNOLOGY GROUP INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410832525.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

In the existing technology, after the source code of the business system is changed, the system documentation is not updated in time, resulting in a reduction in its real-time nature and the inability to accurately reflect the current status and functional relationships of the system.

Method used

When the source code of the target business system changes, determine the changed target terms and add annotation information to them. Based on these annotation information, system documents are generated, including function-related information, business flow charts and test cases, to ensure real-time updates of the documents. .

Benefits of technology

By generating system documents in real time, the real-time and accuracy of the documents are improved, allowing users to understand system changes and functional relationships in a timely manner, and enhancing the reliability of system management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733111A_ABST
    Figure CN118733111A_ABST
Patent Text Reader

Abstract

The invention provides a system document generation method and device, electronic equipment and a storage medium, and relates to the technical field of computers.The method comprises the steps that under the condition that it is determined that a source code corresponding to a target business system is changed, at least one target term in a first source code after change is determined, the target terms are terms in the field to which the target business system belongs; for each target term, adding annotation information to a target code including the target term in the first source code; and generating a system document based on the first source code added with the annotation information. According to the method and the device, the system document is generated in real time when the source code is changed, so that the real-time performance of the system document is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for generating a system document. Background Art

[0002] With the continuous development of corporate business and the rapid changes in the market environment, business systems are facing increasing challenges and opportunities. In order to maintain the competitiveness of business systems, ensure the security and accuracy of data, and improve user experience, it is crucial to update the source code of business systems.

[0003] In the related art, after the development of a business system is completed, a system document is generated for the business system, and the relevant information of each function in the business system is recorded through the system document. However, after the source code corresponding to the business system is changed, the system document is not updated, thereby reducing the real-time performance of the system document. Summary of the invention

[0004] The present invention provides a method, device, electronic equipment and storage medium for generating a system document, so as to solve the defect of reducing the real-time performance of the system document in the prior art.

[0005] The present invention provides a method for generating a system document, comprising: In the case where it is determined that the source code corresponding to the target business system has changed, determining at least one target term in the first source code after the change, the target term being a term in the field to which the target business system belongs; For each of the target terms, adding annotation information to the target code including the target term in the first source code; A system document is generated based on the first source code after the annotation information is added.

[0006] According to a method for generating a system document provided by the present invention, the method of generating the system document based on the first source code after adding annotation information comprises: Based on each of the annotation information, code analysis is performed on the first source code in a code compilation phase to obtain function-related information corresponding to the first source code, wherein the function-related information includes business information of at least one function, calling relationships within each of the functions, and calling relationships between the functions; The system document is generated based on the business information of the at least one function, the internal calling relationship of each of the functions, and the calling relationship between each of the functions.

[0007] According to a method for generating a system document provided by the present invention, the generating of the system document based on the business information of the at least one function, the internal calling relationship of each of the functions and the calling relationship between each of the functions includes: generating a markdown document based on the business information of the at least one function and the internal calling relationship of each of the functions; For each of the functions, the sub-process information of the function node corresponding to the function is determined based on the internal calling relationship of the function; the process information between the function nodes is determined based on the calling relationship between the functions; Generate a business process diagram based on the sub-process information and the process information; The system document is generated based on the business process diagram and the markdown document.

[0008] According to a method for generating a system document provided by the present invention, generating the system document based on the business process diagram and the markdown document includes: For each of the functions, generating a test case for the function based on the business information of the function; Each of the test cases and the business process diagram is embedded in the markdown document to obtain the system document.

[0009] According to a method for generating a system document provided by the present invention, the step of adding annotation information to the target code including the target term in the first source code comprises: determining a target code of the target term included in the first source code; Inputting the target code into an annotation generation model to obtain annotation information corresponding to the target code output by the annotation generation model; the annotation generation model is obtained by training an initial annotation generation model based on at least one sample code in the field to which the target business system belongs and annotation labels corresponding to each sample code; The annotation information corresponding to the target code is added to the corresponding position of the target code in the first source code.

[0010] According to a method for generating a system document provided by the present invention, the method further includes: Obtain the second source code of the target business system before the change occurs; Comparing the first source code with the second source code; In a case where the first source code includes other terms in addition to the terms included in the second source code, information related to the other terms in the system document is marked based on a preset marking method, and the marking is used to display the information related to the other terms in the system document to a user.

[0011] The present invention also provides a system document generation device, comprising: a determining unit, configured to determine, when determining that a source code corresponding to the target business system has changed, at least one target term in the first source code after the change, wherein the target term is a term in the field to which the target business system belongs; and an adding unit, configured to add annotation information to the target code including the target term in the first source code for each target term; The generating unit is used to generate a system document based on the first source code after the annotation information is added.

[0012] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for generating a system document as described in any one of the above is implemented.

[0013] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method for generating a system document as described in any one of the above is implemented.

[0014] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method for generating a system document as described above is implemented.

[0015] The system document generation method, device, electronic device and storage medium provided by the present invention, when determining that the source code corresponding to the target business system has changed, determine the target term in the first source code after the change, add annotation information to the target code including the target term in the first source code, and generate the system document based on the first source code after the annotation information is added, thereby realizing the real-time generation of the system document when the source code has changed, thereby improving the real-time performance of the system document. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0017] Figure 1 This is one of the flow charts of the method for generating system documents provided in an embodiment of the present invention.

[0018] Figure 2 This is the second flowchart of the method for generating system documents provided in an embodiment of the present invention.

[0019] Figure 3 This is the third flow chart of the method for generating system documents provided in the embodiment of the present invention.

[0020] Figure 4 This is the fourth flow chart of the method for generating system documents provided in an embodiment of the present invention.

[0021] Figure 5 It is a structural diagram of a device for generating system documents provided by an embodiment of the present invention.

[0022] Figure 6 It is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0024] Combine the following Figure 1-Figure 4 The method for generating a system document of the present invention is described. The execution subject of the method for generating a system document can be an electronic device such as a computer, a server, a terminal, or a system document generating device set in the electronic device. The system document generating device can be implemented by software, hardware, or a combination of the two.

[0025] Figure 1 FIG. 1 is a flow chart of a method for generating a system document provided by an embodiment of the present invention. Figure 1 As shown, the method for generating the system document includes the following steps: Step 101: When it is determined that a source code corresponding to a target business system has changed, at least one target term in a first source code after the change is determined, where the target term is a term in the field to which the target business system belongs.

[0026] The source code is the core of the target business system. The source code is written according to business requirements and converts business logic into computer executable instructions. Through the source code, developers can implement various functions of the target business system, such as data input, processing, storage and output. The target business system can be, for example, a World Wide Web (web) website or application with certain functions.

[0027] For example, a code auditing tool (such as SonarQube or Checkstyle, etc.) can be used to scan the code base and detect whether the source code has changed. Alternatively, after the user learns that the source code corresponding to the target business system has changed, a code change message is input into the electronic device so that the electronic device determines that the source code corresponding to the target business system has changed. Then, in the first source code after the change, the target terms included in the terminology library of the field to which the target business system belongs are searched. The terminology library is created in advance based on the collected terms in the field to which the target business system belongs. For example, terms in the field include User, Role, Permission, Resource, Access Control List (ACL), Authentication, Authorization, Session, Token, Encryption, Decryption, Key, Digital Signature, Public Key Infrastructure (PKI), Vulnerability, Threat, Attack, Intrusion Detection System (IDS), Firewall, Security Policy, Risk Assessment, Data Protection, Privacy and Compliance, etc.

[0028] Step 102: For each of the target terms, add annotation information to the target code including the target term in the first source code.

[0029] For example, for each target term, a target code including the target term is obtained in the first source code, and semantic understanding is performed on the target code including the target term, and the semantic understanding result is determined as annotation information corresponding to the target code including the target term, and the annotation information is added to the position of the target code including the target term in the first source code, for example, added after the target code.

[0030] Step 103: Generate a system document based on the first source code after adding annotation information.

[0031] For example, after adding annotation information of each target code including the target term in the first source code, the first source code with annotation information added is obtained, and the first source code with annotation information added is input into the code analyzer, and the first source code is analyzed by the code analyzer based on the annotation information. The added annotation information enables the code analyzer to better understand the corresponding code, and finally the system document corresponding to the first source code is obtained, and the system document corresponding to the first source code includes relevant information of each function that can be realized by the target business system. The code analyzer can be a code analysis software developed on the basis of JDepend, which is an open source Java code quality analysis tool.

[0032] It should be noted that the system document may also be converted into an interactive system document, which is not limited in the present invention.

[0033] The system document generation method provided by the present invention determines the target term in the first source code after the change when determining that the source code corresponding to the target business system has changed, adds annotation information to the target code including the target term in the first source code, and generates the system document based on the first source code after the annotation information is added, thereby realizing the real-time generation of the system document when the source code has changed, thereby improving the real-time performance of the system document; and the added annotation information enables the code analyzer to better understand the corresponding code, thereby improving the accuracy of the generated system document.

[0034] In one embodiment, Figure 2 FIG. 2 is a flow chart of a method for generating a system document provided by an embodiment of the present invention. Figure 2 As shown, the above step 103 generates a system document based on the first source code after adding annotation information, which can be specifically implemented by the following steps: Step 1031: Perform code analysis on the first source code in the code compilation stage based on each of the annotation information to obtain function-related information corresponding to the first source code, wherein the function-related information includes business information of at least one function, calling relationships within each of the functions, and calling relationships between each of the functions.

[0035] For example, during the code compilation phase, the code analyzer analyzes the first source code based on each annotation information to obtain function-related information of the first source code. Specifically, the first source code after adding annotation information is scanned, all annotation information is searched, and all annotation information is parsed to understand the meaning of each annotation information, and the corresponding code is associated through the meaning of the annotation information to obtain the business information of the function; the method call in the first source code is also analyzed, and the calling relationship within the function can be determined by analyzing the call stack and parameter passing of the method. In addition to analyzing the calling relationship within a single function, the calling relationship between different functions is also searched, involving cross-class, cross-package and cross-module call analysis. Finally, the business information of each function corresponding to the first source code, the calling relationship within each function and the calling relationship between each function are obtained.

[0036] Step 1032: Generate the system document based on the business information of the at least one function, the internal calling relationship of each function, and the calling relationship between each function.

[0037] For example, when the business information of each function corresponding to the first source code, the calling relationship within each function, and the calling relationship between each function are obtained, the business information of each function, the calling relationship within each function, and the calling relationship between each function can be integrated to obtain the system document corresponding to the target business system.

[0038] In one embodiment, code analysis is performed on the first source code at the code compilation stage based on each annotation information to obtain business information of each function corresponding to the first source code, calling relationships within each function, and calling relationships between each function. Then, based on the business information of each function, calling relationships within each function, and calling relationships between each function, a system document corresponding to the target business system is automatically generated, thereby improving the comprehensiveness of the system document content.

[0039] In one embodiment, Figure 3 FIG. 3 is a flow chart of a method for generating a system document provided by an embodiment of the present invention. Figure 3 As shown, the above step 1032 generates the system document based on the business information of the at least one function, the internal calling relationship of each function and the calling relationship between each function, which can be specifically implemented by the following steps: Step 301: Generate a markdown document based on the business information of the at least one function and the internal calling relationship of each function.

[0040] For example, the document structure of the markdown document is determined, including the title, summary and function details. The title can be, for example, "Business Function Document", and the summary can be, for example, "This document outlines the business information of each function in the target business system and the internal call relationship of the functions". The function details include the business information of each function. For example, the user registration function is intended to allow new users to register an account. The main business logic is: the user fills in the registration form, the system verifies the form entered by the user, and after the verification is passed, the user account is created and a confirmation email is sent. The internal call relationship of the user registration function includes calling the "validateUserInput" function to verify the input after the user registration form is submitted. After the verification is passed, the "createUserAccount" function is called to create an account. After the account is successfully created, the "sendConfirmationEmail" function is called to send a confirmation email. For another example, the login function is intended to verify the user's login credentials and allow the user to log in. The main business logic is: the user enters the username and password, the system verifies the username and password entered by the user, and after the verification is passed, a user session is created and access to the target business system is allowed. The internal call relationship of the login function includes: after the user submits the login information, the "validateLoginCredentials" function is called to verify the user name and password. After the verification is passed, the "createUserSession" function is called to create a user session. After the session is successfully created, the user is redirected to the homepage of the target business system. The format of the title, summary and function details is converted into the format of the markdown document, and finally a markdown document is obtained.

[0041] Step 302: For each of the functions, determine the sub-process information of the function node corresponding to the function based on the internal calling relationship of the function.

[0042] By way of example, for each function, the internal calling relationship of the function is converted into corresponding sub-process information, and the sub-process information is determined as the sub-process information of the function node corresponding to the function; for example, the internal calling relationship of the login function includes calling the "validateLoginCredentials" function to verify the user name and password after the user submits the login information, and after the verification is passed, calling the "createUserSession" function to create a user session. After the session is successfully created, the user is redirected to the homepage of the target business system. The sub-process information is to call the "validateLoginCredentials" function to verify the user name and password after the user submits the login information as the information of sub-node 1, call the "createUserSession" function to create a user session after the verification is passed as the information of sub-node 2, and after the session is successfully created, the user is redirected to the homepage of the target business system as the information of sub-node 3. Finally, the information of sub-node 1, the information of sub-node 2 and the information of sub-node 3 are connected in a flowchart to obtain the sub-process information of the function node corresponding to the function.

[0043] Step 303: Determine the process information between the function nodes based on the calling relationship between the functions.

[0044] For example, if function A calls function B, the specific calling steps of function A calling function B are used as the process information between the function node corresponding to function A and the function node corresponding to function B.

[0045] Step 304: Generate a business process diagram based on the sub-process information and the process information.

[0046] For example, each function node is taken as a vertex, the sub-process information corresponding to the function node is taken as the attribute information of the vertex, the calling relationship between functions is taken as an edge, and the process information between the function nodes is taken as the attribute of the edge, and finally a business process diagram is obtained.

[0047] Step 305: Generate the system document based on the business process diagram and the markdown document.

[0048] For example, after obtaining the business process diagram and the markdown document, the business process diagram and the markdown document can be used together as a system document, or the business process diagram can be embedded in the markdown document to obtain the system document.

[0049] In this embodiment, the business information of the functions, the internal calling relationships of the functions, and the calling relationships between the functions are represented by markdown documents and business process diagrams. Finally, the system document is obtained based on the business process diagram and the markdown document, so that users can know the various functions of the target business system in real time through the system document.

[0050] In one embodiment, Figure 4 FIG. 4 is a flow chart of a method for generating a system document provided in an embodiment of the present invention. Figure 4 As shown, the above step 305 generates the system document based on the business process diagram and the markdown document, which can be specifically implemented by the following steps: Step 3051: for each of the functions, generate a test case for the function based on the business information of the function; embed each of the test cases and the business process diagram into the markdown document to obtain the system document.

[0051] For example, for each function, a test case is written based on the business information of the function. The test case contains information such as the test case number, test title, precondition, test steps, test data, expected results, actual results, and whether it passes or not. Taking the login function as an example, the generated test case is as follows: Test case number: Login_TC_001, precondition: the system is running normally, and there is a valid username and password, test steps: open the login page, enter a valid username in the username input box, enter a password that matches the username in the password input box, and click the "Login" button. Test data: Username: testuser, password: TestPassword123. Expected result: The system verifies that the username and password are correct, creates a user session, successfully redirects to the target business system or displays the user main interface, actual result: (fill in after executing the test), whether it passes or not: (judge according to the actual result). When the business process diagram and test case are obtained, a markdown editor (such as Typora, Mark Text, etc.) is used to directly embed the business process diagram into the markdown document. The specific implementation process of embedding test cases into markdown documents can be as follows: use markdown's title syntax to add a title to the test case section, and then create a list item for the test case. The list item can use an ordered list (using a number plus .) or an unordered list (using -, *, or +). If the test case contains code snippets (for example, sample code for API calls), you can also use markdown's code block syntax to ensure that the test case is easy to read and understand in the markdown document.

[0052] In this embodiment, functional test cases are generated based on functional business information, and functional requirements are converted into executable test cases to verify the correctness and completeness of the target business system functions. Each test case and business process diagram is embedded in a markdown document, and system documentation of the target business system is generated in real time. Reliable system documentation that evolves in real time as the business system changes can be generated.

[0053] In one embodiment, the above step 102 adds annotation information to the target code including the target term in the first source code, which can be implemented in the following way: Determine the target code of the target term included in the first source code; input the target code into an annotation generation model to obtain annotation information corresponding to the target code output by the annotation generation model; the annotation generation model is obtained by training an initial annotation generation model based on at least one sample code in the field to which the target business system belongs and annotation labels corresponding to each sample code; add the annotation information corresponding to the target code to the corresponding position of the target code in the first source code.

[0054] For example, a target code including a target term is searched in the first source code, the target code is input into the annotation generation model, the target code is semantically understood through the annotation generation model, and annotation information corresponding to the target code is output, and finally annotation information corresponding to each target code is obtained, and the annotation information corresponding to each target code is added to the corresponding position of the target code in the first source code, for example, added after the target code.

[0055] It should be noted that the annotation generation model can be trained in the following way: obtain multiple sample codes in the field to which the target business system belongs, input the multiple sample codes into the initial annotation generation model, obtain the sample annotation information corresponding to each sample code output by the initial annotation generation model, construct the loss based on the sample annotation information of the sample code and the corresponding annotation label, adjust the model parameters of the initial annotation generation model based on the loss until the convergence condition is reached, and obtain the annotation generation model. The initial annotation generation model can be a model based on deep learning technology, such as a recurrent neural network (RNN), a convolutional neural network (CNN), or a long short-term memory network (LSTM).

[0056] In this embodiment, annotation information corresponding to the target code is generated based on the annotation generation model, which improves the accuracy and efficiency of annotation information generation and further improves the accuracy of system document generation.

[0057] In one embodiment, after the above step 103, the system document generation method further includes the following steps: obtaining a second source code of the target business system before the change occurs; comparing the first source code and the second source code; when the first source code includes other terms other than the terms included in the second source code, marking the information related to the other terms in the system document based on a preset marking method, and the marking is used to display the information related to the other terms in the system document to the user.

[0058] For example, when it is determined that the source code corresponding to the target business system has changed, a second source code of the target business system before the change is obtained, the first source code and the second source code are compared to find other codes included in the first source code but not included in the second source code, and it is determined whether other terms are included in the other codes. When other terms are included in the other codes, information related to the other terms is detected in the system document, and the information related to the other terms is marked based on a preset marking method, which may be a preset color or a preset shape, etc.

[0059] In this embodiment, the second source code of the target business system before the change and the first source code of the target business system after the change are compared. When other terms are included in the first source code of the target business system after the change, the information related to the other terms in the system document is marked based on a preset marking method, so that the user can know the changed information at a glance based on the marking.

[0060] The following is a description of a system document generation device provided by the present invention. The system document generation device described below and the system document generation method described above can be referenced to each other.

[0061] Figure 5 is a schematic diagram of the structure of a device for generating a system document provided by an embodiment of the present invention, such as Figure 5 As shown, the system document generation device 500 includes a determination unit 501, an adding unit 502 and a generation unit 503, wherein: The determining unit 501 is used to determine at least one target term in the first source code after the change when it is determined that the source code corresponding to the target business system has changed, wherein the target term is a term in the field to which the target business system belongs; the adding unit 502 is used to add annotation information to the target code including the target term in the first source code for each target term; The generating unit 503 is used to generate a system document based on the first source code after the annotation information is added.

[0062] The system document generation device provided by the embodiment of the present invention determines the target term in the first source code after the change when determining that the source code corresponding to the target business system has changed, adds annotation information to the target code including the target term in the first source code, and generates the system document based on the first source code after the annotation information is added, thereby realizing the real-time generation of the system document when the source code has changed, thereby improving the real-time performance of the system document.

[0063] Based on any of the above embodiments, the generating unit 503 is specifically used for: Based on each of the annotation information, code analysis is performed on the first source code in a code compilation phase to obtain function-related information corresponding to the first source code, wherein the function-related information includes business information of at least one function, calling relationships within each of the functions, and calling relationships between the functions; The system document is generated based on the business information of the at least one function, the internal calling relationship of each of the functions, and the calling relationship between each of the functions.

[0064] Based on any of the above embodiments, the generating unit 503 is further specifically configured to: Generate a markdown document based on the business information of the at least one function and the internal call relationship of each of the functions; For each of the functions, the sub-process information of the function node corresponding to the function is determined based on the internal calling relationship of the function; the process information between the function nodes is determined based on the calling relationship between the functions; Generate a business process diagram based on the sub-process information and the process information; The system document is generated based on the business process diagram and the markdown document.

[0065] Based on any of the above embodiments, the generating unit 503 is further specifically configured to: For each of the functions, generating a test case for the function based on the business information of the function; Each of the test cases and the business process diagram is embedded in the markdown document to obtain the system document.

[0066] Based on any of the above embodiments, the adding unit 502 is specifically used for: determining a target code of the target term included in the first source code; Inputting the target code into an annotation generation model to obtain annotation information corresponding to the target code output by the annotation generation model; the annotation generation model is obtained by training an initial annotation generation model based on at least one sample code in the field to which the target business system belongs and annotation labels corresponding to each sample code; The annotation information corresponding to the target code is added to the corresponding position of the target code in the first source code.

[0067] Based on any of the above embodiments, the system document generating device 500 further includes: An acquisition unit, used for acquiring a second source code of the target business system before the change occurs; a comparing unit, configured to compare the first source code with the second source code; a marking unit, configured to mark information related to other terms in the system document based on a preset marking method when the first source code includes other terms in addition to the terms included in the second source code, wherein the marking is used to display the information related to the other terms in the system document to a user.

[0068] Figure 6 is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention, such as Figure 6 As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communication interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the method for generating a system document, the method comprising: in the case of determining that the source code corresponding to the target business system is changed, determining at least one target term in the first source code after the change, the target term being a term in the field to which the target business system belongs; For each of the target terms, annotation information is added to the target code including the target term in the first source code; and a system document is generated based on the first source code after the annotation information is added.

[0069] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0070] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the system document generation method provided by the above methods, the method comprising: in the case of determining that the source code corresponding to the target business system is changed, determining at least one target term in the first source code after the change, the target term being a term in the field to which the target business system belongs; For each of the target terms, adding annotation information to the target code including the target term in the first source code; A system document is generated based on the first source code after the annotation information is added.

[0071] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for generating a system document provided by the above methods is implemented, the method comprising: in the case of determining that a source code corresponding to a target business system is changed, determining at least one target term in a first source code after the change, wherein the target term is a term in the field to which the target business system belongs; For each of the target terms, annotation information is added to the target code including the target term in the first source code; and a system document is generated based on the first source code after the annotation information is added.

[0072] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may 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 labor.

[0073] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0074] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for generating a system document, characterized in that: include: In the case where it is determined that the source code corresponding to the target business system has changed, determining at least one target term in the first source code after the change, the target term being a term in the field to which the target business system belongs; For each of the target terms, adding annotation information to the target code including the target term in the first source code; A system document is generated based on the first source code after the annotation information is added.

2. The method for generating system documents according to claim 1, characterized in that: The generating of the system document based on the first source code after adding the annotation information comprises: Based on each of the annotation information, code analysis is performed on the first source code in a code compilation phase to obtain function-related information corresponding to the first source code, wherein the function-related information includes business information of at least one function, calling relationships within each of the functions, and calling relationships between the functions; The system document is generated based on the business information of the at least one function, the internal calling relationship of each of the functions, and the calling relationship between each of the functions.

3. The method for generating system documents according to claim 2, characterized in that: The generating the system document based on the business information of the at least one function, the internal calling relationship of each function and the calling relationship between each function includes: Generate a markdown document based on the business information of the at least one function and the internal call relationship of each of the functions; For each of the functions, the sub-process information of the function node corresponding to the function is determined based on the internal calling relationship of the function; the process information between the function nodes is determined based on the calling relationship between the functions; Generate a business process diagram based on the sub-process information and the process information; The system document is generated based on the business process diagram and the markdown document.

4. The method for generating system documents according to claim 3, characterized in that: The generating the system document based on the business process diagram and the markdown document includes: For each of the functions, generating a test case for the function based on the business information of the function; Each of the test cases and the business process diagram is embedded in the markdown document to obtain the system document.

5. The method for generating a system document according to any one of claims 1 to 4, characterized in that: The adding annotation information to the target code including the target term in the first source code includes: determining a target code of the target term included in the first source code; Inputting the target code into an annotation generation model to obtain annotation information corresponding to the target code output by the annotation generation model; the annotation generation model is obtained by training an initial annotation generation model based on at least one sample code in the field to which the target business system belongs and annotation labels corresponding to each sample code; The annotation information corresponding to the target code is added to the corresponding position of the target code in the first source code.

6. The method for generating a system document according to any one of claims 1 to 4, characterized in that: The method further includes: obtaining a second source code of the target business system before the change occurs; Comparing the first source code with the second source code; In a case where the first source code includes other terms in addition to the terms included in the second source code, information related to the other terms in the system document is marked based on a preset marking method, and the marking is used to display the information related to the other terms in the system document to a user.

7. A system document generation device, characterized in that: include: a determining unit, configured to determine, when it is determined that a source code corresponding to the target business system has changed, at least one target term in the first source code after the change, wherein the target term is a term in the field to which the target business system belongs; an adding unit, configured to add annotation information to the target code including the target term in the first source code for each target term; The generating unit is used to generate a system document based on the first source code after the annotation information is added.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method for generating the system document according to any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for generating a system document according to any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for generating a system document according to any one of claims 1 to 6 is implemented.