An operation log management method, device, equipment and readable storage medium

By creating an operation log configuration table in the database and configuring the operation log configuration information of each function, the problem of high complexity in operation log management in the existing technology is solved, and simplified configuration and efficient management are achieved.

CN115114256BActive Publication Date: 2025-08-01JINAN INSPUR DATA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210891729.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-27
Publication Date
2025-08-01
Estimated Expiration
2042-07-27

AI Technical Summary

Technical Problem

The existing operation log management has high complexity caused by hard code coding, frequent modification of code and documents, resulting in cumbersome and inefficient management.

Method used

Create an operation log configuration table in the database, configure the operation log configuration information of each function, and record and modify the operation log configuration table through the operation log configuration table to avoid code modification and redistribution.

Benefits of technology

Reduces the complexity and workload of operation log management, improves the convenience and accuracy of operation logging, and simplifies the configuration and maintenance process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115114256B_ABST
    Figure CN115114256B_ABST
Patent Text Reader

Abstract

The present application discloses an operation log management method, device, equipment and readable storage medium. The method includes: creating an operation log configuration table in a database; configuring operation log configuration information of each function in the operation log configuration table; and recording operation logs for operations of the corresponding functions according to the operation log configuration information of each function configured in the operation log configuration table. The technical solution disclosed in the present application realizes that only the operation log configuration information of each function in the operation log configuration table needs to be configured by creating the operation log configuration table in the database, and when modification is required, only the corresponding operation log configuration information in the operation log configuration table needs to be modified, without operations such as code modification, re-release, and synchronous modification of the Cli manual. Therefore, the complexity and workload of operation log configuration management can be reduced, and the difficulty of operation log management can be reduced, thereby improving the convenience and efficiency of operation log management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of log management, and more specifically, to an operation log management method, device, equipment and readable storage medium. Background Art

[0002] The function of the operation log is to record all operations, so as to facilitate subsequent querying and obtaining of operation-related information from the operation log.

[0003] Currently, the description of the operation log is hard-coded in the code. If you want to modify it, you can only change the code, and then re-release and maintain it. Moreover, the description of the operation log is mostly the splicing of Cli (command-line interface) parameters. If the Cli parameter description is not clear, you need to change the Cli command to make the description readable. In this case, not only the code needs to be modified, but also the Cli operation manual provided to the user needs to be changed, and then re-release and maintain it. That is to say, when performing configuration management on the operation log, every time the operation log configuration information needs to be modified, the hard-coded logic of the operation log needs to be modified, that is, the hard-coded logic in the code needs to be modified to implement the modification of the operation log configuration information. After the code is modified, it is also necessary to re-release and maintain it, which makes the operation log management cumbersome and complex.

[0004] In summary, how to reduce the complexity of operation log management is a technical problem that those skilled in the art need to solve urgently at present. Summary of the Invention

[0005] In view of this, the purpose of the present application is to provide an operation log management method, device, equipment and readable storage medium for reducing the complexity of operation log management.

[0006] In order to achieve the above purpose, the present application provides the following technical solutions:

[0007] An operation log management method includes:

[0008] Create an operation log configuration table in the database;

[0009] Configure the operation log configuration information of each function in the operation log configuration table;

[0010] Record the operation log of the corresponding function according to the operation log configuration information of each function configured in the operation log configuration table.

[0011] Preferably, configuring the operation log configuration information of each function in the operation log configuration table includes:

[0012] Configure the operation log record configuration item, operation description configuration item, failure details configuration item, and operation level configuration item corresponding to each of the functions in the operation log configuration table;

[0013] Among them, the operation log record configuration item is used to indicate whether to enable the operation log record of the function, the operation description configuration item is used to configure the operation description, the failure details configuration item is used to configure the failure details, and the operation level configuration item is used to indicate the operation level of the function.

[0014] Preferably, configuring the operation log record configuration item corresponding to each of the functions in the operation log configuration table includes:

[0015] Add a status field corresponding to each of the functions in the operation log configuration table, and set a specific value for the status field according to whether to enable the operation log record of the function.

[0016] Preferably, configuring the operation description configuration item corresponding to each of the functions in the operation log configuration table includes:

[0017] Add a description configuration type field and a description configuration content field corresponding to each of the functions in the operation log configuration table;

[0018] Among them, the description configuration type field is used to store the description configuration type, the description configuration content field is used to store the description configuration content corresponding to the description configuration type, and the description configuration type is divided into custom, Cli parameter splicing, and Cli parameter item replacement.

[0019] Preferably, when the description configuration type of the function is Cli parameter item replacement, the description configuration content includes the field to be modified in the Cli parameter, the field to be replaced with, and the content to be modified to.

[0020] Preferably, configuring the failure details configuration item corresponding to each of the functions in the operation log configuration table includes:

[0021] Add an error code field corresponding to each of the functions in the operation log configuration table, and configure the failure information corresponding to each error code under the error code field.

[0022] Preferably, it further includes:

[0023] When performing operation log query, perform operation log query according to the operation log configuration table and the recorded operation logs, and display the queried operation logs.

[0024] An operation log management device includes:

[0025] A creation module, used to create an operation log configuration table in the database;

[0026] A configuration module for configuring operation log configuration information of each function in the operation log configuration table;

[0027] A recording module for recording operation logs of corresponding functions according to the operation log configuration information of each function configured in the operation log configuration table.

[0028] An operation log management device, comprising:

[0029] A memory for storing a computer program;

[0030] A processor for implementing the steps of the operation log management method as described in any one of the above when executing the computer program.

[0031] A readable storage medium storing a computer program, and the computer program implements the steps of the operation log management method as described in any one of the above when executed by a processor.

[0032] The present application provides an operation log management method, device, equipment and readable storage medium. Among them, the method includes: creating an operation log configuration table in a database; configuring operation log configuration information of each function in the operation log configuration table; and recording operation logs of corresponding functions according to the operation log configuration information of each function configured in the operation log configuration table.

[0033] The above technical solution disclosed in the present application creates an operation log configuration table in a database, and configures operation log configuration information of each function in the operation log configuration table. Subsequently, when recording operation logs, the operation logs of corresponding functions can be recorded based on the operation log configuration information of each function configured in the created operation log configuration table, so as to improve the convenience and accuracy of operation log recording. Compared with the existing method of configuring and modifying operation log configuration information by modifying the hard-coded logic in the code, the present application only needs to configure the operation log configuration information of each function in the operation log configuration table in the database, and only needs to modify the corresponding operation log configuration information in the operation log configuration table when modification is required, without the need to modify the code, re-release, synchronously modify the Cli manual, etc. Therefore, the complexity and workload of operation log configuration management can be reduced, and the difficulty of operation log management can be reduced, thereby improving the convenience and efficiency of operation log management. Description of the Drawings

[0034] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only the embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can also be obtained based on the provided drawings.

[0035] Figure 1 It is a flowchart of an operation log management method provided by an embodiment of the present application;

[0036] Figure 2 It is a flowchart of another operation log management method provided by an embodiment of the present application;

[0037] Figure 3 It is a schematic structural diagram of an operation log management device provided by an embodiment of the present application;

[0038] Figure 4 It is a schematic structural diagram of an operation log management device provided by an embodiment of the present application. Detailed implementation manners

[0039] Currently, there are great drawbacks in the existing operation log management: 1. The operation log description is hard-coded in the code, and if you want to modify it, you can only change the code; 2. Most of the operation log descriptions are the splicing of Cli parameters (users can use, manage, and maintain storage devices through Cli, for example: icfs-admin-cluster-set-cluster–status 1). If the Cli parameter description is not clear, you need to change the Cli command to make the description readable, but at this time, you need to modify the code and also modify the relevant operation manuals provided to users; 3. Once the code is modified, it is necessary to re-release and maintain. That is, the existing operation log management has relatively cumbersome and complex problems.

[0040] Therefore, the present application provides an operation log management method, device, device, and readable storage medium to reduce the complexity of operation log management.

[0041] The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present application.

[0042] See Figure 1 , which shows a flowchart of an operation log management method provided by an embodiment of the present application. An operation log management method provided by an embodiment of the present application may include:

[0043] S11: Create an operation log configuration table in the database.

[0044] First, an operation log configuration table can be created in the database, that is, a database table is created in the database and used as the operation log configuration table.

[0045] Among them, the database mentioned here can specifically be any one of the MySQL (a relational database management system) database, SQLServer (a relational database system launched by Microsoft), Oracle database (a database management system), Redis (an open-source log-type, Key-Value database written in ANSI C language, supporting networking, and can be memory-based or persistent) database. Of course, it can also be other databases, and this application does not limit this.

[0046] By creating an operation log configuration table in the database, the operation log configuration table can be persisted in the database for subsequent utilization.

[0047] S12: Configure the operation log configuration information of each function in the operation log configuration table.

[0048] Based on step S11, the operation log configuration information of each function can be configured in the operation log configuration table, that is, the operation log configuration information of each function can be configured in the operation log configuration table created in the database. And after configuring the operation log configuration information of each function in the operation log configuration table, if it is necessary to modify the operation log configuration information of the target function (that is, the function that needs to modify the operation log configuration information, such as scenarios where the description of the operation log configuration information is incorrect or the user's requirements for the operation log configuration information change), the operation log configuration table can be obtained and the operation log configuration information corresponding to the target function in the operation log configuration table can be directly modified. It should be noted that when it is necessary to modify the operation log configuration information, all the operation log configuration information to be modified can be unified, and then all the operation log configuration information to be modified can be uniformly modified in the operation log configuration table. Of course, for each operation log configuration information to be modified, the operation log configuration information to be modified can also be modified in the operation log configuration table.

[0049] Among them, the functions mentioned above can specifically be the login function, shutdown function, file writing function, file deletion function, user addition function, etc.

[0050] The configuration and modification of the operation log configuration information corresponding to functions can be achieved by creating an operation log configuration table in the database. That is, the configuration and modification of the operation log configuration information corresponding to functions can be completed in the created operation log configuration table, without implementing the configuration management of operation logs through methods such as code configuration, code modification, re - publishing, and maintenance. Therefore, the complexity and difficulty of the configuration management of operation logs can be reduced, and the simplicity and efficiency of the configuration management of operation logs can be improved.

[0051] S13: According to the operation log configuration information of each function configured in the operation log configuration table, record the operation logs for the operations of the corresponding functions.

[0052] Based on step S12, the operation logs for the operations of the corresponding functions can be recorded according to the operation log configuration information of each function configured in the operation log configuration table. Among them, when recording the operation logs for the corresponding functions, specifically, the operation logs corresponding to the operations of the corresponding functions can be recorded in the pre - created operation log table, so as to achieve the unified recording of the logs of all functions in one operation log table, which is convenient for subsequent viewing and acquisition, etc. In addition, the operation log table can also be associated with the created operation log configuration table to enable the two to form complete operation log information.

[0053] Through this application, the function configuration can be handed over to the database for storage, instead of being hard - coded into the code. The hard - coding logic can be removed. The operation log configuration information of the function can be obtained by querying the operation log configuration table, and the operation log configuration information is readable. It can be flexibly replaced by modifying the operation log configuration information in the operation log configuration table, without modifying the code, documents, etc., and without synchronously modifying the Cli manual, etc. Moreover, during development, there is no need to modify the hard - coding in the code to add, delete, and modify the operation log configuration information and re - publish, etc. operations. Only the operation log configuration information in the operation log configuration table needs to be modified, reducing the code volume and development workload, and thus reducing the manpower requirements.

[0054] In the above technical solution disclosed in this application, an operation log configuration table is created in the database, and the operation log configuration information of each function is configured in the operation log configuration table. Subsequently, when performing operation log recording, the operation log recording of the corresponding function can be performed based on the operation log configuration information of each function configured in the created operation log configuration table, so as to improve the convenience and accuracy of operation log recording. Compared with the prior art of configuring and modifying operation log configuration information by modifying the hard-coded logic in the code, in this application, by creating an operation log configuration table in the database, it is only necessary to configure the operation log configuration information of each function in the operation log configuration table in the database, and when modification is required, only the corresponding operation log configuration information in the operation log configuration table needs to be modified, without the need to modify the code, re-release, synchronously modify the Cli manual, etc. Therefore, the complexity and workload of operation log configuration management can be reduced, and the operation log management difficulty can be reduced, thereby improving the convenience and efficiency of operation log management.

[0055] See Figure 2 , which shows a flowchart of another operation log management method provided by an embodiment of this application. An operation log management method provided by an embodiment of this application, configuring the operation log configuration information of each function in the operation log configuration table, may include:

[0056] Configuring the operation log record configuration item, operation description configuration item, failure details configuration item, and operation level configuration item corresponding to each function in the operation log configuration table;

[0057] Among them, the operation log record configuration item is used to indicate whether to enable the operation log recording of the function, the operation description configuration item is used to configure the operation description, the failure details configuration item is used to configure the failure details, and the operation level configuration item is used to indicate the operation level of the function.

[0058] In this application, when configuring the operation log configuration information of each function in the operation log configuration table, specifically, the operation log record configuration item, operation description configuration item, failure details configuration item, and operation level configuration item corresponding to each function can be configured in the created operation log configuration table. The operation log record configuration item is used to indicate whether to enable the operation log record of the function (equivalent to a switch indicating whether to enable the operation log record of the function), the operation description configuration item is used to configure the operation description, the failure details configuration item is used to configure the failure details, and the operation level configuration item is used to indicate the operation level of the function. Among them, the operation log record configuration item, operation description configuration item, failure details configuration item, and operation level configuration item correspond to the four aspects of operation log record configuration, operation description configuration item, failure details configuration, and operation level configuration, and these four aspects can constitute an operation log configuration module, which can solve hard coding and achieve configurable management, while reducing the workload of developers. Moreover, the configurable management can make a set of code have different performances in different sites, making it easier to meet customer needs.

[0059] Regarding the operation log record configuration item, for whether to record the operation log of the relevant function, currently, it is through hard coding the dictionary file in the code. The functions in the dictionary will record the operation log, and the functions not in the dictionary will not record. If you want to add or delete, you can only complete the requirements by modifying the code file and re-releasing. However, through the operation log management method provided by this application, an operation log configuration table is created, and the operation log record configuration item of each function is recorded in the operation log configuration table to use the operation log record configuration item to indicate whether to enable the operation log record of the function. For example, for user login, it will record which user logged in. For the login function, if it is indicated in the operation log record configuration item of the operation log configuration table that the operation log needs to be recorded each time of login (that is, the operation log needs to be recorded), then the operation log will be recorded each time of login. If it is indicated in the operation log record configuration item of the operation log configuration table that the operation log does not need to be recorded each time of login, then the operation log will not be recorded each time of login. By creating an operation log configuration table and configuring the operation record configuration item of the function in it to remove hard coding, the complexity and tediousness of this configuration and maintenance can be reduced, and it is of great significance for subsequent maintenance. When working, there is no need to modify the dictionary file every time, reducing the workload.

[0060] Regarding the operation description configuration item, the current management software operation description configuration is divided into two categories: 1. Cli parameter splicing; 2. Specify the description content for relevant functions, and each function corresponds to an operation code (the operation code is used to represent the function. For example, 01166 represents the login operation, which is convenient for the backend to judge and record). If you want to modify these two configuration methods after the release, you can only complete the requirements by modifying the code and releasing it again. Through this application, you only need to configure the operation description configuration item of the function in the created operation log configuration table, and directly modify the content of the corresponding operation description configuration item in the operation log configuration table when modification is required, without having to modify the code for hard coding implementation. Therefore, it is relatively simple, convenient, and efficient to implement.

[0061] Regarding the failure details configuration item, directly presenting the error message to the user is not readable. Therefore, for the failure details, different error messages can be configured in the failure details configuration item according to different errors, or it can be considered not to display the failure details for some errors to optimize readability. The configuration of the failure details is realized by configuring the failure details configuration item in the operation log configuration table, and operations such as code modification and re-release for failure details configuration are avoided, so as to reduce the complexity and cumbersome degree of failure details configuration.

[0062] Regarding the operation level configuration item, the operation level is distinguished for functions to distinguish the importance of operations and pay attention to important operations. Different markets may focus on different functions. Therefore, the configuration of the operation level provides great convenience. And this application reduces the complexity of operation level configuration by configuring the operation level configuration item corresponding to the function in the created operation log configuration table, and improves the simplicity and convenience of the operation level configuration corresponding to the function.

[0063] An operation log management method provided by an embodiment of this application, configuring the operation log record configuration item corresponding to each function in the operation log configuration table, may include:

[0064] Adding a status field corresponding to each function in the operation log configuration table, and setting specific values for the status field according to whether the operation log record of the function is enabled.

[0065] In this application, when configuring the operation log record configuration items corresponding to each function in the operation log configuration table, specifically, a status field (status) corresponding to each function can be added to the operation log configuration table, and specific values can be set for the status field according to whether the operation log record of the function is enabled. Among them, the correspondence between the specific values of the status field and whether the operation log record of the function is enabled can be set in advance. For example, it can be set that when the specific value of the status field is "1", it represents that the operation log record of the function is enabled, and when the specific value of the status field is "0", it represents that the operation log record of the function is not enabled. In this case, for example: when a user logs in, it will record which user has logged in. For the login function, if its corresponding status is configured as "1", it means that the operation log needs to be recorded each time a login occurs, and if the status is "0", it means that the operation log will no longer be recorded each time a login occurs.

[0066] By adding a status field to the operation log configuration table and setting the specific values of the status field, it is possible to simply and conveniently represent whether the operation log record of the function is enabled, and it has readability.

[0067] An operation log management method provided by an embodiment of this application, when configuring the operation description configuration items corresponding to each function in the operation log configuration table, may include:

[0068] Adding a description configuration type field and a description configuration content field corresponding to each function to the operation log configuration table;

[0069] Among them, the description configuration type field is used to store the description configuration type, the description configuration content field is used to store the description configuration content corresponding to the description configuration type, and the description configuration type is divided into custom, Cli parameter splicing, and Cli parameter item replacement.

[0070] In this application, when configuring the operation description configuration items corresponding to each function in the operation log configuration table, specifically, a description configuration type field (aType) and a description configuration content field (aContent) corresponding to each function can be added to the operation log configuration table. Among them, the description configuration type field is used to store the description configuration type, the description configuration content field is used to store the description configuration content corresponding to the description configuration type, and the description configuration type can specifically be divided into three description configuration types: custom, Cli parameter splicing, and Cli parameter item replacement. Moreover, in order to simplify the configuration of these three description configuration types, three different numbers can be used to represent these three description configuration types. Correspondingly, the description configuration content field is used to store the description configuration content corresponding to custom, Cli parameter splicing, and Cli parameter item replacement.

[0071] Specifically, if 0 corresponds to custom, 1 corresponds to Cli parameter concatenation, and 2 corresponds to Cli parameter item replacement, then aType is divided into 0: custom, 1: Cli parameter concatenation, and 2: Cli parameter item replacement. Among them, custom means using the description configuration content to fill the operation log description content; Cli parameter concatenation means using command parameters for concatenation. For example, the login will be recorded as UserLogin(client_ip = 127.0.0.1, user = admin, password = ******). For Cli parameter item replacement, in the test, the Cli parameter item is too simple, such as path being abbreviated to p, and then in the description it is p = / root / dir.txt, which is difficult to understand. Then, if you want to modify it in the existing system, you need to modify the Cli command, modify the code, and modify the manual, which involves a wide range of changes. Therefore, this application proposes this description configuration type of Cli parameter item replacement, and the Cli parameter item to be replaced can be configured and finally included in aContent.

[0072] An operation log management method provided by an embodiment of this application. When the description configuration type of the function is Cli parameter item replacement, the description configuration content may include the field to be modified in the Cli parameter, the field to be replaced with, and the content to be modified to.

[0073] In this application, when the description configuration type of the function is Cli parameter item replacement, the description configuration content may include the field to be modified in the Cli parameter, the field to be replaced with, and the content to be modified to. Among them, the field to be modified refers to the existing field in the Cli parameter that participates in concatenation but needs to be modified; the field to be replaced with refers to the field that the field to be modified is to be replaced with, that is, the field to be newly written into the Cli parameter to replace the field to be modified; the content to be modified to refers to using the content to be modified to if the content needs to be modified.

[0074] Taking the replacement of p in p = / root / dir.txt with path as an example, the description configuration content is specifically {"p": {"new_key": "path", "content": ""}}, where new_key refers to the field to be replaced with, and content refers to using the content of content if the content needs to be modified.

[0075] Through the above method, it is possible to simply and conveniently replace the Cli parameter item without the process of modifying the Cli command, modifying the code, modifying the manual, etc.

[0076] An operation log management method provided by an embodiment of this application. In the operation log configuration table, configure the failure details configuration items corresponding to each function, which may include:

[0077] Add error code fields corresponding to each function in the operation log configuration table, and configure the failure information corresponding to each error code under the error code fields.

[0078] In this application, when configuring the failure details configuration items corresponding to each function in the operation log configuration table, specifically, error code fields (error_info) corresponding to each function can be added to the operation log configuration table, and the failure information corresponding to each error code can be configured under the error code fields. For example, {"1001": "Parameter error", "1002": "Format verification failed", "1003": ""} can be configured under the error code fields. Among them, 1001, 1002, and 1003 are error codes, and the recording in the operation log table is an induction of the failure information. When querying, if the error code in the operation log table is 1001, the failure information "Parameter error" will be displayed on the interface; if it is 1002, the failure information "Format verification failed" will be displayed on the interface; if it is 1003, no failure information will be displayed (because the failure information configured for 1003 is empty).

[0079] Realize the configuration processing of failure details through the matching of error codes and error code fields.

[0080] In addition, in this application, when configuring the operation level configuration items corresponding to each function in the operation log configuration table, level fields (level) corresponding to each function can be added to the operation log configuration table, and specific level values can be set for the level fields. For example, 1, 2, 3, and 4 can be set, where 1: General, 2: Medium, 3: Important, 4: High risk, that is, specific level values can be recorded when recording operation logs. When querying operation logs, the operation level of the corresponding function can be obtained by combining the created operation log configuration table.

[0081] As can be seen from the above, this application realizes the configuration of operation log configuration information by configuring corresponding fields in the operation configuration table, without hard coding. When adding and deleting operation log configurations, there is no need to modify the code and release a new version.

[0082] An operation log management method provided by an embodiment of this application may further include:

[0083] When querying operation logs, query operation logs according to the operation log configuration table and the recorded operation logs, and display the queried operation logs.

[0084] In this application, on the basis described above, when performing operation log queries, operation log queries can be performed according to the operation log configuration table and the recorded operation logs. Among them, when the operation logs are recorded in the operation log table, the operation log configuration table and the operation log table can be associated to perform operation log queries, so as to obtain complete operation logs.

[0085] In addition, after the operation logs are queried, the queried operation logs can also be displayed on the interface to facilitate relevant personnel to intuitively obtain the queried operation logs. Among them, when displaying the queried operation logs, the display fields are specifically obtained, and the operation logs are displayed according to the display fields.

[0086] The embodiment of this application also provides an operation log management device. Refer to Figure 3 , which shows a schematic structural diagram of an operation log management device provided by the embodiment of this application, and may include:

[0087] A creation module 31 for creating an operation log configuration table in the database;

[0088] A configuration module 32 for configuring the operation log configuration information of each function in the operation log configuration table;

[0089] A recording module 33 for recording operation logs of corresponding functions according to the operation log configuration information of each function configured in the operation log configuration table.

[0090] In the above technical solution disclosed in this application, an operation log configuration table is created in the database, and the operation log configuration information of each function is configured in the operation log configuration table. Subsequently, when recording operation logs, the operation logs of corresponding functions can be recorded based on the operation log configuration information of each function configured in the created operation log configuration table, so as to improve the convenience and accuracy of operation log recording. Compared with the existing method of configuring and modifying operation log configuration information by modifying the hard-coded logic in the code, in this application, by creating an operation log configuration table in the database, it is only necessary to configure the operation log configuration information of each function in the operation log configuration table in the database, and when modification is required, only the corresponding operation log configuration information in the operation log configuration table needs to be modified, without the need to modify the code, re-release, synchronously modify the Cli manual, etc. Therefore, the complexity and workload of operation log configuration management can be reduced, and the difficulty of operation log management can be reduced, thereby improving the convenience and efficiency of operation log management.

[0091] For an operation log management device provided by an embodiment of this application, the configuration module 32 may include:

[0092] A configuration unit is used to configure, in an operation log configuration table, operation log record configuration items, operation description configuration items, failure details configuration items, and operation level configuration items corresponding to each function.

[0093] Among them, the operation log record configuration item is used to indicate whether to enable the operation log record of the function, the operation description configuration item is used to configure the operation description, the failure details configuration item is used to configure the failure details, and the operation level configuration item is used to indicate the operation level of the function.

[0094] For an operation log management device provided by an embodiment of the present application, the configuration unit may include:

[0095] A first adding subunit is used to add status fields corresponding to each function in the operation log configuration table and set specific values for the status fields according to whether to enable the operation log record of the function.

[0096] For an operation log management device provided by an embodiment of the present application, the configuration unit may include:

[0097] A second adding subunit is used to add a description configuration type field and a description configuration content field corresponding to each function in the operation log configuration table;

[0098] Among them, the description configuration type field is used to store the description configuration type, the description configuration content field is used to store the description configuration content corresponding to the description configuration type, and the description configuration type is divided into custom, Cli parameter splicing, and Cli parameter item replacement.

[0099] For an operation log management device provided by an embodiment of the present application, when the description configuration type of the function is Cli parameter item replacement, the description configuration content may include the field to be modified in the Cli parameter, the field to be replaced with, and the content to be modified into.

[0100] For an operation log management device provided by an embodiment of the present application, the configuration unit may include:

[0101] A third adding subunit is used to add an error code field corresponding to each function in the operation log configuration table and configure the failure information corresponding to each error code under the error code field.

[0102] An operation log management device provided by an embodiment of the present application may further include:

[0103] A query module is used to query the operation log according to the operation log configuration table and the recorded operation log when performing an operation log query, and display the queried operation log.

[0104] An embodiment of the present application further provides an operation log management device, see Figure 4, which shows a schematic structural diagram of an operation log management device provided by an embodiment of the present application, may include:

[0105] A memory 41 for storing a computer program;

[0106] A processor 42, when executing the computer program stored in the memory 41, can implement the following steps:

[0107] Create an operation log configuration table in the database; configure the operation log configuration information of each function in the operation log configuration table; perform operation log recording on the operations of the corresponding functions according to the operation log configuration information of each function configured in the operation log configuration table.

[0108] In the above technical solution disclosed in the present application, an operation log configuration table is created in the database, and the operation log configuration information of each function is configured in the operation log configuration table. Subsequently, when performing operation log recording, the operations of the corresponding functions can be recorded based on the operation log configuration information of each function configured in the created operation log configuration table, so as to improve the convenience and accuracy of operation log recording. Compared with the existing method of configuring and modifying operation log configuration information by modifying the hard-coded logic in the code, the present application only needs to configure the operation log configuration information of each function in the operation log configuration table in the database, and only needs to modify the corresponding operation log configuration information in the operation log configuration table when modification is required, without the need to modify the code, re-release, synchronously modify the Cli manual, etc. Therefore, the complexity and workload of operation log configuration management can be reduced, and the difficulty of operation log management can be reduced, thereby improving the convenience and efficiency of operation log management.

[0109] An embodiment of the present application further provides a readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the following steps can be implemented:

[0110] Create an operation log configuration table in the database; configure the operation log configuration information of each function in the operation log configuration table; perform operation log recording on the operations of the corresponding functions according to the operation log configuration information of each function configured in the operation log configuration table.

[0111] In the above technical solution disclosed in this application, an operation log configuration table is created in the database, and the operation log configuration information of each function is configured in the operation log configuration table. Subsequently, when performing operation log recording, the operation log recording of the corresponding function can be carried out based on the operation log configuration information of each function configured in the created operation log configuration table, so as to improve the convenience and accuracy of operation log recording. Compared with the existing method of configuring and modifying operation log configuration information by modifying the hard-coded logic in the code, this application realizes that only the operation log configuration information of each function in the operation log configuration table in the database needs to be configured, and when modification is required, only the corresponding operation log configuration information in the operation log configuration table needs to be modified, without the need to modify the code, release the version again, synchronously modify the Cli manual, etc. Therefore, the complexity and workload of operation log configuration management can be reduced, and the difficulty of operation log management can be reduced, thereby improving the convenience and efficiency of operation log management.

[0112] The readable storage medium may include: various media such as USB flash drives, external hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.

[0113] For the description of the relevant parts in an operation log management device, device, and readable storage medium provided in this application, reference can be made to the detailed description of the corresponding parts in an operation log management method provided in the embodiments of this application, which will not be elaborated here.

[0114] It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "including", "comprising", or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article, or device including a series of elements includes the inherent elements thereof. Without further limitation, the element defined by the statement "including an..." does not exclude the existence of additional identical elements in the process, method, article, or device including the said element. In addition, the parts of the above technical solution provided in the embodiments of this application that are consistent with the corresponding technical solutions in the prior art in terms of implementation principles are not described in detail to avoid excessive elaboration.

[0115] The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An operation log management method, characterized in that, Including: Create an operation log configuration table in the database; Configure the operation log configuration information of each function in the operation log configuration table; According to the operation log configuration information of each function configured in the operation log configuration table, perform operation log recording on the operations of the corresponding functions; Configuring the operation log configuration information of each function in the operation log configuration table includes: Configure the operation log record configuration item, operation description configuration item, failure details configuration item, and operation level configuration item corresponding to each function in the operation log configuration table; Among them, the operation log record configuration item is used to indicate whether to enable the operation log recording of the function, the operation description configuration item is used to configure the operation description, the failure details configuration item is used to configure the failure details, and the operation level configuration item is used to indicate the operation level of the function; Configuring the operation description configuration item corresponding to each function in the operation log configuration table includes: Add a description configuration type field and a description configuration content field corresponding to each function in the operation log configuration table; Among them, the description configuration type field is used to store the description configuration type, the description configuration content field is used to store the description configuration content corresponding to the description configuration type, and the description configuration type is divided into custom, Cli parameter splicing, and Cli parameter item replacement; custom means using the description configuration content to fill the operation log description content; Cli parameter splicing means using command parameters for splicing; Cli parameter item replacement means that the Cli parameter item to be replaced can be configured.

2. The operation log management method according to claim 1, wherein Configuring the operation log record configuration item corresponding to each function in the operation log configuration table includes: Add a status field corresponding to each function in the operation log configuration table, and set a specific value for the status field according to whether to enable the operation log recording of the function.

3. The operation log management method according to claim 1, wherein When the description configuration type of the function is Cli parameter item replacement, the description configuration content includes the field to be modified in the Cli parameter, the field to be replaced with, and the content to be modified to.

4. The operation log management method according to claim 1, wherein, Configuring the failure details configuration item corresponding to each function in the operation log configuration table includes: Add an error code field corresponding to each function in the operation log configuration table, and configure the failure information corresponding to each error code under the error code field.

5. The operation log management method according to claim 1, characterized in that Also including: When performing operation log query, perform operation log query according to the operation log configuration table and the recorded operation logs, and display the queried operation logs.

6. An operation log management device, characterized in that Including: A creation module for creating an operation log configuration table in the database; A configuration module for configuring the operation log configuration information of each function in the operation log configuration table; A recording module for performing operation log recording on the operations of the corresponding functions according to the operation log configuration information of each function configured in the operation log configuration table; The configuration module includes: A configuration unit for configuring the operation log record configuration item, operation description configuration item, failure details configuration item, and operation level configuration item corresponding to each function in the operation log configuration table; Among them, the operation log record configuration item is used to indicate whether to enable the operation log record of the function, the operation description configuration item is used to configure the operation description, the failure details configuration item is used to configure the failure details, and the operation level configuration item is used to indicate the operation level of the function; The configuration unit includes: A second addition subunit, which is used to add the description configuration type field and the description configuration content field corresponding to each function in the operation log configuration table; Among them, the description configuration type field is used to store the description configuration type, the description configuration content field is used to store the description configuration content corresponding to the description configuration type, and the description configuration type is divided into custom, Cli parameter splicing, and Cli parameter item replacement; custom means using the description configuration content to fill the operation log description content; Cli parameter splicing means using command parameters for splicing; Cli parameter item replacement means that the Cli parameter item to be replaced can be configured.

7. An operation log management device, characterized in that, It includes: A memory, which is used to store computer programs; A processor, which is used to implement the steps of the operation log management method according to any one of claims 1 to 5 when executing the computer program.

8. A readable storage medium, characterized in that, A computer program is stored in the readable storage medium, and when the computer program is executed by the processor, the steps of the operation log management method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Operation recording method and device, electronic equipment and storage medium

    CN113849473A