Running log acquisition method, computer program product and computer equipment
By introducing log header data into the run log and recording key information, the location difficulties caused by independent logging in the software system are solved, and rapid positioning is achieved and problem analysis efficiency is improved.
Patent Information
- Application Number
- CN202410962219.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-11-08
AI Technical Summary
In the prior art, the operation logging of the software system is independent, which makes it difficult to locate all related business processing related operation logging records in a short time when problems arise, and takes a lot of time to analyze the problem location.
A method for obtaining the operation log is proposed. By introducing log header data in the log, recording the unique identification information of the pre-service flow, the unique identification information of the current service flow, and the unique identification information of the current service processing module in time, quickly locate the relevant Logs, including steps to import logs, preprocessing, analyzing request processing, and rendering partial run logs.
Through the newly added log header data, all logs related to a certain business can be quickly located, significantly reducing the location time and improving the efficiency of problem analysis.
Smart Images

Figure CN118916253A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular to a method for obtaining an operation log, a computer program product and a computer device. Background Art
[0002] In the related technology, each large software system is composed of multiple relatively small software systems (also called components), which communicate through various means; within each small software system, the business processing flow is also complex, and each business data must be processed by many program functions to finally complete the pre-defined processing of the corresponding function, and pass the data processed by the current business process to the next business flow for processing.
[0003] When a problem occurs in a running business, it is necessary to analyze the entire business process, especially the business data of the involved links, to determine the link where the problem occurs, and to obtain the operation log.
[0004] However, since each system and component records its own operation logs independently, when it is necessary to locate and analyze the problems that occur, although there are many logs, it takes a lot of time to obtain the relevant logs, and it is impossible to locate all the operation log records related to a certain business process in a short time. Summary of the invention
[0005] In view of this, an embodiment of the present invention proposes a method for obtaining operation logs, a computer program product and a computer device to solve the following problems in the prior art: when it is necessary to locate and analyze a problem, although there are many logs, it takes a lot of time to obtain the relevant logs, and it is impossible to locate all operation log records related to a certain business process in a short time.
[0006] On the one hand, an embodiment of the present invention proposes a method for obtaining an operation log, comprising: obtaining all operation logs in response to a log import request, wherein the operation logs include: log content data and log header data, and the log header data at least includes: unique identification information of a preceding business flow that is adjacent in time, unique identification information of a current business flow, and unique identification information of a current business processing module; performing a preprocessing operation on the operation log to obtain the log content data and the log header data; receiving an analysis request for the operation log; obtaining a portion of the operation log corresponding to the analysis request from all the operation logs, and presenting the portion of the operation log.
[0007] In some embodiments, the log header data also includes: unique identification information of the processing function.
[0008] In some embodiments, after receiving the analysis request of the operation log, the method further includes: parsing the analysis request according to a predetermined parsing rule to obtain analysis requirement information, wherein the analysis requirement information includes at least: session unique identification information and operation time.
[0009] In some embodiments, obtaining a portion of the operation log corresponding to the analysis request from all the operation logs includes: obtaining an operation log corresponding to the session unique identification information from all the operation logs; and obtaining the portion of the operation log corresponding to the operation time from the operation log corresponding to the session unique identification information.
[0010] In some embodiments, after the preprocessing operation is performed on the operation log to obtain the log content data and the log header data, the method further includes: storing the log content data and the log header data corresponding to the operation log into a string array.
[0011] In some embodiments, presenting the partial operation log includes: displaying the partial operation log in a chronological order that is reverse to the time of processing the business flow.
[0012] In some embodiments, before obtaining all operation logs in response to the log import request, it also includes: constructing the log header data in the operation log; constructing the log content data after the log header data, wherein the log content data includes: system timestamp, session unique identification information, and log content.
[0013] In some embodiments, before obtaining all operation logs in response to the log import request, the method further includes: receiving the log import request on a predetermined request receiving interface, wherein the predetermined request receiving interface includes one of the following: a visual interactive interface or a command line input interface.
[0014] On the other hand, an embodiment of the present invention provides a computer program product storing a computer program, wherein the computer program implements the steps of the above method when executed by a processor.
[0015] On the other hand, an embodiment of the present invention provides a computer device, which includes at least a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the above method when executing the computer program in the memory.
[0016] The embodiment of the present invention specifies the format of the operation log. The operation log includes not only log content data but also log header data. The newly added log header data records at least the unique identification information of the previous preceding business flow, the unique identification information of the current business flow and the unique identification information of the current business processing module that are adjacent in time. Therefore, all logs related to a certain business can be quickly located through the newly added log header data. The positioning time is short, which improves the processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0018] Figure 1 A flowchart of a method for obtaining an operation log provided in the first embodiment of the present invention;
[0019] Figure 2 A schematic diagram of the structure of a device for obtaining operation logs provided in a second embodiment of the present invention;
[0020] Figure 3 A schematic diagram of the coupling relationship of the log analysis tool provided in the second embodiment of the present invention;
[0021] Figure 4 A schematic structural diagram of an electronic device provided in a fourth embodiment of the present invention. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solution and advantages of the embodiment of the present invention clearer, the technical solution of the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all of the embodiments. Based on the described embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0023] Unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0024] In order to keep the following description of the embodiments of the present invention clear and concise, detailed descriptions of well-known functions and well-known components are omitted.
[0025] In current general software development, although there are certain requirements for the format of operation logs, it has not been considered whether all relevant information can be quickly and efficiently sorted out according to the business processing flow when locating the problem later. Each software, component, etc. is performing independent log recording. The internal log records of each component are incomplete, and the interface records with other components are not clear. Although there are many logs at present, it is impossible to quickly determine all log records related to a certain business process, and thus it is impossible to quickly perform problem location analysis.
[0026] Based on the above considerations, the first embodiment of the present invention provides a method for obtaining a running log. The process of the method is as follows: Figure 1 As shown, steps S101 to S104 are included:
[0027] S101, in response to the log import request, obtain all operation logs, wherein the operation log includes: log content data and log header data, and the log header data includes at least: unique identification information of the preceding business flow adjacent in time (also can be called address information, and subsequent unique identification information is represented by ID), unique identification information of the current business flow, and unique identification information of the current business processing module.
[0028] In order to facilitate the subsequent rapid and clear understanding of problems in the data processing process, the log header data of the embodiment of the present invention needs to at least clearly identify the current business flow and the previous predecessor business flow that is adjacent in time, and the current business processing module also needs to be clearly identified, so that it can be quickly located when viewing the backtracking log.
[0029] In order to further increase the speed of finding log problems, the log header data may also include unique identification information of the processing function.
[0030] The operation log format of the embodiment of the present invention is designed to facilitate product problem analysis, so the focus is on describing the differences from existing conventional logs, and the content involved in general logs (such as the format and content of the log details part) is no longer described. The header data as the key point is described below. To facilitate administrators to directly view and analyze, the operation log format is in text format.
[0031] The operation log is divided into two parts: the operation log header data and the operation log content data. The operation log header data is designed specifically for the operation log. The operation log content data can refer to the conventional operation log definition or the general SYSLOG log definition, which will not be repeated here.
[0032] The log header data part of the operation log is designed for the operation log, so that all related logs can be sorted out according to the business flow in the future. The operation log header data can be in the following form: [previous business flow ID] + [current business flow ID] + [current business processing module ID] + [processing function ID].
[0033] Among them, the previous business flow ID identifies the previous business flow of the current process and who triggered the current business flow, and is used to perform log backtracking according to the log identifier in log analysis; the current business flow ID identifies the current business flow, that is, the business flow that is processing the log, and is used to sort out the log chain according to the business processing process before the previous business flow ID in log analysis, so as to facilitate the analysis of the log by timeline; the current business processing module ID identifies the module that currently processes the log, and is used to find all logs related to the module in a certain time period according to the module, so as to facilitate the comprehensive log analysis; the processing function ID identifies the function that currently processes the log, and is used to accurately locate the code, so as to facilitate the final problem analysis.
[0034] The above describes the log header data of the operation log. The following describes how to record the operation log, that is, before obtaining all the operation logs in response to the log import request, it is necessary to generate the operation log with header data according to the predetermined generation rules. When implementing, it is necessary to construct the log header data in the operation log, and construct the log content data after the log header data, wherein the log content data includes: system timestamp, session unique identification information, and log content.
[0035] After receiving the business processing request, the business processing module prepares to construct the operation log header data (also referred to as the log header), which includes: [previous business flow ID] + [current business flow ID] + [current business processing module ID] + [processing function ID]. After completing the construction of the log header, the log content data part is constructed. In the log content data, the current system timestamp will be saved. This system timestamp records the time when the log is generated; then the constructed log content data and the operation log header data are combined to form the final operation log. By calling the system's log recording component interface, the log is persisted. During implementation, the session ID field of this business flow will also be saved. The session ID identifies a triggered business flow, and the initial acquisition of the log is performed through the session ID later.
[0036] S102, performing preprocessing operations on the operation log to obtain log content data and log header data.
[0037] This process is to split a whole log generated according to a predetermined generation rule, so that the log header data can be directly used when an analysis request is received later.
[0038] After obtaining the log content data and the log header data, the log content data and the log header data corresponding to the running log are stored in a string array so that they can be used directly later.
[0039] S103: receiving an analysis request for the operation log.
[0040] The above analysis request can be received in a visual interactive interface or a command line input interface. Relatedly, the above log import request can also be received in a visual interactive interface or a command line input interface, and can be adaptively set according to actual needs.
[0041] After receiving the analysis request of the operation log, the analysis request is parsed according to a predetermined parsing rule to obtain analysis requirement information, wherein the analysis requirement information at least includes: session unique identification information and operation time.
[0042] S104, obtaining a portion of the operation logs corresponding to the analysis request from all the operation logs, and presenting the portion of the operation logs.
[0043] After obtaining the analysis requirement information, the analysis requirement information can be matched with the operation log after the preprocessing operation to obtain the required operation log. In implementation, the operation log corresponding to the session unique identification information is obtained from all operation logs, and then the partial operation log corresponding to the operation time is obtained from the operation log corresponding to the session unique identification information. Subsequently, in order to facilitate finding the problem, the partial operation log can be displayed in the reverse chronological order of the processing business flow time when presenting the partial operation log.
[0044] The embodiment of the present invention specifies the format of the operation log. The operation log includes not only log content data but also log header data. The newly added log header data records at least the unique identification information of the previous preceding business flow, the unique identification information of the current business flow and the unique identification information of the current business processing module that are adjacent in time. Therefore, all logs related to a certain business can be quickly located through the newly added log header data. The positioning time is short, which improves the processing efficiency.
[0045] The second embodiment of the present invention provides a device for obtaining a running log, the structure of which is shown in FIG. Figure 2 As shown, including:
[0046] The first acquisition module 10 is used to obtain all operation logs in response to a log import request, wherein the operation log includes: log content data and log header data, and the log header data at least includes: unique identification information of a preceding business flow that is adjacent in time, unique identification information of a current business flow, and unique identification information of a current business processing module; the preprocessing module 20 is coupled to the first acquisition module 10, and is used to perform preprocessing operations on the operation log to obtain log content data and log header data; the first receiving module 30 is coupled to the preprocessing module 20, and is used to receive an analysis request for the operation log; the second acquisition module 40 is coupled to the first receiving module 30, and is used to obtain a portion of the operation log corresponding to the analysis request in all the operation logs; the presentation module 50 is coupled to the second acquisition module 40, and is used to present a portion of the operation log.
[0047] In order to facilitate the subsequent rapid and clear understanding of problems in the data processing process, the log header data of the embodiment of the present invention needs to at least clearly identify the current business flow and the previous predecessor business flow that is adjacent in time, and the current business processing module also needs to be clearly identified, so that it can be quickly located when viewing the backtracking log.
[0048] In order to further increase the speed of finding log problems, the log header data may also include unique identification information of the processing function.
[0049] The operation log format of the embodiment of the present invention is designed to facilitate product problem analysis, so the focus is on describing the differences from existing conventional logs, and the content involved in general logs (such as the format and content of the log details part) is no longer described. The header data as the key point is described below. To facilitate administrators to directly view and analyze, the operation log format is in text format.
[0050] The operation log is divided into two parts: the operation log header data and the operation log content data. The operation log header data is designed specifically for the operation log. The operation log content data can refer to the conventional operation log definition or the general SYSLOG log definition, which will not be repeated here.
[0051] The log header data part of the operation log is designed for the operation log, so that all related logs can be sorted out according to the business flow in the future. The operation log header data can be in the following form: [previous business flow ID] + [current business flow ID] + [current business processing module ID] + [processing function ID].
[0052] Among them, the previous business flow ID identifies the previous business flow of the current process and who triggered the current business flow, and is used to perform log backtracking according to the log identifier in log analysis; the current business flow ID identifies the current business flow, that is, the business flow that is processing the log, and is used to sort out the log chain according to the business processing process before the previous business flow ID in log analysis, so as to facilitate the analysis of the log by timeline; the current business processing module ID identifies the module that currently processes the log, and is used to find all logs related to the module in a certain time period according to the module, so as to facilitate the comprehensive log analysis; the processing function ID identifies the function that currently processes the log, and is used to accurately locate the code, so as to facilitate the final problem analysis.
[0053] The above description of the log header data of the operation log is given above. The following is an introduction to how to record the operation log, that is, the above device also includes a construction module, which is used to generate an operation log with header data according to a predetermined generation rule. Specifically, it is used to construct the log header data in the operation log; and construct the log content data after the log header data, wherein the log content data includes: system timestamp, session unique identification information, and log content.
[0054] After receiving the business processing request, the business processing module prepares to construct the operation log header data, which includes: [previous business flow ID] + [current business flow ID] + [current business processing module ID] + [processing function ID]. After completing the construction of the log header, the log content data part is constructed. In the log content data, the current system timestamp will be saved. This system timestamp records the time when the log is generated; then the constructed log content data and the operation log header data are combined to form the final operation log. By calling the system's log recording component interface, the log is persisted. During implementation, the session ID field of this business flow will also be saved. The session ID identifies a triggered business flow, and the initial acquisition of the log is performed through the session ID later.
[0055] The preprocessing module is implemented by splitting a whole log generated according to a predetermined generation rule, so that the log header data can be directly used when an analysis request is received later.
[0056] The above device may further include a storage module. After obtaining the log content data and the log header data, the storage module is used to store the log content data and the log header data corresponding to the operation log in a string array for subsequent direct use.
[0057] For the analysis request, it can be received in a visual interactive interface or a command line input interface. Relatedly, for the above-mentioned log import request, it can also be received in a visual interactive interface or a command line input interface, then the embodiment of the present invention may further include a second receiving module, the second receiving module is used to receive the log import request in a predetermined request receiving interface, wherein the predetermined request receiving interface includes a visual interactive interface or a command line input interface, and can be adaptively set according to actual needs during specific implementation. The embodiment of the present invention also includes a parsing module, which is used to parse the analysis request according to predetermined parsing rules after receiving the analysis request of the operation log to obtain analysis requirement information, wherein the analysis requirement information includes at least: session unique identification information, running time.
[0058] After the analysis requirement information is obtained, the analysis requirement information can be matched with the operation log after the preprocessing operation to obtain the required operation log. In implementation, the first receiving module is specifically used to: obtain the operation log corresponding to the session unique identification information in all operation logs; obtain the partial operation log corresponding to the operation time in the operation log corresponding to the session unique identification information.
[0059] When presenting, in order to facilitate finding the problem, the presentation module is specifically used to: display part of the operation log in a chronological order opposite to the time of processing the business flow.
[0060] The embodiment of the present invention specifies the format of the operation log. The operation log includes not only log content data but also log header data. The newly added log header data records at least the unique identification information of the previous preceding business flow, the unique identification information of the current business flow and the unique identification information of the current business processing module that are adjacent in time. Therefore, all logs related to a certain business can be quickly located through the newly added log header data. The positioning time is short, which improves the processing efficiency.
[0061] The embodiments of the present invention can make up for the typical problems of current product operation log processing and improve the efficiency of product problem analysis. The above device is exemplarily described below in conjunction with a materialized log analysis tool. Since the log analysis tool provides an analysis function, the process of generating an operation log according to a predetermined generation rule before obtaining all operation logs in response to a log import request is not described in detail.
[0062] The log analysis tool of the embodiment of the present invention can provide users with a visual interactive capability in the form of a web page, or it can only provide a command line to quickly complete the problem backtracking through the command line and provide a complete problem tracing path. Regardless of the form, the tool mainly involves the following five functional units, and their coupling relationship is as follows: Figure 3 As shown: log import unit (implementing the function of the first acquisition module), log preprocessing unit (implementing the function of the preprocessing module), log backtracking analysis unit (implementing the function of the presentation module), log backtracking command parsing unit (implementing the functions of the first receiving module and the second acquisition module), log backtracking result presentation unit (implementing the function of the presentation module). The following is a functional introduction to each functional unit:
[0063] Log import unit: The product's operation log is saved in a unified text file format and imported into memory for analysis and processing through log analysis tools. Debugging work is temporary and does not require persistent storage. Therefore, the debugging tool does not need to rely on database components.
[0064] Log preprocessing unit: The operation log is saved in a text file. The different contents of each operation log are a string separated by "[]", and the string needs to be separated. For example: [pre-service flow ID][current service flow ID][current service processing module ID][processing function ID][2024-5-17:08-00-23][log details], the "[]" part needs to be parsed out and saved separately. Each operation log is saved in a string array after parsing and segmentation, and all operation logs are saved in a list in reverse order from new to old according to the generation time.
[0065] Log backtracking analysis unit: The log backtracking analysis unit implements the log backtracking function. It generates an actual reverse order list cache based on the log, and retrieves the logs with the same session ID by running a specific business in the [session ID] in the log details, and displays the retrieval results in reverse order of the logs.
[0066] Log backtracking command parsing unit: Users can directly trace back problems that occur in a certain business module through the command line. The supported command meanings can be described as "log backtracking the Nth / Nth to last error operation of a certain business", or "log backtracking the error operation of a certain business within a certain time period". The log backtracking command parsing module parses key information from the command line: "business name", "Nth" or "Nth to last" or "time range".
[0067] Log backtracking result display unit: presents the log backtracking results, and displays the logs in the reverse order of the business flow. The most direct cause is displayed first, and the logs that are most likely to cause problems are displayed.
[0068] The embodiment of the present invention defines the operation log format in a standardized manner, supports rapid backtracking analysis of the operation log through log header data, generates an actual reverse list cache according to the log, retrieves the log with the same session ID through the [session ID] in the operation log details, and displays the search results in reverse order of the logs.
[0069] The above log analysis tool achieves the following effects: it can quickly retrieve valuable log information from a large number of operation logs; it can provide an intuitive interface and display the operation logs related to the problem in reverse chronological order.
[0070] The third embodiment of the present disclosure provides a computer program product, which stores a computer program. When the computer program is executed by a processor, the method provided by any embodiment of the present disclosure is implemented, including the following steps S11 to S14:
[0071] S11, in response to the log import request, obtaining all operation logs, wherein the operation logs include: log content data and log header data, and the log header data includes at least: unique identification information of a preceding service flow adjacent in time, unique identification information of a current service flow, and unique identification information of a current service processing module;
[0072] S12, performing preprocessing operations on the operation log to obtain log content data and log header data;
[0073] S13, receiving an analysis request for the operation log;
[0074] S14, obtaining a portion of the operation logs corresponding to the analysis request from all the operation logs, and presenting the portion of the operation logs.
[0075] The above log header data may also include: unique identification information of the processing function.
[0076] After receiving the analysis request of the operation log, the computer program is executed by the processor, and the processor also executes the following steps: parsing the analysis request according to a predetermined parsing rule to obtain analysis requirement information, wherein the analysis requirement information at least includes: session unique identification information and operation time.
[0077] When the computer program is executed by the processor to obtain a portion of the operation log corresponding to the analysis request from all the operation logs, the processor specifically executes the following steps: obtaining the operation log corresponding to the session unique identification information from all the operation logs; obtaining a portion of the operation log corresponding to the operation time from the operation log corresponding to the session unique identification information.
[0078] After the computer program is executed by the processor to preprocess the operation log to obtain log content data and log header data, the processor also executes the following steps: storing the log content data and log header data corresponding to the operation log in a string array.
[0079] When the computer program is executed by the processor to present a partial operation log, the processor specifically executes the following steps: displaying the partial operation log in a time sequence that is reverse to the time of processing the business flow.
[0080] Before the computer program is executed by the processor to obtain all the operation logs in response to the log import request, the processor also executes the following steps: constructing log header data in the operation log; constructing log content data after the log header data, wherein the log content data includes: system timestamp, session unique identification information, and log content.
[0081] Before the computer program is executed by the processor to obtain all operation logs in response to the log import request, the processor also executes the following steps: receiving the log import request on a predetermined request receiving interface, wherein the predetermined request receiving interface includes one of the following: a visual interactive interface or a command line input interface.
[0082] The embodiment of the present invention specifies the format of the operation log. The operation log includes not only log content data but also log header data. The newly added log header data records at least the unique identification information of the previous preceding business flow, the unique identification information of the current business flow and the unique identification information of the current business processing module that are adjacent in time. Therefore, all logs related to a certain business can be quickly located through the newly added log header data. The positioning time is short, which improves the processing efficiency.
[0083] Optionally, in this embodiment, the above-mentioned storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk. Optionally, in this embodiment, the processor executes the method steps recorded in the above-mentioned embodiment according to the program code stored in the storage medium. Optionally, the specific examples in this embodiment can refer to the examples described in the above-mentioned embodiment and the optional implementation mode, and this embodiment will not be repeated here. Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present invention can be implemented with a general computing device, which can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices. Optionally, they can be implemented with executable program codes of computing devices, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that here, or they can be made into individual integrated circuit modules respectively, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the present invention is not limited to any specific combination of hardware and software.
[0084] A fourth embodiment of the present disclosure provides an electronic device. The structural diagram of the electronic device can be as follows: Figure 4 As shown, at least a memory 901 and a processor 902 are included, the memory 901 stores a computer program, and the processor 902 implements the method provided by any embodiment of the present disclosure when executing the computer program on the memory 901. Exemplarily, the steps of the electronic device computer program are as follows S21 to S24:
[0085] S21, in response to the log import request, obtaining all operation logs, wherein the operation logs include: log content data and log header data, and the log header data includes at least: unique identification information of a preceding service flow adjacent in time, unique identification information of a current service flow, and unique identification information of a current service processing module;
[0086] S22, performing a preprocessing operation on the operation log to obtain log content data and log header data;
[0087] S23 receives an analysis request for the operation log;
[0088] S24, obtaining a portion of the operation logs corresponding to the analysis request from all the operation logs, and presenting the portion of the operation logs.
[0089] The above log header data may also include: unique identification information of the processing function.
[0090] After executing the computer program stored in the memory for receiving an analysis request for the operation log, the processor further executes the following computer program: parsing the analysis request according to a predetermined parsing rule to obtain analysis requirement information, wherein the analysis requirement information includes at least: session unique identification information and operation time.
[0091] When the processor executes a computer program stored in the memory for obtaining a portion of the operation log corresponding to the analysis request from all the operation logs, the processor specifically executes the following computer program: obtaining the operation log corresponding to the session unique identification information from all the operation logs; obtaining the portion of the operation log corresponding to the operation time from the operation log corresponding to the session unique identification information.
[0092] After executing the computer program stored in the memory for preprocessing the operation log to obtain log content data and log header data, the processor also executes the following computer program: storing the log content data and log header data corresponding to the operation log in a string array.
[0093] When the processor executes the computer program for presenting a part of the operation log stored in the memory, the processor specifically executes the following computer program: displaying the part of the operation log in a time sequence that is reverse to the time of processing the business flow.
[0094] Before executing the computer program stored in the memory for obtaining all operation logs in response to a log import request, the processor also executes the following computer program: constructing log header data in the operation log; constructing log content data after the log header data, wherein the log content data includes: system timestamp, session unique identification information, and log content.
[0095] Before executing the computer program stored in the memory for obtaining all running logs in response to the log import request, the processor also executes the following computer program: receiving the log import request on a predetermined request receiving interface, wherein the predetermined request receiving interface includes one of the following: a visual interactive interface or a command line input interface.
[0096] The embodiment of the present invention specifies the format of the operation log. The operation log includes not only log content data but also log header data. The newly added log header data records at least the unique identification information of the previous preceding business flow, the unique identification information of the current business flow and the unique identification information of the current business processing module that are adjacent in time. Therefore, all logs related to a certain business can be quickly located through the newly added log header data. The positioning time is short, which improves the processing efficiency.
[0097] In addition, although exemplary embodiments have been described herein, the scope includes any and all embodiments based on the present invention with equivalent elements, modifications, omissions, combinations (e.g., various embodiments intersecting schemes), adaptations or changes. The elements in the claims will be interpreted broadly based on the language adopted in the claims, and are not limited to the examples described in this specification or during the implementation of this application, and the examples will be interpreted as non-exclusive. Therefore, this specification and examples are intended to be considered as examples only, and the true scope and spirit are indicated by the following claims and the full scope of their equivalents.
[0098] The above description is intended to be illustrative rather than restrictive. For example, the above examples (or one or more of them) can be used in combination with each other. For example, a person of ordinary skill in the art can use other embodiments when reading the above description. In addition, in the above-mentioned specific embodiments, various features can be grouped together to simplify the present invention. This should not be interpreted as an intention that a disclosed feature that is not required to be protected is necessary for any claim. On the contrary, the subject matter of the present invention may be less than all the features of a specific disclosed embodiment. Thus, the following claims are incorporated into the specific embodiments as examples or embodiments, wherein each claim is independently used as a separate embodiment, and it is considered that these embodiments can be combined with each other in various combinations or arrangements. The scope of the present invention should be determined with reference to the attached claims and the full scope of equivalent forms granted by these claims.
[0099] A number of embodiments of the present invention have been described in detail above, but the present invention is not limited to these specific embodiments. Those skilled in the art can make various variations and modifications to the embodiments based on the concept of the present invention, and these variations and modifications should all fall within the scope of protection claimed by the present invention.
Claims
1. A method for obtaining a running log, It is characterized in that include: Responding to the log import request, obtaining all operation logs, wherein the operation logs include: log content data and log header data, and the log header data includes at least: unique identification information of a preceding service flow adjacent in time, unique identification information of a current service flow, and unique identification information of a current service processing module; Performing a preprocessing operation on the operation log to obtain the log content data and the log header data; Receiving an analysis request for the operation log; A portion of the operation logs corresponding to the analysis request is obtained from all the operation logs, and the portion of the operation logs is presented.
2. The method according to claim 1, It is characterized in that The log header data also includes: processing function unique identification information.
3. The method according to claim 1, It is characterized in that After receiving the analysis request of the operation log, the method further includes: The analysis request is parsed according to a predetermined parsing rule to obtain analysis requirement information, wherein the analysis requirement information at least includes: session unique identification information and running time.
4. The method according to claim 3, It is characterized in that The obtaining of a portion of the operation logs corresponding to the analysis request from all the operation logs includes: Obtaining the operation log corresponding to the session unique identification information from all the operation logs; The part of the operation log corresponding to the operation time is obtained from the operation log corresponding to the session unique identification information.
5. The method according to claim 1, It is characterized in that After the preprocessing operation is performed on the operation log to obtain the log content data and the log header data, the method further includes: The log content data and the log header data corresponding to the operation log are stored in a string array.
6. The method according to claim 1, It is characterized in that The presenting of the partial operation log comprises: The partial operation log is displayed in a chronological order reverse to the time when the business flow is processed.
7. The method according to any one of claims 1 to 6, It is characterized in that Before obtaining all the operation logs in response to the log import request, the method further includes: The log header data is constructed in the operation log; and the log content data is constructed after the log header data, wherein the log content data includes: system timestamp, session unique identification information, and log content.
8. The method according to any one of claims 1 to 6, It is characterized in that Before obtaining all the operation logs in response to the log import request, the method further includes: A log import request is received on a predetermined request receiving interface, wherein the predetermined request receiving interface includes one of the following: a visual interactive interface or a command line input interface.
9. A computer program product storing a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
10. A computer device comprising at least a memory and a processor, wherein the memory stores a computer program. It is characterized in that The processor implements the steps of the method of any one of claims 1 to 8 when executing the computer program on the memory.
