Integrated processing method of operation logs, electronic equipment and storage medium
Patent Information
- Application Number
- CN202411632094.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-11-15
AI Technical Summary
In distributed systems, the operation logs of each system can only be configured and stored in its own system, and cannot achieve unified management and custom configuration.
By obtaining the operation interface parameter information of each system, an operation log template is built and saved to the template database. Based on the template request and operation log template information in the template database, determine the target log template and send it to the system where the log is to be generated, and generate and save the target operation log.
It realizes integrated management of operation logs of each system, and supports unified configuration and unified storage of custom operation log content.
Smart Images

Figure CN119473822A_ABST
Abstract
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 operations performed by users 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 of each system. Therefore, the generation of operation logs is crucial.
[0003] At present, 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 a fixed format, which cannot achieve unified management and custom configuration. Summary of the invention
[0004] The purpose of the present application is to provide an integrated processing method for operation logs, an electronic device and a storage medium to address the deficiencies in the above-mentioned prior art, so as to realize the integrated management of operation logs of various systems.
[0005] To achieve the above purpose, the technical solution adopted in the embodiment of the present application is 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, and the method includes:
[0007] 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;
[0008] According to each of the operation interface parameter information and each of the operation actions, construct operation log template information corresponding to the first system and operation log template information corresponding to each of the second systems, and save each of the operation log template information into a template database;
[0009] Obtaining a template request sent by a system to generate logs, where the system to generate logs includes the first system or the second system;
[0010] 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 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 of the second systems according to each of the operation interface parameter information and each of the operation actions 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 parameter 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 each operation interface address of the 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 of each operation action;
[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 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 in the operation interface parameter information in the template request;
[0027] Determine a target mapping connection relationship according to the mapping connection relationship corresponding to the operation action in each of the 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, the 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, used 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, used to construct operation log template information corresponding to the first system and operation log template information corresponding to each of the second systems according to each of the operation interface parameter information and each of the operation actions, and save each of the operation log template information into a template database;
[0038] An acquisition module, used for acquiring a template request sent by a system to generate logs, wherein the system to generate logs includes the first system or the second system;
[0039] A determination module, used 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 for:
[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 parameter of each operation action, operation log template information corresponding to each second system is constructed.
[0044] Optionally, the building block is specifically used for:
[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 for:
[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 each operation interface address of the 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 of each operation action;
[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 used to:
[0055] Parsing the template request to obtain 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 in the operation interface parameter information in the template request;
[0056] Determine a target mapping connection relationship according to the mapping connection relationship corresponding to the operation action in each of the 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 used 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 used for:
[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, the 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 an application is running, the processor communicates with the storage medium via 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. And each operation log template information is saved in a template database, and then after obtaining a 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 drawings required for use in the embodiments will be briefly introduced below. 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 related drawings can be obtained based on these drawings without paying creative work.
[0069] Figure 1 A schematic diagram of an exemplary scenario provided for 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 schematic diagram 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 a device for an integrated processing method of an operation log provided in an embodiment of the present application;
[0075] Figure 7 A structural block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0076] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme 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 explanation 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 in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, 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 the embodiments. The components of the embodiments of the present application 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 application claimed for protection, but merely represents the 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 belong to 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 A schematic diagram of an exemplary scenario provided in an embodiment of the present application, wherein 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 may communicate with the first system. When each second system needs to generate an operation log, the first system may use the integrated processing method of the operation log 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 the 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 a system in electronic device 1, the second system A can be a system in electronic device 2, the second system B can be a system in electronic device 3, the second system C can be a 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: APP (application) of a mobile phone, an application system on a computer, etc.
[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 The flowchart of an integrated processing method of operation logs provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the method includes:
[0083] S101, obtaining 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 Parameters Field Description / v1 / role / save Save Character param.rolePkId Role ID / v1 / role / save Save Character param.roleName Role 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 correspond to at least one interface respectively, and each interface may correspond to at least one operation interface parameter information of an 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 the database of 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 respectively, then each system corresponds to a collection address, and all operation interface parameters of the system may be obtained through the collection address of each system.
[0088] Exemplarily, 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] Exemplarily, the second system A may include an interface A1 and an interface A2, wherein 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, the operation log template information corresponding to each operation action can be constructed using a preset method according to each operation interface parameter information and each operation action, and the operation log template information corresponding to the first system constructed can be one or more, and the operation log template information corresponding to each second system constructed 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 the template database in the first system using a preset method.
[0093] S103: Obtain a template request sent by the system for generating logs.
[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 the user performs operation a in interface 1 of the first system, and the first system needs to generate an operation log of the operation a, the first system may send a template request, which may include the identifier of the first system, the identifier of interface 1 in the first system, and the operation interface address of the operation a in interface 1. In addition, the first system may obtain the operation interface parameter value of the 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 the user performs operation b in interface A1 of second system A, and second system A needs to generate an operation log of operation b, second system A may send a template request to the first system, and the template request may include the identifier of second system A1, the identifier of interface A1 in second system A, and the operation interface address of operation b in interface A1. In addition, the second system may obtain the operation interface parameter value of operation 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 the information of each operation log template in the template database, and send the target log template to the system for generating logs.
[0098] Optionally, a target log template can be determined using a preset method according to the template request sent by the system to generate the log and each operation log template information in the template database stored in the first system, and the determined target log template is sent to the system to generate the log. The target log template may include at least one template parameter, and since the template parameter is generated according to the operation parameter field name and operation parameter field description in the operation interface parameter, each template parameter may correspond to the operation parameter field name and operation parameter field description in the operation interface parameter information.
[0099] For example, 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: Obtain a target operation log generated by the system to generate a log according to a target log template, and save the target operation log into a log record database.
[0101] Optionally, when the system to generate logs receives the target log template, the received target log template can be filled in with the operation interface parameter values of the operation actions performed by the user in the interface of the system to generate logs. Specifically, a regular expression can be used to match the operation interface parameters of the operation actions with the template parameters in the target log template, find the operation interface parameters that match the template parameters, and use the values of the matching operation interface parameters as the values of the template parameters, so as to generate the target operation log in the system to generate logs.
[0102] For example, if the template parameters in the target log template of 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 according to the parameter information of each operation interface and each operation action in the first system, the operation log template corresponding to the operation action can be constructed according to the operation action in the interface of each system, and the unified configuration of the operation log content can be customized in the first system. And each operation log template information is saved in the template database, and then 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 that the unified storage and management of the operation log can be realized.
[0104] Figure 3 A flow chart of a second method for integrated processing of operation logs provided in an embodiment of the present application is shown in FIG. 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 each 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, according to the 10 operation actions in interface 1 of the first system and the operation interface parameters of each operation action, the operation log template information of the 10 operation actions in interface 1 can be constructed respectively by using a preset method; according to the 8 operation actions in interface 2 and the operation interface parameters of each operation action, the operation log template information of the 8 operation actions in interface 2 can be constructed respectively by using a preset method; according to the 5 operation actions in interface 3 and the operation interface parameter information of each operation action, the operation log template information of the 5 operation actions in interface 3 can be constructed by using a preset method. Then 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 in 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] Exemplarily, 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 operation log template information for each operation action according to 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 the above S201, 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 parameter of each operation action may include:
[0113] Optionally, 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 a third method for integrated processing of operation logs provided in an 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 input 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, the operation action in interface 1 in the first system is "save role". As shown in Table 1 above, the identifier of interface 1 is: "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 between the operation action "save role" and "role management", "save role" and " / v1 / role / save" is established to obtain a mapping connection relationship of the operation action "save role". From the mapping connection relationship, it can be determined that the operation action is in the "role management" interface in the first system and 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 of each operation action, the operation parameter field description and the 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, the required operation parameter field name and operation parameter field description may be customized to construct the operation log template content corresponding to the operation action.
[0120] For example, taking the operation parameter field name and operation parameter field description of the operation action "save role" in Table 1 as an example, the operation log template content constructed for the operation action "save role" may 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 the operation parameter field description, the user 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 will not be 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 a system to generate logs may be obtained. A unified interception component may be provided in the first system and each second system, respectively, and the interception component may 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 may receive the template request sent by the interception component of each system, thereby performing template matching.
[0132] Figure 5 A flowchart of a fourth method for integrated processing of operation logs provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, in the above S104, determining the target log template according to the template request and each operation log template information in the template database may include:
[0133] S401 , 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.
[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 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.
[0135] Specifically, the operation log template information corresponding to the system to be generated can be found from the template database according to the identifier of the system to be generated. Then, from the operation log template information corresponding to the system to be generated, the mapping connection relationship including the interface identifier to be generated and the operation interface address in the system to be generated can be found 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 content corresponding to "role management", "save role" and " / v1 / role / save" in the aforementioned Table 2 is used as the target log template.
[0138] Optionally, the step of saving the target operation log to a 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, wherein 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 in the first system according to the second storage method. The second storage method may be, for example, message queue storage (MQ), specifically, the received target operation log of the second system may be stored in the mysql database according to the storage method of the message queue.
[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 simultaneously.
[0142] In this embodiment, by storing the target operation logs of the first system and the second system in different ways, distributed reception of target operation logs can be supported, which can facilitate subsequent viewing of the operation logs.
[0143] Optionally, after the operation logs are uniformly stored, they can also be queried uniformly. The specific query method is as follows:
[0144] Optionally, a unified query function may be set in the first system, and each system may query the operation log through the unified query function.
[0145] Optionally, a query request of the system to be queried may be obtained, wherein the query system may include the first system or each second system. After the query request is obtained, the target query operation log is searched from the log record database according to 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 action to be queried, an operation time of the operation action to be queried, etc.
[0146] In this embodiment, by setting a unified query function, each system can perform a unified query on the operation log, thereby realizing integrated management of the operation log.
[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 comprises:
[0148] An acquisition module 501 is used 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 used to construct operation log template information corresponding to the first system and operation log template information corresponding to each of the second systems according to each of the operation interface parameter information and each of the operation actions, and save each of the operation log template information into a template database;
[0150] An acquisition module 501 is used to acquire a template request sent by a system to generate logs, where the system to generate logs includes the first system or the second system;
[0151] A determination module 503 is used 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;
[0152] The acquisition module 501 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.
[0153] Optionally, the construction module 502 is specifically used for:
[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 parameter of each operation action, operation log template information corresponding to each second system is constructed.
[0156] Optionally, the construction module 502 is specifically used for:
[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 construction module 502 is specifically used for:
[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 each operation interface address of the operation action;
[0160] Constructing the operation log template content corresponding to each operation action according to the operation parameter field name and the 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 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 in the operation interface parameter information in the template request;
[0168] Determine a target mapping connection relationship according to the mapping connection relationship corresponding to the operation action in each of the 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 used for:
[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, the 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 6 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 above embodiments. 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] The embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method steps in the embodiment of the integrated processing method of the above operation logs are executed.
[0179] Those skilled in the art can clearly understand that, for the convenience and simplicity 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, each functional unit in each embodiment 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, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), disk or optical disk and other media that can store program code.
[0181] The above are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be covered by the protection scope of the present application.
Claims
1. An integrated processing method for operation logs, characterized in that: A first system applied to a distributed system, wherein the distributed system includes the first system and at least one second system, and the method includes: 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; According to each of the operation interface parameter information and each of the operation actions, construct operation log template information corresponding to the first system and operation log template information corresponding to each of the second systems, and save each of the operation log template information into a template database; Obtaining a template request sent by a system to generate logs, where the system to generate logs includes the first system or the second system; 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 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 of operation logs according to claim 1, characterized in that: The constructing the operation log template information corresponding to the first system and the operation log template information corresponding to each of the second systems according to each of the operation interface parameter information and each of the operation actions 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 parameter of each operation action, operation log template information corresponding to each second system is constructed.
3. The integrated processing method of 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 of 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 of each operation action; 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 of 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 of operation logs according to claim 1, characterized in that: The step of 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 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 in the operation interface parameter information in the template request; Determine a target mapping connection relationship according to the mapping connection relationship corresponding to the operation action in each of the 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 of 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 of 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, the 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: It 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 integrated processing method of the operation log described in 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, and when the computer program is executed by a processor, the steps of the integrated processing method of the operation log as described in any one of claims 1 to 7 are executed.
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
Log recording method and system, computer equipment and medium
CN115757054A
Block anchors for online log parsing
US12093162B1