Operation record tracing method, device and equipment and storage medium
By using Kafka and Elasticsearch to generate the target timeline in the microservice architecture, the problem that traditional logging methods cannot track the request call chain is solved, and the full process traceability of user operation records is realized, and data processing efficiency and information accuracy are improved.
Patent Information
- Application Number
- CN202510520857.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2025-07-25
AI Technical Summary
In the microservice architecture, traditional logging methods cannot effectively capture the flow of requests between multiple services, and it is difficult to meet the comprehensive tracking requirements of the request call chain.
By obtaining the initial feature information of user operation records, using Kafka for message queue storage and format conversion, combining the balancing load and intelligent routing strategy of Elasticsearch search engine, the target timeline is generated for display, so as to realize the full process traceability of user operation records.
The data processing volume is improved, the integrity of the timeline and the accuracy of information are ensured, and users can intuitively understand the sequence and logical relationship between operations, realizing the full process traceability of user operations.
Smart Images

Figure CN120371673A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of link tracing, and particularly relates to a method, device, equipment and storage medium for tracing operation records. Background Art
[0002] In today's software development field, the microservices architecture is widely popular due to its flexibility and scalability. However, with the increase in the number of microservices, the complexity of distributed systems also rises. In this environment, a user request may need to pass through multiple service nodes to be processed, which makes it extremely difficult to trace the entire request process.
[0003] Currently, traditional logging methods usually only focus on a single service or node, and this method cannot effectively capture the transfer process of requests between multiple services, thus making it difficult to meet the comprehensive tracing requirements of the request call chain. Therefore, how to trace the entire process of users' operation records has become a technical problem to be solved currently. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a method, device, equipment and storage medium for tracing operation records, which realizes the tracing of users' operation records by using a timeline to display each target feature information. The specific solutions are as follows:
[0005] In a first aspect, the present application provides a method for tracing operation records, including:
[0006] Obtain operation records of different users and the initial feature information respectively corresponding to each operation record, encapsulate each initial feature information into a target message body, and store the target message body into a target message queue in Kafka; the initial feature information includes the operation time, operation metrics, operation type and identity identification number of the operating user corresponding to the operation record; the operation metrics include the response time of the operation and the response rate of the operation;
[0007] Receive a data consumption instruction of a target user, obtain the target message body from the target message queue based on the data consumption instruction, and perform format conversion on each initial feature information in the target message body to obtain corresponding converted feature information;
[0008] Use a load balancing strategy and an intelligent routing strategy to store the converted feature information into an Elasticsearch search engine, obtain target search parameters input by the target user, and retrieve target feature information corresponding to the target search parameters from the converted feature information in the Elasticsearch search engine;
[0009] Sort the target feature information according to the operation time corresponding to each operation record to obtain a target time axis, and use the target time axis to display each target feature information so that the user can trace each operation record according to the target time axis.
[0010] Optionally, storing the target message body into the target message queue in Kafka includes:
[0011] Determine whether there is an exception in the storage process of the target message body. If there is no exception in the storage process of the target message body, jump to the step of receiving the data consumption instruction of the target user;
[0012] If there is an exception in the storage process of the target message body, store the target message body into the target message queue in Kafka again.
[0013] Optionally, before receiving the data consumption instruction of the target user, it further includes:
[0014] Determine whether the target user is an authorized user. If the target user is an authorized user, jump to the step of receiving the data consumption instruction of the target user;
[0015] If the target user is not an authorized user, reject receiving the data consumption instruction of the target user.
[0016] Optionally, using the target time axis to display each target feature information includes:
[0017] If the number of the target feature information is not less than a preset feature quantity threshold, quantify the importance of each target feature information, and screen out key feature information with importance greater than a preset importance threshold from each target feature information according to the corresponding quantification result;
[0018] Obtain the resolution of the display device corresponding to the target time axis; wherein, the target time axis supports zooming operations and can display each target feature information with different time granularities;
[0019] Determine the time intervals between key operation records based on each key feature information, determine the target time granularity corresponding to the target time axis according to each time interval, and display each key feature information based on the resolution, the target time granularity, and the target time axis; the key operation records are the operation records corresponding to the key feature information.
[0020] Optionally, using the target time axis to display each target feature information includes:
[0021] Obtain the data display rules customized by the target user, determine the display order and display positions of the target feature information according to the data display rules, and display the target feature information based on the display order, the display positions, and the target timeline.
[0022] Optionally, the displaying of the target feature information by using the target timeline includes:
[0023] Determine the target permission level corresponding to the target user, determine the displayable information from the target feature information according to the target permission level, and display the displayable information by using the target timeline.
[0024] Optionally, the displaying of the target feature information by using the target timeline includes:
[0025] Determine the abnormal operation records in each operation record according to the operation metrics included in each target feature information, and determine the abnormal feature information corresponding to each abnormal operation record from the target feature information;
[0026] Determine the abnormal types corresponding to the abnormal feature information, and assign different target display colors to the abnormal feature information according to the abnormal types;
[0027] Highlight the abnormal feature information by using the target display colors and the target timeline.
[0028] In a second aspect, the present application provides an operation record tracing device, including:
[0029] A feature information acquisition module, configured to acquire the operation records of different users and the initial feature information respectively corresponding to the operation records, encapsulate the initial feature information into a target message body, and store the target message body into a target message queue in Kafka; the initial feature information includes the operation time, operation metrics, operation type, and identity identification number of the operating user corresponding to the operation record; the operation metrics include the response time of the operation and the response rate of the operation;
[0030] A data format conversion module, configured to receive a data consumption instruction of a target user, obtain the target message body from the target message queue based on the data consumption instruction, and perform format conversion on the initial feature information in the target message body to obtain corresponding converted feature information;
[0031] A feature information retrieval module, which is used to store the converted feature information into an Elasticsearch search engine by using a load balancing strategy and an intelligent routing strategy, obtain target search parameters input by the target user, and retrieve target feature information corresponding to the target search parameters from the converted feature information in the Elasticsearch search engine;
[0032] A feature information display module, which is used to sort the target feature information according to the operation time corresponding to each operation record to obtain a target time axis, and use the target time axis to display each target feature information, so that the user can trace each operation record according to the target time axis.
[0033] In a third aspect, the present application provides an electronic device, including:
[0034] A memory, which is used to store a computer program;
[0035] A processor, which is used to execute the computer program to implement the foregoing operation record tracing method.
[0036] In a fourth aspect, the present application provides a computer-readable storage medium, which is used to store a computer program, and when the computer program is executed by a processor, the foregoing operation record tracing method is implemented.
[0037] This application first obtains the operation records of different users and the initial feature information corresponding to each of the operation records, encapsulates each of the initial feature information into a target message body, and stores the target message body in a target message queue in Kafka; the initial feature information includes the operation time, operation metrics, operation type, and identity identification number of the operating user corresponding to the operation record; the operation metrics include the response time of the operation and the response rate of the operation. Then, it receives a data consumption instruction of a target user, obtains the target message body from the target message queue based on the data consumption instruction, and performs format conversion on each of the initial feature information in the target message body to obtain corresponding converted feature information. After that, it uses a load balancing strategy and an intelligent routing strategy to store the converted feature information in an Elasticsearch search engine, obtains the target search parameters input by the target user, retrieves the target feature information corresponding to the target search parameters from the converted feature information in the Elasticsearch search engine, and finally sorts each of the target feature information according to the operation time corresponding to each of the operation records to obtain a target timeline, and uses the target timeline to display each of the target feature information, so that the user can trace each of the operation records according to the target timeline. It can be seen that this application improves the data processing volume by using Kafka to summarize and store the feature information corresponding to user operation records, thereby ensuring the data volume on the timeline and improving the integrity of the timeline; by using the Elasticsearch search engine, it ensures the accuracy of the user index structure, thus ensuring that the information in the generated target timeline highly corresponds to the user's retrieval requirements; by arranging the user operation records in chronological order and displaying them in the form of a timeline, the user can intuitively understand the sequence and logical relationship between each operation, realizing the full-process traceability of user operations. Description of the Drawings
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.
[0039] Figure 1 It is a flowchart of an operation record traceability method disclosed in this application;
[0040] Figure 2 It is a schematic diagram of the consumption process of Kafka messages disclosed in this application;
[0041] Figure 3 A schematic diagram of the process of writing messages into Elasticsearch disclosed in this application;
[0042] Figure 4 A schematic diagram of the process of querying operation records disclosed in this application;
[0043] Figure 5 A flowchart of the method for displaying operation records disclosed in this application;
[0044] Figure 6 A schematic diagram of user-defined configuration disclosed in this application;
[0045] Figure 7 A schematic diagram of the structure of an operation record traceability device disclosed in this application;
[0046] Figure 8 A structural diagram of an electronic device disclosed in this application. Detailed implementation manners
[0047] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0048] Currently, traditional log recording methods cannot effectively capture the transfer process of requests among multiple services, making it difficult to meet the comprehensive tracking requirements of request call chains. For this reason, this application provides an operation record traceability method, which realizes the traceability of user operation records by using a timeline to display each target feature information.
[0049] See Figure 1 As shown, an embodiment of the present invention discloses an operation record traceability method, including:
[0050] Step S11, obtain the operation records of different users and the initial feature information respectively corresponding to each of the operation records, encapsulate each of the initial feature information into a target message body, and store the target message body in a target message queue in Kafka; the initial feature information includes the operation time, operation metrics, operation type, and identity identification number of the operating user corresponding to the operation record; the operation metrics include the response time of the operation and the response rate of the operation.
[0051] As a high-throughput distributed messaging system, Kafka can process and store large amounts of event stream data, making it an ideal choice for collecting logs from each microservice node. Moreover, in Elasticsearch (a search engine), log events can be effectively indexed and organized, enabling developers and operations personnel to easily perform complex queries and real-time analysis. Therefore, in this embodiment, the tracing of user operation records is realized by leveraging Kafka and Elasticsearch. The overall process of this solution is as follows:
[0052] S1. Configure display items.
[0053] S101. Provide an item configuration module.
[0054] S102. Provide an interface to configure whether the fields of the item are displayed.
[0055] S103. Provide an interface to configure the display order of the fields.
[0056] S104. Provide an interface to configure the storage name of the fields.
[0057] S2. Publish user operation records to Kafka.
[0058] S201. Provide a module to extract the key information of user operation records (i.e., initial feature information) and publish it to the Kafka module.
[0059] S202. Assemble the key information of user operation records into a message body (i.e., target message body).
[0060] S203. Call the interface of Kafka to send the message body to the message queue of Kafka.
[0061] S3. Consume the messages of Kafka.
[0062] S301. Provide a module to consume Kafka messages.
[0063] S302. Start the consumption interface of Kafka messages.
[0064] S303. Call the interface to read the configuration information of the item.
[0065] S304. Replace the field names in the message body according to the configuration.
[0066] S4. Write the message to Elasticsearch.
[0067] S401. Provide an Elasticsearch interface module.
[0068] S402. Receive the processed messages of Kafka.
[0069] S403. Call the interface to write the message into Elasticsearch.
[0070] S5. The timeline (i.e., the target timeline) displays the call chain of the user operation records.
[0071] S501. Provide a timeline display module.
[0072] S502. Obtain the query conditions for the matter (i.e., the target search parameters).
[0073] S503. Obtain all the operation records related to the user according to the query conditions.
[0074] S504. Sort according to the time points in the operation records.
[0075] S505. The timeline displays the matters by using an adaptive timeline dynamic compression algorithm in the order from far to near.
[0076] S506. Use an embedded lightweight machine learning model to detect the operation records and highlight the abnormal operations.
[0077] In this embodiment, first, the initial feature information corresponding to the user operation records needs to be encapsulated into a target message body and the target message body is sent to Kafka; wherein, the process of storing the target message body into the target message queue in Kafka may specifically include: determining whether there is an abnormality in the storage process of the target message body. If there is no abnormality in the storage process of the target message body, then jump to the step of receiving the data consumption instruction of the target user; if there is an abnormality in the storage process of the target message body, then store the target message body into the target message queue in Kafka again.
[0078] Specifically, the process of publishing user operation records to Kafka involves multiple key steps. First, a module needs to be designed that can extract key information from user operation records. The above key information may include the user ID (Identity document, i.e., the identity identification number), operation type, operation time, etc. The key information is crucial for subsequent data analysis and processing. After extracting the key information, it is necessary to assemble the key information into a message body. This process needs to ensure that the format of the message body conforms to the requirements of Kafka so that it can be correctly processed by Kafka. The message body usually contains one or more key-value pairs, where the key is the category of information and the value is the specific information content. The assembled message body is then sent to the Kafka message queue. This step involves calling the interfaces provided by Kafka and passing the message body as a parameter to these interfaces. The Kafka interfaces are responsible for putting the message body into the appropriate message queue so that subsequent consumers can retrieve and process the above key messages from the queue. During the whole process, error handling and exception management also need to be considered. For example, if an error occurs during the sending of the message body, there needs to be a mechanism to retry the sending or record the error information. In addition, to ensure the stability and reliability of the system, it may also be necessary to monitor the status of Kafka to ensure that the system can receive and process messages normally. By leveraging the powerful message queue capabilities of Kafka, this embodiment can efficiently process and publish a large amount of user operation records, greatly improving the data throughput capacity and response speed of the system. Moreover, the distributed characteristics of Kafka also ensure the reliability and high availability of the data.
[0079] Step S12: Receive the data consumption instruction of the target user, obtain the target message body from the target message queue based on the data consumption instruction, and perform format conversion on each of the initial feature information in the target message body to obtain the corresponding converted feature information
[0080] In this embodiment, it is necessary to retrieve the target message body from the target message queue of Kafka according to the user's data consumption instruction and convert the format of the feature information therein. Specifically, this embodiment designs a module for consuming Kafka messages. Among them, the process of consuming Kafka messages is as follows Figure 2As shown, this module is used to efficiently process and receive messages from Kafka topics. By starting a dedicated consumption interface, it realizes real-time monitoring and processing of Kafka messages. During the module initialization phase, a configuration interface is called to read the configuration information of relevant matters, which includes detailed instructions on how to correctly parse and process each message. The above configuration information contains the mapping rules of field names, enabling the module to automatically replace the field names in the message body according to the preset rules. This replacement mechanism ensures that the content of the message conforms to the internal data format standard of the system before being further processed or stored. For example, if the original message uses "user_name" to represent the user name, and the standard field name within the system is "username", this module will automatically perform this conversion, thus avoiding data inconsistency issues. In addition, this module supports high-concurrency consumption and can process messages from multiple Kafka partitions simultaneously, greatly improving the throughput and efficiency of message processing. Moreover, this module also has an error retry mechanism. When encountering temporary problems during the consumption process, it can automatically retry to ensure that each message is processed accurately and without error.
[0081] It should be noted that in terms of security, this module implements role-based access control to ensure that only authorized consumers can connect to Kafka and consume messages. At the same time, it also supports SSL (Identity document, an encryption protocol) / TLS (Transport Layer Security, an encryption protocol) encryption to protect the security of data during transmission; correspondingly, before receiving the data consumption instruction of the target user, it also includes: judging whether the target user is an authorized user. If the target user is an authorized user, it jumps to the step of receiving the data consumption instruction of the target user; if the target user is not an authorized user, it refuses to receive the data consumption instruction of the target user. By configuring the error retry mechanism, the problem of data loss is avoided, and the robustness of the data transmission process is improved; by judging the user's permissions, role-based access is realized, thereby improving the security during the data transmission process.
[0082] Step S13: Use the load balancing strategy and the intelligent routing strategy to store the converted feature information in the Elasticsearch search engine, obtain the target search parameters input by the target user, and retrieve the target feature information corresponding to the target search parameters from the converted feature information in the Elasticsearch search engine.
[0083] In this embodiment, the converted feature information output by Kafka will be stored in the Elasticsearch search engine so that the feature information can be retrieved in the Elasticsearch search engine and then displayed using the timeline. The process of writing messages to the Elasticsearch search engine is as Figure 3 shown; specifically, when Kafka generates messages, these messages will be sent to the Elasticsearch interface module. Inside this module, the messages will go through a series of preprocessing steps, including verification, cleaning, and formatting, to ensure that they meet the data entry standards of Elasticsearch. This preprocessing stage can eliminate inconsistencies in the data and improve the efficiency of subsequent processing. Once the messages are preprocessed, the Elasticsearch interface module will call the corresponding API (Application Programming Interface) to perform the operation of writing the messages to Elasticsearch. This process involves complex index management, including determining the index where the messages should be stored and how to update the existing index structure most effectively. In this embodiment, the interface module plays a key role. Through intelligent routing and load balancing technologies, it ensures the high efficiency and low latency of the data writing operation. In addition, the Elasticsearch interface module also has a variety of built-in security mechanisms to protect the security and integrity of the data during transmission, including functions such as data encryption, access control, and audit logs. The above security measures ensure that sensitive information cannot be accessed without authorization and also provide system administrators with tools for monitoring and diagnosing problems. By cleaning, validating, and formatting the data, inconsistencies in the data are eliminated, thus improving the efficiency of subsequent processing. After storing the messages in the Elasticsearch search engine, it is necessary to query the feature information corresponding to the relevant operation records in the Elasticsearch search engine according to the user's target search parameters. The specific process is as Figure 4 shown.
[0084] Step S14: Sort the target feature information according to the operation time corresponding to each operation record to obtain a target timeline, and use the target timeline to display each target feature information so that the user can trace each operation record according to the target timeline.
[0085] In this embodiment, the process of displaying each piece of target feature information using the target timeline may specifically include: If the number of pieces of target feature information is not less than the preset feature quantity threshold, quantify the importance of each piece of target feature information, and screen out the key feature information with an importance greater than the preset importance threshold from each piece of target feature information according to the corresponding quantification result; obtain the resolution of the display device corresponding to the target timeline; wherein, the target timeline supports zooming operations and can display each piece of target feature information with different time granularities; determine the time intervals between each key operation record based on each piece of key feature information, determine the target time granularity corresponding to the target timeline according to each time interval, and display each piece of the key feature information based on the resolution, the target time granularity, and the target timeline; the key operation record is the operation record corresponding to the key feature information; that is, for a large number of operation records, the timeline module can automatically identify dense time periods, adopt a dynamic compression algorithm (such as aggregation based on a time window) to reduce the number of rendering nodes, while retaining the key event nodes. The user can view timelines with different granularities through zooming interactions. Integrate the LOD (Level of Detail, a rendering method) algorithm to dynamically adjust the event display density according to the screen resolution and the time range, ensuring a balance between high-performance rendering and user experience.
[0086] In this embodiment, the operation of displaying each piece of target feature information using the timeline is completed by the timeline display module. This module allows users to track and manage the activity history (i.e., operation records) through an intuitive timeline view. Additionally, the core functions of this module include obtaining the query conditions for matters, which usually involve the user inputting specific search parameters, such as date ranges, event types, or keywords, etc., in order to accurately locate the required data. Once the query conditions are determined, the system will retrieve all operation records related to the user; it can be understood that these records may contain various information, from simple clicks and page views to complex transactions and interaction behaviors. To ensure the orderly presentation of information, the system will sort according to the time points in the operation records, ensuring that each record can be accurately placed in the order of occurrence time. In the display of the timeline, the matters are arranged in the order from far to near, which means that the user can start viewing from the earliest record and gradually move towards the latest activity. This sorting method not only helps the user understand the change of their own behavior patterns over time, but also makes it easier to trace the causes and consequences of specific events. The design of the entire timeline in this embodiment focuses on the user experience, aiming to optimize the readability and access efficiency of information through clear visual cues and an intuitive interface layout. The user can quickly scan the timeline, find specific events of interest to the user, and view the detailed information of the events in depth, so as to obtain a more comprehensive understanding and insight.
[0087] In addition, in this embodiment, the timeline can not only display data according to the chronological order, but also display data according to the user-defined data display mode; moreover, for users with different permissions, the timeline will display different data.
[0088] It should be noted that this embodiment can calculate the operation metrics corresponding to the user's operations (such as response time, error rate) in real time, identify abnormal patterns through a pre-trained model, and detect abnormal operation records (such as timeout requests, high-frequency failed operations) in real time. At the same time, the abnormal operations will be automatically highlighted in the timeline; correspondingly, the process of displaying each target feature information using the target timeline may specifically include: determining the abnormal operation records in each operation record according to the operation metrics included in each target feature information, and determining the abnormal feature information corresponding to each abnormal operation record from each target feature information; determining the abnormal type corresponding to each abnormal feature information, and assigning different target display colors to each abnormal feature information according to each abnormal type; highlighting each abnormal feature information using each target display color and the target timeline.
[0089] It can be seen that this application summarizes and stores the feature information corresponding to the user's operation records by using Kafka, improves the data processing volume, thereby ensuring the data volume on the timeline and improving the integrity of the timeline; by using the Elasticsearch search engine, it ensures the accuracy of the user index structure, thus ensuring that the information in the generated target timeline highly corresponds to the user's retrieval requirements; by arranging the user's operation records in chronological order and displaying them in the form of a timeline, users can intuitively understand the sequence and logical relationship between each operation, realizing the full-process traceability of the user's operations.
[0090] Based on the foregoing embodiments, this application describes the overall process of tracing the user's operation records. To make the technical solutions in this application more complete, next, this application will elaborate on the process of displaying the feature information corresponding to the user's operation records using the timeline. See Figure 5 As shown, an embodiment of the present invention discloses a method for displaying feature information, including:
[0091] Step S21: Obtain the data display rules customized by the target user, determine the display order and display position of each target feature information according to the data display rules, and determine the target permission level corresponding to the target user.
[0092] In this embodiment, first, it is necessary to obtain the data display rules customized by the target user, and determine the display order and display position of each target feature information according to the data display rules, so as to subsequently display each target feature information based on the display order, display position, and the target timeline.
[0093] In addition, in this embodiment, the target permission level corresponding to the target user can also be obtained, and the information to be displayed can be determined from each piece of target feature information according to the target permission level, so as to display each piece of information to be displayed using the target timeline.
[0094] It should be noted that a matter configuration module is pre-configured in this embodiment, where Figure 6 is a functional schematic diagram of the matter configuration module. Through this module, users can precisely control which fields (i.e., target feature information) should be displayed on the interface and the arrangement order of these fields, thereby optimizing the user experience and data management efficiency. This module allows administrators or developers to define the specific display details of each matter through an interface. For example, it is possible to set that certain sensitive information fields are not displayed externally under specific conditions, or adjust the visible fields according to the user's permission level. This flexibility ensures information security while meeting the needs of different users. In addition, by providing an interface to configure the display order of fields, users can organize the display method of information according to business logic or personal preferences. This means that the most critical or frequently used information can be placed in a more prominent position, thereby improving operation efficiency and data retrieval speed. In addition, the module also supports configuring the storage name of fields, which provides convenience for backend data processing. By customizing the storage name of fields, developers can use clearer and more standardized naming rules in database design, and it is also convenient to maintain data consistency and integrity during future system upgrades or data migrations.
[0095] Step S22: Display each piece of the target feature information based on the display order, the display position, the target permission level, and the target timeline.
[0096] In this embodiment, it is necessary to display the target feature information corresponding to the user's operation records according to the display order and display position defined by the user. That is, when using the timeline to display features, not only can the data be displayed according to the order from the earliest to the latest time, but also it can be displayed according to the display mode defined by the user. For example, the target feature information can be displayed in reverse chronological order, or only some target feature information can be displayed within a specific period of time, or all the operation records of the user within a specific period of time can be displayed, or only the operation records corresponding to the user's needs can be displayed. At the same time, this embodiment can display the target feature information according to the user's permissions. For example, in this embodiment, the user's permissions can be divided into two types: global viewing permission and local viewing permission. Assume that user A has global viewing permission, while user B and user C only have local viewing permission. Then, when displaying data, user A can choose to use three different target timelines to display their own operation records and the operation records of user B and user C respectively. Among them, each timeline can correspond to a set of operation records of a user; user A can also choose to display the feature information corresponding to the operation records of the three users simultaneously on the same timeline according to the chronological order of the data. When user B and user C use the timeline to display feature information, they can only display the feature information corresponding to their own operation records and cannot use the timeline to display the feature information corresponding to the operation records of other users.
[0097] It can be seen that by precisely controlling which fields should be displayed on the interface and the arrangement order of these fields, the user experience and data management efficiency can be optimized; by displaying data based on user permissions, the problem of leakage of important data is avoided, and the security during the data display process is ensured; by arranging the user operation records in chronological order and displaying them in the form of a timeline, users can intuitively understand the sequence and logical relationship between various operations, realizing the full-process traceability of user operations.
[0098] See Figure 7 As shown, an operation record traceability device according to an embodiment of the present invention includes:
[0099] A feature information acquisition module 11, configured to acquire operation records of different users and initial feature information respectively corresponding to each of the operation records, encapsulate each of the initial feature information into a target message body, and store the target message body into a target message queue in Kafka; the initial feature information includes the operation time, operation metrics, operation type, and identity identification number of the operating user corresponding to the operation record; the operation metrics include the response time of the operation and the response rate of the operation;
[0100] A data format conversion module 12, configured to receive a data consumption instruction of a target user, obtain the target message body from the target message queue based on the data consumption instruction, and perform format conversion on each piece of the initial feature information in the target message body to obtain corresponding converted feature information;
[0101] A feature information retrieval module 13, configured to store the converted feature information into an Elasticsearch search engine by using a load balancing strategy and an intelligent routing strategy, obtain a target search parameter input by the target user, and retrieve target feature information corresponding to the target search parameter from the converted feature information in the Elasticsearch search engine according to the target search parameter;
[0102] A feature information display module 14, configured to sort each piece of the target feature information according to the operation time corresponding to each operation record to obtain a target timeline, and display each piece of the target feature information by using the target timeline, so that the user can trace each operation record according to the target timeline.
[0103] Therefore, in this application, by using Kafka to summarize and store the feature information corresponding to user operation records, the data processing volume is increased, thereby ensuring the data volume on the timeline and improving the integrity of the timeline; by using the Elasticsearch search engine, the accuracy of the user index structure is ensured, so that the information in the generated target timeline highly corresponds to the user's retrieval requirements; by arranging the user operation records in chronological order and displaying them in the form of a timeline, the user can intuitively understand the sequence and logical relationship between each operation, realizing the full-process traceability of user operations.
[0104] In some specific embodiments, the feature information acquisition module 11 may specifically include:
[0105] An exception judgment unit, configured to judge whether there is an exception in the storage process of the target message body. If there is no exception in the storage process of the target message body, it jumps to the step of receiving the data consumption instruction of the target user;
[0106] A message body storage unit, configured to re-store the target message body into the target message queue in Kafka if there is an exception in the storage process of the target message body.
[0107] In some specific embodiments, the data format conversion module 12 further includes:
[0108] A step jump unit, configured to determine whether the target user is an authorized user. If the target user is an authorized user, it jumps to the step of receiving the data consumption instruction of the target user;
[0109] An instruction rejection unit, configured to, if the target user is not an authorized user, reject receiving the data consumption instruction of the target user.
[0110] In some specific embodiments, the feature information display module 14 may specifically include:
[0111] A feature information screening unit, configured to, if the number of the target feature information is not less than a preset feature quantity threshold, quantify the importance of each of the target feature information, and screen out key feature information with an importance greater than a preset importance threshold from each of the target feature information according to the corresponding quantification result;
[0112] A resolution acquisition unit, configured to acquire the resolution of the display device corresponding to the target timeline; wherein, the target timeline supports zooming operations and can display each of the target feature information with different time granularities;
[0113] A time granularity determination unit, configured to determine the time intervals between key operation records based on each of the key feature information, determine the target time granularity corresponding to the target timeline according to each of the time intervals, and display each of the key feature information based on the resolution, the target time granularity, and the target timeline; the key operation records are the operation records corresponding to the key feature information.
[0114] In some specific embodiments, the feature information display module 14 may specifically include:
[0115] A first feature information display unit, configured to acquire the data display rules customized by the target user, determine the display order and display positions of each of the target feature information according to the data display rules, and display each of the target feature information based on the display order, the display positions, and the target timeline.
[0116] In some specific embodiments, the feature information display module 14 may specifically include:
[0117] A second feature information display unit, configured to determine the target permission level corresponding to the target user, determine the displayable information from each of the target feature information according to the target permission level, and display each of the displayable information using the target timeline.
[0118] In some specific embodiments, the feature information display module 14 may specifically include:
[0119] An exception information determination unit, configured to determine abnormal operation records in each of the operation records according to the operation metrics included in each of the target feature information, and determine abnormal feature information corresponding to each of the abnormal operation records from each of the target feature information;
[0120] An exception type determination unit, configured to determine an exception type corresponding to each of the abnormal feature information, and assign different target display colors to each of the abnormal feature information according to each of the exception types;
[0121] An exception information display unit, configured to highlight each of the abnormal feature information by using each of the target display colors and the target timeline.
[0122] Furthermore, an embodiment of the present application also discloses an electronic device, Figure 8 It is a structural diagram of an electronic device 20 shown according to an exemplary embodiment, and the content in the figure cannot be considered as any limitation on the scope of use of the present application.
[0123] Figure 8 It is a schematic structural diagram of an electronic device 20 provided by an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the operation record tracing method disclosed in any of the foregoing embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0124] In this embodiment, the power supply 23 is used to provide a working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows is any communication protocol applicable to the technical solution of the present application, and no specific limitation is imposed on it here; the input / output interface 25 is used to obtain external input data or output data to the outside, and its specific interface type can be selected according to specific application needs, and no specific limitation is made here.
[0125] In addition, as a carrier for resource storage, the memory 22 may be a read-only memory, a random access memory, a magnetic disk, or an optical disc, etc., and the resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage method may be temporary storage or permanent storage.
[0126] Among them, the operating system 221 is used to manage and control each hardware device and computer program 222 on the electronic device 20, and it can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the operation record tracing method executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program that can be used to complete other specific tasks.
[0127] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the foregoing disclosed operation record tracing method is implemented. For the specific steps of this method, reference may be made to the corresponding content disclosed in the foregoing embodiments, and details will not be repeated here.
[0128] In this specification, the various embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the various embodiments, reference may be made to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and reference may be made to the description of the method part for related parts.
[0129] Those skilled in the art can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described according to their functions in the above description. Whether these functions are executed in a hardware or software manner 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 to exceed the scope of this application.
[0130] The steps of the method or algorithm described in combination with the embodiments disclosed in this article can be directly implemented by hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, or any other form of storage medium well-known in the technical field.
[0131] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising said element.
[0132] The technical solutions provided in this application have been introduced in detail above. Specific examples are used in this text to elaborate on the principles and implementation manners of this application. The descriptions of the above embodiments are only used to help understand the method and its core idea of this application; at the same time, for those of ordinary skill in the art, according to the idea of this application, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to this application.
Claims
1. An operation record traceability method, characterized in that, Including: Obtain the operation records of different users and the initial feature information respectively corresponding to each of the operation records, encapsulate each of the initial feature information into a target message body, and store the target message body into a target message queue in Kafka; the initial feature information includes the operation time, operation metrics, operation type corresponding to the operation record, and the identity identification number of the operating user; the operation metrics include the response time of the operation and the response rate of the operation; Receive a data consumption instruction of a target user, obtain the target message body from the target message queue based on the data consumption instruction, and perform format conversion on each of the initial feature information in the target message body to obtain corresponding converted feature information; Use a load balancing strategy and an intelligent routing strategy to store the converted feature information into an Elasticsearch search engine, obtain target search parameters input by the target user, and retrieve target feature information corresponding to the target search parameters from the converted feature information in the Elasticsearch search engine; Sort each of the target feature information according to the operation time corresponding to each of the operation records to obtain a target timeline, and use the target timeline to display each of the target feature information so that the user can trace each of the operation records according to the target timeline.
2. The operation record tracing method according to claim 1, wherein The storing the target message body into a target message queue in Kafka includes: Judge whether there is an abnormality in the storage process of the target message body. If there is no abnormality in the storage process of the target message body, jump to the step of receiving the data consumption instruction of the target user; If there is an abnormality in the storage process of the target message body, store the target message body into the target message queue in Kafka again.
3. The operation record traceback method according to claim 1, wherein Before receiving the data consumption instruction of the target user, it further includes: Judge whether the target user is an authorized user. If the target user is an authorized user, jump to the step of receiving the data consumption instruction of the target user; If the target user is not an authorized user, reject receiving the data consumption instruction of the target user.
4. The operation record tracing method according to claim 1, wherein The displaying each of the target feature information by using the target timeline includes: If the number of the target feature information is not less than a preset feature quantity threshold, quantify the importance of each of the target feature information, and screen out key feature information with an importance greater than a preset importance threshold from each of the target feature information according to the corresponding quantification result; Obtain the resolution of the display device corresponding to the target timeline; wherein, the target timeline supports zooming operations and can display each of the target feature information with different time granularities; Determine the time intervals between the key operation records based on each of the key feature information, determine the target time granularity corresponding to the target timeline according to each of the time intervals, and display each of the key feature information based on the resolution, the target time granularity, and the target timeline; the key operation records are the operation records corresponding to the key feature information.
5. The operation record traceback method according to claim 4, characterized in that The displaying each of the target feature information by using the target timeline includes: Obtain the data display rules defined by the target user, determine the display order and display positions of each of the target feature information according to the data display rules, and display each of the target feature information based on the display order, the display positions, and the target timeline.
6. The operation record tracing method according to claim 1, characterized in that The displaying each of the target feature information by using the target timeline includes: Determine the target permission level corresponding to the target user, determine the displayable information from each of the target feature information according to the target permission level, and display each of the displayable information by using the target timeline.
7. The operation record tracing method according to any one of claims 1 to 6, characterized in that, The displaying each of the target feature information by using the target timeline includes: Determine the abnormal operation records in each of the operation records according to the operation metrics included in each of the target feature information, and determine the abnormal feature information corresponding to each of the abnormal operation records from each of the target feature information; Determine the abnormal types corresponding to each of the abnormal feature information, and assign different target display colors to each of the abnormal feature information according to each of the abnormal types; Highlight each of the abnormal feature information by using each of the target display colors and the target timeline.
8. An operation record traceability device, characterized in that, Includes: A feature information acquisition module, configured to acquire the operation records of different users and the initial feature information respectively corresponding to each of the operation records, encapsulate each of the initial feature information into a target message body, and store the target message body into a target message queue in Kafka; the initial feature information includes the operation time, operation metrics, operation type, and identity identification number of the operating user corresponding to the operation record; the operation metrics include the response time and response rate of the operation; A data format conversion module, configured to receive a data consumption instruction of a target user, obtain the target message body from the target message queue based on the data consumption instruction, and perform format conversion on each of the initial feature information in the target message body to obtain corresponding converted feature information; A feature information retrieval module, configured to store the converted feature information into an Elasticsearch search engine by using a load balancing strategy and an intelligent routing strategy, obtain target search parameters input by the target user, and retrieve target feature information corresponding to the target search parameters from the converted feature information in the Elasticsearch search engine; A feature information display module, which is used to sort each piece of the target feature information according to the operation time corresponding to each operation record to obtain a target timeline, and use the target timeline to display each piece of the target feature information, so that the user can trace each operation record according to the target timeline.
9. An electronic device, characterized in that, It includes: A memory, which is used to store a computer program; A processor, which is used to execute the computer program to implement the operation record tracing method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, For storing a computer program, the computer program, when executed by a processor, implements the operation record tracing method according to any one of claims 1 to 7.