Subscription message processing method, device, electronic device and autonomous driving vehicle

Through serialization processing and digest information generation, combined with black and white listing and caching mechanism, the efficiency and accuracy of message storage and playback in the publish and subscription mode system are solved, and efficient and reliable message storage and reading are achieved.

CN114327947BActive Publication Date: 2025-08-29APOLLO INTELLIGENT DRIVING (BEIJING) TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111611729.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-27
Publication Date
2025-08-29
Estimated Expiration
2041-12-27

AI Technical Summary

Technical Problem

In the prior art, publishing subscription mode systems are prone to errors when storing and replaying messages of unstructured data, and lack effective storage methods.

Method used

Serialization is used to convert different message types into a target format in a unified format, generate summary information and save it in a specified file, and combine black and white lists and cache mechanisms to ensure the storage and reading efficiency of messages.

Benefits of technology

Improves the efficiency and accuracy of message storage, ensures message compatibility and fast reading, and reduces the risk of data loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114327947B_ABST
    Figure CN114327947B_ABST
Patent Text Reader

Abstract

The present disclosure provides a subscription message processing method, device, electronic device and autonomous driving vehicle, which relate to the field of data processing technology, and in particular to message processing technology in the field of autonomous driving. The specific implementation scheme is: obtaining the original message; the original message contains the message content in the target format, and the target format is a unified format obtained after serializing the original messages of different message types; when it is determined that the original message meets the storage conditions, the original message is saved to a designated file; based on the message content in the target format contained in the original message, the acquisition time of the original message and the storage location of the original message in the designated file, the summary information of the original message is generated; and the summary information is saved in the designated file. According to the technical solution of the present disclosure, the efficiency and accuracy of message storage can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and in particular to message processing technology in the field of autonomous driving. Background Art

[0002] In a publish-subscribe system, both scheduling and business logic implementation are driven by data. Since messages in the system are unstructured, with uncertain types and lengths, direct storage in traditional databases can be prone to errors when recording or replaying system messages. Therefore, providing an effective storage method to support the recording and replay of system messages has become a pressing technical challenge. Summary of the Invention

[0003] The present disclosure provides a subscription message processing method, device, electronic device, storage medium, autonomous driving vehicle, and computer program product.

[0004] According to a first aspect of the present disclosure, a message processing method is provided, comprising:

[0005] Obtaining an original message; the original message contains message content in a target format, where the target format is a unified format obtained by serializing original messages of different message types;

[0006] When it is determined that the original message meets the storage conditions, the original message is saved to a designated file;

[0007] Generate summary information of the original message based on the target format message content contained in the original message, the acquisition time of the original message, and the storage location of the original message in the specified file;

[0008] Save summary information in the specified file.

[0009] According to a second aspect of the present disclosure, a message processing method is provided, including:

[0010] Get a message output request, which includes a file name and a start time;

[0011] Determine a target file from multiple specified files based on the file name, each of which stores multiple original messages and summary information of the multiple original messages; the original messages contain message content in a target format, which is a unified format obtained by serializing original messages of different message types;

[0012] Reading summary information in the target file, and determining a storage location of at least one target original message in the target file from a plurality of original messages stored in the target file based on the summary information and the start time;

[0013] At least one target original message is read from a storage location of the at least one target original message in the target file, and the at least one target original message is output.

[0014] According to a third aspect of the present disclosure, a message processing device is provided, including:

[0015] A first acquisition unit is configured to acquire an original message; the original message includes message content in a target format, where the target format is a unified format obtained by serializing original messages of different message types;

[0016] A first saving unit is configured to save the original message to a designated file if it is determined that the original message meets the storage condition;

[0017] a generating unit, configured to generate summary information of the original message based on the message content in the target format contained in the original message, the acquisition time of the original message, and the storage location of the original message in the designated file;

[0018] The second saving unit is configured to save the summary information in the designated file.

[0019] According to a fourth aspect of the present disclosure, a message processing device is provided, including:

[0020] A third acquiring unit is configured to acquire a message output request, wherein the message output request includes a file name and a start time;

[0021] a third determining unit, configured to determine a target file from a plurality of designated files based on the file name; wherein each designated file stores a plurality of original messages and summary information of the plurality of original messages, each original message containing message content in a target format, wherein the target format is a unified format obtained by serializing original messages of different message types;

[0022] a fourth determining unit, configured to determine a storage location in the target file of at least one target original message from the plurality of original messages stored in the target file based on the summary information in the target file and the start time;

[0023] The output unit is configured to read the at least one target original message from a storage location of the at least one target original message in the target file and output the at least one target original message.

[0024] According to a fifth aspect of the present disclosure, there is provided an electronic device, including:

[0025] at least one processor; and

[0026] a memory communicatively connected to the at least one processor; wherein,

[0027] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the method described above.

[0028] According to a sixth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, where the computer instructions are used to enable a computer to execute the method described above.

[0029] According to a seventh aspect of the present disclosure, a computer program product is provided, comprising a computer program, which implements the above-described method when executed by a processor.

[0030] According to an eighth aspect of the present disclosure, an autonomous driving vehicle is provided, comprising the electronic device as described in the fifth aspect.

[0031] According to the technical solution of the present disclosure, a more efficient storage method is provided to record system messages, thereby facilitating support for recording or playing back messages.

[0032] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.

[0034] Figure 1 This is a schematic diagram of the implementation process of the message processing method according to the embodiment of the present disclosure Figure 1 ;

[0035] Figure 2 This is a flow chart of message writing according to an embodiment of the present disclosure;

[0036] Figure 3 This is a schematic diagram of the implementation process of the message processing method according to the embodiment of the present disclosure Figure 2 ;

[0037] Figure 4 is a flow chart of message playback according to an embodiment of the present disclosure;

[0038] Figure 5 This is a schematic diagram of the structure of the message processing device according to the embodiment of the present disclosure. Figure 1 ;

[0039] Figure 6 This is a schematic diagram of the structure of the message processing device according to the embodiment of the present disclosure. Figure 2 ;

[0040] Figure 7It is a block diagram of an electronic device used to implement the message processing method according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0041] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0042] The terms "first," "second," and "third," etc. in the description, embodiments, claims, and figures of the present disclosure are used to distinguish similar objects and are not necessarily used to describe a particular order or precedence. In addition, the terms "including" and "having," and any variations thereof, are intended to cover non-exclusive inclusions, for example, including a series of steps or units. A method, system, product, or apparatus is not necessarily limited to the steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to the process, method, product, or apparatus.

[0043] It should be noted that the messages described in the following embodiments may be subscription messages.

[0044] The present disclosure provides a message processing method, which can be applied to electronic devices, including but not limited to fixed devices and / or mobile devices. For example, fixed devices include but are not limited to servers, and servers can be cloud servers or ordinary servers. For example, mobile devices include but are not limited to: one or more of a mobile phone or a tablet computer. Figure 1 As shown, the message processing method includes:

[0045] S101: Acquire an original message, which contains message content in a target format. The target format is a unified format obtained by serializing original messages of different message types.

[0046] S102: If it is determined that the original message meets the storage conditions, save the original message to a designated file;

[0047] S103: Generate summary information of the original message based on the target format message content contained in the original message, the acquisition time of the original message, and the storage location of the original message in the designated file;

[0048] S104: Save the summary information in a designated file.

[0049] The above message processing method is suitable for storing message data.

[0050] The message here can be various types of data. For example, the message can include vehicle status information, geographic location information, posture information, running speed information, etc. For another example, the message can also include image data, voice data, etc.

[0051] The target format is a preset unified format, which is a unified format that can be obtained after serialization of original messages of different message types. The present disclosure does not limit the message type of the original message.

[0052] Here, the original message in S101 is a message that has been serialized.

[0053] In some embodiments, obtaining the original message includes obtaining the original message sent by the external module. In other embodiments, obtaining the original message includes obtaining the original message sent by the external module that is forwarded by the transit module.

[0054] In this way, since what is obtained is the original message in a unified format obtained after processing messages of different message types, it is convenient to uniformly store and manage messages of different message types, and further it is convenient to quickly read out the stored messages.

[0055] In an embodiment of the present disclosure, the storage conditions may be specified by an external module that sends the original message, or the storage conditions may be set by the system. The present disclosure does not limit the content of the storage conditions. In some embodiments, the storage conditions are set according to the subject of the original message. Here, the subject is used to identify the target sending object of the original message. Exemplarily, the storage conditions include that the subject of the original message meets the subject requirements. In other embodiments, the storage conditions are set according to the source of the original message. Here, the source is used to identify the object that sends the original message. Exemplarily, the storage conditions include that the source of the original message meets the source requirements. In yet other embodiments, the storage conditions are set according to the acquisition time of the original message. Here, the acquisition time can be understood as the incoming time of the original message. Exemplarily, the storage conditions include that the acquisition time of the original message meets the time requirements.

[0056] In the embodiment of the present disclosure, saving the original message to the designated file includes: saving information such as the target format message content of the original message, the subject of the original message, and the message type of the original message to the designated file.

[0057] In an embodiment of the present disclosure, summary information of the original message is generated based on the target format message content contained in the original message, the acquisition time of the original message, and the storage location of the original message in the designated file, including: generating summary information of the original message based on one or more of the information such as the length of the target format message content contained in the original message, the acquisition time of the original message, the storage location of the original message in the designated file, the subject of the original message, and the message type of the original message. The specific content included in the summary information and the format of the summary information can be set according to requirements. The more detailed the summary information is, the more helpful it is for subsequent data reading and improving the accuracy of reading.

[0058] In the embodiment of the present disclosure, the designated file may be designated by an external module that sends the original message, or the system may automatically assign the designated file to the original message.

[0059] In the embodiment of the present disclosure, the designated file may exist in the form of a data packet or a binary file.

[0060] The technical solution described in the embodiment of the present disclosure obtains an original message containing message content in a target format, and saves the original message to a designated file when it is determined that the original message meets the storage conditions; and saves the summary information of the original message in the designated file; in this way, messages of different message types can be stored, and since the format of the message content contained in the original message is the target format, it is convenient to uniformly store and manage each original message, which not only improves the efficiency and accuracy of storage, but also improves the compatibility of stored messages; in addition, by recording the summary information of the original message, it is also convenient to quickly read out the original message later.

[0061] In some embodiments, the original message also includes the subject of the original message, which is used to identify the target recipient of the original message; when it is determined that the original message meets the storage conditions, the original message is saved to a designated file, including: when it is determined that the original message meets the storage conditions based on the subject of the original message, the original message is written to the designated file.

[0062] This disclosure does not limit the content of the storage conditions. In some embodiments, the storage conditions include multiple permitted topics. If the storage conditions include the subject of the original message, the original message is determined to meet the storage conditions and the original message is written to the designated file. In other embodiments, the storage conditions include multiple prohibited topics. If the storage conditions do not include the subject of the original message, the original message is determined to meet the storage conditions and the original message is written to the designated file.

[0063] In this way, determining whether the storage condition is met based on the subject of the original message helps to perform refined management of the stored original messages based on the subject of the original message, thereby improving the accuracy of storage.

[0064] In some embodiments, the message processing method also includes: obtaining a first blacklist and a first whitelist; determining that the original message meets the storage conditions when it is found that the first blacklist is empty and the subject of the original message is recorded in the first whitelist; or determining that the original message meets the storage conditions when it is found that the first whitelist is empty and the subject of the original message is not recorded in the first blacklist.

[0065] The first blacklist may include topics that are not permitted, and the topics are used to identify the target recipient of the original message. The present disclosure does not impose a mandatory limit on the number of topics included in the first blacklist.

[0066] The first whitelist may include a subject representing permission, which is used to identify the target recipient of the original message. The present disclosure does not impose a mandatory limit on the number of subjects included in the first whitelist.

[0067] For example, the first whitelist includes topic 1, topic 2,... and topic 100. Assuming that the topic of the currently received original message 1 is topic 1, then the original message 1 meets the storage condition; assuming that the topic of the currently received original message 2 is topic 200, then the original message 2 does not meet the storage condition.

[0068] For example, the first blacklist includes topic a, topic b and topic c. If the topic of the currently received original message 1 is topic 1, then the original message 1 meets the storage condition; if the topic of the currently received original message 3 is topic c, then the original message 3 does not meet the storage condition.

[0069] The present disclosure does not limit the method for obtaining the first blacklist and the first whitelist. For example, in some embodiments, obtaining the first blacklist and the first whitelist includes: before receiving the original message, receiving a message entry configuration request sent by an external module, and determining the first blacklist and the first whitelist based on the message entry configuration request. For another example, in other embodiments, obtaining the first blacklist and the first whitelist includes: obtaining the first blacklist and the first whitelist from the obtained original message.

[0070] In this way, whether the storage condition is met is determined based on the first blacklist and the first whitelist, and customized management can be performed on the stored original message, thereby improving the storage accuracy.

[0071] In some embodiments, saving the original message to the designated file includes: caching the original message; and writing the original message to the designated file when a cache threshold is reached.

[0072] Here, the cache threshold is set or adjusted according to certain design requirements or user requirements.

[0073] For example, the cache threshold is determined according to the size of the memory. In some implementations, when the size of the cached message data reaches a preset size threshold, the cached original message is written to a designated file.

[0074] For another example, the cache threshold is determined based on the number of messages. In some implementations, when the number of cached messages reaches a preset threshold, the cached original messages are written to a designated file.

[0075] In this way, the original message obtained is first placed in the buffer for caching, which can solve the problem that the input and output bottleneck may be reached when encountering traffic peaks due to unstable message traffic in the system, and the message cannot be written in time, resulting in data loss.

[0076] To further prevent data loss, some implementations cache the original message. When a cache threshold is reached, the original message is written to a designated file. This involves: sending the original message to memory; placing the original message's address in memory into the cache; and when the cached data reaches the cache threshold, reading the original message from memory based on the address in the cache and writing it to a designated file on the hard disk. This method uses the storage address to transmit the original message, copying only the storage address, preventing data loss during caching and improving storage accuracy.

[0077] To reduce the efficiency issues caused by read-write locks when inputting and writing messages, some implementations use a dual-buffered queue to store both incoming and outgoing messages. Once all messages in the write queue have been written and cleared, the contents of the two queues are swapped before the write operation resumes.

[0078] In some embodiments, the message processing method further includes: compressing the original message according to a preset compression method; further, saving the original message to a designated file, including: saving the compressed original message in the first part of the designated file; wherein, saving the summary information in the designated file includes: saving the summary information to the second part of the designated file.

[0079] The present disclosure does not limit the type of the preset compression method. For example, the preset compression method can be bzip2 compression, gzip compression, etc.

[0080] Here, the designated file is divided into at least two parts, which are respectively recorded as a first part and a second part. Generally speaking, the first part is located at the front end of the designated file, and the second part is located at the end of the designated file.

[0081] In this way, by compressing the original message using a preset compression method, the space occupied by the original message in the designated file can be saved, thereby increasing the number of original messages stored in the designated file.

[0082] In some embodiments, before saving the original message to the designated file, it also includes: creating a new file when it is detected that the size of the current file exceeds the size threshold or the time period recorded in the current file exceeds the time period threshold, and using the new file as the designated file; otherwise, using the current file as the designated file.

[0083] Here, the size thresholds corresponding to different files may be different; the time period thresholds corresponding to different files may also be different.

[0084] Here, the time period threshold represents the time period threshold of the messages recorded in the current file. For example, if the time period threshold of file 1 is 10:00-11:00, then messages between 10:00 and 11:00 will be stored. If the acquisition time of the currently received original message 1 is 10:00, then original message 1 can be stored in file 1. If the acquisition time of the currently received original message 80 is 11:01, then original message 80 cannot be stored in file 1. Instead, a new file can be created and original message 80 can be stored in the newly created file.

[0085] It should be noted that the designated file can be named according to the process ID and time period. For example, designated file 1 can be named "Process 1 + 10:00-11:00" and designated file 2 can be named "Process 1 + 11:00-12:00".

[0086] In this way, by storing messages based on the file size of each specified file or the time period to which the stored messages belong, better data support can be provided for subsequent reading of the stored original messages, thereby improving the search and reading rates.

[0087] Figure 2 The specific process of writing messages is shown in Figure 1. Figure 2 As shown, the process includes:

[0088] S201, initialization;

[0089] Specifically, the first configuration file is loaded, the first blacklist and the second whitelist, the preset compression method of the file, the file size threshold, the maximum recording time period of each file and other information are read, and then the system message is monitored.

[0090] S202, wait for the serialized original message to be received, and then execute S203;

[0091] S203, determine whether storage is required, if yes, execute S204, if no, return to S202;

[0092] Specifically, based on the first blacklist and the second whitelist, it is determined whether the currently incoming original message needs to be stored. If storage is required, the data of the original message is sent to the buffer queue.

[0093] S204, send the original message to the cache queue, and then execute S205;

[0094] S205: Check if the cache threshold is reached. If yes, execute S206; if no, return to S202.

[0095] Specifically, when the data in the cache reaches a certain size or after a certain time interval, the cache data is written asynchronously.

[0096] S206, asynchronously writing to the specified file.

[0097] Before writing, the specified file size and recorded time period are checked to see if they exceed the threshold. If so, a new file is created according to the naming rules. In addition, summary information such as the subject, acquisition time, and storage address of all messages in the specified file is written to the specified file. The file name can be associated with time information to facilitate sequential search during data playback.

[0098] When writing the original message data, the written data includes the message content, message type, subject, and acquisition time in the target format. When writing the original message data, the written data can be compressed using a preset compression method according to the settings in the initialization.

[0099] This ensures that messages can be written, read, and restored to the original incoming message.

[0100] It should be understood that Figure 2 The flowchart shown is only illustrative and not restrictive, and those skilled in the art can Figure 2 Various obvious changes and / or substitutions can be made to the examples, and the resulting technical solutions still fall within the scope of the disclosure of the embodiments of the present disclosure.

[0101] The present disclosure provides a message processing method, which can be applied to electronic devices, including but not limited to fixed devices and / or mobile devices. For example, fixed devices include but are not limited to servers, and servers can be cloud servers or ordinary servers. For example, mobile devices include but are not limited to: one or more of a mobile phone or a tablet computer. Figure 3 As shown, the message processing method includes:

[0102] S301: Obtain a message output request, which includes a file name and a start time;

[0103] S302: Determine a target file from multiple designated files based on the file name, each designated file storing multiple original messages and summary information of the multiple original messages; the original messages contain message content in a target format, which is a unified format obtained by serializing original messages of different message types;

[0104] S303: Determine a storage location of at least one target original message in the target file from the multiple original messages stored in the target file based on the summary information and the start time in the target file;

[0105] S304: Read at least one target original message from a storage location of the at least one target original message in the target file, and output the at least one target original message.

[0106] The above message processing method is suitable for reading message data.

[0107] Here, different specified files correspond to different file names.

[0108] Here, the start time includes the start time and end time of the message to be played back. For example, the start time is 8:00, the end time is 9:00, and the start time is 8:00-9:00, that is, all messages between 8:00-9:00 need to be played back, that is, all messages between 8:00-9:00 need to be read and output.

[0109] The technical solution described in the embodiment of the present disclosure obtains a message output request; determines a target file from multiple specified files based on the file name in the message output request, determines the storage location of at least one target original message in the target file from multiple original messages saved in the target file based on the summary information in the target file and the start time in the message output request, reads at least one target original message, and outputs at least one target original message; in this way, the original message to be output can be quickly and accurately locked based on the summary information in the target file, thereby improving the efficiency and accuracy of message output.

[0110] In some embodiments, the summary information of each designated file further includes the subject of the original message; and the message output request further includes a second blacklist and a second whitelist. Furthermore, the method further includes: if the second blacklist is empty, based on the summary information, filtering at least one target original message whose subject is recorded in the second whitelist from at least one original message within the starting time; or, if the second whitelist is empty, based on the summary information, filtering at least one target original message whose subject is not recorded in the second blacklist from at least one original message within the starting time.

[0111] The second blacklist may include topics that are not permitted, and the topics are used to identify the target recipient of the original message. The present disclosure does not impose a mandatory limit on the number of topics included in the second blacklist.

[0112] The second whitelist may include a subject representing permission, which is used to identify the target recipient of the original message. The present disclosure does not impose a mandatory limit on the number of subjects included in the second whitelist.

[0113] For example, the message output request requires the replay of the messages of process 1 between 10:00 and 11:00. If the designated file of process 1 between 10:00 and 11:00 is designated file 1, and designated file 1 contains original message 1, original message 2,..., original message 100, if the second blacklist includes topic d and topic e, if the topic of original message 1 is topic d, then there is no need to read original message 1; if the topic of original message 5 is topic f, then original message 5 needs to be read.

[0114] For another example, the message output request requires the replay of the messages of process 1 between 10:00 and 11:00. If the designated file of process 1 between 10:00 and 11:00 is designated file 1, and designated file 1 contains original message 1, original message 2, ..., original message 100, if the second whitelist includes topic 1, topic 2, ... topic 50, then all original messages with topics 1 to 50 need to be read out.

[0115] In this way, by combining the second blacklist and the second whitelist, the target original message that meets the message output request can be quickly determined, thereby improving the efficiency and accuracy of message output.

[0116] In some embodiments, reading at least one target original message from a storage location of at least one target original message in a target file includes: placing the target original message that has been read in the at least one target original message into a cache; pausing reading data from the storage location of at least one target original message in the target file when the total number of cached messages reaches a maximum number of messages or the data size reaches a maximum memory capacity; and continuing to read the target original message that has not been read from the storage location of at least one target original message in the target file after the cached target original message is output.

[0117] Here, the maximum number of messages and the maximum memory capacity can be set or adjusted according to needs.

[0118] For example, if you need to read original messages 1 to 50 from specified file 1 and have already read original messages 1 to 10 into the cache, if the total number of cached messages reaches the maximum number of messages or the data size reaches the maximum memory capacity, reading of original messages 11 to 50 will be paused. After original messages 1 to 10 in the cache are output, reading of original messages 11 to 50 will continue.

[0119] This can prevent messages from being generated too quickly, causing a large number of messages to be accumulated in the memory. At the same time, it also provides support for subsequent control of the output time of the original message.

[0120] In some embodiments, reading at least one target original message from the storage location of at least one target original message in the target file includes: decompressing the data read from the storage location of at least one target original message in the target file according to a preset decompression method to obtain at least one target original message.

[0121] Here, the preset decompression mode is a decompression mode corresponding to the preset compression mode.

[0122] In this way, the original message when it is input can be obtained through the preset decompression method, thereby ensuring the identity of the original message when it is output, and improving the accuracy of the output message.

[0123] In some embodiments, the message output request also includes a playback speed; wherein, outputting at least one target original message includes: determining the acquisition time of at least one target original message from the summary information in the target file; and controlling the output time of each target original message in at least one target original message according to the interval between the playback speed and the acquisition time of each target original message in at least one target original message.

[0124] Here, the playback speed refers to the time interval between the acquisition times of the original messages during storage.

[0125] For example, original messages 1 to 100 are transmitted sequentially, and the time interval between each original message is 2 seconds. After the original messages 1 to 100 are stored in the designated file 1, if the playback speed specified in the received message output request is 2 times, then when the original messages 1 to 100 are output, the transmission time interval between the original messages 1 to 100 is controlled to be 1 second, thereby meeting the playback speed requirement.

[0126] In this way, the message transmission time can be controlled in combination with the playback speed specified by the message output request, thereby being able to control the running status of the message in the original system, thereby improving the controllable diversity of the output.

[0127] Figure 4 A schematic diagram of the message playback process is shown in FIG. Figure 4As shown, the process includes:

[0128] S401, initialization;

[0129] Specifically, the second configuration file is loaded, and information such as the second blacklist, the second whitelist, the name of the file to be played back, the playback speed, and the starting time point are read from the second configuration file.

[0130] S402, read summary information and filter useless messages;

[0131] Specifically, the file to be played back is opened, summary information is read, useless messages are filtered according to the start time of the play, the second blacklist and the second whitelist, and target data is determined.

[0132] S403, read the target data and put it into the cache;

[0133] Specifically, the target data is read from the specified location in the file based on the storage location specified in the summary information. The original message is parsed based on the way it was written when it was stored and restored to the cache. When the total number or total size of messages in memory reaches a threshold, reading is paused and resumed after the data in the cache is output.

[0134] S404, start outputting, and transmit target messages in sequence.

[0135] The original message is read from the cache and, based on the playback speed and the time each original message was received, is dormant until the required time point before being transmitted. The external module then restores the original message based on the message type and performs message flow. This way, when data needs to be transmitted, the message can be quickly found and transmitted according to the external module's requirements. When the external module uses the disclosed method for data writing and playback, it can customize the serialization and deserialization methods to restore the original type of the incoming message.

[0136] It should be understood that Figure 4 The flowchart shown is only illustrative and not restrictive, and those skilled in the art can Figure 4 Various obvious changes and / or substitutions can be made to the examples, and the resulting technical solutions still fall within the scope of the disclosure of the embodiments of the present disclosure.

[0137] The message processing method provided by the present disclosure can be used in projects such as message storage and message playback. For example, it is applicable to a publish-subscribe model system that needs to record message data and playback it.

[0138] The present disclosure also provides a message processing device, such as Figure 5 As shown, the message processing device includes:

[0139] The first acquisition unit 510 is configured to acquire an original message; the original message includes message content in a target format, where the target format is a unified format obtained by serializing original messages of different message types;

[0140] The first saving unit 520 is configured to save the original message to a designated file if it is determined that the original message meets the storage condition;

[0141] The generating unit 530 is configured to generate summary information of the original message based on the target format message content contained in the original message, the acquisition time of the original message, and the storage location of the original message in the designated file;

[0142] The second saving unit 540 is configured to save the summary information in a designated file.

[0143] In some implementations, the original message also includes the subject of the original message;

[0144] The first storage unit 520 is used to:

[0145] When it is determined according to the subject of the original message that the original message meets the storage condition, the original message is written into the designated file.

[0146] In some embodiments, the device further comprises:

[0147] A second acquiring unit, configured to acquire the first blacklist and the first whitelist;

[0148] a first determining unit, configured to determine that the original message meets the storage condition when it is found that the first blacklist is empty and the subject record of the original message is in the first whitelist;

[0149] or

[0150] Used to determine that the original message meets the storage condition when it is queried that the first whitelist is empty and the subject of the original message is not recorded in the first blacklist.

[0151] In some implementations, the first storage unit 520 is configured to:

[0152] Cache the original message;

[0153] Writes the original message to the specified file when the cache threshold is reached.

[0154] In some embodiments, the device also includes: a compression unit, used to compress the original message according to a preset compression method; wherein, a first saving unit 520 is used to save the compressed original message in the first part of the designated file; and a second saving unit 540 is used to save the summary information to the second part of the designated file.

[0155] In some embodiments, the device further includes: a second determination unit, configured to create a new file before the first saving unit saves the original message to the designated file, if it is detected that the size of the current file exceeds a size threshold or the time period recorded in the current file exceeds a time period threshold, and use the new file as the designated file; otherwise, use the current file as the designated file.

[0156] Those skilled in the art should understand that the functions of each processing module in the message processing device of the embodiment of the present disclosure can be understood with reference to the relevant description of the aforementioned message processing method. Each processing module in the message processing device of the embodiment of the present disclosure can be implemented by an analog circuit that implements the functions described in the embodiment of the present disclosure, or can be implemented by running software that executes the functions described in the embodiment of the present disclosure on an electronic device.

[0157] The message processing device of the embodiment of the present disclosure can improve the efficiency and accuracy of message storage.

[0158] The present disclosure also provides a message processing device, such as Figure 6 As shown, the message processing device includes:

[0159] The third acquiring unit 610 is configured to acquire a message output request, where the message output request includes a file name and a start time;

[0160] A third determining unit 620 is configured to determine a target file from a plurality of designated files based on the file name; wherein each designated file stores a plurality of original messages and summary information of the plurality of original messages, each original message includes message content in a target format, and the target format is a unified format obtained by serializing original messages of different message types;

[0161] The fourth determining unit 630 is configured to determine a storage location of at least one target original message in the target file from the multiple original messages stored in the target file based on the summary information and the start time in the target file;

[0162] The output unit 640 is configured to read at least one target original message from a storage location of the at least one target original message in the target file, and output the at least one target original message.

[0163] In some embodiments, the summary information of each designated file also includes the subject of the original message; the message output request also includes a second blacklist and a second whitelist; wherein the device also includes a fifth determination unit, which is used to: when the second blacklist is empty, filter out at least one target original message whose subject is recorded in the second whitelist from at least one original message within the starting time based on the summary information; or, when the second whitelist is empty, filter out at least one target original message whose subject is not recorded in the second blacklist from at least one original message within the starting time based on the summary information.

[0164] In some embodiments, the output unit 640 is further configured to:

[0165] Putting the read target original message in at least one target original message into the cache;

[0166] When the total number of cached messages reaches a maximum number of messages or the data size reaches a maximum memory capacity, pausing reading data from a storage location of at least one target original message in a target file;

[0167] After the target original message to be cached is output, the target original message that has not been read is read from the storage location of at least one target original message in the target file.

[0168] In some embodiments, the output unit 640 is further configured to:

[0169] The data read from the storage location of the at least one target original message in the target file is decompressed according to a preset decompression method to obtain the at least one target original message.

[0170] In some embodiments, the message output request further includes a playback speed; the output unit 640 is further configured to:

[0171] determining, from the summary information in the target file, an acquisition time of at least one target original message;

[0172] The output time of each target original message in the at least one target original message is controlled according to the playback speed and the interval between the acquisition times of each target original message in the at least one target original message.

[0173] Those skilled in the art should understand that the functions of each processing module in the message processing device of the embodiment of the present disclosure can be understood with reference to the relevant description of the aforementioned message processing method. Each processing module in the message processing device of the embodiment of the present disclosure can be implemented by an analog circuit that implements the functions described in the embodiment of the present disclosure, or can be implemented by running software that executes the functions described in the embodiment of the present disclosure on an electronic device.

[0174] The message processing device of the embodiment of the present disclosure can improve the efficiency and accuracy of message output.

[0175] The present disclosure also provides an autonomous driving vehicle, which includes Figure 5 and Figure 6 The message processing device shown. The autonomous driving vehicle adopts Figures 1 to 4 The method shown processes subscription messages. Exemplarily, the subscription messages are stored in the following manner: obtaining an original message; the original message contains message content in a target format, where the target format is a unified format obtained by serializing original messages of different message types; if it is determined that the original message meets the storage conditions, saving the original message to a designated file; generating summary information of the original message based on the message content in the target format contained in the original message, the time the original message was obtained, and the storage location of the original message in the designated file; and saving the summary information in the designated file. As another example, the autonomous driving vehicle replays the subscription message in the following manner: obtaining a message output request, which includes a file name and a start time; determining a target file from multiple specified files based on the file name; wherein each of the specified files stores multiple original messages and summary information of the multiple original messages, and each original message includes message content in a target format, which is a unified format obtained by serializing original messages of different message types; based on the summary information and the start time in the target file, determining the storage location of at least one target original message in the target file from the multiple original messages stored in the target file; reading the at least one target original message from the storage location of the at least one target original message in the target file, and outputting the at least one target original message.

[0176] In the technical solutions disclosed herein, the acquisition, storage, and application of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0177] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0178] Figure 7A schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0179] like Figure 7 As shown, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. Various programs and data required for the operation of the device 700 can also be stored in the RAM 703. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0180] Various components in device 700 are connected to I / O interface 705, including an input unit 706, such as a keyboard, mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a magnetic disk, optical disk, etc.; and a communication unit 709, such as a network card, modem, wireless communication transceiver, etc. The communication unit 709 allows device 700 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0181] The computing unit 701 can be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above, such as the message processing method. For example, in some embodiments, the message processing method can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as the storage unit 708. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the message processing method described above can be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to execute the message processing method in any other appropriate manner (eg, by means of firmware).

[0182] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0183] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0184] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0185] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a cathode ray tube (CRT) or a liquid crystal display (LCD) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0186] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0187] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises through computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.

[0188] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not limited herein.

[0189] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.

Claims

1. A subscription message processing method, comprising: Obtaining an original message; the original message includes message content in a target format, wherein the target format is a unified format obtained by serializing original messages of different message types; the original message also includes a subject of the original message; Get the first blacklist and the first whitelist; When it is found that the first blacklist is empty and the subject record of the original message is in the first whitelist, determining that the original message meets the storage condition; or When it is found that the first whitelist is empty and the subject of the original message is not recorded in the first blacklist, determining that the original message meets the storage condition; If it is determined that the original message meets the storage condition, saving the original message to a designated file; generating summary information of the original message based on the message content in the target format contained in the original message, the acquisition time of the original message, and the storage location of the original message in the designated file; Saving the summary information in the specified file; The step of saving the original message to a designated file when determining that the original message meets the storage condition includes: If it is determined according to the subject of the original message that the original message meets a storage condition, writing the original message into a designated file; compressing the original message according to a preset compression method; The step of saving the original message to a designated file includes: Saving the compressed original message in the first part of the designated file; The step of saving the summary information in the designated file includes: The summary information is saved to the second part of the specified file.

2. The method according to claim 1, wherein Saving the original message to a designated file includes: Cache the original message; When a cache threshold is reached, the original message is written to the designated file.

3. The method according to claim 1, wherein Before saving the original message to the specified file, the method further includes: When it is detected that the size of the current file exceeds a size threshold or the time period recorded in the current file exceeds a time period threshold, a new file is created and the new file is used as the designated file; otherwise, the current file is used as the designated file.

4. A subscription message processing method, comprising: Obtain a message output request, wherein the message output request includes a file name and a start time; The message output request further includes a second blacklist and a second whitelist; Determining a target file from a plurality of designated files based on the file name; wherein each designated file stores a plurality of original messages and summary information of the plurality of original messages; each original message contains message content in a target format, wherein the target format is a unified format obtained by serializing original messages of different message types; and each summary information contains a subject of the original message; Determining a storage location of at least one target original message in the target file from a plurality of original messages stored in the target file based on the summary information in the target file and the start time; Reading the at least one target original message from a storage location of the at least one target original message in the target file, and outputting the at least one target original message; If the second blacklist is empty, filtering out at least one target original message whose subject record is in the second whitelist from at least one original message within the starting time based on the summary information; or If the second whitelist is empty, filtering out at least one target original message whose subject is not recorded in the second blacklist from at least one original message within the starting time based on the summary information; The step of reading the at least one target original message from a storage location of the at least one target original message in the target file includes: The data read from the storage location of the at least one target original message in the target file is decompressed according to a preset decompression method to obtain the at least one target original message.

5. The method according to claim 4, wherein The step of reading the at least one target original message from a storage location of the at least one target original message in the target file comprises: Putting the read target original message in the at least one target original message into a cache; When the total number of cached messages reaches a maximum number of messages or the data size reaches a maximum memory capacity, pausing reading data from a storage location of the at least one target original message in the target file; After the target original message to be cached is output, the target original message that has not been read is read from the storage location of the at least one target original message in the target file.

6. The method according to claim 4, wherein: The message output request also includes a playback speed; The step of outputting the at least one target original message includes: Determining an acquisition time of the at least one target original message from the summary information in the target file; The output time of each target original message in the at least one target original message is controlled according to the playback speed and the interval between the acquisition time of each target original message in the at least one target original message.

7. A subscription message processing device, comprising: A first acquiring unit is configured to acquire an original message; the original message includes message content in a target format, wherein the target format is a unified format obtained by serializing original messages of different message types; and the original message also includes a subject of the original message; A second acquiring unit, configured to acquire the first blacklist and the first whitelist; a first determining unit, configured to determine that the original message meets a storage condition when it is found that the first blacklist is empty and the subject record of the original message is in the first whitelist; or for determining that the original message meets the storage condition when it is found that the first whitelist is empty and the subject of the original message is not recorded in the first blacklist; A first saving unit is configured to save the original message to a designated file if it is determined that the original message meets the storage condition; a generating unit, configured to generate summary information of the original message based on the message content in the target format contained in the original message, the acquisition time of the original message, and the storage location of the original message in the designated file; A second saving unit, configured to save the summary information in the designated file; The first storage unit is configured to: If it is determined according to the subject of the original message that the original message meets a storage condition, writing the original message into a designated file; A compression unit, configured to compress the original message according to a preset compression method; Wherein, the first storage unit is used to: Saving the compressed original message in the first part of the designated file; Wherein, the second storage unit is used to: The summary information is saved to the second part of the specified file.

8. The device according to claim 7, wherein The first storage unit is configured to: Cache the original message; When a cache threshold is reached, the original message is written to the designated file.

9. The apparatus according to claim 7, further comprising: The second determination unit is used to create a new file before the first saving unit saves the original message to the designated file if it is detected that the size of the current file exceeds a size threshold or the time period recorded in the current file exceeds a time period threshold, and use the new file as the designated file; otherwise, use the current file as the designated file.

10. A subscription message processing device, comprising: A third acquiring unit is configured to acquire a message output request, wherein the message output request includes a file name and a start time; The message output request further includes a second blacklist and a second whitelist; a third determining unit configured to determine a target file from a plurality of designated files based on the file name; wherein each designated file stores a plurality of original messages and summary information of the plurality of original messages; each original message includes message content in a target format, wherein the target format is a unified format obtained by serializing original messages of different message types; and each summary information includes a subject of the original message; a fourth determining unit, configured to determine a storage location in the target file of at least one target original message from the plurality of original messages stored in the target file based on the summary information in the target file and the start time; an output unit, configured to read the at least one target original message from a storage location of the at least one target original message in the target file, and output the at least one target original message; a fourth determining unit, configured to: if the second blacklist is empty, filter out, based on the summary information, from at least one original message within the starting time at least one target original message whose subject is recorded in the second whitelist; or, if the second whitelist is empty, filter out, based on the summary information, from at least one original message within the starting time at least one target original message whose subject is not recorded in the second blacklist; The output unit is further configured to: The data read from the storage location of the at least one target original message in the target file is decompressed according to a preset decompression method to obtain the at least one target original message.

11. The device according to claim 10, wherein The output unit is further configured to: Putting the read target original message in the at least one target original message into a cache; When the total number of cached messages reaches a maximum number of messages or the data size reaches a maximum memory capacity, pausing reading data from a storage location of the at least one target original message in the target file; After the target original message to be cached is output, the target original message that has not been read is read from the storage location of the at least one target original message in the target file.

12. The device according to claim 10, wherein The message output request also includes a playback speed; Wherein, the output unit is further used for: Determining an acquisition time of the at least one target original message from the summary information in the target file; The output time of each target original message in the at least one target original message is controlled according to the playback speed and the interval between the acquisition time of each target original message in the at least one target original message.

13. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 3 and / or any one of claims 4 to 6.

14. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 3 and / or any one of claims 4 to 6.

15. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 3 and / or any one of claims 4 to 6.

16. An autonomous driving vehicle comprising the electronic device according to claim 13.

Citation Information

Patent Citations

  • Data processing method based on micro-service and device thereof, terminal and storage medium

    CN111641710A

  • A message queue capacity expansion, capacity shrinkage and processing method, device and equipment

    CN113296971A