Search

CN-121979946-A - Service code analysis method, system and readable storage medium

CN121979946ACN 121979946 ACN121979946 ACN 121979946ACN-121979946-A

Abstract

The application provides a business code analysis method, a business code analysis system and a readable storage medium. The method comprises the steps of obtaining at least one operation event message, wherein the operation event message comprises a tracing identifier, obtaining at least one execution message, wherein the execution message comprises a tracing identifier, method information and data change information, correlating the operation event message, the method information and the data change information which belong to the same tracing identifier to obtain tracing information corresponding to each tracing identifier, and generating a visual service diagram corresponding to a service flow to be analyzed according to the tracing information corresponding to each tracing identifier. The application can accurately correlate the operation event information of the front end and the method information of the rear end which are connected but distributed with the data change information of the database to form a complete tracing chain, and generate a visual service diagram according to the complete tracing chain so as to accurately identify the service system code.

Inventors

  • LI ZHI
  • LI ZHU
  • YU XIAOLEI
  • He Zaiheng

Assignees

  • 金蝶软件(中国)有限公司

Dates

Publication Date
20260505
Application Date
20251210

Claims (10)

  1. 1. A business code analysis method, comprising: Acquiring at least one piece of operation event information, wherein the operation event information is generated by the front end of a service system in response to page operation, and comprises a trace-back identifier, and the trace-back identifier is used for marking content related to the page operation; Acquiring at least one piece of execution information, wherein the execution information comprises a tracing identifier, method information and data change information, the execution information is obtained in the process of executing a business method and updating a database at the back end of the business system in response to an operation request, the operation request is generated by the front end in response to the page operation, the operation request comprises the tracing identifier, the method information is information of the business method, and the data change information is used for representing change conditions after updating the database; correlating the operation event information, the method information and the data change information belonging to the same traceability identifier to obtain traceability information corresponding to each traceability identifier; and generating a visual service diagram corresponding to the service flow to be analyzed according to the tracing information corresponding to each tracing identifier.
  2. 2. The method of claim 1, wherein the generating a visual service graph corresponding to the service flow to be analyzed according to the trace back information corresponding to each trace back identifier includes: generating a visual flow chart according to the operation time stamp, the method information and the data change information in each piece of traceability information, wherein the visual flow chart is used for displaying the business data flow of the business flow to be analyzed according to the time sequence; Constructing an inverted index from the data change information to the page operation information according to the data change information and the page operation information in each piece of traceability information, and generating a visual data influence diagram; the operation event information further comprises the operation time stamp and the page operation information.
  3. 3. The method of claim 2, wherein generating a visualization flow chart based on the operation time stamp, the method information, and the data change information in each trace back information comprises: generating a time flow chart according to the operation time stamp in each piece of traceability information, wherein the time flow chart comprises at least one operation node; and for each operation node, associating the operation node with corresponding method information and data change information to obtain the visualization flow chart.
  4. 4. The method according to claim 2, wherein the constructing a reverse index from the data change information to the page operation information according to the data change information and the page operation information in each trace back information, and generating a visual data influence diagram, includes: determining operation identifiers and access pages corresponding to the data tables according to the traceability information, and constructing a first reverse index between the data tables and the corresponding operation identifiers and access pages; determining operation identifiers and access pages corresponding to the data according to the traceability information, and constructing a second reverse index between the data and the corresponding operation identifiers and access pages; Generating the visual data influence diagram according to the first reverse index and the second reverse index; The data change information comprises a data table operated by the back end and change information of data, and the page operation information comprises an operation identifier and an access page.
  5. 5. A business code analysis method, comprising: Receiving an operation request, wherein the operation request is generated at the front end of a service system in response to a page operation, and the operation request comprises a trace back identifier, and the trace back identifier is used for marking content related to the page operation; Responding to the operation request, executing a corresponding service method and updating a database; Acquiring the traceability identification, method information and data change information, wherein the method information is information of the business method, and the data change information is used for representing change conditions after updating a database; and correlating the traceability identification, the method information and the data change information to obtain execution information.
  6. 6. The method of claim 5, wherein the obtaining the trace back identifier, method information, and data change information comprises: And in the execution process of the service method, acquiring the traceability identification, the method information and the data change information through an acquisition instruction, wherein the acquisition instruction is inserted into the byte code of the service method after intercepting the byte code of the service method in the class loading period of the service method.
  7. 7. The method according to claim 5 or 6, wherein obtaining the traceback identification comprises: And acquiring the tracing identifier from the context of the currently executed thread, wherein the currently executed thread is used for processing the operation request, and the tracing identifier is stored in the currently executed thread after the operation request is acquired.
  8. 8. The method of claim 7, wherein obtaining method information and data change information comprises: recording class names, method names and parameters of the service methods to obtain the method information; And recording the change information of the operated data table and the data, and obtaining the data change information.
  9. 9. The business system is characterized by comprising a front end, a back end and an analysis module; The front end is used for responding to the page operation of the user and generating an operation request and operation event information containing a tracing identifier, wherein the tracing identifier is used for marking content related to the page operation; the back end is used for receiving the operation request; the method is also used for responding to the operation request, executing a corresponding service method and updating a database; The method is also used for acquiring the traceability identification, method information and data change information, wherein the method information is information of the business method, and the data change information is used for representing change conditions after updating a database; The method is also used for associating the traceability identification, the method information of the business method and the data change information to obtain execution information; the analysis module is used for acquiring at least one piece of operation event information and the execution information; The method is also used for associating the operation event information, the method information and the data change information belonging to the same tracing identifier to obtain tracing information corresponding to each tracing identifier; And the visual business map corresponding to the business flow to be analyzed is generated according to the tracing information corresponding to each tracing identifier.
  10. 10. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the method of any one of claims 1 to 4 or any one of claims 5 to 8.

Description

Service code analysis method, system and readable storage medium Technical Field The application belongs to the technical field of electric digital data processing, and particularly relates to a business code analysis method, a business code analysis system and a readable storage medium. Background Currently, as service functions are more and more, service system codes carry more complex services. When a developer performs subsequent work on the service system, the developer needs to understand the complex service system code so as to correctly maintain the service system. In the prior art, the front-end operation, the back-end service logic and the data stream are generally understood by manually reading the fragmented information such as the source code or the log of the service system, and the fragmented information cannot be completely and accurately associated, so that the problems of low code identification accuracy and incomplete service code easily occur when the subsequent service system is executed. Disclosure of Invention The embodiment of the application provides a service code analysis method, a system and a readable storage medium, which can solve the problems of low accuracy and poor integrity of service system code identification. In a first aspect, an embodiment of the present application provides a service code analysis method, including: Acquiring at least one piece of operation event information, wherein the operation event information is generated by the front end of a service system in response to page operation, and comprises a trace-back identifier, and the trace-back identifier is used for marking content related to the page operation; Acquiring at least one piece of execution information, wherein the execution information comprises a tracing identifier, method information and data change information, the execution information is obtained in the process of executing a business method and updating a database at the back end of the business system in response to an operation request, the operation request is generated by the front end in response to the page operation, the operation request comprises the tracing identifier, the method information is information of the business method, and the data change information is used for representing change conditions after updating the database; correlating the operation event information, the method information and the data change information belonging to the same traceability identifier to obtain traceability information corresponding to each traceability identifier; and generating a visual service diagram corresponding to the service flow to be analyzed according to the tracing information corresponding to each tracing identifier. In some embodiments, the generating a visual service map corresponding to the service flow to be analyzed according to the trace information corresponding to each trace identifier includes: generating a visual flow chart according to the operation time stamp, the method information and the data change information in each piece of traceability information, wherein the visual flow chart is used for displaying the business data flow of the business flow to be analyzed according to the time sequence; Constructing an inverted index from the data change information to the page operation information according to the data change information and the page operation information in each piece of traceability information, and generating a visual data influence diagram; the operation event information further comprises the operation time stamp and the page operation information. In some embodiments, the generating a visualization flowchart according to the operation time stamp, the method information and the data change information in each trace back information includes: generating a time flow chart according to the operation time stamp in each piece of traceability information, wherein the time flow chart comprises at least one operation node; and for each operation node, associating the operation node with corresponding method information and data change information to obtain the visualization flow chart. In some embodiments, the constructing a reverse index from the data change information to the page operation information according to the data change information and the page operation information in each trace back information, and generating a visualized data influence diagram includes: determining operation identifiers and access pages corresponding to the data tables according to the traceability information, and constructing a first reverse index between the data tables and the corresponding operation identifiers and access pages; determining operation identifiers and access pages corresponding to the data according to the traceability information, and constructing a second reverse index between the data and the corresponding operation identifiers and access pages; Generating the visual data influence diagram according