Integrated processing method for operation logs, electronic device and storage medium

By building an operation log template in a distributed system and saving it to the database, the problem of the inability to uniformly manage operation logs is solved, custom configuration and unified query are achieved, and the efficiency of system fault analysis is improved.

CN119473822BActive Publication Date: 2025-09-26ZHUHAI PILOT TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411632094.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-09-26
Estimated Expiration
2044-11-15

AI Technical Summary

Technical Problem

In a distributed system, the operation logs of each system cannot be uniformly managed and customized, resulting in a fixed operation log format that cannot be uniformly managed and customized.

Method used

By obtaining the operation interface parameter information of each system interface, constructing the operation log template information and saving it to the template database, generating the target log template according to the template request and saving it to the log record database, unified management and custom configuration of the operation log are achieved.

Benefits of technology

It realizes the unified storage and management of operation logs, supports custom configuration and unified query, and improves the efficiency of system fault analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119473822B_ABST
    Figure CN119473822B_ABST
Patent Text Reader

Abstract

The present application provides an integrated processing method, electronic device, and storage medium for operation logs, which are applied to the first system in a distributed system, wherein the distributed system includes the first system and at least one second system, and the method includes: obtaining operation interface parameter information of at least one operation action of each interface in the first system and each second system; constructing operation log template information corresponding to the first system and operation log template information corresponding to each second system according to each operation interface parameter information and each operation action, and saving each operation log template information into a template database; determining a target log template according to a template request and each operation log template information in the template database, and sending the target log template to the system where the log is to be generated; and saving the target operation log into a log record database. A unified configuration of customizable operation log content and unified storage and management of operation logs are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an integrated processing method for operation logs, an electronic device, and a storage medium. Background Art

[0002] In a distributed system, key user operations in each system need to be recorded in the operation log of each system so that developers can analyze system failures based on the recorded operation logs. Therefore, the generation of operation logs is crucial.

[0003] Currently, the operation logs of each system in a distributed system can only be configured and stored in its own system, and the operation log format of each system is generally fixed, making it impossible to achieve unified management and custom configuration. Summary of the Invention

[0004] The purpose of this application is to address the deficiencies in the above-mentioned prior art and provide an integrated processing method for operation logs, an electronic device and a storage medium to achieve integrated management of operation logs of various systems.

[0005] To achieve the above objectives, the technical solutions adopted in the embodiments of the present application are as follows:

[0006] In a first aspect, an embodiment of the present application provides an integrated processing method for operation logs, which is applied to a first system in a distributed system, wherein the distributed system includes the first system and at least one second system. The method includes:

[0007] Obtaining operation interface parameter information of at least one operation action on each interface of the first system and operation interface parameter information of at least one operation action on each interface of the second system, wherein the operation interface parameter information includes an operation interface address, an operation interface name, an operation parameter field name, and an operation parameter field description;

[0008] constructing operation log template information corresponding to the first system and operation log template information corresponding to each second system according to each operation interface parameter information and each operation action, and saving each operation log template information into a template database;

[0009] Obtaining a template request sent by a system for generating logs, where the system for generating logs includes the first system or the second system;

[0010] Determining a target log template according to the template request and each operation log template information in the template database, and sending the target log template to the system to generate the log;

[0011] The target operation log generated by the system to generate the log according to the target log template is obtained, and the target operation log is saved in a log record database.

[0012] Optionally, constructing the operation log template information corresponding to the first system and the operation log template information corresponding to each second system according to each operation interface parameter information and each operation action includes:

[0013] Constructing operation log template information corresponding to the first system according to each operation action in each interface of the first system and the operation interface parameters of each operation action;

[0014] According to each operation action in each interface of each second system and the operation interface parameters of each operation action, operation log template information corresponding to each second system is constructed.

[0015] Optionally, constructing operation log template information corresponding to the first system according to each operation action in each interface of the first system and an operation interface parameter of each operation action includes:

[0016] Based on the identification of each interface, each operation action in each interface, the operation interface address of each operation action, the operation interface name, the operation parameter field name, the operation parameter field description and the content information entered by the user, the operation log template information corresponding to the first system is constructed.

[0017] Optionally, constructing the operation log template information corresponding to the first system according to the identifier of each interface, each operation action in each interface, the operation interface address of each operation action, the operation interface name, the operation parameter field name, and the operation parameter field description includes:

[0018] Establishing a mapping connection relationship corresponding to each operation action according to the interface identifier, each operation action in the interface, each operation interface name, and the operation interface address of each operation action;

[0019] Constructing the operation log template content corresponding to each operation action according to the operation parameter field name, operation parameter field description and content information input by the user;

[0020] Combining the mapping connection relationship corresponding to each of the operation actions and the operation log template content corresponding to each of the operation actions into the operation log template information of each of the operation actions;

[0021] The operation log template information corresponding to the first system is obtained according to the log template information of each operation action.

[0022] Optionally, the first system and each of the second systems are provided with an interception component;

[0023] The step of obtaining a template request sent by a system for generating logs includes:

[0024] Get the template request sent by the interception component in the system where the log is to be generated.

[0025] Optionally, determining a target log template according to the template request and each operation log template information in the template database includes:

[0026] Parsing the template request to obtain the identifier of the system for which logs are to be generated, the identifier of the interface to be generated in the system for which logs are to be generated, and the operation interface address in the operation interface parameter information in the template request;

[0027] Determining a target mapping connection relationship according to the mapping connection relationship corresponding to the operation action in each operation log template information, the identifier of the system for which the log is to be generated, the identifier of the interface to be generated in the system for which the log is to be generated, and the operation interface address;

[0028] The operation log template content corresponding to the target mapping connection relationship is used as the target log template.

[0029] Optionally, the step of saving the target operation log to a log record database includes:

[0030] If the target operation log is generated by the first system, storing the target operation log in a log record database in the first system according to a first storage method;

[0031] If the target operation log is generated by the second system, the target operation log is stored in the log record database in the first system according to the second storage method.

[0032] Optionally, it also includes:

[0033] Obtaining a query request for a system to be queried, where the system to be queried includes the first system or the second system;

[0034] According to the query request, a target query operation log is searched from the log record database, and the target query operation log is sent to the system to be queried.

[0035] In a second aspect, an embodiment of the present application further provides an integrated processing device for operation logs, the device comprising:

[0036] an acquisition module, configured to acquire operation interface parameter information of at least one operation action of each interface in the first system and operation interface parameter information of at least one operation action of each interface in the second system, wherein the operation interface parameter information includes an operation interface address, an operation interface name, an operation parameter field name, and an operation parameter field description;

[0037] A construction module, configured to construct operation log template information corresponding to the first system and operation log template information corresponding to each second system according to each operation interface parameter information and each operation action, and save each operation log template information into a template database;

[0038] an acquisition module, configured to acquire a template request sent by a system to generate a log, wherein the system to generate a log includes the first system or the second system;

[0039] a determination module, configured to determine a target log template according to the template request and each operation log template information in the template database, and send the target log template to the system for generating logs;

[0040] The acquisition module is used to acquire the target operation log generated by the system to generate the log according to the target log template, and save the target operation log into a log record database.

[0041] Optionally, the building block is specifically used to:

[0042] Constructing operation log template information corresponding to the first system according to each operation action in each interface of the first system and the operation interface parameters of each operation action;

[0043] According to each operation action in each interface of each second system and the operation interface parameters of each operation action, operation log template information corresponding to each second system is constructed.

[0044] Optionally, the building block is specifically used to:

[0045] Based on the identification of each interface, each operation action in each interface, the operation interface address of each operation action, the operation interface name, the operation parameter field name, the operation parameter field description and the content information entered by the user, the operation log template information corresponding to the first system is constructed.

[0046] Optionally, the building block is specifically used to:

[0047] Establishing a mapping connection relationship corresponding to each operation action according to the interface identifier, each operation action in the interface, each operation interface name, and the operation interface address of each operation action;

[0048] Constructing the operation log template content corresponding to each operation action according to the operation parameter field name, operation parameter field description and content information input by the user;

[0049] Combining the mapping connection relationship corresponding to each of the operation actions and the operation log template content corresponding to each of the operation actions into the operation log template information of each of the operation actions;

[0050] The operation log template information corresponding to the first system is obtained according to the log template information of each operation action.

[0051] Optionally, the first system and each of the second systems are provided with an interception component;

[0052] The acquisition module is specifically used for:

[0053] Get the template request sent by the interception component in the system where the log is to be generated.

[0054] Optionally, the determining module is specifically configured to:

[0055] Parsing the template request to obtain the identifier of the system for which logs are to be generated, the identifier of the interface to be generated in the system for which logs are to be generated, and the operation interface address in the operation interface parameter information in the template request;

[0056] Determining a target mapping connection relationship according to the mapping connection relationship corresponding to the operation action in each operation log template information, the identifier of the system for which the log is to be generated, the identifier of the interface to be generated in the system for which the log is to be generated, and the operation interface address;

[0057] The operation log template content corresponding to the target mapping connection relationship is used as the target log template.

[0058] Optionally, the determining module is specifically configured to:

[0059] If the target operation log is generated by the first system, storing the target operation log in a log record database in the first system according to a first storage method;

[0060] If the target operation log is generated by the second system, the target operation log is stored in the log record database in the first system according to the second storage method.

[0061] Optionally, the acquisition module is specifically configured to:

[0062] Obtaining a query request for a system to be queried, where the system to be queried includes the first system or the second system;

[0063] According to the query request, a target query operation log is searched from the log record database, and the target query operation log is sent to the system to be queried.

[0064] In a third aspect, an embodiment of the present application further provides an electronic device comprising: a processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor, and when the application is running, the processor communicates with the storage medium through the bus, and the processor executes the program instructions to perform the steps of the integrated processing method of the operation log described in the first aspect above.

[0065] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and the computer program is read and executes the steps of the integrated processing method of operation logs described in the first aspect above.

[0066] The beneficial effects of this application are:

[0067] The present application provides an integrated processing method, electronic device and storage medium for operation logs. By first constructing operation log template information corresponding to the first system and operation log template information corresponding to each second system according to each operation interface parameter information and each operation action in the first system, an operation log template corresponding to the operation action can be constructed according to the operation action in the interface of each system, and a unified configuration of the operation log content can be customized in the first system. Each operation log template information is saved in a template database. After obtaining the template request sent by the system to generate the log, the target log template can be determined according to the template request and each operation log template information in the template database, and the target log template is sent to the system to generate the log, and the target operation log generated by the system to generate the log according to the target log template is saved in the log record database, so as to realize the unified preservation and management of the operation log. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.

[0069] Figure 1 A schematic diagram of an exemplary scenario provided in an embodiment of the present application;

[0070] Figure 2A flowchart of an integrated processing method for operation logs provided in an embodiment of the present application;

[0071] Figure 3 A flowchart of a second method for integrated processing of operation logs provided in an embodiment of the present application;

[0072] Figure 4 A flowchart of a third method for integrated processing of operation logs provided in an embodiment of the present application;

[0073] Figure 5 A flowchart of a fourth method for integrated processing of operation logs provided in an embodiment of the present application;

[0074] Figure 6 A schematic diagram of an apparatus for an integrated processing method of operation logs provided in an embodiment of the present application;

[0075] Figure 7 This is a structural block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0076] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of illustration and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowcharts can be implemented out of sequence, and steps without logical context can be reversed or implemented simultaneously. In addition, those skilled in the art, under the guidance of the contents of this application, can add one or more other operations to the flowchart, or remove one or more operations from the flowchart.

[0077] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application.

[0078] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.

[0079] Figure 1 This is a schematic diagram of an exemplary scenario provided by an embodiment of the present application. The integrated processing method of the operation log is applied to the first system in a distributed system, such as Figure 1 As shown, the distributed system may include a first system and at least one second system, wherein each second system can communicate with the first system. When each second system needs to generate an operation log, the first system can use the integrated operation log processing method provided in the embodiment of the present application to match each second system with a log template corresponding to each second system, and integrate the operation logs generated by each second system to achieve unified configuration, unified storage, and unified query of customizable operation log content in the first system.

[0080] The first system and each second system can be respectively set in each electronic device. For example, the first system can be the system in electronic device 1, the second system A can be the system in electronic device 2, the second system B can be the system in electronic device 3, the second system C can be the system in electronic device 4, and so on. The electronic device can be, for example, a mobile phone, a tablet computer, a laptop computer, a PDA, a desktop computer, or other terminal device with computing and display capabilities, or can also be a server. Specifically, it can be applied to applications in terminal devices, such as mobile phone apps (applications) and computer application systems.

[0081] The specific implementation process of the integrated processing of the operation log provided in the embodiment of the present application is explained in detail below.

[0082] Figure 2 This is a flow chart of an integrated processing method for operation logs provided in an embodiment of the present application, the execution subject of the method is the aforementioned first system. Figure 2 As shown, the method includes:

[0083] S101: Acquire operation interface parameter information of at least one operation action of each interface in the first system and operation interface parameter information of at least one operation action of each interface in the second system.

[0084] Among them, the operation interface parameter information may include the operation interface address, operation interface name, operation parameter field name and operation parameter field description. The following Table 1 is an exemplary operation interface parameter table provided in an embodiment of the present application.

[0085] Table 1

[0086] Operation interface address Operation interface name Operation parameter field name Operation Parameter Field Description / v1 / role / save Save Character param.rolePkId Character ID / v1 / role / save Save Character param.roleName Character Name / v1 / role / save Save Character param.systemPkId System ID ... ... ... ...

[0087] Optionally, the first system may correspond to at least one interface, and each second system may also correspond to at least one interface, and each interface may correspond to operation interface parameter information of at least one operation action. The first system may first obtain the operation interface parameters of all operation actions of each interface in the first system and the operation interface parameters of all operation actions of each interface in the second system, and may save the obtained operation interface parameters in a database in the first system. Specifically, the operation interface parameters of all operation actions of all interfaces of each system may be stored in a collection address. Then, each system corresponds to a collection address, and all operation interface parameters of each system can be obtained through the collection address of each system.

[0088] For example, the first system may include interface 1, interface 2, and interface 3. Interface 1 may correspond to operation interface parameter information of 10 operation actions, interface 2 may correspond to operation interface parameter information of 8 operation actions, and interface 3 may correspond to operation interface parameter information of 5 operation actions.

[0089] For example, the second system A may include an interface A1 and an interface A2. The interface A1 may correspond to operation interface parameter information of 9 operation actions, and the interface A2 may correspond to operation interface parameter information of 7 operation actions.

[0090] S102: construct operation log template information corresponding to the first system and operation log template information corresponding to each second system according to each operation interface parameter information and each operation action, and save each operation log template information into a template database.

[0091] Among them, the operation log template information refers to the operation log template information of each operation action, which may specifically include the mapping connection relationship corresponding to each operation action and the operation log template content. The operation log template content may include at least one template parameter, and each template parameter may be generated according to the operation interface parameter information.

[0092] Specifically, in the first system, operation log template information corresponding to each operation action can be constructed using a preset method based on each operation interface parameter information and each operation action. The constructed operation log template information corresponding to the first system can be one or more, and the constructed operation log template information corresponding to each second system can also be one or more. After the operation log template information corresponding to the first system and the operation log template information corresponding to each second system are constructed in the first system, each operation log template information can also be saved in a template database in the first system using a preset method.

[0093] S103: Obtain a template request sent by the system for generating the log.

[0094] The system to generate logs may include the first system or each second system. The template request may include the identifier of the system to generate logs, the identifier of the interface to be generated in the system to generate logs, and the operation interface address in the operation interface parameter information.

[0095] For example, if a user performs operation a in interface 1 of a first system, and the first system needs to generate an operation log for operation a, the first system may send a template request that includes the identifier of the first system, the identifier of interface 1 in the first system, and the operation interface address of operation a in interface 1. Furthermore, the first system may obtain the operation interface parameter values ​​for operation a, such as the value of the operation parameter field name and the value of the operation parameter field description.

[0096] For example, if a user performs action b on interface A1 of second system A, and second system A needs to generate an operation log for action b, second system A can send a template request to the first system. This template request may include the identifier of second system A, the identifier of interface A1 in second system A, and the operation interface address of action b on interface A1. Furthermore, the second system can obtain the operation interface parameter values ​​for action b, such as the value of the operation parameter field name and the value of the operation parameter field description.

[0097] S104: Determine a target log template according to the template request and information about each operation log template in the template database, and send the target log template to a system for generating logs.

[0098] Optionally, a target log template can be determined using a preset method based on a template request sent by the system for which the log is to be generated and information about each operation log template in a template database stored in the first system, and the determined target log template can be sent to the system for which the log is to be generated. The target log template can include at least one template parameter. Since the template parameter is generated based on the operation parameter field name and operation parameter field description in the operation interface parameter information, each template parameter can correspond to the operation parameter field name and operation parameter field description in the operation interface parameter information.

[0099] For example, if template parameter 1 in the target template log is: role id: {param.rolePkId}, and the operation interface parameter includes the operation parameter field name "rolePkId", then template parameter 1 in the target log template corresponds to "rolePkId" in the operation interface parameter.

[0100] S105 , obtaining a target operation log generated by the system to generate a log according to a target log template, and saving the target operation log into a log record database.

[0101] Optionally, when the system to generate the log receives the target log template, the operation interface parameter values ​​​​of the operation action performed by the user in the interface of the system to generate the log can be filled in the received target log template. Specifically, the operation interface parameters of the operation action can be matched with the template parameters in the target log template using a regular expression, and the operation interface parameters that match the template parameters can be found. The values ​​of the matching operation interface parameters are used as the values ​​of the template parameters, and the target operation log is generated in the system to generate the log.

[0102] For example, if the template parameters in the target log template for operation action a in interface 1 of the first system include: role id: {param.rolePkId}, role name: {param.roleName}, system ID: {param.systemPkId}. When the user performs operation action a in interface 1 of the first system, the operation interface parameter values ​​are: "rolePkId": 1234, "roleName": "Administrator", "systemPkId": 1. Then, the generated target operation log is: role id: 1234, role name: Administrator, system ID: 1.

[0103] In this embodiment, by first constructing the operation log template information corresponding to the first system and the operation log template information corresponding to each second system based on the parameter information of each operation interface and each operation action in the first system, an operation log template corresponding to the operation action in the interface of each system can be constructed, and a unified configuration of the operation log content can be customized in the first system. Each operation log template information is saved in a template database. After obtaining the template request sent by the system to generate the log, the target log template can be determined based on the template request and the operation log template information in the template database, and the target log template is sent to the system to generate the log. The target operation log generated by the system to generate the log based on the target log template is saved in the log record database, thereby realizing the unified storage and management of the operation log.

[0104] Figure 3 A flow chart of the second method for integrated processing of operation logs provided in the embodiment of the present application is shown as follows: Figure 3 As shown, in the above S102, the operation log template information corresponding to the first system and the operation log template information corresponding to each second system are constructed according to the operation interface parameter information and each operation action, which may include:

[0105] S201: Construct operation log template information corresponding to the first system according to each operation action in each interface of the first system and the operation interface parameters of each operation action.

[0106] Optionally, for the first system, the constructed operation log template information includes log template information of all operation actions in all interfaces in the first system.

[0107] For example, a preset method can be used based on the 10 operating actions in interface 1 of the first system and the operating interface parameters of each operating action to construct operation log template information for each of the 10 operating actions in interface 1; a preset method can be used based on the 8 operating actions in interface 2 and the operating interface parameters of each operating action to construct operation log template information for each of the 8 operating actions in interface 2; and a preset method can be used based on the 5 operating actions in interface 3 and the operating interface parameter information of each operating action to construct operation log template information for each of the 5 operating actions in interface 3. Thus, for the first system, 23 operation log template information are constructed.

[0108] S202: Construct operation log template information corresponding to each second system according to each operation action in each interface of each second system and the operation interface parameters of each operation action.

[0109] Optionally, for each second system, the constructed operation log template information includes log template information of all operation actions in all interfaces in each second system.

[0110] For example, a preset method can be used according to the 9 operation actions in interface A1 of the second system A and the operation interface parameters of each operation action to construct the operation log template information of the 9 operation actions in interface A1 respectively; a preset method can be used according to the 7 operation actions in interface A2 and the operation interface parameters of each operation action to construct the operation log template information of the 7 operation actions in interface A2 respectively. Then, for the second system A, 16 operation log template information are constructed.

[0111] In this embodiment, by constructing the operation log template information of each operation action based on each operation action of each interface in each system and the operation interface parameters of each operation action, the operation log template information corresponding to each system is obtained, and the corresponding log template information can be constructed according to the operation actions on the interface.

[0112] Optionally, in S201 above, constructing the operation log template information corresponding to the first system according to each operation action in each interface of the first system and the operation interface parameters of each operation action may include:

[0113] Optionally, the operation log template information corresponding to the first system can be constructed based on the identification of each interface, each operation action in each interface, the operation interface address of each operation action, the operation interface name, the operation parameter field name, the operation parameter field description and the content information entered by the user.

[0114] Figure 4 A flow chart of the third method for integrated processing of operation logs provided in the embodiment of the present application is shown as follows: Figure 4 As shown, the operation log template information corresponding to the first system is constructed based on the identifier of each interface, each operation action in each interface, the operation interface address of each operation action, the operation interface name, the operation parameter field name, the operation parameter field description, and the content information entered by the user, which may include:

[0115] S301: Establish a mapping connection relationship corresponding to each operation action according to the interface identifier, each operation action in the interface, each operation interface name, and each operation interface address of each operation action.

[0116] Specifically, each operation action in the interface may be bound to an interface identifier, each operation interface name, and an operation interface address of each operation action to establish a mapping connection relationship corresponding to each operation action.

[0117] For example, if the operation action in interface 1 of the first system is "Save Role," as shown in Table 1 above, interface 1 is identified as "Role Management," the interface name of the operation action is "Save Action," and the operation interface address of the operation action is " / v1 / role / save," then a mapping relationship is established between the operation action "Save Role" and "Role Management," "Save Role," and " / v1 / role / save," resulting in a mapping connection relationship for the operation action "Save Role." From this mapping connection relationship, it can be determined that the operation action is in the "Role Management" interface of the first system and that the operation interface address of the operation action is " / v1 / role / save."

[0118] S302: Construct the operation log template content corresponding to each operation action according to the operation parameter field name, operation parameter field description and content information input by the user.

[0119] Optionally, the operation parameter field name and operation parameter field description of each operation action may include one or more. For each operation action, you can customize the required operation parameter field name and operation parameter field description to construct the operation log template content corresponding to the operation action.

[0120] For example, taking the operation parameter field names and descriptions for the "Save Role" operation in Table 1 as an example, the operation log template content constructed for this "Save Role" operation can be: role id: {param.rolePkId}, role name: {param.roleName}, system ID: {param.systemPkId}. Among them, role id: {param.rolePkId} is a template parameter in the operation log template content.

[0121] It is worth noting that, for the operation log template content, in addition to the operation parameter field name and operation parameter field description, users can also add user-defined template content according to actual needs.

[0122] S303: Combine the mapping connection relationship corresponding to each operation action and the operation log template content corresponding to each operation action into operation log template information of each operation action.

[0123] The following Table 2 is an exemplary operation log template information provided in an embodiment of the present application.

[0124] Table 2

[0125]

[0126] S304: Obtain operation log template information corresponding to the first system according to the log template information of each operation action.

[0127] Specifically, the log template information of all operation actions in all interfaces in the first system may be combined into the operation log template information corresponding to the first system.

[0128] It is worth noting that the process of constructing the operation log template information corresponding to each second system is similar to the process of constructing the operation log template information corresponding to the first system, and is not described in detail here.

[0129] Optionally, an interception component is provided in the first system and each second system.

[0130] Optionally, the step of obtaining the template request sent by the system for generating the log in S103 may include:

[0131] Specifically, a template request sent by an interception component in the system to generate logs can be obtained. A unified interception component can be respectively set in the first system and each second system, and the interception component can intercept the template request in the first system and the template request in each second system, and send them to the interception component in the first system, so that the interception component in the first system can receive the template request sent by the interception component of each system, and thus perform template matching.

[0132] Figure 5 A flow chart of the fourth method for integrated processing of operation logs provided in the embodiment of the present application is shown as follows: Figure 5 As shown, the above S104 determines the target log template according to the template request and the information of each operation log template in the template database, which may include:

[0133] S401: Parse the template request to obtain the identifier of the system for which logs are to be generated, the identifier of the interface to be generated in the system for which logs are to be generated, and the operation interface address in the operation interface parameter information.

[0134] S402: Determine a target mapping connection relationship according to the mapping connection relationship corresponding to the operation action in each operation log template information, the identifier of the system to generate the log, the identifier of the interface to be generated in the system to generate the log, and the operation interface address.

[0135] Specifically, the operation log template information corresponding to the system to be generated can be found from the template database according to the identification of the system to be generated log, and then the mapping connection relationship including the interface identification to be generated and the operation interface address in the system to be generated log can be found from the operation log template information corresponding to the system to be generated log as the target mapping connection relationship.

[0136] S403: Use the operation log template content corresponding to the target mapping connection relationship as the target log template.

[0137] For example, the operation log template contents corresponding to "role management", "save role" and " / v1 / role / save" in the aforementioned Table 2 are used as the target log template.

[0138] Optionally, the step of saving the target operation log to the log record database in S105 may include:

[0139] If the target operation log is generated by the first system, the target operation log is stored in the log record database in the first system according to the first storage method, where the first storage method can be, for example, big data storage (Datebase, DB), specifically, it can be stored in batches in the MySQL database using JdbcTemplate.

[0140] If the target operation log is generated by the second system, the target operation log is stored in the log record database of the first system according to the second storage method. The second storage method may be, for example, message queue (MQ) storage. Specifically, the target operation log received from the second system may be stored in the MySQL database according to the message queue storage method.

[0141] Optionally, when saving the target operation log, information such as the operation time of the operation action in the target operation log may also be stored at the same time.

[0142] In this embodiment, by storing the target operation logs of the first system and the second system in different ways, distributed reception of the target operation logs can be supported, which can facilitate subsequent viewing of the operation logs.

[0143] Optionally, after the operation logs are stored in a unified manner, a unified query can be performed. The specific query method is as follows:

[0144] Optionally, a unified query function may be provided in the first system, and each system may query the operation log through the unified query function.

[0145] Optionally, a query request for the system to be queried may be obtained, where the query system may include the first system or each of the second systems. After obtaining the query request, a target query operation log is searched from a log record database based on the query request, and the target query operation log is sent to the system to be queried. Specifically, the query request may include one or more of the following: an identifier of the system to be queried, an identifier of the interface to be queried, a name of the operation to be queried, and an operation time of the operation to be queried.

[0146] In this embodiment, by setting a unified query function, unified query of operation logs by various systems can be realized, thereby achieving integrated management of operation logs.

[0147] Figure 6 A schematic diagram of an integrated processing method for operation logs provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the device includes:

[0148] An acquisition module 501 is configured to acquire operation interface parameter information of at least one operation action of each interface in the first system and operation interface parameter information of at least one operation action of each interface in the second system, wherein the operation interface parameter information includes an operation interface address, an operation interface name, an operation parameter field name, and an operation parameter field description;

[0149] A construction module 502 is configured to construct operation log template information corresponding to the first system and operation log template information corresponding to each second system according to each operation interface parameter information and each operation action, and save each operation log template information into a template database;

[0150] An acquisition module 501 is configured to acquire a template request sent by a system to generate a log, where the system to generate a log includes the first system or the second system.

[0151] A determination module 503 is configured to determine a target log template according to the template request and the information of each operation log template in the template database, and send the target log template to the system for generating logs;

[0152] The acquisition module 501 is configured to acquire a target operation log generated by the system to generate the log according to the target log template, and save the target operation log into a log record database.

[0153] Optionally, the building module 502 is specifically configured to:

[0154] Constructing operation log template information corresponding to the first system according to each operation action in each interface of the first system and the operation interface parameters of each operation action;

[0155] According to each operation action in each interface of each second system and the operation interface parameters of each operation action, operation log template information corresponding to each second system is constructed.

[0156] Optionally, the building module 502 is specifically configured to:

[0157] According to the identifier of each interface, each operation action in each interface, the operation interface address of each operation action, the operation interface name, the operation parameter field name and the operation parameter field description, the operation log template information corresponding to the first system is constructed.

[0158] Optionally, the building module 502 is specifically configured to:

[0159] Establishing a mapping connection relationship corresponding to each operation action according to the interface identifier, each operation action in the interface, each operation interface name, and the operation interface address of each operation action;

[0160] Constructing the operation log template content corresponding to each operation action according to the operation parameter field name and operation parameter field description of each operation action;

[0161] Combining the mapping connection relationship corresponding to each of the operation actions and the operation log template content corresponding to each of the operation actions into the operation log template information of each of the operation actions;

[0162] The operation log template information corresponding to the first system is obtained according to the log template information of each operation action.

[0163] Optionally, the first system and each of the second systems are provided with an interception component;

[0164] The acquisition module 501 is specifically used for:

[0165] Get the template request sent by the interception component in the system where the log is to be generated.

[0166] Optionally, the determining module 503 is specifically configured to:

[0167] Parsing the template request to obtain the identifier of the system for which logs are to be generated, the identifier of the interface to be generated in the system for which logs are to be generated, and the operation interface address in the operation interface parameter information in the template request;

[0168] Determining a target mapping connection relationship according to the mapping connection relationship corresponding to the operation action in each operation log template information, the identifier of the system for which the log is to be generated, the identifier of the interface to be generated in the system for which the log is to be generated, and the operation interface address;

[0169] The operation log template content corresponding to the target mapping connection relationship is used as the target log template.

[0170] Optionally, the determining module 503 is specifically configured to:

[0171] If the target operation log is generated by the first system, storing the target operation log in a log record database in the first system according to a first storage method;

[0172] If the target operation log is generated by the second system, the target operation log is stored in the log record database in the first system according to the second storage method.

[0173] Optionally, the acquisition module 501 is specifically configured to:

[0174] Obtaining a query request for a system to be queried, where the system to be queried includes the first system or the second system;

[0175] According to the query request, a target query operation log is searched from the log record database, and the target query operation log is sent to the system to be queried.

[0176] Figure 7 This is a structural block diagram of an electronic device 600 provided in an embodiment of the present application. The electronic device may be, for example, an integrated processing device for operation logs as described in the aforementioned embodiment. Figure 7 As shown, the electronic device may include: a processor 601 and a memory 602.

[0177] Optionally, a bus 603 may also be included, wherein the memory 602 is used to store machine-readable instructions executable by the processor 601. When the electronic device 600 is running, the processor 601 communicates with the memory 602 through the bus 603. When the machine-readable instructions are executed by the processor 601, the method steps in the above method embodiment are performed.

[0178] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method steps of the embodiment of the method for integrated processing of operation logs are executed.

[0179] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application. In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0180] In addition, the functional units in the various embodiments of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially 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, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0181] The above is only a specific implementation method of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed in this application, which should be covered by the protection scope of the present application.

Claims

1. A method for integrated processing of operation logs, characterized in that: The method is applied to a first system in a distributed system, wherein the distributed system includes the first system and at least one second system, and includes: Obtaining operation interface parameter information of at least one operation action on each interface of the first system and operation interface parameter information of at least one operation action on each interface of the second system, wherein the operation interface parameter information includes an operation interface address, an operation interface name, an operation parameter field name, and an operation parameter field description; constructing operation log template information corresponding to the first system and operation log template information corresponding to each second system according to each operation interface parameter information and each operation action, and saving each operation log template information into a template database; Obtaining a template request sent by a system for generating logs, where the system for generating logs includes the first system or the second system; Determining a target log template according to the template request and each operation log template information in the template database, and sending the target log template to the system to generate the log; The target operation log generated by the system to generate the log according to the target log template is obtained, and the target operation log is saved in a log record database.

2. The integrated processing method for operation logs according to claim 1, characterized in that: The constructing, according to each of the operation interface parameter information and each of the operation actions, the operation log template information corresponding to the first system and the operation log template information corresponding to each of the second systems, includes: Constructing operation log template information corresponding to the first system according to each operation action in each interface of the first system and the operation interface parameters of each operation action; According to each operation action in each interface of each second system and the operation interface parameters of each operation action, operation log template information corresponding to each second system is constructed.

3. The integrated processing method for operation logs according to claim 2, characterized in that: The constructing operation log template information corresponding to the first system according to each operation action in each interface of the first system and the operation interface parameter of each operation action includes: Based on the identification of each interface, each operation action in each interface, the operation interface address of each operation action, the operation interface name, the operation parameter field name, the operation parameter field description and the content information entered by the user, the operation log template information corresponding to the first system is constructed.

4. The integrated processing method for operation logs according to claim 3, characterized in that: The operation log template information corresponding to the first system is constructed according to the identifier of each interface, each operation action in each interface, the operation interface address of each operation action, the operation interface name, the operation parameter field name, the operation parameter field description, and the content information input by the user, including: Establishing a mapping connection relationship corresponding to each operation action according to the identifier of the interface, each operation action in the interface, each operation interface name, and the operation interface address of each operation action; Constructing the operation log template content corresponding to each operation action according to the operation parameter field name, operation parameter field description and content information input by the user; Combining the mapping connection relationship corresponding to each of the operation actions and the operation log template content corresponding to each of the operation actions into the operation log template information of each of the operation actions; The operation log template information corresponding to the first system is obtained according to the log template information of each operation action.

5. The integrated processing method for operation logs according to claim 1, characterized in that: The first system and each of the second systems are provided with an interception component; The step of obtaining a template request sent by a system for generating logs includes: Get the template request sent by the interception component in the system where the log is to be generated.

6. The integrated processing method for operation logs according to claim 1, characterized in that: The determining a target log template according to the template request and each operation log template information in the template database includes: Parsing the template request to obtain the identifier of the system for which logs are to be generated, the identifier of the interface to be generated in the system for which logs are to be generated, and the operation interface address in the operation interface parameter information in the template request; Determining a target mapping connection relationship according to the mapping connection relationship corresponding to the operation action in each operation log template information, the identifier of the system for which the log is to be generated, the identifier of the interface to be generated in the system for which the log is to be generated, and the operation interface address; The operation log template content corresponding to the target mapping connection relationship is used as the target log template.

7. The integrated processing method for operation logs according to claim 1, characterized in that: The step of saving the target operation log to a log record database includes: If the target operation log is generated by the first system, storing the target operation log in a log record database in the first system according to a first storage method; If the target operation log is generated by the second system, the target operation log is stored in the log record database in the first system according to the second storage method.

8. The integrated processing method for operation logs according to claim 1, characterized in that: Also includes: Obtaining a query request for a system to be queried, where the system to be queried includes the first system or the second system; According to the query request, a target query operation log is searched from the log record database, and the target query operation log is sent to the system to be queried.

9. An electronic device, characterized in that: The system comprises a memory and a processor, wherein the memory stores a computer program executable by the processor, and when the processor executes the computer program, the steps of the method for integrated processing of operation logs according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, executes the steps of the method for integrated processing of operation logs according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and system for returning customer service log feedback to database

    CA3146125A1

  • Log processing method and device, electronic equipment and storage medium

    CN114490005A