Log information recording method, device, equipment, storage medium and program product
By creating a session corresponding to the startup operation in the application's session list and recording log information in the sub-sessions of business functions, the problem of low troubleshooting efficiency caused by the scattered logging of existing technologies is solved, and the effect of quickly finding log information is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- MAXEYE SMART TECH CO LTD
- Filing Date
- 2026-04-21
- Publication Date
- 2026-06-05
AI Technical Summary
In existing technologies, log information is recorded in a decentralized manner, resulting in low efficiency in troubleshooting.
Log information is recorded using a hierarchical structure of sessions and sub-sessions by creating sessions corresponding to the startup operation in the application's session list and logging information in sub-sessions of business functions.
It improves the efficiency of troubleshooting log information issues, enabling quick retrieval of log information for corresponding business functions, thus enhancing the efficiency of problem investigation.
Smart Images

Figure CN122152640A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a log information recording method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Technology
[0002] Log information refers to the execution status, business processes, and module operation-related data generated during the operation of an application. Log information can be used for troubleshooting during the development, testing, and maintenance of an application.
[0003] In existing technologies, most applications use a distributed logging method to record application log information. However, this logging method suffers from low efficiency when troubleshooting problems. Summary of the Invention
[0004] Therefore, it is necessary to provide a log information recording method, apparatus, computer equipment, computer-readable storage medium, and computer program product to address the above-mentioned technical problems, which can effectively improve the efficiency of problem investigation.
[0005] Firstly, this application provides a method for recording log information, including:
[0006] In response to a launch operation for a target application, a session corresponding to the launch operation is created in the target application's session list. The target application includes multiple business functions.
[0007] After the target application starts, in response to interactive operations for any of the multiple business functions, a sub-session corresponding to the business function is created in the session;
[0008] Execute business functions based on multiple functional modules of the target application, and record log information generated during the execution of the business functions in the corresponding sub-sessions; and
[0009] Log the termination of the session in response to an exit action against the target application.
[0010] In one embodiment, the method further includes: receiving a query instruction, the query instruction being used to obtain target log information to be queried, and the query instruction including a query time range; determining a target session whose creation time is within the query time range from a session list based on the query time range; and obtaining the target log information based on the target session.
[0011] In one embodiment, obtaining target log information based on a target session includes: in response to receiving a selection operation for any target session in the target session, determining the target sub-session corresponding to the selected target session; and obtaining target log information based on the target sub-session.
[0012] In one embodiment, obtaining target log information based on a target sub-session includes: in response to receiving a selection operation for any target sub-session in the target sub-session, obtaining log information recorded in the selected target sub-session; and determining target log information based on the log information.
[0013] In one embodiment, determining the target log information based on log information includes: grouping the log information according to multiple functional modules to obtain log information groups corresponding to each functional module; sorting the log information in each functional module group based on the timestamps of the log information in the log information group to obtain the log event timeline corresponding to each functional module; and determining the target log information based on the log event timeline corresponding to each functional module.
[0014] In one embodiment, logging information generated during the execution of a business function includes: triggering log recording at key nodes in the execution of the business function and recording the log information in the form of atomic events; wherein the log information includes timestamps, the functional module to which it belongs, the business function point, the execution status, and the business data.
[0015] Secondly, this application also provides a log information recording device, comprising:
[0016] The first execution module is used to respond to a startup operation for the target application by creating a session corresponding to the startup operation in the session list of the target application. The target application includes multiple business functions.
[0017] The second execution module is used to create a sub-session corresponding to the business function in the session in response to the interactive operation of any of the multiple business functions after the target application starts.
[0018] The third execution module is used to execute business functions based on multiple functional modules of the target application, and to record log information generated during the execution of the business functions in the sub-sessions corresponding to the business functions; and
[0019] The fourth execution module is used to end session logging in response to exit operations for the target application.
[0020] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, which, when executed by the processor, is used to implement the steps of the method according to any embodiment of the first aspect described above.
[0021] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is used to implement the steps of the method described according to any of the embodiments of the first aspect above.
[0022] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the steps of the method described according to any of the embodiments of the first aspect above.
[0023] The aforementioned log information recording method, apparatus, computer device, computer-readable storage medium, and computer program product, in response to a startup operation on a target application, create a session corresponding to the startup operation in the session list of the target application, where the target application includes multiple business functions; after the target application starts, in response to an interactive operation on any of the multiple business functions, create a sub-session corresponding to the business function in the session; then, execute the business function based on multiple functional modules of the target application, and record log information generated during the execution of the business function in the sub-session corresponding to the business function; finally, in response to an exit operation on the target application, end the log recording of the session. The log information recording method provided in this application, by recording the log information of each business function in the corresponding sub-session according to the session and sub-session hierarchy, enables quick retrieval of the log information of the corresponding business function during problem investigation, thereby effectively improving the efficiency of using log information for problem investigation. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort. In the drawings:
[0025] Figure 1 This is a flowchart illustrating a log information recording method in one embodiment;
[0026] Figure 2 This is a schematic diagram of a sub-session in one embodiment;
[0027] Figure 3This is a flowchart illustrating a method following the logging of a session at the end of one embodiment.
[0028] Figure 4 This is a flowchart illustrating a method for obtaining target log information in one embodiment;
[0029] Figure 5 This is a flowchart illustrating a method for obtaining target log information in another embodiment;
[0030] Figure 6 This is a flowchart illustrating a method for determining target log information based on log information in one embodiment;
[0031] Figure 7 This is a schematic diagram of target log information in one embodiment;
[0032] Figure 8 This is a flowchart illustrating the log information recording method in another embodiment;
[0033] Figure 9 A structural block diagram of a log information recording device in one embodiment; and
[0034] Figure 10 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0035] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0036] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0037] Log information refers to the execution status, business processes, and module operation-related data generated during the operation of an application. Log information can be used for troubleshooting during the development, testing, and maintenance of an application.
[0038] In existing technologies, most applications use a distributed logging method to record application log information. However, this logging method requires searching and piecing together fragmented log information across modules when troubleshooting, resulting in low efficiency.
[0039] In view of this, this application provides a logging method. In response to a startup operation on a target application, a session corresponding to the startup operation is created in the target application's session list. The target application includes multiple business functions. After the target application starts, in response to an interaction operation on any of the multiple business functions, a sub-session corresponding to the business function is created in the session. Then, the business function is executed based on multiple functional modules of the target application, and log information generated during the execution of the business function is recorded in the sub-session corresponding to the business function. Finally, in response to an exit operation on the target application, the logging of the session ends. The logging method provided by this application records the log information of each business function in the corresponding sub-session according to the session and sub-session hierarchy, enabling quick retrieval of the log information of the corresponding business function during troubleshooting, thereby effectively improving the efficiency of troubleshooting using log information.
[0040] The logging method provided in this application can be executed by a computer device, which can be a terminal.
[0041] In one exemplary embodiment, such as Figure 1 As shown, a method for recording log information is provided, which includes the following steps:
[0042] Step 101: In response to a launch operation for the target application, create a session corresponding to the launch operation in the target application's session list.
[0043] Optionally, the target application may include multiple business functions. For example, login function, device network access function, device pairing function, and other business functions.
[0044] A launch operation can be used to launch a target application. For example, a launch operation can be a user manually clicking the target application's desktop icon, the operating system automatically waking up the target application under specified conditions, or another application launching the target application through an interface call.
[0045] The target application's session list can be used to store the target application's log information.
[0046] In some exemplary embodiments, in response to a launch operation for a target application, the computer device may create a session corresponding to the launch operation in the session list of the target application.
[0047] Specifically, after a computer device detects a startup operation for a target application, it can assign a corresponding session identifier to the startup operation and create a session corresponding to that session identifier in the session list. This session will serve as the top-level container for the lifecycle of the target application.
[0048] Furthermore, this session can also be used to record global metadata and basic runtime context of the target application's runtime lifecycle, such as device information, application version number, and current launch method, and this session will run throughout the entire process of the target application from startup to exit.
[0049] Step 102: After the target application starts, in response to the interactive operation of any of the multiple business functions, create a sub-session in the session corresponding to the business function.
[0050] Optionally, the interactive operation can be any operation that can be used to initiate the execution flow of any business function in the target application. For example, the interactive operation could be clicking the login function entry, triggering a device network access operation command, or initiating a device pairing function request.
[0051] Sub-sessions are log recording units for corresponding business functions, and can be used to record log events generated during the execution of the corresponding business functions.
[0052] In some exemplary embodiments, after the target application is launched, the computer device can create a sub-session corresponding to the business function in the session in response to an interactive operation for any of the multiple business functions.
[0053] Specifically, after detecting an interactive operation for any business function, the computer device can assign a corresponding sub-session identifier to that business function and create a sub-session corresponding to that sub-session identifier under the corresponding session launched by the target application. Furthermore, the sub-session can be bound to the identifier of its parent session to complete the sub-session ownership configuration, making the sub-session a log container for the execution flow of the corresponding business function.
[0054] Step 103: Execute business functions based on multiple functional modules of the target application, and record the log information generated during the execution of the business functions in the sub-sessions corresponding to the business functions.
[0055] Optionally, multiple functional modules can work together to achieve the execution flow of a single business function. For example, functional modules may include a user interface (UI) interaction module, a network communication module, a database operation module, etc.
[0056] In some exemplary embodiments, a computer device may execute business functions based on multiple functional modules of a target application, and record log information generated during the execution of the business functions in the sub-sessions corresponding to the business functions.
[0057] Specifically, computer devices can utilize multiple functional modules of the target application to work together to complete each execution stage of the corresponding business function, and record log information generated during the execution of the business function in the sub-session corresponding to the business function during the execution of the business function in each functional module.
[0058] Step 104: In response to an exit operation for the target application, end the logging of the session.
[0059] Optionally, the exit operation can be used to exit the target application to terminate its operation. For example, the exit operation can be the user manually closing the target application, the target application automatically exiting after completion, or the target application being triggered to exit in the background via a command.
[0060] In some exemplary embodiments, the computer device may terminate session logging in response to an exit operation for a target application.
[0061] Specifically, upon detecting an exit operation against a target application, the computer device can stop recording log information for all sub-sessions within that session, terminating log recording for the entire lifecycle of the target application. Furthermore, the computer device can store the log information for that session and all its sub-sessions, and mark the session's logging status as ended.
[0062] The aforementioned log information recording method, in response to a startup operation on a target application, creates a session corresponding to the startup operation in the target application's session list. The target application includes multiple business functions. After the target application starts, in response to an interaction operation on any of the multiple business functions, a sub-session corresponding to the business function is created within the session. Then, the business function is executed based on multiple functional modules of the target application, and log information generated during the execution of the business function is recorded in the sub-session corresponding to the business function. Finally, in response to an exit operation on the target application, the logging of the session ends. The log information recording method provided in this application records the log information of each business function in the corresponding sub-session according to the session and sub-session hierarchy, enabling quick retrieval of the log information of the corresponding business function during problem investigation, thereby effectively improving the efficiency of using log information for problem investigation.
[0063] In an exemplary embodiment, recording log information generated during the execution of business functions includes: triggering log recording at key nodes in the execution of business functions and recording log information in the form of atomic events.
[0064] Optionally, key nodes can be used to mark phases of a business process. Examples include feature startup, module invocation, state change, process transition, exception occurrence, and feature termination.
[0065] Log information can include timestamps, the corresponding functional module, the business function point, the execution status, and business data. The timestamp refers to the point in time when the log event was recorded; the corresponding functional module refers to the functional module that generated the log event; the business function point refers to the business operation step corresponding to the current log event; the execution status refers to the execution result status of the current business operation; and the business data refers to the parameters or result data involved in the current business operation.
[0066] In some exemplary embodiments, the computer device may trigger logging at key nodes in the execution of business functions and record log information in the form of atomic events.
[0067] Specifically, when a computer device is performing a business function, it automatically triggers a log collection action after detecting a preset key node, and encapsulates the execution information of that node into atomic events. Each atomic event contains fields such as timestamp, to which it belongs, business function point, execution status, and business data, and writes the atomic event into the sub-session corresponding to the current business function. All atomic events can be arranged in order of timestamp.
[0068] For example, such as Figure 2 As shown, taking the login business sub-session in the session as an example, the first atomic log event is recorded at the key node at the beginning of the session to mark the start of the login business. Subsequently, in the login module, the user clicks the login button, displays the login pop-up, responds to the user's input operation, completes the page jump, and the network module interacts with the login request. The corresponding atomic log events are recorded in sequence at key nodes such as the login module, the user clicks the login button, displays the login pop-up, responds to the user's input operation, completes the page jump, and the network module performs the login request interaction. Each atomic log contains a timestamp (i.e., time 1, time 2, ..., time n), the functional module to which it belongs (i.e., the login module / network module), the business function (action / pop-up / event / jump), the execution status, and related business data. Finally, the last atomic log event is recorded at the key node at the end of the session.
[0069] In one exemplary embodiment, such as Figure 3 As shown, after ending session logging, the method also includes the following steps:
[0070] Step 301: Receive query command.
[0071] Optionally, the query command is used to obtain the target log information to be queried, and the query command includes the query time range.
[0072] The query time range can be a user-specified time period used to filter historical sessions. For example, the runtime of the target application on a specific day or within a specified hour.
[0073] In some exemplary embodiments, the computer device may receive a query instruction.
[0074] Specifically, when users need to troubleshoot abnormal business functions or trace historical business execution, they can use computer devices to input query commands.
[0075] Step 302: Based on the query time range, determine the target sessions whose creation time falls within the query time range from the session list.
[0076] In some exemplary embodiments, after receiving a query instruction, the computer device can determine the target session whose creation time falls within the query time range from the session list based on the query time range.
[0077] Specifically, the computer device can first determine the query time range based on the query command, then retrieve the creation time information of all sessions from the session list of the target application, match and filter the creation time of each session with the query time range, and determine the sessions whose creation time is within the query time range as the target sessions.
[0078] Step 303: Based on the target session, obtain the target log information.
[0079] In some exemplary embodiments, after determining a target session, the computer device can obtain target log information based on the target session. Specifically, the computer device can determine the target log information based on the log information in the target session.
[0080] In one exemplary embodiment, such as Figure 4 As shown, obtaining target log information based on the target session includes the following steps:
[0081] Step 401: In response to receiving a selection operation for any target session in the target session, determine the target sub-session corresponding to the selected target session.
[0082] In some exemplary embodiments, the computer device can display target sessions. After displaying the target sessions, the user can select any target session based on actual needs such as log querying or problem troubleshooting. For example, the selection operation can be a single click, double click, or similar action.
[0083] Furthermore, in response to receiving a selection operation for any target session in the target session, the computer device determines the target sub-session corresponding to the selected target session.
[0084] Specifically, the computer device can first determine the selected target session based on the selection operation, and then, based on the session identifier of the target session, retrieve and match all sub-sessions that are bound to and associated with the session identifier, and identify these sub-sessions as the target sub-session.
[0085] Step 402: Obtain target log information based on the target sub-session.
[0086] In some exemplary embodiments, after determining the target sub-session, the computer device can obtain target log information based on the target sub-session. Specifically, the computer device can determine the target log information based on the log information included in the target sub-session.
[0087] In one exemplary embodiment, such as Figure 5 As shown, obtaining target log information based on the target sub-session includes the following steps:
[0088] Step 501: In response to receiving a selection operation for any target sub-session in the target sub-session, obtain the log information recorded in the selected target sub-session.
[0089] In some exemplary embodiments, the computer device can use a display screen to display all target sub-sessions in a list format. After displaying the target sub-sessions, the user can select any target sub-session based on actual needs such as log querying or problem troubleshooting. For example, the selection operation can be a single click, double click, or other similar operation.
[0090] Furthermore, in response to a selection operation for any target sub-session within the target sub-session, the computer device retrieves the log information recorded in the target sub-session.
[0091] Specifically, the computer device can first determine the target sub-session to be queried based on the selected operation, and then retrieve and match all log information under the target sub-session based on the sub-session identifier of the target sub-session.
[0092] Step 502: Determine the target log information based on the log information.
[0093] In some exemplary embodiments, after obtaining log information recorded in the target sub-session, the computer device can determine the target log information based on the log information. Specifically, the computer device can directly determine the obtained log information as the target log information.
[0094] In one exemplary embodiment, such as Figure 6As shown, determining the target log information based on log information includes the following steps:
[0095] Step 601: Group the log information according to multiple functional modules to obtain the log information group corresponding to each functional module.
[0096] In some exemplary embodiments, after obtaining log information, the computer device can use multiple functional modules to group the log information to obtain log information groups corresponding to each functional module.
[0097] Specifically, the computer device first obtains the field information of the functional module to which the log information belongs, and then groups the log information based on the field information of the functional module to which each log information belongs, so as to obtain the log information group corresponding to each functional module.
[0098] For example, if a functional module can include a UI interaction module, a network communication module, and a database operation module, then the log information belonging to the UI interaction module can be identified as the UI interaction module log information group, the log information belonging to the network communication module can be identified as the network communication module log information group, and the log information belonging to the database operation module can be identified as the database operation module log information group.
[0099] Step 602: For the log information group corresponding to each functional module, sort the log information based on the timestamp of the log information in the log information group to obtain the log event timeline corresponding to each functional module.
[0100] In some exemplary embodiments, after obtaining the log information groups corresponding to each functional module, the computer device can sort the log information based on the timestamps of the log information in the log information groups corresponding to each functional module to obtain the log event timeline corresponding to each functional module.
[0101] Specifically, for each functional module's corresponding log information group, the computer device can first obtain the timestamp of each log information in the log information group, and then sort the log information in the log information group in forward time order based on the timestamps, so that the log information in the log information group is arranged in the order of actual business execution, thus obtaining the log event timeline.
[0102] Step 603: Determine the target log information based on the log event timeline corresponding to each functional module.
[0103] In some exemplary embodiments, after obtaining the log event timelines corresponding to each functional module, the computer device can determine the target log information based on the log event timelines corresponding to each functional module.
[0104] Specifically, computer equipment can determine the target log information as the log event timeline corresponding to each functional module.
[0105] Furthermore, the computer device can also integrate the log event timelines corresponding to each functional module, align all timelines with the same timeline, and display the log event timelines of each functional module in parallel.
[0106] For example, such as Figure 7 As shown, taking the log information of the device's network access service as an example, the computer device aligns the timelines of the log events of the UI interaction module (corresponding to UI logs), Bluetooth communication module (corresponding to Bluetooth logs), WiFi connection module (corresponding to WiFi logs), and network communication module (corresponding to network logs) with the same timeline as the reference, and displays the execution flow of each module in parallel:
[0107] 1) The log events of the UI interaction module are as follows along the timeline: "User selects 2nd generation device", "Device connection successful - User confirms network access", "Device network access successful - Return to homepage";
[0108] 2) The log events of the Bluetooth communication module are, in order: "Bluetooth restarts search", "Bluetooth starts connecting", and "Query device basic information";
[0109] 3) The log events of the WiFi connection module are "WiFi search started" and "WiFi connection successful" in sequence;
[0110] 4) The log events of the network communication module are "Device certificate verification successful" and "User and device binding successful".
[0111] In one exemplary embodiment, such as Figure 8 As shown, another logging method is provided, which includes the following steps:
[0112] Step 801: In response to a launch operation for the target application, create a session corresponding to the launch operation in the session list of the target application. The target application includes multiple business functions. After the target application is launched, in response to an interaction operation for any of the multiple business functions, create a sub-session corresponding to the business function in the session.
[0113] Step 802: Execute business functions based on multiple functional modules of the target application, and trigger log recording at key nodes in the execution process of the business function in the sub-session corresponding to the business function, and record log information in the form of atomic events; wherein, the log information includes timestamp, to which the functional module belongs, business function point, execution status and business data; in response to the exit operation of the target application, end the log recording of the session;
[0114] Step 803: Receive a query instruction. The query instruction is used to obtain the target log information to be queried, and the query instruction includes a query time range. Based on the query time range, determine the target session whose creation time is within the query time range from the session list.
[0115] Step 804: In response to receiving a selection operation for any target session in the target session, determine the target sub-session corresponding to the selected target session; in response to receiving a selection operation for any target sub-session in the target sub-session, obtain the log information recorded in the selected target sub-session.
[0116] Step 805: Group the log information according to multiple functional modules to obtain log information groups corresponding to each functional module; for each log information group corresponding to a functional module, sort the log information based on the timestamp of the log information in the log information group to obtain the log event timeline corresponding to each functional module; determine the target log information based on the log event timeline corresponding to each functional module.
[0117] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0118] Based on the same inventive concept, this application also provides a log information recording device for implementing the log information recording method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations of one or more log information recording device embodiments provided below can be found in the limitations of the log information recording method described above, and will not be repeated here.
[0119] In one exemplary embodiment, such as Figure 9 As shown, a log information recording device 900 is provided, including: a first execution module 901, a second execution module 902, a third execution module 903, and a fourth execution module 904, wherein:
[0120] The first execution module 901 is used to create a session corresponding to the startup operation in the session list of the target application in response to the startup operation of the target application. The target application includes multiple business functions.
[0121] The second execution module 902 is used to create a sub-session corresponding to the business function in the session in response to the interactive operation for any of the multiple business functions after the target application starts.
[0122] The third execution module 903 is used to execute business functions based on multiple functional modules of the target application, and to record log information generated during the execution of the business functions in the sub-sessions corresponding to the business functions; and
[0123] The fourth execution module 904 is used to terminate session logging in response to an exit operation for the target application.
[0124] In one embodiment, the first execution module 901 is further configured to receive a query instruction, the query instruction being used to obtain target log information to be queried, and the query instruction including a query time range; determine a target session whose creation time is within the query time range from the session list based on the query time range; and obtain the target log information based on the target session.
[0125] In one embodiment, the first execution module 901 is specifically configured to, in response to receiving a selection operation for any target session in the target session, determine the target sub-session corresponding to the selected target session; and obtain target log information based on the target sub-session.
[0126] In one embodiment, the first execution module 901 is specifically configured to, in response to receiving a selection operation for any target sub-session in the target sub-session, obtain log information recorded in the selected target sub-session; and determine target log information based on the log information.
[0127] In one embodiment, the first execution module 901 is specifically used to group log information according to multiple functional modules to obtain log information groups corresponding to each functional module; for each log information group corresponding to a functional module, sort the log information based on the timestamp of the log information in the log information group to obtain the log event timeline corresponding to each functional module; and determine the target log information based on the log event timeline corresponding to each functional module.
[0128] In one embodiment, the third execution module 903 is specifically used to trigger log recording at key nodes in the execution process of business functions and record log information in the form of atomic events; wherein, the log information includes timestamp, to which the functional module belongs, business function point, execution status and business data.
[0129] Each module in the aforementioned log information recording device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0130] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 10 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When executed by the processor, the computer program implements a log information recording method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0131] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0132] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0133] In response to a launch operation for a target application, a session corresponding to the launch operation is created in the target application's session list. The target application includes multiple business functions.
[0134] After the target application starts, in response to an interactive operation targeting any of the multiple business functions, a sub-session corresponding to the business function is created within the session; and
[0135] Execute business functions based on multiple functional modules of the target application, and record log information generated during the execution of business functions in the sub-sessions corresponding to the business functions;
[0136] Log the termination of the session in response to an exit action against the target application.
[0137] In one embodiment, when the processor executes the computer program, it further performs the following steps: receiving a query instruction for obtaining target log information to be queried, and the query instruction includes a query time range; determining a target session whose creation time is within the query time range from a session list based on the query time range; and obtaining the target log information based on the target session.
[0138] In one embodiment, when the processor executes the computer program, it further performs the following steps: in response to receiving a selection operation for any target session in the target session, determining the target sub-session corresponding to the selected target session; and obtaining target log information based on the target sub-session.
[0139] In one embodiment, when the processor executes the computer program, it further performs the following steps: in response to receiving a selection operation for any target sub-session in the target sub-session, obtaining log information recorded in the selected target sub-session; and determining target log information based on the log information.
[0140] In one embodiment, when the processor executes the computer program, it further performs the following steps: grouping log information according to multiple functional modules to obtain log information groups corresponding to each functional module; sorting the log information based on the timestamps of the log information in the log information group for each functional module to obtain the log event timeline corresponding to each functional module; and determining the target log information based on the log event timeline corresponding to each functional module.
[0141] In one embodiment, when the processor executes the computer program, it further implements the following steps: triggering log recording at key nodes in the execution process of the business function, and recording log information in the form of atomic events; wherein, the log information includes timestamps, the functional module to which it belongs, the business function point, the execution status, and the business data.
[0142] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0143] In response to a launch operation for a target application, a session corresponding to the launch operation is created in the target application's session list. The target application includes multiple business functions.
[0144] After the target application starts, in response to interactive operations for any of the multiple business functions, a sub-session corresponding to the business function is created in the session;
[0145] Execute business functions based on multiple functional modules of the target application, and record log information generated during the execution of the business functions in the corresponding sub-sessions; and
[0146] Log the termination of the session in response to an exit action against the target application.
[0147] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: receiving a query instruction for obtaining target log information to be queried, and the query instruction includes a query time range; determining a target session whose creation time is within the query time range from a session list based on the query time range; and obtaining the target log information based on the target session.
[0148] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: in response to receiving a selection operation for any target session in the target session, determining the target sub-session corresponding to the selected target session; and based on the target sub-session, obtaining target log information.
[0149] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: in response to receiving a selection operation for any target sub-session in the target sub-session, obtaining log information recorded in the selected target sub-session; and determining target log information based on the log information.
[0150] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: grouping log information according to multiple functional modules to obtain log information groups corresponding to each functional module; sorting the log information based on the timestamps of the log information in the log information group to obtain the log event timeline corresponding to each functional module; and determining the target log information based on the log event timeline corresponding to each functional module.
[0151] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: triggering log recording at key nodes in the execution process of the business function, and recording log information in the form of atomic events; wherein, the log information includes timestamps, the functional module to which it belongs, the business function point, the execution status, and the business data.
[0152] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0153] In response to a launch operation for a target application, a session corresponding to the launch operation is created in the target application's session list. The target application includes multiple business functions.
[0154] After the target application starts, in response to interactive operations for any of the multiple business functions, a sub-session corresponding to the business function is created in the session;
[0155] Execute business functions based on multiple functional modules of the target application, and record log information generated during the execution of the business functions in the corresponding sub-sessions; and
[0156] Log the termination of the session in response to an exit action against the target application.
[0157] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: receiving a query instruction for obtaining target log information to be queried, and the query instruction includes a query time range; determining a target session whose creation time is within the query time range from a session list based on the query time range; and obtaining the target log information based on the target session.
[0158] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: in response to receiving a selection operation for any target session in the target session, determining the target sub-session corresponding to the selected target session; and based on the target sub-session, obtaining target log information.
[0159] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: in response to receiving a selection operation for any target sub-session in the target sub-session, obtaining log information recorded in the selected target sub-session; and determining target log information based on the log information.
[0160] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: grouping log information according to multiple functional modules to obtain log information groups corresponding to each functional module; sorting the log information based on the timestamps of the log information in the log information group to obtain the log event timeline corresponding to each functional module; and determining the target log information based on the log event timeline corresponding to each functional module.
[0161] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: triggering log recording at key nodes in the execution process of the business function, and recording log information in the form of atomic events; wherein, the log information includes timestamps, the functional module to which it belongs, the business function point, the execution status, and the business data.
[0162] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0163] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0164] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for recording log information, characterized in that, include: In response to a launch operation for a target application, a session corresponding to the launch operation is created in the session list of the target application, the target application including multiple business functions; After the target application is launched, in response to an interactive operation for any of the multiple business functions, a sub-session corresponding to the business function is created in the session; The business function is executed based on multiple functional modules of the target application, and log information generated during the execution of the business function is recorded in the sub-session corresponding to the business function. as well as Log recording of the session ends in response to an exit operation for the target application.
2. The method according to claim 1, characterized in that, Also includes: Receive a query instruction, the query instruction being used to obtain target log information to be queried, and the query instruction including a query time range; Based on the query time range, determine the target session whose creation time falls within the query time range from the session list; as well as Based on the target session, obtain the target log information.
3. The method according to claim 2, characterized in that, The step of obtaining the target log information based on the target session includes: In response to receiving a selection operation for any of the target sessions, determine the target sub-session corresponding to the selected target session; and Based on the target sub-session, obtain the target log information.
4. The method according to claim 3, characterized in that, The step of obtaining the target log information based on the target sub-session includes: In response to receiving a selection operation for any of the target sub-sessions, the system retrieves log information recorded in the selected target sub-session; and The target log information is determined based on the log information.
5. The method according to claim 4, characterized in that, Determining the target log information based on the log information includes: The log information is grouped according to the multiple functional modules to obtain log information groups corresponding to each functional module; For each functional module's corresponding log information group, the log information is sorted based on the timestamps of the log information in the log information group to obtain the log event timeline for each functional module; and The target log information is determined based on the log event timeline corresponding to each of the aforementioned functional modules.
6. The method according to claim 1, characterized in that, The log information generated during the execution of the business function includes: Log recording is triggered at key nodes in the execution process of the business function, and the log information is recorded in the form of atomic events. The log information includes timestamps, the corresponding functional module, business function points, execution status, and business data.
7. A log information recording device, characterized in that, include: The first execution module is configured to, in response to a launch operation for a target application, create a session corresponding to the launch operation in the session list of the target application, wherein the target application includes multiple business functions; The second execution module is used to create a sub-session corresponding to the business function in the session in response to an interactive operation for any of the multiple business functions after the target application is started. The third execution module is used to execute the business function based on multiple functional modules of the target application, and to record the log information generated during the execution of the business function in the sub-session corresponding to the business function. as well as The fourth execution module is used to terminate the logging of the session in response to an exit operation for the target application.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When executed by the processor, the computer program is used to implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program is used to implement the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program is used to implement the method according to any one of claims 1 to 6.