Vehicle-mounted log recording method and device, electronic equipment, medium and vehicle

By collecting and storing the log information of the microcontroller unit in the vehicle and using the run log management protocol to parse log messages, the problem that the freezing frame mode cannot detect the software abnormal points inside the controller is solved, and accurate positioning and efficient vehicle failures are achieved repair.

CN119182656APending Publication Date: 2024-12-24CHINA FAW CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411181294.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2024-12-24

AI Technical Summary

Technical Problem

In the prior art, the freeze frame mode can only record the car's operating status during vehicle troubleshooting, and cannot check abnormal points of the controller's internal software, resulting in inconvenient troubleshooting.

Method used

The microprocessor establishes a communication connection with the microcontroller, collects and stores log information on the flash memory chip, uses the run log management protocol to parse log messages, extracts log information and microcontroller number, and records it in the flash memory chip to reproduce faults The situation is to accurately locate the abnormal points of the software program.

Benefits of technology

It improves the efficiency of vehicle troubleshooting, reduces the difficulty of fault repair, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119182656A_ABST
    Figure CN119182656A_ABST
Patent Text Reader

Abstract

The invention discloses a vehicle-mounted log recording method, device and equipment, a medium and a vehicle, and belongs to the technical field of vehicles, the method comprises the following steps: responding to a connection establishment request message sent by a micro-control unit, returning a confirmation message to the micro-control unit, and establishing communication connection with the micro-control unit; receiving a log message sent by the micro-control unit; analyzing the log message, and extracting log information and serial number information of the micro-control unit; and recording the log information and the serial number information of the micro-control unit in the flash memory chip. By collecting the log information of each micro-control unit and storing the log information in the flash memory chip, when the vehicle breaks down, the fault condition can be reproduced according to the log information, so that abnormal points in a software program can be accurately positioned, the subsequent vehicle fault checking operation efficiency can be improved, and the vehicle fault checking efficiency can be improved. Therefore, the vehicle fault repair difficulty is reduced, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicle technology, and in particular to a vehicle-mounted log recording method, device, electronic device, medium and vehicle. Background Art

[0002] Currently, with the development of vehicle technology, multiple hardware inside the vehicle usually share one controller for control, and the software logic is relatively complex.

[0003] In the related art, the freeze frame mode is usually used to troubleshoot vehicle faults. However, in actual applications, it is found that the freeze frame troubleshooting mode only records the vehicle's operating status when the vehicle fails, and cannot troubleshoot the abnormal points of the controller's internal software, causing inconvenience to vehicle fault troubleshooting.

[0004] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the invention

[0005] The embodiments of the present application provide a vehicle-mounted log recording method, device, electronic device, medium and vehicle, which can reproduce the fault condition based on the log information, so as to accurately locate the abnormal points within the software program, which helps to improve the efficiency of subsequent vehicle fault troubleshooting operations.

[0006] On the one hand, an embodiment of the present application provides a vehicle-mounted log recording method, which is applied to a microprocessor and includes the following steps:

[0007] In response to the connection establishment request message sent by the micro control unit, a confirmation message is returned to the micro control unit to establish a communication connection with the micro control unit;

[0008] Receive log messages sent by the microcontroller unit;

[0009] Parse the log message and extract the log information and the number information of the microcontroller unit;

[0010] The log information and the serial number information of the micro control unit are recorded in the flash memory chip.

[0011] Optionally, the microprocessor and the micro control unit are communicatively connected via a running log management protocol, and a message format sent between the microprocessor and the micro control unit is a running log management protocol message format.

[0012] Optionally, the running log management protocol message format includes a message header and message data;

[0013] The message header includes the source address, destination address, message length, software module number, log danger level, and message type;

[0014] Message data includes log information, which is transmitted via the American Standard Code for Information Interchange.

[0015] Optionally, the log danger level includes a fatal error event level, a serious failure event level, a warning information event level, a notification information event level, and a debugging information event level.

[0016] Optionally, the message types include a connection establishment request message, a log message, a disconnection request message, a keep-alive request message, a keep-alive response message, and a confirmation message.

[0017] Optionally, before returning a confirmation message to the microcontroller in response to the connection establishment request message sent by the microcontroller, and establishing a communication connection with the microcontroller, the method further includes:

[0018] Initialize and set the numbering information of all microcontroller units and software module numbers;

[0019] The serial number information of all micro control units and the serial number of the software modules are summarized into an information table, and the information table is stored in the microprocessor.

[0020] Optionally, the method further comprises:

[0021] When the microprocessor and the microcontroller establish a communication connection, and the time during which no message is sent between the microprocessor and the microcontroller reaches a first threshold, sending a keep-alive request message to the microcontroller;

[0022] If no keep-alive response message returned by the microcontroller is received within the first preset time interval, releasing the communication connection link resources between the current microprocessor and the microcontroller;

[0023] If a keep-alive response message returned by the micro control unit is received within the first preset time interval, the communication connection link resources between the current microprocessor and the micro control unit are maintained.

[0024] On the other hand, an embodiment of the present application provides a vehicle-mounted log recording device, the device comprising:

[0025] A connection establishment module, used to respond to the connection establishment request message sent by the micro control unit, return a confirmation message to the micro control unit, and establish a communication connection with the micro control unit;

[0026] A message receiving module, used for receiving log messages sent by the micro control unit;

[0027] The message parsing module is used to parse the log message and extract the log information and the number information of the micro control unit;

[0028] The log recording module is used to record the log information and the serial number information of the micro control unit in the flash memory chip.

[0029] On the other hand, an embodiment of the present application provides an electronic device, which includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned vehicle log recording method when executing the computer program.

[0030] On the other hand, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned vehicle log recording method is implemented.

[0031] On the other hand, an embodiment of the present application provides a vehicle, which includes the above-mentioned vehicle-mounted log recording device or the above-mentioned electronic device.

[0032] The embodiment of the present application utilizes a microprocessor to establish a communication connection with a microcontroller unit, and obtains the vehicle-mounted log information of the microcontroller unit through message interaction. By collecting the log information of each microcontroller unit and storing it in a flash memory chip, when a vehicle fails, the fault condition can be reproduced based on the log information, thereby being able to accurately locate the abnormal points within the software program, helping to improve the efficiency of subsequent vehicle fault troubleshooting operations, thereby reducing the difficulty of vehicle fault repair and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 It is a schematic diagram of an implementation environment of a vehicle log recording method provided in an embodiment of the present application;

[0034] Figure 2 It is a flowchart of a vehicle log recording method provided by an embodiment of the present application;

[0035] Figure 3 It is a structural schematic diagram of a vehicle system architecture provided by an embodiment of the present application;

[0036] Figure 4 It is a structural diagram of a running log management protocol message format provided in an embodiment of the present application;

[0037] Figure 5 It is a signaling diagram of a vehicle log recording method provided in an embodiment of the present application;

[0038] Figure 6 It is a signaling diagram of another vehicle log recording method provided by an embodiment of the present application;

[0039] Figure 7 It is a structural schematic diagram of a vehicle-mounted log recording device provided in an embodiment of the present application;

[0040] Figure 8 It is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.

[0042] It is understood that the terms "first", "second", etc. used in this application can be used to describe various concepts in this article, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the embodiment of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".

[0043] The terms "at least one", "multiple", "each", "any", etc. used in this application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.

[0044] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0045] Currently, with the development of vehicle technology, multiple hardware inside a vehicle usually share one controller for control. For example, the vehicle's intelligent driving, smart cockpit, motor, battery, etc. are all controlled by one controller, making the software logic of the controller more complex.

[0046] In the related art, the freeze frame mode is usually used to troubleshoot vehicle faults. The freeze frame mode means that when a vehicle fails, the vehicle's operating status is recorded, such as vehicle speed, voltage, gear position and other information. However, in actual applications, it is found that the freeze frame troubleshooting mode only records the vehicle's operating status when the vehicle fails. In the current situation where multiple hardware inside the vehicle usually share a controller for control and the software logic of the controller is relatively complex, it is impossible to troubleshoot the abnormal points of the software inside the controller, which causes inconvenience to vehicle fault troubleshooting and easily affects the user experience.

[0047] In view of this, the embodiments of the present application provide a vehicle-mounted log recording method, device, equipment, medium and vehicle. By collecting the log information of each microcontroller unit and storing it in a flash memory chip, when a vehicle fails, the fault condition can be reproduced according to the log information, so that the abnormal point inside the software program can be accurately located, which helps to improve the efficiency of subsequent vehicle fault troubleshooting operations, thereby reducing the difficulty of vehicle fault repair and improving the user experience.

[0048] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.

[0049] The specific implementation of the embodiment of the present application is described in detail below in conjunction with the accompanying drawings. First, a vehicle log recording method provided in the embodiment of the present application is described in conjunction with the accompanying drawings.

[0050] Please refer to Figure 1 , Figure 1 The schematic diagram of the implementation environment of a vehicle log recording method provided by an embodiment of the present application is shown. In the implementation environment, the main software and hardware entities involved include a vehicle processor 110 and a server 120.

[0051] Specifically, the vehicle processor 110 may be installed with a related vehicle log recording control program, and the server 120 is a background server of the control program. The vehicle processor 110 and the background server 120 are connected in communication. The vehicle log recording method provided in the embodiment of the present application may be executed on the vehicle processor 110 side.

[0052] Server 120 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms.

[0053] In addition, the server 120 may also be a node server in the blockchain network.

[0054] The vehicle processor 110 and the server 120 may establish a communication connection via a wireless network. The wireless network uses standard communication technology and / or protocols, and the network may be set to the Internet, or any other network, such as but not limited to a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, or any combination of a wireless network, a private network, or a virtual private network. Furthermore, the above-mentioned software and hardware entities may use the same communication connection mode or different communication connection modes, and this application does not impose any specific restrictions on this.

[0055] Of course, it is understandable that Figure 1 The implementation environment in the embodiment of the present application is only some optional application scenarios of the vehicle log recording method provided in the embodiment of the present application, and the actual application is not fixed. Figure 1 The software and hardware environment shown is not specifically limited in this application.

[0056] like Figure 2 As shown, Figure 2 It is a flowchart of a vehicle log recording method provided in an embodiment of the present application, specifically including but not limited to steps S100 to S400.

[0057] Step S100: In response to the connection establishment request message sent by the micro control unit, a confirmation message is returned to the micro control unit to establish a communication connection with the micro control unit.

[0058] In an embodiment of the present application, the execution entity may be a microprocessor (MPU) disposed inside the vehicle. For example, an MPU chip loaded with a Linux operating system may be disposed and communicated with a microcontroller unit (MCU) inside the vehicle through a communication protocol.

[0059] Please refer to Figure 3 , Figure 3 It is a structural diagram of a whole vehicle system architecture provided in an embodiment of the present application. A microprocessor and four microcontroller units are arranged inside the vehicle system, and these four microcontroller units can establish communication connections with the microprocessor and perform message exchange.

[0060] Furthermore, during vehicle operation, when the microcontroller sends a connection establishment request message to the microprocessor, the microprocessor can determine whether to establish a communication connection with the microcontroller based on the current work task and load carrying capacity. If the microprocessor currently allows the establishment of a communication connection, it returns a confirmation message to the microcontroller to establish a communication connection.

[0061] Specifically, as an optional implementation, before returning a confirmation message to the microcontroller in response to the connection establishment request message sent by the microcontroller and establishing a communication connection with the microcontroller, the method further includes:

[0062] Initialize and set the numbering information of all microcontroller units and software module numbers;

[0063] The serial number information of all micro control units and the software module serial numbers are summarized into an information table, and the information table is stored in the microprocessor.

[0064] In the embodiments of this application, please refer to Figure 3 Before the microprocessor and the microcontroller establish a communication connection, since each microcontroller needs to be configured with an exclusive logical address to confirm the sending and receiving addresses of the message and distinguish which microcontroller unit transmits the message, the numbering information of all microcontrollers and the software module numbers in the microcontroller can also be initialized.

[0065] For example, Figure 3 There are 4 microcontroller units in total. The source address of microcontroller unit ① can be set to 0x1 in sequence, where 0x is the hexadecimal identifier and 1 is the number information; the source address of microcontroller unit ② can be set to 0x2, where 2 is the number information; the source address of microcontroller unit ③ can be set to 0x3, where 3 is the number information; the source address of microcontroller unit ④ can be set to 0x4, where 4 is the number information.

[0066] Furthermore, for example, there are three software modules in the micro control unit ①, namely the time management module, the diagnosis module, and the communication module. The software module number of the time management module can be initialized to 0001, the software module number of the diagnosis module can be initialized to 0002, and the software module number of the communication module can be initialized to 0003.

[0067] It is understandable that the IP address, port information and destination address of the microprocessor can also be initialized and set, such as Figure 3 As shown, the IP address of the microprocessor can be set to 172.20.0.9, the port number can be set to 1234, and the destination address can be set to 0xE.

[0068] Furthermore, the numbering information of all microcontroller units and the software module numbers can be summarized into an information table, and the information table can be stored in the microprocessor, so that when the microprocessor establishes a communication connection with any microcontroller unit and exchanges messages, the source of the message can be determined and the software module numbering information configured by the microcontroller can be confirmed based on the message content.

[0069] Of course, it should be noted that the above initialization settings for the microcontroller unit and the microprocessor are only used for illustrative purposes and do not mean to limit the actual initialization settings, which can be independently defined according to the actual usage scenario requirements.

[0070] Step S200: receiving a log message sent by the micro control unit.

[0071] In the embodiment of the present application, since the microcontroller itself does not have the ability to store log files, after a communication connection is established between the microprocessor and the microcontroller, the microprocessor can receive the log message sent by the microcontroller and transmit the log file information to the microprocessor.

[0072] It is understandable that the microprocessor can perform message interaction with multiple microcontroller units at the same time based on its own processing performance, thereby improving the efficiency of vehicle log recording.

[0073] Step S300: parse the log message to extract log information and serial number information of the micro control unit.

[0074] In an embodiment of the present application, after the microprocessor and the microcontroller establish a communication connection, messages can be sent according to a pre-declared message format during message exchange, so that the microprocessor and the microcontroller can parse the messages according to the message format after receiving them.

[0075] Therefore, when the microprocessor receives the log message sent by the microcontroller unit, it can extract the corresponding log information and the number information of the microcontroller unit that sent the log message.

[0076] Specifically, as an optional implementation, the microprocessor and the micro control unit are communicatively connected via a running log management protocol, and the message format sent between the microprocessor and the micro control unit is a running log management protocol message format.

[0077] In an embodiment of the present application, the Runtime Log Management (RLM) protocol refers to the process of collecting, storing, analyzing and managing log data generated by applications, systems and services during operation. That is to say, when the log information generated by the microcontroller unit in the working state will follow the RLM protocol and be sent to the microprocessor after the communication connection is established through the message format of the RLM protocol, and the microprocessor will record and store the log information.

[0078] It can be understood that the communication connection between the microprocessor and the micro control unit through the RLM protocol can significantly improve the maintainability, reliability and safety of the micro control unit.

[0079] Specifically, as an optional implementation, the running log management protocol message format includes a message header and message data;

[0080] The message header includes the source address, destination address, message length, software module number, log danger level and message type;

[0081] The message data includes log information, and the log information is transmitted via the American Standard Code for Information Interchange.

[0082] Please refer to Figure 4 , Figure 4 It is a structural diagram of a run log management protocol message format provided in an embodiment of the present application. The run log management protocol message format mainly includes two parts: a message header and message data. Among them, the message header can be subdivided into source address, destination address, message length, software module number, log danger level and message type.

[0083] It can be understood that the source address is the sender of the message, the destination address is the receiver of the message, the message length refers to the software module number, the log danger level, the message type and the total length of the message data. The software module number is the number information of the software module to which the log information belongs, which can be pre-initialized by the user according to the specific usage scenario. The log danger level is the danger level of the log information carried in the log message, and the message type is used to distinguish messages with different functions.

[0084] Furthermore, the message data includes log information, and the log information can be transmitted via the American Standard Code for Information Interchange (ASCII), so that the microprocessor can parse the log information carried in the log message.

[0085] As an optional embodiment, the log danger level includes a fatal error event level, a serious failure event level, a warning information event level, a notification information event level, and a debugging information event level.

[0086] For example, Table 1 is a log danger level classification table. As shown in Table 1, the log danger level can be divided into five levels, namely, fatal error event level, serious fault event level, warning information event level, notification information event level, and debugging information event level. Among them, the log information of the fatal error event level will point out that each serious error event will cause the application to exit, indicating a major error, and the program needs to be stopped directly; the log information of the serious fault event level reflects that the system has a very serious fault and cannot automatically recover to normal operation, requiring manual intervention; the log information of the warning information event level indicates that the system may have potential errors; the log information of the notification information event level is mainly used to print the information that the user is concerned about or important; the log information of the debugging information event level is mainly used to print the running information of the software module during the development process.

[0087] It is understandable that when the message type is a non-log message, the log danger level can be filled with 0 for identification.

[0088] Table 1 Log hazard level classification table

[0089]

[0090]

[0091] As an optional embodiment, the message types include a connection establishment request message, a log message, a disconnection request message, a keep-alive request message, a keep-alive response message, and a confirmation message.

[0092] Exemplarily, Table 2 is a message type classification table. As shown in Table 2, the message types can be divided into six types, namely, connection establishment request message, log message, disconnection request message, keep-alive request message, keep-alive response message and confirmation message. Among them, the message of the connection establishment request message type represents that the current microcontrol unit requests the microprocessor to establish a communication connection; the message of the log message type represents that the current microcontrol unit sends a message carrying log information to the microprocessor; the message of the disconnection request message type represents that the current microcontrol unit requests the microprocessor to disconnect the communication connection; the keep-alive request message and the keep-alive response message are messages used by the microprocessor and the microcontrol unit to confirm whether the other party is still online when there is no message interaction for a long time.

[0093] It is understandable that the confirmation message refers to the Ack (Acknowledgement) message, which is generally used to indicate confirmation of receipt of the message sent by the other party. Exemplarily, in an embodiment of the present application, it can be set that the receiver returns the Ack message only when the message type number of the sender is 0x1, 0x2, or 0x3. In addition, when the message type number is 0x1 or 0x3, the message data of the Ack message can be filled with 0x0 to represent the successful execution of the request to establish or disconnect the communication connection; the message data of the Ack message can be filled with 0x1 to represent the failure of the execution. When the message type is 0x2, that is, a log message, the message data of the Ack message can be filled with 0x0 to represent successful reception of the log message; the message data of the Ack message can be filled with 0x1 to represent a reception failure, and the reason for the failure is that the communication connection has not been established; the message data of the Ack message can be filled with 0x2 to represent a reception failure, and the reason for the failure is that the source address does not exist; the message data of the Ack message can be filled with 0x3 to represent a reception failure, and the reason for the failure is that the destination address is incorrect; the message data of the Ack message can be filled with 0x4 to represent a reception failure, and the reason for the failure is that the current software module does not exist in the microcontroller unit; the message data of the Ack message can be filled with 0x5 to represent a reception failure, and the reason for the failure is that the current log danger level does not exist; the message data of the Ack message can be filled with 0x6 to represent a reception failure, and the reason for the failure is that the current message type does not exist; the message data of the Ack message can be filled with 0x7 to represent a reception failure, and the reason for the failure is a general error (General Reject).

[0094] Table 2 Message type classification table

[0095]

[0096]

[0097] It should be noted that the introduction of the log danger levels and message types provided in the above embodiments is only used for exemplary purposes and does not mean to limit the actual log danger levels and message types.

[0098] Step S400: Record the log information and the serial number information of the micro control unit in a flash memory chip.

[0099] In an embodiment of the present application, after the microprocessor parses the log message and extracts the log information and the number information of the microcontroller unit, this information can be recorded in the flash memory chip, which helps engineers to quickly access the log information of the relevant software modules when troubleshooting and repairing vehicle problems, and restore the vehicle status before and after the problem occurs, thereby significantly improving the ability to locate abnormal points, thereby reducing the difficulty of vehicle fault repair and improving the user experience, which is not available in the existing freeze frame mode.

[0100] As an optional implementation, Ethernet communication can be used between the microcontroller unit and the microprocessor inside the vehicle system. Communication can be achieved by laying network cables, and the transmission rate is relatively fast.

[0101] Below, combined with the specific application implementation process, the vehicle log recording method provided in this application is explained and described in detail:

[0102] As an optional implementation, please refer to Figure 5 , Figure 5 It is a signaling diagram of a vehicle log recording method provided in an embodiment of the present application, which mainly includes a signaling process for message interaction between a microcontroller unit with an address of 0x1 and a microprocessor with an address of 0xE.

[0103] First, the microcontroller sends a connection establishment request message to the microprocessor: 0001 000E 00000004000000 01, where 0001 is the source address of the microcontroller, 000E is the destination address of the microprocessor, and 00000004 represents a message length of 4, specifically: the length of the software module number 0000 is 2, and because it is a non-log message type, it is filled with 0x0 by default; the length of the log danger level 00 is 1, and because it is a non-log message type, it is filled with 0x0 by default; the length of the message type 01 is 1, representing a connection establishment request message.

[0104] Furthermore, after the microprocessor receives the connection establishment request message sent by the microcontroller, it determines whether the current usage scenario can establish a connection. If so, 0x0 is filled in the message data part of the returned confirmation message, indicating that the request is successfully executed; if not, 0x1 is filled in the message data part of the returned confirmation message, indicating that the request fails to execute. Therefore, when the microcontroller receives the returned confirmation message, it can determine whether the communication connection is successfully established based on whether the content filled in the message data part of the confirmation message is 00. If it is not 0x0, it means that the communication connection has failed to be established, and it returns to the dormant state to wait for the next time to initiate a connection establishment request; if it is 0x0, it means that the communication connection is successfully established, and a log message can be further sent.

[0105] Exemplarily, the microcontroller unit sends a log message: 0001 000E 00000009 0003 010248454C4C4F, wherein 0001 is the source address of the microcontroller unit, 000E is the destination address of the microprocessor, 00000009 represents that the message length is 9, the software module number 0003 refers to the communication software module, the log danger level 01 represents that the danger level of the log information in the log message is the fatal error event level, the message type 02 represents that the current message type is a log message, the message data content 48454C4C4F is an ASCII code, and the corresponding log information is hello.

[0106] Furthermore, after receiving the log message, the microprocessor can parse the log message to extract the log information hello and the number information of the microcontroller (i.e. 0x1), and can compare it with the information table pre-stored in the microprocessor to determine whether the vehicle log is successfully recorded in the flash chip, and return a confirmation message to the microcontroller. It is understandable that when the log is successfully recorded, the message data part in the confirmation message is filled with 0x0; when the log is not successfully recorded, the corresponding data can be selected to fill the message data part in the confirmation message according to the specific cause of failure, for example, filling 0x7 means that the cause of failure is a general error.

[0107] Finally, when the message interaction between the two parties is completed, the microcontroller unit can determine whether to disconnect the current communication connection. If the communication connection is still not disconnected, the microcontroller unit returns to maintain the current state; if the communication connection needs to be disconnected, the microcontroller unit can send a disconnection request message to the microprocessor, specifically the message type in the message is 0x3.

[0108] Furthermore, the microprocessor determines whether the connection can be disconnected according to the current working environment. If so, 0x0 is filled in the message data part of the returned confirmation message, indicating that the request is successfully executed; if not, 0x1 is filled in the message data part of the returned confirmation message, indicating that the request fails to be executed. Therefore, when the microcontroller receives the returned confirmation message, it can determine whether the disconnection of the communication connection is successful according to whether the content filled in the message data part of the confirmation message is 00. If it is not 0x0, it means that the disconnection of the communication connection has failed, and it returns to the standby state to wait for the next disconnection and connection request; if it is 0x0, it means that the disconnection of the communication connection is successful, and the message interaction process ends.

[0109] Specifically, in a possible implementation manner, the method further includes:

[0110] When the microprocessor establishes a communication connection with the micro control unit, and the time during which no message is sent between the microprocessor and the micro control unit reaches a first threshold, sending a keep-alive request message to the micro control unit;

[0111] If no keep-alive response message returned by the micro control unit is received within a first preset time interval, releasing the current communication connection link resources between the microprocessor and the micro control unit;

[0112] If a keep-alive response message returned by the micro control unit is received within a first preset time interval, the current communication connection link resources between the microprocessor and the micro control unit are maintained.

[0113] In an embodiment of the present application, in order to better manage and control communication connection link resources, the microprocessor and the microcontroller unit may also interact through messages to confirm whether it is necessary to maintain an active state of the communication connection.

[0114] Please refer to Figure 6 , Figure 6 It is a signaling diagram of another vehicle log recording method provided in an embodiment of the present application, which mainly includes a signaling process of a microcontroller unit with an address of 0x1 and a microprocessor with an address of 0xE performing message interaction:

[0115] After the microcontrol unit and the microprocessor establish a communication connection, if the time for not sending any message reaches the first threshold, the microprocessor will respond to the inspection mechanism and send a keep-alive request message 000E0001 00000004 000000 04 to the microcontrol unit, where the message type 0x4 refers to the keep-alive request message. For example, the first threshold can be set to 60 minutes, that is, when the microcontrol unit and the microprocessor establish a communication connection, if neither party sends any message within 60 minutes, the microprocessor will respond to the inspection mechanism and send a keep-alive request message to the microcontrol unit to query whether the other party is still online, so as to determine whether to maintain the current communication connection link resources.

[0116] Furthermore, if the micro control unit is still online, after receiving the keep-alive request message, it can return a keep-alive response message 0001 000E 00000004 0000 00 05, where the message type 0x5 refers to the keep-alive response message; if the micro control unit is already offline, no message will be returned.

[0117] Therefore, the microprocessor can determine whether the microcontroller unit is still in an online state by judging whether a keep-alive response message returned by the microcontroller unit is received within the first preset time interval. If a keep-alive response message is received, it means that the current microcontroller unit is still active and the current communication connection link resources need to be maintained; if no keep-alive response message is received, it means that the current microcontroller unit is no longer active and the current communication connection link resources can be released, thereby achieving the effect of reasonably managing the communication connection link resources of the microprocessor.

[0118] See also Figure 7 The embodiment of the present application further provides a vehicle-mounted log recording device 700, which can implement the above-mentioned vehicle-mounted log recording method, and the device includes:

[0119] The connection establishment module 710 is used to respond to the connection establishment request message sent by the micro control unit, return a confirmation message to the micro control unit, and establish a communication connection with the micro control unit;

[0120] The message receiving module 720 is used to receive the log message sent by the micro control unit;

[0121] The message parsing module 730 is used to parse the log message and extract the log information and the serial number information of the micro control unit;

[0122] The log recording module 740 is used to record the log information and the serial number information of the micro control unit in a flash memory chip.

[0123] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0124] Please refer to Figure 8 , Figure 8 The hardware structure of the electronic device provided in the embodiment of the present application is illustrated, and the electronic device includes:

[0125] The processor 801 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0126] The memory 802 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 802 can store an operating system and other applications. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 802, and the processor 801 calls and executes the vehicle log recording method of the embodiment of this application;

[0127] Input / output interface 803, used to implement information input and output;

[0128] The communication interface 804 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);

[0129] A bus 805 that transmits information between the various components of the device (e.g., the processor 801, the memory 802, the input / output interface 803, and the communication interface 804);

[0130] The processor 801 , the memory 802 , the input / output interface 803 and the communication interface 804 are connected to each other in communication within the device via a bus 805 .

[0131] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned vehicle log recording method is implemented.

[0132] It can be understood that the contents of the above method embodiments are all applicable to the present storage medium embodiments, the functions specifically implemented by the present storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0133] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0134] Specifically, in a possible implementation, an embodiment of the present application further provides a vehicle, which includes the above-mentioned vehicle-mounted log recording device or the above-mentioned electronic device.

[0135] Specifically, the vehicle may be a private car, such as a sedan, a multi-purpose vehicle, a sports utility vehicle, or a pickup truck, etc. The vehicle may also be an operating vehicle, such as a van, a bus, a small truck, or a large trailer, etc. The vehicle may be a gasoline vehicle or a new energy vehicle. When the vehicle is a new energy vehicle, it may be a hybrid vehicle or a pure electric vehicle.

[0136] The embodiments of the present application provide a vehicle-mounted log recording method, device, equipment, medium and vehicle, which collects log information of each microcontroller unit and stores it in a flash memory chip. When a vehicle fails, the fault condition can be reproduced based on the log information, thereby accurately locating the abnormal points within the software program, helping to improve the efficiency of subsequent vehicle fault troubleshooting operations, thereby reducing the difficulty of vehicle fault repair and improving the user experience.

[0137] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0138] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0139] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0140] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0141] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0142] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0143] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, 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 through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

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

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

[0146] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.

[0147] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.

Claims

1. A vehicle log recording method, characterized in that: Applied to a microprocessor, the method comprises the following steps: In response to the connection establishment request message sent by the micro control unit, a confirmation message is returned to the micro control unit to establish a communication connection with the micro control unit; Receiving a log message sent by the micro control unit; Parsing the log message to extract log information and number information of the micro control unit; The log information and the serial number information of the micro control unit are recorded in a flash memory chip.

2. The vehicle log recording method according to claim 1, characterized in that: The microprocessor and the microcontroller unit are connected in communication via the operation log management protocol, and the message format sent between the microprocessor and the microcontroller unit is the message format of the operation log management protocol.

3. The vehicle log recording method according to claim 2, characterized in that: The message format of the operation log management protocol includes a message header and message data; The message header includes the source address, destination address, message length, software module number, log danger level and message type; The message data includes log information, and the log information is transmitted via the American Standard Code for Information Interchange.

4. The vehicle log recording method according to claim 3, characterized in that: The log danger level includes a fatal error event level, a serious fault event level, a warning information event level, a notification information event level, and a debugging information event level.

5. The vehicle log recording method according to claim 3, characterized in that: The message types include a connection establishment request message, a log message, a disconnection request message, a keep-alive request message, a keep-alive response message, and a confirmation message.

6. The vehicle log recording method according to claim 1, characterized in that: Before returning a confirmation message to the microcontroller in response to the connection establishment request message sent by the microcontroller and establishing a communication connection with the microcontroller, the method further includes: Initialize and set the numbering information of all microcontroller units and software module numbers; The serial number information of all micro control units and the software module serial numbers are summarized into an information table, and the information table is stored in the microprocessor.

7. The vehicle log recording method according to claim 1, characterized in that: The method further comprises: When the microprocessor establishes a communication connection with the micro control unit, and the time during which no message is sent between the microprocessor and the micro control unit reaches a first threshold, sending a keep-alive request message to the micro control unit; If no keep-alive response message returned by the micro control unit is received within a first preset time interval, releasing the current communication connection link resources between the microprocessor and the micro control unit; If a keep-alive response message returned by the micro control unit is received within a first preset time interval, the current communication connection link resources between the microprocessor and the micro control unit are maintained.

8. A vehicle-mounted log recording device, characterized in that: The device comprises: A connection establishment module, used to respond to the connection establishment request message sent by the micro control unit, return a confirmation message to the micro control unit, and establish a communication connection with the micro control unit; A message receiving module, used for receiving log messages sent by the micro control unit; A message parsing module, used to parse the log message and extract the log information and the serial number information of the micro control unit; The log recording module is used to record the log information and the serial number information of the micro control unit in a flash memory chip.

9. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the vehicle log recording method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the vehicle-mounted log recording method according to any one of claims 1 to 7 is implemented.

11. A vehicle, characterized in that: The vehicle includes the vehicle-mounted log recording device according to claim 8 or the electronic device according to claim 9.