Message processing method and device
By encapsulating and dropping the vehicle's pending messages, the frame drop problem when the vehicle sends data to the server is solved, ensuring data integrity and continuity, and improving the accuracy of analysis of vehicle problems.
Patent Information
- Application Number
- CN202311385426.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-24
- Publication Date
- 2025-04-25
AI Technical Summary
When a vehicle sends bus data to the server, if the vehicle is dormant or powered off, it is difficult to ensure the completion and continuity of the data frame, resulting in frame loss and affecting the accurate analysis of vehicle problems.
By obtaining the vehicle's pending messages and encapsulating them according to the preset message packaging format, an encapsulated data packet is formed. If the encapsulated data packet is not successfully sent to the server, it will be dropped into the preset data pool, and after the vehicle establishes a communication connection with the server, the drop-off data packet will be resent.
Ensure the integrity and continuity of messages received by the server, avoid frame drops, and thus improve the analysis efficiency and accuracy of vehicle problems.
Smart Images

Figure CN119892782A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a message processing method and device. Background Art
[0002] With the rapid development of new energy vehicles, the number of sensors and ECUs (Electronic Control Units) on vehicles is increasing. The data of each electronic control unit is transmitted through the bus. Therefore, collecting complete vehicle bus messages plays a vital role in analyzing vehicle problems.
[0003] At present, a method for analyzing vehicle problems includes: sending the bus data of the vehicle to the server, and analyzing the data in the server to obtain the vehicle problem. However, in the process of sending the bus data to the server, if the vehicle is dormant or powered off, it is difficult to ensure the completeness and continuity of the message sent to the server, resulting in the loss of data frames, which is not conducive to the accurate analysis of the vehicle problem. Therefore, how to avoid the frame loss phenomenon when the vehicle sends the vehicle message to the server is an urgent problem to be solved. Summary of the invention
[0004] In order to solve the problem of frame loss when a vehicle sends a vehicle message to a server, an embodiment of the present application provides a message processing method, device, electronic device and computer-readable storage medium to avoid frame loss in the process of collecting vehicle messages.
[0005] In a first aspect, an embodiment of the present application provides a message processing method, including:
[0006] Acquire a message to be processed of the vehicle, and encapsulate the message to be processed according to a preset message encapsulation format to obtain at least one encapsulated data packet;
[0007] Sending the at least one encapsulated data packet to the server, and determining whether the at least one encapsulated data packet is successfully sent to the server according to the response information returned by the server;
[0008] If it is determined that there is a target encapsulated data packet in the at least one encapsulated data packet that has not been successfully sent to the server, the target encapsulated data packet is dropped to a preset data pool to form a dropped data packet, so as to resend the dropped data packet to the server.
[0009] As an optional implementation of the embodiment of the present application, after the target encapsulated data packet is stored in a disk to a preset data pool to form a disk data packet, the method further includes:
[0010] Determining whether a communication connection is successfully established between the vehicle and the server;
[0011] When the vehicle successfully establishes a communication connection with the server, the disk data packet is resent to the server.
[0012] As an optional implementation of the embodiment of the present application, the obtaining of the to-be-processed message of the vehicle includes:
[0013] Acquire filter configuration information of the vehicle, where the filter configuration information is used to indicate whether to filter the vehicle message;
[0014] If the filter configuration information indicates that the vehicle messages are not to be filtered, all acquired vehicle messages are determined as the messages to be processed.
[0015] As an optional implementation of the embodiment of the present application, the method further includes:
[0016] If the filter configuration information indicates to filter the vehicle message, the acquired vehicle message is filtered according to the target signal, and the vehicle message corresponding to the filtered target signal is determined as the message to be processed.
[0017] As an optional implementation of the embodiment of the present application, the attribute parameters of the message to be processed include: the message type, channel number, message identifier and message length of the message to be processed;
[0018] The step of encapsulating the message to be processed according to a preset message encapsulation format to obtain at least one encapsulated data packet includes:
[0019] Concatenate the message type, channel number, message identifier and message length of each message in the to-be-processed message to obtain at least one data frame;
[0020] The at least one data frame, the header information of the at least one data frame, the message length of the at least one data frame, and the check information are combined to obtain the at least one encapsulated data packet.
[0021] As an optional implementation of the embodiment of the present application, the combining of the at least one data frame, the header information of the at least one data frame, the message length of the at least one data frame, and the check information to obtain the at least one encapsulated data packet includes:
[0022] Starting with the header information of the at least one data frame, the at least one data frame and the check information are sequentially combined to obtain the at least one encapsulated data packet, and the check information is spliced to the end of the at least one data frame.
[0023] As an optional implementation of the embodiment of the present application, the method further includes:
[0024] Obtaining the proportion of the total storage space of the preset data pool occupied by the data packets stored on the disk;
[0025] If the occupied space ratio is greater than a preset ratio, the disk-placed data packets are cleared according to the disk-placed time of the disk-placed data packets.
[0026] In a second aspect, an embodiment of the present application provides a message processing device, comprising:
[0027] The acquisition module is used to obtain the vehicle's pending messages.
[0028] An encapsulation module, configured to encapsulate the message to be processed according to a preset message encapsulation format to obtain at least one encapsulated data packet, wherein each of the at least one encapsulated data packet comprises: at least one data frame, header information of the at least one data frame, a message length of the at least one data frame, and check information, and each of the at least one data frame comprises attribute parameters of the message to be processed;
[0029] A sending module, used for sending the at least one encapsulated data packet to a server;
[0030] A judging module, configured to judge whether the at least one encapsulated data packet is successfully sent to the server according to the response information returned by the server;
[0031] The processing module is used to write the target encapsulated data packet to a preset data pool to form a disk-written data packet if it is determined that there is a target encapsulated data packet that has not been successfully sent to the server in the at least one encapsulated data packet, so as to resend the disk-written data packet to the server.
[0032] As an optional implementation of the embodiment of the present application, the device further includes:
[0033] A judgment module, used to judge whether the vehicle has successfully established a communication connection with the server;
[0034] When the vehicle successfully establishes a communication connection with the server, the disk data packet is resent to the server.
[0035] As an optional implementation of the embodiment of the present application, the acquisition module is specifically used to acquire filter configuration information of the vehicle, and the filter configuration information is used to indicate whether to filter the vehicle message;
[0036] If the filter configuration information indicates that the vehicle messages are not to be filtered, all acquired vehicle messages are determined as the messages to be processed.
[0037] As an optional implementation of the embodiment of the present application, if the filter configuration information indicates that the vehicle message is to be filtered, the acquisition module is also used to filter the acquired vehicle message according to the target signal, and determine the vehicle message corresponding to the filtered target signal as the message to be processed.
[0038] As an optional implementation of the embodiment of the present application, the attribute parameters of the message to be processed include: the message type, channel number, message identifier and message length of the message to be processed;
[0039] The encapsulation module is specifically used to concatenate the message type, channel number, message identifier and message length of each message in the to-be-processed message to obtain at least one data frame;
[0040] The at least one data frame, the header information of the at least one data frame, the message length of the at least one data frame, and the check information are combined to obtain the at least one encapsulated data packet.
[0041] As an optional implementation of the embodiment of the present application, the encapsulation module is specifically used to start with the header information of the at least one data frame, and sequentially combine with the message length of the at least one data frame, the at least one data frame, and the verification information to obtain the at least one encapsulated data packet, and the verification information is spliced to the end of the at least one data frame.
[0042] As an optional implementation of the embodiment of the present application, the device further includes:
[0043] A cleaning module, used for obtaining the proportion of the total storage space of the preset data pool occupied by the data packets dropped to the disk;
[0044] If the occupied space ratio is greater than a preset ratio, the disk-placed data packets are cleared according to the disk-placed time of the disk-placed data packets.
[0045] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory and a processor, the memory being used to store a computer program, the processor being used to execute the message processing method described in the first aspect or any optional implementation manner of the first aspect when calling the computer program.
[0046] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the message processing method described in the first aspect or any optional implementation manner of the first aspect is implemented.
[0047] Compared with the prior art, the technical solution provided by the embodiments of the present application has the following advantages:
[0048] The embodiments of the present application provide a message processing method, device, electronic device and computer-readable storage medium, wherein the method includes: obtaining a message to be processed of a vehicle, and encapsulating the message to be processed according to a preset message encapsulation format to obtain at least one encapsulated data packet; sending the at least one encapsulated data packet to a server, and judging whether the at least one encapsulated data packet is successfully sent to the server according to the response information returned by the server; if it is determined that there is a target encapsulated data packet that has not been successfully sent to the server in the at least one encapsulated data packet, then the target encapsulated data packet is dropped to a preset data pool to form a dropped data packet, so that the dropped data packet can be resent to the server. The embodiments of the present application provide a preset data pool for storing target encapsulated data packets that have not been successfully sent to the server, so that the target encapsulated data packets that have not been successfully sent to the server can be dropped to the preset data pool, and the dropped data packets in the preset data pool can be resent to the server, thereby ensuring the integrity of the message received by the server and avoiding frame loss. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0050] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0051] Figure 1 A flowchart of a message processing method provided according to one or more embodiments of the present application;
[0052] Figure 2 A schematic diagram of a process for encapsulating a message to be processed according to one or more embodiments of the present application;
[0053] Figure 3 A flowchart of a message processing method provided according to one or more embodiments of the present application;
[0054] Figure 4A flowchart of a message processing method provided according to one or more embodiments of the present application;
[0055] Figure 5 A structural block diagram of a message processing device provided for one or more embodiments of the present application;
[0056] Figure 6 A structural block diagram of a message processing device provided for one or more embodiments of the present application;
[0057] Figure 7 The present invention is a diagram of the internal structure of an electronic device provided according to one or more embodiments of the present application. DETAILED DESCRIPTION
[0058] In order to make the purpose, implementation mode and advantages of the present application clearer, the exemplary implementation mode of the present application will be clearly and completely described below in conjunction with the drawings in the exemplary embodiments of the present application. Obviously, the described exemplary embodiments are only part of the embodiments of the present application, not all of the embodiments.
[0059] Based on the exemplary embodiments described in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the claims attached to this application. In addition, although the disclosure in this application is introduced according to one or several exemplary examples, it should be understood that each aspect of these disclosures can also constitute a complete implementation method separately. It should be noted that the brief description of the terms in this application is only for the convenience of understanding the implementation methods described below, and is not intended to limit the implementation methods of this application. Unless otherwise specified, these terms should be understood according to their common and usual meanings.
[0060] First, the application scenario of the embodiment of the present application is described. With the development of automobile electrification, the functions of vehicles are becoming more and more abundant, and the number of sensors and ECUs on vehicles is also increasing. The data of each ECU will be transmitted through the bus. Therefore, when analyzing the problems of the vehicle, it is necessary to collect bus messages. In order to quickly analyze the vehicle problems, the bus messages of the vehicle are usually sent to the server, and the analysts analyze based on the data in the server. However, in the process of the vehicle sending data to the server, if there is sleep or power off, it is difficult to ensure the completeness and continuity of the message sent to the server, resulting in the phenomenon of lost data frames, which is not conducive to the accurate analysis of vehicle problems.
[0061] Based on this, an embodiment of the present application provides a message processing method and device, wherein the method provides a preset data pool for storing target encapsulated data packets that have not been successfully sent to the server, and can store target encapsulated data packets that have not been successfully sent to the server in the preset data pool. When it is determined that a communication connection has been established between the vehicle and the server, the stored data packets in the preset data pool are resent to the server, thereby ensuring the continuity and integrity of the messages received by the server, avoiding frame loss, and improving the efficiency and accuracy of analyzing vehicle problems.
[0062] The message processing method provided in the embodiment of the present application can be executed by the electronic device provided in the embodiment of the present application. The electronic device provided in the embodiment of the present application can be but is not limited to an electronic device (such as an on-board computer), an on-board infotainment product, etc., or the message processing method provided in the embodiment of the present application can also be implemented by a functional module or functional entity on the vehicle.
[0063] The message processing method provided in the embodiments of the present application is described in detail below through several specific embodiments.
[0064] Figure 1 A schematic diagram of a flow chart of a message processing method provided in an embodiment of the present application, referring to Figure 1 As shown, the message processing method provided in this embodiment includes the following steps:
[0065] S11. Obtain the vehicle's message to be processed.
[0066] The message to be processed here can be a bus message that needs to be sent to the server, and the bus message can include a CAN bus message and a LIN bus message, or it can also be other vehicle messages that need to be sent to the server. Exemplarily, the acquisition module on the vehicle can acquire the message to be processed from the CAN bus or the LIN bus based on the IPCF communication protocol.
[0067] When all vehicle messages need to be sent to the server, all vehicle messages are pending messages. When the vehicle messages need to be filtered and sent to the server, the pending messages need to be determined based on the vehicle's filter configuration information. Exemplarily, in some embodiments, the vehicle's filter configuration information can be obtained from the server based on the mesh-configure protocol, and the filter configuration information is used to indicate whether to filter the vehicle messages; mesh-configure is a low-latency Internet of Things protocol that can be actively initiated by the vehicle to connect to the server.
[0068] If the filter configuration information indicates that the vehicle messages are not to be filtered, all acquired vehicle messages are determined as the messages to be processed; if the filter configuration information indicates that the vehicle messages are to be filtered, the acquired vehicle messages are filtered according to the target signal, and the vehicle messages corresponding to the filtered target signal are determined as the messages to be processed.
[0069] In some embodiments, the filter configuration information instructs the vehicle to filter vehicle messages other than vehicle messages corresponding to the target signal, and only send the vehicle messages corresponding to the target signal to the server. Exemplarily, the target signal may be a collision detection signal, etc.
[0070] When the target signal can be a collision detection signal, the vehicle message is filtered and processed. In the event of a vehicle collision, the vehicle message at the collision detection time point can be uploaded to the server first to analyze the cause of the collision. The filter configuration information greatly improves the efficiency of after-sales service and fault location, saving costs.
[0071] S12. Encapsulate the message to be processed according to a preset message encapsulation format to obtain at least one encapsulated data packet.
[0072] Among them, each encapsulated data packet in the at least one encapsulated data packet includes: at least one data frame, header information of the at least one data frame, message length of the at least one data frame, and verification information, and each data frame in the at least one data frame includes attribute parameters of the message to be processed.
[0073] When the attribute parameters of the message to be processed include: the message type, channel number, message identifier and message length of the message to be processed, the message to be processed can be encapsulated in the following manner: the message type, channel number, message identifier and message length of each message in the message to be processed are concatenated to obtain at least one data frame; the at least one data frame, the header information of the at least one data frame, the message length of the at least one data frame, and the check information are combined to obtain the at least one encapsulated data packet.
[0074] The combining of the at least one data frame, the header information of the at least one data frame, the message length of the at least one data frame, and the check information to obtain the at least one encapsulated data packet includes:
[0075] Starting with the header information of the at least one data frame, the at least one data frame and the check information are sequentially combined to obtain the at least one encapsulated data packet, and the check information is spliced to the end of the at least one data frame. During the encapsulation process, a specific timestamp is marked for each data frame. The timestamp can be at the microsecond level. The size of each data frame is limited to less than 70K. Figure 2 As shown, Figure 2 This is a schematic diagram of the encapsulation process of the message to be processed. For example, the header information of each data frame occupies 2 bytes, the message length of at least one data frame occupies 3 bytes, the check information occupies 1 byte, the data frame size occupies 3 bytes, the timestamp occupies 6 bytes, the message type of the message to be processed occupies 1 byte, the message identifier occupies 2 bytes, and the message length occupies 2 bytes. This is just an example and no limitation is imposed.
[0076] Each data frame has a corresponding timestamp, and at least one data frame can be sorted based on the timestamp to ensure the continuity of the data frames, thereby ensuring the continuity of the vehicle messages received by the server.
[0077] S13. Send the at least one encapsulated data packet to a server.
[0078] Exemplarily, the encapsulation module of the vehicle sends the encapsulated data packet to the central control system HU of the vehicle across the domain using the DDS network, and sends the at least one encapsulated data packet to the server based on the HU, so that the server performs security verification, message parsing, and message playback on the received encapsulated data packet to analyze the scene where the vehicle is located. At least one encapsulated data packet can be sent to the server according to the timestamp to ensure the message continuity of the encapsulated data packet received by the server.
[0079] HU has the largest memory and computing power compared to other domain controllers. It can directly connect to the messages and data of other domain control systems and vehicle control computing units. Other domains send messages and data to HU through memory and disk reading and writing. The application of HU avoids the overhead caused by repetitive messages and greatly saves network resources.
[0080] S14. Determine whether the at least one encapsulated data packet is successfully sent to the server according to the response information returned by the server.
[0081] If it is determined that there is a target encapsulated data packet that has not been successfully sent to the server among the at least one encapsulated data packet, the following step S15 is executed.
[0082] Exemplarily, if the response information is a response information of successful reception, it is determined that all encapsulated data packets are successfully sent to the server; if the response information is a response information of failed reception, it is determined that at least one encapsulated data packet has a target encapsulated data packet that is not successfully sent to the server.
[0083] S15: write the target encapsulated data packet to a preset data pool to form a written data packet, so as to resend the written data packet to the server.
[0084] That is, the dropped data packet is an encapsulated data packet that has not been successfully sent to the server. In an embodiment of the present application, at least one encapsulated data packet is obtained by obtaining the pending message of the vehicle and encapsulating the pending message according to a preset message encapsulation format; the at least one encapsulated data packet is sent to the server, and it is determined whether the at least one encapsulated data packet is successfully sent to the server; if it is determined that there is a target encapsulated data packet that has not been successfully sent to the server in the at least one encapsulated data packet, the target encapsulated data packet is dropped to a preset data pool to form a dropped data packet, so that the dropped data packet can be resent to the server. The embodiment of the present application provides a preset data pool for storing target encapsulated data packets that have not been successfully sent to the server. Therefore, the encapsulated data packets that have not been successfully sent to the server can be dropped to the preset data pool, so that the dropped data packets in the preset data pool can be resent to the server, thereby ensuring the integrity of the message received by the server and avoiding frame loss.
[0085] Further, in Figure 1 Based on the embodiment shown, after step S15, steps S31 to S32 are further included, referring to Figure 3 As shown, Figure 3 A flowchart of a message processing method provided in another embodiment of the present application. This embodiment will not be further described in detail. Figure 1 The same or similar steps in the embodiments shown are specifically described and illustrated. For details, please refer to Figure 1 Instructions and description of the steps shown.
[0086] S31, determining whether a communication connection is successfully established between the vehicle and the server.
[0087] When the vehicle successfully establishes a communication connection with the server, the following step S32 is performed:
[0088] S32: resend the disk data packet to the server.
[0089] Exemplarily, when it is detected that the vehicle is powered on again and a communication connection is successfully established between the vehicle and the server, the disk data packet in the preset data pool is resent to the server through the HU based on the http protocol.
[0090] In the embodiment of the present application, the process of the vehicle sending a data packet to the HU through the DDS protocol and the process of sending a data packet to the server based on the HU need to establish a network connection. Compared with the method of collecting vehicle messages based on the collection APP in the prior art, the network overhead and memory overhead are reduced.
[0091] Further, in Figure 1 or Figure 3 Based on the embodiment shown, after step S15, the following steps S41 to S42 are also included, referring to Figure 4 As shown, Figure 4 A flowchart of a message processing method provided in yet another embodiment of the present application is provided. Figure 4 by Figure 1 The embodiment shown is based on the example shown in the figure, and this embodiment will not be described in detail. Figure 1 The same or similar steps in the embodiments shown are specifically described and illustrated. For details, please refer to Figure 1 The embodiments shown are illustrated and described.
[0092] S41: Obtain the proportion of the total storage space of the preset data pool occupied by the data packets stored on the disk.
[0093] If the occupied space ratio is greater than the preset ratio, step S42 is executed.
[0094] S42: Clean up the data packets according to the time when the data packets were dropped on disk.
[0095] The cleaning of the data packets dropped to disk in the preset data pool follows the first-in-first-out principle. For example, if the drop time of data packet A is earlier than the drop time of data packet B, and the drop time of data packet B is earlier than the drop time of data packet C, then when it is determined that the proportion of storage space occupied by the dropped data packets in the preset data pool is greater than the preset proportion, data packet A is cleaned up first, then data packet B is cleaned up, and then data packet C is cleaned up to release the storage space of the preset data pool, so that the size of the preset data pool can be dynamically adjusted to continuously receive dropped data packets.
[0096] Based on the message processing method provided in the embodiment of the present disclosure, the vehicle messages can be sent in full or filtered based on the filter configuration information. The filter configuration information can be used to dynamically adjust the pending messages that need to be sent to the server, providing convenience for different users.
[0097] Based on the same inventive concept, as an implementation of the above method, the embodiment of the present application also provides a message processing device for executing the above embodiment. The device embodiment corresponds to the above method embodiment. For ease of reading, the device embodiment will no longer repeat the details of the above method embodiment one by one, but it should be clear that the message processing in this embodiment can correspond to the implementation of all the contents in the above method embodiment.
[0098] Figure 5 A schematic diagram of the structure of a message processing device provided in one embodiment of the present application is shown in FIG. Figure 5 As shown, the message processing device 500 provided in this embodiment includes:
[0099] The acquisition module 510 is used to acquire the message to be processed of the vehicle.
[0100] The encapsulation module 520 is used to encapsulate the message to be processed according to a preset message encapsulation format to obtain at least one encapsulated data packet, each of the at least one encapsulated data packet includes: at least one data frame, header information of the at least one data frame, message length of the at least one data frame, and check information, and each of the at least one data frame includes attribute parameters of the message to be processed;
[0101] A sending module 530, configured to send the at least one encapsulated data packet to a server;
[0102] A determination module 540 is used to determine whether the at least one encapsulated data packet is successfully sent to the server;
[0103] The processing module 550 is used to write the one or more encapsulated data packets to a preset data pool to form a disk-written data packet, if it is determined that one or more encapsulated data packets in the at least one encapsulated data packet have not been successfully sent to the server, so as to resend the disk-written data packet to the server.
[0104] As an optional implementation of the embodiment of the present application, the judgment module 540 is used to judge whether the vehicle has successfully established a communication connection with the server; if the vehicle has successfully established a communication connection with the server, the disk data packet is resent to the server based on the http protocol.
[0105] As an optional implementation of the embodiment of the present application, the acquisition module 510 is specifically used to obtain the filter configuration information of the vehicle, and the filter configuration information is used to indicate whether to filter the vehicle message; if the filter configuration information indicates that the vehicle message is not to be filtered, all the acquired vehicle messages are determined as the messages to be processed.
[0106] As an optional implementation of the embodiment of the present application, the acquisition module 510 is further used to acquire the vehicle message corresponding to the target signal if the filter configuration information indicates filtering of the vehicle message, and determine the vehicle message corresponding to the target signal as the message to be processed.
[0107] As an optional implementation of the embodiment of the present application, the attribute parameters of the message to be processed include: the message type, channel number, message identifier and message length of the message to be processed;
[0108] The encapsulation module 520 is specifically used to splice the message type, channel number, message identifier and message length of each message in the to-be-processed message to obtain at least one data frame; and combine the at least one data frame, the header information of the at least one data frame, the message length of the at least one data frame, and the check information to obtain the at least one encapsulated data packet.
[0109] As an optional implementation of the embodiment of the present application, the encapsulation module 520 is specifically used to start with the header information of the at least one data frame, and sequentially combine with the message length of the at least one data frame, the at least one data frame, and the verification information to obtain the at least one encapsulated data packet, and the verification information is spliced to the end of the at least one data frame.
[0110] As an optional implementation of the present application, Figure 5 Based on the message processing device shown, the device also includes:
[0111] The cleaning module 610 is used to obtain the proportion of the total storage space of the preset data pool occupied by the data packets dropped to disk; if the proportion of the occupied space is greater than the preset proportion, the data packets dropped to disk are cleaned up according to the drop time of the data packets dropped to disk.
[0112] In one embodiment, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the message processing methods described in the above method embodiments when executing the computer program.
[0113] For example, Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 7 As shown, the electronic device provided in this embodiment includes: a memory 71 and a processor 72, the memory 71 is used to store a computer program; the processor 72 is used to execute the steps of the message processing method provided in the above method embodiment when calling the computer program, and its implementation principle and technical effect are similar, which will not be repeated here. Those skilled in the art can understand that Figure 7The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0114] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of any one of the message processing methods described in the above method embodiments are implemented.
[0115] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in various forms, such as static random access memory (SRAM) and dynamic random access memory (DRAM).
[0116] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0117] For the convenience of explanation, the above description has been made in conjunction with specific embodiments. However, the above discussion in some embodiments is not intended to be exhaustive or limit the embodiments to the specific forms disclosed above. According to the above teachings, various modifications and variations can be obtained. The selection and description of the above embodiments are to better explain the principles and practical applications, so that those skilled in the art can better use the embodiments and various different variations of the embodiments suitable for specific use considerations.
Claims
1. A message processing method, characterized in that: include: Acquire a message to be processed of the vehicle, and encapsulate the message to be processed according to a preset message encapsulation format to obtain at least one encapsulated data packet; Sending the at least one encapsulated data packet to the server, and determining whether the at least one encapsulated data packet is successfully sent to the server according to the response information returned by the server; If it is determined that there is a target encapsulated data packet in the at least one encapsulated data packet that has not been successfully sent to the server, the target encapsulated data packet is dropped to a preset data pool to form a dropped data packet, so as to resend the dropped data packet to the server.
2. The method according to claim 1, characterized in that After the target encapsulated data packet is written to a disk in a preset data pool to form a written data packet, the method further includes: Determining whether a communication connection is successfully established between the vehicle and the server; When the vehicle successfully establishes a communication connection with the server, the disk data packet is resent to the server.
3. The method according to claim 1, characterized in that The obtaining of the to-be-processed message of the vehicle comprises: Acquire filter configuration information of the vehicle, where the filter configuration information is used to indicate whether to filter the vehicle message; If the filter configuration information indicates that the vehicle messages are not to be filtered, all acquired vehicle messages are determined as the messages to be processed.
4. The method according to claim 3, characterized in that The method further comprises: If the filter configuration information indicates to filter the vehicle message, the acquired vehicle message is filtered according to the target signal, and the vehicle message corresponding to the filtered target signal is determined as the message to be processed.
5. The method according to claim 1, characterized in that The attribute parameters of the message to be processed include: the message type, channel number, message identifier and message length of the message to be processed; The step of encapsulating the message to be processed according to a preset message encapsulation format to obtain at least one encapsulated data packet includes: Concatenate the message type, channel number, message identifier and message length of each message in the to-be-processed message to obtain at least one data frame; The at least one data frame, the header information of the at least one data frame, the message length of the at least one data frame, and the check information are combined to obtain the at least one encapsulated data packet.
6. The method according to claim 5, characterized in that The step of combining the at least one data frame, the header information of the at least one data frame, the message length of the at least one data frame, and the check information to obtain the at least one encapsulated data packet comprises: Starting with the header information of the at least one data frame, the at least one data frame and the check information are sequentially combined to obtain the at least one encapsulated data packet, and the check information is spliced to the end of the at least one data frame.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: Obtaining the proportion of the total storage space of the preset data pool occupied by the data packets stored on the disk; If the occupied space ratio is greater than a preset ratio, the disk-placed data packets are cleared according to the disk-placed time of the disk-placed data packets.
8. A message processing device, characterized in that: include: An acquisition module, used to acquire the vehicle's to-be-processed message; An encapsulation module, used to encapsulate the message to be processed according to a preset message encapsulation format to obtain at least one encapsulated data packet; A sending module, used for sending the at least one encapsulated data packet to a server; A judging module, configured to judge whether the at least one encapsulated data packet is successfully sent to the server according to the response information returned by the server; The processing module is used to write the target encapsulated data packet to a preset data pool to form a disk-written data packet if it is determined that there is a target encapsulated data packet that has not been successfully sent to the server in the at least one encapsulated data packet, so as to resend the disk-written data packet to the server.
9. An electronic terminal, comprising: A memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the message processing method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the message processing method according to any one of claims 1 to 7 is implemented.
11. A vehicle, characterized in that: The vehicle is equipped with the message processing device according to claim 8 or the electronic device according to claim 9 or the storage medium according to claim 10.