A link log generation method and system

Bytecode insertion technology adds link information to the distributed log system, solving the problem of lack of correlation between log information, realizing link logging function, reducing development and operation and maintenance costs, and improving search efficiency.

CN112181909BActive Publication Date: 2025-01-17CHINA CITIC BANK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010968578.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-15
Publication Date
2025-01-17
Estimated Expiration
2040-09-15

AI Technical Summary

Technical Problem

In the distributed systems in the fields of banking, finance, etc., the lack of correlation between log information, resulting in low error search efficiency. The existing link tracking components need to make underlying modifications to the log system, resulting in development and adaptation work. Large quantity and high cost.

Method used

Bytecode stake method is used to synchronize link information in the original log system to realize link tracking function, avoid system underlying modification, and realize link log generation through node scanning components, link delivery components and bytecode stake components , supports the correspondence between link information and log information.

Benefits of technology

Without modifying the existing system, the link log function is implemented, which reduces the development and operation and maintenance workload, improves the online efficiency, reduces costs, and supports mutual positioning and searching between log information and link information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112181909B_ABST
    Figure CN112181909B_ABST
Patent Text Reader

Abstract

The present invention relates to a link log generation method and system. By utilizing a bytecode plugging method, link information is synchronously added in the existing process of generating log information while keeping the original log system unchanged at the bottom layer. This can greatly reduce the development and operation and maintenance workload required when the existing log system is switched and upgraded to a link log, improve the online efficiency, reduce the application cost, realize the addition of a link tracking function to the existing log component, and avoid the tedious work of large-scale modification of the system bottom layer and re-adaptation of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of log information systems, and in particular to a link log generation method and system. Background Art

[0002] At present, as information systems increasingly adopt distributed models, the number of system nodes increases and the complexity of functions increases significantly. Especially in the fields of banking and finance, as a single transaction involves more nodes and the function chain becomes longer, it becomes increasingly difficult for developers and operation and maintenance personnel to find errors through system logs.

[0003] Existing business systems all have business components, but the structure is mostly distributed nodes. There is no correlation between the logs generated by each node, and it cannot support cross-node log search. For example, for a transfer transaction in the banking system, the system will intelligently select a funding channel (such as a large-value system, online banking interconnection system, UnionPay payment system, etc.). When a business problem occurs, it is necessary to first determine which funding channel (business system) the transaction passed through, and then find the transaction information from the log data of the corresponding system. The transaction process of complex business involves multiple system routing selections, and the efficiency of finding errors through system log information is very low.

[0004] An effective solution is to use a link tracking component, which can realize that the log information generated by each node forms a connection relationship based on the link; however, the application of link tracking components in the existing technology requires underlying modifications to the existing log system or even rewriting the entire log system, which requires a lot of development and adaptation work. In particular, the workload required for redevelopment of existing banking and financial log system services is extremely large, and the high replacement cost hinders the promotion of this method. Summary of the invention

[0005] In order to address the deficiencies of the prior art, the present invention proposes a link log generation method and system, which utilizes the bytecode insertion method to synchronously add link information in the existing log information generation process while keeping the original log system unchanged at the bottom layer, thereby realizing the addition of link tracking function to the existing log component and avoiding the tedious work of large-scale modification of the system bottom layer and re-adaptation of the system.

[0006] To achieve the above objectives, the technical solutions adopted by the present invention include:

[0007] A link log generation method, characterized by comprising:

[0008] Scan the node server to see if the specified class files in the specified directory have been changed;

[0009] Add link information to the specified class files that have been changed;

[0010] The specified class file with added link information is sent to the data server for registration and storage.

[0011] Furthermore, adding link information to the changed specified class file includes:

[0012] Scan the specified class file to see if link information has been added;

[0013] For the specified class files that have been added with link information, the added link information is used without modification;

[0014] For the specified class file that has no link information added, add new link information.

[0015] Further, the scanning node server determines whether a specified class file in a specified directory has been changed, including:

[0016] Start scanning the specified directory in the node server at a scheduled time and / or according to instructions;

[0017] Determine whether the specified class files in the specified directory have changed since the last scan;

[0018] No action is performed on the specified class files that have not been changed;

[0019] Generates an operation instruction for adding link information for the specified class file that has been changed.

[0020] Furthermore, the method further comprises:

[0021] The specified class file with added link information is converted into a message with added link information and sent to another node server.

[0022] Furthermore, the method further comprises:

[0023] Determine whether link information is added to the message received by the node server and / or the message to be sent;

[0024] For messages with added link information, the added link information is used without modification.

[0025] For the message without link information, add new link information.

[0026] Furthermore, the designated directory includes a business system installation directory.

[0027] Furthermore, the designated class files include log class files and message class files.

[0028] Furthermore, the adding of link information includes writing the link information by using bytecode stubs.

[0029] The present invention also relates to a link log generation system, characterized in that it comprises:

[0030] A node scanning component is used to scan whether a specified class file in a specified directory in a node server has been changed, and to generate an operation instruction to add link information for the specified class file that has been changed;

[0031] The link transmission component is used to determine whether the message received by the node server and / or the message to be sent has added link information, and generate an operation instruction to add link information for the message without adding link information;

[0032] The bytecode instrumentation component receives an operation instruction for adding link information and adds link information to the specified class files that have been changed and / or the messages to which link information has not been added according to the operation instruction.

[0033] The beneficial effects of the present invention are:

[0034] By adopting the link log generation method and system of the present invention, by applying bytecode plugging, link information can be added to the original node distributed log system without modifying the existing system, thereby realizing the link log function, which can greatly reduce the development and operation and maintenance workload required when the existing log system is switched and upgraded to the link log, improve the online efficiency and reduce the application cost; the generated link log is a complete log data with a complete correspondence between log information and link information, which can realize mutual positioning and search between log information and link information, especially can simply realize the unified search function of log information of multiple different nodes involved in a certain link through link information, which is greatly convenient for use; the application of the method and system of the present invention does not require modification of the code of the original business system, so it is particularly suitable for the transformation and use of existing stock systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 The figure is a flow chart of the link log generation method of the present invention.

[0036] Figure 2 This is a schematic diagram of the structure of the link log generation system of the present invention.

[0037] Figure 3 The present invention is a flowchart of an embodiment of applying the method of the present invention to perform log processing. DETAILED DESCRIPTION

[0038] In order to more clearly understand the content of the present invention, it will be described in detail with reference to the drawings and embodiments.

[0039] like Figure 1The flowchart of the link log generation method of the present invention is shown, which mainly includes the process of adding link information to the specified class files (especially the .class files of log class files and message class files) under the specified directory (especially the business system installation directory) on the node server and adding link information to the messages transmitted between the nodes. By applying this method, the link log function can be added to the existing business system without invading the source code of the stock system and maintaining the function of the log component. The specific operation steps include: scanning whether the specified class files under the specified directory in the node server have been changed, not performing operations for the specified class files that have not been changed, and generating operation instructions for adding link information for the specified class files that have been changed; scanning whether the specified class files with changes have been added with link information, for the specified class files that have been added with link information, the added link information is used without modification, and for the specified class files that have not been added with link information, the bytecode plugging technology is used to add new link information; sending the specified class files with added link information to the data server for registration and storage, including sending the original specified class files with added link information and the specified class files with added new link information. On the other hand, the method of the present invention can also add link information to the message transmitted between nodes to realize the link tracking function. The process mainly includes judging whether the message received by the node server and / or the message to be sent has added link information; for the message with added link information, the added link information is used without modification; for the message without added link information, the bytecode plugging technology is used to add new link information; and it also supports converting the class file with added link information into a message and sending it to other nodes. By using this method to add the link log function to the existing system, the complete function of node log fully corresponding to link information and link tracking between nodes is provided.

[0040] The present invention also relates to a Figure 2The link log generation system shown is composed of a node scanning component, a link transmission component and a bytecode plugging component connected to each other. The node scanning component is built on the node server, which is used to scan the node server regularly and / or according to the instruction, and generates an operation instruction for adding link information for the specified class file that generates the change and transmits it to the bytecode plugging component; the link transmission component connects the existing system communication module and identifies the message received and sent by the communication module, and generates an operation instruction for adding link information for the message that does not add link information in the incoming message and transmits it to the bytecode plugging component; the bytecode plugging component adds link information to the incoming message according to the received operation instruction for adding link information, and the preferred operation may include judging whether the message received by the communication module already contains link information (a unique transaction link code can be used), if so, this link information is used, otherwise a new link information is created; when the communication module sends a message to the outside, if the link information already exists, the link information is put into the message, otherwise a new link information is created and placed in the communication message. In order to realize that the link information corresponds to the log information of the original node server, the link information and the log information can be correspondingly registered and stored to determine the corresponding relationship between the two. The above system uses bytecode insertion to modify the original system and supplement link information. It is an external unit that is completely independent of the original system. There is no need to modify the original system during use. It is particularly suitable for upgrading existing systems.

[0041] like Figure 3 The figure shows a flow chart of an embodiment of applying the link log generation method of the present invention to add a link log query function to an existing transaction system, which includes the following steps:

[0042] S31. Along with the communication message of the transaction, the transaction link information (mainly the link number of the transaction, which is unique in the system and the same transaction uses the same link number, generated by the first node in the transaction link) is transmitted between the nodes related to the transaction; the link information is added to the message using the method described in the present invention to ensure that the messages between each node have the link information (unique link number), so that the message has the link tracking function.

[0043] S32. The transaction-related node registers and saves the link information related to the node.

[0044] S33. When a transaction-related node registers transaction log information, link information (a unique link number) is added to the log information, that is, link information is added to the log information class file through bytecode instrumentation to ensure that all log information has corresponding link information; the log information includes both the log information generated by the operation of this node and the log information generated by the message flowing through this node.

[0045] S34. The data collection process on the server collects log information and link information of each node, and sends the data to the data processing server.

[0046] S35. The data processing server processes the log information and link information, obtains the association information of the link and the log based on the transaction link encoding, and forms a complete mapping relationship between the log information and the link information.

[0047] S36. The system provides a query function that can query link information and further query the log information of each node on the link through the associated information of the link and the log, that is, the link query function of the log information in the entire system is realized, and specific transactions can be used as retrieval conditions, rather than being limited to searching log information within each node.

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

Claims

1. A link log generation method, characterized in that: include: Scan the node server to see if the specified class files in the specified directory have been changed; Add link information to the specified class files that have been changed; Send the specified class file with added link information to the data server for registration and storage. The specified class files include log class files and message class files, and the adding of link information includes writing link information by bytecode instrumentation. Among them, link information is added to the log information class file through bytecode instrumentation to ensure that all log information has corresponding link information; the log information includes both log information generated by node operations and log information generated by messages flowing through the nodes; the data collection process on the server collects the log information and link information of each node, and sends the data to the data processing server; the data processing server processes the log information and link information, obtains the correlation information of the link and the log based on the transaction link encoding, and forms a complete mapping relationship between the log information and the link information; queries the link information, and further queries the log information of each node on the link through the correlation information of the link and the log.

2. The method according to claim 1, characterized in that The adding link information to the changed specified class file includes: Scan the specified class file to see if link information has been added; For the specified class files that have been added with link information, the added link information is used without modification; For the specified class file that has no link information added, add new link information.

3. The method according to claim 1, characterized in that The scanning node server specifies whether the specified class file in the specified directory has been changed, including: Start scanning the specified directory in the node server at a scheduled time and / or according to instructions; Determine whether the specified class files in the specified directory have changed since the last scan; No action is performed on the specified class files that have not been changed; Generates an operation instruction for adding link information for the specified class file that has been changed.

4. The method according to claim 1, characterized in that The method further comprises: The specified class file with added link information is converted into a message with added link information and sent to another node server.

5. The method according to claim 4, characterized in that The method further comprises: Determine whether link information is added to the message received by the node server and / or the message to be sent; For messages with added link information, the added link information is used without modification. For the message without link information, add new link information.

6. The method according to any one of claims 1 to 5, characterized in that: The designated directory includes the business system installation directory.

7. A link log generation system, characterized in that: include: A node scanning component is used to scan whether a specified class file in a specified directory in a node server has been changed, and to generate an operation instruction to add link information for the specified class file that has been changed; The link transmission component is used to determine whether the message received by the node server and / or the message to be sent has added link information, and generate an operation instruction to add link information for the message without adding link information; The bytecode instrumentation component receives an operation instruction to add link information and adds link information to the specified class files that have been changed and / or the messages to which link information has not been added according to the operation instruction. The specified class files include log class files and message class files, and the adding of link information includes writing link information by bytecode instrumentation. Among them, link information is added to the log information class file through bytecode instrumentation to ensure that all log information has corresponding link information; the log information includes both log information generated by node operations and log information generated by messages flowing through the nodes; the data collection process on the server collects the log information and link information of each node, and sends the data to the data processing server; the data processing server processes the log information and link information, obtains the correlation information of the link and the log based on the transaction link encoding, and forms a complete mapping relationship between the log information and the link information; queries the link information, and further queries the log information of each node on the link through the correlation information of the link and the log.

Citation Information

Patent Citations

  • Service log generation method, device and device

    CN109104327A

  • Distributed system call relationship visualization method and device

    CN111008105A