Operation log generation method and device, computer equipment and storage medium

By intercepting data operation requests to obtain new and old data and generate operation logs, the problem of lack of universality in the logging function in the prior art is solved, real-time, completeness and meticulousness of operation logs are realized, and the efficiency of troubleshooting and historical operation reproduction is improved.

CN119862162APending Publication Date: 2025-04-22SHENZHEN GRANDSTREAM NETWORKS TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411947887.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

The custom logging function in existing user systems lacks universality and cannot effectively record and query operation logs, resulting in inefficient system troubleshooting and historical operation reproduction.

Method used

By intercepting the data operation request, the first operation data (new data) and the second operation data (old data) in the request are obtained, and the target operation log is generated based on these two data. This method is not limited by the system operation logging function and is universal.

Benefits of technology

Real-time and completeness of operation logs are realized. The generated log contains data before and after data operations, which improves the meticulousness and universality of the logs and improves the efficiency of system troubleshooting and historical operation reproduction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119862162A_ABST
    Figure CN119862162A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an operation log generation method and device, computer equipment and a storage medium, and the method comprises the steps: intercepting a data operation request, obtaining first operation data in the data operation request, obtaining second operation data before data change caused by the data operation request, and generating an operation log according to the first operation data and the second operation data. The new data and the old data corresponding to the new data are obtained based on the intercepted data operation request, the real-time performance and integrity of data obtaining are ensured, the generated target operation log is made to have data before and after data operation, the meticulous performance of the target operation log is improved, and the user experience is improved. Since the first operation data and the second operation data are obtained based on the data operation request, the method is not limited by an operation log recording function of the system, and has universality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to an operation log generation method, device, computer equipment and storage medium. Background Art

[0002] In today's Internet era, users are increasingly concerned about operation records. Operation records, also known as operation logs, refer to the recorded information after performing one or more operations (such as data update operations, data addition operations, etc.) on an object. These operation logs can facilitate query and traceability of operation information, quickly troubleshoot system failures, or reproduce historical system operations. In order to improve user experience and system development efficiency, many software applications are committed to recording operation logs. In related technologies, some user systems use custom logging functions, which lack universality. Summary of the invention

[0003] The embodiments of the present application provide an operation log generation method, apparatus, computer device and storage medium, which are used to solve the technical problem that some user systems use a customized log recording function and the existing log recording function lacks universality.

[0004] In a first aspect, the present application provides a method for generating an operation log, comprising:

[0005] Intercept data manipulation requests;

[0006] Acquire first operation data in the data operation request, and acquire second operation data before the data operation request causes data change;

[0007] A target operation log is generated according to the first operation data and the second operation data.

[0008] In a second aspect, the present application provides an operation log generating device, comprising:

[0009] Interception module, used to intercept data operation requests;

[0010] An acquisition module, used to acquire first operation data in the data operation request, and acquire second operation data before the data operation request causes data change;

[0011] A generating module is used to generate a target operation log according to the first operation data and the second operation data.

[0012] In a third aspect, the present application provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps in the above-mentioned operation log generation method when executing the computer program.

[0013] In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned operation log generation method are implemented.

[0014] In a fifth aspect, the present application also provides a computer program product, including a computer program / instruction, which, when executed by a processor, is used to execute the steps in the operation log generation method described in any one of the first aspects above.

[0015] The embodiments of the present application provide an operation log generation method, apparatus, computer equipment and storage medium. The method intercepts a data operation request, obtains first operation data in the data operation request, and obtains second operation data before the data operation request causes a data change. A target operation log is generated based on the first operation data and the second operation data, thereby obtaining new data and old data corresponding to the new data based on the intercepted data operation request, ensuring the real-time and integrity of data acquisition, so that the generated target operation log contains data before and after the data operation, thereby improving the meticulousness of the target operation log. Since the first operation data and the second operation data are obtained based on the data operation request, the method is not limited to the operation log recording function of the system and has universality. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0017] in:

[0018] Figure 1 A flowchart of a method for generating an operation log in one embodiment;

[0019] Figure 2 It is a flowchart of a target operation log generation process when a terminal performs a data update operation or a data addition operation on a page calling an interface in an embodiment;

[0020] Figure 3 It is a flowchart of a target operation log generation process when a terminal calls an interface on a page to view data in an embodiment;

[0021] Figure 4 A schematic diagram of a page for updating a target operation log configured by a client in one embodiment;

[0022] Figure 5A schematic diagram of a page of a target operation log for updating alarm notification settings in one embodiment;

[0023] Figure 6 is a structural block diagram of an operation log generating device in an embodiment;

[0024] Figure 7 FIG. 4 is a structural block diagram of a computer device in one embodiment. DETAILED DESCRIPTION

[0025] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0026] like Figure 1 As shown, in one embodiment, a flowchart of an operation log generation method is provided, and the operation log generation method specifically includes the following steps:

[0027] Step 102: intercepting a data operation request.

[0028] The data operation request is a request initiated by the client for performing data operations, which may include various types of operations, such as data update, data deletion, data addition, data viewing, etc. For example, a user calling an interface on a page to perform a data deletion operation is a data operation request.

[0029] Specifically, the computer device intercepts the data operation request so as to subsequently obtain data operation related data for recording based on the intercepted data operation request.

[0030] In a specific embodiment, the data operation request sent by the terminal is intercepted by the interception method class of aspect-oriented programming. Aspect-oriented programming (AOP) is a programming paradigm, and the interception method class of AOP is the interception function of AOP. More specifically, the interception function of AOP of Spring, which is a commonly used Java backend development framework, can intercept data requests sent by different user systems.

[0031] Step 104: Acquire the first operation data in the data operation request, and acquire the second operation data before the data operation request causes the data change.

[0032] The first operation data is the data after the data operation request causes the data change, that is, the result data of the data operation, that is, the new data. The second operation data is the data before the data operation request causes the data change, that is, the data before the data operation, that is, the old data. Both the first operation data and the second operation data include operation parameters and corresponding operation data. For example, for the case where the data operation type is data update, the second operation data is "host name: host 1", and the first operation data is "host name: -", where "host name" is the operation parameter, and "host 1" and "-" are the operation data corresponding to the operation parameter.

[0033] Specifically, the first operation data can be obtained according to the request input parameter carried in the data operation request, and the first operation data can be used to reversely search and obtain the old data associated with the first operation data according to the data operation request, so as to obtain the second operation data before the data change caused by the data operation request. It can be understood that in this embodiment, by obtaining the first operation data and the second operation data based on the intercepted data operation request, the new data in the data operation process and the old data corresponding to the new data are realized, ensuring the real-time and integrity of data acquisition. At the same time, the method of obtaining the first operation data and the second operation data based on the data operation request is not limited by the user system, and there is no need to develop a data acquisition component for each user system, which is universal.

[0034] In a specific implementation, the data operation request includes a current uniform resource locator; in step 104, second operation data before the data change caused by the data operation request is obtained, specifically as follows:

[0035] Step 104A, based on a preset uniform resource locator configuration relationship, determining a dependent uniform resource locator having a dependent relationship with the current uniform resource locator;

[0036] Step 104B: Acquire the second operation data according to the dependent uniform resource locator and the current uniform resource locator.

[0037] Among them, Uniform Resource Locator (URL) is the uniform resource locator symbol of WWW. It is used to indicate the location of resources obtained from the Internet and the method of accessing these resources. As long as the resource can be located, the system can perform various operations on the resource, such as access, update, replace and find its attributes. The data operation request in this embodiment can be an http request.

[0038] The preset uniform resource locator configuration relationship is a pre-configured association relationship that records the current URL and the URL that has a dependent relationship with it, and is used to obtain the dependent URL that has a dependent relationship with the current URL. The current URL is the URL that triggers the data operation request when the terminal calls the interface on the page, and the dependent URL is the URL that has an associated relationship with the current URL, that is, the URL called by the terminal before performing the data operation. Exemplarily, the dependent URL is the previous URL of the current URL, which is used to locate the data before the data operation is performed.

[0039] In a specific implementation, for example, a data operation request is used to update personal information. The terminal needs to enter the personal information page and call the interface of the personal information page, the corresponding URL of which is http: / / ....... / info, which is used to return personal information. After the terminal updates the personal information on the personal information page, the changed information is saved by calling the interface of the information saving page, and then click Save. The URL corresponding to the interface of the called information saving page is http: / / ....... / save. At the same time, a URL configuration relationship is pre-stored in the computer device, such as a configuration relationship in which there is a dependency relationship between http: / / ....... / save and http: / / ....... / info. In this implementation, the current URL is http: / / ....... / save, and the dependent URL is http: / / ....... / info.

[0040] Specifically, the dependent URL corresponding to the current URL is obtained from the preset URL configuration table. Since the data operation request includes the current URL and the dependent URL has a dependency relationship with the current URL, the second operation data before the data operation request causes data changes can be obtained based on the current URL and the dependent URL.

[0041] In a specific implementation manner, in step 104B, the second operation data is obtained according to the dependent uniform resource locator and the current uniform resource locator as follows:

[0042] Step 104B1, determining a corresponding operation request input parameter based on the current uniform resource locator;

[0043] Step 104B2, encapsulating the configuration relationship between the dependent uniform resource locator and the current uniform resource locator, and the operation request input parameter into an operation object;

[0044] Step 104B3: Determine the second operation data based on the operation object.

[0045] Among them, the operation request input parameter is the request parameter of the current uniform resource locator, and the request parameter is the parameter included in the data operation request, and may further include the value corresponding to the parameter. For example, the data operation type is data update, which can be an update request parameter, and may further include the updated data corresponding to the update request parameter.

[0046] Specifically, the operation request input parameters can be obtained from the current URL, and then the configuration relationship between the dependent URL and the current URL is used as configuration data. The configuration data and the operation request input parameters are encapsulated into an object to obtain an operation object, which is stored in a database so that the operation object has relevant data of the current URL and the dependent URL. Therefore, the operation request input parameters in the operation object can be used to query data from the database according to the dependent URL, which can be data corresponding to the operation request input parameters obtained from the dependent URL, thereby obtaining the second operation data.

[0047] It is worth noting that before step 104B3, the operation object can also be put into a queue for consumption, so that when the first operation data is obtained, the second operation data has been consumed and processed, thereby avoiding the impact of the second operation data on the first operation data and improving the processing efficiency of the first operation data.

[0048] In a specific implementation, the data operation type is data update or data addition; in step 104B3, the second operation data is determined based on the operation object, specifically as follows:

[0049] Step 104B301, determining old data before the data change caused by the data operation request according to the dependent uniform resource locator in the operation object;

[0050] Step 104B302: If it is detected that the old data has a reference identifier, reflection processing is performed based on the reference identifier to obtain a reference name corresponding to the reference identifier;

[0051] Step 104B303, obtaining the second operation data according to the reference name and the old data.

[0052] Among them, data update is a data operation that modifies data, and similarly, data addition is a data operation that adds data. Due to different data operations, the URLs of the interfaces called are different, and the type of data operation can be determined by identifying the current URL.

[0053] For data update operations, the corresponding old data is the data before the data change. For data addition operations, the corresponding old data is empty. Take inserting data in a relational database as an example. In a relational database, if data is added by adding a new record, that is, inserting a row of data, the corresponding old data is empty. The reference name refers to the name of one or more data descriptions that have a reference relationship with the old data. For example, in the teacher information form, there is a drop-down box for selecting the teacher's student information. If the student's ID is selected, other detailed information with a reference relationship can be obtained through the student ID, such as the student's name, etc. The name of the data description of the student's name is the reference name.

[0054] Specifically, in the process of updating or adding data, the first operation data can be obtained by using the operation request input parameter in the operation object. At the same time, according to the configuration relationship between the dependent URL and the current URL in the operation object and the operation request input parameter, the dependent URL can be determined from the operation object. According to the first operation data, the dependent URL can be used to reversely find the old data before the data operation request caused the data change. When it is detected that the old data has a reference identifier, the reference identifier is reflected and the reference name corresponding to the reference identifier is found, and the reference name and the old data are used as the second operation data. It can be understood that in this embodiment, the old data before the data operation request caused the data change is obtained through the dependent uniform resource locator in the operation object, which realizes efficient and convenient acquisition of the old data. At the same time, the reference name is added to the old data, making the old data more intuitive and detailed.

[0055] It is worth noting that for the operation of adding data, when the old data is an empty set, a comparison mechanism between the new data and the old data can be implemented.

[0056] It should be noted that since the operation parameters in the first operation data and the second operation data are consistent, the reference identifiers of the first operation data and the second operation data are consistent. When the data operation type is data update, the combination of the old data and the reference name is the second operation data. Accordingly, the reference identifier in the first operation data can be reflected to obtain the reference name, or directly modified to the reference identifier, ensuring that the operation parameters of the first operation data and the second operation data are consistent.

[0057] In a specific implementation, the data operation type is data deletion; in step 104B3, the second operation data is determined based on the operation object, specifically as follows:

[0058] Step 104B304, determining old data before the data change caused by the data operation request according to the dependent uniform resource locator in the operation object;

[0059] Step 104B305: if it is detected that the old data does not have a preset key identifier, determine the preset key identifier of the old data based on the primary key identifier of the database where the old data is located;

[0060] Step 104B306: Obtain the second operation data based on the preset key identifier and the old data.

[0061] Among them, the preset key identifier is an identifier that can represent the key information of the data, such as the Name field, the device MAC field, etc. For example, in a scenario, if a specific operation is performed on a device, the device MAC field at this time can represent the key information of the data. Therefore, the device MAC field is determined as the preset key identifier and displayed to the user. For the user, the display of data is more intuitive. For another example, for the operation of deleting a report, the user needs to know the Name field of the report, such as the name of the report, so the Name field is used as the preset key identifier.

[0062] Specifically, in the process of deleting data, the first operation data can be obtained by using the operation request input parameter in the operation object. At the same time, according to the configuration relationship between the dependent URL and the current URL in the operation object and the operation request input parameter, the dependent URL can be determined from the operation object. According to the first operation data, the dependent URL can be used to reversely find the old data before the data change caused by the data operation request. When it is detected that the old data does not have a preset key identifier, the preset key identifier of the old data is found based on the primary key identifier of the database where the old data is located, and the preset key identifier and the old data are used as the second operation data. It can be understood that in this embodiment, the dependent uniform resource locator in the operation object obtains the old data before the data change caused by the data operation request, thereby realizing efficient and convenient acquisition of the old data. At the same time, the preset key identifier is added to the old data, making the old data more intuitive and detailed, which is conducive to improving the user experience.

[0063] In a specific implementation, for example, data deletion means deleting a report. If the old data obtained is a report ID, only the report ID is displayed during log display. This is not intuitive for customers. Therefore, the corresponding preset key identifier, such as the report name, can be found through the report ID, making the second operation data more intuitive and user-friendly, thereby improving the user experience.

[0064] In a specific implementation, it also includes: step 108, identifying the data operation type in the data operation request; generating a target operation log based on the first operation data and the second operation data, including: generating a target operation log based on the first operation data and the second operation data and the data operation type.

[0065] Specifically, since data operations of different data operation types have corresponding data operation requests different, the corresponding data operation type can be determined by identifying the operation request. After the data operation type is determined, the combination of the first operation data, the second operation data, and the data operation type is used as the target operation log, so that the target operation log contains not only the first operation data and the second operation data, but also the data operation type, thereby further improving the detailed intuitiveness of the target operation log.

[0066] Step 106: Generate a target operation log according to the first operation data and the second operation data.

[0067] Specifically, the first operation data and the second operation data can be combined to obtain the target operation log, or the first operation data and the second operation data can be encapsulated into a log object to obtain the target operation log. In this embodiment, according to the first operation data and the second operation data, the generated target operation log contains the data before and after the data operation, which improves the detailed intuitiveness of the target operation log. Since the first operation data and the second operation data are obtained based on the data operation request, it is not limited to the operation log recording function of the system and has universality.

[0068] In a specific implementation, in step 106, generating a target operation log according to the first operation data and the second operation data is as follows:

[0069] Step 106A, performing desensitization processing on the first operation data and the second operation data;

[0070] Step 106B: Generate a target operation log based on the desensitized first operation data and second operation data.

[0071] Specifically, after determining the first operation data and the second operation data, the first operation data and the second operation data can also be desensitized, such as encrypting, hiding or replacing the privacy field data values ​​in the first operation data and the second operation data with characters, etc., to improve the security of the first operation data and the second operation data, and then combining the desensitized first operation data and the second operation data to obtain the target operation log, or encapsulating the desensitized first operation data and the second operation data into a log object to obtain the target operation log, so as to improve the data security of the target operation log.

[0072] In a specific implementation, in step 106, after generating the target operation log according to the first operation data and the second operation data, the following may also be included:

[0073] Step 108, rendering the target operation log to obtain a rendered operation log;

[0074] Step 110: Display the rendered operation log on a preset page.

[0075] Specifically, the target operation log can be rendered and displayed on the front-end page of the client, thereby achieving an intuitive display of the target operation log and improving the user experience.

[0076] In a specific embodiment, Figure 2 As shown in FIG. 1 , it is a flow chart of the target operation log generation process when the terminal calls the interface on the page to perform the data update operation or data addition operation. The specific process of the target operation log generation is as follows:

[0077] S1: The user of the terminal calls the interface on the page to update data;

[0078] S2: AOP intercepts the data update operation request, searches for configuration data according to the current URL of the update operation request, encapsulates the configuration data and the operation request input parameter into an operation object and puts it into the queue. The operation request input parameter is the first operation data, that is, the new data after the data is modified.

[0079] S3: consume the operation objects in the queue;

[0080] S4: retrieve the corresponding data according to the operation object and the dependent URL, that is, the old data before the data modification;

[0081] S5: According to the reference identifiers corresponding to the new data and the old data, the reference identifiers are used to obtain corresponding reference names through reflection;

[0082] S6: Encapsulate the processed new data, old data and reference name into an object, insert it into the database, and obtain the target operation log.

[0083] It is worth noting that for the operation of adding data, when the old data is an empty set, a comparison mechanism between the new data and the old data can be implemented.

[0084] In another specific embodiment, Figure 3 As shown in FIG. 1 , it is a flow chart of the target operation log generation process when the terminal calls the interface on the page to view data. The specific process of generating the target operation log is as follows:

[0085] M1: The terminal user clicks the operation log function list on the user page;

[0086] M2: Search the user operation records through the database;

[0087] M3: The searched data records are divided into update, delete, add and other operations according to the fields, and the corresponding operation methods are executed respectively;

[0088] M4: If it is an update or addition, the request parameters and input parameters are compared in detail, that is, the new data and the old data are compared, and the changed data is put into the return structure. The return structure can be the structure of the response body content returned by the front end, so that the front end can obtain data from the response returned by the back end according to the negotiated fields for display and rendering;

[0089] M5: If it is a deletion, the data to be displayed can be obtained according to the request parameters, such as the input parameters, and the data to be displayed is placed in the return structure. If a preset key identifier is transmitted, such as the Name field or the device MAC field, the data is directly placed in the return structure. Otherwise, the corresponding preset key identifier is found through the id, and then the preset key identifier is placed in the return structure together.

[0090] In another specific embodiment, Figure 4 As shown, this is a page diagram of the target operation log for updating the client configuration, which displays the information before and after the client configuration, implements the data comparison mechanism before and after the update, provides clear and complete data change details, and users can clearly understand the historical operations through the interface.

[0091] In another specific embodiment, Figure 5 As shown, this is a page diagram of the target operation log for updating the alarm notification settings, which displays the information before and after the alarm notification is set, implements the data comparison mechanism before and after the update, and provides clear and complete data change details. Users can clearly understand the historical operations through the interface.

[0092] The above-mentioned operation log generation method intercepts the data operation request, obtains the first operation data in the data operation request, and obtains the second operation data before the data operation request causes the data change, and generates the target operation log according to the first operation data and the second operation data, so as to obtain the new data and the old data corresponding to the new data based on the intercepted data operation request, ensure the real-time and integrity of data acquisition, so that the generated target operation log contains the data before and after the data operation, and improves the meticulousness of the target operation log. Since the first operation data and the second operation data are obtained based on the data operation request, it is not limited by the operation log recording function of the system and has universality.

[0093] like Figure 6 As shown, in one embodiment, an operation log generating device is proposed, and the operation log generating device 200 includes:

[0094] An interception module 202, used to intercept data operation requests;

[0095] The acquisition module 204 is used to acquire the first operation data in the data operation request, and acquire the second operation data before the data operation request causes the data change;

[0096] The generating module 206 is configured to generate a target operation log according to the first operation data and the second operation data.

[0097] In one embodiment, the data operation request includes a current uniform resource locator; the acquisition module 204 is specifically used to:

[0098] Based on a preset uniform resource locator configuration relationship, determining a dependent uniform resource locator that has a dependent relationship with the current uniform resource locator;

[0099] The second operation data is acquired according to the dependent uniform resource locator and the current uniform resource locator.

[0100] In one embodiment, the acquisition module 204 is further configured to:

[0101] Determine a corresponding operation request input parameter based on the current uniform resource locator;

[0102] Encapsulate the configuration relationship between the dependent uniform resource locator and the current uniform resource locator, and the operation request input parameter into an operation object;

[0103] Based on the operation object, the second operation data is determined.

[0104] In one embodiment, the data operation type is data update or data addition; the acquisition module 204 is further used to:

[0105] Determine, according to the dependent uniform resource locator in the operation object, old data before the data change caused by the data operation request;

[0106] If it is detected that the old data has a reference identifier, reflection processing is performed based on the reference identifier to obtain a reference name corresponding to the reference identifier;

[0107] The second operation data is obtained according to the reference name and the old data.

[0108] In one embodiment, the data operation type is data deletion; the acquisition module 204 is further used to:

[0109] Determine, according to the dependent uniform resource locator in the operation object, old data before the data change caused by the data operation request;

[0110] If it is detected that the old data does not have a preset key identifier, determining the preset key identifier of the old data based on the primary key identifier of the database where the old data is located;

[0111] The second operation data is obtained based on the preset key identifier and the old data.

[0112] In one embodiment, the apparatus further comprises: an identification module, configured to identify a data operation type in the data operation request;

[0113] The generating module 206 is specifically used to generate a target operation log according to the first operation data, the second operation data, and the data operation type.

[0114] In one embodiment, the operation log generating device further includes:

[0115] A rendering module, used for rendering the target operation log to obtain a rendered operation log;

[0116] The display module is used to display the rendered operation log on a preset page.

[0117] Figure 7 FIG. 1 shows an internal structure diagram of a computer device in an embodiment. The computer device may be a server, including but not limited to a high-performance computer and a high-performance computer cluster. Figure 7 As shown, the computer device includes a processor, a memory and a network interface connected via a system bus. The memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor can implement the operation log generation method. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor can execute the operation log generation method. Those skilled in the art can understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0118] In one embodiment, the operation log generation method provided in the present application can be implemented in the form of a computer program. The computer program can be Figure 7 The computer device shown in the figure is run. The memory of the computer device can store various program templates constituting the operation log generating device, such as the interception module 202, the acquisition module 204, and the generation module 206.

[0119] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the above-mentioned operation log generating method when executing the computer program.

[0120] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned operation log generation method are implemented.

[0121] The embodiment of the present application also provides a computer program product, including a computer program / instruction, which, when executed by a processor, is used to execute the steps in any one of the operation log generation methods provided in the embodiment of the application.

[0122] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0123] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0124] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for generating an operation log, characterized in that: include: Intercept data manipulation requests; Acquire first operation data in the data operation request, and acquire second operation data before the data operation request causes data change; A target operation log is generated according to the first operation data and the second operation data.

2. The operation log generation method according to claim 1, characterized in that: The data operation request includes a current uniform resource locator; and obtaining the second operation data before the data change caused by the data operation request includes: Based on a preset uniform resource locator configuration relationship, determining a dependent uniform resource locator that has a dependent relationship with the current uniform resource locator; The second operation data is acquired according to the dependent uniform resource locator and the current uniform resource locator.

3. The operation log generation method according to claim 2, characterized in that: The acquiring the second operation data according to the dependent uniform resource locator and the current uniform resource locator includes: Determine a corresponding operation request input parameter based on the current uniform resource locator; Encapsulate the configuration relationship between the dependent uniform resource locator and the current uniform resource locator, and the operation request input parameter into an operation object; Based on the operation object, the second operation data is determined.

4. The method according to claim 3, characterized in that The data operation type is data update or data addition, and the determining the second operation data based on the operation object includes: Determine, according to the dependent uniform resource locator in the operation object, old data before the data change caused by the data operation request; If it is detected that the old data has a reference identifier, reflection processing is performed based on the reference identifier to obtain a reference name corresponding to the reference identifier; The second operation data is obtained according to the reference name and the old data.

5. The operation log generation method according to claim 3, characterized in that: The data operation type is data deletion; and determining the second operation data based on the operation object includes: Determine, according to the dependent uniform resource locator in the operation object, old data before the data change caused by the data operation request; If it is detected that the old data does not have a preset key identifier, determining the preset key identifier of the old data based on the primary key identifier of the database where the old data is located; The second operation data is obtained based on the preset key identifier and the old data.

6. The operation log generation method according to any one of claims 1 to 5, characterized in that: Also includes: Identifying a data operation type in the data operation request; The generating a target operation log according to the first operation data and the second operation data includes: generating a target operation log according to the first operation data and the second operation data and the data operation type.

7. The operation log generation method according to any one of claims 1 to 5, characterized in that: After generating a target operation log according to the first operation data and the second operation data, the method further includes: Rendering the target operation log to obtain a rendered operation log; The rendered operation log is displayed on the preset page.

8. An operation log generating device, characterized in that: The operation log generating device comprises: Interception module, used to intercept data operation requests; An acquisition module, used to acquire first operation data in the data operation request, and acquire second operation data before the data operation request causes data change; A generating module is used to generate a target operation log according to the first operation data and the second operation data.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the operation log generating method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the operation log generating method according to any one of claims 1 to 7 are implemented.