Operation log storage method and device, electronic equipment and storage medium

By storing exception log data in the front-end database when performing operations on the browser page, the problem of high storage pressure on back-end servers in the prior art is solved, and the effect of reducing back-end server load and improving system performance is achieved.

CN119902706APending Publication Date: 2025-04-29BEIJING URBAN CONSTR INTELLIGENT CONTROL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411853614.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-04-29

AI Technical Summary

Technical Problem

In the prior art, storing system log data has a high storage pressure on the back-end server, resulting in an increase in the load on the back-end server.

Method used

When performing operations on the browser page, if there is an exception, the exception log data is stored in the front-end database instead of directly storing it to the back-end server, thereby reducing dependence and storage pressure on the back-end server.

Benefits of technology

By storing exception log data in the front-end database, the storage pressure of the back-end server is reduced and the system performance and reliability is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119902706A_ABST
    Figure CN119902706A_ABST
Patent Text Reader

Abstract

The invention provides an operation log storage method and device, electronic equipment and a storage medium, and is applied to the technical field of computers.The method comprises the steps that operation log data generated in the operation execution process of a browser page is obtained; performing data analysis processing on the operation log data, and determining whether the browser page is abnormal in an operation execution process or not; and if the browser page is abnormal in the process of executing the operation, obtaining abnormal log data with abnormity in the operation log data, and storing the abnormal log data in a front-end database. By the adoption of the technical scheme, when the front-end browser page is abnormal in the operation execution process, the abnormal log data can be stored in the front-end database, and therefore the storage pressure of a rear-end server can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an operation log storage method, device, electronic device and storage medium. Background Art

[0002] System operation logs are an important part of the system management and maintenance process. They can provide valuable information to support system operation and management. Therefore, it is necessary to store system operation logs.

[0003] Currently, system operation logs are generally stored in back-end servers such as log management platforms or cloud service storage. When storing system operation logs in log management platforms or cloud service storage, a storage request is usually initiated to the port of the back-end server first, and after the back-end server feeds back a storage response message, the system log is stored in the back-end server through interaction with the back-end server.

[0004] However, this storage method is highly dependent on the backend server, which leads to high storage pressure on the backend server. Summary of the invention

[0005] The present invention provides an operation log storage method, device, electronic device and storage medium, which are used to solve the defect of storing system log data in the prior art that the storage pressure on the back-end server is relatively large, and to achieve the purpose of storing the abnormal log data in the front-end database when an abnormality occurs during the execution of an operation on the front-end browser page, so as to reduce the storage pressure on the back-end server.

[0006] The present invention provides an operation log storage method, comprising: Obtain the operation log data generated by the browser page during the operation; Perform data analysis on the operation log data to determine whether there are any abnormalities in the browser page during the operation; If an exception occurs during the operation of the browser page, the exception log data of the exception is obtained from the operation log data, and the exception log data is stored in the front-end database.

[0007] According to an operation log storage method provided by the present invention, the above-mentioned obtaining of operation log data generated by a browser page during the execution of an operation includes: Using different data acquisition tools to acquire the operation log data generated when the browser page executes different candidate operations; Accordingly, the above data analysis and processing of the operation log data to determine whether there is an abnormality in the process of executing the operation on the browser page includes: Perform data analysis on the operation log data corresponding to each candidate operation to determine whether each candidate operation is abnormal; If at least one candidate operation has an exception, it is determined that an exception occurs during the execution of the operation by the browser page.

[0008] According to an operation log storage method provided by the present invention, the above-mentioned abnormal log data with abnormalities is obtained from the operation log data, and the abnormal log data is stored in the front-end database, including: According to the candidate operation with an exception, candidate operation log data corresponding to the candidate operation with an exception is obtained from the operation log data, and the candidate operation log data is used as the exception log data; Determine the corresponding target exception type according to the candidate operation with the exception; According to the target exception type, a target log storage space corresponding to the target exception type is determined in the front-end database, and the exception log data is stored in the target log storage space; the front-end database includes different exception types and log storage spaces corresponding to each exception type.

[0009] According to an operation log storage method provided by the present invention, the candidate operation includes a user operation, and the operation log data corresponding to each candidate operation is analyzed and processed to determine whether each candidate operation is abnormal, including: After the user operation is completed, the user updated data corresponding to the user operation is obtained in the browser page after the user data is updated; Matching the user updated data with at least one preset flag data; the preset flag data is data obtained by embedding the user's current data after performing corresponding user operations at different operation stages; If the user update data successfully matches any flag data, it is determined that there is no abnormality in the user operation; if the user update data fails to match all flag data, it is determined that there is an abnormality in the user operation.

[0010] According to an operation log storage method provided by the present invention, the method further includes: Obtaining a log operation request input by a user; the log operation request includes the target permission level corresponding to the user and the pending operation that the user needs to perform on the front-end database; According to the target permission level, the permission operation corresponding to the user is determined in the preset permission correspondence relationship; the above permission correspondence relationship includes different permission levels and the operations that can be performed on the front-end database corresponding to each permission level; Determine the target operations that the user can perform on the front-end database based on the permission operations and pending operations.

[0011] According to an operation log storage method provided by the present invention, the method further includes: When the network is offline, a log query request input in the browser page is obtained; the log query request includes login information for logging into the front-end database and the abnormal type to be queried of the abnormal log data to be queried; Log in to the front-end database in the browser page according to the login information, and query the exception log data corresponding to the exception type to be queried in the front-end database according to the exception type to be queried; The found exception log data corresponding to the exception type to be queried is displayed on the browser page.

[0012] The present invention also provides an operation log storage device, comprising the following modules: The data acquisition module is used to acquire the operation log data generated by the browser page during the execution of the operation; The data analysis module is used to analyze and process the operation log data to determine whether there are any abnormalities in the browser page during the operation; The log storage module is used to obtain abnormal log data of the abnormality in the operation log data if there is an abnormality in the browser page during the execution of the operation, and store the abnormal log data in the front-end database.

[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the operation log storage method described in any one of the above is implemented.

[0014] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the operation log storage method described in any one of the above is implemented.

[0015] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the operation log storage method described in any one of the above is implemented.

[0016] The operation log storage method, device, electronic device and storage medium provided by the present invention obtain the operation log data generated by the browser page during the operation, and perform data analysis and processing on the operation log data to determine whether there is an abnormality in the browser page during the operation. If there is an abnormality in the browser page during the operation, the abnormal log data with the abnormality is obtained from the operation log data, and then the abnormal log data is stored in the front-end database. In this method, since the abnormal log data can be obtained and stored in the front-end database after the abnormality occurs when the browser page performs the operation, there is no need for the front-end browser page and the back-end server to interact to store the operation log data in the back-end server, thereby reducing the dependence on the back-end server and reducing the storage pressure on the back-end server; and storing in the front-end database can also facilitate operations such as querying the operation log data of the front-end browser page. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are 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.

[0018] Figure 1 This is one of the flow charts of the operation log storage method provided by the present invention.

[0019] Figure 2 This is the second flow chart of the operation log storage method provided by the present invention.

[0020] Figure 3 This is the third flow chart of the operation log storage method provided by the present invention.

[0021] Figure 4 It is a structural schematic diagram of the operation log storage device provided by the present invention.

[0022] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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.

[0024] The system operation log is a record of the operations and events performed by the system during operation. It can include the system startup and shutdown time, user login and logout information, system errors and exceptions, system configuration changes, data access and modification, etc. The system operation log is very important for troubleshooting, security auditing, performance analysis and system monitoring. By analyzing the system operation log, you can understand the operation of the system, find potential problems, track user activities, detect security events, and perform system performance and optimization analysis. In short, the system operation log is an important part of the system management and maintenance process, and can provide valuable information to support system operation and management. At present, the mainstream storage methods of the system operation log include local file system storage, database storage, log management platform storage, cloud service storage and other methods, but most of these storage methods involve the need to interact with the back-end server to realize the storage of system log data, thereby making the storage pressure of the back-end server larger. Based on this, the embodiment of the present invention provides an operation log storage method, device, electronic device and storage medium, which can solve this technical problem.

[0025] Combine the following Figure 1-Figure 3 The operation log storage method according to an embodiment of the present invention is described.

[0026] It should be noted that the execution subject of the embodiments of the present invention may be an operation log storage device, or an electronic device including an operation log storage device, or a device including an operation log storage device or an electronic device and supporting a browser, which may be a terminal or other device. The following embodiments will be described using the electronic device as the execution subject.

[0027] Figure 1 This is one of the flow charts of the operation log storage method provided by the present invention, such as Figure 1 As shown, the method comprises the following steps: S102, obtaining operation log data generated by the browser page during the execution of the operation.

[0028] Among them, the browser and the browser page are front-end applications compared to the server. After the browser page is opened on the electronic device (such as a terminal) where the browser is installed, the browser can start running. During the operation of the browser, the browser page itself can directly perform some operations, such as page loading operations, page rendering operations, etc. Of course, the user can also trigger operations on the browser page to make the browser page execute. The browser page will generate corresponding operation log data during the execution of the operation. The electronic device can obtain the operation log data through the monitoring port on the browser page, etc. The operation log data can be system operation log data, such as performance data of page loading, resource loading data, page loading event data, page change data, page rendering data, etc.

[0029] S104, analyzing and processing the operation log data to determine whether there is any abnormality in the process of executing the operation on the browser page.

[0030] The data analysis process may include parsing, statistics, timeout analysis, monitoring, and the like of the operation log data.

[0031] Specifically, after obtaining the operation log data, assuming that the operation log data includes the performance data of the browser page loading, the page loading time can be obtained by parsing the performance data, and it is determined whether the page loading time exceeds the set time (such as 5 seconds or 10 seconds). For example, the timing starts when the page is entered, and the timing ends after all the page elements are loaded. If the loading time exceeds the set time, it can be recorded as the page loading is too long. If it exceeds the set time, it means that the browser page may have an abnormality in the process of executing the operation. For another example, if the operation log data includes the resource loading data of the browser page (such as resource loading abnormality data), the resource loading data can be parsed to obtain whether there is a problem with the code or the network or whether the browser is compatible (such as capturing the error and analyzing and recording the information). If there is a problem, it means that the browser page may have an abnormality in the process of executing the operation. For another example, if the operation log data includes a page loading event, the page loading event can be monitored through the observe monitoring port to determine whether the browser page has a page change. If there is no change, it means that the browser page may have an abnormality in the process of executing the operation (such as a white screen on the page). For example, if the operation log data includes the page rendering performance data of the browser page, the page rendering performance problem can be captured, and the page uninstall event can be monitored to check whether all event handlers and timers are cleared to avoid memory leaks. If they are not cleared, it means that the browser page may have an exception during the operation. The above are only examples and are not exhaustive.

[0032] In the above manner, corresponding data analysis and processing can be performed on the operation log data to obtain the result of whether there is any abnormality in the process of executing the operation on the browser page.

[0033] S106: If an exception occurs during the operation of the browser page, abnormal log data of the exception is obtained from the operation log data, and the abnormal log data is stored in the front-end database.

[0034] In this step, if the above operation log data determines that there is an abnormality in the process of executing the operation of the browser page, then the operation log data where the specific abnormality occurs can be obtained through the above process of determining the abnormality (for example, if the page loading time is abnormal, the operation log data corresponding to the page loading time is the abnormal log data), and the operation log data with abnormalities is extracted from the operation log data, which is recorded as abnormal log data. The abnormal log data here can include operation log data under problems such as slow page loading, chaotic page rendering, abnormal interaction, white screen page, and page freeze. After that, the abnormal log data can be stored in the database of the front end associated with the browser, which is recorded as the front end database, such as indexDB (index DataBase) or indexedDB index database.

[0035] The front-end database is different from the database of the back-end server. It is a low-level, transactional client-side storage database used in the browser, which can store a large amount of structured data and can record and access data offline in the browser. IndexDB or indexedDB can provide an API (Application Programming Interface) similar to a relational database, allowing the storage and retrieval of key-value data, and supporting indexing and range queries, so it is easy to operate on the abnormal log data after it is stored in the front-end database.

[0036] When storing the exception log data generated during the browser page operation in the front-end database, the browser page does not need to interact with the back-end server for requests (such as data storage requests, query requests, deletion requests, etc.), but directly stores the exception log data in the front-end database. This can reduce the requests for the back-end interface and the need for more detailed records (such as operation records of interface request failures or offline states also need to be recorded). That is, the exception log data in a pure front-end scenario can be independently recorded / stored without relying on the back-end server, thereby greatly reducing the storage pressure on the back-end server.

[0037] Of course, if there is enough storage space in the front-end database, after the abnormal log data is extracted from the operation log data as mentioned above, the remaining operation log data is normal operation log data, and then this part of the operator log data is also stored in the front-end database and marked as normal log data to distinguish it from the abnormal log data.

[0038] Furthermore, after the abnormal log records are stored in the front-end database, an interface request can also be used to determine whether the abnormal log data needs to be synchronized to the upper layer node. At the same time, the abnormal log data can be summarized and analyzed as well as added, deleted, modified, and checked according to needs.

[0039] In this embodiment, the operation log data generated by the browser page during the operation is obtained, and the operation log data is analyzed and processed to determine whether there is an abnormality in the browser page during the operation. If there is an abnormality in the browser page during the operation, the abnormal log data with the abnormality is obtained from the operation log data, and then the abnormal log data is stored in the front-end database. In this method, since the abnormal log data can be obtained and stored in the front-end database after the abnormality occurs when the browser page performs the operation, there is no need for the front-end browser page and the back-end server to interact to store the operation log data in the back-end server, thereby reducing the dependence on the back-end server and reducing the storage pressure on the back-end server; and storing in the front-end database can also facilitate operations such as querying the operation log data of the front-end browser page.

[0040] The following embodiments illustrate the process of obtaining operation log data when there are different operations and the process of determining whether there is an abnormality in the browser page execution process based on the operation log data.

[0041] Figure 2 This is the second flow chart of the operation log storage method provided by the present invention, such as Figure 2 As shown, the above S102 may include the following steps: S202, using different data acquisition tools to acquire operation log data generated when the browser page executes different candidate operations.

[0042] Among them, for different operations performed on the browser page (all of which can be recorded as candidate operations), different data acquisition tools can be used to obtain the operation log data generated under the corresponding operations. Of course, for some different operations, the same data acquisition tool can also be used to obtain the operation log data generated under different operations (for example, the same data acquisition tool is used at different times to obtain the operation log data generated under different operations).

[0043] The candidate operations here may include, for example, page loading operations, resource loading operations, page rendering operations, global exception catching operations, operations triggered by users on browser pages, and the like.

[0044] The data acquisition tools here can include, for example, window.performance (window performance data) object, window.addeventListener ("error") (window add listener (error)), observe (monitor), window.addeventListener ("DOMContentLoaded") (window add listener (DOM content loaded)) event, window.requestAnimationFrame (window request animation frame), etc. For example, you can use the window.performance object to obtain page loading performance data, use window.addeventListener ("error") to capture some resource loading errors, monitor page changes through observe, capture page loading events through window.addeventListener ("DOMContentLoaded") events, capture page rendering problems through window.requestAnimationFrame, and use window.error (window error) to capture global exceptions.

[0045] Accordingly, the above S104 may include the following steps: S204: Perform data analysis on the operation log data corresponding to each candidate operation to determine whether each candidate operation has an abnormality.

[0046] After obtaining the operation log data corresponding to different candidate operations, data analysis and processing can be performed on these operation log data to obtain the result of whether each candidate operation has an abnormality. For example, based on the performance data, determine whether the page loading operation has an abnormality (slow page loading generally indicates an abnormality). For example, when a page loading event exceeds the set time, it means that the page loading operation has an abnormality, otherwise there is no abnormality.

[0047] Taking the above candidate operation including a user operation as an example, as an optional embodiment, the above data analysis and processing process may include: After the user operation is completed, the user update data corresponding to the user operation is obtained in the browser page after the user data is updated; the user update data is matched with at least one preset flag data; the above preset flag data is the data obtained by burying the user's current data after performing the corresponding user operation in different operation stages; if the user update data successfully matches any flag data, it is determined that there is no abnormality in the user operation; if the user update data fails to match all flag data, it is determined that there is an abnormality in the user operation.

[0048] Among them, user operations may include user addition operations, query operations, modification operations, deletion operations, etc. on the browser page. You can perform tracking at different operation stages to complete the flag data / information recording. Take the user operation as a new operation as an example. For example, if a user is added on the browser page, you can fill in the user information on the browser page. After filling in, you can click Submit. After submission, you can record the user name and other information. Then, you can perform tracking at the new user interface to record the corresponding user current data (such as the new user name and other information), which is recorded as flag data. After the successful submission on the browser page, you can make an interface query request so that the browser page updates the data based on the user operation and obtains the user update data (such as the updated user name and other information on the browser page). After that, the user update data in the browser page can be matched with the flag data of the previous tracking. If the flag data can be matched, it means that the match is successful, that is, there is no abnormality in the user operation, such as adding a new user. After the user is added, a list query can be performed to query the new user; if the flag data cannot be matched, it means that the match fails, that is, there is an abnormality in the user operation, such as adding a new user. After the user is added, a list query cannot be performed to query the new user; if the flag data cannot be matched, it means that the match fails, that is, there is an abnormality in the user operation, such as adding a new user. After the user is added, a list query cannot be performed to query the new user. The operation log data corresponding to the user operation can then be recorded as normal or abnormal.

[0049] S206: If at least one candidate operation is abnormal, determine that an abnormality occurs during the execution of the operation by the browser page.

[0050] In this step, the operation log data of each candidate operation can be analyzed and processed to determine whether it is abnormal, and the result of whether the corresponding candidate operation is abnormal can be obtained. If the result of one or more candidate operations is abnormal, it can indicate that there is an abnormality in the process of executing the operation of the browser page.

[0051] In this embodiment, different data acquisition tools are used to acquire the operation log data when the browser page executes different candidate operations, and after data analysis and processing of each operation log data, when at least one candidate operation is abnormal, it is determined that there is an abnormality in the process of executing the operation of the browser page. In this way, the abnormality of the browser page execution is determined by the abnormality of each candidate operation, which can improve the accuracy of the browser abnormal log data recording. In addition, when the candidate operation includes a user operation, the user's update data can be matched with the flag bit data of the buried point during the operation to obtain whether the user operation is abnormal. In this way, the analysis process of the log data of the user operation is refined, which can improve the accuracy of the obtained data analysis results, that is, the abnormal results, and thus improve the accuracy of the browser abnormal log data recording.

[0052] The following embodiment describes the process of classifying and storing abnormal log data.

[0053] Figure 3 This is the third flow chart of the operation log storage method provided by the present invention, such as Figure 3 As shown, the above S106 may include the following steps: S302: According to the candidate operation with an exception, obtain candidate operation log data corresponding to the candidate operation with an exception in the operation log data, and use the candidate operation log data as the exception log data.

[0054] In this step, as mentioned in the above embodiment, it is possible to analyze whether each candidate operation is abnormal, and obtain candidate operations with abnormalities. Afterwards, operation log data related to these candidate operations with abnormalities (generally, operation log data involved in data analysis) can be obtained from the operation log data and recorded as candidate operation log data. These candidate operation log data are log data with abnormalities, and can be further used as abnormal log data.

[0055] S304: Determine a corresponding target exception type according to the candidate operation with the exception.

[0056] In this step, the abnormal situations that may occur during the operation of the browser page can be collected in advance, and then these abnormal situations can be classified into multiple abnormal types, such as login failure, operation failure, long page loading time, resource loading abnormality, global exception capture, etc.

[0057] Among them, login failure can include the exception type of functional abnormality / network abnormality, and can also include the exception type of design problem / user operation abnormality. Among them, login failure caused by request failure can be counted as the exception type of functional abnormality / network abnormality, and login failure caused by insufficient user authority level can be counted as the exception type of design problem / user operation abnormality.

[0058] After obtaining the candidate operation with abnormalities, the operation log data of the candidate operation with abnormalities can be analyzed to determine the specific abnormality type to which the candidate operation with abnormalities belongs, which is recorded as the target abnormality type. For example, if the candidate operation with abnormalities is that the page loads too slowly, then the corresponding target abnormality type is the abnormality type of the page loading time being too long.

[0059] S306, according to the target exception type, determine the target log storage space corresponding to the target exception type in the front-end database, and store the exception log data in the target log storage space; the front-end database includes different exception types and the log storage space corresponding to each exception type.

[0060] According to the abnormal types divided in S304, different log storage spaces can be divided in advance in the front-end database for different abnormal types to achieve the purpose of classified storage of log data in the front-end database. Of course, a log storage space corresponding to a normal type can also be set in the front-end database to store normal operation log data.

[0061] After obtaining the target abnormality type, the corresponding abnormality type can be matched in the front-end database, and the corresponding log storage space can be obtained, which is recorded as the target log storage space. The abnormal log data corresponding to the target abnormality type can then be stored in the target storage space of the front-end database.

[0062] In this embodiment, by determining the abnormal log data corresponding to the candidate operation with the exception and its corresponding target exception type, and finding the target log storage space matching the target exception type in the front-end database to classify and store the corresponding abnormal log data, it is convenient to classify and store various types of abnormal logs, and facilitate subsequent operations such as adding, deleting, modifying and checking the abnormal log data.

[0063] The following embodiment describes the process of operating the front-end database according to the user authority level.

[0064] In some embodiments, the above method may further include the following steps: Step A1, obtaining a log operation request input by a user; the log operation request includes the target authority level corresponding to the user and the pending operation that the user needs to perform on the front-end database.

[0065] Step A2, according to the target permission level, determine the permission operation corresponding to the user in the preset permission correspondence relationship; the above permission correspondence relationship includes different permission levels and the operations that can be performed on the front-end database corresponding to each permission level.

[0066] Step A3, determining the target operation that the user can perform on the front-end database according to the permission operation and the pending operation.

[0067] Among them, different permission levels can be assigned to different registered users in advance by the browser page, such as permission levels including ordinary users and advanced users, and then different operations can be set for different permission levels. The different operations refer to the operations that can be performed on the front-end database, and a correspondence between different permission levels and their corresponding operations is established, which is recorded as a permission correspondence relationship. For example, the operations that ordinary users can perform on the front-end database include query operations and new operations, and the operations that advanced users can perform on the front-end database include new operations, deletion operations, modification operations, and query operations. Generally, the higher the permission level, the more operations that can be performed on the front-end database or the more advanced they are.

[0068] When the above user needs to query the log data in the front-end database, he can enter a log operation request in the browser page of the front end. The log operation request can include the permission level corresponding to the user (recorded as the target permission level), for example, the target permission level corresponding to the user is an ordinary user. The log operation request can also include the operation that the user needs to perform on the front-end database, recorded as a pending operation, and the pending operation can be any one of a new operation, a delete operation, a modification operation, and a query operation. After that, the operation corresponding to the target permission level can be found in the permission correspondence relationship, recorded as a permission operation. Then it can be determined whether the permission operation includes the pending operation. If it does, the pending operation is used as the target operation that the user can perform on the front-end database; for example, the pending operation includes the query operation, and the permission operation includes the query operation and the new operation, then the query operation is the target operation that the user can perform on the front-end database. For example, the pending operation includes the delete operation, the permission operation includes the query operation and the new operation, and the permission operation does not include the delete operation, then the target operation that the user can perform on the front-end database is the query operation and the new operation, and the delete operation cannot be performed.

[0069] It should be noted that, in a normal network state or an offline network state, a log operation request can be obtained in the front-end browser page to perform a target operation on the front-end database.

[0070] In this embodiment, the permission operations that the user can perform on the front-end database are determined by the user's permission level and compared with the pending operations that the user needs to perform to determine the user's target operation on the front-end database. This can avoid the problem of data loss or damage caused by unauthorized users' incorrect operations on the front-end database, thereby ensuring the validity of the log data in the front-end database.

[0071] The following embodiment describes the process of querying abnormal log data in a front-end database in an offline state.

[0072] In some embodiments, the above method may further include the following steps: Step B1, when the network is offline, obtain a log query request input in a browser page; the log query request includes login information for logging into a front-end database and anomaly types to be queried of the abnormal log data to be queried.

[0073] Step B2: log in to the front-end database in the browser page according to the login information, and query the front-end database for abnormal log data corresponding to the abnormal type to be queried according to the abnormal type to be queried.

[0074] Step B3: Display the found abnormal log data corresponding to the abnormal type to be queried on the browser page.

[0075] Among them, when the network is offline, the user can still enter the login information for logging into the front-end database and the abnormal type corresponding to the abnormal log data to be queried (recorded as the abnormal type to be queried) in the front-end browser page, and form a log query request with the login information and the abnormal type to be queried so that the electronic device can obtain it. The login information includes login user name, password and other information.

[0076] After that, the electronic device can log in to the front-end database according to the login information input by the user. After the login is successful, the front-end database can be queried. Specifically, the abnormal type to be queried can be entered in the front-end database, and then the abnormal type to be queried can be matched in the front-end database, and then the log storage space corresponding to the abnormal type to be queried can be found, and the abnormal log data stored therein can be obtained. After the abnormal log data of the abnormal type to be queried can be displayed on the browser page.

[0077] Of course, the above log query request can also be performed when the network is in a normal state.

[0078] In this embodiment, the front-end database is logged in through the login information entered by the user in the browser page when the network is offline, and the exception type to be queried entered by the user is matched to the exception log data in the corresponding storage space in the front-end database and displayed in the browser page. This makes it convenient for users to view the exception log data when the network is offline, thereby improving log operation requirements.

[0079] The operation log storage device provided by the present invention is described below. The operation log storage device described below and the operation log storage method described above can be referred to each other.

[0080] Figure 4 is a schematic diagram of the structure of the operation log storage device provided by the present invention, see Figure 3 As shown, the device may include: The data acquisition module 410 is used to acquire the operation log data generated by the browser page during the execution of the operation; The data analysis module 420 is used to perform data analysis on the operation log data to determine whether there is any abnormality in the process of executing the operation on the browser page; The log storage module 430 is used to obtain abnormal log data of the abnormality in the operation log data if an abnormality occurs during the execution of the operation on the browser page, and store the abnormal log data in the front-end database.

[0081] In some embodiments, the data acquisition module 410 is specifically used to Using different data acquisition tools to acquire the operation log data generated when the browser page executes different candidate operations; Accordingly, the data analysis module 420 is specifically used for Data analysis and processing are performed on the operation log data corresponding to each candidate operation to determine whether each candidate operation has an exception; if at least one candidate operation has an exception, it is determined that an exception exists in the process of executing the operation on the browser page.

[0082] Optionally, the candidate operation includes a user operation, and the data analysis module 420 is specifically used to After the user operation is completed, the user update data corresponding to the user operation is obtained in the browser page after the user data is updated; the user update data is matched with at least one preset flag data; the above preset flag data is the data obtained by burying the user's current data after performing the corresponding user operation in different operation stages; if the user update data successfully matches any flag data, it is determined that there is no abnormality in the user operation; if the user update data fails to match all flag data, it is determined that there is an abnormality in the user operation.

[0083] In some embodiments, the log storage module 430 is specifically used to According to the candidate operation with exceptions, candidate operation log data corresponding to the candidate operation with exceptions is obtained in the operation log data, and the candidate operation log data is used as the exception log data; the corresponding target exception type is determined according to the candidate operation with exceptions; according to the target exception type, a target log storage space corresponding to the target exception type is determined in the front-end database, and the exception log data is stored in the target log storage space; the above-mentioned front-end database includes different exception types and log storage space corresponding to each exception type.

[0084] In some embodiments, the above apparatus further comprises: An operation module is used to obtain a log operation request input by a user; the log operation request includes a target permission level corresponding to the user and a pending operation that the user needs to perform on a front-end database; according to the target permission level, the permission operation corresponding to the user is determined in a preset permission correspondence relationship; the permission correspondence relationship includes different permission levels and the operations that can be performed on the front-end database corresponding to each permission level; according to the permission operation and the pending operation, the target operation that the user can perform on the front-end database is determined.

[0085] In some embodiments, the above apparatus further comprises: The query module is used to obtain a log query request input in a browser page when the network is offline; the log query request includes login information for logging into a front-end database and the type of abnormality to be queried of the abnormal log data to be queried; the front-end database is logged in in the browser page according to the login information, and the abnormal log data corresponding to the abnormal type to be queried is queried in the front-end database according to the abnormal type to be queried; the abnormal log data corresponding to the abnormal type to be queried obtained is displayed in the browser page.

[0086] It should be noted here that the above-mentioned device provided in the embodiment of the present invention can implement all the method steps implemented in the above-mentioned method embodiment, and can achieve the same technical effect. The parts and beneficial effects that are the same as the method embodiment in this embodiment will not be described in detail here.

[0087] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the operation log storage method, which includes: obtaining the operation log data generated by the browser page during the operation; performing data analysis and processing on the operation log data to determine whether there is an abnormality in the browser page during the operation; if there is an abnormality in the browser page during the operation, obtaining the abnormal log data of the abnormality in the operation log data, and storing the abnormal log data in the front-end database.

[0088] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0089] On the other hand, the present invention also provides a computer program product, which includes a computer program, and the computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the operation log storage method provided by the above methods, and the method includes: obtaining operation log data generated by the browser page during the execution of the operation; performing data analysis and processing on the operation log data to determine whether there is an exception in the process of the browser page executing the operation; if there is an exception in the process of the browser page executing the operation, obtaining exception log data of the exception in the operation log data, and storing the exception log data in a front-end database.

[0090] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to execute the operation log storage method provided by the above-mentioned methods. The method includes: obtaining operation log data generated by a browser page during the execution of an operation; performing data analysis and processing on the operation log data to determine whether there is an exception in the process of the browser page executing the operation; if there is an exception in the process of the browser page executing the operation, obtaining exception log data of the exception in the operation log data, and storing the exception log data in a front-end database.

[0091] It should be noted that the user data, user information, passwords or user operations involved in the embodiments of the present invention are all data, information, passwords or operations authorized by the user.

[0092] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0093] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0094] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for storing an operation log, characterized in that: include: Obtain the operation log data generated by the browser page during the operation; Performing data analysis and processing on the operation log data to determine whether there is an abnormality in the process of executing the operation on the browser page; If an exception occurs during the operation of the browser page, abnormal log data of the exception is obtained from the operation log data, and the abnormal log data is stored in the front-end database.

2. The operation log storage method according to claim 1, characterized in that: The obtaining of operation log data generated by the browser page during the execution of the operation includes: Using different data acquisition tools to acquire operation log data generated when the browser page executes different candidate operations; Accordingly, the performing of data analysis and processing on the operation log data to determine whether there is an abnormality in the process of executing the operation on the browser page includes: Performing data analysis on the operation log data corresponding to each of the candidate operations to determine whether each of the candidate operations is abnormal; If at least one candidate operation has an abnormality, it is determined that an abnormality exists in the process of executing the operation on the browser page.

3. The operation log storage method according to claim 2, characterized in that: The step of obtaining abnormal log data having abnormalities from the operation log data and storing the abnormal log data in a front-end database includes: According to the candidate operation with an exception, obtaining candidate operation log data corresponding to the candidate operation with an exception in the operation log data, and using the candidate operation log data as the exception log data; Determine a corresponding target abnormality type according to the candidate operation with the abnormality; According to the target exception type, a target log storage space corresponding to the target exception type is determined in the front-end database, and the exception log data is stored in the target log storage space; the front-end database includes different exception types and log storage spaces corresponding to each exception type.

4. The operation log storage method according to claim 2, characterized in that: The candidate operations include user operations, and the data analysis and processing of the operation log data corresponding to each of the candidate operations to determine whether each of the candidate operations is abnormal includes: After the user operation is completed, obtaining the user updated data corresponding to the user operation in the browser page after the user data is updated; Matching the user updated data with at least one preset flag data; the preset flag data is data obtained by embedding the user's current data after performing corresponding user operations at different operation stages; If the user update data successfully matches any flag data, it is determined that there is no abnormality in the user operation; if the user update data fails to match all flag data, it is determined that there is an abnormality in the user operation.

5. The operation log storage method according to any one of claims 1 to 4, characterized in that: The method further comprises: Obtaining a log operation request input by a user; the log operation request includes a target authority level corresponding to the user and a pending operation that the user needs to perform on the front-end database; According to the target permission level, determining the permission operation corresponding to the user in a preset permission correspondence relationship; the permission correspondence relationship includes different permission levels and the operations that can be performed on the front-end database corresponding to each permission level; According to the permission operation and the pending operation, a target operation that the user can perform on the front-end database is determined.

6. The operation log storage method according to any one of claims 1 to 4, characterized in that: The method further comprises: When the network is offline, obtaining a log query request input in the browser page; the log query request includes login information for logging into the front-end database and an abnormal type to be queried of the abnormal log data to be queried; Logging into the front-end database in the browser page according to the login information, and querying the front-end database for abnormal log data corresponding to the abnormal type to be queried according to the abnormal type to be queried; The queried exception log data corresponding to the to-be-queried exception type is displayed on the browser page.

7. An operation log storage device, characterized in that: include: The data acquisition module is used to acquire the operation log data generated by the browser page during the execution of the operation; A data analysis module is used to perform data analysis on the operation log data to determine whether there is an abnormality in the process of executing the operation on the browser page; The log storage module is used to obtain abnormal log data of the abnormality in the operation log data if there is an abnormality in the process of executing the operation of the browser page, and store the abnormal log data in the front-end database.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the operation log storage method according to any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the operation log storage method according to any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the operation log storage method according to any one of claims 1 to 6 is implemented.