Log processing method and device, electronic equipment and storage medium

By receiving the logs of various processes and storage according to the process, the problem of confusion and reading of car log files is solved, and efficient and readable log storage and management have been realized.

CN119357149APending Publication Date: 2025-01-24ZHEJIANG GEELY HLDG GRP CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411616157.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

The current automobile log file storage timing is chaotic, poor readability, and the compressed storage method increases system overhead and management complexity.

Method used

By receiving the logs and process logos sent by each process, the logs of the same process are stored into the corresponding log files, and the adoption of the log file is used to store the disorderly chaos and improve the readability of the log file.

Benefits of technology

It achieves timing consistency and readability of log files, reduces system resource usage, simplifies log management, and reduces the overhead of compressing files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119357149A_ABST
    Figure CN119357149A_ABST
Patent Text Reader

Abstract

The invention provides a log processing method and device, electronic equipment and a storage medium. The log processing method comprises the steps that logs sent by all processes and identifiers of all the processes are received; and storing the logs sent by the same process into the log file corresponding to the identifier of the same process. The method and the device are used for solving the problem of poor readability of stored log files.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of log processing, and in particular to a log processing method, device, electronic device and storage medium. Background Art

[0002] With the development of electric and intelligent connected vehicles, autonomous driving technology is rapidly becoming popular on the vehicle side, and the corresponding requirements for safety and reliability have become higher. This requires automobile manufacturers to promptly discover and solve software and hardware problems during the trial production stage, and to promptly and quickly solve unexpected problems encountered by consumers after mass production is delivered to consumers, eliminating the adverse effects on driver and passenger safety. Therefore, it is necessary to ensure that engineers can obtain accurate vehicle logs when analyzing vehicle fault problems.

[0003] The current common logging method is for each process to directly record its own log to the storage medium, which involves certain system IO (Input / Output) operations. At the same time, it also requires each process to manage the log files, which will occupy some system overhead to a certain extent.

[0004] Some solutions collect the logs of each process and compress them for storage. However, the stored logs may be reported alternately by multiple processes, with chaotic timing, which is inconvenient for problem troubleshooting. At the same time, the compressed file format is not convenient for reading logs at the test site. There is also a lack of flexibility in the management of log files. Because compressed files generally store more information, deleting compressed files may result in the loss of key logs of the problem. At the same time, frequent calls to the compression algorithm for file compression itself will increase overhead.

[0005] Therefore, the currently stored log files are prone to problems such as time sequence confusion and poor readability. Summary of the invention

[0006] The present application provides a log processing method, device, electronic device and storage medium to solve the problem of poor readability of stored log files.

[0007] According to a first aspect of an embodiment of the present application, a log processing method is provided, including:

[0008] Receiving logs sent by each process and identifications of each process;

[0009] The logs sent by the same process are stored in the log file corresponding to the identifier of the same process.

[0010] Optionally, the number of log files corresponding to the same process identifier is less than or equal to N, where N is a positive integer, and the size of each log file is less than or equal to M.

[0011] Optionally, storing the logs sent by the same process in a log file corresponding to the identifier of the same process includes:

[0012] The logs sent by the same process are stored in the first log file corresponding to the identifier of the same process;

[0013] When the size of the (i-1)th log file is equal to M, the logs sent by the same process are stored in the i-th log file corresponding to the identifier of the same process, where i is an integer, i is greater than 1, and i is less than or equal to N.

[0014] Optionally, the method further comprises:

[0015] When the size of the Nth log file corresponding to the same process identifier is equal to M, delete the first log file corresponding to the same process identifier, and store the logs sent by the same process in the (N+1)th log file corresponding to the same process identifier.

[0016] Optionally, the method further comprises:

[0017] When the log upload mode is real-time upload, the logs sent by the same process are cached in a cache queue corresponding to the identifier of the same process, wherein the number of logs in the cache queue is less than or equal to K, where K is an integer greater than 1;

[0018] The logs of the same process are read in sequence from the head of the cache queue corresponding to the identifier of the same process, and the logs of the same process are uploaded to the server.

[0019] Optionally, the file name of the log file includes a timestamp of the earliest stored log in the log file.

[0020] Optionally, the method further comprises:

[0021] Receiving a log upload instruction, wherein the log upload instruction includes an upload time period;

[0022] Determine a target log file to be uploaded based on the upload time period and a timestamp in the file name of the log file;

[0023] The target log file is compressed and uploaded to the server.

[0024] According to a second aspect of an embodiment of the present application, a log processing device is provided, including:

[0025] A receiving unit, used for receiving logs sent by each process and an identifier of each process;

[0026] The storage unit is used to store the logs sent by the same process in a log file corresponding to the identifier of the same process.

[0027] According to a third aspect of an embodiment of the present application, there is provided an electronic device, including a memory and a processor;

[0028] The memory is connected to the processor and is used to store programs;

[0029] The processor is used to implement the log processing method as described in the first aspect by running the program in the memory.

[0030] According to a fourth aspect of an embodiment of the present application, a storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the log processing method as described in the first aspect is implemented.

[0031] In the present application, the log sent by each process and the identification of each process are received, the log sent by the same process is stored in the log file corresponding to the identification of the same process, what is stored in the same log file is the log sent by the same process, and the log file is stored according to the process, and the situation of disordered timing in the log file caused by the alternating reporting of logs by multiple processes is reduced, and the readability of the stored log file is enhanced. Moreover, the log sent by each process and the identification of each process are received, and each process does not need to directly perform the storage operation of the log and the management of the log file, and part of the system resources can be saved. In addition, the mode of directly managing the log file instead of the compressed file is adopted, and the flexibility is higher, the log file can be directly read on the one hand, and the overhead of the compressed file can be reduced on the other hand, and the compression times of the log file are reduced, and the system overhead is saved. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0033] Figure 1 A flow chart of a log processing method provided in an embodiment of the present application;

[0034] Figure 2 A schematic diagram of a process of step 102 provided in an embodiment of the present application;

[0035] Figure 3 A flow chart of a log processing method provided in an embodiment of the present application;

[0036] Figure 4 A flow chart of a log processing method provided in an embodiment of the present application;

[0037] Figure 5 A schematic diagram of the structure of a log processing device provided in an embodiment of the present application;

[0038] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0039] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0040] Exemplary Implementation Environment

[0041] The log processing method according to the embodiment of the present application can be performed by an electronic device such as a terminal device or a server, and the terminal device can be a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc., and the server can be an independent physical server, a server cluster composed of multiple physical servers, or a cloud server capable of cloud computing. The method can be implemented by a processor calling a computer-readable program instruction stored in a memory. The application is explained by taking the log processing method being executed by the log management module in the vehicle-mounted device as an example, but is not limited to this.

[0042] Exemplary Methods

[0043] See also Figure 1 In an exemplary embodiment, a log processing method is provided. Figure 1 As shown in the figure, the process of the log processing method mainly includes:

[0044] Step 101: Receive logs sent by each process and the identifier of each process.

[0045] In some embodiments, each process refers to each application process, and each process is located in a different chip in the vehicle-mounted device. The log processing method is executed by a log management module in the vehicle-mounted device. The log management module can be located on the same chip as any one of the processes, or the log management module can be located on a separate chip. The present application does not limit this. Since each process is located in a different chip in the vehicle-mounted device, cross-chip vehicle-mounted log processing is realized.

[0046] In some embodiments, step 101 includes: receiving log messages sent by each process; extracting logs sent by each process and identifiers of each process from the log messages.

[0047] In an exemplary embodiment, the log message sent by each process can be a log message based on the DLT (Diagnostic Log and Trace) protocol. The DLT protocol is a standard protocol, and the log message based on the DLT protocol includes an APPID field, which records the application identifier. Each process refers to each application process, that is, the APPID field records the identifier of the process that uploads the log message. As needed, the log message sent by each process can also be a log message based on other protocols. As long as the logs sent by each process and the identifiers of each process can be extracted from the log message, this application does not limit this.

[0048] Step 102: Store the logs sent by the same process into a log file corresponding to the identifier of the same process.

[0049] The logs sent by each process and the identification of each process are uniformly received by the log management module, and the logs sent by the same process are stored in the log file corresponding to the identification of the same process. What is stored in the same log file is the log sent by the same process. The log files are stored according to the process, and the situation of time sequence confusion in the log files caused by the alternating reporting of logs by multiple processes is reduced, and the readability of the stored log files is enhanced. Moreover, the logs sent by each process and the identification of each process are uniformly received by the log management module, and the logs sent by the same process are stored in the log file corresponding to the identification of the same process. Each process does not need to directly perform the storage operation of the log and the management of the log file, which can save part of the system resources. In addition, the method of directly managing the log file instead of the compressed file is adopted, which has higher flexibility. On the one hand, the log file can be directly read at the debugging site, and on the other hand, the cost of the compressed file can be reduced. The file can be compressed again when it is necessary to upload, which reduces the number of compression times of the log file and saves system overhead.

[0050] In an exemplary embodiment, the log management module receives log messages based on the DLT protocol sent by each process, parses the log messages to obtain the logs sent by each process and the identifier of each process (i.e., APPID), creates different log files for different process identifiers, and stores the logs sent by the same process in the log file corresponding to the identifier of the same process.

[0051] In some embodiments, the number of log files corresponding to the identifier of the same process is less than or equal to N, where N is a positive integer, and the size of each log file is less than or equal to M.

[0052] The number of log files corresponding to the same process identifier is less than or equal to N, and the size of each log file is less than or equal to M. The size and number of log files corresponding to the same process identifier are managed. The storage space occupied by the log files corresponding to the same process identifier is less than or equal to N*M. It is only necessary to allocate N*M storage space in advance for the log files corresponding to each process identifier.

[0053] In some embodiments, N log files corresponding to the identifier of the same process can be created in advance, or when one log file is full of M, a new log file can be created for log storage during the log storage process. This application does not limit this.

[0054] In an exemplary embodiment, the number of log files corresponding to the same process identifier is equal to N, where N is a positive integer, and the size of each log file is less than or equal to M. A fixed number of N log files are allocated to the same process identifier, and the size of each log file is less than or equal to M. The storage space occupied by the log files corresponding to the same process identifier is less than or equal to N*M, and it is only necessary to allocate N*M storage space in advance for the log files corresponding to each process identifier.

[0055] In some embodiments, Figure 2 As shown, step 102 includes:

[0056] Step 201: Store the logs sent by the same process into the first log file corresponding to the identifier of the same process.

[0057] Step 202, when the size of the (i-1)th log file is equal to M, the logs sent by the same process are stored in the i-th log file corresponding to the identifier of the same process, where i is an integer, i is greater than 1, and i is less than or equal to N.

[0058] For example, after receiving the log sent by process A and the identifier ID_A of process A, the log sent by process A is stored in the first log file corresponding to the identifier ID_A of process A. When the first log file corresponding to ID_A is not full, the logs sent by process A are incrementally written to the first log file corresponding to ID_A. When the size of the first log file corresponding to ID_A is equal to M, the second log file corresponding to ID_A is created, and the logs sent by process A are subsequently stored in the second log file corresponding to ID_A. Similarly, when the size of the (N-1)th log file corresponding to ID_A is equal to M, the Nth log file corresponding to ID_A is created, and the logs sent by process A are stored in the Nth log file corresponding to ID_A. The logs sent by process A are incrementally written to the Nth log file corresponding to ID_A.

[0059] The logs sent by the same process are stored in the first log file corresponding to the identifier of the same process. When the size of the (i-1)th log file is equal to M, the logs sent by the same process are stored in the i-th log file corresponding to the identifier of the same process, where i is an integer, i is greater than 1, and i is less than or equal to N. The logs sent by the same process are stored in each log file corresponding to the identifier of the same process in the order of the sending time of the logs sent by the same process. The log files are more readable, the occurrence of time sequence confusion is reduced, and it is ensured that the number of log files corresponding to the identifier of the same process is less than or equal to N, and the size of each log file is less than or equal to M.

[0060] In some embodiments, the log processing method also includes: when the size of the Nth log file corresponding to the identifier of the same process is equal to M, deleting the first log file corresponding to the identifier of the same process, and storing the logs sent by the same process in the (N+1)th log file corresponding to the identifier of the same process.

[0061] After the Nth log file corresponding to the identifier of the same process is full, delete the first log file corresponding to the identifier of the same process, create the (N+1)th log file corresponding to the identifier of the same process, and store the newly sent logs of the same process in the (N+1)th log file corresponding to the identifier of the same process. Use the rollback method to ensure that the number of log files corresponding to the identifier of the same process is always N, and the storage space occupied by the log files corresponding to the identifier of the same process is less than or equal to N*M. It is only necessary to allocate N*M storage space to the log files corresponding to the identifier of each process in advance, and it can ensure that the log files corresponding to the identifier of the same process are the latest. Deleting the first log file corresponding to the identifier of the same process means deleting the log files with an earlier storage time.

[0062] In some embodiments, Figure 3 As shown, the log processing method also includes:

[0063] Step 301, when the log upload mode is real-time upload, the logs sent by the same process are cached in a cache queue corresponding to the identifier of the same process, wherein the number of logs in the cache queue is less than or equal to K, and K is an integer greater than 1.

[0064] Step 302: read the logs of the same process from the head of the cache queue corresponding to the identifier of the same process in sequence, and upload the logs of the same process to the server.

[0065] In an exemplary embodiment, the log management module allocates cache queues according to the number of processes reporting logs. The number of cache queues is equal to the number of processes reporting logs, and one process reporting logs corresponds to one cache queue.

[0066] In an exemplary embodiment, the logs in the cache queue are stored in a first-in-first-out manner.

[0067] In an exemplary embodiment, step 302 may specifically be to sequentially read the logs of the same process from the head of the cache queue corresponding to the identifier of the same process, and upload the logs of the same process to the server through a transmission protocol.

[0068] In an exemplary embodiment, logs of the same process are read sequentially from the head of the cache queue corresponding to the identifier of the same process, and the logs of the same process are uploaded to the server. The log management module uploads the logs of the same process to the server one by one.

[0069] In an exemplary embodiment, the number of logs in the cache queue may be set to be less than or equal to K, or a threshold value of the number of logs sent by each process received by the log management module may be set.

[0070] The current log upload solution usually obtains the log upload instruction of the TSP (Telematics Service Provider) cloud server, parses the log upload method in the log upload instruction, and then uploads the corresponding locally stored log. The log upload method usually includes real-time upload, file upload, upload according to time period, etc. However, the current log upload to the cloud server usually compresses all the locally stored log files and uploads them as a whole, which takes up more network resources. At the same time, the compressed file upload method cannot obtain the real-time generated logs, so it is impossible to monitor the key information in the log in real time. For the file upload method, it is necessary to perform multiple log writing, log file compression, and compressed file upload processes when the vehicle problem occurs, and real-time monitoring cannot be achieved.

[0071] In the present application, when the log upload method is real-time upload, the log management module directly forwards the received logs sent by the same process to the cloud server through the transmission protocol forwarding method, so that the vehicle logs of the vehicle that is having problems can be obtained in real time when vehicle problems occur, which helps to continuously monitor various key data at the time of the problem and facilitate real-time monitoring of the vehicle logs.

[0072] Moreover, when the log uploading mode is real-time uploading, the logs sent by the same process are cached in the cache queue corresponding to the identifier of the same process, wherein the number of logs in the cache queue is less than or equal to K, K is an integer greater than 1, and the logs of the same process are read in sequence from the head of the cache queue corresponding to the identifier of the same process, and the logs of the same process are uploaded to the server. If the speed at which the log management module uploads logs to the server is lower than the speed at which the log management module receives logs, some logs received by the log management module may not be uploaded to the server in time, resulting in the loss of some logs. Allocating a cache queue can preset storage space for the logs received by the log management module to reduce log loss.

[0073] In some embodiments, the file name of the log file includes the timestamp of the earliest stored log in the log file.

[0074] In an exemplary embodiment, the timestamp may be UTC (Universal Time Coordinated), which may be specific to seconds. For example, the file name of the log file may be APPID_2024_06_22_16_43_28.log.

[0075] The file name of the log file includes the timestamp of the earliest stored log in the log file, that is, the file name of the log file includes the timestamp of the first log in the log file.

[0076] The file name of the log file includes the timestamp of the earliest stored log in the log file, which makes it easy to filter out the logs of the period when the vehicle problem occurred according to the file name of the log file.

[0077] In some embodiments, Figure 4 As shown, the log processing method also includes:

[0078] Step 401: Receive a log upload instruction, wherein the log upload instruction includes an upload time period.

[0079] In an exemplary embodiment, step 401 includes: receiving a log upload instruction sent by a server.

[0080] Step 402: Determine the target log file to be uploaded based on the upload time period and the timestamp in the file name of the log file.

[0081] Step 403: compress the target log file and upload it to the server.

[0082] In some embodiments, step 402 includes: sorting the timestamps in the file name of the log file in chronological order, and filtering according to the upload time period to obtain each timestamp within the upload time period sorted in chronological order, and the previous timestamp of the earliest timestamp within the upload time period; and determining the log files corresponding to each timestamp within the upload time period and the previous timestamp of the earliest timestamp within the upload time period as the target log files to be uploaded.

[0083] It can ensure that the logs within the upload time period will not be lost in the target log file to be uploaded, but there may be some redundant logs.

[0084] For example, the timestamps in the file names of the log files are 2024_06_22_07_45_00, 2024_06_22_07_53_00, 2024_06_22_07_58_00, 2024_06_22_08_03_00, 2024_06_22_08_11_00, 2024_06_22_08_24_00, 2024_06_2 2_08_32_00, 2024_06_22_08_36_00, the upload time period is 2024_06_22_08_00_00 to 2024_06_22_08_30_00, and the timestamps in the file names of the target log files to be uploaded include 2024_06_22_07_58_00, 2024_06_22_08_03_00, 2024_06_22_08 _11_00, 2024_06_22_08_24_00, the target log files corresponding to 2024_06_22_07_58_00 include the logs between 2024_06_22_07_58_00 and 2024_06_22_08_03_00, and the target log files corresponding to 2024_06_22_08_24_00 include the logs between 2024_06_22_08_24_0 The logs between 0 and 2024_06_22_08_32_00 are included in the target log file uploaded at last. The redundant logs between 2024_06_22_07_58_00 and 2024_06_22_08_00_00 and the redundant logs between 2024_06_22_08_30_00 and 2024_06_22_08_32_00 are included in the target log file uploaded at last. However, the logs within the upload time period are not lost.

[0085] By configuring the upload time period in the log upload instruction, the vehicle logs during the time period when the vehicle broke down are selected instead of uploading all the logs. The uploaded logs are filtered by time. Because the file name of the log file includes the timestamp of the earliest stored log in the log file, the vehicle logs during the time period when the vehicle broke down can be filtered by time. The target log files are compressed and uploaded to the server, avoiding the occupation of system and network transmission resources caused by the full compression and uploading of local log files on the vehicle side, and occupying as few network resources as possible.

[0086] In some embodiments, various parameters involved in the present application (eg, N, M, K, etc.) may be configured in a log management module.

[0087] In summary, in the present application, the log sent by each process and the identification of each process are received, the log sent by the same process is stored in the log file corresponding to the identification of the same process, what is stored in the same log file is the log sent by the same process, and the log file is stored according to the process, and the situation of disordered timing in the log file caused by the alternating reporting of logs by multiple processes is reduced, and the readability of the stored log file is enhanced. Moreover, the log sent by each process and the identification of each process are received, and each process does not need to directly perform the storage operation of the log and the management of the log file, which can save part of the system resources. In addition, the mode of directly managing the log file instead of the compressed file is adopted, which has higher flexibility, can directly read the log file on the one hand, and can reduce the cost of the compressed file on the other hand, reduces the compression times of the log file, and saves the system cost.

[0088] Exemplary Devices

[0089] Accordingly, the present application also provides a log processing device, such as Figure 5 As shown, the log processing device includes:

[0090] The receiving unit 501 is used to receive the logs sent by each process and the identifiers of each process;

[0091] The storage unit 502 is used to store the logs sent by the same process in a log file corresponding to the identifier of the same process.

[0092] The log processing device provided in this embodiment belongs to the same application concept as the log processing method provided in the above embodiments of this application, can execute the log processing method provided in any of the above embodiments of this application, and has the corresponding functional modules and beneficial effects of executing the log processing method. For technical details not fully described in this embodiment, please refer to the specific processing content of the log processing method provided in the above embodiments of this application, which will not be repeated here.

[0093] The functions implemented by the above receiving unit 501 and the storage unit 502 can be implemented by the same or different processors respectively, and the embodiments of the present application are not limited thereto.

[0094] It should be understood that the units in the above devices can be implemented in the form of a processor calling software. For example, the device includes a processor, the processor is connected to a memory, and instructions are stored in the memory. The processor calls the instructions stored in the memory to implement any of the above methods or realize the functions of each unit of the device, wherein the processor can be a general-purpose processor, such as a CPU or a microprocessor, etc., and the memory can be a memory in the device or a memory outside the device. Alternatively, the units in the device can be implemented in the form of hardware circuits, and the functions of some or all units can be realized by designing the hardware circuits. The hardware circuit can be understood as one or more processors; for example, in one implementation, the hardware circuit is an ASIC, and the functions of some or all of the above units are realized by designing the logical relationship of the components in the circuit; for another example, in another implementation, the hardware circuit can be implemented by PLD, taking FPGA as an example, which can include a large number of logic gate circuits, and the connection relationship between the logic gate circuits is configured by the configuration file, so as to realize the functions of some or all of the above units. All units of the above devices can be implemented in the form of a processor calling software, or in the form of hardware circuits, or in part by a processor calling software, and the remaining part is implemented in the form of hardware circuits.

[0095] In an embodiment of the present application, a processor is a circuit with the ability to process signals. In one implementation, the processor may be a circuit with the ability to read and run instructions, such as a CPU, a microprocessor, a GPU, or a DSP; in another implementation, the processor may implement certain functions through the logical relationship of a hardware circuit, and the logical relationship of the hardware circuit is fixed or reconfigurable, such as a hardware circuit implemented by an ASIC or PLD, such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document to implement the hardware circuit configuration can be understood as the process of the processor loading instructions to implement the functions of some or all of the above units. In addition, it can also be a hardware circuit designed for artificial intelligence, which can be understood as an ASIC, such as an NPU, TPU, DPU, etc.

[0096] It can be seen that each unit in the above device can be one or more processors (or processing circuits) configured to implement the above method, such as: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms.

[0097] In addition, all or part of the units in the above device can be integrated together, or can be implemented independently. In one implementation, these units are integrated together and implemented in the form of a SOC. The SOC may include at least one processor for implementing any of the above methods or implementing the functions of each unit of the device. The type of the at least one processor may be different, for example, including a CPU and an FPGA, a CPU and an artificial intelligence processor, a CPU and a GPU, etc.

[0098] Exemplary Electronic Devices

[0099] An embodiment of the present application provides an electronic device, see Figure 6 As shown, the device includes:

[0100] Memory 200 and processor 210;

[0101] The memory 200 is connected to the processor 210 and is used to store programs;

[0102] The processor 210 is used to implement the log processing method disclosed in any of the above embodiments by running the program stored in the memory 200.

[0103] Specifically, the electronic device may further include: a bus, a communication interface 220 , an input device 230 and an output device 240 .

[0104] The processor 210, the memory 200, the communication interface 220, the input device 230 and the output device 240 are connected to each other via a bus.

[0105] A bus may include a pathway that transfers information between components of a computer system.

[0106] The processor 210 may be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the scheme of the present invention. It may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0107] The processor 210 may include a main processor, and may also include a baseband chip, a modem, and the like.

[0108] The memory 200 stores a program for executing the technical solution of the present invention, and may also store an operating system and other key services. Specifically, the program may include a program code, and the program code includes a computer operation instruction. More specifically, the memory 200 may include a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM), other types of dynamic storage devices that can store information and instructions, a disk storage, a flash, and the like.

[0109] The input device 230 may include a device for receiving data and information input by a user, such as a keyboard, a mouse, a camera, a scanner, a light pen, a voice input device, a touch screen, a pedometer, or a gravity sensor.

[0110] Output device 240 may include a device that allows information to be output to a user, such as a display screen, a printer, a speaker, etc.

[0111] The communication interface 220 may include any device such as a transceiver to communicate with other devices or communication networks, such as Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc.

[0112] The processor 210 executes the program stored in the memory 200 and calls other devices, which can be used to implement each step of any log processing method provided in the above embodiments of the present application.

[0113] Exemplary computer program products and storage media

[0114] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the log processing method according to various embodiments of the present application described in any of the above-mentioned embodiments of this specification.

[0115] The computer program product may be written in any combination of one or more programming languages ​​to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0116] In addition, the embodiment of the present application may also be a storage medium on which a computer program is stored. The computer program is executed by a processor to execute the steps of the log processing method according to various embodiments of the present application described in any of the above embodiments of this specification, and specifically the following steps may be implemented:

[0117] Step 101: Receive logs sent by each process and the identifier of each process.

[0118] Step 102: Store the logs sent by the same process into a log file corresponding to the identifier of the same process.

[0119] For the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0120] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0121] The steps in the methods of each embodiment of the present application can be adjusted in order, combined and deleted according to actual needs, and the technical features recorded in each embodiment can be replaced or combined.

[0122] The modules and sub-modules in the devices and terminals in the various embodiments of the present application can be combined, divided and deleted according to actual needs.

[0123] In the several embodiments provided in the present application, it should be understood that the disclosed terminals, devices and methods can be implemented in other ways. For example, the terminal embodiments described above are only schematic, for example, the division of modules or submodules is only a logical function division, and there may be other division methods in actual implementation, for example, multiple submodules or modules can be combined or integrated into another module, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.

[0124] The modules or submodules described as separate components may or may not be physically separated, and the components of the modules or submodules may or may not be physical modules or submodules, that is, they may be located in one place, or they may be distributed on multiple network modules or submodules. Some or all of the modules or submodules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0125] In addition, each functional module or submodule in each embodiment of the present application may be integrated into one processing module, or each module or submodule may exist physically separately, or two or more modules or submodules may be integrated into one module. The above-mentioned integrated modules or submodules may be implemented in the form of hardware or in the form of software functional modules or submodules.

[0126] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0127] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly by hardware, software units executed by a processor, or a combination of the two. The software units may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0128] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0129] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A log processing method, characterized in that: include: Receiving logs sent by each process and identifications of each process; The logs sent by the same process are stored in the log file corresponding to the identifier of the same process.

2. The log processing method according to claim 1, characterized in that: The number of log files corresponding to the same process identifier is less than or equal to N, where N is a positive integer, and the size of each log file is less than or equal to M.

3. The log processing method according to claim 2, characterized in that: The storing the logs sent by the same process into the log file corresponding to the identifier of the same process includes: The logs sent by the same process are stored in the first log file corresponding to the identifier of the same process; When the size of the (i-1)th log file is equal to M, the logs sent by the same process are stored in the i-th log file corresponding to the identifier of the same process, where i is an integer, i is greater than 1, and i is less than or equal to N.

4. The log processing method according to claim 3, characterized in that: The method further comprises: When the size of the Nth log file corresponding to the same process identifier is equal to M, delete the first log file corresponding to the same process identifier, and store the logs sent by the same process in the (N+1)th log file corresponding to the same process identifier.

5. The log processing method according to claim 1, characterized in that: The method further comprises: When the log upload mode is real-time upload, the logs sent by the same process are cached in a cache queue corresponding to the identifier of the same process, wherein the number of logs in the cache queue is less than or equal to K, where K is an integer greater than 1; The logs of the same process are read in sequence from the head of the cache queue corresponding to the identifier of the same process, and the logs of the same process are uploaded to the server.

6. The log processing method according to claim 1, characterized in that: The file name of the log file includes the timestamp of the earliest stored log in the log file.

7. The log processing method according to claim 6, characterized in that: The method further comprises: Receiving a log upload instruction, wherein the log upload instruction includes an upload time period; Determine a target log file to be uploaded based on the upload time period and a timestamp in the file name of the log file; The target log file is compressed and uploaded to the server.

8. A log processing device, characterized in that: include: A receiving unit, used for receiving logs sent by each process and an identifier of each process; The storage unit is used to store the logs sent by the same process in a log file corresponding to the identifier of the same process.

9. An electronic device, characterized in that: including memory and processor; The memory is connected to the processor and is used to store programs; The processor is used to implement the log processing method according to any one of claims 1 to 7 by running the program in the memory.

10. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the log processing method according to any one of claims 1 to 7 is implemented.