A log creation method, device, and storage medium
By adding target annotation information in the business system and the creation logic of the creation of the use of the log in the use of the log, the problem of the universal nature of the logging method in the existing technology in the existing technology has been solved, and the efficient and flexible log creation and query are achieved.
Patent Information
- Application Number
- CN202010855614.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-24
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2040-08-24
AI Technical Summary
The log creation method under the prior art is not very versatile, wastes manpower and material resources, and cannot realize effective user or operation query.
Provide a log creation method. By adding the target annotation information by adding the target function of the business system, obtain the preset log creation operating tree, and use the logic of creating branches in the operation tree to create a log logic of calling target functions.
It improves the generality and flexibility created by logs, adapts more application scenarios, saves manpower and material resources, and realizes effective query on user operations.
Smart Images

Figure CN114090506B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a log creation method, device, and storage medium. Background Art
[0002] With the popularization of information systems and the increase in system complexity, the probability of problems occurring due to user misoperation during the use of software systems continues to increase, and the log information generated by the system is an important means to better understand the system operation status and error details and troubleshoot system failures. The current Spring technology stack lacks a general logging function to record background behaviors in the database.
[0003] At the same time, the log generation method under the existing technology requires different information processing logic to be customized for different usage scenarios, which is not very versatile and wastes manpower and material resources. In addition, it is impossible to achieve effective query for different users or operations. Summary of the invention
[0004] The embodiments of the present application provide a log creation method, device, server and storage medium to solve the problem that the log creation method in the prior art is not universal and wastes manpower and material resources.
[0005] In a first aspect, the present application provides a log creation method, the method comprising:
[0006] When the business system calls the target function, target annotation information is added to the target function to obtain the annotated function;
[0007] Obtain a preset log creation operation tree, wherein the log creation operation tree includes a plurality of creation nodes at different levels, each creation node includes at least one creation branch logic for creating a log, and each creation branch logic can be used to obtain information of one dimension of the annotation function;
[0008] In the log creation operation tree, determining a plurality of target creation nodes of different levels associated with the annotation function;
[0009] The log of calling the target function is created by utilizing the creation branch logic in the plurality of target creation nodes.
[0010] Further, the obtaining of a preset log creation operation tree includes:
[0011] Acquire an initial log creation operation tree, wherein the initial log creation operation tree includes a plurality of enumeration objects, the plurality of enumeration objects correspond one-to-one to the plurality of creation nodes, the initial log creation operation tree is a multi-level structure, and the plurality of creation nodes are located at different levels in the initial log creation operation tree;
[0012] Obtain a set of functions that will be called by the business system;
[0013] Generate a plurality of annotation information corresponding to each function in the function set;
[0014] Using the multiple annotation information, all the functions are respectively bound to the bottom-level enumeration objects in the initial log creation operation tree to obtain multiple first enumeration objects;
[0015] The log creation operation tree is generated according to the multiple first enumeration objects, and the multiple first enumeration objects are located at the bottom layer of the log creation operation tree.
[0016] Further, generating the log creation operation tree according to the multiple first enumeration objects includes:
[0017] Respectively obtain a creation branch logic set corresponding to each function, wherein the creation branch logic set includes at least one creation branch logic for obtaining function call information of different dimensions of the function;
[0018] Binding at least one first creation branch logic corresponding to each of the functions to the first enumeration object;
[0019] Extract the same branch creation logic in the first enumeration object;
[0020] Binding the same creation branch logic upward to a creation node, and binding the creation node to an enumeration object other than the first enumeration object;
[0021] The at least one creation branch logic corresponding to each function is traversed to generate the log creation operation tree.
[0022] Furthermore, in the log creation operation tree, determining multiple target creation nodes of different levels associated with the annotation function includes:
[0023] Parsing the target annotation information to obtain the creation branch logic information corresponding to the target function;
[0024] According to the creation branch logic call information, a plurality of target creation nodes of different levels associated with the annotation function are determined from the log creation operation tree.
[0025] Further, determining a plurality of target creation nodes of different levels associated with the annotation function in the log creation operation tree includes:
[0026] Determine the position of the annotation function in the log creation operation tree according to the target annotation information;
[0027] The log creation operation tree is traversed from bottom to top to obtain multiple target creation nodes of different levels associated with the annotation function.
[0028] Further, the creating a log of calling the target function by using the creation branch logic in the multiple target creation nodes includes:
[0029] According to the multiple target creation nodes, obtaining the target creation branch logic in each target creation node;
[0030] According to the target creation branch logic, first log information for calling the target function is created, wherein the first log information includes multiple function call information of different dimensions, and the first log information is multiple.
[0031] Further, the method further includes: parsing the target annotation information to obtain an information processing logic set of the target function, wherein the information processing logic set includes a plurality of information processing logics for obtaining log information of different dimensions of the annotation function, and the information processing logic includes at least one information processing sub-logic for obtaining log information of the same dimension of the annotation function;
[0032] Processing the annotation function by using the at least one information processing sub-logic to obtain a plurality of second log information of the same dimension of the annotation function;
[0033] Merging the multiple second log information of the same dimension to obtain unique third log information of the same dimension, where the third log information is multiple;
[0034] The plurality of third log information in different dimensions are merged to obtain the fourth log information.
[0035] Furthermore, the method further comprises:
[0036] The plurality of first log information and the plurality of fourth log information are combined to generate a log of calling the target function.
[0037] In a second aspect, the present application further provides a log creation device, the device comprising: a function calling module, the function calling module being used to add target annotation information to the target function when the business system calls the target function, so as to obtain the annotated function;
[0038] A log creation operation tree acquisition module, the log creation operation tree acquisition module is used to acquire a preset log creation operation tree, the log creation operation tree includes a plurality of creation nodes at different levels, each creation node includes at least one creation branch logic for creating a log, and each creation branch logic can be used to acquire information of one dimension of the annotation function;
[0039] A node determination module, the node determination module is used to determine a plurality of target creation nodes of different levels associated with the annotation function in the log creation operation tree;
[0040] A log creation module, wherein the log creation module is used to create a log of calling the target function by using the creation branch logic in the multiple target creation nodes.
[0041] In a third aspect, the present application further provides a server, the server comprising:
[0042] one or more processors;
[0043] Memory; and
[0044] One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the log creation method as described in any one of the above items.
[0045] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is loaded by a processor to execute the steps in the log creation method as described in any one of the above items.
[0046] In the embodiment of the present application, a log creation method, device, server and storage medium are provided. The method provides a log creation operation tree, and the bottom node in the log creation operation tree is bound to the target function that the user will call; and the nodes in the log creation operation tree include creation branch logic for obtaining information of different dimensions of the target function, and the function called by the user can be processed by the creation branch logic to generate an operation log. The log creation operation tree can arbitrarily add and delete new creation branch logic, so that for different application scenarios, only the nodes in the log creation operation tree and the creation branch logic corresponding to the nodes need to be added and deleted, and there is no need to write a new log creation program, which increases the flexibility of log generation, thereby adapting to more application scenarios and saving manpower and material resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0048] Figure 1 A schematic diagram of a scenario of a log creation system provided in an embodiment of the present application;
[0049] Figure 2A schematic diagram of a log creation process according to an embodiment of the present application;
[0050] Figure 3 A schematic diagram of a log creation operation tree embodiment provided in an embodiment of the present application;
[0051] Figure 4 A schematic diagram of a flow chart of an embodiment of obtaining a preset log creation operation tree provided in an embodiment of the present application;
[0052] Figure 5 A schematic diagram of a flow chart of an embodiment of a log creation operation tree provided in an embodiment of the present application;
[0053] Figure 6 A flowchart of another embodiment of the log creation method provided in the embodiment of the present application;
[0054] Figure 7 A schematic diagram of an embodiment of a log creation device provided in an embodiment of the present application;
[0055] Figure 8 This is a schematic diagram of the structure of the server involved in the embodiment of the present application. Specific embodiments
[0056] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0057] In the description of the present application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, which are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application. In addition, the terms "first" and "second" are used only for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more features. In the description of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0058] In this application, the word "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described in this application as "exemplary" is not necessarily to be construed as being preferred or advantageous over other embodiments. The following description is given to enable any technician in the field to implement and use the present application. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present application can be implemented without using these specific details. In other instances, well-known structures and processes will not be elaborated in detail to avoid obscuring the description of the present application with unnecessary details. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in the present application.
[0059] The embodiments of the present application provide a log creation method, device, server, and storage medium, which are described below respectively.
[0060] like Figure 1 As shown, it is a scene diagram of the log creation system provided by the embodiment of the present application. The log creation system may include multiple hosts 100 and servers 200. The hosts 100 and the servers 20 are connected to a network. The server 200 is integrated with a log creation device, such as Figure 1 In the server, host 100 can access server 200.
[0061] In the embodiment of the present invention, the server 200 is mainly used to add target annotation information to the target function to obtain the annotated function when the business system calls the target function; obtain a preset log creation operation tree, the log creation operation tree includes multiple creation nodes at different levels, each creation node includes at least one creation branch logic for creating a log, and each creation branch logic can be used to obtain information of one dimension of the annotated function, that is, one creation branch logic can obtain information of one dimension in the annotated function, and multiple creation branch logics can obtain information of multiple dimensions in the annotated function; in the log creation operation tree, determine multiple target creation nodes of different levels associated with the annotated function; use the creation branch logic in the multiple target creation nodes to create a log of calling the target function.
[0062] In the embodiment of the present invention, the server 200 can be an independent server, or a server network or server cluster composed of servers. For example, the server 200 described in the embodiment of the present invention includes but is not limited to a computer, a network host, a single network server, a plurality of network server sets or a cloud server composed of a plurality of servers. Among them, the cloud server is composed of a large number of computers or network servers based on cloud computing. In the embodiment of the present invention, communication between the server and the host can be achieved through any communication method, including but not limited to mobile communications based on the 3rd Generation Partnership Project (3GPP), Long Term Evolution (LTE), Worldwide Interoperability for Microwave Access (WiMAX), or computer network communications based on TCP / IP Protocol Suite (TCP / IP), User Datagram Protocol (UDP) and the like.
[0063] It is understandable that the host 100 used in the embodiment of the present invention may be a device including both receiving and transmitting hardware, that is, a device having receiving and transmitting hardware capable of performing two-way communication on a two-way communication link. Such a host may include: a cellular or other communication device having a single-line display or a multi-line display or a cellular or other communication device without a multi-line display. The specific host 100 may be a desktop terminal or a mobile terminal, and the host 100 may also be a mobile phone, a tablet computer, a laptop computer, etc.
[0064] Those skilled in the art will understand that Figure 1 The application environment shown in the figure is only one application scenario of the present application solution and does not constitute a limitation on the application scenario of the present application solution. Other application environments may also include Figure 1 More or fewer servers, or server network connections, as shown in Figure 1 Only one server and two hosts are shown. It can be understood that the log creation system can also include one or more other servers, and / or one or more hosts connected to the server network, which is not specifically limited here.
[0065] In addition, if Figure 1 As shown, the log creation system may further include a memory 300 for storing data, such as storing host data, such as host status data when the host is running.
[0066] It should be noted that Figure 1 The scenario diagram of the log creation system shown is only an example. The log creation system and scenario described in the embodiment of the present invention are intended to more clearly illustrate the technical solution of the embodiment of the present invention, and do not constitute a limitation on the technical solution provided by the embodiment of the present invention. Ordinary technicians in this field can know that with the evolution of the log creation system and the emergence of new business scenarios, the technical solution provided by the embodiment of the present invention is also applicable to similar technical problems.
[0067] An embodiment of the present application provides a log creation method, the method comprising: when a business system calls a target function, adding target annotation information to the target function to obtain an annotated function; obtaining a preset log creation operation tree, the log creation operation tree comprising a plurality of creation nodes at different levels, each creation node comprising at least one creation branch logic for creating a log, each creation branch logic can be used to obtain information of one dimension of the annotated function; in the log creation operation tree, determining a plurality of target creation nodes at different levels associated with the annotated function; and utilizing the creation branch logic in the plurality of target creation nodes to create a log for calling the target function. Each is described in detail below. Figure 2 As shown, Figure 2 A schematic diagram of a flow chart of an embodiment of log creation provided in an embodiment of the present application, the method includes:
[0068] 21. When the business system calls the target function, add the target annotation information to the target function to obtain the annotated function.
[0069] The business system will call functions to implement various functions during use, and the process of calling functions requires the creation of logs to save the usage of functions during the function calling process. In some embodiments of the present application, when the business system calls a specific function, namely the target function, target annotation information is added to the target function to obtain an annotated function.
[0070] Specifically, in the embodiment of the present application, the annotation information is added to the target function in order to obtain the process of processing the target function by parsing the annotation information; that is, by using the annotation information, it is possible to determine the process of information extraction and the like required for the target function. Specifically, adding the annotation information to the target function may include: obtaining the target annotation information corresponding to the target function; adding the target annotation information before and after the target function, that is, inserting the target function into the target annotation information to obtain the annotation function including the target annotation information. In the embodiment of the present application, the target function corresponds to the target annotation information one by one, and the annotation function includes the target annotation information.
[0071] 22. Obtain a preset log creation operation tree, where the log creation operation tree includes multiple creation nodes at different levels, each creation node includes at least one creation branch logic, and each creation branch logic can be used to obtain information of one dimension of the annotation function.
[0072] In some embodiments of the present application, the creation branch logic is used to obtain the call information of the annotated function, and the creation branch logic may include multiple ones, which are respectively used to obtain the call information of different dimensions of the annotated function. In a specific embodiment of the present application, the creation branch logic may include: user information processing logic, which is used to obtain some information of the user who calls the target function, so as to determine the information of the user who is currently calling the function, that is, the information of the user who is performing various operations. Operation parameter processing logic, which is used to obtain some important operation parameters of the user when calling the target function and save them; because the information of some operations is too complex and redundant, it is possible to filter and remove redundant information, and format the remaining information for easy storage. Among them, the information obtained after removing the redundant information is formatted and saved in the form of a json string.
[0073] The creation branch logic can also include: retrieval attribute processing logic, which is used to extract some attribute information when the user calls the target function, so as to facilitate the subsequent retrieval of the log; different operations of calling functions and key attributes that need to be recorded, as well as the methods of extracting these key attributes are different. Return result processing logic, which is used to determine whether the call of the target function and the acquisition of the aforementioned various parameters are successful. These creation branch logics can be used to obtain information on multiple dimensions of the annotation function.
[0074] 23. In the log creation operation tree, determine multiple target creation nodes at different levels associated with the annotation function.
[0075] 24. Use the creation branch logic in multiple target creation nodes to create a log of calling the target function.
[0076] The log creation method provided by the embodiment of the present application provides a log creation operation tree, and the bottom node in the log creation operation tree is bound to the annotation function that the user will call; in this way, the target function can traverse the entire log creation operation tree from top to bottom to confirm all the target layer creation nodes corresponding to the annotation function. The creation node in the log creation operation tree includes the creation branch logic for obtaining the different dimensional information of the annotation function, and the function called by the user can be processed by the creation branch logic to generate the operation log in the process of calling the function. At the same time, the log creation operation tree can arbitrarily add and delete new creation branch logic, for example, by adding or deleting the creation node, to bind or delete the creation branch logic, to achieve the addition or deletion of the creation branch logic in the log creation operation tree, so that for different application scenarios, only the creation node in the log creation operation tree and the creation branch logic corresponding to the creation node need to be added and deleted, and there is no need to write a new log creation program, which increases the flexibility of log generation, thereby adapting to more application scenarios and saving manpower and material resources.
[0077] In some embodiments of the present application, the creation branch logic of the log creation provided by the present application can be encapsulated in aspect-oriented programming (Aspect Oriented Programming, AOP). Specifically, AOP is a technology that realizes the unified maintenance of program functions through pre-compilation mode and dynamic proxy during operation. Using AOP, the various parts of the business logic can be isolated, so that the coupling degree between the various parts of the business logic is reduced, the repeatability of the program is improved, and the development efficiency is improved. In an embodiment of the present application, the creation branch logic of the log creation is encapsulated in AOP, that is, some general methods or steps of log creation in the prior art can be extracted, and the function code is written separately, and the log creation method provided in the present application is encapsulated separately. When it is necessary to create an operation log in different application scenarios, not only a general log creation method can be used, but also a log creation method provided by the present application can be used. The general log creation method and the log creation method provided by the present application are independent, and the general log creation method and the log creation method provided by the present application are encapsulated separately in the business system, so that the applicable scenario of the log creation method provided by the present application can be improved, and the flexibility of the log creation method provided by the present application can be improved.
[0078] In an embodiment of the present application, a log creation operation tree is provided, which can be used to create a log of a calling function. Figure 3As shown, it is a schematic diagram of a log creation operation tree embodiment provided in an embodiment of the present application. The log creation operation tree provided in the present application is a multi-layer structure. The log creation operation tree includes multiple creation nodes at different levels, and each creation node encapsulates at least one creation branch logic for creating a log, wherein the creation branch logic can be used to obtain the calling information of the annotated function.
[0079] In an embodiment of the present application, a creation node in the log creation operation tree may include a creation branch logic for creating a log, or may include multiple creation branch logics for creating a log. If a creation node includes multiple creation branch logics for creating a log, then the creation node can be used to simultaneously obtain information of multiple dimensions of the annotated function; that is, the creation node can be used to simultaneously obtain information of multiple dimensions of the target function called by the business system.
[0080] In some embodiments of the present application, before using the log creation operation tree to create a log of calling the target function, it is necessary to obtain a preset log creation operation tree, such as Figure 4 As shown, it is a schematic diagram of a flow chart of an embodiment of obtaining a preset log creation operation tree provided in an embodiment of the present application. Obtaining a preset log creation operation tree may include:
[0081] 41. Obtain an initial log creation operation tree, where the initial log creation operation tree includes multiple enumeration objects.
[0082] Among them, multiple enumeration objects correspond to multiple creation nodes one by one, the initial log creation operation tree is a multi-level structure, multiple creation nodes are located at different levels of the initial log creation operation tree, that is, multiple enumeration objects are also located at different levels of the initial log creation operation tree. The enumeration object is actually encapsulated in the creation node.
[0083] 42. Get the set of functions that the business system will call.
[0084] 43. Generate annotation information corresponding to each function in the function set.
[0085] 44. Utilize multiple annotation information to bind all functions and the bottom-level enumeration object in the initial log creation operation tree respectively to obtain multiple first enumeration objects.
[0086] 45. Generate a log creation operation tree according to the multiple first enumeration objects.
[0087] Among them, the multiple first enumeration objects are located at the bottom layer of the log creation operation tree.
[0088] Specifically, in some embodiments of the present application, an initial log creation operation tree can be obtained first, and the initial log creation operation tree includes multiple creation nodes, each creation node corresponds to an enumeration object, that is, the creation node and the enumeration object correspond one to one. However, the initial log creation operation tree does not include the creation branch logic of the creation operation log. In an embodiment of the present application, it is necessary to bind the function set that the business system will call to the initial log creation operation tree, and it is also necessary to bind the creation branch logic corresponding to each function in the function set to the initial creation operation tree.
[0089] In an embodiment of the present application, it is necessary to bind the target function that the business system will call to the creation node. Specifically, you can first obtain a function set of all functions that the business system will call, and the function set includes multiple different functions. Among them, the business system will call different functions to achieve different functions during the actual operation process. The function that a business system will call is determined and pre-set. In different scenarios, the functions called by the business system can be increased or decreased according to the actual situation to achieve different functions.
[0090] Generate multiple annotation information corresponding to the function set including all functions, one annotation information corresponds to one function; bind multiple annotation information to multiple functions one by one. At the same time, bind the functions to the bottom enumeration objects in the initial log creation operation tree one by one; thereby bind the functions to the creation nodes in the initial log creation operation tree.
[0091] In the embodiment of the present application, some description information of the target function and the specific processing logic in the target function can also be encapsulated in the enumeration object. At the same time, the name of the enumeration object can be saved as the unique identifier of the target function. In this way, the enumeration object and multiple functions in the function set are bound one by one through multiple annotation information; one target function corresponds to one annotation information and also corresponds to one enumeration object.
[0092] Among them, what is actually encapsulated in the creation node is the enumeration object. Therefore, the enumeration object is bound to all functions that the business system will call, that is, the function is further encapsulated in the enumeration object, so as to realize the binding of the function and the enumeration object, that is, the binding of the function and the creation node.
[0093] It should be noted that the bottom-level enumeration object is bound to the target function, and the first enumeration object is obtained. There are multiple target functions, and the corresponding first enumeration objects are also multiple; and the first enumeration object is part of the enumeration object in the initial log creation operation tree. The enumeration object can contain quantities such as color, mode, category, state, etc., which are limited in number, discrete in form, and extremely clearly expressed. In this application, the function and the creation branch logic can be bound to the enumeration object. That is, in the initial log creation operation tree, in addition to a part of the enumeration objects bound to the target function, there are also some enumeration objects that are not bound to the target function. And in the initial log creation operation tree, the multiple creation nodes corresponding to the first enumeration object are located at the bottom of the initial log creation operation tree, that is, the target function is located at the bottom of the initial log creation operation tree.
[0094] In the initial log creation operation tree, other enumeration objects except the first enumeration object can be second enumeration objects. The first enumeration object is set at the bottom layer of the initial log creation operation tree, and other second enumeration objects are divided into different levels except the bottom layer, so as to obtain the log creation operation tree.
[0095] like Figure 5 As shown, a flow chart of an embodiment of generating a log creation operation tree provided in an embodiment of the present application may include:
[0096] 51. Obtain a creation branch logic set corresponding to each function respectively, where the creation branch logic set includes at least one creation branch logic for obtaining multiple function call information of different dimensions of the function.
[0097] 52. Bind at least the first creation branch logic and the first enumeration object corresponding to each function.
[0098] 53. Extract the same creation branch logic in the first enumeration object.
[0099] 54. Bind the same creation branch logic upward to a creation node, and bind the creation node to an enumeration object other than the first enumeration object.
[0100] 55. Traverse at least one creation branch logic corresponding to each function to generate a log creation operation tree.
[0101] Specifically, in an embodiment of the present application, the business system will call multiple target functions, and adding annotation information to the target function will obtain an annotation function. An annotation function will correspond to a creation branch logic set, which may include multiple creation branch logics. Different creation branch logics are used to obtain function call information of different dimensions of the annotation function. Therefore, an annotation function will correspond to multiple creation branch logics, and then the multiple creation branch logics are bound to the first enumeration object at the bottom of the initial log creation operation tree, so that the multiple creation branch logics corresponding to the function can be bound to the log creation operation tree through the first enumeration object. It should be noted that for a specific annotation function, the creation branch logic corresponding to the annotation function can be multiple, and these multiple creation branch logics are all bound to the first enumeration object bound to the annotation function; instead of binding these multiple creation branch logics to multiple first enumeration objects respectively.
[0102] After obtaining the multiple creation branch logic sets corresponding to each annotation function, it is also necessary to extract the same creation branch logic bound to the multiple first enumeration objects.
[0103] Specifically, since different sets of creation branch logics obtain information of different dimensions of the annotation function, the creation branch logic may include multiple creation branch logics. Therefore, although one annotation function can correspond to multiple creation branch logics, for different annotation functions, if the same information is obtained, it is possible that the same creation branch logic corresponds to the same creation branch logic. Therefore, the same creation branch logic in different annotation functions can be extracted, and the same creation branch logic can be bound to a creation node one level up in the log creation operation tree, that is, the same creation branch logic in different functions can be bound to a parent node upward.
[0104] In this way, when the business system calls the annotation function and needs to use the creation branch logic bound in the creation node to obtain information on multiple dimensions of the annotation function, it can first obtain the creation branch logic bound in the first creation node bound to the target function, and then search the log creation operation tree upward to obtain other creation branch logic bound in all other creation nodes associated with the annotation function.
[0105] And because multiple annotation functions correspond one-to-one to the bottom-level creation node in the log creation operation tree, and the same creation node can be bound upward in the log creation operation tree, that is, bound to the same parent node, after each target function obtains the creation branch logic bound in its corresponding bottom-level creation node, it can search upward in the log creation operation tree to obtain other creation nodes bound to it, and obtain the creation branch logic in other creation nodes.
[0106] For the objective function, different objective functions may need to obtain different dimensional information, and the specific methods for obtaining the information of the same dimension may also be different. Therefore, in the log creation operation tree, for other creation nodes that are bound to multiple objective functions, if the dimensional information that these objective functions need to obtain is the same for different objective functions, and the methods for obtaining the dimensional information are the same, the same creation branch logic can be extracted and bound, for example, the creation branch logic can be encapsulated in AOP and then implemented through AOP. Since the creation branch logics encapsulated in AOP are all independent, different creation branch logics are bound to AOP; different creation branch logics can be selected for different scenarios, that is, different AOPs can be selected, which can effectively improve the flexibility of the log creation method provided in this application to adapt to more scenarios.
[0107] Please refer to Figure 3 ,exist Figure 3 The log creation operation tree includes multiple creation nodes, wherein the root node is located at the top layer of the log creation operation tree, and the target function may include a first target function, a second target function, and a third target function; the first target function, the second target function, and the third target function are respectively bound to a bottom-level creation node, and the bottom-level creation node is located at the bottom layer of the log creation operation tree. Multiple creation branch logics of the target function are also bound to the first creation node, wherein, for the bottom-level first target creation node bound to the first target function, the bottom-level first target creation node is bound with multiple creation branch logics for obtaining different dimensional information of the first target function, which can be respectively for obtaining the first target function user information, operation parameter information, and retrieval attribute information; and the specific methods corresponding to obtaining the first target function user information, operation parameter information, and retrieval attribute information can be m1n1q1.
[0108] Similarly, for the second lowest level target creation node bound to the second objective function, the second lowest level target creation node may be bound with multiple creation branch logics for obtaining different dimensional information of the second objective function, respectively obtaining the second objective function user information and operation parameter information; and the specific methods corresponding to obtaining the second objective function user information and operation parameter information may be m1n1. For the third lowest level target creation node bound to the third objective function, the third lowest level target creation node may be bound with multiple creation branch logics for obtaining dimensional information of the third objective function, respectively obtaining the third objective function user information, operation parameter information, and retrieval attribute information; and the specific methods corresponding to obtaining the third objective function user information, operation parameter information, and retrieval attribute information may be m1n1q2.
[0109] As can be seen from the above, for the first target function, the second target function and the third target function, it is necessary to obtain the user information and operation parameter information of these three functions; however, for the first target function and the third target function, the method for obtaining user information is the same as the method for obtaining operation parameters, and the method for obtaining retrieval attributes is different. Therefore, the method m1 for obtaining user information and the method n1 for obtaining operation parameters can be extracted, and the method m1n1 can be bound upward to a creation node. At this time, the creation branch logic bound in the bottom-level first target creation node is q1, while the creation branch logic bound in the bottom-level second target creation node and the creation branch logic bound in the bottom-level third target creation node are q2.
[0110] It should be noted that, in the embodiments of the present application, although some creation nodes are not bound with creation branch logic, since the creation nodes have the property inheritance feature, the creation nodes that are not bound with creation branch logic are actually bound with creation branch logic; that is, these creation nodes can inherit the creation branch logic in the creation node (i.e., the parent node) of the previous layer bound to them. If the parent node bound to the first creation node still does not have the creation branch logic bound to it, then the upward search can continue and the creation branch logic can be bound until the root node.
[0111] In a specific embodiment of the present application, although the creation branch logic is not bound in the bottom-level second target creation node, the attribute inheritance characteristics of the creation node make the creation branch logic in the bottom-level second target creation node actually m1n1; that is, the creation branch logic bound in the second target creation node is: the creation branch logic in the creation node of the upper layer bound to the second target creation node.
[0112] Using the above method, all functions in the function set that the business system will call are traversed, and then multiple creation branch logics corresponding to each function in the function set are traversed, and the same creation branch logic is bound upward to the creation node. If multiple creation nodes also include the same creation branch logic, then new creation nodes can be bound upward until there is no same creation branch logic to continue to bind new creation nodes upward, and then bind the root node as the end.
[0113] In this way, when the user calls the first target function, the bottom-level first target creation node corresponding to the first target function is first determined according to the log creation operation tree, and then the first target function is processed according to the creation branch logic q1 bound to the bottom-level first target creation node. Then search the upper layer to obtain the creation node in the upper layer bound to the first target creation node, and then process the first target function according to the creation branch logic m1n1 bound to the creation node. Similarly, the second and third target functions can be processed in the same way to obtain the log information corresponding to the second and third target functions respectively.
[0114] In the embodiment of the present application, in the process of processing the function using the log creation operation tree and obtaining the log, it is also necessary to determine multiple target creation nodes of different levels associated with the annotation function in the log creation operation tree. Among them, since the creation branch logic of the log creation corresponding to each function in the log creation operation tree is upwardly extracted and bound to the same log creation branch logic, multiple creation branch logics corresponding to a certain annotation function are located at different levels of the log creation operation tree.
[0115] Specifically, in some embodiments of the present application, in a log creation operation tree, determining multiple target creation nodes of different levels associated with an annotated function may include: parsing the target annotation information to obtain creation branch logic call information corresponding to the target function; and determining multiple target creation nodes of different levels associated with the annotated function from the log creation operation tree based on the creation branch logic call information.
[0116] Specifically, annotation information is added to the annotated function, and the content in the annotation information can determine what information of the annotated function needs to be obtained, that is, the function call information of the creation branch logic that needs to be called for the annotated function. The annotation information includes the creation branch logic for processing the annotated function, and the creation branch logic is bound to the log creation operation tree. According to the annotation information, the creation branch logic corresponding to the annotated function can be determined, and then searched in the log creation operation tree to obtain multiple target creation nodes of different levels associated with the annotated function.
[0117] In some embodiments of the present application, obtaining multiple target creation nodes of different levels associated with the annotation function from the log creation operation tree according to the annotation information may include:
[0118] According to the target annotation information, the position of the annotation function in the log creation operation tree is determined; the log creation operation tree is traversed from bottom to top to obtain multiple target creation nodes of different levels associated with the annotation function.
[0119] Specifically, since the annotation function is bound to the first creation node at the bottom of the log creation operation tree, and the annotation function corresponds to the first creation node at the bottom one by one, the position of the annotation function in the log creation operation tree can be determined. After determining the position of the annotation function in the log creation operation tree, the entire log creation operation tree can be traversed from bottom to top to obtain multiple target creation nodes of different levels associated with the annotation function.
[0120] After the position of the annotation function in the log creation operation tree is confirmed according to the target annotation information, the log creation operation tree can be traversed from bottom to top to obtain multiple target creation nodes of different levels associated with the annotation function.
[0121] Specifically, when the log creation operation tree is created, the first creation node at the bottom layer has been bound to the function one by one, and in the layers other than the bottom layer, the multiple creation branch logics corresponding to each function are also extracted and bound. Therefore, the log creation operation tree can be modified from top to bottom to determine multiple target creation nodes at different levels associated with the annotated function.
[0122] After determining multiple target creation nodes associated with the annotated function, since the creation branch logic is bound to the enumeration object bound to each creation node, the creation branch logic bound to each target creation node can be used to create the first log information of calling the target function. The first log information includes multiple function call information of different dimensions, and the first log information is obtained by using the creation branch logic in the creation node, and the first log information can be multiple.
[0123] Specifically, after determining multiple target creation nodes associated with the target function, the creation branch logic bound to each target creation node can be obtained, which is the target creation branch logic. The specific method for processing the target function in the target creation branch logic can be a processing method customized for the target function. Then, the target function is processed according to the target creation branch logic to obtain multiple first log information. Among them, there are multiple first log information, and different first log information corresponds to information of one dimension of the target function.
[0124] like Figure 6 As shown, it is a flow chart of another embodiment of the log creation method provided in the embodiment of the present application; in the embodiment of the present application, the log creation method provided in the embodiment of the present application may also include:
[0125] 61. Parse the target annotation information and obtain the information processing logic set of the target function.
[0126] Among them, the preset information processing logic set parsed from the target annotation information summary of the annotation function may include multiple information processing logics to respectively obtain information of different dimensions in the annotation function; and a preset information processing logic obtains information of one dimension of the annotation function, but a preset information processing logic may include at least one information processing sub-logic. If a preset information processing logic includes multiple information processing sub-logics, then these multiple information processing sub-logics obtain information of the same dimension of the annotation function, but the specific methods of obtaining the information are different. The preset information processing logic and the creation branch logic in the log creation operation tree both obtain information of different dimensions in the annotation function. The difference between the two is that the preset information processing logic can be a more general information processing logic in the prior art; while the creation branch logic in the log creation operation tree can be a unique creation branch logic customized for a certain annotation function.
[0127] 62. Use at least one information processing sub-logic to process the annotation function to obtain multiple second log information of the same dimension of the annotation function.
[0128] 63. Merge multiple second log information of the same dimension to obtain unique third log information of the same dimension.
[0129] 64. Merge multiple third log information in different dimensions to obtain fourth log information.
[0130] In an embodiment of the present application, when the business system calls the target function, it is necessary to first add annotation information to the target function to obtain the annotated function; then parse the annotation information to obtain all target creation nodes corresponding to the annotated function in the preset information processing logic and log creation operation tree, and the target creation node is bound with the creation branch logic. The annotated function is first processed using the preset information processing logic to obtain the third log information of different dimensions of the annotated function, and the third log information is multiple.
[0131] And because a preset information processing logic can include multiple information processing sub-logics, and multiple information processing sub-logics in the same preset information processing logic obtain information of the same dimension of the annotation function, that is, the second log information. Therefore, the second log information is the information of the same dimension of the annotation function obtained using different information processing methods. Multiple second log information can be merged to obtain a unique third log information under a certain dimension; and then multiple third log information under different dimensions can be merged to obtain the final fourth log information.
[0132] The preset information processing logic and the creation branch logic in the log creation operation tree both obtain call information of different dimensions in the annotation function. The difference between the two is that the preset information processing logic can be a more common information processing logic in the prior art; while the creation branch logic in the log creation operation tree can be a unique creation branch logic customized for a certain annotation function.
[0133] In a specific embodiment of the present application, the preset information processing logic may include: processing logic for obtaining user information and information processing logic for obtaining operation parameters. The processing logic for obtaining user information may specifically include multiple methods, namely methods a, b and c; and the information processing logic for obtaining operation parameters may include multiple methods, namely methods d, e and f. For methods a, b and c, they process the annotation function and obtain user information, that is, the second log information; for methods d, e and f, they process the annotation function and obtain operation parameter information, which is also the second log information. However, methods a, b and c obtain information of the dimension of user information of the annotation function, while methods d, e and f obtain information of the dimension of operation parameter information of the annotation function.
[0134] Merge the information of the same dimension, that is, merge the user information obtained by methods a, b, and c respectively, to obtain the final user information, that is, the third log information under the user information dimension; merge the operation parameter information obtained by methods d, e, and f respectively, to obtain the final operation parameter information, that is, the third log information under the operation parameter dimension. Then merge multiple third log information under different dimensions such as user information and operation parameter information to obtain the final fourth log information, which includes log information of multiple dimensions of the annotation function. The fourth log information is obtained by processing the annotation function using the preset information processing logic, and the preset information processing logic may include some general information processing logic.
[0135] It should be noted that, in an embodiment of the present application, the information processing logic for creating the fourth log information is not bound to the log creation operation tree, and the information processing logic required to create the fourth log information is the existing more common information processing logic to create the operation log of the function. The creation branch logic for creating the first log information is bound to the log creation operation tree, and the creation branch logic is some information processing logic customized for different functions. Both the creation branch logic and the information processing logic obtain function call information of different dimensions of the function, but the creation branch logic and the information processing logic are separately bound in the AOP, which reduces the coupling between the information acquisition methods of each dimension, can improve the repeatability of the program, and improve development efficiency.
[0136] That is, the fourth log information is obtained by processing the target function using a general information processing method, and is information of multiple dimensions of the target function; the first log information is obtained by processing the target function using a customized information processing method, and is information of multiple dimensions of the target function. In some embodiments of the present application, if you want to obtain the function call log of the calling template target function, you also need to merge multiple first log information and multiple fourth log information to obtain the final log of calling the target function.
[0137] In an embodiment of the present application, for a log creation operation tree, the creation nodes at the bottom of the log creation operation tree can be continuously increased to bind more functions, so that the log creation operation tree is applicable to more log creation scenarios. At the same time, the creation branch logic bound to the log creation operation tree is a creation branch logic customized for a specific function. Only when it is necessary to call these customized creation branch logics to create logs, the log creation operation tree will be called using the annotation function to obtain these customized creation branch logics to process the function.
[0138] It should be noted that, in the embodiment of the present application, the log information is function call information, because the log information includes various information generated by various processing of the functions in the process of calling multiple functions.
[0139] The present application also provides a log creation device, such as Figure 7 As shown, it is a schematic diagram of an embodiment of a log creation device provided in an embodiment of the present application, and the log creation device may include:
[0140] Function calling module 701, the function calling module 701 is used to add target annotation information to the target function when the business system calls the target function to obtain the annotated function.
[0141] The log creation operation tree acquisition module 702 is used to obtain a preset log creation operation tree. The log creation operation tree includes multiple creation nodes at different levels. Each creation node includes at least one creation branch logic for creating a log. Each creation branch logic can be used to obtain information of one dimension of the annotation function.
[0142] The node determination module 703 is used to determine a plurality of target creation nodes of different levels associated with the annotation function in the log creation operation tree.
[0143] The log creation module 704 is used to create a log of calling the target function by using the creation branch logic in the multiple target creation nodes.
[0144] The log creation device provided by the present application provides a log creation operation tree, and the bottom-level node in the log creation operation tree is bound to the target function that the user will call; and the nodes in the log creation operation tree include creation branch logic for obtaining information of different dimensions of the target function, and the creation branch logic can be used to process the function called by the user to generate an operation log. The log creation operation tree can arbitrarily add and delete new creation branch logic, so that for different application scenarios, only the nodes in the log creation operation tree and the creation branch logic corresponding to the nodes need to be added and deleted, and there is no need to write a new log creation program, which increases the flexibility of log generation, thereby adapting to more application scenarios and saving manpower and material resources.
[0145] In some embodiments of the present application, the log creation operation tree acquisition module 702 can be specifically used to: obtain an initial log creation operation tree, which includes multiple enumeration objects; obtain a set of functions that will be called by the business system; generate multiple annotation information corresponding to each function in the function set; use the multiple annotation information to bind all functions to the bottom-level enumeration object in the initial log creation operation tree, respectively, to obtain multiple first enumeration objects; generate a log creation operation tree based on the multiple first enumeration objects, and the multiple first enumeration objects are located at the bottom of the log creation operation tree.
[0146] In the above embodiment, multiple enumeration objects correspond to multiple creation nodes one by one, the initial log creation operation tree is a multi-level structure, and multiple creation nodes are located at different levels in the initial log creation operation tree. The functions in the function set are bound to the enumeration objects, that is, the functions are bound to the creation nodes through the enumeration objects, and the enumeration objects bound to the functions are only part of the multiple enumeration objects in the initial log creation operation tree, and the creation nodes corresponding to the enumeration objects bound to the functions are located at the bottom of the initial log creation operation tree.
[0147] In some embodiments of the present application, the log creation operation tree acquisition module 702 can be specifically used to: respectively obtain the creation branch logic set corresponding to each function, the creation branch logic set includes at least one creation branch logic for obtaining multiple function call information of different dimensions of the function; bind the at least one creation branch logic corresponding to each function to the first enumeration object; extract the same creation branch logic in the first enumeration object; bind the same creation branch logic upward to one of the creation nodes, and bind the creation node to an enumeration object outside the first enumeration object; traverse the at least one creation branch logic corresponding to each function to generate the log creation operation tree.
[0148] In some embodiments of the present application, the node determination module 703 can be specifically used to: parse the target annotation information to obtain the creation branch logic call information corresponding to the target function; and determine multiple target creation nodes of different levels associated with the annotation function from the log creation operation tree based on the creation branch logic call information.
[0149] Specifically, in some embodiments of the present application, the node determination module 703 can be specifically used to: determine the position of the annotation function in the log creation operation tree based on the annotation information; traverse the log creation operation tree from bottom to top to obtain multiple target creation nodes of different levels associated with the annotation function.
[0150] In some embodiments of the present application, the log creation module 704 can be specifically used to: obtain the target creation branch logic in each target creation node based on multiple target creation nodes; create first log information for calling the target function based on the target creation branch logic, and the first log information includes multiple function call information of different dimensions.
[0151] In some embodiments of the present application, the log creation module 704 can also be used to: parse the target annotation information to obtain the information processing logic set corresponding to the target function. Use at least one information processing sub-logic to process the annotation function to obtain multiple second log information of the same dimension of the annotation function; merge multiple second log information of the same dimension to obtain unique third log information under the same dimension, and the third log information is multiple; merge multiple third log information under different dimensions to obtain fourth log information.
[0152] The information processing logic set includes a plurality of information processing logics for obtaining log information of different dimensions of the annotation function, and the information processing logic includes at least one information processing sub-logic for obtaining log information of the same dimension of the annotation function.
[0153] Among them, in some embodiments of the present application, the information processing logic can be multiple, and a preset information processing logic includes at least one information processing sub-logic to obtain log information of the same dimension of the annotation function. Using at least one information processing sub-logic to process the annotation function, multiple second log information obtained by different methods under the same dimension of the annotation function can be obtained; then the multiple second log information under the same dimension are merged to obtain a unique third log information under the same dimension. There are multiple third log information, which are function call information under different dimensions of the annotation function. Then merge multiple third log information of different dimensions to obtain fourth log information of the function call.
[0154] The log creation module 704 may also be specifically configured to: merge a plurality of first log information and a plurality of fourth log information to generate a log of calling the target function.
[0155] The present application also provides a server, which integrates any character recognition model training device provided in the embodiments of the present application, such as Figure 8 As shown, it shows a schematic diagram of the structure of the server involved in the embodiment of the present application, specifically:
[0156] The server may include one or more processing core processors 801, one or more computer-readable storage media memories 802, a power supply 803, an input unit 804 and other components. Those skilled in the art will appreciate that Figure 7 The server structure shown in the figure does not constitute a limitation on the server, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:
[0157] The processor 801 is the control center of the server, and uses various interfaces and lines to connect various parts of the entire server. By running or executing software programs and / or modules stored in the memory 802, and calling data stored in the memory 802, the processor 801 performs various functions of the server and processes data, thereby monitoring the server as a whole. Optionally, the processor 801 may include one or more processing cores; preferably, the processor 801 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 801.
[0158] The memory 802 can be used to store software programs and modules. The processor 801 executes various functional applications and data processing by running the software programs and modules stored in the memory 802. The memory 802 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the server, etc. In addition, the memory 802 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 802 may also include a memory controller to provide the processor 801 with access to the memory 802.
[0159] The server also includes a power supply 803 for supplying power to each component. Preferably, the power supply 803 can be logically connected to the processor 801 through a power management system, so as to manage charging, discharging, power consumption and other functions through the power management system. The power supply 803 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.
[0160] The server may further include an input unit 804, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0161] Although not shown, the server may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 801 in the server will load the executable files corresponding to the processes of one or more application programs into the memory 802 according to the following instructions, and the processor 801 will run the application programs stored in the memory 802, thereby realizing various functions, as follows:
[0162] When the business system calls the target function, add the target annotation information to the target function to obtain the annotated function. Obtain a preset log creation operation tree, which includes multiple creation nodes at different levels, each creation node includes at least one creation branch logic for creating a log, and each creation branch logic is used to obtain information of one dimension of the annotated function. In the log creation operation tree, determine multiple target creation nodes at different levels associated with the annotated function. Use the creation branch logic in the multiple target creation nodes to create a log that calls the target function.
[0163] The present application also provides a computer-readable storage medium, which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. The storage medium stores a computer program, which is loaded by a processor to execute the steps in any log creation method provided in the embodiments of the present application. For example, the computer program loaded by the processor can execute the following steps:
[0164] When the business system calls the target function, add the target annotation information to the target function to obtain the annotated function. Obtain a preset log creation operation tree, which includes multiple creation nodes at different levels, each creation node includes at least one creation branch logic for creating a log, and each creation branch logic is used to obtain information of one dimension of the annotated function. In the log creation operation tree, determine multiple target creation nodes at different levels associated with the annotated function. Use the creation branch logic in the multiple target creation nodes to create a log that calls the target function.
[0165] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the detailed description of other embodiments above, and will not be repeated here.
[0166] In specific implementation, the above units or structures can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units or structures can refer to the previous method embodiments, which will not be repeated here.
[0167] The above is a detailed introduction to a log creation method, device, server and storage medium provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and embodiments of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific embodiments and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A log creation method, characterized in that: The method comprises: When the business system calls the target function, target annotation information is added to the target function to obtain the annotated function; Obtaining a preset log creation operation tree, the log creation operation tree includes a plurality of creation nodes at different levels, each creation node includes at least one creation branch logic for creating a log, and each creation branch logic can be used to obtain information of one dimension of the annotation function, including: obtaining an initial log creation operation tree, the initial log creation operation tree includes a plurality of enumeration objects, the plurality of enumeration objects correspond to the plurality of creation nodes one by one, the initial log creation operation tree is a multi-level structure, and the plurality of creation nodes are located at different levels in the initial log creation operation tree; Obtain a set of functions that will be called by the business system; Generate a plurality of annotation information corresponding to each function in the function set; Using the plurality of annotation information, each of the functions is respectively bound to the bottom-level enumeration object in the initial log creation operation tree to obtain a plurality of first enumeration objects; Generate the log creation operation tree according to the multiple first enumeration objects, wherein the multiple first enumeration objects are located at the bottom layer of the log creation operation tree; In the log creation operation tree, determining a plurality of target creation nodes of different levels associated with the annotation function; The log of calling the target function is created by utilizing the creation branch logic in the plurality of target creation nodes.
2. The log creation method according to claim 1, characterized in that: The step of generating the log creation operation tree according to the plurality of first enumeration objects includes: Respectively obtain a creation branch logic set corresponding to each function, wherein the creation branch logic set includes at least one creation branch logic for obtaining function call information of different dimensions of the function; Binding at least one creation branch logic corresponding to each of the functions to the first enumeration object; Extract the same branch creation logic in the first enumeration object; Binding the same creation branch logic upward to a creation node, and binding the creation node to an enumeration object other than the first enumeration object; The at least one creation branch logic corresponding to each function is traversed to generate the log creation operation tree.
3. The log creation method according to claim 1, characterized in that: Determining, in the log creation operation tree, a plurality of target creation nodes of different levels associated with the annotation function, includes: Parsing the target annotation information to obtain the creation branch logic call information corresponding to the target function; According to the creation branch logic call information, a plurality of target creation nodes of different levels associated with the annotation function are determined from the log creation operation tree.
4. The log creation method according to claim 3, characterized in that: The step of determining a plurality of target creation nodes of different levels associated with the annotation function in the log creation operation tree includes: Determine the position of the annotation function in the log creation operation tree according to the target annotation information; The log creation operation tree is traversed from bottom to top to obtain multiple target creation nodes of different levels associated with the annotation function.
5. The log creation method according to claim 4, characterized in that: The step of creating a log of calling the target function by using the creation branch logic in the multiple target creation nodes includes: According to the multiple target creation nodes, obtaining the target creation branch logic in each target creation node; According to the target creation branch logic, first log information for calling the target function is created, wherein the first log information includes multiple function call information of different dimensions, and the first log information is multiple.
6. The log creation method according to claim 5, characterized in that: The method further includes: parsing the target annotation information to obtain an information processing logic set of the target function, wherein the information processing logic set includes a plurality of information processing logics for obtaining log information of different dimensions of the annotation function, and the information processing logic includes at least one information processing sub-logic for obtaining log information of the same dimension of the annotation function; Processing the annotation function by using the at least one information processing sub-logic to obtain a plurality of second log information of the same dimension of the annotation function; Merging the multiple second log information of the same dimension to obtain unique third log information of the same dimension, where the third log information is multiple; Multiple third log information in different dimensions are merged to obtain fourth log information.
7. The log creation method according to claim 6, characterized in that: The method further comprises: The plurality of first log information and the plurality of fourth log information are combined to generate a log of calling the target function.
8. A log creation device, characterized in that: The device comprises: A function calling module, wherein the function calling module is used to add target annotation information to the target function to obtain an annotated function when the business system calls the target function; A log creation operation tree acquisition module, the log creation operation tree acquisition module is used to acquire a preset log creation operation tree, the log creation operation tree includes multiple creation nodes at different levels, each creation node includes at least one creation branch logic for creating a log, each creation branch logic can be used to obtain function call information of one dimension of the annotation function, the log creation operation tree acquisition module is specifically used to acquire an initial log creation operation tree, the initial log creation operation tree includes multiple enumeration objects, the multiple enumeration objects correspond to the multiple creation nodes one by one, the initial log creation operation tree is a multi-level structure, and the multiple creation nodes are located at different levels in the initial log creation operation tree; Obtain a set of functions that will be called by the business system; Generate a plurality of annotation information corresponding to each function in the function set; Using the plurality of annotation information, each of the functions is respectively bound to the bottom-level enumeration object in the initial log creation operation tree to obtain a plurality of first enumeration objects; Generate the log creation operation tree according to the multiple first enumeration objects, wherein the multiple first enumeration objects are located at the bottom layer of the log creation operation tree; A node determination module, the node determination module is used to determine a plurality of target creation nodes of different levels associated with the annotation function in the log creation operation tree; A log creation module, wherein the log creation module is used to create a log of calling the target function by using the creation branch logic in the multiple target creation nodes.
9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in the log creation method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Log record generation method and device, storage medium and server
CN110245074A
Apparatus for log data collection and analysis
US5819094A