CN114090506A - Log creating method and device and storage medium - Google Patents

Log creating method and device and storage medium Download PDF

Info

Publication number
CN114090506A
CN114090506A CN202010855614.3A CN202010855614A CN114090506A CN 114090506 A CN114090506 A CN 114090506A CN 202010855614 A CN202010855614 A CN 202010855614A CN 114090506 A CN114090506 A CN 114090506A
Authority
CN
China
Prior art keywords
log
creation
function
information
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010855614.3A
Other languages
Chinese (zh)
Inventor
高欢斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SF Technology Co Ltd
Original Assignee
SF Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SF Technology Co Ltd filed Critical SF Technology Co Ltd
Priority to CN202010855614.3A priority Critical patent/CN114090506A/en
Publication of CN114090506A publication Critical patent/CN114090506A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/148File search processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/1734Details of monitoring file system events, e.g. by the use of hooks, filter drivers, logs

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application provides a log creating method, a log creating device and a log creating storage medium, wherein when a target function is called, target annotation information is added into the target function to obtain an annotation function; acquiring a preset log creation operation tree comprising a plurality of creation nodes positioned at different levels, wherein each creation node comprises at least one creation branch logic for acquiring one dimension information of an annotation function; a log of calling the target function is determined and created using create branch logic in a plurality of target create nodes at different levels associated with the annotation function. The nodes in the log creation operation tree in the method comprise creation branch logic for acquiring different dimensional information of functions, and the creation branch logic is utilized to process the functions called by users to generate operation logs. Aiming at different application scenes, only nodes in the log creation operation tree and creation branch logics corresponding to the nodes are added and deleted, a new log creation program is not required to be written, the flexibility of log generation is improved, and more scenes are adapted.

Description

Log creating method and device and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a log creation method, apparatus, and storage medium.
Background
Along with the popularization of information systems and the improvement of system complexity, the probability of problems caused by misoperation of users is increased continuously in the use process of software systems, and log information generated by the systems is an important means for better understanding the operation condition and the error details of the systems and troubleshooting system faults. The current Spring technology stack lacks a general logging function to record background behaviors to a database.
Meanwhile, the log generation method in the prior art needs to customize different information processing logics according to different use scenes, is low in universality and wastes manpower and material resources. And effective query cannot be realized for different users or operations.
Disclosure of Invention
The embodiment of the application provides a log creating method, a log creating device, a server and a storage medium, and aims to solve the problems that the log creating method in the prior art is low in universality and wastes manpower and material resources.
In a first aspect, the present application provides a log creation method, including:
when a business system calls a target function, adding target annotation information into the target function to obtain an annotation function;
acquiring a preset log creation operation tree, wherein the log creation operation tree comprises a plurality of creation nodes positioned at different levels, each creation node comprises at least one creation branch logic for creating a log, and each creation branch logic can be used for acquiring information of one dimension of the annotation function;
determining, in the log creation operation tree, a plurality of target creation nodes of different levels associated with the annotation function;
creating a log that calls the target function using the create branch logic in the plurality of target create nodes.
Further, the obtaining of the preset log creation operation tree includes:
acquiring an initial log creation operation tree, wherein the initial log creation operation tree comprises a plurality of enumeration objects, the enumeration objects correspond to a plurality of creation nodes one by one, the initial log creation operation tree is of a multi-level structure, and the creation nodes are located in different levels in the initial log creation operation tree;
acquiring a function set called by the service system;
generating a plurality of annotation information corresponding to each function in the function set one by one;
binding all the functions and the enumeration objects at the bottommost layer in the initial log creation operation tree respectively by using the annotation information to obtain a plurality of first enumeration objects;
and generating the log creation operation tree according to the plurality of first enumeration objects, wherein the plurality of first enumeration objects are positioned at the bottommost layer of the log creation operation tree.
Further, the generating the log creation operation tree according to the plurality of first enumeration objects includes:
respectively obtaining a creating branch logic set corresponding to each function, wherein the creating branch logic set comprises at least one creating branch logic used for obtaining function call information of different dimensions of the function;
binding at least one first creation branch logic corresponding to each function with the first enumeration object;
extracting the same creating branch logic in the first enumeration object;
binding the same creation branch logic upwards to one creation node, and binding the creation node with one enumeration object except the first enumeration object;
and traversing the at least one creating branch logic corresponding to each function to generate the log creating operation tree.
Further, the determining, in the log creation operation tree, a plurality of target creation nodes of different levels associated with the annotation function includes:
analyzing the target annotation information to obtain created branch logic information corresponding to the target function;
and determining a plurality of target creation nodes of different levels associated with the annotation function from the log creation operation tree according to the creation branch logic call information.
Further, the determining a plurality of target creation nodes of different levels associated with the annotation function in the log creation operation tree includes:
determining the position of the annotation function in the log creation operation tree according to the target annotation information;
and traversing the log creation operation tree from bottom to top to obtain a plurality of target creation nodes of different levels associated with the annotation function.
Further, the creating a log that calls the target function using the create branch logic in the plurality of target create nodes includes:
acquiring target creation branch logic in each target creation node according to the plurality of target creation nodes;
and creating first log information for calling the target function according to the target creating branch logic, wherein the first log information comprises a plurality of pieces of function calling information with different dimensionalities.
Further, the method further comprises: analyzing the target annotation information to obtain an information processing logic set of the target function, wherein the information processing logic set comprises a plurality of information processing logics for acquiring log information of different dimensions of the annotation function, and the information processing logics comprise at least one information processing sub-logic for acquiring the 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 with the same dimensionality of the annotation function;
merging the plurality of second log information with the same dimensionality to obtain unique third log information with the same dimensionality, wherein the number of the third log information is multiple;
and combining the plurality of third log information under different dimensions to obtain the fourth log information.
Further, the method further comprises:
and combining the plurality of first log information and the plurality of fourth log information to generate a log for calling the target function.
In a second aspect, the present application further provides a log creating apparatus, including: the function calling module is used for adding target annotation information into a target function to obtain an annotation function when the service system calls the target function;
the log creating operation tree obtaining module is used for obtaining a preset log creating operation tree, the log creating operation tree comprises a plurality of creating nodes located at different levels, each creating node comprises at least one creating branch logic for creating the log, and each creating branch logic can be used for obtaining information of one dimension of the annotation function;
a node determination module to determine a plurality of target creation nodes of different hierarchies associated with the annotation function in the log creation operation tree;
a log creation module to create a log that calls the target function using the create branch logic in the plurality of target create nodes.
In a third aspect, the present application further provides a server, including:
one or more processors;
a memory; and
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.
In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, the computer program being loaded by a processor to perform the steps in the log creation method as described in any one of the above.
The embodiment of the application provides a log creating method, a log creating device, a server and a storage medium, wherein the method is characterized in that a log creating operation tree is provided, and the bottommost node in the log creating operation tree is bound with a target function called by a user; and the nodes in the log creation operation tree comprise creation branch logic for acquiring different dimensional information of the target function, and the functions called by the user can be processed by utilizing the creation branch logic so as to generate the operation log. The log creation operation tree can add and delete new creation branch logic at will, so that only nodes in the log creation operation tree and creation branch logic corresponding to the nodes need to be added and deleted for different application scenes, a new log creation program does not need to be written, the flexibility of log generation is increased, more application scenes are adapted, and manpower and material resources are saved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic view of a scenario of a log creation system according to an embodiment of the present application;
fig. 2 is a schematic flowchart of an embodiment of creating a log according to an embodiment of the present application;
FIG. 3 is a diagram of an embodiment of a log creation operation tree provided in an embodiment of the present application;
fig. 4 is a schematic flowchart of an embodiment of obtaining a preset log creation operation tree according to the present application;
fig. 5 is a schematic flowchart of an embodiment of an operation tree for creating a log according to the present application;
fig. 6 is a schematic flowchart of another embodiment of a method for creating a journal log according to an embodiment of the present application;
fig. 7 is a schematic diagram of an embodiment of a log creation apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a server according to an embodiment of the present application.
DETAILED DESCRIPTION OF EMBODIMENT (S) OF INVENTION
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the description of the present application, it is to be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", and the like indicate orientations or positional relationships based on those shown in the drawings, and are used merely for convenience of description and for simplicity of description, and do not indicate or imply that the referenced device or element must have a particular orientation, be constructed in a particular orientation, and be operated, and thus should not be considered as limiting the present application. Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more features. In the description of the present application, "a plurality" means two or more unless specifically limited otherwise.
In this application, the word "exemplary" is used to mean "serving as an example, instance, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments. The following description is presented to enable any person skilled in the art to make and use the application. In the following description, details are set forth for the purpose of explanation. It will be apparent to one of ordinary skill in the art that the present application may be practiced without these specific details. In other instances, well-known structures and processes are not set forth in detail in order to avoid obscuring the description of the present application with unnecessary detail. Thus, the present application is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.
The embodiments of the present application provide a method and an apparatus for creating a log, a server, and a storage medium, which are described below.
As shown in fig. 1, a schematic view of a scenario of a log creation system provided in an embodiment of the present application, where the log creation system may include a plurality of hosts 100 and a server 200, where the hosts 100 and the server 20 are connected through a network, and a log creation apparatus, such as the server in fig. 1, is integrated in the server 200, and the hosts 100 may access the server 200.
In the embodiment of the present invention, the server 200 is mainly used for adding target annotation information to a target function to obtain an annotation function when a service system calls the target function; the method comprises the steps of obtaining a preset log creation operation tree, wherein the log creation operation tree comprises a plurality of creation nodes located at different levels, each creation node comprises at least one creation branch logic for creating the log, each creation branch logic can be used for obtaining information of one dimension of an annotation function, namely, one creation branch logic can obtain information of one dimension of the annotation function, and a plurality of creation branch logics can obtain information of a plurality of dimensions of the annotation function; determining a plurality of target creation nodes of different levels associated with the annotation function in the log creation operation tree; with create branch logic in the plurality of target create nodes, a log is created that calls the target function.
In this embodiment of the present invention, the server 200 may be an independent server, or may be a server network or a server cluster composed of servers, for example, the server 200 described in this 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 constituted by a large number of computers or web servers based on Cloud Computing (Cloud Computing). In the embodiment of the present invention, the server and the host may implement communication through any communication manner, including but not limited to mobile communication based on the third Generation Partnership Project (3 GPP), Long Term Evolution (LTE), Worldwide Interoperability for Microwave Access (WiMAX), or computer network communication based on the TCP/IP Protocol Suite (TCP/IP), User Datagram Protocol (UDP) Protocol, and the like.
It will be appreciated that the host 100 used in embodiments of the present invention may be a device that includes both receiving and transmitting hardware, i.e., a device having receiving and transmitting hardware capable of performing two-way communications over a two-way communications 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 host 100 may specifically be a desktop terminal or a mobile terminal, and the host 100 may also specifically be one of a mobile phone, a tablet computer, a notebook computer, and the like.
Those skilled in the art will appreciate that the application environment shown in fig. 1 is only one application scenario related to the present application, and does not constitute a limitation to the application scenario of the present application, and that other application environments may further include more or less servers than those shown in fig. 1, or a network connection relationship of servers, for example, only 1 server and 2 hosts are shown in fig. 1, and it will be understood that the log creation system may further include one or more other servers, or/and one or more hosts network-connected to a server, and is not limited herein.
In addition, as shown in fig. 1, the log creation system may further include a memory 300 for storing data, such as host data, e.g., host status data during the operation of the host.
It should be noted that the scenario diagram of the log creation system shown in fig. 1 is only an example, and the log creation system and the scenario described in the embodiment of the present invention are for more clearly illustrating the technical solution of the embodiment of the present invention, and do not form a limitation on the technical solution provided in the embodiment of the present invention.
The embodiment of the application provides a log creating method, which comprises the following steps: when a business system calls a target function, target annotation information is added into the target function to obtain an annotation function; acquiring a preset log creation operation tree, wherein the log creation operation tree comprises a plurality of creation nodes positioned at different levels, each creation node comprises at least one creation branch logic for creating the log, and each creation branch logic can be used for acquiring information of one dimension of the annotation function; determining a plurality of target creation nodes of different levels associated with the annotation function in the log creation operation tree; with create branch logic in the plurality of target create nodes, a log is created that calls the target function. The following are detailed below. As shown in fig. 2, fig. 2 is a schematic flowchart of an embodiment of creating a log provided by the embodiment of the present application, where the method includes:
21. and when the business system calls the target function, adding target annotation information in the target function to obtain an annotation function.
The service system calls functions to realize various functions in the using process, and the process of calling the functions needs to create logs to store the using conditions of the functions in the function calling process. In some embodiments of the present application, when the service system calls a specific function, that is, a target function, target annotation information is added to the target function to obtain an annotation function.
Specifically, in the embodiment of the present application, the annotation information is added to the target function, so as to obtain a process of processing the target function by analyzing the annotation information; namely, the annotation information can be used to determine the flow such as information extraction of the target function. Specifically, adding annotation information to the target function may include: acquiring target annotation information corresponding to a target function; target annotation information is added before and after the target function, namely the target function is inserted into the target annotation information, so that an annotation function comprising the target annotation information is obtained. In the embodiment of the application, the target function corresponds to the target annotation information one by one, and the annotation function includes the target annotation information.
22. The method comprises the steps of obtaining a preset log creation operation tree, wherein the log creation operation tree comprises a plurality of creation nodes located at different levels, each creation node comprises at least one creation branch logic, and each creation branch logic can be used for obtaining information of one dimension of an annotation function.
In some embodiments of the present application, the creation branch logic is configured to obtain the call information of the annotation function, and the creation branch logic may include a plurality of branch logics, each branch logic being configured to obtain the call information of different dimensions of the annotation function. In a particular embodiment of the present application, creating branch logic may comprise: and the user information processing logic is used for acquiring some information of the user calling the target function so as to determine the information of the user calling the function currently, namely the information of the user performing various operations. The operation parameter processing logic is used for acquiring and storing some important operation parameters when the user calls the target function; because some operation information is too complex and redundant, redundant information can be screened and removed, and the rest information is formatted and is convenient to store. The information obtained after removing the redundant information is stored in a json character string form after being formatted.
Creating the branch logic may further comprise: the retrieval attribute processing logic is used for extracting some attribute information of the user when calling the target function, so that the subsequent retrieval of the log is facilitated; the operation for different calling functions and the key attributes to be recorded are different from the method for extracting the key attributes. And the return result processing logic is used for judging whether the calling of the target function and the acquisition of the various parameters are successful or not. Information of multiple dimensions of the annotation function can be obtained by using the creating branch logic.
23. In a log creation operation tree, a plurality of target creation nodes of different levels associated with annotation functions are determined.
24. With create branch logic in the plurality of target create nodes, a log is created that calls the target function.
According to the log creating method provided by the embodiment of the application, a log creating operation tree is provided, and a bottommost node in the log creating operation tree is bound with an annotation function called by a user; thus, the target function can traverse the whole log creation operation tree from top to bottom to confirm all target layer creation nodes corresponding to the annotation function. And the creation of the nodes in the log creation operation tree comprises the creation branch logic for acquiring the information of different dimensions of the annotation function, and the creation branch logic can be utilized to process the function called by the user so as to generate the operation log in the process of calling the function. Meanwhile, the log creation operation tree can arbitrarily add and delete the new creation branch logic, for example, the creation node is added or deleted to bind or delete the creation branch logic, so that the addition or deletion of the creation branch logic in the log creation operation tree is realized, and 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, a new log creation program does not need to be written, the flexibility of log generation is increased, and thus more application scenarios are adapted, and manpower and material resources are saved.
In some embodiments of the present application, the create branching logic for log creation provided by the present application may be encapsulated in Aspect Oriented Programming (AOP). Specifically, AOP is a technique for implementing unified maintenance of program functions by means of pre-compilation and dynamic behavior of the agent during runtime. By utilizing the AOP, all parts of the business logic can be isolated, so that the coupling degree between all parts of the business logic is reduced, the repeatability of a program is improved, and the development efficiency is improved. In the embodiment of the application, the creating branch logic of the log creation is encapsulated in the AOP, that is, some general methods or steps of the log creation in the prior art can be extracted, functional codes are written separately, and the log creating method provided in the application is encapsulated separately. When the operation logs need to be created in different application scenes, not only a general log creation method but also the log creation method provided by the application can be utilized. The general log creation method and the log creation method provided by the application are independent, and the general log creation method and the log creation method provided by the application are independently packaged in the service system, so that the application scene of the log creation method provided by the application can be improved, and the flexibility of the log creation method provided by the application is improved.
In an embodiment of the present application, a log creation operation tree is provided, which can be utilized to create a log of calling functions. As shown in fig. 3, a diagram of an embodiment of a log creation operation tree provided by the present application is a multi-layer structure, where the log creation operation tree includes a plurality of creation nodes located at different levels, and each creation node encapsulates at least one creation branch logic of the creation log, where the creation branch logic may be used to obtain call information of an annotation function.
In the embodiment of the application, one creating node in the log creating operation tree may include one creating branch logic for creating a log, or may include a plurality of creating branch logics for creating a log. If one creating node comprises a plurality of creating branch logics for creating the log, the creating node can be used for simultaneously acquiring information of a plurality of dimensions of the annotation function; that is, the creating node may be used to simultaneously obtain information of multiple dimensions of the target function called by the service system.
In some embodiments of the present application, summarizing, before creating a log for calling a target function by using a log creation operation tree, a preset log creation operation tree needs to be obtained, as shown in fig. 4, a flowchart of an embodiment of obtaining the preset log creation operation tree provided in the embodiments of the present application, where obtaining the preset log creation operation tree may include:
41. an initial log creation operation tree is obtained, wherein the initial log creation operation tree comprises a plurality of enumeration objects.
The plurality of enumeration objects are in one-to-one correspondence with the plurality of creation nodes, the initial log creation operation tree is of a multi-level structure, and the plurality of creation nodes are located in different levels of the initial log creation operation tree, that is, the plurality of enumeration objects are also located in different levels of the initial log creation operation tree. The enumeration object is actually encapsulated in the creation node.
42. And acquiring a function set called by the service system.
43. And generating annotation information which corresponds to each function in the function set one by one.
44. And binding all functions and enumeration objects at the bottommost layer in the initial log creation operation tree respectively by using the plurality of annotation information to obtain a plurality of first enumeration objects.
45. And generating a log creation operation tree according to the plurality of first enumeration objects.
Wherein the plurality of first enumeration objects are located at the lowest level of the log creation operation tree.
Specifically, in some embodiments of the present application, an initial log creation operation tree may be obtained first, where the initial log creation operation tree includes multiple creation nodes, and each creation node corresponds to an enumeration object, that is, the creation nodes and the enumeration objects correspond to each other one to one. But does not include the create branch logic to create the oplog in the initial log create operation tree. In the embodiment of the present application, a function set that a service system will call needs to be bound to an initial log creation operation tree, and a creation branch logic corresponding to each function in the function set also needs to be bound to the initial creation operation tree.
In the embodiment of the present application, an objective function that the service system will call needs to be bound to the creation node. Specifically, a function set of all functions that the service system may call may be obtained first, where the function set includes a plurality of different functions. The service system calls different functions to realize different functions in the actual operation process, and the function called by one service system is determined and preset. In different scenes, functions called by the service system can be increased or decreased according to actual conditions to realize different functions.
Generating a plurality of annotation information corresponding to a function set including all functions, one annotation information corresponding to one function; and binding the plurality of annotation information and the plurality of functions one by one. Simultaneously, binding the function with the enumeration objects at the bottommost layer in the initial log creation operation tree one by one; thereby binding the function with the creation node in the initial log creation operation tree.
In the embodiment of the present application, some description information of the objective function and specific processing logic in the objective function may also be packaged in the enumeration object. Meanwhile, the name of the enumeration object can be stored as the unique identifier of the target function. Thus, the enumeration object and a plurality of functions in the function set are bound one by one through a plurality of annotation information; an objective function corresponds to annotation information and also to an enumeration object.
The enumeration object is actually packaged in the creation node, so that the enumeration object is bound with all functions called by the service system, that is, the functions are further packaged in the enumeration object, so that the binding of the functions and the enumeration object, that is, the binding of the functions and the creation node is realized.
It should be noted that, the enumeration object at the bottom layer is bound with a target function, so that a plurality of first enumeration objects are obtained, and a plurality of target functions and a plurality of corresponding first enumeration objects are obtained; while the first enumeration object is a part of the enumeration object in the initial log creation operation tree, the enumeration object may contain quantities used to represent finite, discrete, expressive and very specific quantities such as color, mode, category, state, etc. in this application, functions and creation branching logic may be bound in the enumeration object. That is, in the initial log creation operation tree, besides a part of the enumeration objects bound to the target function, a part of the enumeration objects are not bound to the target function. And in the initial log creation operation tree, a plurality of creation nodes corresponding to the first enumeration object are positioned at the bottommost layer of the initial log creation operation tree, namely the target function is positioned at the bottommost layer of the initial log creation operation tree.
In the initial log creation operation tree, other enumeration objects except the first enumeration object may be second enumeration objects, the first enumeration object is arranged at the lowest layer of the initial log creation operation tree, and other second enumeration objects are divided into other different levels except the lowest layer, so as to obtain the log creation operation tree.
As shown in fig. 5, a flowchart of an embodiment of creating an operation tree for generating a log according to the embodiment of the present application may include:
51. and respectively acquiring a creating branch logic set corresponding to each function, wherein the creating branch logic set comprises at least one creating branch logic for acquiring various function call information of different dimensions of the function.
52. And binding at least the first creation branch logic corresponding to each function with the first enumeration object.
53. The same create branch logic in the first enumerated object is fetched.
54. And binding the same creation branch logic to a creation node upwards, and binding the creation node to an enumeration object except the first enumeration object.
55. And traversing at least one creating branch logic corresponding to each function, and generating a log creating operation tree.
Specifically, in the embodiment of the present application, the number of target functions to be called by the service system is multiple, and the annotation function is obtained by adding annotation information to the target function. One annotation function corresponds to one creation branch logic set, and the creation branch logic set can comprise a plurality of creation branch logics, wherein different creation branch logics are used for acquiring function call information of different dimensions of the annotation function. Therefore, one annotation function corresponds to a plurality of creating branch logics, and then the creating branch logics are bound with the first enumeration object at the bottommost layer in the initial log creating operation tree, so that the creating branch logics corresponding to the function can be bound in the log creating operation tree through the first enumeration object. It should be noted that, for a specific annotation function, there may be a plurality of creation branch logics corresponding to the annotation function, and the plurality of creation branch logics are all bound in the first enumeration object bound to the annotation function; rather than binding the multiple create branch logics separately in the multiple first enumeration objects.
After obtaining the multiple creation branch logic sets corresponding to each annotation function, the same creation branch logic bound in the multiple first enumeration objects needs to be extracted.
In particular, since different creating branch logic sets obtain information annotating different dimensions of a function, creating branch logic may include multiple creating branch logics. Therefore, although one annotation function may correspond to a plurality of creation branch logics, different annotation functions may correspond to the same creation branch logics if the same information is acquired. Therefore, the same creating branch logic in different annotation functions can be extracted, and the same creating branch logic is bound to a creating node at the upper layer in the log creating operation tree, namely, the same creating branch logic in different functions is bound to a parent node at the upper layer.
Therefore, when the service system calls the annotation function and the creation branch logic bound in the creation node is needed to obtain the information of multiple dimensions of the annotation function, the creation branch logic bound in the first creation node bound with the target function can be obtained first, then the log creation operation tree is retrieved upwards, and other creation branch logics bound in all other creation nodes associated with the annotation function are obtained.
And because the plurality of annotation functions are respectively in one-to-one correspondence with the bottommost creation nodes in the log creation operation tree, and the same creation node, namely the same father node, can be bound upwards in the log creation operation tree, after each target function respectively acquires the creation branch logic bound in the bottommost creation node corresponding to each target function, the target function can search upwards in the log creation operation tree to obtain other creation nodes bound with the target function, and acquire the creation branch logic in other creation nodes.
For the objective function, the dimension information required to be obtained by different objective functions may be different, and the specific method for obtaining the same dimension information may also be different. Therefore, in the log creation operation tree, for other creation nodes bound to multiple target functions, if the information of the dimension that needs to be obtained by the target functions is the same for different target functions and the method for obtaining the dimension information is the same, the same creation branch logic can be extracted and bound, for example, the creation branch logic can be packaged in AOP and then implemented by AOP. Because the creation branch logics packaged in the AOP are independent, different creation branch logics are bound in the AOP; different creating branch logics can be selected aiming at different scenes, namely different AOPs are selected, so that the flexibility of the log creating method provided by the application can be effectively improved, and the log creating method is suitable for more scenes.
Referring to fig. 3, in fig. 3, the log creation operation tree includes a plurality of creation nodes, wherein the root node is located at the uppermost layer of the log creation operation tree, and the objective function may include a first objective function, a second objective function, and a third objective function; the first target function, the second target function and the third target function are respectively bound with a bottommost layer creation node, and the bottommost layer creation node is located at the bottommost layer of the log creation operation tree. A plurality of creating branch logics of the target function are also bound in the first creating node, wherein for the bottommost first target creating node bound with the first target function, a plurality of creating branch logics for acquiring different dimension information of the first target function are bound in the bottommost first target creating node, and the creating branch logics can be used for acquiring user information, operation parameter information and retrieval attribute information of the first target function respectively; and a specific method corresponding to obtaining the first objective function user information, the operation parameter information, and the retrieval attribute information may be m1n1q 1.
Similarly, for a second lowest-layer target creation node bound with a second target function, multiple creation branch logics for obtaining different dimensional information of the second target function can be bound in the second lowest-layer target creation node, and the multiple creation branch logics are respectively used for obtaining user information and operation parameter information of the second target function; and a specific method corresponding to the obtaining of the second objective function user information and the operation parameter information may be m1n 1. For the lowest layer third target creation node bound with the third target function, multiple creation branch logics for obtaining the dimension information of the third target function can be bound in the lowest layer third target creation node, namely obtaining the user information, the operation parameter information and the retrieval attribute information of the third target function; and a specific method corresponding to obtaining the third objective function user information, the operation parameter information, and the retrieval attribute information may be m1n1q 2.
As can be seen from the above, for the first objective function, the second objective function, and the third objective function, user information and operation parameter information of the three functions need to be acquired; however, for the first objective function and the third objective function, the method for acquiring the user information is the same as the method for acquiring the operation parameter, and the method for acquiring the search attribute is different. Therefore, the method m1 for acquiring the user information and the method n1 for acquiring the operation parameters can be extracted, and the method m1n1 is bound upwards in one creating node. At this time, the creation branch logic of the binding in the lowest layer first target creation node is q1, while the creation branch logic of the binding in the lowest layer second target creation node and the creation branch logic of the binding in the lowest layer third target creation node is q 2.
It should be noted that, in the embodiment of the present application, although some creation nodes do not have the binding creation branch logic, because the creation nodes have the property of attribute inheritance, the creation branch logic is actually bound in the creation nodes without the binding creation branch logic; that is, these creation nodes can inherit the creation branch logic in the creation node (i.e., parent node) of the upper layer to which they are bound. If no binding creates branch logic in the parent node bound to the first creating node, then the upward search and creation of the binding of the branch logic may continue until the root node.
In a specific embodiment of the present application, although the creation branch logic is not bound in the lowest second target creation node, the creation node has an attribute inheritance property such that, in fact, the creation branch logic in the lowest second target creation node is m1n 1; that is, the creating branch logic of the binding in the second target creating node is: create branch logic in a creation node of a previous layer bound to a second target creation node.
By using the method, all functions in the function set called by the traversal service system are traversed, then the multiple creation branch logics corresponding to each function in the function set are traversed, and the same creation branch logics are bound upwards to create nodes. If the plurality of creation nodes also comprise the same creation branch logic, the new creation node can be continuously bound upwards until no same creation branch logic can continuously bind the new creation node upwards, and the root node is bound again to be the end.
Thus, when the user calls the first target function, the bottommost first target creation node corresponding to the first target function is determined according to the log creation operation tree, and then the first target function is processed according to the creation branch logic q1 bound in the bottommost first target creation node. And searching the upper layer, acquiring the creation node in the upper layer bound with the first target creation node, and processing the first target function according to the creation branch logic m1n1 bound in the creation node. Similarly, the second objective function and the third objective function may be processed in the same way, so as to obtain the log information corresponding to the second objective function and the third objective function respectively.
In the embodiment of the present application, in the process of processing the function by using the log creation operation tree to obtain the log, a plurality of target creation nodes of different levels associated with the annotation function need to be determined in the log creation operation tree. Because the creating branch logic of the creating log corresponding to each function in the log creating operation tree is subjected to upward extraction binding of the same log creating branch logic, a plurality of creating branch logics corresponding to a certain annotation function are positioned at different levels of the log creating operation tree.
Specifically, in some embodiments of the present application, determining multiple target creation nodes of different hierarchies associated with an annotation function in a log creation operation tree may include: analyzing the target annotation information to obtain creating branch logic call information corresponding to the target function; and determining a plurality of target creation nodes of different levels associated with the annotation function from the log creation operation tree according to the creation branch logic calling information.
Specifically, the annotation function is added with annotation information, and the content in the annotation information can determine which information of the annotation function needs to be acquired, that is, the function call information of creating branch logic that needs to be called for the annotation function. The annotation information comprises creation branch logic for processing the annotation function, the creation branch logic is bound in the log creation operation tree, the creation branch logic corresponding to the annotation function can be determined according to the annotation information, and then the creation branch logic is searched in the log creation operation tree to obtain a plurality of target creation nodes of different levels associated with the annotation function.
In some embodiments of the present application, obtaining, from the log creation operation tree, a plurality of target creation nodes of different hierarchies associated with the annotation function according to the annotation information may include:
determining the position of an annotation function in a log creation operation tree according to the target annotation information; and traversing the log creation operation tree from bottom to top to obtain a plurality of target creation nodes of different levels associated with the annotation function.
Specifically, since the annotation function is bound to the first creation node at the bottom layer in the log creation operation tree, and the annotation function is in one-to-one correspondence with the first creation node at the bottom layer, the position of the annotation function in the log creation operation tree can be determined. After the position of the annotation function in the log creation operation tree is determined, the whole log creation operation tree can be traversed from bottom to top, so that a plurality of target creation nodes of different levels associated with the annotation function are obtained.
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 a plurality of target creation nodes of different levels associated with the annotation function.
Specifically, when the log creation operation tree is created, the first creation node at the bottommost layer is already bound with the functions one by one, and in the layers except the bottommost layer, the multiple creation branch logics corresponding to each function are also extracted and bound. Thus, an operation tree may be created from the top-down variable log to determine multiple target creation nodes at different levels associated with the annotation function.
After a plurality of target creation nodes associated with the annotation function are determined, since the creation branch logic is bound in the enumeration object bound by each creation node, the first log information for calling the target function can be created by using the creation branch logic bound by each target creation node. The first log information includes a plurality of pieces of function call information with different dimensions, the first log information is obtained by using creation branch logic in the creation node, and the first log information can be a plurality of pieces.
Specifically, after a plurality of target creation nodes associated with the target function are determined, the creation branch logic bound in each target creation node may be obtained, the branch logic is created for the target, and a specific method for processing the target function in the target creation branch logic may be a processing method customized for the target function. And processing the target function according to the target creation branch logic to obtain a plurality of pieces of first log information. The first log information is a plurality of pieces of first log information, and different pieces of first log information respectively correspond to information of one dimension of the objective function.
As shown in fig. 6, a schematic flowchart of another embodiment of a log creation method provided in the embodiment of the present application is shown; in an embodiment of the present application, the log creating method provided in the embodiment of the present application may further include:
61. and analyzing the target annotation information to obtain an information processing logic set of the target function.
The preset information processing logic set analyzed from the target annotation information summarization of the annotation function can comprise a plurality of information processing logics so as to respectively acquire information with different dimensions in the annotation function; while a preset information processing logic obtains information of one dimension of the annotation function, 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, the multiple information processing sub-logics acquire information of the annotation function in the same dimension, and only the specific methods for acquiring the information are different. The preset information processing logic and the creating branch logic in the log creating operation tree are used for acquiring information with different dimensions in the annotation function, and the difference between the preset information processing logic and the creating branch logic is that the preset information processing logic can be relatively universal information processing logic in the prior art; the branch creation logic in the log creation operation tree may be customized for a certain annotation function, and is unique.
62. And processing the annotation function by utilizing at least one information processing sub-logic to obtain a plurality of second log information with the same dimensionality of the annotation function.
63. And merging the second log information with the same dimensionality to obtain the unique third log information with the same dimensionality.
64. And combining the plurality of third log information under different dimensions to obtain fourth log information.
In the embodiment of the application, when a business system calls a target function, annotation information needs to be added into the target function to obtain an annotation function; and analyzing the annotation information to obtain all target creation nodes corresponding to the annotation function in the preset information processing logic and the log creation operation tree, wherein the target creation nodes are bound with creation branch logic. And processing the annotation function by using a preset information processing logic to obtain a plurality of third log information of different dimensions of the annotation function.
And because one preset information processing logic can comprise a plurality of information processing sub-logics, and the plurality of information processing sub-logics in the same preset information processing logic acquire the information of the annotation function in the same dimension, namely the information of the second log. The second log information is thus information of the same dimension of the annotation function acquired by different information processing methods. The plurality of second log information can be combined to obtain only one third log information under a certain dimensionality; and combining the plurality of third log information under different dimensions to obtain final fourth log information.
The preset information processing logic and the creating branch logic in the log creating operation tree are used for acquiring call information with different dimensions in the annotation function, and the difference between the preset information processing logic and the creating branch logic is that the preset information processing logic can be relatively universal information processing logic in the prior art; the branch creation logic in the log creation operation tree may be customized for a certain annotation function, and is unique.
In one embodiment of the present application, the preset information processing logic may include: processing logic to obtain user information and information processing logic to obtain operating parameters. The processing logic of the obtained user information may further specifically include a plurality of methods, which are methods a, b, and c, respectively; and the information processing logic to obtain the operating parameters may include a plurality of methods, respectively methods d, e, and f. For methods a, b and c, the annotation function is processed by the methods a, b and c, and user information, namely second log information, is obtained; for methods d, e, and f, they process the annotation function to obtain the operation parameter information and the second log information. However, methods a, b and c obtain information in the dimension of annotation function user information, and methods d, e and f obtain information in the dimension of annotation function operation parameter information.
Merging the information with the same dimension, namely merging the user information acquired by the methods a, b and c respectively to obtain final user information, namely third log information under the dimension of the user information; and merging the operation parameter information obtained by the methods d, e and f respectively to obtain final operation parameter information, namely third log information under the dimension of the operation parameters. And combining a plurality of third log information under different dimensions, such as user information, operation parameter information and the like, to obtain final fourth log information, wherein the fourth log information comprises log information of multiple dimensions of an annotation function. The fourth log information is obtained by processing the annotation function by using preset information processing logic, and the preset information processing logic may include some general information processing logic.
It should be noted that, in the 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 for creating the fourth log information is an existing and relatively common information processing logic to create the operation log of the function. The create branch logic that creates the first log information is bound in the log create operation tree, and the create branch logic is some information processing logic that is customized for different functions. The branch creating logic and the information processing logic are used for acquiring function call information of different dimensions of the function, but the branch creating logic and the information processing logic are respectively bound in the AOP, so that the coupling degree between the dimension information acquisition methods is reduced, the repeatability of the program can be improved, and the development efficiency is improved.
The fourth log information is obtained by processing an objective function by using a general information processing method, and the objective function has multiple dimensions; the first log information is obtained by processing an objective function by a customized information processing method, and the objective function has a plurality of dimensions. In some embodiments of the present application, in order to obtain a function call log for calling a template target function, a plurality of first log information and a plurality of fourth log information need to be merged to obtain a final log for calling the target function.
In the embodiment of the application, for the log creation operation tree, creation nodes positioned at the bottom layer in the log creation operation tree can be continuously increased to bind more functions, so that the log creation operation tree is suitable for more log creation scenarios. Meanwhile, the creation branch logic bound in the log creation operation tree is the creation branch logic customized for a specific function, and only when the customized creation branch logic is required to be called to create the log, the annotation function is utilized to call the log creation operation tree so as to obtain the customized creation branch logic to process the function.
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 performing various processing on a function in the process of making a call to a plurality of functions.
As shown in fig. 7, an embodiment of the log creating apparatus provided in this embodiment of the present application is schematically illustrated, and the log creating apparatus may include:
the function calling module 701, the function calling module 701 is configured to add target annotation information to the target function when the service system calls the target function, so as to obtain an annotation function.
The annotation function comprises a log creation operation tree obtaining module 702, where the log creation operation tree obtaining module 702 is configured to obtain a preset log creation operation tree, where the log creation operation tree includes multiple creation nodes located at different hierarchies, and each creation node includes at least one creation branch logic for creating a log, and each creation branch logic may be used to obtain information of one dimension of the annotation function.
A node determining module 703, the node determining module 703 being configured 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 704, the log creation module 704 configured to create a log that calls the target function using create branch logic in the plurality of target creation nodes.
According to the log creation device, a log creation operation tree is provided, and a bottommost node in the log creation operation tree is bound with a target function called by a user; and the nodes in the log creation operation tree comprise creation branch logic for acquiring different dimensional information of the target function, and the functions called by the user can be processed by utilizing the creation branch logic so as to generate the operation log. The log creation operation tree can add and delete new creation branch logic at will, so that only nodes in the log creation operation tree and creation branch logic corresponding to the nodes need to be added and deleted for different application scenes, a new log creation program does not need to be written, the flexibility of log generation is increased, more application scenes are adapted, and manpower and material resources are saved.
In some embodiments of the present application, the log creation operation tree obtaining module 702 may be specifically configured to: acquiring an initial log creation operation tree, wherein the initial log creation operation tree comprises a plurality of enumeration objects; acquiring a function set called by a service system; generating a plurality of annotation information which corresponds to each function in the function set one by one; binding all functions and the bottom enumeration object in the initial log creation operation tree respectively by using the annotation information to obtain a plurality of first enumeration objects; and generating a log creation operation tree according to the plurality of first enumeration objects, wherein the plurality of first enumeration objects are positioned at the bottom layer of the log creation operation tree.
In the above embodiment, the plurality of enumeration objects correspond to the plurality of creation nodes one to one, the initial log creation operation tree is a multi-level structure, and the plurality of creation nodes are located in different levels in the initial log creation operation tree. Binding the function and the enumeration object in the function set, namely binding the function and the creation node through the enumeration object, wherein the enumeration object bound with the function is only one part of a plurality of enumeration objects in the initial log creation operation tree, and the creation node corresponding to the enumeration object bound with the function is positioned at the bottommost layer of the initial log creation operation tree.
In some embodiments of the present application, the log creation operation tree obtaining module 702 may be specifically configured to: respectively obtaining a creating branch logic set corresponding to each function, wherein the creating branch logic set comprises at least one creating branch logic used for obtaining various function call information of different dimensions of the function; binding at least one creating branch logic corresponding to each function with the first enumeration object; extracting the same creating branch logic in the first enumeration object; binding the same creation branch logic upwards to one creation node, and binding the creation node with an enumeration object except the first enumeration object; and traversing at least one creating branch logic corresponding to each function respectively to generate the log creating operation tree.
In some embodiments of the present application, the node determining module 703 may be specifically configured to: analyzing the target annotation information to obtain creating branch logic call information corresponding to the target function; and determining a plurality of target creation nodes of different levels associated with the annotation function from the log creation operation tree according to the creation branch logic calling information.
Specifically, in some embodiments of the present application, the node determining module 703 may be specifically configured to: determining the position of an annotation function in a log creation operation tree according to the annotation information; and traversing the log creation operation tree from bottom to top to obtain a plurality of target creation nodes of different levels associated with the annotation function.
In some embodiments of the present application, the log creation module 704 may be specifically configured to: acquiring target creation branch logic in each target creation node according to the plurality of target creation nodes; according to the target creation branch logic, first log information for calling a target function is created, and the first log information includes a plurality of pieces of function call information of different dimensions.
In some embodiments of the present application, the log creating module 704 may further be specifically configured to: and analyzing the target annotation information to obtain an information processing logic set corresponding to the target function. Processing the annotation function by utilizing at least one information processing sub-logic to obtain a plurality of second log information with the same dimensionality of the annotation function; merging a plurality of second log information with the same dimensionality to obtain unique third log information with the same dimensionality, wherein the number of the third log information is multiple; and combining the plurality of third log information under different dimensions to obtain fourth log information.
The information processing logic set comprises a plurality of information processing logics for acquiring log information of different dimensions of an annotation function, and the information processing logics comprise at least one information processing sub-logic for acquiring the log information of the same dimension of the annotation function.
In some embodiments of the present application, the information processing logic may be multiple, and one preset information processing logic includes at least one information processing sub-logic to obtain the log information of the same dimension as the annotation function. Processing the annotation function by using at least one information processing sub-logic to obtain a plurality of second log information which is obtained by using different methods under the same dimension of the annotation function; and combining the second log information under the same dimension to obtain only one third log information under the same dimension. The third log information is a plurality of pieces of function call information under different dimensions of the annotation function. And combining the plurality of third log information with different dimensions to obtain fourth log information of function call.
The log creating module 704 may be further specifically configured to: and merging the plurality of first log information and the plurality of fourth log information to generate a log for calling the target function.
The present application further provides a server, which integrates any one of the training devices for character recognition models provided in the embodiments of the present application, as shown in fig. 8, which shows a schematic structural diagram of the server according to the embodiments of the present application, and specifically:
the server may include components such as a processor 801 of one or more processing cores, memory 802 of one or more computer-readable storage media, a power supply 803, and an input unit 804. Those skilled in the art will appreciate that the server architecture shown in FIG. 7 is not meant to be limiting, and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the processor 801 is a control center of the server, connects various parts of the entire server using various interfaces and lines, and performs various functions of the server and processes data by running or executing software programs and/or modules stored in the memory 802 and calling data stored in the memory 802, thereby performing overall monitoring of the server. Alternatively, processor 801 may include one or more processing cores; preferably, the processor 801 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 801.
The memory 802 may be used to store software programs and modules, and the processor 801 executes various functional applications and data processing by operating 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 program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to the use of the server, and the like. Further, the memory 802 may include high speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 802 may also include a memory controller to provide the processor 801 access to the memory 802.
The server further includes a power supply 803 for supplying power to the various components, and preferably, the power supply 803 may be logically connected to the processor 801 via a power management system, so that functions of managing charging, discharging, and power consumption are performed via the power management system. The power supply 803 may also include one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and any like components.
The server may further include an input unit 804, and the input unit 804 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the server may further include a display unit and the like, which will not be described in detail herein. Specifically, in this embodiment, the processor 801 in the server loads the executable file corresponding to the process of one or more application programs into the memory 802 according to the following instructions, and the processor 801 runs the application programs stored in the memory 802, thereby implementing various functions as follows:
and when the business system calls the target function, adding target annotation information in the target function to obtain an annotation function. The method comprises the steps of obtaining a preset log creation operation tree, wherein the log creation operation tree comprises a plurality of creation nodes located at different levels, each creation node comprises at least one creation branch logic for creating the log, and each creation branch logic is used for obtaining information of one dimension of an annotation function. In a log creation operation tree, a plurality of target creation nodes of different levels associated with annotation functions are determined. With create branch logic in the plurality of target create nodes, a log is created that calls the target function.
The present application also provides a computer-readable storage medium, which may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like. The storage medium stores a computer program, and the computer program is loaded by the processor to execute the steps in any log creation method provided by the embodiments of the present application. For example, the computer program may be loaded by a processor to perform the steps of:
and when the business system calls the target function, adding target annotation information in the target function to obtain an annotation function. The method comprises the steps of obtaining a preset log creation operation tree, wherein the log creation operation tree comprises a plurality of creation nodes located at different levels, each creation node comprises at least one creation branch logic for creating the log, and each creation branch logic is used for obtaining information of one dimension of an annotation function. In a log creation operation tree, a plurality of target creation nodes of different levels associated with annotation functions are determined. With create branch logic in the plurality of target create nodes, a log is created that calls the target function.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and parts that are not described in detail in a certain embodiment may refer to the above detailed descriptions of other embodiments, and are not described herein again.
In a specific implementation, each unit or structure may be implemented as an independent entity, or may be combined arbitrarily to be implemented as one or several entities, and the specific implementation of each unit or structure may refer to the foregoing method embodiment, which is not described herein again.
The log creating method, the log creating device, the log creating server and the log creating storage medium provided by the embodiment of the application are described in detail, a specific embodiment is applied in the description to explain the principle and the embodiment of the application, and the description of the embodiment is only used for helping to understand the method and the core idea of the application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A method of log creation, the method comprising:
when a business system calls a target function, adding target annotation information into the target function to obtain an annotation function;
acquiring a preset log creation operation tree, wherein the log creation operation tree comprises a plurality of creation nodes positioned at different levels, each creation node comprises at least one creation branch logic for creating a log, and each creation branch logic can be used for acquiring information of one dimension of the annotation function;
determining, in the log creation operation tree, a plurality of target creation nodes of different levels associated with the annotation function;
creating a log that calls the target function using the create branch logic in the plurality of target create nodes.
2. The log creation method of claim 1, wherein the obtaining of the preset log creation operation tree comprises:
acquiring an initial log creation operation tree, wherein the initial log creation operation tree comprises a plurality of enumeration objects, the enumeration objects correspond to the creation nodes one by one, the initial log creation operation tree is of a multi-level structure, and the creation nodes are located in different levels in the initial log creation operation tree;
acquiring a function set called by the service system;
generating a plurality of annotation information corresponding to each function in the function set one by one;
binding all the functions and the enumeration objects at the bottommost layer in the initial log creation operation tree respectively by using the annotation information to obtain a plurality of first enumeration objects;
and generating the log creation operation tree according to the plurality of first enumeration objects, wherein the plurality of first enumeration objects are positioned at the bottommost layer of the log creation operation tree.
3. The log creation method of claim 2, wherein generating the log creation operation tree based on the plurality of first enumeration objects comprises:
respectively obtaining a creating branch logic set corresponding to each function, wherein the creating branch logic set comprises at least one creating branch logic used for obtaining function call information of different dimensions of the function;
binding at least one creating branch logic corresponding to each function with the first enumeration object;
extracting the same creating branch logic in the first enumeration object;
binding the same creation branch logic upwards to one creation node, and binding the creation node with one enumeration object except the first enumeration object;
and traversing the at least one creating branch logic corresponding to each function to generate the log creating operation tree.
4. The method of claim 1, wherein said determining a plurality of target creation nodes of different levels associated with said annotation function in said log creation operation tree comprises:
analyzing the target annotation information to obtain created branch logic call information corresponding to the target function;
and determining a plurality of target creation nodes of different levels associated with the annotation function from the log creation operation tree according to the creation branch logic call information.
5. The log creation method of claim 4, wherein said determining a plurality of target creation nodes of different levels associated with said annotation function in said log creation operation tree comprises:
determining the position of the annotation function in the log creation operation tree according to the target annotation information;
and traversing the log creation operation tree from bottom to top to obtain a plurality of target creation nodes of different levels associated with the annotation function.
6. The log creation method of claim 5, wherein said creating a log that calls the target function using the create branch logic in the plurality of target creation nodes comprises:
acquiring target creation branch logic in each target creation node according to the plurality of target creation nodes;
and creating first log information for calling the target function according to the target creating branch logic, wherein the first log information comprises a plurality of pieces of function calling information with different dimensionalities.
7. The log creation method of claim 6, wherein the method further comprises: analyzing the target annotation information to obtain an information processing logic set of the target function, wherein the information processing logic set comprises a plurality of information processing logics for acquiring log information of different dimensions of the annotation function, and the information processing logics comprise at least one information processing sub-logic for acquiring the 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 with the same dimensionality of the annotation function;
merging the plurality of second log information with the same dimensionality to obtain unique third log information with the same dimensionality, wherein the number of the third log information is multiple;
and combining the plurality of third log information under different dimensions to obtain fourth log information.
8. The log creation method of claim 7, wherein the method further comprises:
and combining the plurality of first log information and the plurality of fourth log information to generate a log for calling the target function.
9. An apparatus for creating a log, the apparatus comprising:
the function calling module is used for adding target annotation information into a target function to obtain an annotation function when the service system calls the target function;
the annotation function comprises a log creation operation tree acquisition module, a log creation operation tree acquisition module and a data processing module, wherein the log creation operation tree acquisition module is used for acquiring a preset log creation operation tree, the log creation operation tree comprises a plurality of creation nodes positioned at different levels, each creation node comprises at least one creation branch logic for creating a log, and each creation branch logic can be used for acquiring function call information of one dimension of the annotation function;
a node determination module to determine a plurality of target creation nodes of different hierarchies associated with the annotation function in the log creation operation tree;
a log creation module to create a log that calls the target function using the create branch logic in the plurality of target create nodes.
10. A computer-readable storage medium, having stored thereon a computer program which is loaded by a processor to perform the steps of the log creation method of any one of claims 1 to 8.
CN202010855614.3A 2020-08-24 2020-08-24 Log creating method and device and storage medium Pending CN114090506A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010855614.3A CN114090506A (en) 2020-08-24 2020-08-24 Log creating method and device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010855614.3A CN114090506A (en) 2020-08-24 2020-08-24 Log creating method and device and storage medium

Publications (1)

Publication Number Publication Date
CN114090506A true CN114090506A (en) 2022-02-25

Family

ID=80295490

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010855614.3A Pending CN114090506A (en) 2020-08-24 2020-08-24 Log creating method and device and storage medium

Country Status (1)

Country Link
CN (1) CN114090506A (en)

Similar Documents

Publication Publication Date Title
CN110795257A (en) Method, device and equipment for processing multi-cluster operation records and storage medium
US11036608B2 (en) Identifying differences in resource usage across different versions of a software application
CN106294151B (en) Log test method and device
US11704114B2 (en) Data structures for managing configuration versions of cloud-based applications
CN108427728A (en) Management method, equipment and the computer-readable medium of metadata
CN110795091B (en) Modularized route decoupling method, storage medium, electronic equipment and system
CN112970011B (en) Pedigree in record query optimization
CN115827436A (en) Data processing method, device, equipment and storage medium
CN103503388B (en) A kind of distributed queue's message read method and equipment, system
CN112860412B (en) Service data processing method and device, electronic equipment and storage medium
CN111124883B (en) Test case library introduction method, system and equipment based on tree form
CN115098297B (en) Consistent snapshot generation method and system for cloud primary storage data volume
CN114090506A (en) Log creating method and device and storage medium
CN115578096A (en) Block chain parallel transaction method, device, equipment and storage medium
CN112988278B (en) Meta file modification method and device of resource file, electronic equipment and storage medium
CN113190236B (en) HQL script verification method and device
CN113760822A (en) HDFS-based distributed intelligent campus file management system optimization method and device
CN112269677A (en) Rollback operation device, method, equipment and medium under heterogeneous cloud platform
CN111680036A (en) Method and device for realizing configuration management library based on graph storage
CN110968467A (en) Remote automatic test method for GPU and algorithm
CN112181407A (en) Service implementation processing method, device, system, electronic equipment and storage medium
TWI765447B (en) Decoupling method and system for decomposing services
CN116303317A (en) Log processing method and device for lua program interface and computer equipment
CN115168124A (en) Stability test method and device for concurrently executing multiple files on hard disk, computer equipment and medium
CN114461572A (en) Metadata collection method and device for distributed file system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination