Log processing method and device, equipment, medium and vehicle

By writing the target termination pointer and determining the writing area in the log buffer, the real-time and resource allocation problems of the logging task are solved, and efficient log writing is achieved.

CN120704847APending Publication Date: 2025-09-26SHANGHAI LIXIANG AUTOMOBILE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410323479.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-20
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

In the existing technology, logging tasks require acquiring locks, which results in a long writing time and an inability to guarantee real-time performance. In addition, irrational resource allocation leads to tension and waste.

Method used

By receiving a log write request, responding to the pointer write request, writing a target end pointer in the log buffer, determining the area between the target start pointer and the end pointer as the write area, and writing the target log in the area.

Benefits of technology

It realizes the real-time performance of log writing and the rational allocation of resources, saves log buffer resources, and ensures the high efficiency of log writing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120704847A_ABST
    Figure CN120704847A_ABST
Patent Text Reader

Abstract

The invention relates to a log processing method and device, equipment, a medium and a vehicle. The log processing method comprises the steps that a log write-in request is received, and the log write-in request comprises a content write-in request and a pointer write-in request; in response to the pointer write-in request, a target termination pointer is written in a log buffer area, and the pointer write-in request comprises the target termination pointer; taking an area between a target start pointer and the target end pointer existing in the log buffer area as a target write-in area; and in response to the content writing request, a target log is written in the target writing area, and the content writing request comprises the target log. According to the embodiment of the invention, log writing can be effectively carried out in real time, and resources of a log buffer area are saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a log processing method, apparatus, device, medium, and vehicle. Background Art

[0002] During the operation of the system, many expected or unexpected errors may occur. Therefore, it is necessary to record the system's operation log to effectively trace the errors that occur during the system operation and eliminate the security risks of the long-term stable operation of the system.

[0003] In the related art, in some schemes, multiple logging tasks can be scheduled for writing through mutual exclusion locks, scheduling locks and spin locks, that is, each logging task needs to obtain the corresponding lock before logging, but these methods all require obtaining the corresponding lock, which results in a longer writing time for some logging tasks and cannot guarantee real-time performance; in other schemes, the atomic array method can be used to write logs for each logging task by adding a new array. Although each logging task can be completed in real time and effectively, each newly added array has a fixed maximum length, that is, the resources scheduled for each logging task are the maximum resources, which causes resource tension and waste. Summary of the Invention

[0004] In order to solve the above technical problems, the present disclosure provides a log processing method, device, equipment, medium and vehicle.

[0005] In a first aspect, the present disclosure provides a log processing method, comprising:

[0006] receiving a log writing request, wherein the log writing request includes a content writing request and a pointer writing request;

[0007] In response to the pointer write request, writing a target termination pointer in a log buffer, the pointer write request including the target termination pointer;

[0008] Using the area between the target start pointer and the target end pointer in the log buffer as the target write area;

[0009] In response to the content write request, a target log is written in the target write area, the content write request including the target log.

[0010] In a second aspect, the present disclosure provides a log processing device, comprising:

[0011] A request receiving module, configured to receive a log writing request, wherein the log writing request includes a content writing request and a pointer writing request;

[0012] a first writing module, configured to write a target termination pointer into a log buffer in response to the pointer writing request, wherein the pointer writing request includes the target termination pointer;

[0013] an area determination module, configured to use an area between a target start pointer and a target end pointer in the log buffer as a target write area;

[0014] The second writing module is configured to write a target log into the target writing area in response to the content writing request, wherein the content writing request includes the target log.

[0015] In a third aspect, the present disclosure provides a log processing device, including:

[0016] processor;

[0017] a memory for storing executable instructions;

[0018] The processor is used to read executable instructions from the memory and execute the executable instructions to implement the log processing method of the first aspect.

[0019] In a fourth aspect, the present disclosure provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor implements the log processing method of the first aspect.

[0020] In a fifth aspect, the present disclosure provides a vehicle comprising the above log processing device.

[0021] The technical solution provided by the embodiments of the present disclosure has the following advantages over the prior art:

[0022] The log processing method, apparatus, device, medium and vehicle of the embodiments of the present disclosure are capable of receiving a log write request, which includes a content write request and a pointer write request. Then, in response to the pointer write request, a target end pointer is written in the log buffer, the pointer write request includes the target end pointer, and then the area between the target start pointer and the target end pointer in the log buffer is used as the target write area. Finally, in response to the content write request, a target log is written in the target write area, the content write request includes the target log. Thus, the target end pointer can be written in the log buffer according to the pointer write request to determine the corresponding target write area, that is, the corresponding resource area is reasonably divided for the log buffer resources required for the log write request, thereby saving log buffer resources, and writing the target log in the target write area in real time according to the content write request, so that log writing can be performed in real time and effectively. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.

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

[0025] Figure 2 A schematic diagram of a log buffer provided in an embodiment of the present disclosure;

[0026] Figure 3 A schematic diagram of another log buffer provided in an embodiment of the present disclosure;

[0027] Figure 4 A schematic diagram of another log buffer provided in an embodiment of the present disclosure;

[0028] Figure 5 A schematic diagram of another log buffer provided in an embodiment of the present disclosure;

[0029] Figure 6 A schematic diagram of the structure of a log processing device provided in an embodiment of the present disclosure;

[0030] Figure 7 A schematic diagram of the structure of a log processing device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0031] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.

[0032] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0033] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.

[0034] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0035] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".

[0036] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0037] In order to solve the above problems, the present disclosure provides a log processing method, device, equipment, medium and vehicle. Figures 1 to 5 The log processing method provided by the embodiment of the present disclosure is described in detail.

[0038] Figure 1 A flow chart of a log processing method provided by an embodiment of the present disclosure is shown.

[0039] In the embodiment of the present disclosure, the log processing method can be executed by an electronic device. Specifically, the electronic device can include but is not limited to a mobile terminal such as a computer device, a mobile phone, an in-vehicle device, a vehicle controller, a tablet computer, a wearable device, etc.

[0040] like Figure 1 As shown, the log processing method may include the following steps.

[0041] S110: Receive a log writing request, where the log writing request includes a content writing request and a pointer writing request.

[0042] In an embodiment of the present disclosure, the electronic device may receive a log writing request.

[0043] Optionally, the log write request may be a request to write into a log, wherein the log write request may include a content write request and a pointer write request.

[0044] Optionally, the content writing request may be for requesting log content.

[0045] Optionally, the pointer write request may be used to request writing a certain pointer.

[0046] Specifically, when a task is run through a central processing unit (CPU), it is necessary to record the relevant running log of the task. At this time, a log write request can be sent to the electronic device, and the electronic device can receive the log write request. The log write request can include a content write request and a pointer write request.

[0047] S120 . In response to the pointer write request, write a target termination pointer into a log buffer, wherein the pointer write request includes the target termination pointer.

[0048] In the embodiment of the present disclosure, the electronic device may write a target termination pointer into the log buffer in response to the pointer write request.

[0049] Optionally, the log buffer may be used to store various written log data.

[0050] Optionally, the target termination pointer may be an element for indicating a termination position, wherein the pointer write request may include the target termination pointer.

[0051] Specifically, the pointer write request may be used to request writing of a target termination pointer. In response to the pointer write request, the electronic device writes the target termination pointer included in the pointer write request into the log buffer.

[0052] S130: Use the area between the target start pointer and the target end pointer in the log buffer as the target write area.

[0053] In an embodiment of the present disclosure, the electronic device may use the area between the target start pointer and the target end pointer in the log buffer as the target write area.

[0054] Optionally, the target start pointer may be an element used to indicate a start position.

[0055] Optionally, the target writing area may be an area in the log buffer used for writing logs.

[0056] Specifically, after the electronic device writes the target end pointer into the log buffer, it can search for a pre-existing target start pointer in the log buffer, and then use the area between the target start pointer and the target end pointer as the target write area.

[0057] Figure 2A schematic diagram of a log buffer provided by an embodiment of the present disclosure is shown.

[0058] like Figure 2 As shown, in the initialization phase, when there is no log in the log buffer 201 , the existing target start pointer (start) and target end pointer (end) overlap and can be at any position in the log buffer 201 .

[0059] S140 . Writing a target log into the target write area in response to the content write request, wherein the content write request includes the target log.

[0060] In the embodiment of the present disclosure, the electronic device may write a target log into the target write area in response to the content write request.

[0061] Optionally, the target log may be a log to be written. The content writing request may include the target log.

[0062] Optionally, the target log may include a log information record and log content. The log information record may include certain information used to characterize the target log. For example, the log information record may include log length and log status. The log content may be log data generated by the task execution. The log length may include the length of the log information record and the length of the log content. The log status may be used to indicate whether the target log is valid.

[0063] Specifically, after determining the target writing area, the electronic device may respond to the content writing request and write the target log included in the content writing request into the target writing area. The target log may include log information records and log content.

[0064] Figure 3 A schematic diagram of another log buffer provided by an embodiment of the present disclosure is shown.

[0065] like Figure 3 As shown, in case 1, the electronic device can write the target end pointer (end) in the log buffer 301. At this time, the electronic device can use the area between the target start pointer (start) and the target end pointer (end) as the target write area 302. In response to the content write request, the target log can be written sequentially into the target write area 302. The target log can include log information records (H) and log content (log1).

[0066] Therefore, in the embodiment of the present disclosure, a log write request can be received, which log write request includes a content write request and a pointer write request, and then in response to the pointer write request, a target end pointer is written in the log buffer, the pointer write request includes the target end pointer, and then the area between the target start pointer and the target end pointer in the log buffer is used as the target write area, and finally in response to the content write request, a target log is written in the target write area, the content write request includes the target log, thereby, the target end pointer can be written in the log buffer according to the pointer write request, and the corresponding target write area can be determined, that is, the corresponding resource area is reasonably divided for the log buffer resources required for the log write request, thereby saving log buffer resources, and writing the target log in the target write area in real time according to the content write request, so that log writing can be performed in real time and effectively.

[0067] Optionally, S120 may specifically include: starting from the position of the target start pointer of the log buffer, determining the position of the log length away from the position of the target start pointer as the target position; and writing the target end pointer at the target position in response to the pointer write request.

[0068] In an embodiment of the present disclosure, the electronic device may start from the position of the target start pointer of the log buffer and determine a position that is the log length away from the position of the target start pointer as the target position.

[0069] Alternatively, the target location may be a location for writing a target end pointer.

[0070] Specifically, the electronic device may first determine the position of the target start pointer in the log buffer, and then determine the distance from the target start pointer to the target start pointer as the target position, that is, the distance between the target start pointer and the target position is the log length.

[0071] Furthermore, the electronic device may write the target termination pointer at the target location in response to the pointer write request.

[0072] Specifically, after the electronic device determines the target position on the log buffer, it may write the target termination pointer at the target position.

[0073] Optionally, S140 may specifically include: in response to the content write request, sequentially writing the target log starting from the target start pointer of the target write area; when the tail space of the log buffer is less than the log length, continuing to write the target log from the head space of the log buffer.

[0074] In the embodiment of the present disclosure, the electronic device may, in response to the content write request, sequentially write the target log starting from the target start pointer of the target write area.

[0075] In some embodiments, the electronic device may respond to the content write request by sequentially writing the target log starting from the target start pointer of the target write area until the target end pointer. Figure 3 , the electronic device can sequentially write the target log (log information record (H) and log content (log1)) starting from the target start pointer (start) of the target write area 302 until the target end pointer (end).

[0076] In other embodiments, if the tail space of the log buffer is smaller than the log length, the electronic device may continue to write the target log from the head space of the log buffer.

[0077] Optionally, the tail space may be free space at the tail of the log buffer.

[0078] Optionally, the header space may be an empty space at the header in the log buffer.

[0079] Specifically, when the electronic device is writing the target log, if the tail space of the log buffer is less than the log length, the target log (log information record (H) and log content (log2)) can be continued to be written from the head space of the log buffer. Figure 3 In case 1, in the log buffer 303, the corresponding target write area 304 is determined starting from the target start pointer (start). Since the free tail space of the log buffer 303 is less than the log length of the target log at this time, the tail space is insufficient to write the target log. Therefore, the corresponding target write area 304 is further divided from the free head space of the log buffer 303. When the electronic device writes the target log, it starts writing from the target start pointer (start) of the target write area 304. When the tail space is written, it continues writing from the head space until the target end pointer (end).

[0080] Optionally, S120 may specifically include: receiving multiple log write requests, determining the request reception order of multiple pointer write requests included in the multiple log write requests; and writing the multiple target termination pointers corresponding to the multiple pointer write requests into the log buffer in sequence according to the request reception order of the multiple pointer write requests.

[0081] In an embodiment of the present disclosure, the electronic device may receive multiple log writing requests and determine a request receiving order of multiple pointer writing requests included in the multiple log writing requests.

[0082] Optionally, the request receiving order may be the order in which the write requests are received.

[0083] Specifically, when multiple CPUs run tasks, they all need to send log write requests to the electronic device. The electronic device can receive multiple log write requests and determine the order of the multiple pointer write requests included in the multiple log write requests, that is, determine the order in which the multiple pointer write requests are received.

[0084] Furthermore, the electronic device may write the multiple target termination pointers corresponding to the multiple pointer write requests into the log buffer in sequence according to the request reception order of the multiple pointer write requests.

[0085] Specifically, after receiving multiple pointer write requests sent by multiple cores, the electronic device can write the multiple target termination pointers corresponding to the multiple pointer write requests into the log buffer in sequence according to the order in which the multiple pointer write requests are received. For example, when the electronic device receives multiple concurrent pointer write requests, it can determine the order in which the multiple pointer write requests are received, and first write the target termination pointer corresponding to the pointer write request that is first in the receiving order according to the order in which the requests are received, and then write the target termination pointer corresponding to the pointer write request that is second in the receiving order after the target termination pointer, and write the pointers into the log buffer in sequence. In this way, the mutually exclusive concurrent write operations of multiple pointer write requests are avoided, the reasonable writing of the log buffer is guaranteed, and the writing efficiency is improved.

[0086] Figure 4 A schematic diagram of another log buffer provided by an embodiment of the present disclosure is shown.

[0087] like Figure 4 As shown, in the log buffer 401, the electronic device can simultaneously receive two log write requests, the two log write requests being for the target log log1 and the target log log2 respectively. At this time, the electronic device can determine the request order of the pointer write requests included in the two log write requests, thereby determining the target pointer write request that is in the first place. For example, if the request order of the pointer write request for the target log log1 is in the first place, the electronic device writes the target end pointer (end) and determines the target write area as 402; for another example, if the request order of the pointer write request for the target log log2 is in the first place, the electronic device writes the target end pointer (end) and determines the target write area as 403.

[0088] Furthermore, for the remaining pointer write requests, the electronic device continues to determine the target pointer write request corresponding to the first one according to the request sequence of the pointer write requests, and performs target pointer write.

[0089] Figure 5 A schematic diagram of another log buffer provided by an embodiment of the present disclosure is shown.

[0090] like Figure 5 As shown, in the log buffer 501 , the electronic device first writes the target log (init) that is first in the request order into the target write area 502 , and then writes the target log (finish) into the target write area 503 according to the request order.

[0091] Therefore, when multiple log write requests are received, only the request that comes first in the request sequence is written, thus avoiding conflicts among the requests.

[0092] Optionally, S140 may specifically include: in response to the multiple content write requests, determining the write priorities of the multiple content write requests; and writing target logs corresponding to the multiple content write requests into the multiple target write areas according to the write priorities.

[0093] In the embodiment of the present disclosure, the electronic device may determine the write priorities of the multiple content write requests in response to the multiple content write requests.

[0094] Specifically, the electronic device may determine multiple target write areas corresponding to multiple log write requests in the log buffer, and then when writing content, the electronic device may respond to the multiple content write requests and determine the write priorities of the multiple content write requests.

[0095] Furthermore, the electronic device may write target logs corresponding to the multiple content write requests into multiple target write areas according to the write priorities.

[0096] Specifically, after determining multiple target write areas in the log buffer, the electronic device can write the corresponding target logs into the corresponding target write areas according to the write priority, in descending order of write priority. For example, for the same CPU core, when the electronic device writes to the target log log1, because the write priority of the target log log2 is higher, the CPU core will write to the target log log2 first, and then continue to write to the target log log1 after the target log log2 is written; or when writing to the target logs of two CPU cores, the CPU core that starts writing later can complete the target log writing faster because the log length of the target log is shorter.

[0097] Optionally, after S140 , the log processing method may further include: changing the log status of the target log to a valid status.

[0098] In the embodiment of the present disclosure, after writing the target log into the target writing area, the electronic device may change the log status of the target log to a valid state.

[0099] Optionally, the valid state may be used to indicate that the target log is valid.

[0100] Specifically, after writing the target log into the target writing area, the electronic device may change the log state of the target log to a valid state, for example, changing the parameter representing the log state in the target log to a valid state.

[0101] Optionally, the log processing method may further include: in response to a log reading request, detecting the log status of the target log corresponding to the log reading request; when the log status is the valid state, reading and printing the target log; and changing the log status of the target log from the valid state to the invalid state.

[0102] In an embodiment of the present disclosure, the electronic device may detect the log status of the target log corresponding to the log reading request in response to the log reading request.

[0103] Optionally, the log reading request may be a request to read a log.

[0104] Specifically, when log reading is required, the electronic device may detect the log status of the target log corresponding to the log reading request in response to the log reading request.

[0105] Furthermore, when the log status is the valid status, the electronic device can read and print the target log.

[0106] Specifically, after detecting the log status of the target log, if the log status of the target log is valid, the electronic device can read and print the target log. If the log status of the target log is not valid, the electronic device does not read and print.

[0107] Furthermore, after reading and printing the target log, the electronic device may change the log status of the target log from the valid state to the invalid state.

[0108] Optionally, the invalid state may indicate that the target log is invalid.

[0109] Therefore, by changing the log status of the target log, it can be determined whether the target log can be read and printed, or whether the target log has been printed, to prevent the target log from being mistakenly re-output when the log buffer is re-circulated.

[0110] Figure 6 A structural diagram of a log processing device provided by an embodiment of the present disclosure is shown.

[0111] In some embodiments of the present disclosure, Figure 6 The log processing device shown can be provided in an electronic device. Specifically, the electronic device can include but is not limited to a mobile terminal such as a computer device, a mobile phone, an in-vehicle device, a vehicle controller, a tablet computer, a wearable device, etc.

[0112] like Figure 6 As shown, the log processing device 600 may include a request receiving module 610 , a first writing module 620 , a region determining module 630 and a second writing module 640 .

[0113] The request receiving module 610 may be configured to receive a log writing request, where the log writing request includes a content writing request and a pointer writing request.

[0114] The first writing module 620 may be configured to write a target termination pointer into the log buffer in response to the pointer writing request, wherein the pointer writing request includes the target termination pointer.

[0115] The area determination module 630 may be configured to use an area between a target start pointer and a target end pointer in the log buffer as a target write area.

[0116] The second writing module 640 may be configured to write a target log into the target writing area in response to the content writing request, wherein the content writing request includes the target log.

[0117] Therefore, in the embodiment of the present disclosure, a log write request can be received, which log write request includes a content write request and a pointer write request, and then in response to the pointer write request, a target end pointer is written in the log buffer, the pointer write request includes the target end pointer, and then the area between the target start pointer and the target end pointer in the log buffer is used as the target write area, and finally in response to the content write request, a target log is written in the target write area, the content write request includes the target log, thereby, the target end pointer can be written in the log buffer according to the pointer write request, and the corresponding target write area can be determined, that is, the corresponding resource area is reasonably divided for the log buffer resources required for the log write request, thereby saving log buffer resources, and writing the target log in the target write area in real time according to the content write request, so that log writing can be performed in real time and effectively.

[0118] In some embodiments of the present disclosure, the target log may include a log information record and log content, and the log information record may include a log length and a log status.

[0119] In some embodiments of the present disclosure, the first writing module 620 may specifically include a position determining unit and a pointer writing unit.

[0120] The position determination unit may be configured to start from the position of the target start pointer of the log buffer and determine a position that is the log length away from the position of the target start pointer as the target position.

[0121] The pointer writing unit may be configured to write the target termination pointer at the target location in response to the pointer writing request.

[0122] In some embodiments of the present disclosure, the second writing module 640 may specifically include a first writing unit and a second writing unit.

[0123] The first writing unit may be configured to, in response to the content writing request, sequentially write the target log starting from the target start pointer of the target writing area.

[0124] The second writing unit may be configured to continue writing the target log from the head space of the log buffer when the tail space of the log buffer is smaller than the log length.

[0125] In some embodiments of the present disclosure, the first writing module 620 may specifically include a sequence determination unit and a third writing unit.

[0126] The sequence determination unit may be configured to receive a plurality of log write requests and determine a request sequence of a plurality of pointer write requests included in the plurality of log write requests.

[0127] The third writing unit may be configured to respond to a target pointer writing request that is first in the request sequence and write the target termination pointer corresponding to the target pointer writing request into the log buffer.

[0128] In some embodiments of the present disclosure, the log processing device 600 may further include a first changing module.

[0129] The first changing module may be configured to change the log state of the target log to a valid state after writing the target log into the target write area in response to the content write request.

[0130] In some embodiments of the present disclosure, the log processing device 600 may further include a status detection module, a reading and printing module, and a second changing module.

[0131] The status detection module may be configured to detect, in response to a log reading request, the log status of the target log corresponding to the log reading request.

[0132] The reading and printing module can be used to read and print the target log when the log status is the valid status.

[0133] The second changing module may be configured to change the log state of the target log from the valid state to the invalid state.

[0134] It should be noted that Figure 6 The log processing device 600 shown can execute Figures 1 to 5 The various steps in the method embodiment shown are implemented Figures 1 to 5 The various processes and effects in the illustrated method embodiment are not described in detail here.

[0135] Figure 7 A structural diagram of a log processing device provided by an embodiment of the present disclosure is shown.

[0136] In some embodiments of the present disclosure, Figure 7 The log processing device shown can be an electronic device that the user wants to process logs. Specifically, the electronic device can include but is not limited to mobile terminals such as mobile phones, vehicle-mounted devices, vehicle controllers, tablet computers, wearable devices, smart home devices, etc.

[0137] like Figure 7 As shown, the log processing device may include a processor 701 and a memory 702 storing computer program instructions.

[0138] Specifically, the processor 701 may include a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0139] Memory 702 may include a large-capacity memory for information or instructions. By way of example, and not limitation, memory 702 may include a hard disk drive (HDD), a floppy disk drive, flash memory, an optical disk, a magneto-optical disk, magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 702 may include removable or non-removable (or fixed) media. Where appropriate, memory 702 may be internal or external to the integrated gateway device. In certain embodiments, memory 702 is non-volatile solid-state memory. In certain embodiments, memory 702 includes read-only memory (ROM). Where appropriate, the ROM may be mask-programmed ROM, programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable PROM (EEPROM), electrically alterable ROM (EAROM), or flash memory, or a combination of two or more of these.

[0140] The processor 701 reads and executes the computer program instructions stored in the memory 702 to perform the steps of the log processing method provided in the embodiment of the present disclosure.

[0141] In one example, the log processing device may further include a transceiver 703 and a bus 704. Figure 7 As shown, the processor 701 , the memory 702 and the transceiver 703 are connected via a bus 704 and communicate with each other.

[0142] The bus 704 includes hardware, software, or both. By way of example and not limitation, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industrial Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses, or a combination of two or more of these. Where appropriate, the bus 704 may include one or more buses. Although embodiments herein describe and illustrate a particular bus, this application contemplates any suitable bus or interconnect.

[0143] The embodiments of the present disclosure further provide a computer-readable storage medium, which may store a computer program. When the computer program is executed by a processor, the processor implements the log processing method provided by the embodiments of the present disclosure.

[0144] The above-mentioned storage medium may, for example, include a memory 702 of computer program instructions, and the above-mentioned instructions may be executed by the processor 701 of the log processing device to complete the log processing method provided in the embodiment of the present disclosure. Optionally, the storage medium may be a non-transitory computer-readable storage medium, for example, a non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a compact disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, and an optical data storage device.

[0145] The embodiment of the present disclosure also provides a vehicle, which includes the log processing device as described above. It is understood that the vehicle may also include: a processor, a memory, and a computer program. The computer program is stored in the memory and is configured to be executed by the processor to implement the log processing method provided by the embodiment of the present disclosure. The processor and the memory are already in Figure 7 The parts described in the illustrated embodiment are not repeated here.

[0146] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising" is intended to cover non-exclusive inclusion, so that a process, method, article or apparatus that includes a list of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article or apparatus.

[0147] The foregoing description is intended only to provide specific embodiments of the present disclosure, intended to enable those skilled in the art to understand and implement the present disclosure. Various modifications to these embodiments will be readily 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 disclosure. Therefore, the present disclosure is not intended to be limited to the embodiments described herein, but rather to be construed in the broadest manner consistent with the principles and novel features disclosed herein.

Claims

1. A log processing method, characterized in that: include: receiving a log writing request, wherein the log writing request includes a content writing request and a pointer writing request; In response to the pointer write request, writing a target termination pointer in a log buffer, the pointer write request including the target termination pointer; Using the area between the target start pointer and the target end pointer in the log buffer as the target write area; In response to the content write request, a target log is written in the target write area, the content write request including the target log.

2. The method according to claim 1, characterized in that The target log includes log information records and log content, and the log information records include log length; Wherein, writing the target termination pointer in the log buffer in response to the pointer write request includes: Starting from the position of the target start pointer of the log buffer, determining a position that is the log length away from the position of the target start pointer as the target position; In response to the pointer write request, the target termination pointer is written at the target location.

3. The method according to claim 2, characterized in that Writing a target log in the target write area in response to the content write request includes: In response to the content write request, sequentially write the target log starting from the target start pointer of the target write area; When the tail space of the log buffer is smaller than the log length, the target log is continuously written from the head space of the log buffer.

4. The method according to claim 1, wherein Writing a target termination pointer into a log buffer in response to the pointer write request includes: receiving a plurality of log write requests, and determining a request receiving order of a plurality of pointer write requests included in the plurality of log write requests; The target termination pointers corresponding to the pointer write requests are sequentially written into the log buffer according to the request receiving order of the pointer write requests.

5. The method according to claim 2, characterized in that Writing a target log in the target write area in response to the content write request includes: In response to the plurality of content write requests, determining write priorities of the plurality of content write requests; According to the write priority, the target logs corresponding to the multiple content write requests are written into the multiple target write areas.

6. The method according to claim 5, characterized in that After writing the target log in the target write area in response to the content write request, the method further includes: In response to a log reading request, detecting a log status of the target log corresponding to the log reading request, wherein the log status is used to indicate whether the target log is valid; When the log status is valid, reading and printing the target log; The log state of the target log is changed from the valid state to the invalid state.

7. A log processing device, characterized in that: include: A request receiving module, configured to receive a log writing request, wherein the log writing request includes a content writing request and a pointer writing request; a first writing module, configured to write a target termination pointer into a log buffer in response to the pointer writing request, wherein the pointer writing request includes the target termination pointer; an area determination module, configured to use an area between a target start pointer and a target end pointer in the log buffer as a target write area; The second writing module is configured to write a target log into the target writing area in response to the content writing request, wherein the content writing request includes the target log.

8. A log processing device, characterized in that: include: processor; a memory for storing executable instructions; The processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the log processing method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that The storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the log processing method according to any one of claims 1 to 6.

10. A vehicle, characterized in that: The method comprises the log processing apparatus according to claim 7 , the log processing device according to claim 8 , or the computer-readable storage medium according to claim 9 .