Business code analysis method and system and readable storage medium
By acquiring and associating front-end operation events and back-end execution information from the business system, a visual business diagram is generated, which solves the problem of poor accuracy and completeness in business system code recognition and enables accurate understanding of the intent of the business system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- KINGDEE SOFTWARE(CHINA) CO LTD
- Filing Date
- 2025-12-10
- Publication Date
- 2026-05-05
AI Technical Summary
In existing technologies, the accuracy and completeness of business system code identification are low, which can easily lead to problems when the business system is executed.
By acquiring front-end operation event information and back-end execution information, and using traceability identifiers to associate them, a visual business diagram is generated to show the relationship between front-end operation events, back-end method information, and database data change information.
It improves the accuracy and completeness of business system code identification, ensuring that developers can correctly understand the intent of the business system and reducing inaccuracy and incompleteness issues in code identification.
Smart Images

Figure CN121979946A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of electronic digital data processing technology, and in particular relates to a business code analysis method, system and readable storage medium. Background Technology
[0002] Currently, with the increasing number of business functions, the business system code carries more complex business logic. Developers need to understand this complex business system code before performing any subsequent work on it in order to properly maintain the system.
[0003] In existing technologies, front-end operations, back-end business logic, and data flow are generally understood by manually reading fragmented information such as the source code or logs of the business system. Because this fragmented information cannot be completely and accurately linked together, the subsequent execution of the business system is prone to problems such as low code recognition accuracy and incomplete business code. Summary of the Invention
[0004] This application provides a business code analysis method, system, and readable storage medium, which can solve the problems of low accuracy and poor integrity in business system code identification.
[0005] In a first aspect, embodiments of this application provide a business code analysis method, including: Obtain at least one operation event information, wherein the operation event information is generated by the front end of the business system in response to a page operation, and the operation event information includes a traceability identifier, which is used to mark content related to the page operation; At least one execution information is obtained, the execution information including a traceability identifier, method information and data change information. The execution information is obtained in the process of the backend of the business system responding to an operation request, executing a business method and updating the database. The operation request is generated by the frontend in response to the page operation. The operation request includes the traceability identifier. The method information is the information of the business method. The data change information is used to characterize the changes after updating the database. The operation event information, method information and data change information belonging to the same traceability identifier are associated to obtain the traceability information corresponding to each traceability identifier; Based on the traceability information corresponding to each traceability identifier, a visual business diagram corresponding to the business process to be analyzed is generated.
[0006] In some embodiments, generating a visual business diagram corresponding to the business process to be analyzed based on the traceability information corresponding to each traceability identifier includes: Based on the operation timestamps, method information and data change information in each of the traceability information, a visual flowchart is generated. The visual flowchart is used to display the business data flow of the business process to be analyzed in chronological order. Based on the data change information and page operation information in each of the traceability information, a reverse index is constructed from the data change information to the page operation information, and a visual data impact diagram is generated; The operation event information also includes the operation timestamp and the page operation information.
[0007] In some embodiments, generating a visual flowchart based on the operation timestamp, the method information, and the data change information in each of the traceability information includes: A time flow chart is generated based on the operation timestamps in each of the traceability information, and the time flow chart includes at least one operation node. For each operation node, the operation node is associated with the corresponding method information and data change information to obtain the visual flowchart.
[0008] In some embodiments, constructing a reverse index from the data change information to the page operation information based on the data change information and page operation information in each of the traceability information, and generating a visual data impact diagram, includes: Based on the traceability information, determine the operation identifier and access page corresponding to each data table, and construct a first reverse index between each data table and its corresponding operation identifier and access page; Based on the traceability information, determine the operation identifier and access page corresponding to each data, and construct a second reverse index between each data and the corresponding operation identifier and access page; The visualization data impact map is generated based on the first inverted index and the second inverted index; The data change information includes the data tables operated by the backend and the data change information, and the page operation information includes the operation identifier and the accessed page.
[0009] Secondly, embodiments of this application provide a business code analysis method, including: Receive an operation request, which is generated in response to a page operation at the front end of the business system. The operation request includes a traceability identifier, which is used to mark content related to the page operation. In response to the operation request, the corresponding business method is executed, and the database is updated; The traceability identifier, method information, and data change information are obtained, wherein the method information is the information of the business method, and the data change information is used to characterize the changes after updating the database. The traceability identifier, the method information, and the data change information are associated to obtain execution information.
[0010] In some embodiments, obtaining the traceability identifier, method information, and data change information includes: During the execution of the business method, the traceability identifier, the method information, and the data change information are obtained through a collection instruction. The collection instruction is inserted into the bytecode after intercepting the bytecode of the business method during the class loading period of the business method.
[0011] In some embodiments, obtaining the traceability identifier includes: The traceability identifier is obtained from the context of the currently executing thread, which is used to process the operation request. The traceability identifier is stored in the currently executing thread after the operation request is obtained.
[0012] In some embodiments, obtaining method information and data change information includes: Record the class name, method name, and parameters of the business method to obtain the method information; Record the data tables and data changes operated on to obtain the data change information.
[0013] Thirdly, embodiments of this application provide a business system, including: a front-end, a back-end, and an analysis module; The front end is used to respond to user page operations and generate operation requests and operation event information containing traceability identifiers, wherein the traceability identifiers are used to mark content related to the page operation; The backend is used to receive the operation request; It is also used to respond to the operation request, execute the corresponding business method, and update the database; It is also used to obtain the traceability identifier, method information and data change information, wherein the method information is the information of the business method and the data change information is used to characterize the changes after updating the database; It is also used to associate the traceability identifier, the method information of the business method, and the data change information to obtain execution information; The analysis module is used to obtain at least one of the operation event information and the execution information; It is also used to associate the operation event information, the method information and the data change information belonging to the same traceability identifier to obtain the traceability information corresponding to each traceability identifier; It is also used to generate a visual business diagram corresponding to the business process to be analyzed based on the traceability information corresponding to each of the traceability identifiers.
[0014] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method as described in any one of the first or second aspects above.
[0015] The beneficial effects of the embodiments in this application compared with the prior art are: This application embodiment associates operation events, method information, and data change information belonging to the same traceability identifier to obtain traceability information corresponding to each traceability identifier. The operation event information is generated by the front end in response to page operations and includes a traceability identifier, which is used to mark content related to page operations. The execution information includes traceability identifiers, method information, and data change information. The execution information is obtained by the back end in response to an operation request, executing a business method, and updating the database. The operation request is generated by the front end in response to the page operation. This achieves precise association of related but scattered front end operation event information, back end method information, and database data change information based on a unique traceability identifier, forming a complete traceability chain and improving the integrity of the business system code. Based on the traceability information corresponding to each traceability identifier, a visual business diagram is generated to visually display the relationship between front end operation event information, back end method information, and database data change information, so as to accurately identify the business system code and thus correctly understand the business intent of the business system code, improving the identification accuracy of the business system code.
[0016] It is understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a schematic diagram of a system provided in an embodiment of this application; Figure 2 This is a schematic diagram of the first type of business code analysis method provided in an embodiment of this application; Figure 3This is a schematic diagram of the second type of business code analysis method provided in the embodiments of this application; Figure 4 This is a schematic diagram of the third process of the business code analysis method provided in the embodiments of this application; Figure 5 This is the fourth flowchart of the business code analysis method provided in the embodiments of this application; Figure 6 This is the fifth flowchart of the business code analysis method provided in the embodiments of this application. Detailed Implementation
[0019] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0020] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0021] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0022] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0023] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0024] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0025] The business code analysis method provided in this application can be applied to business systems. Figure 1 This is a schematic diagram of a system provided in an embodiment of this application, as shown below. Figure 1 As shown, the system includes a front-end 10, a back-end 11, and an analysis module 12. The front-end 10 connects to the back-end 11 via wired or wireless means. The front-end 10, also known as a client, can be, but is not limited to, a personal computer, laptop, personal digital assistant, smartphone, tablet, smartwatch, etc. The back-end 11 can be a server implementing a single function or a server implementing multiple functions; specifically, it can be a standalone physical server or a cluster of physical servers. The front-end can provide multiple different visual pages and operation identifiers. Specifically, developers can interact with the visual pages of the front-end 10 to generate page operations. In response to user page operations, it generates operation requests and operation event information containing traceability identifiers. The traceability identifiers are used to mark content related to the page operation. After receiving the operation request, the back-end 11 responds by executing the corresponding business method and updating the database; it obtains the traceability identifier, method information, and data change information. The method information is the information of the business method, and the data change information is used to characterize the changes after updating the database; it associates the traceability identifier, the method information of the business method, and the data change information to obtain execution information. The analysis module 12 associates operation events, method information, and data change information belonging to the same traceability identifier to obtain traceability information corresponding to each traceability identifier; based on the traceability information corresponding to each traceability identifier, it generates a visual business diagram corresponding to the business process to be analyzed.
[0026] In some implementations, the computer device can specifically be a front-end, comprising a processor, storage medium, internal memory, network interface, display screen, and input device connected via a system bus. The processor provides computing and control capabilities, supporting the operation of the entire front-end. The storage medium stores the operating system and computer programs, which, when executed by the processor, enable the processor to implement a business code analysis method. The internal memory of the computer device may also store computer programs, which, when executed by the processor, enable the processor to execute a business code analysis method. The network interface of the computer device is used for communication with the back-end and analysis modules. The input device of the computer device can be a touch layer covering the display screen, or an external keyboard, touchpad, or mouse. The display screen can be used to display multiple different visual pages and operation icons, allowing developers to interact with the front-end visual interface.
[0027] In some implementations, the computer device can specifically be a backend, comprising a processor, storage medium, internal memory, and network interface connected via a system bus. The processor provides computing and control capabilities, supporting the operation of the entire backend. The storage medium stores the operating system and computer programs, which, when executed by the processor, enable the processor to implement a business code analysis method. The internal memory of the computer device may also store computer programs, which, when executed by the processor, enable the processor to execute a business code analysis method. The network interface of the computer device is used for communication with the frontend and analysis modules.
[0028] In some implementations, the computer device can specifically be an analysis module. This computer device includes a processor, storage medium, internal memory, and network interface connected via a system bus. The processor provides computational and control capabilities, supporting the operation of the entire analysis module. The storage medium stores the operating system and computer programs. When executed by the processor, these programs enable the processor to implement a business code analysis method. The internal memory of the computer device may also store computer programs, which, when executed by the processor, enable the processor to execute a business code analysis method. The network interface of the computer device is used for communication with the front-end and back-end.
[0029] Figure 2 This is a schematic diagram of the first type of business code analysis method provided in this application embodiment. The method is applied to the front end of a business system. Figure 2 The method shown includes steps S11 to S12, which will be described in detail below.
[0030] S11: Responds to user page actions.
[0031] The front-end provides users with a visual and intuitive page, featuring multiple control buttons. These buttons are represented by operation icons, with different icons for different controls. Users can interact with these control buttons to generate corresponding page actions, allowing the front-end to determine the user's intent and respond accordingly.
[0032] Page operations can also be referred to as UI operations (User Interface Operation, which refers to user interactions on a front-end page).
[0033] As an example, page actions could include clicking a button, submitting, etc.
[0034] S12: Generate operation request and operation event information containing traceability identifiers.
[0035] The traceability identifier is used to mark content related to page operations. The traceability identifier is globally unique and is used to identify a complete request chain.
[0036] The frontend responds to page actions by generating a globally unique traceability identifier to mark content related to that page action. It then generates an action request and action event information containing the traceability identifier. This unique traceability identifier is transmitted through the action request and action event information, enabling the backend to obtain the traceability identifier via the action request and the analytics module to obtain it via the action event information.
[0037] In some embodiments, in order to reduce the impact on business systems, asynchronous reporting of operation requests and operation event information can be adopted, and the sampling rate can be adjusted and optimized according to the actual situation to improve front-end performance.
[0038] In some embodiments, in order to reduce the impact on the business system, operation requests and operation event information are first added to a memory queue, and then sent in the order in the memory queue to adjust and optimize front-end performance.
[0039] In this embodiment of the application, by responding to the user's page operation, an operation request and operation event information containing a traceability identifier are generated. The traceability identifier is used to mark the content related to the page operation, so as to provide a foundation for accurately associating the related but scattered front-end operation event information, back-end method information and database data change information to form a complete traceability chain.
[0040] Understandably, the business process to be analyzed may typically involve multiple events at different times and multiple pages. Users perform actions on the various pages involved in the business process in chronological order. Each time a user performs a page action, an action request and action event information are generated. The front-end generates multiple action requests and action event information for the business process to be analyzed until the business process ends. The corresponding back-end will receive at least one action request, and the back-end will respond to each action request by performing an action. The analysis module will obtain at least one piece of information.
[0041] As an example, the business process to be analyzed includes events a, b, and c. The user performs an operation on the page involved in event a, in chronological order, generating an operation request a containing the traceability identifier a and operation event information a. Then, the user performs an operation on the page involved in event b, generating an operation request b containing the traceability identifier b and operation event information b. Finally, the user performs an operation on the page involved in event c, generating an operation request c containing the traceability identifier c and operation event information c.
[0042] In some embodiments, in order to enable users to better understand the business process to be analyzed, the front end provides a visual configuration interface. Users can operate on the visual configuration interface to predefine a complete business process to be analyzed, i.e. the business process to be analyzed, and name the business process to clarify the specific functions and operations implemented by the business process to be analyzed.
[0043] For example, users define the complete onboarding process for new employees in the visual configuration interface, defining the start event (onboarding and record creation) and end event (completion and archiving), forming a business process from start to finish. They can also define activity events at different times and set operable resources.
[0044] In some embodiments, generating operation event information includes: S121: Record the page operation information and operation timestamp corresponding to the page operation.
[0045] S122: Generate operation event information based on page operation information, operation timestamp, and traceability identifier.
[0046] In some implementations, a corresponding SDK can be pre-configured based on the front-end framework. By embedding the front-end SDK (Software Development Kit), the system can automatically record the pages accessed by the user, the operation identifier, obtain page operation information, and automatically record the operation timestamp. Then, operation event information is generated based on the page operation information, operation timestamp, and traceability identifier. By configuring the corresponding SDK according to the front-end framework, global information acquisition can be achieved, enabling non-intrusive capture of user page operation-related information and reducing the impact on business systems.
[0047] This application embodiment records the page operation information and operation timestamp corresponding to the page operation, and generates operation event information based on the page operation information, operation timestamp and traceability identifier, providing clear and explicit business context information for subsequent steps, and thus providing a foundation for generating a complete, clear and content-rich visual business view.
[0048] Figure 3 This is a schematic diagram of the second type of business code analysis method provided in this application embodiment. This method is applied to the backend of a business system. Figure 3 The method shown includes steps S21 to S24, which will be described in detail below.
[0049] S21: Receive operation request.
[0050] Among them, the operation request is generated in the front end of the business system in response to the page operation. The operation request includes a traceability identifier, which is used to mark the content related to the page operation.
[0051] Each time the front end responds to a page operation, it generates an operation request. The back end receives the corresponding operation request and its unique traceability identifier.
[0052] S22: In response to the operation request, execute the corresponding business method and update the database.
[0053] The backend responds to the operation request by determining the corresponding business method. It then executes the business method to obtain the processing result. Finally, it calls the data access interface to update the corresponding database based on the processing result, thereby changing the relevant data.
[0054] The business methods can be methods such as insert, update, and delete.
[0055] S23: Obtain traceability identifiers, method information, and data change information.
[0056] Among them, the method information is the information of the business method, and the data change information is used to represent the changes after the database is updated.
[0057] When a business method is invoked, traceability identifiers, method information, and data change information related to the business method are collected.
[0058] S24: Associate the traceability identifier, method information, and data change information to obtain execution information.
[0059] The business method is determined by the corresponding operation request, and the data change information is generated after the business method is executed. The traceability identifier of the operation request is associated with the method information and data change information, which provides a basis for the subsequent association of the front-end operation event information with the method information and data change information.
[0060] In some embodiments, in order to reduce the impact on business systems, asynchronous reporting of execution information may be adopted, and the sampling rate may be adjusted and optimized according to the actual situation to improve backend performance.
[0061] In some embodiments, in order to reduce the impact on the business system, operation requests are first added to a memory queue, and threads are allocated according to the order in the memory queue to process the operation requests and execute the business methods, which can adjust and optimize backend performance.
[0062] This application embodiment receives an operation request, obtains a traceability identifier from the operation request through the request link, acquires the traceability identifier, method information, and data change information, associates the traceability identifier, method information, and data change information to obtain execution information, realizes the accurate association between related but scattered backend method information and database data change information, and provides a basis for the accurate association between frontend operation event information, backend method information, and database data change information based on the traceability identifier.
[0063] Understandably, the business process being analyzed may typically involve multiple events at different times and multiple pages. The front-end will generate multiple operation requests, and the back-end will receive multiple operation requests, responding to each operation request to perform the operation.
[0064] As an example, the business process to be analyzed includes events a, b, and c. The user, in chronological order, first receives operation request a containing traceability identifier a, and executes the corresponding business method a. Then, the user receives operation request b containing traceability identifier b, and executes the corresponding business method b. Finally, the user receives operation request c containing traceability identifier c, and executes the corresponding business method c.
[0065] In some embodiments, step S23 includes: During the execution of business methods, traceability identifiers, method information, and data change information are obtained through collection instructions.
[0066] The acquisition instruction is inserted into the bytecode after intercepting the bytecode of the business method during the class loading period.
[0067] During the class loading phase of the business method, the backend intercepts the bytecode of the business method from the data access layer, obtains the bytecode, and then inserts a data collection instruction at the beginning of the business method's method body; that is, the data collection instruction instrumentation occurs before the bytecode is loaded. After the business method completes class initialization, it obtains new, complete, and continuous bytecode containing the data collection instructions. After the business method starts, during its execution, the backend executes the data collection instructions to obtain traceability identifiers, method information, and data change information.
[0068] The acquisition instructions can be expressed in bytecode.
[0069] In some implementations, the traceability identifier is obtained, including: Retrieve the trace identifier from the context of the currently executing thread.
[0070] The currently executing thread is used to process operation requests, and the traceability identifier is stored in the currently executing thread after the operation request is obtained.
[0071] In response to an operation request, the backend allocates an idle thread to handle the request. The currently executing thread is then the one processing the operation request. During the processing, the currently executing thread retrieves a trace identifier from the operation request and stores it in a thread variable.
[0072] Once the currently executing thread enters a business method, the context of the currently executing thread is captured by the collection instructions during the execution of the business method to obtain traceability identifiers related to page operations.
[0073] In some embodiments, an operation identifier is obtained from the context of the currently executing thread. The operation identifier is stored in the currently executing thread after the operation request is obtained.
[0074] In some implementations, method information and data change information are obtained, including: Record the class name, method name, and parameters of the business method to obtain method information.
[0075] Once the currently executing thread enters the business method, it obtains method information by collecting instructions and recording the class name, method name, and parameters of the business method during the execution of the business method.
[0076] As an example, the inserted business method is: Add an order in the backend. The corresponding class name is OrderService, the method name is createOrder, and the parameters are: Long userId, List<userId>. <orderitem>`items` retrieves information about how to add new orders in the backend.
[0077] Record the data tables and data changes performed, and obtain data change information.
[0078] Once the currently executing thread enters the business method, it obtains data change information by collecting instructions and recording changes to the data tables and data during the execution of the business method.
[0079] In some implementations, after obtaining the SQL statement generated based on the business method, the SQL statement is parsed to obtain and record the data tables operated on and the changes to the data, thus obtaining the change information for the data tables and data. The changes to the operated data include changes to the primary keys and fields.
[0080] In some embodiments, to enable users to accurately understand the changes, a data snapshot can be recorded to obtain the values of the fields before and after the changes.
[0081] In some implementations, when collecting snapshots, pre-configured rules can be set, such as regular expressions to match field names, and pre-set authorized passwords, mobile phone numbers, and other information for automatic de-identification to ensure data security.
[0082] This application embodiment intercepts the bytecode of the business method during the class loading period and inserts the collection instructions into the bytecode, thereby achieving non-intrusive information collection. The required information can be collected without modifying the business code, reducing the impact on the business system, lowering the technical threshold for deployment and use, and enabling application in large and complex legacy business systems, thus improving applicability.
[0083] Understandably, by intercepting the bytecode of business methods during class loading and inserting the collection instructions into the bytecode, non-intrusive information collection can be achieved. This solves the problems of manually adding custom annotations to business methods to mark methods that need to be traced, and the backend intercepting the annotated business methods to collect information, which leads to strong intrusion, high cost, easy omission of business methods, and the need to modify business code. It can also solve the problem of not being able to obtain the front-end page operations and back-end method information marked by traceability information when collecting data change information by parsing database log files, resulting in information fragmentation and the inability to establish a complete business chain.
[0084] Figure 4 This is a schematic diagram of the third type of business code analysis method provided in this application embodiment. This method is applied to the analysis module of a business system. Figure 4 The method shown includes steps S31 to S34, which will be described in detail below.
[0085] S31: Obtain at least one operation event information.
[0086] Among them, operation event information is generated by the front end of the business system in response to page operations. Operation event information includes traceability identifiers, which are used to mark content related to page operations. S32: Obtain at least one execution information.
[0087] The execution information includes traceability identifiers, method information, and data change information. The execution information is obtained in the backend of the business system in response to the operation request, executing the business method and updating the database. The operation request is generated in response to the page operation in the frontend. The operation request includes traceability identifiers, the method information is the information of the business method, and the data change information is used to represent the changes after updating the database.
[0088] Understandably, the business process to be analyzed typically involves multiple events at different times and multiple pages. The front-end generates multiple operation requests and operation event information for the business process to be analyzed until the business ends. The corresponding back-end will receive at least one operation request, and the back-end will respond to each operation request to perform an operation, thereby obtaining multiple execution information. The analysis module will obtain at least one operation event information and execution information.
[0089] As an example, the business process to be analyzed includes events a, b, and c. The analysis module obtains operation event information a, operation event information b, and operation event information c. The analysis module also obtains execution information a, execution information b, and execution information c.
[0090] S33: Associate the operation event information, method information and data change information belonging to the same traceability identifier to obtain the traceability information corresponding to each traceability identifier.
[0091] Based on the operation event information, which includes traceability identifiers, and the execution information, which also includes traceability identifiers, the operation event information, method information, and data change information belonging to the same traceability identifier are searched and associated.
[0092] As an example, the analysis module obtains operation event information a, operation event information b, operation event information c, and execution information a, execution information b, and execution information c. Based on the traceability identifier a, operation event information a is associated with method information a and data change information a to obtain traceability information a. Based on the traceability identifier b, operation event information b is associated with method information b and data change information b to obtain traceability information b. Based on the traceability identifier c, operation event information c is associated with method information c and data change information c to obtain traceability information c.
[0093] S34: Generate a visual business diagram corresponding to the business process to be analyzed based on the traceability information corresponding to each traceability identifier.
[0094] The system analyzes related operational events, methods, and data change information within various traceability records to generate multi-dimensional visualizations, resulting in a visualized business diagram. Different dimensions represent different relationships between information. Specific dimensions can be set according to actual needs to enable developers to clearly understand the business process being analyzed.
[0095] This application embodiment associates operation events, method information, and data change information belonging to the same traceability identifier to obtain traceability information corresponding to each traceability identifier. The operation event information is generated by the front end in response to page operations and includes a traceability identifier, which is used to mark content related to page operations. The execution information includes traceability identifiers, method information, and data change information. The execution information is obtained by the back end in response to an operation request, executing a business method, and updating the database. The operation request is generated by the front end in response to the page operation. This achieves precise association of related but scattered front end operation event information, back end method information, and database data change information based on a unique traceability identifier, forming a complete traceability chain and improving the integrity of the business system code. Based on the traceability information corresponding to each traceability identifier, a visual business diagram is generated to visually display the relationship between front end operation event information, back end method information, and database data change information, so as to accurately identify the business system code and thus correctly understand the business intent of the business system code, improving the identification accuracy of the business system code.
[0096] Understandably, by automatically generating visual business diagrams based on accurate traceability information, developers can intuitively, accurately, and quickly understand the entire business process. This can solve the problems of poor timeliness, poor accuracy, inability to dynamically trace and verify, and high maintenance costs caused by manually declaring the relationship between business logic and data in code or documents according to coding standards and documentation.
[0097] In some embodiments, the method further includes: Use a retrieval database to store various traceability information.
[0098] This application embodiment utilizes a retrieval database to store various traceability information, supporting rapid querying and analysis of massive amounts of data.
[0099] In some embodiments, the operation event information may also include an operation timestamp and page operation information. Figure 5 This is the fourth flowchart of the business code analysis method provided in the embodiments of this application. For example... Figure 5 As shown, step S34 includes: S341: Generate a visual flowchart based on the operation timestamp, method information, and data change information in each traceability information.
[0100] Among them, the visual flowchart is used to display the business data flow of the business process to be analyzed in chronological order.
[0101] In some implementations, step S341 includes: S51: Generate a time flow diagram based on the operation timestamps in each traceability information. The time flow diagram includes at least one operation node.
[0102] Based on the operation timestamp, operation nodes are generated at the corresponding times, thus creating a timeline-based flowchart. The operation timestamp represents the time when the page operation occurred, the operation nodes represent the page operations, and the timeline flowchart represents the temporal sequence of each page operation.
[0103] S52: For each operation node, associate the operation node with the corresponding method information and data change information to obtain a visual flowchart.
[0104] Each operation node represents a page operation. Based on the page operation, the method information, data change information and operation nodes associated with the page operation are linked to obtain a complete visual flowchart. This allows users to click on any operation node to see which backend business methods are triggered by that operation node, which data tables, primary keys, and fields undergo which changes.
[0105] S342: Based on the data change information and page operation information in each traceability information, construct a reverse index from the data change information to the page operation information, and generate a visual data impact diagram.
[0106] In some implementations, step S142 includes: S61: Based on the traceability information, determine the operation identifier and access page corresponding to each data table, and construct the first inverse index between each data table and the corresponding operation identifier and access page.
[0107] The data change information includes the data tables operated on by the backend and the data change information, while the page operation information includes the operation identifier and the accessed page.
[0108] In practice, multiple front-end page operations may modify the same data table, or a single page operation may modify a different data table. The system retrieves the data tables from the back-end change information in the traceability logs. For each data table, the system searches the traceability logs for the page operations that modified it, constructing a reverse index from the data table to the operation identifier and the accessed page. This first reverse index allows the system to list the page operations that modified the data table.
[0109] S62: Based on each traceability information, determine the operation identifier and access page corresponding to each data, and construct a second reverse index between each data and its corresponding operation identifier and access page.
[0110] In practice, multiple front-end page operations may modify the same data, or a single page operation may modify a single piece of data. We retrieve the data changes from the back-end operations within the various traceability information. For each piece of data, we search for the page operations that modified it within each traceability information, and then construct a reverse index from the data to the operation identifier and the accessed page, obtaining a second reverse index to list the page operations that modified the data.
[0111] In some embodiments, the data is in the form of fields, and a second inverse index is constructed between each field and its corresponding operation identifier and access page.
[0112] S63: Generate a visualization of the data impact based on the first and second inverted indices.
[0113] A topology map involving the data tables is generated based on the first inverted index, and a topology map of the data is generated based on the second inverted index, in order to generate a visual data impact map. This allows users to search for any data table or data and, through the business system, to reverse-list the page operations that modify the data table or data, view the page operations that modify the data table or data, and understand the scope of the impact of the page operations.
[0114] This application embodiment generates a visual flowchart based on the operation timestamps, method information, and data change information in each traceability information, obtaining a view expressed in the vertical dimension. It aggregates related but scattered operations, methods, and change data into a visual business data flow, enabling developers to intuitively understand the business process. Based on the data change information and page operation information in each traceability information, it constructs a reverse index from data change information to page operation information and generates a visual data impact diagram, obtaining a view expressed in the horizontal dimension. This allows developers to quickly and accurately assess the scope of affected data, reducing the possibility of online failures due to erroneous modifications and improving system stability and maintainability.
[0115] By using visual flowcharts and visual data impact diagrams, developers can quickly understand the overall business process and thus the overall business system, reducing the time required for understanding and improving the efficiency of code comprehension.
[0116] Figure 6 This is the fifth flowchart of the business code analysis method provided in the embodiments of this application. For example... Figure 6 As shown, the method includes: The front end responds to the user's page actions by generating operation requests and operation event information containing traceability identifiers. The traceability identifiers are used to mark content related to the page actions.
[0117] The backend receives operation requests; The backend responds to the operation request by executing the corresponding business method and updating the database; The backend retrieves traceability identifiers, method information, and data change information.
[0118] Among them, the method information is the information of the business method, and the data change information is used to represent the changes after the database is updated; The backend will associate the traceability identifier, the method information of the business method, and the data change information to obtain the execution information.
[0119] The analysis module obtains at least one operation event and execution information; The analysis module associates operation event information, method information, and data change information belonging to the same traceability identifier to obtain the traceability information corresponding to each traceability identifier; The analysis module generates a visual business diagram corresponding to the business process to be analyzed based on the traceability information corresponding to each traceability identifier.
[0120] Understandably, generating visualizations from accurate and real-time traceability information can provide accurate and timely documentation, reduce the loss of business knowledge due to personnel changes, and lower team collaboration costs.
[0121] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. Furthermore, the data collection in the above embodiments is compliant, and its use or implementation does not involve any infringement upon public interests.
[0122] For ease of explanation, only the parts related to the embodiments of this application are shown in the methods described in the above embodiments.
[0123] In some embodiments, the system includes: a front-end, a back-end, and an analysis module; The front end is used to respond to user page operations and generate operation requests and operation event information containing traceability identifiers. The traceability identifiers are used to mark content related to page operations.
[0124] The backend is used to receive operation requests; It is also used to respond to operation requests, execute corresponding business methods, and update the database; It is also used to obtain traceability identifiers, method information, and data change information. Method information refers to information about business methods, and data change information is used to characterize changes after updating the database. It is also used to associate traceability identifiers, business method information, and data change information to obtain execution information.
[0125] The analysis module is used to obtain at least one operation event information and execution information; It is also used to associate operation event information, method information and data change information belonging to the same traceability identifier to obtain traceability information corresponding to each traceability identifier; It is also used to generate a visual business diagram corresponding to the business process to be analyzed based on the traceability information corresponding to each traceability identifier.
[0126] In some embodiments, the analysis module includes a first generation module and a second generation module.
[0127] The first generation module is used to generate a visual flowchart based on the operation timestamps, method information, and data change information in each traceability information. The visual flowchart is used to display the business data flow of the business process to be analyzed in chronological order.
[0128] The second generation module is used to construct a reverse index from data change information to page operation information based on the data change information and page operation information in each traceability information, and generate a visual data impact diagram.
[0129] The operation event information also includes the operation timestamp and page operation information.
[0130] In some embodiments, the first generation module is specifically used to generate a time flow chart based on the operation timestamps in each traceability information. The time flow chart includes at least one operation node. For each operation node, the operation node is associated with the corresponding method information and data change information to obtain a visual flowchart.
[0131] In some embodiments, the second generation module is specifically used to determine the operation identifier and access page corresponding to each data table based on each traceability information, and construct a first reverse index between each data table and its corresponding operation identifier and access page; determine the operation identifier and access page corresponding to each data based on each traceability information, and construct a second reverse index between each data and its corresponding operation identifier and access page; and generate a visualized data impact diagram based on the first and second reverse indexes; wherein, the data change information includes the data table operated by the backend and the data change information, and the page operation information includes the operation identifier and access page.
[0132] In some embodiments, the backend includes: a response module, an acquisition module, and an association module.
[0133] The response module is used to receive operation requests, which are generated in response to page operations on the front end of the business system. The operation request includes a traceability identifier, which is used to mark content related to the page operation. In response to the operation request, the corresponding business method is executed and the database is updated.
[0134] The acquisition module is used to acquire traceability identifiers, method information, and data change information. The method information is the information of the business method, and the data change information is used to represent the changes after updating the database.
[0135] The association module is used to associate traceability identifiers, method information, and data change information to obtain execution information.
[0136] In some embodiments, the acquisition module is specifically used to acquire traceability identifiers, method information, and data change information through acquisition instructions during the execution of the business method. The acquisition instructions are inserted into the bytecode after intercepting the bytecode of the business method during the class loading period of the business method.
[0137] In some embodiments, the acquisition module includes a traceability identifier acquisition unit, a method information acquisition unit, and a change information acquisition unit.
[0138] The traceability identifier acquisition unit is used to obtain the traceability identifier from the context of the currently executing thread. The currently executing thread is used to process the operation request, and the traceability identifier is stored in the currently executing thread after obtaining the operation request.
[0139] The method information acquisition unit is used to record the class name, method name, and parameters of the business method to obtain method information.
[0140] The change information acquisition unit is used to record the change information of the data tables and data being operated on, and to obtain data change information.
[0141] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0142] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0143] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the steps in the above-described method embodiments.
[0144] This application provides a computer program product that, when run on an electronic device, enables the electronic device to implement the steps described in the various method embodiments above.
[0145] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying the computer program code to a photographing device / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some cases, the computer-readable medium cannot be an electrical carrier signal or a telecommunication signal.
[0146] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0147] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0148] In the embodiments provided in this application, it should be understood that the disclosed apparatus / network devices and methods can be implemented in other ways. For example, the apparatus / network device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0149] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0150] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.< / orderitem>
Claims
1. A business code analysis method, characterized in that, include: Obtain at least one operation event information, wherein the operation event information is generated by the front end of the business system in response to a page operation, and the operation event information includes a traceability identifier, which is used to mark content related to the page operation; At least one execution information is obtained, the execution information including a traceability identifier, method information and data change information. The execution information is obtained in the process of the backend of the business system responding to an operation request, executing a business method and updating the database. The operation request is generated by the frontend in response to the page operation. The operation request includes the traceability identifier. The method information is the information of the business method. The data change information is used to characterize the changes after updating the database. The operation event information, method information and data change information belonging to the same traceability identifier are associated to obtain the traceability information corresponding to each traceability identifier; Based on the traceability information corresponding to each traceability identifier, a visual business diagram corresponding to the business process to be analyzed is generated.
2. The method according to claim 1, characterized in that, The step of generating a visual business diagram corresponding to the business process to be analyzed based on the traceability information corresponding to each of the traceability identifiers includes: Based on the operation timestamps, method information and data change information in each of the traceability information, a visual flowchart is generated. The visual flowchart is used to display the business data flow of the business process to be analyzed in chronological order. Based on the data change information and page operation information in each of the traceability information, a reverse index is constructed from the data change information to the page operation information, and a visual data impact diagram is generated; The operation event information also includes the operation timestamp and the page operation information.
3. The method according to claim 2, characterized in that, The step of generating a visual flowchart based on the operation timestamps, method information, and data change information in each of the traceability information includes: A time flow chart is generated based on the operation timestamps in each of the traceability information, and the time flow chart includes at least one operation node. For each operation node, the operation node is associated with the corresponding method information and data change information to obtain the visual flowchart.
4. The method according to claim 2, characterized in that, The step of constructing a reverse index from the data change information to the page operation information based on the data change information and page operation information in each of the traceability information, and generating a visual data impact diagram, includes: Based on the traceability information, determine the operation identifier and access page corresponding to each data table, and construct a first reverse index between each data table and its corresponding operation identifier and access page; Based on the traceability information, determine the operation identifier and access page corresponding to each data, and construct a second reverse index between each data and the corresponding operation identifier and access page; The visualization data impact map is generated based on the first inverted index and the second inverted index; The data change information includes the data tables operated by the backend and the data change information, and the page operation information includes the operation identifier and the accessed page.
5. A business code analysis method, characterized in that, include: Receive an operation request, which is generated in response to a page operation at the front end of the business system. The operation request includes a traceability identifier, which is used to mark content related to the page operation. In response to the operation request, the corresponding business method is executed, and the database is updated; The traceability identifier, method information, and data change information are obtained, wherein the method information is the information of the business method, and the data change information is used to characterize the changes after updating the database. The traceability identifier, the method information, and the data change information are associated to obtain execution information.
6. The method according to claim 5, characterized in that, The acquisition of the traceability identifier, method information, and data change information includes: During the execution of the business method, the traceability identifier, the method information, and the data change information are obtained through a collection instruction. The collection instruction is inserted into the bytecode after intercepting the bytecode of the business method during the class loading period of the business method.
7. The method according to claim 5 or 6, characterized in that, Obtaining the traceability identifier includes: The traceability identifier is obtained from the context of the currently executing thread, which is used to process the operation request. The traceability identifier is stored in the currently executing thread after the operation request is obtained.
8. The method according to claim 7, characterized in that, Obtain method information and data change information, including: Record the class name, method name, and parameters of the business method to obtain the method information; Record the data tables and data changes operated on to obtain the data change information.
9. A business system, characterized in that, include: Front-end, back-end, and analytics modules; The front end is used to respond to user page operations and generate operation requests and operation event information containing traceability identifiers, wherein the traceability identifiers are used to mark content related to the page operation; The backend is used to receive the operation request; It is also used to respond to the operation request, execute the corresponding business method, and update the database; It is also used to obtain the traceability identifier, method information and data change information, wherein the method information is the information of the business method and the data change information is used to characterize the changes after updating the database; It is also used to associate the traceability identifier, the method information of the business method, and the data change information to obtain execution information; The analysis module is used to obtain at least one of the operation event information and the execution information; It is also used to associate the operation event information, the method information and the data change information belonging to the same traceability identifier to obtain the traceability information corresponding to each traceability identifier; It is also used to generate a visual business diagram corresponding to the business process to be analyzed based on the traceability information corresponding to each of the traceability identifiers.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 4 or any one of claims 5 to 8.