Log generation method and apparatus, server, and storage medium

By generating and presenting target logs through collaborative operation between terminal devices and servers, the issues of log output format flexibility and data security are resolved, the efficiency of locating and investigating log information is improved, and flexible log output and secure log presentation are achieved.

CN114840379BActive Publication Date: 2025-12-16CITIC AIBANK CORPORATION LIMITED
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210410136.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-19
Publication Date
2025-12-16
Estimated Expiration
2042-04-19

AI Technical Summary

Technical Problem

Existing technologies are insufficient to flexibly meet the log output format requirements of different business types, and log data security is difficult to guarantee, especially when locating and troubleshooting the causes of event anomalies or failures.

Method used

The terminal device initiates a log output request for the target event to the server. The server obtains the business type information and content information, determines the log assembly rules, generates and sends the target log for the terminal device to display or store. It supports flexible configuration of business fields and data processing methods to achieve desensitization of log information.

Benefits of technology

It enables flexible handling of log output format requirements for different business types, ensures data security, and improves the efficiency of locating and troubleshooting log information, especially when presenting the reasons for event anomalies or failures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114840379B_ABST
    Figure CN114840379B_ABST
Patent Text Reader

Abstract

The present disclosure provides a log generation method and device, a server, a storage medium and a log processing system. The system initiates a target log output request corresponding to a target event to a server by a terminal device. The server acquires service type information and service content information of the target event in response to receiving the target log output request sent by the terminal device, determines a log assembly rule corresponding to the service type information, and generates a target log corresponding to the target event according to the log assembly rule and the service content information for the terminal device to present. The system can flexibly cope with the demand of different service types for log output format.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer, in particular to a log generation method and device, a server and a storage medium. BACKGROUND

[0002] A log is a data file used to record user operations, device running states and other parameters, which can be used by relevant personnel to understand the running states of devices and business processing states. With the continuous running of devices, a large amount of log data is often generated. Various analysis and processing of log data is a common way to obtain effective information. SUMMARY

[0003] The present disclosure provides a log generation method and device, a server and a storage medium.

[0004] In a first aspect, the present disclosure provides a log generation method applied to a server, comprising:

[0005] In response to receiving a target log output request corresponding to a target event sent by a terminal device, obtaining business type information and business content information of the target event, the output request being generated by the terminal device in response to detecting a log output operation input by a user, the target log being used to record the target event;

[0006] Determining a log assembly rule corresponding to the business type information;

[0007] Generating a target log corresponding to the target event according to the log assembly rule and the business content information;

[0008] Sending the generated target log to the terminal device for presenting or storing the received target log by the terminal device.

[0009] In some optional embodiments, the log assembly rule comprises a plurality of business fields and assembly orders, path information, data processing manners, prefix information and suffix information corresponding to each business field, the business fields comprise event exception / failure reasons, the business fields are associated with the business type information, and the data processing manners are associated with the types of the business fields.

[0010] In some optional embodiments, the generating a target log corresponding to the target event according to the log assembly rule and the business content information comprises:

[0011] Obtaining log element data corresponding to each business field from the business content information according to the path information, generating the target log by combining each log element data according to the corresponding data processing manner and assembly order, and combining the corresponding prefix information and suffix information.

[0012] In a second aspect, the present disclosure provides a log generation apparatus applied to a server, comprising:

[0013] An acquisition unit configured to acquire service type information and service content information of a target event in response to receiving a target log output request sent by a terminal device, the output request being generated by the terminal device in response to detecting a log output operation input by a user, the target log being used to record the target event;

[0014] A determination unit configured to determine a log assembly rule corresponding to the service type information;

[0015] A generation unit configured to generate a target log corresponding to the target event according to the log assembly rule and the service content information;

[0016] A first sending unit configured to send the generated target log to the terminal device for presenting or storing the received target log.

[0017] In some optional embodiments, the first sending unit 504 is further configured to acquire log element data corresponding to respective service fields from the service content information according to the path information, and generate a target log by combining respective prefix information and suffix information according to the respective data processing manners and assembly orders of the log element data.

[0018] In a third aspect, the present disclosure provides a log presentation method applied to a terminal device, comprising:

[0019] In response to detecting a log output operation input by a user, sending a target log output request to a server, the target log being used to record a target event;

[0020] In response to receiving a target log sent by the server, presenting or storing the received target log, the target log being generated by the server according to a log assembly rule and service content information, the log assembly rule being determined by the server according to service type information, the service type information and the service content information being acquired by the server in response to receiving the target log output request and corresponding to the target event.

[0021] In a fourth aspect, the present disclosure provides a log presentation apparatus applied to a terminal device, comprising:

[0022] A second sending unit configured to send a target log output request to a server in response to detecting a log output operation input by a user, the target log being used to record a target event;

[0023] The presentation unit is configured to present or store the received target log in response to receiving the target log sent by the server, the target log being generated by the server according to a log assembly rule and service content information, the log assembly rule being determined by the server according to service type information, and the service type information and the service content information being acquired by the server in response to receiving a target log output request and corresponding to the target time.

[0024] In a fifth aspect, an embodiment of the present disclosure provides a server, comprising: one or more processors; and a storage device having one or more programs stored thereon, when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation manner of the first aspect.

[0025] In a sixth aspect, an embodiment of the present disclosure provides a terminal device, comprising: one or more processors; and a storage device having one or more programs stored thereon, when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation manner of the second aspect.

[0026] In a seventh aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is executed by one or more processors to implement the method described in any implementation manner of the first aspect and / or the method described in any implementation manner of the second aspect.

[0027] In an eighth aspect, an embodiment of the present disclosure provides a log processing system, comprising the server described in any implementation manner of the fifth aspect and the terminal device described in any implementation manner of the sixth aspect.

[0028] The present disclosure provides a log generation method, device, server, storage medium and log processing system. The system initiates a target log output request corresponding to a target event from a terminal device to a server. The server acquires service type information and service content information of the target event in response to receiving the target log output request sent by the terminal device, determines a log assembly rule corresponding to the service type information, and generates a target log corresponding to the target event according to the log assembly rule and the service content information for the terminal device to present. The technical effects include but are not limited to:

[0029] 1. The system can flexibly cope with the demand of different service types for log output format.

[0030] 2. The output log information is desensitized, effectively ensuring data security.

[0031] 3. The service field can be configured in the log assembly rule according to the demand in advance.

[0032] 4. The event exception / failure reason service field can be pre-configured, so that the output log presents the event exception / failure reason, which can facilitate the user to quickly locate and troubleshoot. BRIEF DESCRIPTION OF DRAWINGS

[0033] Other features, objects, and advantages of the present disclosure will become more apparent from the following detailed description of non-limiting embodiments with reference to the attached drawings:

[0034] Figure 1 is an exemplary system architecture diagram to which one embodiment of the present disclosure can be applied;

[0035] Figure 2 is a timing diagram of one embodiment of a log processing system according to the present disclosure;

[0036] Figure 2A is a schematic diagram of one example of a log assembly rule;

[0037] Figure 2B is a schematic diagram of another example of a log assembly rule;

[0038] Figure 3 is a flowchart of one embodiment of a log generation method according to the present disclosure;

[0039] Figure 4 is a flowchart of one embodiment of a log presentation method according to the present disclosure;

[0040] Figure 5 is a structural schematic diagram of one embodiment of a log generation apparatus according to the present disclosure;

[0041] Figure 6 is a structural schematic diagram of one embodiment of a log presentation apparatus according to the present disclosure;

[0042] Figure 7 is a structural schematic diagram of a computer system of an electronic device (server or terminal device) suitable for implementing the present disclosure. DETAILED DESCRIPTION

[0043] The present disclosure will be described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are intended to be illustrative only and not limiting of the present disclosure. In addition, it should be noted that for ease of description, only the parts related to the present disclosure are shown in the drawings.

[0044] It should be noted that the embodiments in the present disclosure and the features in the embodiments can be combined with each other without conflict. The present disclosure will be described in further detail below with reference to the accompanying drawings and embodiments.

[0045] Figure 1 An exemplary system architecture 100 is shown, in which one embodiment of the log processing system of the present disclosure can be applied.

[0046] As shown in Figure 1 The log processing system 100 can include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is a medium for providing a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 can include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.

[0047] The users can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 101, 102, 103, such as log output type applications, log processing type applications, web browser applications, search type applications, instant messaging tools, email clients, social platform software, etc.

[0048] The terminal devices 101, 102, 103 can be hardware or software. When the terminal devices 101, 102, 103 are hardware, they can be various electronic devices with display screens and support for sound collection and / or video collection, including but not limited to smartphones, tablet computers, e-book readers, laptop computers, and desktop computers, etc. When the terminal devices 101, 102, 103 are software, they can be installed in the above-mentioned electronic devices. They can be implemented as multiple software or software modules (for example, to provide distributed services), or as a single software or software module. No specific limitation is made herein.

[0049] The server 105 can be a server that provides various services, such as a background server that provides support for log output type applications displayed on the terminal devices 101, 102, 103. The background server can analyze and process received log output requests and other data, and feed back the processing results to the terminal devices.

[0050] It should be noted that the server 105 can be hardware or software. When the server 105 is hardware, it can be implemented as a distributed server cluster composed of multiple servers, or as a single server. When the server is software, it can be implemented as multiple software or software modules (for example, to provide distributed services), or as a single software or software module. No specific limitation is made herein.

[0051] It should be noted that the log generation method applied to the server provided by the present disclosure is generally executed by the server 105, and correspondingly, the log generation device applied to the server is generally arranged in the server 105.

[0052] It should be noted that the log presentation method applied to the terminal device provided by the present disclosure is generally executed by the terminal device 101, 102, 103, and correspondingly, the log presentation device applied to the terminal device is generally arranged in the terminal device 101, 102, 103.

[0053] It should be understood that Figure 1 The number of terminal devices, networks and servers in

[0054] It should be understood that Figure 1 The number of terminal devices, networks and servers in

[0055] With reference to Figure 2 , a timing diagram of one embodiment of the log processing system of the present disclosure is shown. The log processing system in the embodiment of the present disclosure can include a terminal device and a server. The timing diagram 200 includes the following steps:

[0056] Step 201, the terminal device sends a target log output request to the server in response to detecting a user input log output operation.

[0057] Here, the target log is used to record a target event. The log record corresponding to the target event includes the time when the target event occurs and the event content of the target event. The target event can include, etc.

[0058] In this embodiment, the terminal device (for example Figure 1 The terminal device 101, 102, 103 shown in the figure) can generate a target log output request based on the output statement corresponding to the log output operation in the case of detecting the user input log output operation. The terminal device can send the generated target log output request to the server.

[0059] For example, the target log output request includes output statement information and execution parameters. The output statement information can be the identification of the output statement, and the execution parameters can be the username, user identification or user account, etc. in the target event.

[0060] Here, the log output operation can be various preset operations that can trigger the output of the target log related to the output statement.

[0061] For example, the log output operation can be that the user inputs an output sentence in a search box and clicks a log output operation display object (such as a preset log output button, icon, or specified key on a keyboard).

[0062] At step 202, the server acquires service type information and service content information of the target event in response to receiving the target log output request sent by the terminal device.

[0063] In this embodiment, the server (for example, the server 105 shown in FIG. 1) can acquire service type information and service content information of the target event recorded by the target log in the case of receiving the target log output request sent by the terminal device. Here, the service type information of the target event can be used to represent the service type of the target event. The service type information can be a service type name or a service type identifier, for example, can be user login, user logout, and the like. The service content information can include the time when the target event occurs and the event content of the target event. Figure 1

[0064] In one embodiment, the service type information can include transaction service type information, for example, transfer and remittance, and the like.

[0065] At step 203, the server determines a log assembly rule corresponding to the service type information.

[0066] In this embodiment, the server can determine the log assembly rule corresponding to the service type information of the target event according to the correspondence between the preset service type information and the log assembly rule. That is, the corresponding log assembly rule can be set in advance for different service type information.

[0067] Here, the log assembly rule can include a plurality of service fields and assembly order, path information, data processing mode, prefix information, and suffix information corresponding to each service field.

[0068] The service field can be preset. The service field can be used to identify the meaning and category of the log element data to be acquired. The service field can also be referred to as an attribute. The service field can be associated with the service type information. For example, when the service type information is transfer, the service field can include fields such as user name, user account initiating the transfer, user account receiving the transfer, and the like.

[0069] The assembly order can be used to represent the arrangement order of the log element data corresponding to the service field in the output log.

[0070] The path information can be used to represent the acquisition path position information of the log element data corresponding to the service field, for example, 1, 2, and the like. ​

[0071] The data processing manner can be used to represent a processing manner of the log element data corresponding to the business field, such as splicing, cropping, desensitization, conversion, etc. The data processing manner is associated with the type of the business field. For example, when the type of the business field is an account, the corresponding data processing manner is desensitization and splicing.

[0072] Figure 2A is a schematic diagram of an example of the log assembly rule. Specifically, the log assembly rule corresponding to the business type information of transfer.

[0073] In an embodiment, the business field can further include an event exception / failure reason.

[0074] Figure 2B is a schematic diagram of another example of the log assembly rule. Specifically, the log assembly rule corresponding to the business type information of transfer, in which the business field includes an event exception / failure reason (reason).

[0075] In step 204, the server generates a target log corresponding to the target event according to the log assembly rule and the business content information.

[0076] In this embodiment, the server can generate a target log corresponding to the target event based on the business content information obtained in step 202 according to the log assembly rule determined in step 203.

[0077] In an embodiment, the server can obtain log element data corresponding to the business field according to the path information from the business content information, and generate the target log by combining the log element data according to the corresponding data processing manner and assembly order, and combining the corresponding prefix information and suffix information.

[0078] For example, the target log can be "User Zhang San (6228****19) transferred 100.00 yuan to Li Si's account (6227****01) through the mobile banking app at 11:00:00 on January 14, 2022 (Friday) in the morning, and the operation was successful."

[0079] For example, the target log can be "User Zhang San (6228****19) transferred 100.00 yuan to Li Si's account (6227****01) through the mobile banking app at 11:00:00 on January 14, 2022 (Friday) in the morning, and the operation failed. Failure reason: timeout."

[0080] In step 205, the server sends the generated target log to the terminal device.

[0081] In this embodiment, the server can send the target log generated in step 205 to the terminal device.

[0082] Step 206, the terminal device presents or stores the received target log.

[0083] In this embodiment, the terminal device can present the target log received from the server in various implementation manners in the case that the terminal device receives the target log returned by the server in response to the log output request sent to the server in step 201.

[0084] The log generation system provided by the above embodiments of the present disclosure can be implemented as follows: the terminal device initiates a target log output request corresponding to a target event to the server; the server, in response to receiving the target log output request sent by the terminal device, acquires service type information and service content information of the target event, determines a log assembly rule corresponding to the service type information, and generates the target log corresponding to the target event according to the log assembly rule and the service content information for the terminal device to present.

[0085] 1. The system can flexibly cope with the requirements of different service types for log output formats.

[0086] 2. The output log information is desensitized, and the data security is effectively ensured.

[0087] 3. The service fields can be configured in the log assembly rule in advance according to requirements.

[0088] 4. The event exception / failure reason service field can be configured in advance, so that the output log presents the event exception / failure reason, and the user can quickly locate and troubleshoot.

[0089] Further reference Figure 3 , which shows a flowchart of one embodiment of a log generation method. The flow 300 of the log generation method is applied to a server and includes the following steps:

[0090] Step 301, in response to receiving a target log output request corresponding to a target event sent by a terminal device, acquiring service type information and service content information of the target event.

[0091] In this embodiment, the specific operation of step 301 and the technical effects produced thereby are basically the same as those of step 202 in the embodiment shown in Figure 2 , and will not be repeated here.

[0092] Step 302, determining a log assembly rule corresponding to the service type information.

[0093] In this embodiment, the specific operation of step 302 and the technical effects produced thereby are basically the same as those of step 202 in the embodiment shown in Figure 2The operation and effect of step 203 in the embodiment shown are basically the same, and will not be repeated here.

[0094] Step 303, according to the log assembly rule and the service content information, generates a target log corresponding to the target event.

[0095] In this embodiment, the specific operation of step 303 and the technical effects produced thereby are basically the same as those of step 203 in the embodiment shown above, and will not be repeated here. Figure 2 The operation and effect of step 204 in the embodiment shown are basically the same, and will not be repeated here.

[0096] Step 304, sending the generated target log to the terminal device for the terminal device to present or store the received target log.

[0097] In this embodiment, the specific operation of step 304 and the technical effects produced thereby are basically the same as those of step 203 in the embodiment shown above, and will not be repeated here. Figure 2 The operation and effect of step 205 in the embodiment shown are basically the same, and will not be repeated here.

[0098] Further referring to Figure 4 , which shows a flowchart of one embodiment of a log presentation method. The flowchart 400 of the log presentation method is applied to a terminal device, and includes the following steps:

[0099] Step 401, in response to detecting a log output operation input by a user, sending a target log output request to a server.

[0100] Step 402, in response to receiving a target log sent by the server, presenting or storing the received target log.

[0101] Further referring to Figure 5 , as an implementation of the method shown in the above figures, the present disclosure provides one embodiment of a log generation device. The device embodiment corresponds to the method embodiment shown in Figure 3 , and the device can be specifically applied to various electronic devices.

[0102] As Figure 5As shown, the log generation apparatus 500 in this embodiment includes an acquisition unit 501, a determination unit 502, a generation unit 503, and a first sending unit 504. The acquisition unit 501 is configured to, in response to receiving a target log output request sent by a terminal device, acquire service type information and service content information of a target event, the output request being generated by the terminal device in response to detecting a log output operation input by a user, the target log being used to record the target event. The determination unit 502 is configured to determine a log assembly rule corresponding to the service type information. The generation unit 503 is configured to generate a target log corresponding to the target event according to the log assembly rule and the service content information. The first sending unit 504 is configured to send the generated target log to the terminal device for the terminal device to present or store the received target log.

[0103] In some optional implementations, the first sending unit 504 can be further configured to acquire log element data corresponding to respective service fields according to the path information from the service content information, and generate the target log by combining respective prefix information and suffix information according to the respective log element data, the respective data processing manners, and the assembly order.

[0104] In this embodiment, the specific processes of the acquisition unit 501, the determination unit 502, the generation unit 503, and the first sending unit 504 of the log generation apparatus 500 and the technical effects brought by the specific processes can be respectively referred to the related descriptions of steps 301, 302, 303, and 304 in the corresponding embodiment. Figure 3 The related descriptions of steps 301, 302, 303, and 304 in the corresponding embodiment will not be repeated here.

[0105] It should be noted that the implementation details and technical effects of each unit in the log generation apparatus provided by the present disclosure can be referred to the descriptions of other embodiments in the present disclosure, and will not be repeated here.

[0106] Further reference Figure 6 , as an implementation of the method shown in the above figures, the present disclosure provides an embodiment of a log presentation apparatus, which corresponds to the method embodiment shown in Figure 4 , and the apparatus can be specifically applied in various electronic devices.

[0107] As Figure 6As shown, the log presentation device 600 in this embodiment includes a second sending unit 601 and a presentation unit 602. The second sending unit 601 is configured to send a target log output request to a server in response to detecting a log output operation input by a user, the target log being used to record a target event; the presentation unit 602 is configured to present or store the received target log in response to receiving the target log sent by the server, the target log being generated by the server according to a log assembly rule and service content information, the log assembly rule being determined by the server according to service type information, and the service type information and the service content information being acquired by the server in response to receiving the target log output request and corresponding to the target time.

[0108] In this embodiment, the specific processing of the second sending unit 601 and the presentation unit 602 of the log presentation device 600 and the technical effects brought by the specific processing can be referred to the related descriptions of steps 401 and 402 in the corresponding embodiment, which will not be repeated here. Figure 4 The related descriptions of steps 401 and 402 in the corresponding embodiment will not be repeated here.

[0109] It should be noted that the implementation details and technical effects of each unit in the log presentation device provided by the present disclosure can be referred to the descriptions of other embodiments in the present disclosure, which will not be repeated here.

[0110] The following will be described with reference to Figure 7 which shows a structural schematic diagram of a computer system 700 suitable for implementing an electronic device of the present disclosure. Figure 7 The electronic device (server or user terminal) shown is only an example and should not impose any limitation on the functions and use range of the present disclosure.

[0111] As shown in Figure 7 , the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 702 or programs loaded from a storage portion 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0112] The following components are connected to the I / O interface 705: an input section 706 including input devices such as a touch panel, a handwriting panel, a keyboard, or a mouse; an output section 707 including output devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 708 including a hard disk; and a communication section 709 including a network interface card such as a LAN (Local Area Network) card, a modem, and the like. The communication section 709 performs communication processing via a network such as the Internet.

[0113] In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program code for executing the methods illustrated by the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network by the communication section 709. When the computer program is executed by the central processing unit (CPU) 701, the above-described functions defined in the methods of the present disclosure are performed. It should be noted that the computer readable medium of the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable storage medium may, for example, be but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any suitable combination of the foregoing. More specific examples of the computer readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, the computer readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus or device. In the present disclosure, the computer readable signal medium can include a data signal that is propagated in baseband or as part of a carrier wave, in which the computer readable program code is carried. Such a propagated data signal can take any of a variety of forms, including but not limited to electro-magnetic, optical, or any suitable combination of the foregoing. The computer readable signal medium can also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate or transport a program for use by or in connection with an instruction execution system, apparatus or device. The program code contained on the computer readable medium can be transmitted by any suitable medium, including but not limited to wireless, wire line, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0114] Computer program code for carrying out operations of the present disclosure can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++, Python, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0115] The flow diagrams and the block diagrams in the drawings are illustrations of architectures, functionalities, and operations of possible implementations of systems, methods, and computer program products according to various embodiments of present disclosure. In this regard, each block in the flow diagrams or block diagrams can represent a module, a procedure, or a part of code, which comprises one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or in the reverse order, depending on the functionality involved. It is also noted that each block of the block diagrams and / or flow diagrams and combinations of blocks in the block diagrams and / or flow diagrams can be implemented by a dedicated hardware-based system that carries out specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0116] The units described in the present disclosure can be implemented by software, or by hardware. The described units can also be implemented by a processor, for example, a processor can be described as: a processor includes an obtaining unit, a determining unit, a generating unit, and a first sending unit. In some cases, the names of the units do not constitute a limitation on the units themselves, for example, the obtaining unit can also be described as: a unit that "obtains the service type information and the service content information of the target event in response to receiving the target log output request sent by the terminal device". For another example, a processor can be described as: a processor includes a second sending unit and a presenting unit.

[0117] As another aspect, the present disclosure also provides a computer readable medium, which can be included in the apparatus described in the above embodiments, or exist independently without being assembled into the apparatus. The computer readable medium carries one or more programs, which, when executed by the apparatus, cause the apparatus to implement the above method. Figure 3 the log generation method shown, and / or Figure 4 the log presentation method shown.

[0118] The above description is merely illustrative of the exemplary embodiments of the present disclosure and the principles of the technology employed. It should be understood by those skilled in the art that the scope of the present disclosure is not limited to the technical solutions formed by the specific combinations of the above technical features, and should also cover other technical solutions formed by the combinations of the above technical features or equivalent features without departing from the above inventive concept. For example, the above features can be replaced with the technical features disclosed in the present disclosure (but not limited to) having similar functions to form technical solutions.

Claims

1. A log generation method, applied to a server, comprising: In response to receiving a target log output request corresponding to a target event sent by a terminal device, the service type information and service content information of the target event are obtained. The output request is generated by the terminal device in response to detecting a log output operation input by the user. The target log is used to record the target event. The service type information is a service type name or service type identifier. The service content information includes the time when the target event was generated and the event content of the target event. Determine the log assembly rules corresponding to the aforementioned business type information; Based on the log assembly rules and the business content information, a target log corresponding to the target event is generated; The generated target log is sent to the terminal device so that the terminal device can present or store the received target log; The log assembly rules include multiple business fields and their corresponding assembly order, path information, data processing method, prefix information, and suffix information. The business fields include event exception / failure reasons. The business fields are associated with the business type information, and the data processing method is associated with the type of the business field. The business field is pre-defined and associated with business type information; the assembly order is used to characterize the arrangement order of the log element data corresponding to the business field in the output log; the path information is used to characterize the acquisition path location information of the log element data corresponding to the business field; the data processing method is used to characterize the processing method of the log element data corresponding to the business field and is associated with the type of the business field. The step of generating a target log corresponding to the target event based on the log assembly rules and the business content information includes: The log element data corresponding to the business field is obtained from the business content information according to the path information. The log element data is processed according to the corresponding data processing method and assembly order, and combined with the corresponding prefix information and suffix information to generate the target log.

2. A log generation device, applied to a server, comprising: The acquisition unit is configured to acquire the service type information and service content information of the target event in response to receiving a target log output request sent by the terminal device. The output request is generated by the terminal device in response to detecting a log output operation input by the user. The target log is used to record the target event. The service type information is a service type name or service type identifier. The service content information includes the time when the target event occurred and the event content of the target event. The determining unit is configured to determine the log assembly rule corresponding to the business type information; The generation unit is configured to generate a target log corresponding to the target event based on the log assembly rules and the business content information; The first sending unit is configured to send the generated target log to the terminal device so that the terminal device can present or store the received target log. The log assembly rules include multiple business fields and their corresponding assembly order, path information, data processing method, prefix information, and suffix information. The business fields include event exception / failure reasons. The business fields are associated with the business type information, and the data processing method is associated with the type of the business field. The business field is pre-defined and associated with business type information; the assembly order is used to characterize the arrangement order of the log element data corresponding to the business field in the output log; the path information is used to characterize the acquisition path location information of the log element data corresponding to the business field; the data processing method is used to characterize the processing method of the log element data corresponding to the business field and is associated with the type of the business field. The step of generating a target log corresponding to the target event based on the log assembly rules and the business content information includes: The log element data corresponding to the business field is obtained from the business content information according to the path information. The log element data is processed according to the corresponding data processing method and assembly order, and combined with the corresponding prefix information and suffix information to generate the target log.

3. A server, comprising: One or more processors; A storage device on which one or more programs are stored; When the one or more programs are executed by the one or more processors, the one or more processors implement the log generation method as described in claim 1.

4. A computer-readable medium having a computer program stored thereon, wherein, When the computer program is executed by one or more processors, it implements the log generation method as described in claim 1.

5. A log processing system, comprising the server as described in claim 3 and at least one terminal device.

Citation Information

Patent Citations

  • Log monitoring method and device, computer equipment and storage medium

    CN110134658A

  • Log desensitization method, device and equipment and computer readable storage medium

    CN111651784A