Message processing method and system, storage medium and vehicle

By generating and parsing intermediate data containing serialized target messages and sending time in the vehicle assisted driving system, and replacing the sending time on the second host device, the problem of time out of synchronization of multiple host devices is solved, and stable message processing and system operation are achieved.

CN119938360APending Publication Date: 2025-05-06CHONGQING CHANGAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510057873.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-14
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

In vehicle-assisted driving systems, due to the out-of-synchronization of multiple host devices, the message processing function experience is poor, the algorithm logic is confusing, and even the system crash.

Method used

By generating the first intermediate data including the serialized target message, the preset topic name, and the transmission time corresponding to the target message on the first host device, and parsing the data by the proxy module on the second host device, replacing the transmission time with the startup time of the second host device, and finally obtaining the target message.

Benefits of technology

Time synchronization across hosts is realized, and message processing errors or delay problems caused by time out of synchronization are avoided, so that the host device on the receiving end has no perception of the host time out of synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119938360A_ABST
    Figure CN119938360A_ABST
Patent Text Reader

Abstract

The invention provides a message processing method and system, a storage medium and a vehicle, and the method comprises the steps: sending first intermediate data to a second host device, the first intermediate data being generated based on a serialized target message, a preset topic name and the sending time corresponding to the target message, sending the first intermediate data to the second host device to enable the second host device to analyze the first intermediate data, obtaining the starting time of the second host device, replacing the sending time corresponding to the target message in the first intermediate data based on the starting time to obtain second intermediate data, and obtaining the target message based on the second intermediate data. According to the embodiment of the invention, the time data of the host equipment at the transmitting end is replaced by the starting time of the host equipment corresponding to the receiving end, and the host equipment at the receiving end considers that the time is synchronous, so that the host equipment at the receiving end does not sense the asynchronous host time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication processing technology, and in particular to a message processing method, system, storage medium and vehicle. Background Art

[0002] As the application of vehicle assisted driving systems becomes more and more common, the communication framework installed in them has become an indispensable core basic software. Its core is to use the communication interfaces such as pipes, TCP / IP, and shared memory provided by the operating system, combined with data exchange protocols such as protobuf and json, to provide a unified message sending and receiving interface for assisted driving application modules such as perception, path planning, and control.

[0003] In the related art, in the process of message processing based on the communication framework, especially in the communication scenario involving multiple host devices, due to the asynchrony of the time of each host device, it leads to serious consequences such as poor functional experience, chaotic algorithm logic and even system crash. Summary of the invention

[0004] The object of the present invention is to provide a message processing method, system, storage medium and vehicle.

[0005] In order to achieve the above object, the present invention discloses a message processing method, which is applied to a first host device, wherein the first host device includes a first application module and a first agent module, and the method includes: Send first intermediate data to a second host device, where the first intermediate data is generated based on a serialized target message, a preset topic name, and a sending time corresponding to the target message, so that the second host device parses the first intermediate data and obtains the startup time of the second host device, replaces the sending time corresponding to the target message in the first intermediate data based on the startup time, obtains second intermediate data, and obtains the target message based on the second intermediate data.

[0006] Optionally, the first host device is equipped with a first monotonic time interface, and the first monotonic time interface is used to obtain the sending time on the first host device corresponding to any message.

[0007] Optionally, the first host device includes a first proxy module, and sending the first intermediate data to the second host device includes: Serializing the target message to obtain a target byte stream; Acquire the sending time of the target message on the first host device through the first monotonic time interface; Assembling the target byte stream, the sending time and the preset topic name to obtain first intermediate data; The first intermediate data is sent to the second application module through the first proxy module.

[0008] Optionally, the first host device includes a first shared memory; after the step of assembling the target byte stream, the sending time, and the preset topic name to obtain the first intermediate data, and before the step of sending the first intermediate data to the second application module through the first proxy module, the method includes: The first intermediate data is written into the first shared memory, so that the first agent module reads the first intermediate data from the first shared memory.

[0009] The present invention also discloses a message processing method, which is applied to a second host device, and the method comprises: Receiving first intermediate data sent by a first host device, wherein the first intermediate data is generated based on a serialized target message, a preset topic name, and a sending time corresponding to the target message; Parsing the first intermediate data and obtaining the startup time of the second host device; Replacing the sending time corresponding to the target message in the first intermediate data based on the start time to obtain second intermediate data; The target message is acquired based on the second intermediate data.

[0010] Optionally, acquiring the target message based on the second intermediate data includes: Parsing the second intermediate data to obtain the target message, the preset topic name and the start time; Determine whether the time point corresponding to the start time exceeds the current time corresponding to when the second host device receives the second intermediate data; If not, deserialize the serialized target message to generate the target message.

[0011] The present invention also discloses a message processing system, the message processing system comprising a first host device and a second host device, the first host device comprising a first application module and a first agent module, the second host device comprising a second application module and a second agent module; first intermediate data sent by the first host device to the second proxy module of the second host device; The second host device is used to parse the first intermediate data, and obtain the startup time of the second host device based on the corresponding second monotonic time interface on the second host device; replace the sending time corresponding to the target message in the first intermediate data based on the startup time to obtain the second intermediate data; and obtain the target message based on the second intermediate data.

[0012] Optionally, message transmission between the first host device and the second host device is implemented through a preset communication framework, and the preset communication framework is mounted on the first host device and the second host device. The preset communication framework includes a header file and a library file. The header file includes a declaration sending interface and a subscription interface. The declaration sending interface is used by the first application module to send the target message, and the subscription interface is used by the second application module to receive the target message. The header file encapsulates a monotonic time interface, and the monotonic time interface includes a first monotonic time interface and a second monotonic time interface. The monotonic time interface is used to obtain the monotonic time corresponding to any host device.

[0013] An embodiment of the present invention further discloses an electronic device, comprising at least one processor and a memory communicatively connected to the at least one processor; The memory is used to store computer programs; The processor is used to implement the message processing method described in the embodiment of the present invention when executing the program stored in the memory.

[0014] The embodiment of the present invention further discloses a computer-readable storage medium on which a computer program is stored. When executed by one or more processors, the processors execute the message processing method as described in the embodiment of the present invention.

[0015] The embodiment of the present invention further discloses a vehicle, comprising a computer program / instruction, wherein the computer program / instruction, when executed by a processor, implements the message processing system described in the embodiment of the present invention.

[0016] Beneficial effects of the present invention: The embodiment of the present invention is applied to a first host device, the first host device includes a first application module and a first proxy module, and sends first intermediate data to a second host device, the first intermediate data is generated based on a serialized target message, a preset topic name, and a sending time corresponding to the target message, so that the second host device parses the first intermediate data, obtains the startup time of the second host device, replaces the sending time corresponding to the target message in the first intermediate data based on the startup time, obtains second intermediate data, and obtains the target message based on the second intermediate data. The embodiment of the present invention generates first intermediate data including a serialized target message, a preset topic name, and a sending time corresponding to the target message on the first host device, and the second proxy module on the second host device parses the data, replaces the sending time in combination with the startup time of the second host device, and finally obtains the target message. This process achieves cross-host time synchronization by replacing the time data of the sending host device with the startup time of the host device corresponding to the receiving end. When the second application module of the second host device corresponding to the receiving end receives the processed message data, because the time has been replaced with the time of the same host device where it is located, the receiving module will consider the time to be synchronized when performing a time check, so that the host device at the receiving end is unaware of the host time asynchrony, and thus no time logic-related anomalies will occur, avoiding message processing errors or delays caused by time asynchrony. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 A flowchart of a message processing method provided in an embodiment of the present invention; Figure 2 A flowchart of another message processing method provided in an embodiment of the present invention; Figure 3 A system block diagram of a message processing system provided in an embodiment of the present invention; Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention; Figure 5 A flowchart of an exemplary message processing method provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0018] The following will describe the embodiments of the present invention with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention, not for limiting the scope of protection of the present invention.

[0019] Reference Figure 1 , shows a flow chart of a message processing method provided in an embodiment of the present invention, which specifically includes the following steps: Step 101: Send first intermediate data to a second host device, where the first intermediate data is generated based on a serialized target message, a preset topic name, and a sending time corresponding to the target message, so that the second host device parses the first intermediate data and obtains the startup time of the second host device, replaces the sending time corresponding to the target message in the first intermediate data based on the startup time, obtains second intermediate data, and obtains the target message based on the second intermediate data.

[0020] It should be noted that the application scenario of the embodiment of the present application is to perform message sending and receiving processing by application modules across host devices. In the embodiment of the present application, it is applied to the first host device, and the first host device includes a first application module, a first proxy module and a first shared memory.

[0021] Among them, the first host device can act as a sending end, so that the first application module can send messages to the second application module of the second host device. Similarly, the first host device can also act as a receiving end, so that the first application module can receive messages sent by the second application module of the second host device.

[0022] In the embodiment of the present application, in order to facilitate understanding by those skilled in the art, the first host device serves as a transmitting end and the second host device serves as a receiving end.

[0023] It should be noted that, for the first application module at the sending end, it can generate a target message and attach the local time (the sending time corresponding to the target message), and then send it to other hosts (second host devices) through the first proxy module. The second application module at the receiving end receives the target message through its corresponding second proxy module and replaces the original local time attached to the sending end with the local time, and then forwards it to the second application module. When the second application module triggers the message callback function, the time attached to the message is its local time, and the second application module at the receiving end is unaware of the host time being out of sync.

[0024] Furthermore, the first host device is equipped with a first monotonic time interface, and the first monotonic time interface is used to obtain the sending time on the first host device corresponding to any message.

[0025] Specifically, the interaction between host devices in the present application is based on a preset communication framework, which is expressed in software as header files and library files. The header file declares two interfaces, publish and subscribe, which are used for application modules to send and receive messages respectively. The library file is a specific implementation of the interface. In the example of the present invention, the channel for data transmission implemented by publish and subscribe is the shared memory method of the operating system.

[0026] It should be noted that, for the preset topic name, in this implementation example, it represents a string agreed upon by the message senders and senders to identify a communication channel; for the target message, it refers to the specific data content sent and received by the communicating parties, which has two forms of expression: one is a data object with a specific structure that exists in the software code, and the other is a byte stream form after serialization for easy transmission between modules. Conversely, the byte stream form can also be deserialized into a specific data object in the software code.

[0027] The sample sending and receiving interface declarations are as follows: / / Send a message. The sender module needs to pass in the specific message data msg and topic name topic parameters template<typename T> void publish(const T&msg, const std::string&topic); / / To receive a message, the receiving module needs to pass in the topic name and callback function parameters template<typename T> void subscribe(const std::string&topic, std::function<void(const T&msg, double time)> callback) The above-mentioned framework header file encapsulates an interface for obtaining the monotonic time of the host device, namely the monotonic time interface. Therefore, since the first host device and the second host device are both equipped with a preset communication framework, the first host device is equipped with a first monotonic time interface. The first monotonic time interface is used to obtain the sending time on the first host device corresponding to any message. It should be noted that this sending time is the startup and running time of the local system corresponding to when the target message is sent. It should be noted that it is not a timestamp.

[0028] Specifically, taking the Linux operating system commonly used in the assisted driving domain controller as an example, use the clock_gettime interface to obtain it. Note that the parameter type must be specified as the system startup running time rather than the timestamp. The example code is as follows: double getMonotonicTime() { timespec ts; clock_gettime(CLOCK_MONOTONIC_RAW,&ts); return ts.tv_sec + ts.tv_nsec / 1e9; } Further, the first host device includes a first proxy module, and the sending of the first intermediate data to the second host device includes: Serializing the target message to obtain a target byte stream; Acquire the sending time of the target message on the first host device through the first monotonic time interface; Assembling the target byte stream, the sending time and the preset topic name to obtain first intermediate data; The first intermediate data is sent to the second application module through the first proxy module.

[0029] Further, the first host device includes a first shared memory; after the step of assembling the target byte stream, the sending time and the preset topic name to obtain the first intermediate data, and before the step of sending the first intermediate data to the second application module through the first proxy module, the method includes: The first intermediate data is written into the first shared memory, so that the first agent module reads the first intermediate data from the first shared memory.

[0030] Therefore, when the first application module on the first host device sends a message to the second application module, the corresponding process is as follows: Figure 5 .

[0031] First, the target message to be sent is serialized to obtain the target byte stream. It should be noted that the byte stream form after serialization is convenient for transmission between modules. Conversely, the byte stream form can also be deserialized into specific data objects in the software code.

[0032] Secondly, obtaining the sending time of the target message on the first host device through the first monotonic time interface; Next, the target byte stream, the sending time and the preset topic name are assembled to obtain the first intermediate data.

[0033] It should be noted that, in the embodiment of the present application, the first intermediate data is a linear intermediate data structure used to carry messages sent and received by the application module. Specifically, the first intermediate data includes three elements: monotonic time, topic name, and serialized message. These elements are generated and sent to the shared memory when the first application module at the sending end calls the preset communication framework sending (publish) interface. Conversely, the second application module at the receiving end calls the preset communication framework receiving (subscribe) interface to obtain the above elements from the shared memory and perform a deserialization operation (deserialize) to obtain the message and its time.

[0034] After the first intermediate data is obtained, the first intermediate data is sent to the second application module through the first proxy module.

[0035] It should be noted that, during this period, the first intermediate data will be written into the first shared memory, and the first proxy module can obtain the first intermediate data through the first shared memory.

[0036] Specifically, a proxy module for sending and receiving messages between cross-host devices runs on each host that needs to communicate with the outside world. On the one hand, it calls the subscribe interface of the above-mentioned preset communication framework to receive messages sent by the module in the host, and then uses the TCP / IP socket interface of the operating system to send the messages to other hosts. On the other hand, it uses the TCP / IP socket interface of the operating system to receive messages from other hosts and calls the publish interface of the above-mentioned communication framework to input the messages into the module inside the same host.

[0037] Furthermore, the above-mentioned proxy module embeds a code logic for replacing the time in the intermediate data of the transmission process and reorganizing the intermediate data. The code logic first finds the position of the time from the intermediate data, then obtains the host time, replaces the time therein and re-encapsulates a new intermediate data, and finally inputs the intermediate data into the module inside the same host.

[0038] After the first proxy module sends the first intermediate data to the second host device, the second host device will receive the first intermediate data through the second proxy module, parse the first intermediate data, and replace the parsed time with the host startup time corresponding to the current device host, and then re-encapsulate a new intermediate data, namely the second intermediate data, and finally input the second intermediate data into the second application module inside the same host.

[0039] The embodiment of the present invention is applied to a first host device, the first host device includes a first application module and a first proxy module, and sends first intermediate data to a second host device, the first intermediate data is generated based on a serialized target message, a preset topic name, and a sending time corresponding to the target message, so that the second host device parses the first intermediate data, obtains the startup time of the second host device, replaces the sending time corresponding to the target message in the first intermediate data based on the startup time, obtains second intermediate data, and obtains the target message based on the second intermediate data. The embodiment of the present invention generates first intermediate data including a serialized target message, a preset topic name, and a sending time corresponding to the target message on the first host device, and the second proxy module on the second host device parses the data, replaces the sending time in combination with the startup time of the second host device, and finally obtains the target message. This process achieves cross-host time synchronization by replacing the time data of the sending host device with the startup time of the host device corresponding to the receiving end. When the second application module of the second host device corresponding to the receiving end receives the processed message data, because the time has been replaced with the time of the same host device where it is located, the receiving module will consider the time to be synchronized when performing a time check, so that the host device at the receiving end is unaware of the host time asynchrony, and thus no time logic-related anomalies will occur, avoiding message processing errors or delays caused by time asynchrony.

[0040] Reference Figure 2 , shows a flow chart of another message processing method provided in an embodiment of the present invention, which specifically includes the following steps: Step 201: receiving first intermediate data sent by a first host device, wherein the first intermediate data is generated based on a serialized target message, a preset topic name, and a sending time corresponding to the target message. Step 202, parsing the first intermediate data and obtaining the startup time of the second host device; Step 203, replacing the sending time corresponding to the target message in the first intermediate data based on the start time to obtain second intermediate data; Step 204: Acquire the target message based on the second intermediate data.

[0041] Further, step 204, namely, obtaining the target message based on the second intermediate data includes: Parsing the second intermediate data to obtain the target message, the preset topic name and the start time; Determine whether the time point corresponding to the start time exceeds the current time corresponding to when the second host device receives the second intermediate data; If not, deserialize the serialized target message to generate the target message.

[0042] It should be noted that in the embodiment of the present application, referring to the foregoing, when the first proxy module sends the first intermediate data to the second host device, the second host device will receive the first intermediate data through the second proxy module, parse the first intermediate data, and replace the parsed time with the host startup time corresponding to the current device host, and then re-encapsulate a new intermediate data, namely the second intermediate data, and finally input the second intermediate data into the second application module inside the same host.

[0043] During the process of reorganizing the second intermediate data, the second host device also writes it into the second shared memory, so that the second application module can read and parse the second intermediate data from the second shared memory. Since the target message obtained after parsing at this time is a serialized target message, the time after parsing is first checked. After the time check is correct, the serialized target message is deserialized to obtain the final target message.

[0044] The embodiment of the present invention generates first intermediate data including a serialized target message, a preset topic name, and a sending time corresponding to the target message on a first host device, and the second proxy module on the second host device parses the data, replaces the sending time with the startup time of the second host device, and finally obtains the target message. This process realizes time synchronization across hosts, by replacing the time data of the sending host device with the startup time of the host device corresponding to the receiving end. When the second application module of the second host device corresponding to the receiving end receives the processed message data, because the time has been replaced with the time of the same host device where it is located, the receiving module will consider the time to be synchronized when performing a time check, so that the host device on the receiving end is unaware of the asynchronous host time, and thus no time logic-related anomalies will be generated, thereby avoiding message processing errors or delays caused by asynchronous time.

[0045] Reference Figure 3 , shows a system block diagram of a message processing system provided in an embodiment of the present invention, the message processing system includes a first host device and a second host device, the first host device includes a first application module and a first agent module, the second host device includes a second application module and a second agent module; first intermediate data sent by the first host device to the second proxy module of the second host device; The second host device is used to parse the first intermediate data, and obtain the startup time of the second host device based on the corresponding second monotonic time interface on the second host device; replace the sending time corresponding to the target message in the first intermediate data based on the startup time to obtain the second intermediate data; and obtain the target message based on the second intermediate data.

[0046] Furthermore, the first host device includes a first shared memory, and the second host device includes a second shared memory.

[0047] Furthermore, message transmission between the first host device and the second host device is achieved through a preset communication framework, and the preset communication framework is mounted on the first host device and the second host device. The preset communication framework includes a header file and a library file. The header file includes a declaration sending interface and a subscription interface. The declaration sending interface is used by the first application module to send the target message, and the subscription interface is used by the second application module to receive the target message. The header file encapsulates a monotonic time interface, and the monotonic time interface includes a first monotonic time interface and a second monotonic time interface. The monotonic time interface is used to obtain the monotonic time corresponding to any host device.

[0048] The embodiment of the present invention generates first intermediate data including a serialized target message, a preset topic name, and a sending time corresponding to the target message on a first host device, and the second proxy module on the second host device parses the data, replaces the sending time with the startup time of the second host device, and finally obtains the target message. This process realizes time synchronization across hosts, by replacing the time data of the sending host device with the startup time of the host device corresponding to the receiving end. When the second application module of the second host device corresponding to the receiving end receives the processed message data, because the time has been replaced with the time of the same host device where it is located, the receiving module will consider the time to be synchronized when performing a time check, so that the host device on the receiving end is unaware of the asynchronous host time, and thus no time logic-related anomalies will be generated, thereby avoiding message processing errors or delays caused by asynchronous time.

[0049] It should be noted that, in the embodiments of the present application, the above contents can refer to the previous discussion and will not be repeated here.

[0050] The embodiment of the present invention further provides an electronic device, such as Figure 4 As shown, it includes a processor 401, a device interface 402, a memory 403 and a bus 404; Memory 403, used for storing computer programs; The processor 401 is used to execute the program stored in the memory 403 to implement the following steps: Send first intermediate data to a second host device, where the first intermediate data is generated based on a serialized target message, a preset topic name, and a sending time corresponding to the target message, so that the second host device parses the first intermediate data and obtains the startup time of the second host device, replaces the sending time corresponding to the target message in the first intermediate data based on the startup time, obtains second intermediate data, and obtains the target message based on the second intermediate data.

[0051] or, receiving, by the second proxy module, first intermediate data sent by the first proxy module, wherein the first intermediate data is generated based on the serialized target message, the preset topic name, and the sending time corresponding to the target message, Parsing the first intermediate data, and acquiring the startup time of the second host device based on a corresponding second monotonic time interface on the second host device; Replacing the sending time corresponding to the target message in the first intermediate data based on the start time to obtain second intermediate data; The target message is acquired based on the second intermediate data.

[0052] The bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0053] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0054] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0055] The present invention also provides a storage medium. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the message processing method of the aforementioned embodiment.

[0056] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0057] The algorithm and display provided herein are not inherently related to any particular computer, virtual device or other equipment. According to the above description, it is obvious that the structure required for constructing this type of device is. In addition, the present invention is not directed to any specific programming language. It should be understood that various programming languages ​​can be utilized to realize the content of the present invention described herein, and the description of the above specific language is to disclose the best mode of the present invention.

[0058] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0059] Similarly, it should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: that the claimed invention requires more features than those expressly recited in each claim. Rather, as reflected in the claims below, inventive aspects lie in less than all of the features of the individual embodiments disclosed above. Therefore, the claims that follow the detailed description are hereby expressly incorporated into the detailed description, with each claim itself serving as a separate embodiment of the present invention.

[0060] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and further may be divided into a plurality of submodules or subunits or subcomponents. All features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device so disclosed may be combined in any combination, except that at least some of such features and / or processes or units are mutually exclusive. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature that provides the same, equivalent or similar purpose.

[0061] The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the sorting device according to the present invention. The present invention may also be implemented as a device or apparatus program for executing part or all of the methods described herein. Such a program for implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0062] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.

[0063] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices, apparatuses and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0064] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

[0065] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

[0066] It should be noted that the various data-related processes in the embodiments of the present application are all carried out in compliance with the corresponding data protection laws and policies of the country where the device is located, and with the authorization given by the owner of the corresponding device.

Claims

1. A message processing method, characterized in that: Applied to a first host device, the method comprises: Send first intermediate data to a second host device, where the first intermediate data is generated based on a serialized target message, a preset topic name, and a sending time corresponding to the target message, so that the second host device parses the first intermediate data and obtains the startup time of the second host device, replaces the sending time corresponding to the target message in the first intermediate data based on the startup time, obtains second intermediate data, and obtains the target message based on the second intermediate data.

2. The method according to claim 1, characterized in that The first host device is equipped with a first monotonic time interface, and the first monotonic time interface is used to obtain the sending time of any message on the first host device.

3. The method according to claim 2, characterized in that The first host device includes a first proxy module, and sending the first intermediate data to the second host device includes: Serializing the target message to obtain a target byte stream; Acquire the sending time of the target message on the first host device through the first monotonic time interface; Assembling the target byte stream, the sending time and the preset topic name to obtain first intermediate data; The first intermediate data is sent to the second application module through the first proxy module.

4. The method according to claim 3, characterized in that The first host device includes a first shared memory; after the step of assembling the target byte stream, the sending time, and the preset topic name to obtain the first intermediate data, and before the step of sending the first intermediate data to the second application module through the first proxy module, the method includes: The first intermediate data is written into the first shared memory, so that the first agent module reads the first intermediate data from the first shared memory.

5. A message processing method, characterized in that: Applied to a second host device, the method comprises: Receiving first intermediate data sent by a first host device, wherein the first intermediate data is generated based on a serialized target message, a preset topic name, and a sending time corresponding to the target message; Parsing the first intermediate data and obtaining the startup time of the second host device; Replacing the sending time corresponding to the target message in the first intermediate data based on the start time to obtain second intermediate data; The target message is acquired based on the second intermediate data.

6. The method according to claim 5, characterized in that The acquiring the target message based on the second intermediate data comprises: Parsing the second intermediate data to obtain the target message, the preset topic name and the start time; Determine whether the time point corresponding to the start time exceeds the current time corresponding to when the second host device receives the second intermediate data; If not, deserialize the serialized target message to generate the target message.

7. A message processing system, characterized in that: The message processing system includes a first host device and a second host device, the first host device includes a first application module and a first agent module, and the second host device includes a second application module and a second agent module; first intermediate data sent by the first host device to the second proxy module of the second host device; The second host device is used to parse the first intermediate data, and obtain the startup time of the second host device based on a corresponding second monotonic time interface on the second host device; The sending time corresponding to the target message in the first intermediate data is replaced based on the start time to obtain the second intermediate data; and the target message is obtained based on the second intermediate data.

8. The system according to claim 7, characterized in that The message transmission between the first host device and the second host device is realized through a preset communication framework, and the preset communication framework is mounted on the first host device and the second host device. The preset communication framework includes a header file and a library file. The header file includes a declaration sending interface and a subscription interface. The declaration sending interface is used by the first application module to send the target message, and the subscription interface is used by the second application module to receive the target message. The header file encapsulates a monotonic time interface, and the monotonic time interface includes a first monotonic time interface and a second monotonic time interface. The monotonic time interface is used to obtain the monotonic time corresponding to any host device.

9. A readable storage medium for storing a program, characterized in that: When the program is executed by a processor, the message processing method according to any one of claims 1 to 4 is implemented, or the message processing method according to any one of claims 5 to 6 is implemented.

10. A vehicle comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the message processing system according to claim 7 or 8 is implemented.