Message processing method and device, equipment and medium
By determining the data format according to the communication type during message recording and serializing the data, generating byte stream string information and storing it as a recorded data packet, the problem of poor message processing in the existing method is solved, and efficient storage and Quick parsing message processing effect.
Patent Information
- Application Number
- CN202411389056.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-02-18
AI Technical Summary
The recorded messages in the existing methods are poor in processing and are difficult to meet the needs of autonomous vehicle software development and debugging.
During message recording, the data format requirements of the message are determined according to the communication type, and the message is serialized to generate byte stream string information. This information is written into the corresponding data structure and stored as a recorded data packet for subsequent quick parsing and playback.
Through this method, efficient storage, rapid transmission, easy parsing of messages, support complex data, data integrity, easy playback and scalability, significantly improving the effect of message processing.
Smart Images

Figure CN119473649A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of autonomous driving technology, and in particular to a message processing method, device, equipment and medium. Background Art
[0002] The process of developing and debugging autonomous vehicle software can refer to the systematic work of creating, testing and optimizing computer programs and algorithms used in autonomous vehicles. This process involves multiple stages and technical areas to ensure that the autonomous driving system can operate safely and reliably in various driving environments.
[0003] At present, in the process of developing and debugging the software for autonomous driving vehicles, frequent actual road tests are not only difficult but also costly. Therefore, recording tools are generally used to record the communication messages between various modules in the vehicle operation and save them as files, so that these messages can be played back later to simulate the road test environment, so as to carry out software development and debugging under non-actual road test conditions.
[0004] However, the recorded messages in the existing methods have the problem of poor processing effect. Summary of the invention
[0005] The present application provides a message processing method, device, equipment and medium, which are used to solve the problem that the recorded messages in the existing methods have poor processing effects.
[0006] In a first aspect, the present application provides a message processing method, comprising:
[0007] When recording a message, a message that meets a preset data format requirement is obtained, where the preset data format requirement is determined according to a communication type of the message when it is transmitted;
[0008] Serialize the message to obtain byte stream string information;
[0009] Writing the byte stream string information into the message data field of the first target data structure, the first target data structure being a data structure corresponding to the byte stream string information;
[0010] According to the first target data structure in which the byte stream character string information is written, a recording data packet is obtained and stored.
[0011] In a possible implementation, obtaining a recorded message that meets a preset data format requirement includes:
[0012] According to the configuration file, determine the channel name and communication type of the message during transmission;
[0013] Create a subscriber based on the channel name and communication type of the message when it is transmitted;
[0014] When the vehicle is in the autonomous driving state, the subscriber obtains messages that meet the preset data format requirements from all messages sent by the vehicle.
[0015] In a possible implementation, creating a subscriber according to the channel name and communication type of the recorded message during transmission includes:
[0016] Determine the calling function based on the recording toolkit;
[0017] Create a subscriber based on the calling function, the channel name and the communication type of the message when it is transmitted.
[0018] In a possible implementation, the first target data structure further includes a channel name field and a message type name field;
[0019] According to the first target data structure in which the byte stream character string information is written, obtaining and storing a recording data packet includes:
[0020] Write the subscription channel message into the channel name field in the first target data structure, and write the communication type of the recorded message during transmission into the message type name field in the first target data structure;
[0021] The first target data structure having the channel name field, the message type name field and the message data field written therein is written into the recording data packet and stored.
[0022] In a possible implementation, after obtaining and storing the recording data packet according to the first target data structure of the written byte stream character string information, the method further includes:
[0023] In response to a request operation for message playback, storing the byte stream character string information in the recording data packet into the message data field of the second target data structure;
[0024] Deserialize the byte stream character string information in the message data field of the second target data structure to obtain a message that meets the playback requirements;
[0025] Publish messages that meet the playback requirements to play the data of the recorded data packets.
[0026] In a possible implementation, in response to a request operation for message playback, storing byte stream character string information in a recording data packet into a message data field of a second target data structure includes:
[0027] In response to a request operation for playing a message, determining a message publisher and a channel message stored in a file when the message publisher publishes the recording;
[0028] According to the channel message stored in the file when the message publisher publishes the recording, the byte stream string information in the recording data packet is determined;
[0029] The byte stream character string information in the recording data packet is stored in the message data field of the second target data structure.
[0030] In a possible implementation, deserializing the byte stream character string information in the message data field of the second target data structure to obtain a message that meets the playback requirements includes:
[0031] Determine the communication type of the channel message that the publisher of the message publishes and stores in the file when recording;
[0032] According to the communication type of the channel message stored in the file when the message publisher publishes the recording, the byte stream character string information in the message data field of the second target data structure is deserialized to obtain a message that meets the playback requirements.
[0033] In a second aspect, the present application provides a message processing device, including:
[0034] An acquisition module, used to acquire messages that meet preset data format requirements when recording messages, where the preset data format requirements are determined according to the communication type of the message when it is transmitted;
[0035] The serialization processing module is used to serialize the message and obtain the byte stream string information;
[0036] A writing module, used for writing the byte stream character string information into a message data field of a first target data structure, the first target data structure being a data structure corresponding to the byte stream character string information;
[0037] The storage module is used to obtain and store the recording data packet according to the first target data structure in which the byte stream character string information is written.
[0038] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;
[0039] Memory stores computer execution quality;
[0040] The processor executes the computer execution quality stored in the memory to implement the method of the embodiment of the present application.
[0041] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer execution quality is stored, and the computer execution quality is used to implement the method of the embodiment of the present application when the processor executes it.
[0042] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the method of any one of the first aspects when executed by a processor.
[0043] The message processing method, apparatus, device and medium provided in the present application serialize the message after determining the data format requirements of the message according to the communication type when recording the message, so as to obtain byte stream string information with the characteristics of efficient storage, fast transmission, easy parsing, support for complex data, data integrity, easy playback and scalability, and store the byte stream string information in a corresponding first target data structure, so that when playing the message, the recorded data packet storing the byte stream string information can be quickly parsed according to the first target data structure, thereby achieving the processing effect of the recorded message. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] 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.
[0045] Figure 1 A schematic diagram of a scenario of a message processing method provided in an embodiment of the present application;
[0046] Figure 2 Schematic diagram of the message processing method provided in the embodiment of the present application Figure 1 ;
[0047] Figure 3 Schematic diagram of the message processing method provided in the embodiment of the present application Figure 2 ;
[0048] Figure 4 A schematic diagram of the structure of a message processing device provided in an embodiment of the present application;
[0049] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0050] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0051] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0052] First, let's explain the terms involved in this application: the development of autonomous driving vehicle software can refer to the design, writing and integration of various software modules and algorithms to achieve the autonomous driving function of the vehicle. These software modules include environmental perception, decision planning, vehicle control and other aspects, aiming to enable the vehicle to autonomously complete driving tasks in different driving environments.
[0053] Debugging of autonomous driving vehicle software can refer to testing and optimizing the software during the development process to ensure that it can work stably and reliably in actual operation. The debugging process involves multiple links, including unit testing, integration testing, simulation testing, and real vehicle testing, etc. The purpose is to discover and fix errors and defects in the software, optimize performance, and improve the robustness and safety of the system.
[0054] Road testing refers to a series of testing activities conducted on vehicles and their systems on actual roads to verify their performance, reliability and safety. In the field of autonomous driving, road testing is a key link in the development and verification of autonomous driving technology. By collecting data and evaluating system performance in a real driving environment, it ensures that autonomous driving vehicles can operate safely and stably under various working conditions.
[0055] In the process of developing and debugging the software for autonomous driving vehicles, it is not only difficult but also costly to conduct actual road tests every time. Therefore, a tool is needed to record the communication messages between various modules in the vehicle operation and save them as files in a specific format. In this way, during the actual road test, the relevant messages can be recorded and saved in files, and the road test environment can be simulated by replaying the messages in the files later, so as to develop and debug various modules of the vehicle software under non-actual road test conditions.
[0056] At present, the recording tool developed by the manufacturer is used to record messages. When recording data packets, the tool subscribes to channel messages published by different nodes and writes these subscribed channels and messages into files. When developers are debugging in a non-actual drive test environment, they can publish the channels and messages recorded in the file (data recorded in the actual drive test environment) by reading the file and playing the data packets. Developers can subscribe to the corresponding channels and messages as needed, just like receiving messages from various sensors during actual drive tests, so as to debug different modules of the software.
[0057] The message processing method provided by the embodiment of the present application determines the data format requirements of the message according to the communication type when recording the message, and then serializes the message to obtain byte stream string information with the characteristics of efficient storage, fast transmission, easy parsing, support for complex data, data integrity, easy playback and scalability. The byte stream string information is stored in a corresponding first target data structure, so that when the message is played, the recorded data packet storing the byte stream string information can be quickly parsed according to the first target data structure, thereby achieving the processing effect of the recorded message.
[0058] Figure 1 A schematic diagram of a scenario of a message processing method provided in an embodiment of the present application. Figure 1 As shown, the execution subject of a message processing method provided in an embodiment of the present application may be a message processing system. Among them, the message processing system may be a server, and the server may be a computer, a mobile phone, a tablet and other devices. This embodiment does not impose any special restrictions on the implementation method of the execution subject, as long as the execution subject can obtain a message that meets the preset data format requirements when recording the message, and the preset data format requirements are determined according to the communication type of the message during transmission; the message is serialized to obtain byte stream string information; the byte stream string information is written into the message data field of the first target data structure, and the first target data structure is a data structure corresponding to the byte stream string information; according to the first target data structure in which the byte stream string information is written, the recording data packet is obtained and stored.
[0059] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0060] Figure 2 Schematic diagram of the message processing method provided in the embodiment of the present application Figure 1 , the execution subject of this method can be a message processing system, such as Figure 2 As shown, the method may include:
[0061] S201. When recording a message, obtain a message that meets a preset data format requirement, where the preset data format requirement is determined according to a communication type of the message during transmission.
[0062] Among them, the message may refer to the information transmitted between various modules during the operation of the vehicle. The message may include sensor data, control instructions, status information, etc.
[0063] Message recording refers to the process of recording the communication messages between modules during vehicle operation and saving these messages as files. The purpose of message recording is to analyze, debug and optimize the autonomous driving system in the future.
[0064] Communication type refers to the way and protocol of passing messages between different modules in the autonomous driving system. The way and protocol of passing messages between different modules can determine how messages are transmitted, processed and managed in the system.
[0065] The preset data format requirement may refer to a message format requirement according to a communication type used when the message is transmitted. For example, when the message is sent using vsomip communication, the preset data format requirement may be characterized as a data format in the form of vsomip::message.
[0066] In this embodiment of the present application, obtaining a recorded message that meets the preset data format requirements includes:
[0067] According to the configuration file, determine the channel name and communication type of the message during transmission;
[0068] Create a subscriber based on the channel name and communication type of the message when it is transmitted;
[0069] When the vehicle is in the autonomous driving state, the subscriber obtains messages that meet the preset data format requirements from all messages sent by the vehicle.
[0070] Among them, the configuration file may refer to a file containing system, application or service settings. The settings may include but are not limited to network parameters, security options, communication protocols, etc. In an embodiment of the present application, when it comes to determining the communication type of a message during transmission, the configuration file may be used to define the communication parameters, service addresses, port numbers and other information for processing Fastdds, vsomip and ros middleware, so as to ensure that each middleware can work together correctly. By reading the communication parameters, it is possible to determine how the message will be transmitted in the network and the type of communication during transmission.
[0071] A subscriber may refer to an application or service that receives messages published on a specific topic or channel. In the embodiment of the present application, a publisher and subscriber mode may be adopted, and the recording and broadcasting package tool creates a subscriber according to the configuration file to subscribe to all channel messages in the current startup node. For example, at the beginning of recording, you can subscribe to a channel message, where the subscription function is SubscribeRaw(channel_name), channel_name is the name of the channel, and the configuration file is read according to the channel name to obtain the communication type of the subscription message. For example, if the communication type is vsomeip, the subscription function will create a vsomeip Subscriber, and the creation of the subscriber can be implemented internally according to the publish-subscribe mechanism of vsomip.
[0072] In this embodiment of the present application, creating a subscriber according to the communication type of the recorded message during transmission includes:
[0073] Determine the subscription function based on the recording toolkit;
[0074] Create a subscriber based on the calling function, the channel name and the communication type of the message when it is transmitted.
[0075] Among them, the recording toolkit may refer to a tool for collecting and recording various sensor data, environmental information, and vehicle status information during vehicle operation. In an embodiment of the present application, the recording toolkit can also be used as a tool for developing and testing autonomous driving systems. The initial subscriber is created by calling the subscription function to obtain real-time or historical data streams, so as to debug, analyze, and improve the autonomous driving algorithm.
[0076] Subscription Function can refer to the key component used to create subscribers in the Pub / Sub model. It allows client applications to subscribe to specific topics or channels, thereby receiving messages published to these topics or channels. Subscription functions are usually provided by messaging middleware or frameworks to simplify the message subscription process.
[0077] A subscription mechanism may refer to a mechanism for a subscriber to register and receive messages from a publisher.
[0078] In an embodiment of the present application, a configuration file containing information such as the communication type, topic name, server address, etc. can be loaded first. The configuration file is in proto format, and the configuration file is parsed to obtain information such as the communication type, topic name, message type, etc., and then based on the parsed topic name and message type, the subscription function is called to create the initial subscriber. Finally, based on the parsed communication type, the subscription mechanism of the initial subscriber is adjusted.
[0079] S202, serialize the message to obtain byte stream string information;
[0080] S203. Write the byte stream character string information into the message data field of the first target data structure, where the first target data structure is a data structure corresponding to the byte stream character string information.
[0081] Serialization refers to the process of converting a data structure or object into a byte stream for storage or transmission.
[0082] The byte stream string information may refer to information stored in the form of a byte stream string.
[0083] The first target data structure may refer to a data structure corresponding to the byte stream string format, that is, a data structure that represents a data structure that can store byte stream string information in the byte stream string format.
[0084] In the embodiment of the present application, the first target data structure adopts the protobuf format. Since the amount of data in some data formats is relatively large and the data types are relatively diverse when recording messages, in the embodiment of the present application, the first target data structure is uniformly defined as the format of RawMessagePB, wherein RawMessagePB is the message format defined by protobuf, which can avoid the need to redefine a new Protobuf message format corresponding to the processed message each time a different type of message is processed. Thereby reducing the conversion steps between the message formats of different communication types and the custom proto data message formats in the code and the byte stream strings, improving the program execution efficiency, and allowing the program to have more time to process other more complex logics. In addition, RawMessagePB can include a bytes type field, such as the msg_datas field, through which the byte stream string information represented as a byte stream string format can be encapsulated. In the embodiment of the present application, the first target data structure can be a pre-set target data structure, or it can be a target data structure set at any time according to the needs of use.
[0085] S204: Obtain and store a recording data packet according to the first target data structure into which the byte stream character string information is written.
[0086] After the byte stream character string information is written into the first target data structure, it can be written into the recording data packet through the subscriber's callback function, thereby completing the recording of the message. The callback function can be: callback(RawMessagePB).
[0087] Among them, the first target data structure also includes a channel name field and a message type name field. In the embodiment of the present application, according to the first target data structure in which the byte stream string information is written, the recording data packet is obtained and stored, including:
[0088] Write the subscription channel message into the channel name field in the first target data structure, and write the communication type of the recorded message during transmission into the message type name field in the first target data structure;
[0089] The first target data structure having the channel name field, the message type name field and the message data field written therein is written into the recording data packet and stored.
[0090] Among them, the channel name field may refer to a field for storing the name of the subscription channel message, and the message type name field may refer to a field for storing the communication type name. In an embodiment of the present application, when the first target data structure is the proto data format of RawMessagePB, the data format may be:
[0091] message RawMessagePB{
[0092] string channel_name = 1;
[0093] string type_name = 2;
[0094] bytes msg_datas = 3;
[0095] }, thus, when playing a message, the byte stream string information can be quickly found from msg_datas through the channel_name representing the channel name field and the type_name representing the message type name field.
[0096] The message processing method provided in the embodiment of the present application can adopt a publisher and subscriber mode similar to ROS when recording data packets. The recording and broadcasting package tool creates a subscriber according to the configuration file and subscribes to all channel messages in the current startup node. According to the communication type during message transmission, a specific message format is obtained, and then the format is converted into msg_datas of RawMessagePB, and then written into the file through the subscriber's callback function, so as to realize more convenient and quick recording of messages.
[0097] Figure 3 Schematic diagram of the message processing method provided in the embodiment of the present application Figure 2 , the execution subject of this method is the message processing system, such as Figure 3 As shown, the method may include:
[0098] S301. In response to a request operation for message playback, the byte stream character string information in the recording data packet is stored in a message data field of a second target data structure.
[0099] Message playback can refer to the process of resending or replaying a previously recorded or stored message. The message can come from sensor data, vehicle status information, environmental perception data, etc. Through message playback, real-time data flow can be simulated to help develop and test software in autonomous driving systems for debugging.
[0100] The request operation may refer to an operation in which a user requests message playback through a message processing system when assisting in developing and testing software in an autonomous driving system for debugging by simulating a real-time data stream.
[0101] The second target data structure may refer to the first target data structure, or may be a target data structure of the same data structure type as the first target data structure that is recreated in response to a request operation for message play.
[0102] Storing the byte stream string information in the recording data packet into the message data field of the second target data structure may refer to a process of reading the byte stream string information in the recording data packet and then storing the byte stream string information into the message data field of the second target data structure for publishing.
[0103] In this embodiment of the present application, in response to a request operation for message playback, storing the byte stream character string information in the recorded data packet into the message data field of the second target data structure includes:
[0104] In response to a request operation for playing a message, determining a message publisher and a channel message stored in a file when the message publisher publishes the recording;
[0105] According to the channel message stored in the file when the message publisher publishes the recording, the byte stream string information in the recording data packet is determined;
[0106] The byte stream character string information in the recording data packet is stored in the message data field of the second target data structure.
[0107] Among them, the message publisher can refer to sending messages to a specific topic or queue for one or more subscribers to receive and process.
[0108] The channel message that the message publisher stores in the file during recording may refer to the channel name corresponding to the byte stream string information stored in the recording data packet by the message publisher. The corresponding byte stream string information may be quickly determined through the channel name.
[0109] S302: Deserialize the byte stream character string information in the message data field of the second target data structure to obtain a message that meets the playback requirements.
[0110] Among them, deserialization processing (Deserialization) may refer to the process of converting the serialized byte stream string information back to its original data structure or object. In an embodiment of the present application, when the data format of the message is in the form of vsomip::message, and the byte stream string information representing the byte stream string form is obtained after serialization processing, deserialization processing may refer to converting the byte stream string information into a message in the form of vsomip::message.
[0111] The playback requirement may refer to a requirement corresponding to a preset data format requirement, wherein both the playback requirement and the preset data format requirement are determined according to the communication type of the channel message.
[0112] The byte stream character string information in the message data field of the second target data structure is deserialized to obtain a message that meets the playback requirements, including:
[0113] Determine the communication type of the channel message that the publisher of the message publishes and stores in the file when recording;
[0114] According to the communication type of the channel message stored in the file when the message publisher publishes the recording, the byte stream character string information in the message data field of the second target data structure is deserialized to obtain a message that meets the playback requirements.
[0115] S303: Publish a message that meets the playback requirements to play the data of the recorded data package.
[0116] The message processing method provided by the embodiment of the present application can create a publisher according to the configuration when the developer needs to play the data packet debugging software, read the byte stream string information in the file and store it in the msg_datas field of RawMessagePB, and then convert it into the communication format of the message and publish it externally. For example, at the beginning of data playback, the message publisher publishes a channel message, wherein the channel message includes a publishing function: AdvertiseRaw(channel_name); according to the channel_name in the publishing function, the communication type of the published message is obtained by reading the configuration file to publish the message, wherein, when the channel type is vsomeip, the publishing function can create vsomeippublisher, which is implemented internally according to the publish-subscribe mechanism of vsomip, reads the RawMessagePB message from the recording file, and converts it into the vsomip::message format, and publishes it through the pub function of vsomeippublisher, thereby completing the playback of the message.
[0117] Therefore, the message processing method provided in the embodiment of the present application can use the uniformly defined RawMessagePB proto format data type when the recording and broadcasting package tool stores the message into a file, wherein the msg_datas field directly stores the message, and serializes the message format of the communication type into the msg_datas record file of RawMessagePB during recording, and deserializes the msg_datas of RawMessagePB into the message format supported by the communication method during playback and publishes it, thereby reducing the message conversion steps during the recording process, thereby improving the efficiency of recording and playback, improving CPU utilization, and enabling the program to have more resources to process other complex logics. In addition, the message formats of different communication types and various proto message formats are uniformly converted into the RawMessagePB format, which simplifies the implementation of the program code.
[0118] Figure 4 A schematic diagram of the structure of a message processing device provided in an embodiment of the present application, such as Figure 4 As shown, the message processing device 40 provided in this embodiment includes:
[0119] An acquisition module 401 is used to acquire a message that meets a preset data format requirement when recording a message, where the preset data format requirement is determined according to a communication type when the message is transmitted;
[0120] The serialization processing module 402 is used to perform serialization processing on the message to obtain byte stream string information;
[0121] A writing module 403, used for writing the byte stream string information into the message data field of the first target data structure, the first target data structure being a data structure corresponding to the byte stream string information;
[0122] The storage module 404 is used to obtain and store the recording data packet according to the first target data structure in which the byte stream character string information is written.
[0123] In a possible implementation, the acquisition module 401 may be specifically used for:
[0124] According to the configuration file, determine the channel name and communication type of the message during transmission;
[0125] Create a subscriber based on the channel name and communication type of the message when it is transmitted;
[0126] When the vehicle is in the autonomous driving state, the subscriber obtains messages that meet the preset data format requirements from all messages sent by the vehicle.
[0127] In a possible implementation, the acquisition module 401 may be specifically used for:
[0128] Determine the subscription function based on the recording toolkit;
[0129] Create a subscriber based on the calling function, the channel name and the communication type of the message when it is transmitted.
[0130] In a possible implementation, the first target data structure further includes a channel name field and a message type name field; the storage module 404 may be specifically used for:
[0131] Write the subscription channel message into the channel name field in the first target data structure, and write the communication type of the recorded message during transmission into the message type name field in the first target data structure;
[0132] The first target data structure having the channel name field, the message type name field and the message data field written therein is written into the recording data packet and stored.
[0133] In a possible implementation, the storage module 404 may also be specifically used for:
[0134] In response to a request operation for message playback, storing the byte stream character string information in the recording data packet into the message data field of the second target data structure;
[0135] Deserialize the byte stream character string information in the message data field of the second target data structure to obtain a message that meets the playback requirements;
[0136] Publish messages that meet the playback requirements to play the data of the recorded data packets.
[0137] In a possible implementation, the storage module 404 may also be specifically used for:
[0138] In response to a request operation for playing a message, determining a message publisher and a channel message stored in a file when the message publisher publishes the recording;
[0139] According to the channel message stored in the file when the message publisher publishes the recording, the byte stream string information in the recording data packet is determined;
[0140] The byte stream character string information in the recording data packet is stored in the message data field of the second target data structure.
[0141] In a possible implementation, the storage module 404 may also be specifically used for:
[0142] Determine the communication type of the channel message that the publisher of the message publishes and stores in the file when recording;
[0143] According to the communication type of the channel message stored in the file when the message publisher publishes the recording, the byte stream character string information in the message data field of the target data structure is deserialized to obtain a message that meets the playback requirements.
[0144] The message processing device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be described in detail here.
[0145] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 As shown, the electronic device 50 provided in this embodiment includes: at least one processor 501 and a memory 502. Optionally, the device 50 also includes a communication component 503. The processor 501, the memory 502 and the communication component 503 are connected via a bus 504.
[0146] In a specific implementation process, at least one processor 501 executes the computer-executable instructions stored in the memory 502, so that at least one processor 501 executes the above method.
[0147] The specific implementation process of the processor 501 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0148] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0149] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.
[0150] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0151] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.
[0152] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.
[0153] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0154] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.
[0155] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0156] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0157] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0158] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0159] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0160] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A message processing method, characterized in that: The method comprises: When recording a message, obtaining the message that meets a preset data format requirement, wherein the preset data format requirement is determined according to a communication type of the message when it is transmitted; Serializing the message to obtain byte stream character string information; Writing the byte stream character string information into a message data field of a first target data structure, wherein the first target data structure is a data structure corresponding to the byte stream character string information; According to the first target data structure in which the byte stream character string information is written, a recording data packet is obtained and stored.
2. The method according to claim 1, characterized in that The step of obtaining a recorded message that meets the preset data format requirement includes: Determine, according to the configuration file, the channel name and communication type of the message during transmission; Creating a subscriber according to the channel name and communication type of the message when transmitting; When the vehicle is in an automatic driving state, messages that meet preset data format requirements are obtained from all messages sent by the vehicle through the subscriber.
3. The method according to claim 2, characterized in that The step of creating a subscriber according to the channel name and communication type of the recorded message during transmission includes: Determine the calling function based on the recording toolkit; A subscriber is created according to the calling function, the channel name of the message during transmission, and the communication type.
4. The method according to any one of claims 1 to 3, characterized in that The first target data structure also includes a channel name field and a message type name field; The step of obtaining and storing a recording data packet according to the first target data structure written with the byte stream character string information comprises: Writing the subscription channel message into the channel name field in the first target data structure, and writing the communication type of the recorded message during transmission into the message type name field in the first target data structure; The first target data structure written with the channel name field, the message type name field and the message data field is written into a recording data packet and stored.
5. The method according to claim 1, characterized in that After obtaining and storing the recording data packet according to the first target data structure written with the byte stream character string information, the method further includes: In response to a request operation for message playback, storing the byte stream character string information in the recording data packet into a message data field of a second target data structure; Deserialize the byte stream character string information in the message data field of the second target data structure to obtain a message that meets the playback requirements; A message that meets the playback requirements is published to play the data of the recorded data packet.
6. The method according to claim 5, characterized in that The step of storing the byte stream character string information in the recording data packet into the message data field of the second target data structure in response to the request operation of playing the message includes: In response to a request operation for playing a message, determining a message publisher and a channel message stored in a file when the message publisher publishes the recording; Determine the byte stream character string information in the recording data packet according to the channel message stored in the file when the message publisher publishes the recording; The byte stream character string information in the recording data packet is stored in the message data field of the second target data structure.
7. The method according to claim 5, characterized in that The deserializing of the byte stream character string information in the message data field of the second target data structure to obtain a message that meets the playback requirements includes: Determine the communication type of the channel message that the publisher of the message publishes and stores in the file when recording; According to the communication type of the channel message stored in the file when the message publisher publishes the recording, the byte stream character string information in the message data field of the target data structure is deserialized to obtain a message that meets the playback requirements.
8. A message processing device, characterized in that: include: An acquisition module, used to acquire the message that meets the preset data format requirement when recording the message, wherein the preset data format requirement is determined according to the communication type of the message when it is transmitted; A serialization processing module, used for serializing the message to obtain byte stream string information; A writing module, used for writing the byte stream character string information into a message data field of a first target data structure, wherein the first target data structure is a data structure corresponding to the byte stream character string information; The storage module is used to obtain and store the recording data packet according to the first target data structure in which the byte stream character string information is written.
9. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.