CN112597119A - Method and device for generating processing log and storage medium - Google Patents

Method and device for generating processing log and storage medium Download PDF

Info

Publication number
CN112597119A
CN112597119A CN202011363082.8A CN202011363082A CN112597119A CN 112597119 A CN112597119 A CN 112597119A CN 202011363082 A CN202011363082 A CN 202011363082A CN 112597119 A CN112597119 A CN 112597119A
Authority
CN
China
Prior art keywords
processing
information
middleware program
request information
data
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.)
Withdrawn
Application number
CN202011363082.8A
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.)
LCFC Hefei Electronics Technology Co Ltd
Original Assignee
LCFC Hefei Electronics 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 LCFC Hefei Electronics Technology Co Ltd filed Critical LCFC Hefei Electronics Technology Co Ltd
Priority to CN202011363082.8A priority Critical patent/CN112597119A/en
Publication of CN112597119A publication Critical patent/CN112597119A/en
Withdrawn 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/18File system types
    • G06F16/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file systems
    • 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

Abstract

The invention discloses a method, a device and a storage medium for generating a processing log, wherein the method comprises the following steps: when request information sent by a user terminal is received, a middleware program is operated, the request information is read by the middleware program to obtain first data, the first data is recorded in the middleware program, the request information is processed to obtain processing information corresponding to the request information, the processing information is recorded in the middleware program, and the first data and the processing information in the middleware program are output to obtain a first processing log corresponding to the request information. In the invention, when the server receives a request message sent by the user terminal, a middleware program can be correspondingly operated, and the first data and the processing message corresponding to the request message are cached in the middleware program and then output, so that the first processing log corresponding to the request message generated in the way is independent and sequential, and cannot be mixed with other processing logs corresponding to other request messages.

Description

Method and device for generating processing log and storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a method and an apparatus for generating a processing log, and a storage medium.
Background
With the continuous development of network technology, users have been able to obtain various services through the internet using user terminals. When a user obtains a service through the internet, it is generally necessary to send request information to a server using a user terminal. On the server side, when the request information is highly concurrent, the server needs to process a plurality of request information at the same time. Because a plurality of processing logs generated during processing of a plurality of request information are recorded together and stacked according to the order of the received processing logs during recording, the processing logs corresponding to the request information are mixed with each other, and the difficulty in subsequently inquiring the processing logs and arranging errors according to the processing logs can be caused.
At present, the query of the processing log is generally realized by an analysis query program, and the analysis query program can query the processing log based on the keywords input by the user. However, since a plurality of processing logs are recorded together and mixed with each other, it is difficult to find a complete processing log when the processing log is searched by a keyword. Therefore, how to implement the recording and sorting of the processing log so as to reduce the difficulty in querying the processing log subsequently is a problem which needs to be solved urgently.
Content of application
The embodiment of the application provides a method and a device for generating a processing log and a storage medium, so as to solve the problem that in the prior art, due to the fact that a plurality of processing logs are recorded together and mixed with each other when being recorded, when the processing log is queried through a keyword, the complete processing log is difficult to find.
In order to solve the above problem, in a first aspect, an embodiment of the present invention provides a method for generating a processing log, which is used at a server side, and includes: when request information sent by a user terminal is received, operating a middleware program; reading the request information by adopting a middleware program to obtain first data; recording first data in a middleware program; processing the request information to obtain processing information corresponding to the request information; recording the processing information in the middleware program; and outputting the first data and the processing information in the middleware program to obtain a first processing log corresponding to the request information.
Optionally, when running a middleware program, the method for generating the processing log further includes: identifying the request information to obtain identification information; and identifying the middleware program according to the identification information.
Optionally, the processing information includes identification information, and the recording of the processing information in the middleware program includes: the processing information is recorded in the middleware program based on the identification information.
Optionally, the middleware program includes a stack, and the recording of the first data in the middleware program includes: the first data is recorded in the stack of the middleware program.
Optionally, the recording of the processing information in the middleware program includes: the processing information is recorded in the stack of the middleware program.
Optionally, the method for generating a processing log further includes: responding the request information to obtain response information; recording response information in the middleware program; and outputting the first data, the processing information and the response information in the middleware program to obtain a second processing log corresponding to the request information.
Optionally, the method for generating a processing log further includes: the middleware program is deleted.
In a second aspect, an embodiment of the present invention provides a generation apparatus for processing a log, where the generation apparatus is used at a server side, and includes: a receiving unit, for operating a middleware program when receiving the request information sent by the user terminal; the reading unit is used for reading the request information by adopting a middleware program to obtain first data; a first recording unit configured to record first data in the middleware program; the processing unit is used for processing the request information to obtain processing information corresponding to the request information; a second recording unit for recording the processing information in the middleware program; and the output unit is used for outputting the first data and the processing information in the middleware program to obtain a first processing log corresponding to the request information.
In a third aspect, an embodiment of the present invention provides a computer, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executable by the at least one processor to cause the at least one processor to perform a method of generating a processing log as in the first aspect or any of the embodiments of the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where computer instructions are stored, and the computer instructions are configured to cause a computer to execute a method for generating a processing log as in the first aspect or any implementation manner of the first aspect.
According to the method, the device and the storage medium for generating the processing log provided by the embodiment of the invention, when request information sent by a user terminal is received, a middleware program is operated to read the request information by adopting the middleware program to obtain first data, the first data is recorded in the middleware program and is processed to obtain processing information corresponding to the request information, the processing information is recorded in the middleware program, the first data and the processing information in the middleware program are output to obtain the first processing log corresponding to the request information, so that when a server receives the request information sent by the user terminal, the middleware program can be correspondingly operated, the first data and the processing information corresponding to the request information are cached in the middleware program and are output, and the first processing log corresponding to the request information generated in the way is independent, And sequentially, the first processing log corresponding to the request information is not mixed with other processing logs corresponding to other request information, so that when a user queries the first processing log corresponding to the request information by inputting a keyword, the complete and ordered first processing log can be queried.
The foregoing description is only an overview of the technical solutions of the present application, and the present application can be implemented according to the content of the description in order to make the technical means of the present application more clearly understood, and the following detailed description of the present application is given in order to make the above and other objects, features, and advantages of the present application more clearly understandable.
Drawings
FIG. 1 is a schematic flow chart illustrating a method for generating a processing log according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of an apparatus for generating a processing log according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a hardware structure of a computer according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. 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 invention.
An embodiment of the present invention provides a method for generating a processing log, which is used at a server side, and as shown in fig. 1, the method includes:
s101, when request information sent by a user terminal is received, operating a middleware program; specifically, when request information sent by the user terminal is received, a middleware program is correspondingly operated, so that the middleware program can be used for caching various information before the request information is responded.
S102, reading request information by adopting a middleware program to obtain first data; specifically, before processing the request information, a middleware program may be used to read the request information to obtain first data in the request information, where the first data may include a request initiation time, a request path, a request header, a request body, and the like.
S103, recording first data in a middleware program; specifically, after the first data is obtained, the first data may be recorded in the middleware program.
S104, processing the request information to obtain processing information corresponding to the request information; specifically, the request processing program may be used to process the request information, and the log recording program may be used to record the processing information generated in the request information processing process, so as to obtain the processing information corresponding to the request information.
S105, recording processing information in the middleware program; specifically, the logging program may give the processing information corresponding to the request information to the middleware program, and the middleware program may record the processing information.
And S106, outputting the first data and the processing information in the middleware program to obtain a first processing log corresponding to the request information. Specifically, the first data and the processing information in the middleware program are recorded sequentially and correspond to the request information, so that the first processing log corresponding to the request information can be obtained by outputting the first data and the processing information.
According to the method for generating the processing log provided by the embodiment of the invention, when request information sent by the user terminal is received, a middleware program is operated to read the request information by adopting the middleware program to obtain first data, the first data is recorded in the middleware program and the request information is processed to obtain processing information corresponding to the request information, the processing information is recorded in the middleware program, the first data and the processing information in the middleware program are output to obtain a first processing log corresponding to the request information, so that when a server receives the request information sent by the user terminal, the middleware program can be correspondingly operated, the first data and the processing information corresponding to the request information are cached in the middleware program and then output, and the first processing log corresponding to the request information generated in such a way is independent, And sequentially, the first processing log corresponding to the request information is not mixed with other processing logs corresponding to other request information, so that when a user queries the first processing log corresponding to the request information by inputting a keyword, the complete and ordered first processing log can be queried.
In an alternative embodiment, in step S101, when a middleware program is run, the method for generating a processing log further includes: identifying the request information to obtain identification information; and identifying the middleware program according to the identification information.
When the request information is highly concurrent, the server receives a plurality of request information at the same time, so that a plurality of middleware programs are operated in the server, in order to enable the middleware programs not to generate confusion when recording first data corresponding to the request information and processing information, the request information can be identified while the middleware programs are operated, the identified request information is obtained, identification information corresponding to the request information is obtained, the middleware programs are identified by the identification information, and the request information and the middleware programs have the same identification information.
When a middleware program is operated, the request information is identified to obtain identification information, and the middleware program is identified according to the identification information, so that the request information and the middleware program have the same identification, the middleware program is convenient to search, and the subsequent processing information is recorded in the middleware program, so that when the request information is highly concurrent, the first data corresponding to the request information and the processing information are recorded in the middleware program without confusion.
In an alternative embodiment, the processing information may include identification information, and step S105, recording the processing information in the middleware program includes: the processing information is recorded in the middleware program based on the identification information.
Specifically, the request information has identification information, and the logging program also records the identification information when recording the processing information corresponding to the request information, and therefore, the processing information includes the identification information. When the log recording program gives the processing information to the middleware program, the corresponding middleware program can be searched according to the identification information. And after receiving the processing information, the middleware program records the processing information.
The processing information is recorded in the middleware program through the identification information, and the corresponding middleware program can be found, so that the processing information can correspond to the first data, and the subsequently obtained first processing log can be complete and ordered.
In an alternative embodiment, the middleware program may include a stack, and step S103 records first data in the middleware program, including: the first data is recorded in the stack of the middleware program.
Specifically, a stack is set in the middleware program, and first data is recorded in the stack of the middleware program, so that when the first data and the processing information are output, the first data is output at last, and therefore the first processing logs are sequentially stacked according to a time sequence, and the user can conveniently check the first processing logs.
In an alternative embodiment, step S105, recording the processing information in the middleware program includes: the processing information is recorded in the stack of the middleware program.
Specifically, a stack is set in the middleware program, and processing information is recorded in the stack of the middleware program, so that when first data and the processing information are output, the processing information is output first, and the first data is output last, so that first processing logs are sequentially stacked according to a time sequence, and the user can conveniently check the logs.
In an optional embodiment, the method for generating a processing log further includes: responding the request information to obtain response information; recording response information in the middleware program; and outputting the first data, the processing information and the response information in the middleware program to obtain a second processing log corresponding to the request information.
Specifically, after the request processing program processes the request information, the request processing program may respond to the request information. The log recording program can record the response information and send the response information to the middleware program, the middleware program records the response information, and finally the first data, the processing information and the response information are output, so that a complete second processing log corresponding to the request information can be obtained.
The response information is recorded in the middleware program, and the first data, the processing information and the response information are output to obtain the second processing log corresponding to the request information, so that the response information can be seen when the second processing log is inquired subsequently, and a user can conveniently view the complete processing condition corresponding to the request information.
In an optional embodiment, the method for generating a processing log further includes: the middleware program is deleted.
Specifically, since the middleware program is used to temporarily store the first data, the processing information, and the response information, the middleware program can be deleted after the first data, the processing information, and the response information are output. And deleting the middleware program, so that the resources of the server can be released.
An embodiment of the present invention further provides a generation apparatus for processing a log, which is used at a server side, and as shown in fig. 2, the generation apparatus includes: a receiving unit 201, configured to run a middleware program when receiving a request message sent by a user terminal; the specific implementation manner is described in detail in step S101 of the above embodiment, and is not described again here. A reading unit 202, configured to read the request information by using a middleware program to obtain first data; the specific implementation manner is described in detail in step S102 of the above embodiment, and is not described again here. A first recording unit 203 for recording first data in the middleware program; the specific implementation manner is described in detail in step S103 of the above embodiment, and is not described again here. The processing unit 204 is configured to process the request information to obtain processing information corresponding to the request information; the specific implementation manner is described in detail in step S104 of the above embodiment, and is not described herein again. A second recording unit 205 for recording the processing information in the middleware program; the specific implementation manner is described in detail in step S105 of the above embodiment, and is not described again here. The output unit 206 is configured to output the first data and the processing information in the middleware program, and obtain a first processing log corresponding to the request information. The specific implementation manner is described in detail in step S106 of the above embodiment, and is not described herein again.
According to the log processing generation device provided by the embodiment of the invention, when request information sent by a user terminal is received, a middleware program is operated to read the request information by adopting the middleware program to obtain first data, the first data is recorded in the middleware program and is processed to obtain processing information corresponding to the request information, the processing information is recorded in the middleware program, the first data and the processing information in the middleware program are output to obtain a first processing log corresponding to the request information, so that when a server receives the request information sent by the user terminal, the middleware program can be correspondingly operated, the first data and the processing information corresponding to the request information are cached in the middleware program and are output, and the first processing log corresponding to the request information generated in the way is independent, And sequentially, the first processing log corresponding to the request information is not mixed with other processing logs corresponding to other request information, so that when a user queries the first processing log corresponding to the request information by inputting a keyword, the complete and ordered first processing log can be queried.
Based on the same inventive concept as the generation method of the processing log in the foregoing embodiment, the present invention also provides a computer having stored thereon a computer program that, when executed by a processor, implements the steps of any one of the methods of the generation method of the processing log described above.
Where in fig. 3 a bus architecture (represented by bus 300), bus 300 may include any number of interconnected buses and bridges, bus 300 linking together various circuits including one or more processors, represented by processor 302, and memory, represented by memory 304. The bus 300 may also link together various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface 306 provides an interface between the bus 300 and the receiver 301 and transmitter 303. The receiver 301 and the transmitter 303 may be the same element, i.e., a transceiver, providing a means for communicating with various other apparatus over a transmission medium.
The processor 302 is responsible for managing the bus 300 and general processing, and the memory 304 may be used for storing data used by the processor 302 in performing operations.
Based on the same inventive concept as the generation method of the processing log in the foregoing embodiment, the present invention also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, realizes the steps of:
when request information sent by a user terminal is received, operating a middleware program; reading the request information by adopting a middleware program to obtain first data; recording first data in a middleware program; processing the request information to obtain processing information corresponding to the request information; recording the processing information in the middleware program; and outputting the first data and the processing information in the middleware program to obtain a first processing log corresponding to the request information.
In a specific implementation, when the program is executed by a processor, any method step in the first embodiment may be further implemented.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable information processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable information processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable information processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable information processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. A generation method of a processing log is used for a server side and comprises the following steps:
when request information sent by a user terminal is received, operating a middleware program;
reading the request information by adopting the middleware program to obtain first data;
recording the first data in the middleware program;
processing the request information to obtain processing information corresponding to the request information;
recording the processing information in the middleware program;
and outputting the first data and the processing information in the middleware program to obtain a first processing log corresponding to the request information.
2. The method for generating a processing log according to claim 1, wherein when the executing a middleware program, the method further comprises:
identifying the request information to obtain identification information;
and identifying the middleware program according to the identification information.
3. The processing log generating method according to claim 2, wherein the processing information includes the identification information,
the recording of the processing information in the middleware program includes:
and recording the processing information in the middleware program according to the identification information.
4. The generation method of a processing log according to claim 1, wherein the middleware program includes a stack,
the recording the first data in the middleware program includes:
recording the first data in a stack of the middleware program.
5. The method according to claim 4, wherein recording the processing information in the middleware program includes:
recording the processing information in a stack of the middleware program.
6. The process log generating method according to any one of claims 1 to 5, further comprising:
responding the request information to obtain response information;
recording the response information in the middleware program;
and outputting the first data, the processing information and the response information in the middleware program to obtain a second processing log corresponding to the request information.
7. The process log generating method according to any one of claims 1 to 5, further comprising:
and deleting the middleware program.
8. A generation apparatus for processing a log, which is used for a server side, comprising:
a receiving unit, for operating a middleware program when receiving the request information sent by the user terminal;
the reading unit is used for reading the request information by adopting the middleware program to obtain first data;
a first recording unit configured to record the first data in the middleware program;
the processing unit is used for processing the request information to obtain processing information corresponding to the request information;
a second recording unit operable to record the processing information in the middleware program;
and the output unit is used for outputting the first data and the processing information in the middleware program to obtain a first processing log corresponding to the request information.
9. A computer, comprising:
at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the method of processing log generation of any of claims 1-7.
10. A computer-readable storage medium storing computer instructions for causing a computer to execute the method for generating a processing log according to any one of claims 1 to 7.
CN202011363082.8A 2020-11-27 2020-11-27 Method and device for generating processing log and storage medium Withdrawn CN112597119A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011363082.8A CN112597119A (en) 2020-11-27 2020-11-27 Method and device for generating processing log and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011363082.8A CN112597119A (en) 2020-11-27 2020-11-27 Method and device for generating processing log and storage medium

Publications (1)

Publication Number Publication Date
CN112597119A true CN112597119A (en) 2021-04-02

Family

ID=75187458

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011363082.8A Withdrawn CN112597119A (en) 2020-11-27 2020-11-27 Method and device for generating processing log and storage medium

Country Status (1)

Country Link
CN (1) CN112597119A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114500255A (en) * 2022-03-01 2022-05-13 北京百度网讯科技有限公司 Log data reporting method, device, equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114500255A (en) * 2022-03-01 2022-05-13 北京百度网讯科技有限公司 Log data reporting method, device, equipment and storage medium
CN114500255B (en) * 2022-03-01 2024-03-15 北京百度网讯科技有限公司 Log data reporting method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN111352902A (en) Log processing method and device, terminal equipment and storage medium
CN111258978B (en) Data storage method
CN110928851B (en) Method, device and equipment for processing log information and storage medium
CN111935227A (en) Method for uploading file through browser, browser and electronic equipment
CN111611622A (en) Block chain-based file storage method and electronic equipment
CN112835885B (en) Processing method, device and system for distributed form storage
CN113568604B (en) Method and device for updating wind control strategy and computer readable storage medium
EP3042316B1 (en) Music identification
CN111198885A (en) Data processing method and device
CN112597119A (en) Method and device for generating processing log and storage medium
CN108460002A (en) Affiliate's automatic butt method, apparatus, equipment and storage medium
CN110134583B (en) Software testing and data processing method and device
CN111444148A (en) Data transmission method and device based on MapReduce
CN113495723B (en) Method, device and storage medium for calling functional component
CN114090514A (en) Log retrieval method and device for distributed system
CN111045983B (en) Nuclear power station electronic file management method, device, terminal equipment and medium
CN110716961B (en) Data processing method and device
CN108805741B (en) Fusion method, device and system of power quality data
CN109033189B (en) Compression method and device of link structure log, server and readable storage medium
CN114629895B (en) File fragment breakpoint continuous transmission method, device, terminal equipment and medium
CN114443777B (en) Multi-data aggregation management method, device, equipment and system
CN116028444B (en) File fingerprint generation method, device and system, electronic equipment and storage medium
CN114818645B (en) Automatic report generation method, device, equipment and medium based on data body
CN110837536B (en) Information processing method, device and storage medium
CN115774739A (en) Transaction data tracking method and device

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
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20210402