Dynamic log series and business logic graphical analysis method and system

Through dynamic log concatenation and business logic graphical analysis methods, the shortcomings of existing technologies in log management and distributed tracking are solved, real-time and comprehensive business logic tracking and visual analysis are achieved, and the troubleshooting efficiency and system reliability are significantly improved. sex.

CN119357147APending Publication Date: 2025-01-24CHINA UNITECHS
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411358065.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

Existing log management and analysis tools are difficult to achieve real-time, efficient screening and in-depth analysis when processing huge and scattered log data, and distributed tracking technology is difficult to monitor multiple call links and cannot accurately describe the full picture of business logic.

Method used

Dynamic log concatenation and business logic graphical analysis methods are used to decompose complex business processes into logical nodes, use JSON format to describe nodes and their connection relationships, generate public IDs for log association, and use message queues and graph databases to build business logic links. Figure, and visually displayed through the front-end interactive interface.

Benefits of technology

Realized the comprehensive and efficient tracking of business logic, supporting the intuitive visualization of the business execution site, significantly improved the efficiency of fault investigation, reduced operation and maintenance costs, and improved the reliability and stability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119357147A_ABST
    Figure CN119357147A_ABST
Patent Text Reader

Abstract

The invention discloses a dynamic log series and business logic graphical analysis method and system, and the method comprises the steps: decomposing a complex business process into a series of logic nodes and a connection relation thereof, and assigning a subsequent node for each logic node; when a service request starts each time, a public ID is automatically generated, and the public ID is attached to all related logs and transmitted along with the service request; when each logic node records a log, the public ID and additional context information are added; collecting log data generated by each service by using a message queue, and converging and sorting the log data by taking the public ID as a key value; the collected original log data is converted into structured information, and the category and the state of the log are visually displayed through a color label. According to the method and the system, the real-time performance of data processing is ensured, the comprehensive and efficient tracking of service logic is realized, and the visual visualization of a service execution site is supported, so that the positioning and the solving of problems are accelerated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of log management and analysis, and in particular to a method and system for dynamic log concatenation and business logic graphical analysis. Background Art

[0002] With the rapid development of Internet products, the complexity of business logic has increased dramatically. Traditional log management tools such as ELK (Elasticsearch, Logstash, Kibana) are standard solutions for log management and analysis. However, as business logic deepens and system scale expands, they are increasingly unable to handle large and dispersed log data, especially in terms of real-time performance, efficient screening, and in-depth analysis. In addition, existing distributed tracing technologies, such as those based on Dapper and Zipkin, have provided basic session tracking capabilities for distributed systems, but they still face challenges in achieving comprehensive business logic tracing: it is difficult to monitor multiple call links simultaneously, it is impossible to accurately depict the entire picture of business logic, and there are deficiencies in focusing on the execution level of specific business logic. Summary of the Invention

[0003] To solve the above-mentioned problems existing in the prior art, the present invention provides a method and system for dynamic log concatenation and business logic graphical analysis, which, while ensuring the real-time performance of data processing, enables comprehensive and efficient tracking of business logic and supports intuitive visualization of business execution sites, thereby accelerating the location and resolution of problems.

[0004] To achieve the above object, the present invention adopts the following technical solutions:

[0005] In one embodiment of the present invention, a method for dynamic log concatenation and business logic graphical analysis is proposed, which includes:

[0006] Decompose complex business processes into a series of logical nodes and their connections. Each logical node includes a node ID, node type, description, input, output, and subsequent nodes. Use JSON format to statically describe these logical nodes and their connections to define a complete business logic chain.

[0007] At the start of each service request, a public ID is automatically generated and appended to all relevant logs, passing them along with the service request. Each logical node, in addition to the standard log content, also includes the public ID and additional contextual information when logging. A message queue or stream processing framework is used to collect log data generated by each service, using the public ID as a key to aggregate and sort the log data.

[0008] After preprocessing the collected raw log data, a business logic link diagram is constructed through a graph database. Each node represents each business logic operation or service call, and the edge represents the call relationship between nodes. The log data is associated with the nodes and edges through a public ID; different color labels on the nodes and edges are used to distinguish the category and status of the log for front-end display.

[0009] Furthermore, the following steps are used to preprocess the collected raw log data:

[0010] Clean the collected raw log data to remove useless information; extract key fields from the logs using regular expressions or custom parsing rules;

[0011] Unify the formats of logs from different sources to the same structural standard;

[0012] Assign log data to the corresponding business logic link based on the node ID and public ID in the log;

[0013] Define different color labels according to the status of the log.

[0014] Furthermore, the following steps are used to construct a business logic link diagram:

[0015] Create an empty graph model in the graph database to store node and edge information;

[0016] In a graph database, each business logic operation or service call is modeled as a node; the attribute information of each node comes from the JSON description in the log data;

[0017] Edges represent the call relationship between nodes and are allowed to carry attribute information, which is extracted from log data;

[0018] Read log files or consume log data from message queues, parse the log data, extract node and edge information, and store this information in the corresponding nodes and edges in the graph database;

[0019] Create or update nodes and edges in the graph database based on the node ID and call relationship recorded in the log data; if the node already exists, update its attribute information; if the node does not exist, create a new node; for edges, check whether they already exist, and if not, create a new edge;

[0020] In a graph database, records in log data are associated with nodes and edges through a common ID (trace_id).

[0021] Furthermore, the following steps are used for front-end display:

[0022] Nodes and edges in the graph database can be assigned different color labels; these color labels are implemented through graph database queries or during front-end rendering;

[0023] Develop an interactive interface using a front-end framework to visualize information in the graph database. The interactive interface dynamically loads and renders the business logic link diagram based on user queries or selections, providing an interactive experience.

[0024] When the user clicks an abnormal node, the log details of the node will be automatically expanded; in addition, filter conditions can be set to display only logs of specific types.

[0025] In one embodiment of the present invention, a dynamic log concatenation and business logic graphical analysis system is also proposed, which includes:

[0026] The business logic link abstraction module 101 is used to decompose complex business processes into a series of logical nodes and their connection relationships. Each logical node includes a node ID, node type, description, input, output, and subsequent nodes. These logical nodes and their connection relationships are statically described in JSON format to define a complete business logic link.

[0027] The dynamic log concatenation module 102 is used to automatically generate a public ID at the beginning of each service request, attach the public ID to all related logs, and transmit it along with the service request. When each logical node records a log, in addition to the standard log content, it also adds the public ID and additional context information. The log data generated by each service is collected using a message queue or stream processing framework, and the public ID is used as a key value to aggregate and sort the log data.

[0028] The visualization restoration module 103 is used to pre-process the collected original log data and then build a business logic link diagram through a graph database. Each node represents each business logic operation or service call, and the edge represents the call relationship between nodes. The log data is associated with the nodes and edges through a public ID; different color labels are used to distinguish the category and status of the log for front-end display.

[0029] Furthermore, the following steps are used to preprocess the collected raw log data:

[0030] Clean the collected raw log data to remove useless information; extract key fields from the logs using regular expressions or custom parsing rules;

[0031] Unify the formats of logs from different sources to the same structural standard;

[0032] Assign log data to the corresponding business logic link based on the node ID and public ID in the log;

[0033] Define different color labels according to the status of the log.

[0034] Furthermore, the following steps are used to construct a business logic link diagram:

[0035] Create an empty graph model in the graph database to store node and edge information;

[0036] In a graph database, each business logic operation or service call is modeled as a node; the attribute information of each node comes from the JSON description in the log data;

[0037] Edges represent the call relationship between nodes and are allowed to carry attribute information, which is extracted from log data;

[0038] Read log files or consume log data from message queues, parse the log data, extract node and edge information, and store this information in the corresponding nodes and edges in the graph database;

[0039] Create or update nodes and edges in the graph database based on the node ID and call relationship recorded in the log data; if the node already exists, update its attribute information; if the node does not exist, create a new node; for edges, check whether they already exist, and if not, create a new edge;

[0040] In a graph database, records in log data are associated with nodes and edges through a common ID (trace_id).

[0041] Furthermore, the following steps are used for front-end display:

[0042] Nodes and edges in the graph database can be assigned different color labels; these color labels are implemented through graph database queries or during front-end rendering;

[0043] Develop an interactive interface using a front-end framework to visualize information in the graph database. The interactive interface dynamically loads and renders the business logic link diagram based on user queries or selections, providing an interactive experience.

[0044] When the user clicks an abnormal node, the log details of the node will be automatically expanded; in addition, filter conditions can be set to display only logs of specific types.

[0045] In one embodiment of the present invention, a computer device is also proposed, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the aforementioned dynamic log concatenation and business logic graphical analysis method is implemented.

[0046] In one embodiment of the present invention, a computer-readable storage medium is further provided. The computer-readable storage medium stores a computer program for executing the dynamic log concatenation and business logic graphical analysis method.

[0047] Beneficial effects:

[0048] 1. Through business logic link abstraction and dynamic log concatenation technology, the present invention can quickly reconstruct the complete request execution path, shortening the problem location time from hours to minutes, greatly improving troubleshooting efficiency.

[0049] 2. This invention uses visual restoration technology to convert complex log data into an intuitive graphical interface, making the system operation status clear at a glance. This allows operation and maintenance personnel to monitor the system health in real time, quickly identify anomalies, and prevent potential problems in advance.

[0050] 3. The automated log correlation and visual analysis of the present invention greatly reduces the workload of manual analysis, and can improve the daily work efficiency of operation and maintenance personnel by more than 50%, thereby significantly reducing the operation and maintenance costs of the enterprise.

[0051] 4. The fine-grained business logic tracing capability of this invention provides a powerful tool for analyzing and optimizing complex business processes. This enables enterprises to gain a deeper understanding of business processes, identify optimization opportunities, and improve overall business efficiency.

[0052] 5. The comprehensive monitoring and rapid problem location capabilities of the present invention help reduce system failure time by more than 30%, significantly improving the reliability and stability of the entire system, thereby ensuring business continuity and user satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 This is a diagram of the dynamic log concatenation and business logic graphical analysis architecture of the present invention;

[0054] Figure 2 This is a flow chart of the dynamic log concatenation and business logic graphical analysis method of the present invention;

[0055] Figure 3 This is a structural diagram of the dynamic log concatenation and business logic graphical analysis system of the present invention;

[0056] Figure 4 It is a schematic diagram of the computer device structure of the present invention. DETAILED DESCRIPTION

[0057] The principles and spirit of the present invention will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided solely to enable those skilled in the art to better understand and implement the present invention, and are not intended to limit the scope of the present invention in any way. Rather, these embodiments are provided to make this disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.

[0058] Those skilled in the art will appreciate that embodiments of the present invention may be implemented as a system, device, method, or computer program product. Therefore, the present disclosure may be implemented in the following forms: entirely in hardware, entirely in software (including firmware, resident software, microcode, etc.), or in a combination of hardware and software.

[0059] According to an embodiment of the present invention, a dynamic log concatenation and business logic graphical analysis method is proposed. While ensuring the real-time performance of data processing, it realizes comprehensive and efficient tracking of business logic and supports intuitive visualization of business execution sites, thereby accelerating the location and resolution of problems.

[0060] The principles and spirit of the present invention are explained in detail below with reference to several representative embodiments of the present invention.

[0061] The dynamic log concatenation and business logic graphical analysis method proposed in this invention is as follows: Figure 1 and 2 As shown, the method includes:

[0062] 1. Business logic chain abstraction technology decomposes complex business processes into a series of logical nodes. Each logical node includes a node ID, node type, description, input, output, and subsequent node information. The system uses JSON format to statically describe these nodes and their connections, defining a complete business logic chain. For example, the order processing process on an e-commerce platform may include nodes such as "browse product," "add to cart," and "create order." Each node explicitly specifies its possible subsequent nodes using JSON, thereby constructing a complete business process structure. This approach makes business processes structured and easy to analyze.

[0063] 2. Dynamic log concatenation technology generates a globally unique identifier (public ID), embeds it in the log, and passes it along with the request to ensure the association and reorganization of cross-service logs. Each time a business request begins, the system generates a public ID. This public ID runs through the entire request life cycle and will be recorded in all relevant logs regardless of how many services or links the request passes through. When each node records a log, in addition to the standard content, it also contains the public ID as well as contextual information such as timestamp and node name, so that each log can determine its position and context in the request link. Log data is collected through a message queue or stream processing framework, and is aggregated and sorted using the public ID. Even if the data is stored in a dispersed manner, a complete call link view can be reconstructed.

[0064] 3. Visual restoration technology converts log data into structured information, and uses color labels to intuitively display the category and status of the log. The data preprocessing stage includes cleaning, parsing, and standardization, extracting key fields and unifying the format to facilitate subsequent processing. Graph databases (such as Neo4j) are used to build business logic link graphs, where each node represents a logical operation or service call, and edges represent the call relationship between nodes. Through the graph database, the system can dynamically build a business logic link graph, adjust color labels in real time, reflect the latest status, and facilitate troubleshooting and problem location. Front-end rendering uses frameworks such as React or Vue.js to implement an interactive interface, which is convenient for viewing and understanding business logic link graphs. Performance optimization measures include virtual scrolling, block loading, and caching strategies to improve data retrieval and processing speed.

[0065] It should be noted that although the operations of the method of the present invention are described in a specific order in the above embodiments and drawings, this does not require or imply that these operations must be performed in this specific order, or that all illustrated operations must be performed to achieve the desired results. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0066] In order to explain the above-mentioned dynamic log concatenation and business logic graphical analysis method more clearly, a specific embodiment is used for illustration below. However, it should be noted that this embodiment is only for better illustrating the present invention and does not constitute an improper limitation to the present invention.

[0067] Example:

[0068] The present invention is achieved through three core technical innovations, and the specific implementation methods are as follows:

[0069] 1. Business Logic Link Abstraction

[0070] Business logic link abstraction is achieved by decomposing complex business processes into a series of logical nodes and the connections between them. This helps build a clear, easy-to-understand and easy-to-analyze structure. The specific implementation steps are as follows:

[0071] 1. Define logical nodes: First, identify key operations or events in the business process and define them as logical nodes. Each logical node represents a business processing unit and has the following attributes:

[0072] (1) Node ID: A unique identifier used to reference the node in a link. For example, browse_product represents product browsing and add_to_cart represents adding to a shopping cart.

[0073] (2) Node type: describes the properties of the node, such as data retrieval, data update, etc.

[0074] (3) Description: Describe the node function.

[0075] (4) Input: Identify the input data required by the node (such as user preferences, product ID).

[0076] (5) Output: Specify the node output results (such as product list information, operation success flag).

[0077] (6) Subsequent nodes: Indicates the node relationship after this node, for example, after browsing a product, it may enter the shopping cart or continue browsing.

[0078] The following uses the order processing process of an e-commerce platform as an example to explain how to define logical nodes:

[0079] Product browsing node:

[0080] Node ID: browse_product.

[0081] Node Type: Data Retrieval.

[0082] Description: Displays a list of products based on user requests. (Optional)

[0083] Input: User preferences, search keywords. (Optional)

[0084] Output: Product list information. (Optional)

[0085] Subsequent nodes: Users can select items to add to the shopping cart or continue browsing.

[0086] Add to cart node:

[0087] Node ID: add_to_cart.

[0088] Node type: Data Update.

[0089] Description: Adds the user-selected items to the shopping cart.

[0090] Input: Product ID, Quantity.

[0091] Output: Operation success / failure flag.

[0092] Subsequent nodes: If successful, you can continue browsing or proceed directly to settlement; if failed, an error message will be prompted.

[0093] 2. Define business logic links: In order to make the business process structured and programmable, use JSON format data to statically describe the business logic link. JSON format data allows complex logical relationships to be expressed in a concise and easy-to-understand way, and specifies subsequent nodes for each logical node. The following is a typical shopping process that may involve multiple steps such as product browsing, adding to the shopping cart, order creation, and payment. Each step can be regarded as a logical node. For example, the "browse product" node may include sub-operations such as the user clicking on the product details page and loading product information, while the "order creation" node involves verifying inventory, calculating prices, generating order records, etc. These logical nodes and their relationships are written in JSON, such as:

[0094]

[0095]

[0096] In this example, after the "browse_product" node is completed, the next process node may be "add_to_cart" where the product is added to the shopping cart, or "create_order" where an order is created. After the order is created, there may be a payment process or a failure notification.

[0097] 2. Dynamic Log Concatenation

[0098] Dynamic log concatenation is used to track and correlate log records across multiple services or components in a distributed system, ensuring that the execution path of a business request can be fully reconstructed from beginning to end. This is achieved through the following steps:

[0099] 1. Public ID Generation and Transmittal: First, whenever a new business request begins, the system automatically generates a globally unique identifier, typically a UUID (Universally Unique Identifier). This identifier, called a public ID (such as trace_id), is appended to all relevant logs and transmitted along with the request throughout its lifecycle, regardless of how many services or processing steps the request passes through. This ensures that even in a highly distributed environment, dispersed log records can be linked through this public ID. For example, in an e-commerce system, when a user clicks "Buy Now," the system generates a trace_id (such as 123e4567-e89b-12d3-a456-426614174000) for this purchase request. This public ID is recorded in all logs from browsing a product, adding it to a shopping cart, creating an order, to payment.

[0100] 2. Logging Enhancement: Secondly, to facilitate subsequent analysis and correlation of logs, each logical node (such as a service or function) will include this public ID and additional contextual information, such as timestamp and node name, in addition to the standard log content when logging. This way, each log entry contains enough information to determine its location and context in the request chain. A sample log entry might look like this:

[0101] {

[0102] "timestamp":"2023-04-01T14:30:00Z",

[0103] "trace_id":"123e4567-e89b-12d3-a456-426614174000",

[0104] "node_id":"create_order",

[0105] "status":"success",

[0106] "message":"Order created successfully"

[0107] }

[0108] 3. Dynamic Aggregation: Finally, message queues (such as Apache Kafka) are used to collect log data generated by various services. Technologies that use message queues to collect log data from various services, such as Apache Kafka, RabbitMQ, Amazon Simple Notification Service (SNS), and Simple Queue Service (SQS), can efficiently process large-scale real-time data streams and aggregate and sort logs using a common ID as a key. This allows log data to be reorganized in the correct order based on the trace_id, even if stored across different nodes, to form a complete view of the call chain. Suppose, in the e-commerce system described above, a user's purchase triggers multiple service calls, each of which generates log records with the same trace_id. These records are collected in a message queue and then aggregated by trace_id by the processing engine, ultimately reconstructing the entire chain from product browsing to payment completion.

[0109] In summary, the dynamic log concatenation mechanism embeds public IDs in logs and leverages modern data processing technology to effectively correlate and reorganize cross-service logs, greatly improving the efficiency of problem location and troubleshooting in complex distributed systems.

[0110] 3. Visual Restoration

[0111] Visual restoration technology converts raw log data into structured information and uses color labels to visually display log categories and status, helping to quickly locate and resolve issues. This process involves several key steps: data preprocessing, link building, and color labeling.

[0112] 1. Data preprocessing

[0113] (1) Cleaning and parsing: First, the collected raw log data is cleaned to remove invalid characters, blank lines, and other useless information to ensure data quality. Then, key fields of the log, such as timestamp, node ID, status information, and public ID (trace_id), are extracted through regular expressions or custom parsing rules.

[0114] (2) Standardization: Next, unify the formats of logs from different sources to ensure that all log data follows the same structural standards. This includes standardizing the time format and mapping error codes to a unified error code library to facilitate subsequent processing and querying.

[0115] (3) Logical Link Classification: Finally, log records are assigned to corresponding business logic links based on the node ID and trace_id in the log. This step is achieved by comparing the trace_id in the log with the pre-defined business logic link graph.

[0116] (4) Coloring rule definition: Define different color labels based on the log status (such as success, warning, error). For example, successful operations are marked green, warnings are yellow, and errors or exceptions are red. Coloring rules can be configured to meet the needs of different business scenarios.

[0117] 2. Link Construction

[0118] (1) Initialize the graph database: First, we need to create an empty graph model in a graph database (such as Neo4j) to prepare for storing node and edge information. This involves setting up a database connection and creating necessary indexes and constraints to optimize query performance.

[0119] (2) Node modeling: In a graph database, each business logic operation or service call is modeled as a node. For example, "Browse Product," "Add to Cart," and "Create Order" are all examples of nodes. Each node has attributes such as node ID, type, input and output parameters, and execution results. This information is derived from the JSON description in the log data.

[0120] (3) Edge modeling: Edges represent the call relationship between nodes, that is, how one node triggers the execution of another node. In a graph database, edges can carry attributes such as the number of calls and average response time, which can be extracted from log data.

[0121] (4) Importing log data: Importing information from log data into the graph database. This includes reading log files or consuming log data from message queues, parsing the log data, extracting relevant information about nodes and edges, and storing this information in the corresponding nodes and edges in the graph database.

[0122] (5) Create nodes and edges: Create or update nodes and edges in the graph database based on the node IDs and call relationships recorded in the log data. If the node already exists, its properties are updated; if the node does not exist, a new node is created. For edges, check whether they already exist; if not, a new edge is created.

[0123] (6) Associated Public ID: In the graph database, log records are associated with nodes and edges through public IDs (trace_id). This ensures that all log records related to a specific request are correctly linked together in the graph, making it possible to trace the execution path of the entire business request.

[0124] 3. Front-end display

[0125] (1) Dynamic coloring: To visually display the categories and status of logs, nodes and edges in the graph database can be assigned different colors. For example, successfully executed nodes can be green, nodes in warning status can be yellow, and failed or abnormal nodes can be red. These color labels can be implemented through graph database queries or during front-end rendering to facilitate quick identification of problem areas.

[0126] (2) Front-end rendering: Develop an interactive interface using a front-end framework (such as React or Vue.js) to visualize the information in the graph database. The interactive interface can dynamically load and render the business logic link diagram based on the user's query or selection, providing an interactive experience that allows users to deeply explore and analyze problems in the business process.

[0127] (3) Interactive function: Users can click on an abnormal node, and the system will automatically expand the log details of that node, including the error code, stack trace, etc., to help quickly identify the root cause of the problem. In addition, you can set filtering conditions to only display logs of a specific type (such as errors or warnings).

[0128] Through the above embodiments, the present invention not only solves the inefficiency problem of traditional log management solutions, but also overcomes the shortcomings of distributed tracing in business logic tracing, realizes real-time log processing, full-link visual tracing and efficient problem location capabilities, and brings revolutionary improvements to operation and maintenance and troubleshooting in complex business environments.

[0129] Based on the same inventive concept, the present invention also proposes a dynamic log concatenation and business logic graphical analysis system. The implementation of this system can refer to the implementation of the above method, and the repeated parts will not be repeated. The term "module" used below can be a combination of software and / or hardware that implements a predetermined function. Although the system described in the following embodiments is preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and conceivable.

[0130] Figure 3 This is a diagram of the dynamic log concatenation and business logic graphical analysis system architecture of an embodiment of the present invention. Figure 3 As shown, the system includes:

[0131] The business logic link abstraction module 101 is used to decompose complex business processes into a series of logical nodes and their connection relationships. Each logical node contains a node ID, node type, description, input, output, and subsequent nodes; these logical nodes and their connection relationships are statically described in JSON format to define a complete business logic link.

[0132] The dynamic log concatenation module 102 is used to automatically generate a public ID at the beginning of each business request, attach the public ID to all related logs and transmit it along with the business request; when each logical node records the log, in addition to the standard log content, it will also add the public ID and additional context information; use the message queue or stream processing framework to collect the log data generated by each service, and use the public ID as the key value to aggregate and sort the log data.

[0133] The visualization restoration module 103 is used to pre-process the collected original log data and then build a business logic link diagram through a graph database. Each node represents each business logic operation or service call, and the edge represents the call relationship between nodes. The log data is associated with the nodes and edges through a public ID; different color labels are used to distinguish the category and status of the log for front-end display.

[0134] The following steps are used to preprocess the collected raw log data:

[0135] Clean the collected raw log data to remove useless information; extract key fields from the logs using regular expressions or custom parsing rules;

[0136] Unify the formats of logs from different sources to the same structural standard;

[0137] Assign log data to the corresponding business logic link based on the node ID and public ID in the log;

[0138] Define different color labels according to the status of the log.

[0139] Use the following steps to build a business logic link diagram:

[0140] Create an empty graph model in the graph database to store node and edge information;

[0141] In a graph database, each business logic operation or service call is modeled as a node; the attribute information of each node comes from the JSON description in the log data;

[0142] Edges represent the call relationship between nodes and are allowed to carry attribute information, which is extracted from log data;

[0143] Read log files or consume log data from message queues, parse the log data, extract node and edge information, and store this information in the corresponding nodes and edges in the graph database;

[0144] Create or update nodes and edges in the graph database based on the node ID and call relationship recorded in the log data; if the node already exists, update its attribute information; if the node does not exist, create a new node; for edges, check whether they already exist, and if not, create a new edge;

[0145] In a graph database, records in log data are associated with nodes and edges through a common ID (trace_id).

[0146] Use the following steps to display the front end;

[0147] Nodes and edges in the graph database can be assigned different color labels; these color labels are implemented through graph database queries or during front-end rendering;

[0148] Develop an interactive interface using a front-end framework to visualize information in the graph database. The interactive interface dynamically loads and renders the business logic link diagram based on user queries or selections, providing an interactive experience.

[0149] When the user clicks an abnormal node, the log details of the node will be automatically expanded; in addition, filter conditions can be set to display only logs of specific types.

[0150] It should be noted that while the detailed description above mentions several modules of the dynamic log concatenation and business logic graphical analysis system, this division is merely exemplary and not mandatory. In practice, depending on the embodiments of the present invention, the features and functions of two or more modules described above can be embodied in a single module. Conversely, the features and functions of a single module described above can be further divided and embodied by multiple modules.

[0151] Based on the above invention concept, Figure 4 As shown, the present invention also proposes a computer device 200, including a memory 210, a processor 220 and a computer program 230 stored in the memory 210 and executable on the processor 220. When the processor 220 executes the computer program 230, the aforementioned dynamic log concatenation and business logic graphical analysis method is implemented.

[0152] Based on the aforementioned inventive concept, the present invention further proposes a computer-readable storage medium, which stores a computer program for executing the aforementioned dynamic log concatenation and business logic graphical analysis method.

[0153] The dynamic log concatenation and business logic graphical analysis method and system proposed in this invention have the following highlights:

[0154] 1. Significantly improve problem location and troubleshooting efficiency: Through business logic link abstraction and dynamic log concatenation technology, the system can quickly reconstruct the complete request execution path, reducing problem location time from hours to minutes, significantly improving troubleshooting efficiency.

[0155] 2. Greatly Enhanced System Observability: Visual restoration technology converts complex log data into an intuitive graphical interface, making system operation status clear at a glance. This enables operations and maintenance personnel to monitor system health in real time, quickly identify anomalies, and prevent potential problems in advance.

[0156] 3. Significantly reduce operation and maintenance costs: Automated log correlation and visual analysis significantly reduce the workload of manual analysis, and can improve the daily work efficiency of operation and maintenance personnel by more than 50%, thereby significantly reducing the operation and maintenance costs of the enterprise.

[0157] 4. Effective support for complex business analysis: Fine-grained business logic tracing capabilities provide a powerful tool for analyzing and optimizing complex business processes. This enables enterprises to gain a deeper understanding of business processes, identify optimization opportunities, and improve overall business efficiency.

[0158] 5. Significantly improve system reliability: Comprehensive monitoring and rapid problem location capabilities help reduce system downtime by more than 30%, significantly improving the reliability and stability of the entire system, thereby ensuring business continuity and user satisfaction.

[0159] Although the spirit and principles of the present invention have been described with reference to several specific embodiments, it should be understood that the present invention is not limited to the specific embodiments disclosed, and the division into various aspects does not mean that the features of these aspects cannot be combined to benefit. Such division is only for the convenience of expression. The present invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

[0160] Regarding the limitation of the protection scope of the present invention, those skilled in the art should understand that, based on the technical solution of the present invention, various modifications or variations that can be made by those skilled in the art without creative work are still within the protection scope of the present invention.

Claims

1. A method for dynamic log concatenation and business logic graphical analysis, characterized in that: The method includes: Decompose complex business processes into a series of logical nodes and their connection relationships. Each logical node contains node ID, node type, description, input, output and subsequent nodes. Use JSON format to statically describe these logical nodes and their connection relationships to define a complete business logic link. When each service request starts, a public ID is automatically generated, which is attached to all relevant logs and passed along with the service request. When each logical node records a log, in addition to the standard log content, the public ID and additional context information are also added. The message queue or stream processing framework is used to collect the log data generated by each service, and the public ID is used as the key value to aggregate and sort the log data. After preprocessing the collected raw log data, a business logic link diagram is constructed through the graph database. Each node represents each business logic operation or service call, and the edge represents the call relationship between nodes. The log data is associated with the nodes and edges through the public ID; the different color labels of the nodes and edges are used to distinguish the category and status of the log for front-end display.

2. The method for dynamic log concatenation and business logic graphical analysis according to claim 1 is characterized in that: The following steps are used to preprocess the collected raw log data: Clean the collected raw log data to remove useless information; extract key fields of the logs through regular expressions or custom parsing rules; Unify the formats of logs from different sources to the same structural standard; According to the node ID and public ID in the log, the log data is assigned to the corresponding business logic link; Define different color labels according to the status of the log.

3. The method for dynamic log concatenation and business logic graphical analysis according to claim 1 is characterized in that: Use the following steps to build a business logic link diagram: Create an empty graph model in the graph database to store node and edge information; In a graph database, each business logic operation or service call is modeled as a node; the attribute information of each node comes from the JSON description in the log data; Edges represent the calling relationship between nodes, and edges are allowed to carry attribute information, which is extracted from log data; Read log files or consume log data from message queues, parse log data, extract relevant information about nodes and edges, and store this information in the corresponding nodes and edges in the graph database; Create or update nodes and edges in the graph database based on the node ID and call relationship recorded in the log data; if the node already exists, update its attribute information; If the node does not exist, create a new node; for the edge, check whether it already exists, if not, create a new edge; In a graph database, records in log data are associated with nodes and edges through a common ID (trace_id).

4. The method for dynamic log concatenation and business logic graphical analysis according to claim 1 is characterized in that: Use the following steps to display the front end; Nodes and edges in the graph database can be assigned different color labels; these color labels are implemented through graph database queries or during front-end rendering; Use the front-end framework to develop an interactive interface to visualize the information in the graph database; The interactive interface dynamically loads and renders the business logic link diagram based on the user's query or selection, providing an interactive experience; When the user clicks on an abnormal node, the log details of the node are automatically expanded; Additionally, it allows you to set filter conditions to only display logs of a specific type.

5. A dynamic log concatenation and business logic graphical analysis system, characterized in that: The system includes: The business logic link abstraction module is used to decompose complex business processes into a series of logical nodes and their connection relationships. Each logical node contains node ID, node type, description, input, output and subsequent nodes. These logical nodes and their connection relationships are statically described in JSON format to define a complete business logic link. The dynamic log concatenation module is used to automatically generate a public ID at the beginning of each business request, attach the public ID to all related logs and pass it along with the business request; when each logical node records a log, in addition to the standard log content, it will also add the public ID and additional context information; use the message queue or stream processing framework to collect the log data generated by each service, and use the public ID as the key value to aggregate and sort the log data; The visualization restoration module is used to pre-process the collected raw log data and then build a business logic link diagram through the graph database. Each node represents each business logic operation or service call, and the edge represents the call relationship between nodes. The log data is associated with the nodes and edges through the public ID; the different color labels of the nodes and edges are used to distinguish the category and status of the log for front-end display.

6. The dynamic log concatenation and business logic graphical analysis system according to claim 5 is characterized in that: The following steps are used to preprocess the collected raw log data: Clean the collected raw log data to remove useless information; extract key fields of the logs through regular expressions or custom parsing rules; Unify the formats of logs from different sources to the same structural standard; According to the node ID and public ID in the log, the log data is assigned to the corresponding business logic link; Define different color labels according to the status of the log.

7. The dynamic log concatenation and business logic graphical analysis system according to claim 5 is characterized in that: Use the following steps to build a business logic link diagram: Create an empty graph model in the graph database to store node and edge information; In a graph database, each business logic operation or service call is modeled as a node; the attribute information of each node comes from the JSON description in the log data; Edges represent the calling relationship between nodes, and edges are allowed to carry attribute information, which is extracted from log data; Read log files or consume log data from message queues, parse log data, extract relevant information about nodes and edges, and store this information in the corresponding nodes and edges in the graph database; Create or update nodes and edges in the graph database based on the node ID and call relationship recorded in the log data; if the node already exists, update its attribute information; If the node does not exist, create a new node; for the edge, check whether it already exists, if not, create a new edge; In a graph database, records in log data are associated with nodes and edges through a common ID (trace_id).

8. The dynamic log concatenation and business logic graphical analysis system according to claim 5 is characterized in that: Use the following steps to display the front end; Nodes and edges in the graph database can be assigned different color labels; these color labels are implemented through graph database queries or during front-end rendering; Use the front-end framework to develop an interactive interface to visualize the information in the graph database; The interactive interface dynamically loads and renders the business logic link diagram based on the user's query or selection, providing an interactive experience; When the user clicks on an abnormal node, the log details of the node are automatically expanded; Additionally, it allows you to set filter conditions to only display logs of a specific type.

9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 4 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program for executing the method according to any one of claims 1 to 4.

Citation Information

Cited By

  • Distribution automation operation and maintenance work log intelligent recording platform based on CS architecture

    CN119692728A

  • Block log presentation method

    CN120407348A