Log visualization method and device, equipment, medium and program product
By collecting, encoding, serializing, and deserializing log events, the system enables the visualization of logs, solving the problem of poor reading experience for log analysts and improving the efficiency and accuracy of log analysis.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2026-05-08
AI Technical Summary
Log analysts have a poor experience reading plain text logs, resulting in low efficiency in log analysis.
By collecting, encoding, serializing, and deserializing log events, logs can be visualized, improving the intuitiveness of log analysis.
It improves the user experience for log analysts and enhances the efficiency and accuracy of log analysis.
Smart Images

Figure CN121996240A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Internet technology, and in particular to a log visualization method, apparatus, device, medium, and program product. Background Technology
[0002] Logs are used to record information such as object operations, interface changes, and system running status during program execution. They are an indispensable part of program development, operation, and debugging. By analyzing program logs, log analysts can understand the program's running status, promptly identify and locate problems, and thus fix and optimize the program.
[0003] Currently, logs are all in plain text format, requiring log analysts to read them for analysis. However, this results in a poor user experience for log analysts. Summary of the Invention
[0004] This application provides a log visualization method, apparatus, device, medium, and program product, which can improve the experience of log analysts.
[0005] In a first aspect, embodiments of this application provide a log visualization method. The method is applied to a first terminal and includes: collecting multiple events in the log based on the chronological order of event timestamps; encoding the multiple events to obtain encoded events; serializing the encoded events to obtain an event sequence; sending the event sequence to a backend server so that a second terminal can retrieve the event sequence from the backend server, deserialize the event sequence to obtain encoded events, execute the encoded events, and simultaneously display the execution process of the encoded events.
[0006] Secondly, embodiments of this application provide a log visualization method, which is applied to a second terminal. The method includes: pulling an event sequence from a backend server; deserializing the event sequence to obtain encoded events; executing the encoded events and simultaneously displaying the execution process of the encoded events.
[0007] Thirdly, embodiments of this application provide a log visualization device, including: a collection module, an encoding module, a serialization module, and a sending module. The collection module is used to collect multiple events in the log based on the chronological order of the event timestamps; the encoding module is used to encode the multiple events to obtain encoded events; the serialization module is used to serialize the encoded events to obtain an event sequence; and the sending module is used to send the event sequence to a backend server so that a second terminal can pull the event sequence from the backend server, deserialize the event sequence to obtain encoded events, execute the encoded events, and simultaneously display the execution process of the encoded events.
[0008] In some implementations, the log is the log of the target mini-program; in the case where multiple events include a component framework initialization event, the encoding module is specifically used to: obtain the node information of each node included in the component framework of the target mini-program and the initialization timestamp of the component framework recorded in the component framework initialization event; and encode the node information of each node included in the component framework and the initialization timestamp of the component framework.
[0009] In some implementations, for each node included in the component framework, the node information includes at least one of the following:
[0010] Node identifier;
[0011] The identifier of the node's parent node;
[0012] Node labels;
[0013] Node attributes.
[0014] In some implementations, the log is the log of the target mini-program; in the case where multiple events include component framework change events, the encoding module is specifically used to: obtain the node information of the changed nodes included in the component framework of the target mini-program recorded in the component framework change event; and encode the node information of the changed nodes.
[0015] In some implementations, the change node is replaced with an insertion node; wherein the node information of the insertion node includes at least one of the following:
[0016] The type of insertion operation corresponding to the inserted node;
[0017] The insertion timestamp of the inserted node;
[0018] The identifier of the inserted node;
[0019] The identifier of the parent node of the inserted node;
[0020] The index of the inserted node under its parent node;
[0021] Insert the node's label;
[0022] The attributes of the inserted node.
[0023] In some implementations, the change node is replaced by the deletion node; wherein the node information of the deleted node includes at least one of the following:
[0024] The deletion operation type corresponding to the deleted node;
[0025] The identifier of the deleted node;
[0026] The deletion timestamp of the deleted node.
[0027] In some implementations, the change node is an attribute update node; wherein the node information of the attribute update node includes at least one of the following:
[0028] The update operation type corresponding to the attribute update node;
[0029] The identifier of the attribute update node;
[0030] Update the attributes of the attribute update node;
[0031] The update timestamp of the attribute update node.
[0032] In some implementations, where multiple events include object interaction events, the encoding module is specifically used to: obtain event information recorded in the object interaction events; and encode the event information.
[0033] In some implementations, the object interaction event is a click event; wherein the event information includes at least one of the following:
[0034] Click operation type;
[0035] Click the timestamp;
[0036] Click the object's identifier;
[0037] Click on location information.
[0038] In some implementations, the object interaction event is a swipe event; where the event information includes at least one of the following:
[0039] Slide operation type;
[0040] Sliding timestamp;
[0041] Content displayed before swiping;
[0042] The content displayed after sliding.
[0043] In some implementations, when multiple events include page jump events, the encoding module is specifically used to: obtain the page jump information recorded in the page jump event; and encode the page jump information.
[0044] In some possible implementations, the page redirection information includes at least one of the following:
[0045] Page redirection type;
[0046] Page redirect timestamp;
[0047] The path to the page before the redirect;
[0048] The path to the page after redirection;
[0049] Parameters carried during page redirection.
[0050] Fourthly, embodiments of this application provide a log visualization device, including: a pull module, a deserialization module, an execution module, and a display module, wherein the pull module is used to pull event sequences from a backend server; the deserialization module is used to deserialize the event sequences to obtain encoded events; the execution module and the display module are respectively used to execute the encoded events and display the execution process of the encoded events.
[0051] In some implementations, the execution module is specifically used to: determine the execution duration of each event based on the timestamps of each event in the encoded event; and execute each event sequentially according to the order of its timestamps and its execution duration.
[0052] In some implementations, the execution module is specifically used to: for any two adjacent events, calculate the time difference between the timestamp of the latter event and the timestamp of the former event, and obtain the execution duration of the former event.
[0053] In some implementations, the display module is specifically used to: display the execution process of the encoded event in the first display area.
[0054] In some implementations, the display module is also used to: display the execution process of the encoded event in the first display area, while simultaneously displaying the description information of the currently executed event in the second display area; wherein the first display area and the second display area are different.
[0055] Fifthly, embodiments of this application provide an electronic device, including: a processor and a memory, the memory being used to store a computer program, and the processor being used to call and run the computer program stored in the memory to perform the methods as described in the first to second aspects or their respective implementations.
[0056] In a sixth aspect, embodiments of this application provide a computer-readable storage medium for storing a computer program that causes a computer to perform the methods described in the first to second aspects or their respective implementations.
[0057] In a seventh aspect, embodiments of this application provide a computer program product including computer program instructions that cause a computer to perform the methods as described in the first to second aspects or their respective implementations.
[0058] Eighthly, embodiments of this application provide a computer program that causes a computer to perform the methods described in the first to second aspects or their respective implementations.
[0059] The technical solution provided in this application enables log visualization, allowing log analysts to perform log analysis intuitively and thus improving their experience. Attached Figure Description
[0060] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0061] Figure 1 This is a schematic diagram of a system architecture according to an embodiment of this application;
[0062] Figure 2 An interactive flowchart of a log visualization method provided in an embodiment of this application;
[0063] Figure 3 A user interface diagram provided for an embodiment of this application;
[0064] Figure 4 Another user interface diagram provided for an embodiment of this application;
[0065] Figure 5 Another user interface diagram provided for an embodiment of this application;
[0066] Figure 6 A schematic diagram of a log visualization device 600 provided in an embodiment of this application;
[0067] Figure 7 A schematic diagram of a log visualization device 700 provided in an embodiment of this application;
[0068] Figure 8 This is a schematic block diagram of the electronic device 800 provided in the embodiments of this application. Detailed Implementation
[0069] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0070] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0071] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0072] Before introducing the technical solution of this application, the relevant knowledge involved in this application will be explained below:
[0073] 1. A mini-program is a lightweight application that can be used without downloading or installing. Mini-programs have independent interfaces and functions and can provide an object experience similar to traditional applications.
[0074] 2. The logs of the mini program are used to record information such as object operations, interface changes, and system running status during the operation of the mini program.
[0075] 3. An event sequence refers to a sequence of events with timestamps.
[0076] The technical problems to be solved, the inventive concept and the system architecture of the embodiments of this application will be described below:
[0077] As mentioned above, current logs are all in plain text format, requiring log analysts to read them for analysis. However, this results in a poor user experience for log analysts.
[0078] To address the aforementioned technical issues, this application proposes a log visualization feature, enabling log analysts to perform log analysis intuitively and thus improving their experience.
[0079] Figure 1 This is a schematic diagram of a system architecture according to an embodiment of this application. The system architecture involves network elements: a first terminal 110, a second terminal 120, and a backend server 130. The first terminal 110, the second terminal 120, and the backend server 130 can be directly or indirectly connected through wired or wireless communication methods, which is not limited in this application.
[0080] In some implementations, the first terminal 110 may have an application (APP) installed, allowing objects to perform various operations on the APP, such as clicking and swiping, so that the background server 130 corresponding to the APP can generate logs for the APP. These logs may be in text format, enabling the first terminal 110 to collect multiple events from the logs based on the timestamp sequence of the events; encode the multiple events to obtain encoded events; serialize the encoded events to obtain an event sequence; and send the event sequence to the background server 130 corresponding to the APP.
[0081] In some implementations, the first terminal 110 may have a host program of the target mini-program installed. The object can perform various operations on the target mini-program, such as clicking and swiping, so that the background server 130 corresponding to the target mini-program can generate logs corresponding to the target mini-program. The logs may be in text format, thereby enabling the first terminal 110 to collect multiple events in the logs based on the timestamp sequence of the events; encode the multiple events to obtain encoded events; serialize the encoded events to obtain an event sequence; and send the event sequence to the background server 130 corresponding to the target mini-program.
[0082] It should be understood that a host program is a program that provides a runtime environment for other programs or code. It allows these programs or code to execute within it and provides the necessary resources and interfaces.
[0083] In some implementations, the host program can be an instant messaging client or a payment client, but it is not limited to these.
[0084] It should be understood that the instant messaging client can be any communication tool based on Internet technology that allows users to communicate with each other in real time through text, voice, video, etc., such as WeChat, QQ, WeChat Work, etc., but not limited to these.
[0085] The first terminal 110 is often equipped with a display device to obtain object operations and display the mini-program interface, etc.
[0086] It should be understood that display devices are also called monitors, displays, touch screens, etc., and touch screens are also called touch screens, touch panels, etc.
[0087] In some possible implementations, the first terminal 110 may be a desktop computer, laptop computer, handheld computer, tablet computer, smartphone, smartwatch, virtual reality (VR) device, augmented reality (AR) device, etc., but is not limited to these.
[0088] In some implementations, the backend server 130 can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0089] In some implementations, the second terminal 120 can pull the event sequence from the backend server 130, deserialize the event sequence to obtain the encoded event, execute the encoded event, and simultaneously display the execution process of the encoded event.
[0090] The second terminal 120 is often equipped with a display device to visually display the logs of the APP or target mini-program.
[0091] It should be understood that display devices are also called monitors, displays, touch screens, etc., and touch screens are also called touch screens, touch panels, etc.
[0092] In some possible implementations, the second terminal 120 can be a desktop computer, laptop computer, PDA, tablet computer, smartphone, smartwatch, VR device, AR device, etc., but is not limited to these.
[0093] It should be noted that, Figure 1 This is merely a schematic diagram of a system architecture provided in this application embodiment; the system architecture involved in this application embodiment is not limited to... Figure 1 The system architecture shown, for example, Figure 1 The system architecture shown only includes one first terminal 110 and one second terminal 120. In reality, it can include other numbers of first terminals 110 and second terminals 120, or... Figure 1 Based on the system architecture shown, the system architecture involved in the embodiments of this application may also include other network elements, etc.
[0094] The technical solution of this application will be described in detail below:
[0095] Figure 2 This application provides an interactive flowchart of a log visualization method. The method can be executed by a first terminal, a second terminal, and a backend server. The first terminal can be a host application with an APP or target mini-program installed, corresponding to the user of the APP or target mini-program. The second terminal corresponds to the log analysis party. The first terminal, second terminal, and backend server can be respectively... Figure 1 The system includes a first terminal 110, a second terminal 120, and a backend server 130, but is not limited to these. For further explanation of the first terminal, second terminal, and backend server, please refer to [link to relevant documentation]. Figure 1 The corresponding explanations and descriptions will not be repeated in the embodiments of this application. Figure 2 As shown, the method may include:
[0096] S210: The first terminal collects multiple events from the log based on the order of their timestamps;
[0097] In some possible implementations, the log can be the log corresponding to the aforementioned APP or the log corresponding to the target mini-program; this application embodiment does not impose any restrictions on this.
[0098] It should be understood that the target mini-program can be any mini-program in the host program, and this application embodiment does not limit this.
[0099] The following section will use the logs of the target mini-program as an example to illustrate the log visualization method:
[0100] It should be understood that objects can perform various operations on the target mini-program, such as clicking and swiping, so that the backend server can generate logs for the target mini-program. These logs can be in text format and can record various types of events, such as component framework initialization events, component framework change events, object interaction events, and page navigation events.
[0101] In some feasible implementations, the first terminal can detect the logs of the target mini-program through the interface provided by the component framework of the target mini-program, so as to collect component framework initialization events, component framework change events, object interaction events, and page jump events in the logs of the target mini-program.
[0102] In some implementation methods, the first terminal can periodically check the logs corresponding to the target mini-program to periodically collect component framework initialization events, component framework change events, object interaction events, and page jump events from the target mini-program's logs. For example, the first terminal checks the logs corresponding to the target mini-program every 10 seconds to collect component framework initialization events and component framework change events from the target mini-program's logs within 10 seconds.
[0103] It should be understood that the target mini-program's component framework provides basic support for its various components. All components within the mini-program, including built-in and custom components, are organized and managed by this component framework. This component framework can be built into the mini-program's base library. For example, this component framework could be the exparser framework.
[0104] It should be understood that the component framework of the target mini-program is a tree structure composed of multiple user interface (UI) nodes. Therefore, this component framework is also called a component tree, for example, the exparser framework is also called an exparser tree. Each node in this component framework has attributes such as styles. This component framework is similar to the Document Object Model (DOM) tree in Hyper Text Markup Language (HTML). This component framework can render the UI of the mini-program based on the attributes of each node, just as a browser can render a DOM tree into a web interface.
[0105] For example, the following is an example of an exparser tree:
[0106] View(container)
[0107] |--Text(title)
[0108] ||--Value: Welcome to my mini-program
[0109] |--Button(btn)
[0110] ||--Bindtap:handleClick
[0111] ||--Content: Click me
[0112] |--Input(input)
[0113] |--Placeholder: Please enter your content
[0114] The View(container) node has three child nodes: Text(title), Button(btn), and Input(input). Value: Welcome to my mini-program is an attribute of the Text(title) node. Bindtap: handleClick and Content: Click me are attributes of the Button(btn) node. Placeholder: Please enter content is an attribute of the Input(input) node.
[0115] It should be understood that the component framework initialization event refers to the event that implements the initialization of the component framework. Usually, the component framework is initialized only once. Therefore, the target mini program's logs usually only contain one component framework initialization event.
[0116] In some implementations, the timestamp for the component framework initialization event is the initialization timestamp of the target mini-program's component framework. It should be understood that although the target mini-program's component framework includes multiple nodes, there is only one initialization timestamp for the component framework, which can be the completion time of the initialization of all nodes within that component framework. For example, assuming the target mini-program's component framework completed initialization on 2024-10-29-18:00:00, then the corresponding timestamp for the component framework initialization event is 2024-10-29-18:00:00.
[0117] It should be understood that a component framework change event refers to an event that updates the component framework. Updates to the target mini-program's component framework include: inserting nodes into the target mini-program's component framework, deleting nodes from the target mini-program's component framework, and updating the properties of a node in the target mini-program's component framework. For the target mini-program's component framework, each node update operation corresponds to one component framework change event. This node update operation includes: node insertion, node deletion, and node property update. For example, when node 1 is inserted into the target mini-program's component framework, the target mini-program's log will include one component framework change event. When node 2 is deleted from the target mini-program's component framework, the target mini-program's log will also include one component framework change event. When the properties of node 3 are updated in the target mini-program's component framework, the target mini-program's log will again include one component framework change event.
[0118] In some implementations, for node insertion operations, the timestamp of the component framework change event is the insertion timestamp of the inserted node. For example, assuming that node 1 was inserted into the component framework of the target mini-program on 2024-10-30-10:00:00, then the timestamp of the corresponding component framework change event is 2024-10-30-10:00:00.
[0119] In some implementations, for node deletion operations, the timestamp of the component framework change event is the deletion timestamp of the deleted node. For example, assuming that node 2 was deleted from the component framework of the target mini-program on 2024-10-30-10:01:00, then the timestamp of the corresponding component framework change event is 2024-10-30-10:01:00.
[0120] In some implementations, for node attribute update operations, the timestamp of the component framework change event is the update timestamp of the node whose attribute is being updated. For example, suppose the component framework of the target mini-program updates the attribute of node 3 at 2024-10-30-10:02:01, then the timestamp of the corresponding component framework change event is 2024-10-30-10:02:01.
[0121] It should be understood that object interaction events refer to the interaction events between an object and the user interface of the target mini-program.
[0122] In some implementations, object interaction events include, but are not limited to, touch events and non-touch events.
[0123] In some implementations, touch events include, but are not limited to: click events, swipe events, long press events, pinch events, expand events, drag events, etc.
[0124] In some possible implementations, non-touch events include, but are not limited to: gesture recognition events, voice interaction events, face recognition events, iris recognition events, fingerprint recognition events, palmprint recognition events, etc.
[0125] In some implementations, the timestamp for an object interaction event is the object interaction timestamp. For example, for a click event, its timestamp is the click timestamp. As another example, for a swipe event, its timestamp is the swipe timestamp, which can be the start time of the current swipe operation, but is not limited to this.
[0126] It should be understood that a page jump event refers to the event that jumps from one page in the target mini-program to another page.
[0127] In some implementations, the timestamp for a page jump event is the page jump timestamp. For example, if a page jump occurs from page 1 to page 2 of the target mini-program at 10:05:30 on 2024-10-30, then the timestamp for this page jump event is 2024-10-30-10:05:30.
[0128] It should be understood that multiple events collected by the first terminal based on the chronological order of their timestamps constitute an event sequence. It is worth noting that this event sequence differs from the event sequence mentioned in S230 in that it is the pre-encoded event sequence, while the event sequence mentioned in S230 is the encoded event sequence.
[0129] S220: The first terminal encodes multiple events to obtain the encoded events;
[0130] As mentioned above, the target mini-program's logs include the following types of events: component framework initialization events, component framework change events, object interaction events, and page navigation events. The coding process for each of these event types will be explained in detail below:
[0131] In some possible implementations, when multiple events include a component framework initialization event, the first terminal encodes the multiple events, including: the first terminal obtains the node information of each node included in the component framework of the target mini-program and the initialization timestamp of the component framework recorded in the component framework initialization event; and encodes the node information of each node included in the component framework and the initialization timestamp of the component framework to realize the encoding of the component framework initialization event.
[0132] It should be understood that the explanation of the initialization timestamp of the component framework can be found above, and will not be repeated in this embodiment.
[0133] For example, the timestamp can be initialized as follows:
[0134] timestamp:1618303000000; / / 1618303000000 represents the initialization timestamp, usually in milliseconds.
[0135] In some implementations, for each node included in the component framework, the node information includes at least one of the following, but is not limited to:
[0136] The identifier of this node;
[0137] The identifier of the parent node of this node;
[0138] The label of this node;
[0139] The attributes of this node.
[0140] For example, the data structure of a node in the component framework can be as follows:
[0141] {
[0142] id:int32; / / id is the identifier of this node, used to identify this node;
[0143] parentId: int32; / / parentId is the identifier of the parent node of this node, used to identify the parent node;
[0144] tagName: string; / / tagName is the tag (i.e., tag name) of this node, such as the WeChat-view (wx-view) tag, the WeChat-text (wx-text) tag, etc.;
[0145] attributes: key values; / / attributes are the attributes of this node;
[0146] }
[0147] In some possible implementations, when multiple events include a component framework initialization event, the first terminal encodes the multiple events, including: the first terminal obtaining the node information of each node included in the component framework of the target mini-program, the initialization timestamp of the component framework, and the identifier of the component framework initialization event recorded in the component framework initialization event; and encoding the node information of each node included in the component framework, the initialization timestamp of the component framework, and the identifier of the component framework initialization event to achieve the encoding of the component framework initialization event.
[0148] It should be understood that the identifier of the component framework initialization event is used to identify the component framework initialization event.
[0149] In some possible implementations, when multiple events include a component framework initialization event, the first terminal encodes the multiple events, including: the first terminal obtaining the node information of each node included in the component framework of the target mini-program, the initialization timestamp of the component framework, the identifier of the component framework initialization event, and the event type of the component framework initialization event recorded in the component framework initialization event; and encoding the node information of each node included in the component framework, the initialization timestamp of the component framework, the identifier of the component framework initialization event, and the event type of the component framework initialization event, so as to realize the encoding of the component framework initialization event.
[0150] It should be understood that the event type of the component framework initialization event can be the component framework initialization event type.
[0151] It should be noted that the embodiments of this application do not impose restrictions on the encoding method of component framework initialization events.
[0152] In some possible implementations, when multiple events include component framework change events, the first terminal encodes multiple events, including: obtaining node information of the changed nodes included in the component framework of the target mini-program recorded in the component framework change event; and encoding the node information of the changed nodes to achieve the encoding of the component framework change event.
[0153] In some possible implementations, when a changed node is inserted, the node information of the inserted node includes at least one of the following, but is not limited to:
[0154] The type of insertion operation corresponding to the inserted node;
[0155] The insertion timestamp of the inserted node;
[0156] The identifier of the inserted node;
[0157] The identifier of the parent node of the inserted node;
[0158] The index of the inserted node under its parent node;
[0159] Insert the node's label;
[0160] The attributes of the inserted node.
[0161] For example, the data structure of the insertion node in the component framework can be as follows:
[0162]
[0163] In some possible implementations, when a node is changed to a deleted node, the node information of the deleted node includes at least one of the following, but is not limited to:
[0164] The deletion operation type corresponding to the deleted node;
[0165] The identifier of the deleted node;
[0166] The deletion timestamp of the deleted node.
[0167] For example, the data structure for deleting a node in the component framework can be as follows:
[0168]
[0169] In some possible implementations, when a change node is an attribute update node, the node information of the attribute update node includes at least one of the following, but is not limited to:
[0170] The update operation type corresponding to the attribute update node;
[0171] The identifier of the attribute update node;
[0172] Update the attributes of the attribute update node;
[0173] The update timestamp of the attribute update node.
[0174] For example, the data structure of the property update node in the component framework can be as follows:
[0175]
[0176] In some possible implementations, when multiple events include component framework change events, the first terminal encodes multiple events, including: obtaining node information of the changed nodes included in the component framework of the target mini-program and the identifier of the component framework change event recorded in the component framework change event; and encoding the node information of the changed nodes and the identifier of the component framework change event to achieve the encoding of the component framework change event.
[0177] It should be understood that the identifier for this component framework change event is used to identify the component framework change event.
[0178] In some possible implementations, when multiple events include component framework change events, the first terminal encodes multiple events, including: obtaining the node information of the changed nodes included in the component framework of the target mini-program, the identifier of the component framework change event, and the event type of the component framework change event recorded in the component framework change event; and encoding the node information of the changed nodes, the identifier of the component framework change event, and the event type of the component framework change event to achieve the encoding of the component framework change event.
[0179] It should be understood that the event type of this component framework change event can be the component framework change event type.
[0180] It should be noted that the embodiments of this application do not impose restrictions on the encoding method for component framework change events.
[0181] In some possible implementations, when multiple events include object interaction events, the first terminal encodes the multiple events, including: the first terminal acquiring event information recorded in the object interaction events; and encoding the event information to achieve the encoding of the object interaction events.
[0182] In some implementations, when the object interaction event is a click event, the event information includes at least one of the following, but is not limited to:
[0183] Click operation type;
[0184] Click the timestamp;
[0185] Click the object's identifier;
[0186] Click on location information.
[0187] For example, the data structure for a click event can be as follows:
[0188]
[0189] In some implementations, when the object interaction event is a swipe event, the event information includes at least one of the following, but is not limited to:
[0190] Slide operation type;
[0191] Sliding timestamp;
[0192] Content displayed before swiping;
[0193] The content displayed after sliding.
[0194] For example, the data structure for a swipe event can be as follows:
[0195]
[0196] In some possible implementations, when multiple events include object interaction events, the first terminal encodes the multiple events, including: the first terminal acquiring event information recorded in the object interaction events; and inputting the event information into a first neural network model to obtain the encoding of the event information, thereby realizing the encoding of the object interaction events.
[0197] In some implementations, the first neural network model can be trained using training samples. Each training sample may include event information of an object interaction event and the actual encoding of that event information, where the actual encoding can serve as a sample label. The training device can employ supervised training; for example, it can input the event information of an object interaction event into the first neural network model and output a predicted encoding of that event information. Further, the training device can calculate a loss based on the actual encodings included in all training samples and the corresponding predicted encodings, and adjust the parameters of the first neural network model based on this loss until the training iterations reach a preset number or the loss reaches its minimum value, at which point training stops.
[0198] In some implementations, the training device may use any of the following loss functions when training the first neural network model, but is not limited to: L1 loss function, mean squared error (MSE) loss function, cross-entropy loss function, etc.
[0199] It should be noted that the embodiments of this application do not impose any restrictions on the encoding method of object interaction events.
[0200] In some possible implementations, when multiple events include page jump events, the first terminal encodes the multiple events, including: the first terminal acquiring page jump information recorded in the page jump event; and encoding the page jump information to achieve encoding of the page jump event.
[0201] In some possible implementations, the page redirection information includes at least one of the following, but is not limited to:
[0202] Page redirection type;
[0203] Page redirect timestamp;
[0204] The path to the page before the redirect;
[0205] The path to the page after redirection;
[0206] Parameters carried during page redirection.
[0207] In some possible implementations, page redirection types include, but are not limited to:
[0208] A page redirection type that retains the current page and redirects to a new page;
[0209] This type of page redirection closes the current page and redirects to a new page.
[0210] Page redirection type that closes all pages and redirects to a new page;
[0211] This is a page navigation type that redirects to the tabBar page and closes other pages.
[0212] A page navigation type that returns to the previous page or multiple levels of pages.
[0213] For example, the `navigateTo` method in a mini-program is a page navigation type that preserves the current page and navigates to a new page. Its function is to retain the current page and navigate to a specific page within the application. The new page is added to the page stack, and the object can return to the original page using the back arrow in the upper left corner or by calling the `navigateBack` method. It is suitable for situations where it's necessary to navigate to a new page while preserving the state of the original page, such as navigating from a list page to a details page.
[0214] For example, the `redirectTo` method in a mini-program is a page redirection type that closes the current page and redirects to a new page. Its function is to close the current page and redirect to a specific page within the application. The new page replaces the current page and is added to the page stack, but a back arrow will not appear in the top left corner, and the object cannot return to the original page using the back arrow. It is suitable for situations where the current page needs to be closed and redirected to a new page, such as redirecting to the homepage after successful login.
[0215] For example, the `reLaunch` method in a mini-program closes all pages and redirects to a new page; its function is to close all pages and open a specific page within the application. This clears the page stack, leaving only the new page. The object cannot return to a previous page using the `back` operation. It is suitable for situations where all pages need to be closed and a new page opened, such as when an object logs out and redirects to the login page.
[0216] For example, the `switchTab` method in a mini-program is a page navigation type that navigates to a tabBar page and closes other pages. Its function is to navigate to a tabBar page and close all other non-tabBar pages. This method can only be used to navigate to a tabBar page and will clear the page stack of non-tabBar pages. It is suitable for situations where you need to navigate to a tabBar page, such as navigating from another page to the homepage.
[0217] For example, the `navigateBack` method in a WeChat Mini Program is a page navigation type that returns to the previous page or multiple levels of pages. Its function is to close the current page and return to the previous page or multiple levels of pages. This method performs the return operation based on the page stack. It is suitable for situations where you need to return from the current page to the previous page or multiple levels of pages.
[0218] In some implementations, the path to the page before the redirect refers to the Uniform Resource Locator (URL) of the page before the redirect, but it is not limited to this.
[0219] In some implementations, the path to the redirected page refers to the URL of the redirected page, but this is not the only one.
[0220] For example, the data structure for a page navigation event of type navigateTo can be as follows:
[0221]
[0222] In some possible implementations, when multiple events include page jump events, the first terminal encodes the multiple events, including: the first terminal acquiring page jump information and the identifier of the page jump event recorded in the page jump event; and encoding the page jump information and the identifier of the page jump event to achieve encoding of the page jump event.
[0223] It should be understood that the identifier for this page redirection event is used to identify the page redirection event.
[0224] In some possible implementations, when multiple events include page jump events, the first terminal encodes the multiple events, including: the first terminal acquiring the page jump information, the identifier of the page jump event, and the event type of the page jump event recorded in the page jump event; and encoding the page jump information, the identifier of the page jump event, and the event type of the page jump event to achieve the encoding of the page jump event.
[0225] It should be understood that the event type of this page redirection event can be a page redirection event type.
[0226] It should be noted that the embodiments of this application do not impose restrictions on the encoding method for page jump events.
[0227] In some implementations, the first terminal may use the JavaScript programming language to encode multiple events, but this is not a limitation.
[0228] It should be understood that JavaScript is a lightweight, interpreted or just-in-time compiled programming language that can add dynamic content and interactivity to web pages.
[0229] It should be understood that when the first terminal encodes multiple events, the order of these events does not change; that is, they are still arranged in chronological order according to their timestamps.
[0230] S230: The first terminal serializes the encoded events to obtain an event sequence;
[0231] In some implementations, the first terminal can serialize the encoded events using Protocol Buffers (protobuf) to obtain an event sequence.
[0232] It should be understood that protobuf is a binary data serialization format. It boasts efficient encoding and decoding performance, enabling efficient data transmission over networks. Protobuf requires defining the data structure first, followed by generating code in the corresponding language for serialization and deserialization.
[0233] It should be understood that the first terminal may also use other serialization methods, such as JavaScript Object Notation (JSON) serialization, Extensible Markup Language (XML) serialization, Binary JSON (BSON) serialization, etc.
[0234] S240: The first terminal sends the event sequence to the backend server;
[0235] It should be understood that after obtaining the event sequence, the backend server can store the event sequence, which will then facilitate the second terminal to retrieve the event sequence from the backend server.
[0236] In some implementations, the first terminal can periodically collect events from the logs. Therefore, the first terminal will generate an event sequence at regular intervals, such as every 10 milliseconds. Based on this, the backend server can insert these event sequences into the event queue according to the order in which they were generated.
[0237] S250: The second terminal retrieves the event sequence from the backend server;
[0238] In some implementations, the second terminal can request the event sequence from the backend server via an Application Programming Interface (API) to retrieve the event sequence.
[0239] In some implementations, the backend server can use a first-in-first-out (FIFO) principle to retrieve the event sequence from the event queue and send it to the second terminal.
[0240] S260: The second terminal deserializes the event sequence to obtain the encoded event;
[0241] It should be understood that the deserialization method used by the second terminal corresponds to the serialization method used by the first terminal. For example, when the first terminal uses the protobuf method to serialize the encoded event, the second terminal can use the deserialization function of the protobuf method to deserialize the event sequence and obtain the encoded event.
[0242] S270: The second terminal executes the encoded event and displays the execution process of the encoded event.
[0243] As mentioned above, each encoded event has its own timestamp. Based on this, the second terminal can arrange these events in chronological order and execute the encoded events sequentially.
[0244] For example, suppose the encoded events include: event 1, with a timestamp of 1618303000000; event 2, with a timestamp of 1618303000003; event 3, with a timestamp of 1618303000007; and event 4, with a timestamp of 1618303000010. Based on this, the second terminal can execute events 1, 2, 3, and 4 sequentially.
[0245] In some possible implementations, the second terminal executes the encoded events, including: the second terminal determines the execution duration of each event based on the timestamp of each event in the encoded events; and executes each event sequentially according to the order of the timestamps and the execution duration.
[0246] In some implementation methods, the second terminal determines the execution duration of each event based on the timestamps of each event in the encoded event, including: for any two adjacent events in each event, the second terminal calculates the time difference between the timestamp of the latter event and the timestamp of the former event to obtain the execution duration of the former event.
[0247] For example, suppose the encoded events include: event 1, with a timestamp of 1618303000000; event 2, with a timestamp of 1618303000003; event 3, with a timestamp of 1618303000007; and event 4, with a timestamp of 1618303000010. Based on this, the second terminal can calculate the time difference between the timestamp of event 2 (1618303000003) and the timestamp of event 1 (1618303000000), and obtain the execution time of event 1 as 3; calculate the time difference between the timestamp of event 3 (1618303000007) and the timestamp of event 2 (1618303000003), and obtain the execution time of event 2 as 4; calculate the time difference between the timestamp of event 4 (1618303000010) and the timestamp of event 3 (1618303000007), and obtain the execution time of event 3 as 3.
[0248] It should be understood that, as mentioned above, the first terminal can generate an event sequence at regular intervals. Based on this, for any event sequence that is not the last, the execution duration of the last event in that event sequence can be the time difference between the timestamp of the first event in the next event sequence and the timestamp of the last event. For the last event sequence, the execution duration of the last event in that event sequence can be a default value, but is not limited to this.
[0249] For example, suppose there are other event sequences after the event sequence consisting of events 1-4. For instance, the first event in the next event sequence consisting of events 1-4 is event 5, and the event stamp of event 5 is 1618303000012. Based on this, the second terminal calculates the time difference between the timestamp of event 5 (1618303000012) and the timestamp of event 4 (1618303000010), and obtains that the execution time of event 4 is 2.
[0250] For example, assuming that the event sequence consisting of events 1-4 above is the last event sequence, then the execution time of event 4 in the second terminal is 1 by default.
[0251] In some implementations, the second terminal determines the execution duration of each event based on the timestamps of each event in the encoded event, including: the second terminal inputs the timestamps of each event in the encoded event into the second neural network model to obtain the execution duration of each event.
[0252] In some implementations, the second neural network model can be trained using training samples. Each training sample can include: timestamps of multiple events and the actual execution duration of multiple events, where the actual execution duration can serve as the sample label. The training device can employ supervised training methods; for example, it can input the timestamps of multiple events into the second neural network model and output the predicted execution duration of multiple events. Further, the training device can calculate a loss based on the actual execution duration included in all training samples and the corresponding predicted execution duration, and adjust the parameters of the second neural network model based on this loss until the training iterations reach a preset number or the loss reaches its minimum value, at which point training stops.
[0253] In some implementations, the training device may use any of the following loss functions when training the second neural network model, but is not limited to: L1 loss function, MSE loss function, cross-entropy loss function, etc.
[0254] It should be understood that the embodiments of this application do not limit the calculation method for the execution time of each event.
[0255] In some implementations, the first terminal can use a timer to execute each event sequentially according to the order of its timestamps and execution duration, in order to simulate or replay the execution process of each event.
[0256] For example, here is the pseudocode for executing each event:
[0257]
[0258] elif event.type == 'click':
[0259] applyClickEvent(event)
[0260] elif event.type=='navigateTo':
[0261] applyNavigateEvent(event)
[0262] #Handling other types of events...
[0263] In some implementations, when the second terminal executes a component framework initialization event or a component framework change event, it can use the rendering module provided by the component framework of the target mini-program to render the user interface, thereby displaying the various UI components on the target mini-program.
[0264] In some implementations, for object interaction events, the second terminal can draw a dot at the interaction location when executing the event to visualize the object interaction event.
[0265] For example, Figure 3 A user interface diagram provided for an embodiment of this application, such as... Figure 3 As shown, when the second terminal executes a click event, it can draw a dot at the click location to visualize the click event.
[0266] In some implementations, when a page navigation event occurs, the second terminal can automatically schedule multiple pages related to the event and visually display one of them. For example, a mini-program might contain a Home Page, a Detail Page, and a Result Page. When an object clicks a button on the Home Page, triggering a page navigation event, the second terminal needs to automatically schedule these three pages and ultimately visually display the Detail Page.
[0267] It should be noted that mini-programs can, to a certain extent, manage and schedule multiple pages, which is a characteristic of mini-programs.
[0268] In some implementations, the second terminal displays the execution process of the encoded event, including: displaying the execution process of the encoded event in a first display area.
[0269] In some possible implementations, the second terminal may display the execution process of the encoded event in the first display area in the form of video, but is not limited to this.
[0270] In some implementations, while the second terminal displays the execution process of the encoded event in the first display area, it can also simultaneously display the description information of the currently executed event in the second display area; wherein the first display area and the second display area are different.
[0271] In some implementations, if the current execution event is a component framework initialization event, the description information of the current execution event includes, but is not limited to, the event type of the component framework initialization event and the timestamp of the component framework initialization event.
[0272] In some implementations, if the current execution event is a component framework change event, the description information of the current execution event includes, but is not limited to, the event type of the component framework change event and the timestamp of the component framework change event.
[0273] In some implementations, if the currently executed event is an object interaction event, the description information of the currently executed event includes, but is not limited to, the event type of the object interaction event and the timestamp of the object interaction event.
[0274] In some implementations, if the currently executed event is a page redirection event, the description information of the currently executed event includes, but is not limited to, the path of the page after redirection and the timestamp of the page redirection event.
[0275] In some implementations, the second terminal may display, in addition to the description information of the currently executed event, the description information of the events preceding and / or following the currently executed event in the second display area, wherein the amount of description information displayed depends on the size of the second display area.
[0276] For example, Figure 4 Another user interface diagram provided for an embodiment of this application, such as Figure 4 As shown, the second terminal displays the execution process of the encoded event in video format in the first display area. Assuming the current video playback reaches time point 00:04, the second display area can display the description information of the click event corresponding to 00:04, including the click event type and timestamp 00:04. Before that, the description information corresponding to 00:00 is also displayed, including the start of collection and timestamp 00:00. The description information of the page jump event corresponding to 00:02 is also displayed, including the path of the page after the jump and the timestamp 00:02 of the page jump event. After that, the description information of the click event corresponding to 00:06 is also displayed, including the click event type and timestamp 00:06. The description information of the page jump event corresponding to 00:08 is also displayed, including the path of the page after the jump and the timestamp 00:08 of the page jump event.
[0277] In some implementations, the second terminal receives a click operation on the first description information in the second display area, and responds to the click operation to drag the progress bar of the execution process of the encoded event to the timestamp position included in the first description information, so as to display the execution process of the encoded event from that position.
[0278] In some implementations, as the progress bar of the execution process of the encoded event is dragged to the timestamp position included in the first description information, the description information displayed in the second display area includes at least the first description information, and may also include description information of events before and / or after the event corresponding to the first description information.
[0279] For example, Figure 5 This is another user interface illustration provided in an embodiment of the present application. It is assumed that before the object clicks on any descriptive information in the second display area, the user interface is as follows: Figure 4 As shown, when an object clicks the description information of the page jump event corresponding to 00:08 in the second display area, the progress bar of the encoded event execution process is dragged to the time point 00:08 to display the execution process of the encoded event from that position, as shown. Figure 5 As shown. At the same time, as Figure 5 As shown, the descriptive information displayed in the second display area of this user interface is consistent with... Figure 4 The descriptive information displayed in the second display area of the user interface shown is different.
[0280] In some implementations, the first display area can be enlarged or reduced.
[0281] In some implementations, the second display area can be enlarged or reduced.
[0282] This application provides a log visualization method, comprising: a first terminal collecting multiple events from a log based on the chronological order of event timestamps; the first terminal encoding the multiple events to obtain encoded events; the first terminal serializing the encoded events to obtain an event sequence; the first terminal sending the event sequence to a backend server; a second terminal retrieving the event sequence from the backend server, deserializing the event sequence to obtain encoded events, executing the encoded events, and simultaneously displaying the execution process of the encoded events. This log visualization method allows log analysts to perform log analysis intuitively, thereby improving their user experience. It significantly improves the efficiency and effectiveness of log analysts in analyzing object behavior and program experience.
[0283] Furthermore, by synchronously displaying event descriptions in the second display area, and by synchronizing the event execution progress bar when an object clicks on a description, the user experience for log analysts can be further improved.
[0284] The preferred embodiments of this application have been described in detail above with reference to the accompanying drawings. However, this application is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this application, various simple modifications can be made to the technical solutions of this application, and these simple modifications all fall within the protection scope of this application. For example, the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, this application will not describe the various possible combinations separately. Furthermore, various different embodiments of this application can also be arbitrarily combined, as long as they do not violate the spirit of this application, they should also be considered as the content disclosed in this application.
[0285] It should also be understood that, in the various method embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0286] The methods provided in the embodiments of this application have been described above. The log visualization device provided in the embodiments of this application will be described below.
[0287] Figure 6 A schematic diagram of a log visualization device 600 provided in an embodiment of this application is shown below. Figure 6 As shown, the device 600 includes: a collection module 610, an encoding module 620, a serialization module 630, and a sending module 640. The collection module 610 is used to collect multiple events from the log based on the chronological order of the event timestamps; the encoding module 620 is used to encode the multiple events to obtain encoded events; the serialization module 630 is used to serialize the encoded events to obtain an event sequence; and the sending module 640 is used to send the event sequence to a background server so that a second terminal can pull the event sequence from the background server, deserialize the event sequence to obtain encoded events, execute the encoded events, and simultaneously display the execution process of the encoded events.
[0288] In some implementations, the log is the log of the target mini-program; in the case where multiple events include a component framework initialization event, the encoding module 620 is specifically used to: obtain the node information of each node included in the component framework of the target mini-program and the initialization timestamp of the component framework recorded in the component framework initialization event; and encode the node information of each node included in the component framework and the initialization timestamp of the component framework.
[0289] In some implementations, for each node included in the component framework, the node information includes at least one of the following:
[0290] Node identifier;
[0291] The identifier of the node's parent node;
[0292] Node labels;
[0293] Node attributes.
[0294] In some implementations, the log is the log of the target mini-program; in the case where multiple events include component framework change events, the encoding module 620 is specifically used to: obtain the node information of the changed nodes included in the component framework of the target mini-program recorded in the component framework change event; and encode the node information of the changed nodes.
[0295] In some implementations, the change node is replaced with an insertion node; wherein the node information of the insertion node includes at least one of the following:
[0296] The type of insertion operation corresponding to the inserted node;
[0297] The insertion timestamp of the inserted node;
[0298] The identifier of the inserted node;
[0299] The identifier of the parent node of the inserted node;
[0300] The index of the inserted node under its parent node;
[0301] Insert the node's label;
[0302] The attributes of the inserted node.
[0303] In some implementations, the change node is replaced by the deletion node; wherein the node information of the deleted node includes at least one of the following:
[0304] The deletion operation type corresponding to the deleted node;
[0305] The identifier of the deleted node;
[0306] The deletion timestamp of the deleted node.
[0307] In some implementations, the change node is an attribute update node; wherein the node information of the attribute update node includes at least one of the following:
[0308] The update operation type corresponding to the attribute update node;
[0309] The identifier of the attribute update node;
[0310] Update the attributes of the attribute update node;
[0311] The update timestamp of the attribute update node.
[0312] In some implementations, where multiple events include object interaction events, the encoding module 620 is specifically used to: obtain event information recorded in the object interaction events; and encode the event information.
[0313] In some implementations, the object interaction event is a click event; wherein the event information includes at least one of the following:
[0314] Click operation type;
[0315] Click the timestamp;
[0316] Click the object's identifier;
[0317] Click on location information.
[0318] In some implementations, the object interaction event is a swipe event; where the event information includes at least one of the following:
[0319] Slide operation type;
[0320] Sliding timestamp;
[0321] Content displayed before swiping;
[0322] The content displayed after sliding.
[0323] In some possible implementations, when multiple events include page jump events, the encoding module 620 is specifically used to: obtain page jump information recorded in the page jump event; and encode the page jump information.
[0324] In some possible implementations, the page redirection information includes at least one of the following:
[0325] Page redirection type;
[0326] Page redirect timestamp;
[0327] The path to the page before the redirect;
[0328] The path to the page after redirection;
[0329] Parameters carried during page redirection.
[0330] It should be understood that the device embodiments and method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, further details will not be provided here. Specifically, Figure 6The apparatus 600 shown can execute the method embodiment corresponding to the first terminal side, and the foregoing and other operations and / or functions of each module in the apparatus 600 are respectively for implementing the corresponding process in the method embodiment corresponding to the first terminal side. For the sake of brevity, they will not be described in detail here.
[0331] The apparatus 600 of this application embodiment has been described above from the perspective of functional modules in conjunction with the accompanying drawings. It should be understood that this functional module can be implemented in hardware, in software instructions, or in a combination of hardware and software modules. Specifically, the steps of the method embodiments in this application can be completed by integrated logic circuits in the processor's hardware and / or by software instructions. The steps of the method disclosed in this application embodiment can be directly embodied as being executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. Optionally, the software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps in the above method embodiments.
[0332] Figure 7 A schematic diagram of a log visualization device 700 provided in an embodiment of this application is shown below. Figure 7 As shown, the device 700 includes: a pull module 710, a deserialization module 720, an execution module 730, and a display module 740. The pull module 710 is used to pull event sequences from a background server; the deserialization module 720 is used to deserialize the event sequences to obtain encoded events; the execution module 730 and the display module 740 are used to execute the encoded events and display the execution process of the encoded events.
[0333] In some implementations, the execution module 730 is specifically used to: determine the execution duration of each event based on the timestamp of each event in the encoded event; and execute each event sequentially according to the order of the timestamps and the execution duration.
[0334] In some implementations, the execution module 730 is specifically used to: for any two adjacent events in each event, calculate the time difference between the timestamp of the latter event and the timestamp of the former event, and obtain the execution duration of the former event.
[0335] In some implementations, the display module 740 is specifically used to: display the execution process of the encoded event in the first display area.
[0336] In some implementations, the display module 740 is also used to: display the execution process of the encoded event in the first display area while simultaneously displaying the description information of the currently executed event in the second display area; wherein the first display area and the second display area are different.
[0337] It should be understood that the device embodiments and method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, further details will not be provided here. Specifically, Figure 7 The apparatus 700 shown can execute the method embodiment corresponding to the second terminal side, and the foregoing and other operations and / or functions of each module in the apparatus 700 are respectively for implementing the corresponding process in the method embodiment corresponding to the second terminal side. For the sake of brevity, they will not be described in detail here.
[0338] The apparatus 700 of this application embodiment has been described above from the perspective of functional modules in conjunction with the accompanying drawings. It should be understood that this functional module can be implemented in hardware, in software instructions, or in a combination of hardware and software modules. Specifically, the steps of the method embodiments in this application can be completed by integrated logic circuits in the processor's hardware and / or by software instructions. The steps of the method disclosed in this application embodiment can be directly embodied as being executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. Optionally, the software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps in the above method embodiments.
[0339] Figure 8 This is a schematic block diagram of an electronic device 800 provided in an embodiment of this application. The electronic device 800 may be the first terminal or the second terminal described above, but is not limited thereto. Figure 8 As shown, the electronic device 800 may include:
[0340] The system includes a memory 810 and a processor 820. The memory 810 stores a computer program 830 and transfers the computer program 830 to the processor 820. In other words, the processor 820 can retrieve and run the computer program 830 from the memory 810 to implement the methods described in the embodiments of this application.
[0341] For example, the processor 820 can be used to execute the steps in the above method according to the instructions in the computer program 830.
[0342] In some embodiments of this application, the processor 820 may include, but is not limited to:
[0343] General-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0344] In some embodiments of this application, the memory 810 includes, but is not limited to:
[0345] Volatile memory and / or non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).
[0346] In some embodiments of this application, the computer program 830 may be divided into one or more modules, which are stored in the memory 810 and executed by the processor 820 to perform the method provided in this application. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program 830 in the electronic device.
[0347] like Figure 8 As shown, the electronic device 800 may further include:
[0348] Transceiver 840, which can be connected to processor 820 or memory 810.
[0349] The processor 820 can control the transceiver 840 to communicate with other devices; specifically, it can send information or data to other devices or receive information or data sent by other devices. The transceiver 840 may include a transmitter and a receiver. The transceiver 840 may further include antennas, and the number of antennas may be one or more.
[0350] It should be understood that the various components in the electronic device 800 are connected through a bus system, which includes a data bus, a power bus, a control bus, and a status signal bus.
[0351] According to one aspect of this application, a computer storage medium is provided that stores a computer program thereon, which, when executed by a computer, enables the computer to perform the methods of the above-described method embodiments. Alternatively, embodiments of this application also provide a computer program product containing instructions that, when executed by a computer, cause the computer to perform the methods of the above-described method embodiments.
[0352] According to another aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method described in the above-described method embodiments.
[0353] In other words, when implemented using software, it can be implemented wholly or partially in the form of a computer program product. This computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disc (DVD)), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0354] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0355] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.
[0356] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to implement the solution of this embodiment according to actual needs. For example, the functional modules in the various embodiments of this application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0357] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A log visualization method, characterized in that, The method is applied to a first terminal, and the method includes: Collect multiple events from the log based on the order of their timestamps. The multiple events are encoded to obtain the encoded events; The encoded events are serialized to obtain an event sequence; The event sequence is sent to the backend server so that the second terminal can pull the event sequence from the backend server, deserialize the event sequence to obtain the encoded event, execute the encoded event, and display the execution process of the encoded event.
2. The method according to claim 1, characterized in that, The logs mentioned are those of the target mini-program; In the case where the plurality of events includes a component framework initialization event, the encoding of the plurality of events includes: Obtain the node information of each node included in the component framework of the target mini-program and the initialization timestamp of the component framework as recorded in the component framework initialization event; The node information of each node included in the component framework and the initialization timestamp of the component framework are encoded.
3. The method according to claim 2, characterized in that, For each node included in the component framework, the node information includes at least one of the following: The identifier of the node; The identifier of the parent node of the node; The label of the node; The attributes of the node.
4. The method according to any one of claims 1-3, characterized in that, The logs mentioned are those of the target mini-program; In the case where the plurality of events includes component framework change events, the encoding of the plurality of events includes: Obtain the node information of the changed nodes included in the component framework of the target mini-program recorded in the component framework change event; The node information of the changed node is encoded.
5. The method according to claim 4, characterized in that, The changed node is an inserted node; The node information of the inserted node includes at least one of the following: The insertion operation type corresponding to the insertion node; The insertion timestamp of the inserted node; The identifier of the inserted node; The identifier of the parent node of the inserted node; The index of the inserted node under the parent node; The label of the inserted node; The attributes of the inserted node.
6. The method according to claim 4, characterized in that, The changed node is a deleted node; The node information of the deleted node includes at least one of the following: The deletion operation type corresponding to the deleted node; The identifier of the node to be deleted; The deletion timestamp of the deleted node.
7. The method according to claim 4, characterized in that, The change node is an attribute update node; The node information of the attribute update node includes at least one of the following: The update operation type corresponding to the attribute update node; The attribute update node's identifier; The attribute update node updates its attributes; The update timestamp of the attribute update node.
8. The method according to any one of claims 1-3, characterized in that, In the case where the plurality of events includes object interaction events, the encoding of the plurality of events includes: Obtain the event information recorded in the object's interaction events; The event information is encoded.
9. The method according to claim 8, characterized in that, The object interaction event is a click event; The event information includes at least one of the following: Click operation type; Click the timestamp; Click the object's identifier; Click on location information.
10. The method according to any one of claims 1-3, characterized in that, In the case where the plurality of events includes a page redirection event, encoding the plurality of events includes: Retrieve the page redirection information recorded in the page redirection event; The page redirection information is encoded.
11. The method according to claim 10, characterized in that, The page redirection information includes at least one of the following: Page redirection type; Page redirect timestamp; The path to the page before the redirect; The path to the page after redirection; Parameters carried during page redirection.
12. A log visualization method, characterized in that, The method is applied to a second terminal, and the method includes: Retrieve the event sequence from the backend server; The event sequence is deserialized to obtain the encoded events; The encoded event is executed, and the execution process of the encoded event is displayed.
13. The method according to claim 12, characterized in that, The event of executing the encoded code includes: Based on the timestamps of each event in the encoded event, the execution duration of each event is determined; The events are executed sequentially according to their timestamps and execution duration.
14. The method according to claim 13, characterized in that, Determining the execution duration of each event based on the timestamps of each event in the encoded event includes: For any two adjacent events in each event, calculate the time difference between the timestamp of the latter event and the timestamp of the former event to obtain the execution duration of the former event.
15. The method according to any one of claims 12-14, further comprising: While displaying the execution process of the encoded event in the first display area, the description information of the currently executing event is displayed simultaneously in the second display area. The first display area is different from the second display area.
16. A log visualization device, characterized in that, include: The acquisition module is used to collect multiple events from the log based on the order of their timestamps. An encoding module is used to encode the multiple events to obtain encoded events; A serialization module is used to serialize the encoded events to obtain an event sequence; The sending module is used to send the event sequence to the backend server so that the second terminal can pull the event sequence from the backend server, deserialize the event sequence to obtain the encoded event, execute the encoded event, and display the execution process of the encoded event.
17. A log visualization device, characterized in that, include: The pull module is used to pull event sequences from the backend server; A deserialization module is used to deserialize the event sequence to obtain the encoded events; The execution module and the display module are used to execute the encoded event and display the execution process of the encoded event, respectively.
18. An electronic device, characterized in that, include: A processor and a memory, the memory being used to store a computer program, the processor being used to invoke and run the computer program stored in the memory to perform the method of any one of claims 1 to 15.
19. A computer-readable storage medium, characterized in that, Used to store a computer program that causes a computer to perform the method as described in any one of claims 1 to 15.
20. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the method as described in any one of claims 1 to 15.