Method and device for generating message to be sent, electronic equipment and storage medium

By dynamically selecting compression strategies and generating message bits, the mechanical problems caused by fixed frame formats in signal communication are solved, and flexible adjustment and efficient transmission are achieved.

CN120433892APending Publication Date: 2025-08-05CHONGQING SOKON POWER CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510691575.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-27
Publication Date
2025-08-05

AI Technical Summary

Technical Problem

In the prior art, signal communication uses a fixed frame format to generate messages, which cannot be flexibly adjusted, resulting in signal communication being more mechanical, and the packet encoding of different types of signals has problems such as data redundancy or substantial data loss.

Method used

According to the type of the current signal, the target compression strategy is dynamically selected, the message data is generated through merge or differential compression, and the bits representing the compression strategy are generated, and the message to be sent is generated in combination with the message identification, optimizing the sending order and verification mechanism.

Benefits of technology

It realizes the flexibility of signal communication, reduces the length of packet data domain, improves transmission efficiency and reliability, and avoids data redundancy and loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120433892A_ABST
    Figure CN120433892A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of messages, and discloses a to-be-sent message generation method and device, electronic equipment and a storage medium, and the method comprises the steps: determining a target compression strategy for compressing a current signal according to the type of the current signal; compressing the current signal according to the target compression strategy to obtain message data corresponding to the current signal, and generating a message bit representing the type of the target compression strategy; generating a to-be-sent message corresponding to the current signal based on the message data, the message bit and the message identifier; wherein the message identifier is an identifier determined according to the source end of the current signal. According to the method, the target compression strategy can be adaptively and flexibly selected for signal compression, so that the total length of the message to be sent is shortened, and meanwhile, the message bits representing the type of the target compression strategy are generated, so that message decompression is facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicle technology, and in particular to a method, device, electronic device and storage medium for generating a message to be sent. Background Art

[0002] Related signal communication uses a fixed frame format to generate corresponding messages for communication. Because this fixed frame format results in a fixed message format and consistent data field length, it cannot be flexibly adjusted for messages corresponding to different signal types, resulting in a rather mechanical signal communication process. Summary of the Invention

[0003] In view of the above problems, the present application provides a method, device, electronic device and storage medium for generating a message to be sent, which is used to dynamically select a target compression strategy suitable for the current signal and generate a corresponding message to be sent, thereby improving the flexibility of signal communication.

[0004] According to one aspect of the present application, a method for generating a message to be sent is provided, the generating method comprising: determining a target compression strategy for compressing the current signal according to the type of the current signal; compressing the current signal according to the target compression strategy to obtain message data corresponding to the current signal, and generating message bits representing the type of the target compression strategy; based on the message data, the message bits, and the message identifier, generating a message to be sent corresponding to the current signal; wherein the message identifier is an identifier determined based on the source end of the current signal.

[0005] In an optional manner, the current signal is a Boolean type signal; determining a target compression strategy for compressing the current signal based on the type of the current signal includes: determining a first type compression strategy corresponding to the Boolean type signal as the target compression strategy; wherein the first type compression strategy is a strategy for merging the Boolean type signals; compressing the current signal according to the target compression strategy to obtain message data corresponding to the current signal includes: merging a preset number of Boolean type signals in the current signal into one byte, and using the merged byte as the message data corresponding to the current signal.

[0006] In an optional manner, the current signal is a signal that shows a continuous change compared with the historical signal; the target compression strategy for compressing the current signal is determined based on the type of the current signal, including: determining the second type compression strategy corresponding to the continuous signal as the target compression strategy; wherein the second type compression strategy is a strategy for compressing the signal difference between the continuously changing signals; compressing the current signal according to the target compression strategy to obtain the message data corresponding to the current signal, including: performing a difference operation between the current signal and the historical signal, and using the obtained signal difference as the message data corresponding to the current signal.

[0007] In an optional manner, the generation method also includes: determining the priority of the message to be sent corresponding to the current signal based on the current update frequency and the historical update frequency of the current signal; determining the sending order of the message to be sent corresponding to the current signal based on the priority and message data length of the message to be sent corresponding to the current signal and other messages to be sent.

[0008] In an optional manner, the historical update frequency includes a maximum historical update frequency and a minimum historical update frequency; determining the priority of the message to be sent corresponding to the current signal based on the current update frequency and the historical update frequency of the current signal includes: dividing the difference between the maximum historical update frequency and the current update frequency of the current signal by the difference between the maximum historical update frequency and the minimum historical update frequency to calculate a quotient value; matching the quotient value with a preset quotient value, and using the preset priority corresponding to the successfully matched preset quotient value as the priority of the message to be sent corresponding to the current signal.

[0009] In an optional manner, the method of generating a message to be sent corresponding to the current signal based on the message data, the message bits, and the message identifier includes: splicing the message data, the message bits, and the message identifier based on a preset order to obtain an initial message; adding a verification data field to the end of the initial message to generate a message to be sent corresponding to the current signal; wherein the verification data field is used to verify the correctness of the message.

[0010] In an optional manner, the generation method also includes: if the bus load of the sent message is less than a preset threshold, and the length of the message to be sent corresponding to the current signal is greater than the preset length, then the message to be sent corresponding to the current signal is split into multiple sub-messages for sending; if the bus load of the sent message is greater than or equal to the preset threshold, and the current signal is a designated signal, then the sending order of the message to be sent corresponding to the current signal is adjusted to a front position for sending.

[0011] According to another aspect of the present application, a device for generating a message to be sent is provided, and the generating device includes: a determination module, which is used to determine a target compression strategy for compressing the current signal according to the type of the current signal; a compression module, which is used to compress the current signal according to the target compression strategy, obtain message data corresponding to the current signal, and generate message bits representing the type of the target compression strategy; a generation module, which is used to generate a message to be sent corresponding to the current signal based on the message data, the message bits, and the message identifier; wherein the message identifier is an identifier determined according to the source end of the current signal.

[0012] According to one aspect of the present application, an electronic device is provided, comprising: a controller; and a memory for storing one or more programs, wherein when the one or more programs are executed by the controller, the above-mentioned generation method is executed.

[0013] According to one aspect of the present application, a computer-readable storage medium is further provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer executes the above-mentioned generation method.

[0014] According to one aspect of the present application, a computer program product or computer program is also provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the above-described generation method.

[0015] This application selects an adaptive target compression strategy to perform signal compression based on the type of the current signal, obtains the corresponding message data, and significantly shortens the data domain length of the message data, thereby shortening the total length of the message to be sent. Because the data domain lengths of the message data compressed according to different compression strategies are different, the total lengths of the messages to be sent corresponding to different types of signals are also different, thereby being able to flexibly adjust the total length of the messages to be sent, thereby improving the flexibility of signal communication. At the same time, message bits representing the type of target compression strategy are generated, which facilitates the rapid identification of the target compression strategy adopted by the message data, so as to quickly determine the corresponding decompression strategy and decompress the message to be sent.

[0016] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and it is clear that a person of ordinary skill in the art can derive other drawings based on these drawings without inventive effort.

[0018] Figure 1 It is a flowchart of a method for generating a message to be sent, shown as an exemplary embodiment of the present application.

[0019] Figure 2 It is a schematic diagram of the message structure of a message to be sent shown in an exemplary embodiment of the present application.

[0020] Figure 3 is based on Figure 1 The exemplary embodiment shown is a flow chart of another method for generating a message to be sent.

[0021] Figure 4 is based on Figure 1 The exemplary embodiment shown is a flow chart of another method for generating a message to be sent.

[0022] Figure 5 is based on Figure 1 The exemplary embodiment shown is a flow chart of another method for generating a message to be sent.

[0023] Figure 6 is based on Figure 1 、 Figures 3 to 5 A flowchart of another method for generating a message to be sent is shown in any of the exemplary embodiments shown in FIG.

[0024] Figure 7 It is a schematic diagram of the application scenario of the method for generating the message to be sent in this application.

[0025] Figure 8 It is a structural diagram of a device for generating a message to be sent, shown as an exemplary embodiment of the present application.

[0026] Figure 9 It is a structural diagram of a computer system of an electronic device shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0027] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. When the following description refers to the drawings, identical numerals in different figures represent identical or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0028] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0029] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be combined or partially combined. Therefore, the actual execution order may vary depending on the actual situation.

[0030] In this application, "plurality" refers to two or more. "And / or" describes the relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.

[0031] The relevant technology cannot flexibly adjust the messages corresponding to different types of signals, resulting in relatively mechanical signal communication.

[0032] Message encoding for simple types of signals only requires a shorter data field. If the data field length of the message generated using a fixed frame format is fixed, other data fields need to be filled, resulting in data redundancy and wasted bandwidth.

[0033] The message obtained by encoding a complex signal has a large amount of substantial data in its payload. If a transmission interruption occurs during the transmission of the message, the substantial data in the message will be lost.

[0034] To this end, one aspect of the present application provides a method for generating a message to be sent, which dynamically selects a target compression strategy suitable for the current signal and generates a corresponding message to be sent, thereby improving the flexibility of signal communication. Figure 1 , Figure 1This is a flow chart of a method for generating a message to be sent, as shown in an exemplary embodiment of the present application. The generation method includes at least S110 to S130, which are described in detail as follows:

[0035] S110: Determine a target compression strategy for compressing the current signal according to the type of the current signal.

[0036] The current signal carries substantial information represented by the signal, and the substantial information includes but is not limited to the represented object, object state, etc. For example, the current signal represents the open or closed state of a vehicle window.

[0037] Signals are divided into different types based on their own properties. Each type of signal has a corresponding preset decompression strategy, and different types of signals have different preset decompression strategies. Among them, types include but are not limited to point types and line types. Point types are types that represent that there is no correlation between similar signals. Point type signals can independently represent their own signal information, such as independent signals that only represent yes or no. Line types are types that represent that there is a correlation between similar signals, such as the existence of timing correlation, etc. Line type signals can not only independently represent their own signal information, but also there is a correlation between the signal information they represent, such as vehicle speed signals, battery power signals, etc.

[0038] The target compression strategy is determined from a plurality of preset compression strategies and corresponds to the type of the current signal. This embodiment flexibly determines an adaptive target compression strategy based on the type of the current signal, making the selection of the target compression strategy for the current signal more targeted.

[0039] The preset compression method corresponding to the point type signal may be a byte merging method: merging multiple bytes into one byte, and adjacent data fields in the message data may also be compressed to reduce the size of the message data.

[0040] The preset compression method corresponding to the line type signal can be a signal difference compression method: adjacent signals are subtracted and the difference is compressed into message data; wherein the difference is significantly reduced compared to the original signal value, reducing the repeated sending of overlapping information between signals to improve message transmission efficiency.

[0041] S120: Compress the current signal according to the target compression strategy, obtain message data corresponding to the current signal, and generate message bits representing the type of the target compression strategy.

[0042] This embodiment compresses the information represented by the current signal according to the target compression strategy, and uses the compressed data as the message data corresponding to the current signal. Compression includes, but is not limited to, operations such as merging, filtering, and cropping to reduce the size and quantity of the compressed data to be smaller than the original data.

[0043] According to the type of the current signal, an adaptive target compression strategy is selected to perform signal compression to obtain the corresponding message data, which greatly shortens the data field length of the message data and thus shortens the total length of the message to be sent.

[0044] The message bit is a data field within a message that specifies the target compression strategy. It is associated with the current signal type. A message bit can be one or more bits in a message. The message bit parameter can be used to quickly determine the target compression strategy used for a compressed message. For example, a message bit is a one-bit field within a message, with "0" representing no compression, "1" representing the default compression strategy for point-type signals, and "2" representing the default compression strategy for line-type signals.

[0045] This embodiment can quickly identify the target compression strategy used by the message data through the message bits, so as to quickly determine the corresponding decompression strategy and decompress the corresponding message. Among them, decompression represents the use of the inverse operation opposite to compression to quickly restore the original signal.

[0046] S130: Generate a to-be-sent message corresponding to the current signal based on the message data, message bits, and message identifier; wherein the message identifier is an identifier determined according to the source end of the current signal.

[0047] The source includes the source domain of the current signal and the components within that source domain. Each source domain corresponds to a corresponding preset domain identifier, and each component corresponds to a corresponding preset component identifier. For example, if the source of the current signal is the second electronic unit in the control domain, its corresponding message identifier is 001X002; where 001X is the preset domain identifier corresponding to the control domain, and 002 is the preset component identifier corresponding to the second electronic unit.

[0048] In one exemplary embodiment, the message data, message bits, and message identifier are directly concatenated in a preset order to generate a message to be sent corresponding to the current signal. The preset order represents the order in which the various data fields in the message are arranged. Each data field has a different length and represents a different meaning. For example, the message identifier, message bits, and message data are sequentially concatenated to generate a message to be sent corresponding to the current signal.

[0049] In another exemplary embodiment, in order to improve the security of the message, a verification data field is introduced when generating the corresponding message to be sent, which is used to verify the message to be sent to determine whether the message to be sent has been tampered with, thereby reducing the bit error rate. The details are as follows:

[0050] The message data, message bits, and message identifier are concatenated based on a preset order to obtain an initial message; a check data field is added to the end of the initial message to generate a message to be sent corresponding to the current signal; wherein the check data field is used to verify the correctness of the message.

[0051] The preset order is as follows Figure 2 As shown, they are message identifiers ( Figure 2 ID in), message bits ( Figure 2 C-Flag in), message data ( Figure 2 Data in the field, the length of which can be 1 to 64 bits), check code data field ( Figure 2 The message to be sent corresponding to the current signal generated by this embodiment includes a check data field, which can significantly reduce the bit error rate. In some embodiments, it can also be based on the message identifier ( Figure 2 The ID in the message and the preset check function are used to calculate a check value of a bit. The parity of the check value is used to determine whether the starting bit of the data field of the message is incorrect, so as to realize the double check of the head and tail, that is, the check is performed based on the message identifier and the check data field at the same time.

[0052] This application selects an adaptive target compression strategy to perform signal compression based on the type of the current signal, obtains the corresponding message data, and significantly shortens the data domain length of the message data, thereby shortening the total length of the message to be sent. Because the data domain lengths of the message data compressed according to different compression strategies are different, the total lengths of the messages to be sent corresponding to different types of signals are also different, thereby being able to flexibly adjust the total length of the messages to be sent, thereby improving the flexibility of signal communication. At the same time, message bits representing the type of target compression strategy are generated, which facilitates the rapid identification of the target compression strategy adopted by the message data, so as to quickly determine the corresponding decompression strategy and decompress the message to be sent.

[0053] The message compression methods involved in the related technologies are relatively fixed, and a single compression method is used to mechanically compress all signals, which makes it impossible to select a personalized compression method.

[0054] To this end, in another exemplary embodiment of the present application, a compression method for a type signal is provided, and the compression method for a Boolean type signal is described in detail. For details, please refer to Figure 3 , Figure 3 is based on Figure 1 The exemplary embodiment shown is a flow chart of another method for generating a message to be sent. Figure 1 The S110 shown includes S310, and the S120 includes S320; wherein the current signal is a Boolean type signal, which is described in detail as follows:

[0055] S310: Determine a first type compression strategy corresponding to the Boolean type signal as a target compression strategy; wherein the first type compression strategy is a strategy for merging Boolean type signals.

[0056] Boolean signals are similar to the point signals mentioned above: a single signal can represent a single meaning, and each signal is a single byte. For example, "0" and "1" represent "off" and "on," respectively. Depending on the position of the signal, different components can be represented as on or off. For example, "010" represents the lights off, the doors open, and the windows closed.

[0057] The first type of compression strategy is a strategy for merging signals, that is, by merging the signal values of bits at corresponding positions into one signal value, thereby slimming down the current signal and using the merged data as message data.

[0058] S320: Merge a preset number of Boolean type signals in the current signal into one byte, and use the merged byte as message data corresponding to the current signal.

[0059] For example, 8 Boolean type signals (each signal is 1 byte) are merged into 1 byte, and all the bytes obtained by the merger are converted into corresponding bits as the message data corresponding to the current signal, thereby greatly reducing the length of the message data corresponding to the current signal and reducing the total length of the data field of the message to be sent.

[0060] This embodiment provides a merged compression strategy to perform data compression on Boolean type signals. By merging signal bytes, multiple byte data are merged into one byte data, thereby slimming down the current signal. The length of the compressed message data is shorter than the original data length, significantly reducing the total length of the data field of the generated message to be sent.

[0061] In another exemplary embodiment of the present application, another type of signal compression method is provided, and the compression method of the continuous signal is described in detail. For details, please refer to Figure 4 , Figure 4 is based on Figure 1 The exemplary embodiment shown is a flow chart of another method for generating a message to be sent. Figure 1 S110 shown includes S410, and S120 includes S420. The current signal is a signal that continuously changes with the historical signal, as described in detail below:

[0062] S410: Determine a second type compression strategy corresponding to the continuous signal as a target compression strategy; wherein the second type compression strategy is a strategy for compressing signal differences between continuously changing signals.

[0063] Continuous signals are similar to the aforementioned line-type signals. They exhibit correlation and overlapping information, and multiple continuous signals can represent changes in the state of a specified component. For example, a vehicle speed signal not only independently represents the vehicle speed at that moment, but also exhibits continuity between adjacent speed signals at the timing level. For such continuous signals, the difference between the signals is used as message data. The message receiver can quickly determine the complete current signal represented by the message being sent based on the difference between the historical signal value at the previous moment and the signal represented by the currently received message.

[0064] S420: Perform a difference operation on the current signal and the historical signal, and use the obtained signal difference as the message data corresponding to the current signal.

[0065] Here, the signals can be directly subtracted, or the signals can be digitized and unified, and then the subtraction can be performed on the corresponding signal values.

[0066] For example, according to the following difference code, the speed signal (continuous signal) difference is calculated to use the signal difference as the message data corresponding to the current speed signal: int16_t speed_diff = current_speed - previous_speed; wherein, current_speed represents the current speed signal value represented by the current speed signal, and previous_speed represents the historical speed signal value represented by the historical speed signal, which can be understood as the speed signal value at the previous moment compared to the current moment.

[0067] This embodiment provides a signal difference compression strategy to perform data compression on continuous signals. Instead of directly using the signal itself as message data, the signal difference between adjacent signals is calculated and used as message data to reduce the data domain length of the message data. The length of the compressed message data is shorter than the original data length, significantly reducing the total length of the data domain of the generated message to be sent.

[0068] In another exemplary embodiment of the present application, how to determine the order in which the messages to be sent are sent is described in detail. Figure 5 , Figure 5 is based on Figure 1 The exemplary embodiment shown is a flow chart of another method for generating a message to be sent. Figure 1 Based on the S110 to S130 shown, at least S510 to S520 are also included, which are detailed as follows:

[0069] S510: Determine the priority of the to-be-sent message corresponding to the current signal according to the current update frequency and the historical update frequency of the current signal.

[0070] The current update frequency is the update frequency of the current signal at the current moment, while the historical update frequency is the update frequency of historical signals with the same representation as the current signal at previous moments. The term "historical moment" can refer to multiple historical moments or to historical moments adjacent to the current moment, and can be adjusted adaptively based on different implementation scenarios.

[0071] The priority of a message is one of the factors that affect the order in which messages are sent. The priority is directly related to the update frequency of the signal. This embodiment introduces the historical update frequency while considering the current update frequency to avoid distortion of the calculated priority due to sudden changes in the current update frequency. By introducing the historical update frequency to correct the calculation process, the calculated priority is more accurate.

[0072] Exemplarily, the historical update frequency includes a maximum historical update frequency and a minimum historical update frequency, and the calculation process is as follows:

[0073] The quotient is calculated by dividing the difference between the maximum historical update frequency and the current update frequency of the current signal by the difference between the maximum historical update frequency and the minimum historical update frequency. The formula is as follows: Priority = [(f max -f) / (f max -f min )×1024]; wherein Priority represents a quotient value, which can be understood as a corrected current update frequency. In some embodiments, the corrected current update frequency can be stored in the source end of the current signal, that is, in the RAM (random access memory) of the corresponding electronic unit in the corresponding domain, so as to calibrate and update the priority of the corresponding signal of the corresponding component in real time; f max Indicates the maximum historical update frequency among the historical update frequencies; f indicates the current update frequency; f min Indicates the minimum historical update frequency among the historical update frequencies.

[0074] The quotient value is matched with a preset quotient value, and the preset priority corresponding to the successfully matched preset quotient value is used as the priority of the message to be sent corresponding to the current signal. For example, the quotient value is matched with the preset quotient value in Table 1, and the preset priority corresponding to the successfully matched preset quotient value is used as the priority of the message to be sent corresponding to the current signal.

[0075] Table 1: Example relationship table between preset quotient values and preset priorities

[0076] Preset quotient value Preset priority …… …… 100 First priority 200 Second priority …… ……

[0077] S520: Determine the order of sending the messages to be sent corresponding to the current signal according to the messages to be sent corresponding to the current signal and other messages to be sent, their respective corresponding priorities, and the length of the message data.

[0078] The length of the message data is also one of the factors that affect the order in which the messages are sent. For example, it takes a long time to send a long message. When the bus load for sending the message is too large, the sending order of the long message can be appropriately postponed.

[0079] The sending order of any message to be sent is not absolute. It is necessary to consider the impact of other messages to be sent at the same time. It is also necessary to introduce the priority corresponding to other messages to be sent and the length of the message data to adjust the sending order. Only in this way can the sending order of the messages to be sent corresponding to the current signal in the current scenario be accurately determined.

[0080] The related technology directly sends the message to be sent after generating it. If multiple messages to be sent are sent at the same time, communication congestion will occur, resulting in failure to send the corresponding messages to be sent.

[0081] To this end, in another exemplary embodiment of the present application, the order in which each message to be sent is sent, that is, the method of sending the message to be sent is adjusted, and different sending methods of the message to be sent are described in detail. For details, please refer to Figure 6 , Figure 6 is based on Figure 1 、 Figures 3 to 5 A flow chart of another method for generating a message to be sent is shown in any of the exemplary embodiments shown in FIG. Figure 1 Based on the S110 to S130 shown, at least S610 to S620 are also included, which are detailed as follows:

[0082] S610: If the bus load of the message to be sent is less than a preset threshold, and the length of the message to be sent corresponding to the current signal is greater than a preset length, the message to be sent corresponding to the current signal is split into multiple sub-messages for sending.

[0083] The preset threshold is the critical value for measuring whether the bus load for sending messages is overloaded. If the bus load for sending messages is less than the preset threshold, it indicates that the current bus load is small and the data loss rate is small. Splitting long-to-be-sent messages into multiple sub-messages for sending makes sub-messages less likely to be lost, and at the same time improves the sending efficiency of the messages to be sent.

[0084] S620: If the bus load of the message being sent is greater than or equal to the preset threshold, and the current signal is a designated signal, the sending order of the message to be sent corresponding to the current signal is adjusted to a front position for sending.

[0085] If the bus load for sending messages is greater than or equal to a preset threshold, the bus load is high. Further message splitting will increase the number of messages, further exacerbating the bus load. In this case, priority is given to sending designated signals with a high safety impact, such as brake signals, to ensure the communication of vehicle safety signals. Designated signals are signals with a preset impact on vehicle safety.

[0086] S610 and S620 are illustrated as follows: If the bus load for sending messages is less than 70% (a preset threshold), and the length of the message to be sent is 64 bytes, which is greater than 48 bytes (a preset length), the message to be sent is split into 8 frames, each of which occupies 8 bytes. A 2-bit sequence number is added before each frame to facilitate subsequent message splicing. This message splitting and sending method reduces the transmission time of the original message to be sent from 10ms to 7ms. If the bus load for sending messages is greater than or equal to 70%, priority is given to sending designated signals with a high safety impact, such as brake signals, to ensure the communication of vehicle safety signals.

[0087] This embodiment introduces the bus load condition of sending messages to adaptively adjust the sending order of messages to be sent to provide sending methods under different load conditions: when the load is not overloaded, the message sending efficiency is optimized; when the load is overloaded, the communication of vehicle safety signals is prioritized.

[0088] In another exemplary embodiment of the present application, the application scenarios of the above-mentioned multiple generation methods are exemplarily described. For details, please refer to Figure 7 , Figure 7 Schematic diagram of an application scenario of the method for generating a message to be sent in the present application, wherein the signal source end 100 and the server 200 are connected via wireless communication, and the present application does not limit the connection method between them.

[0089] The signal source end 100 represents the corresponding components in each domain of the vehicle end, such as electronic units, etc. The signal source end 100 sends the collected source signal to the server 200, so that the server 200 generates a corresponding message to be sent based on the source signal.

[0090] The server 200 can be used as the execution subject of the generation method shown in any of the above exemplary embodiments to execute any of the above generation methods. Figure 7 The example shown includes: a compression module and a scheduling module. The generation method is described below in conjunction with the modules in the server 200.

[0091] The compression module determines a target compression strategy for compressing the current signal based on the type of the current signal; the compression module compresses the current signal based on the target compression strategy, obtains the message data corresponding to the current signal, and generates message bits that represent the type of the target compression strategy; the compression module generates a message to be sent corresponding to the current signal based on the message data, message bits, and message identifier; wherein the message identifier is an identifier determined based on the source end of the current signal.

[0092] The scheduling module determines the priority of the message to be sent corresponding to the current signal based on the current and historical update frequencies of the current signal. It also determines the order in which the messages corresponding to the current signal should be sent based on the priorities and lengths of the messages corresponding to the current signal and other messages to be sent. Furthermore, the scheduling module dynamically updates the priority of the source corresponding to the current signal, that is, dynamically updates the mapping between the message identifier and priority of the current signal.

[0093] The scheduling module can also obtain the bus load of the sending message in real time through the bus controller, and adjust the sending order and sending method of the corresponding messages to be sent based on the real-time bus load. For example, if the bus load of the sending message is less than a preset threshold, and the length of the message to be sent corresponding to the current signal is greater than the preset length, the message to be sent corresponding to the current signal will be split into multiple sub-messages for transmission. If the bus load of the sending message is greater than or equal to the preset threshold, and the current signal is a designated signal, the sending order of the message to be sent corresponding to the current signal will be adjusted to a front position for transmission.

[0094] The bus controller can perform corresponding checks on the message to be sent, for example, based on the message identifier in the message to be sent (such as Figure 2 ID in) and check code data field (such as Figure 2 The bus controller can also optimize transmission timing by inserting high-priority frames into idle bus slots during message transmission to reduce latency. For example, it can configure bit timing parameters (such as propagation segment Tprop = 2TQ and phase buffer segment Tbs1 = 3TQ) to optimize signal synchronization.

[0095] The bus controller can also control the sending of messages. For example, the bus controller can compare two messages to be sent, and determine one of the messages to be sent based on the priority corresponding to the message identifier, the message data length, etc. (for example: give priority to sending the message to be sent with a higher priority. If the priorities are the same, give priority to sending the message to be sent with a shorter message data length to reduce the bus occupancy time of sending the message), and compare the remaining messages to be sent with other messages to be sent again, and so on. If the remaining messages to be sent have not been sent for more than 3 times, stop sending them and no longer use them as comparison objects to avoid bus congestion for sending messages.

[0096] Server 200 can be an independent physical server or a server cluster or distributed system composed of multiple physical servers, where multiple servers can form a blockchain, and the server is a node on the blockchain. Server 200 can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, and this is not restricted here.

[0097] Another aspect of the present application also provides a device for generating a message to be sent, such as Figure 8 As shown, Figure 8 It is a structural diagram of a device for generating a message to be sent, shown as an exemplary embodiment of the present application.

[0098] The generating device 800 includes:

[0099] The determination module 810 is configured to determine a target compression strategy for compressing the current signal according to the type of the current signal.

[0100] The compression module 830 is configured to compress the current signal according to the target compression strategy, obtain message data corresponding to the current signal, and generate message bits representing the type of the target compression strategy.

[0101] The generating module 850 is used to generate a to-be-sent message corresponding to the current signal based on the message data, message bits, and message identifier; wherein the message identifier is an identifier determined according to the source end of the current signal.

[0102] In another exemplary embodiment, the current signal is a Boolean type signal; the determination module 810 includes: a first type compression strategy determination unit, used to determine the first type compression strategy corresponding to the Boolean type signal as the target compression strategy; wherein the first type compression strategy is a strategy that characterizes merging Boolean type signals.

[0103] The compression module 830 includes: a merging unit, configured to merge a preset number of Boolean type signals in the current signal into one byte, and use the merged byte as message data corresponding to the current signal.

[0104] In another exemplary embodiment, the current signal is a signal that shows continuous changes compared with the historical signal; the determination module 810 includes: determining the second type of compression strategy corresponding to the continuous signal as the target compression strategy; wherein the second type of compression strategy is a strategy that characterizes compressing the signal difference between continuously changing signals.

[0105] The compression module 830 includes: performing a difference operation between the current signal and the historical signal, and using the obtained signal difference as the message data corresponding to the current signal.

[0106] In another exemplary embodiment, the generating device 800 further includes:

[0107] The priority determination module is used to determine the priority of the message to be sent corresponding to the current signal according to the current update frequency and the historical update frequency of the current signal.

[0108] The sending order determination module is used to determine the sending order of the messages to be sent corresponding to the current signal according to the priorities and message data lengths of the messages to be sent corresponding to the current signal and other messages to be sent.

[0109] In another exemplary embodiment, the historical update frequency includes a maximum historical update frequency and a minimum historical update frequency; and the priority determination module includes:

[0110] The calculation unit is configured to divide the difference between the maximum historical update frequency and the current update frequency of the current signal by the difference between the maximum historical update frequency and the minimum historical update frequency to calculate a quotient.

[0111] The matching unit is used to match the quotient value with a preset quotient value, and use the preset priority corresponding to the successfully matched preset quotient value as the priority of the message to be sent corresponding to the current signal.

[0112] In another exemplary embodiment, the generating module 850 includes:

[0113] The splicing unit is used to splice the message data, message bits and message identifiers based on a preset order to obtain an initial message.

[0114] The generation unit is used to add a verification data field to the end of the initial message to generate a message to be sent corresponding to the current signal; wherein the verification data field is used to verify the correctness of the message.

[0115] In another exemplary embodiment, the generating device 800 further includes:

[0116] The first sending module is used to split the message to be sent corresponding to the current signal into multiple sub-messages for sending if the bus load of the sent message is less than a preset threshold and the length of the message to be sent corresponding to the current signal is greater than a preset length.

[0117] The second sending module is used to adjust the sending order of the to-be-sent message corresponding to the current signal to a front position for sending if the bus load of the sent message is greater than or equal to a preset threshold and the current signal is a designated signal.

[0118] The generating device of the present application selects an adaptive target compression strategy to perform signal compression based on the type of the current signal, obtains the corresponding message data, and significantly shortens the data domain length of the message data, thereby shortening the total length of the message to be sent. Because the data domain length of the message data compressed according to different compression strategies is different, the total length of the message to be sent corresponding to different types of signals is also different, so that the total length of the message to be sent can be flexibly adjusted, thereby improving the flexibility of signal communication. At the same time, a message bit characterizing the type of target compression strategy is generated, which facilitates the rapid identification of the target compression strategy adopted by the message data, so as to quickly determine the corresponding decompression strategy and decompress the message to be sent.

[0119] It should be noted that the generation device provided in the above embodiment and the generation method provided in the above embodiment belong to the same concept, and the specific manner in which each module and unit performs operations has been described in detail in the method embodiment and will not be repeated here.

[0120] Another aspect of the present application provides an electronic device, comprising: a controller; and a memory for storing one or more programs, which, when executed by the controller, executes the above-mentioned generation method.

[0121] See also Figure 9 , Figure 9 1 is a schematic diagram of the structure of a computer system of an electronic device shown in an exemplary embodiment of the present application, which shows a schematic diagram of the structure of a computer system of an electronic device suitable for implementing an embodiment of the present application.

[0122] It should be noted that Figure 9 The computer system 900 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0123] like Figure 9As shown, the computer system 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 902 or the program loaded from the storage part 908 into the random access memory (RAM) 903, such as executing the method in the above embodiment. Various programs and data required for system operation are also stored in the RAM 903. The CPU 901, ROM 902 and RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0124] The following components are connected to the I / O interface 905: an input section 906 including a keyboard, a mouse, and the like; an output section 907 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 908 including a hard disk and the like; and a communication section 909 including a network interface card such as a LAN (Local Area Network) card or a modem. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. Removable media 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, and the like, are installed in the drive 910 as needed, so that computer programs read therefrom can be installed into the storage section 908 as needed.

[0125] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 909, and / or installed from a removable medium 911. When the computer program is executed by the central processing unit (CPU) 901, the various functions defined in the system of the present application are executed.

[0126] It should be noted that the computer-readable medium shown in the embodiments of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), 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 above. In the present application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable computer program. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. A computer program embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, or any suitable combination thereof.

[0127] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. Among them, each box in the flowchart or block diagram can represent a module, program segment, or part of the code, and the above-mentioned module, program segment, or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0128] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. In some cases, the names of these units do not constitute limitations on the units themselves.

[0129] Another aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the aforementioned generation method. The computer-readable storage medium may be included in the electronic device described in the above embodiments, or may exist independently without being incorporated into the electronic device.

[0130] Another aspect of the present application provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the generation method provided in each of the above embodiments.

[0131] According to one aspect of an embodiment of the present application, a computer system is further provided, including a central processing unit (CPU), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage portion into a random access memory (RAM), such as executing the method in the above embodiment. Various programs and data required for system operation are also stored in the RAM. The CPU, ROM, and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.

[0132] The following components are connected to the I / O interface: an input section including a keyboard, mouse, etc.; an output section including a cathode ray tube (CRT), liquid crystal display (LCD), and speakers; a storage section including a hard disk; and a communication section including a network interface card such as a LAN (Local Area Network) card and a modem. The communication section performs communication processing via a network such as the Internet. A drive is also connected to the I / O interface as needed. Removable media such as magnetic disks, optical disks, magneto-optical disks, semiconductor memories, etc. are installed in the drive as needed so that computer programs read from them can be installed into the storage section as needed.

[0133] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. Ordinary technicians in this field can easily make corresponding changes or modifications based on the main ideas and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.

Claims

1. A method for generating a message to be sent, characterized in that: The generation method comprises: Determine a target compression strategy for compressing the current signal according to the type of the current signal; Compressing the current signal according to the target compression strategy to obtain message data corresponding to the current signal, and generating message bits representing the type of the target compression strategy; Based on the message data, the message bits, and the message identifier, a message to be sent corresponding to the current signal is generated; wherein the message identifier is an identifier determined according to the source end of the current signal.

2. The generation method according to claim 1, characterized in that: The current signal is a Boolean type signal; The step of determining a target compression strategy for compressing the current signal according to the type of the current signal includes: Determining a first type of compression strategy corresponding to the Boolean type signal as a target compression strategy; wherein the first type of compression strategy is a strategy for merging the Boolean type signal; The compressing the current signal according to the target compression strategy to obtain message data corresponding to the current signal includes: Combine a preset number of Boolean type signals in the current signal into one byte, and use the combined byte as the message data corresponding to the current signal.

3. The generation method according to claim 1, characterized in that: The current signal is a signal that changes continuously with the historical signal; The step of determining a target compression strategy for compressing the current signal according to the type of the current signal includes: Determining a second type of compression strategy corresponding to the continuous signal as a target compression strategy; wherein the second type of compression strategy is a strategy for compressing the signal difference between the continuously changing signals; The compressing the current signal according to the target compression strategy to obtain message data corresponding to the current signal includes: Perform a difference operation on the current signal and the historical signal, and use the obtained signal difference as the message data corresponding to the current signal.

4. The generation method according to claim 1, characterized in that: The generating method further comprises: Determine the priority of the message to be sent corresponding to the current signal based on the current update frequency and the historical update frequency of the current signal; According to the to-be-sent message corresponding to the current signal and other to-be-sent messages, their respective corresponding priorities, and the length of message data, the sending order of the to-be-sent message corresponding to the current signal is determined.

5. The generation method according to claim 4, characterized in that: The historical update frequency includes a maximum historical update frequency and a minimum historical update frequency; and determining the priority of the message to be sent corresponding to the current signal based on the current update frequency and the historical update frequency of the current signal includes: Dividing the difference between the maximum historical update frequency and the current update frequency of the current signal by the difference between the maximum historical update frequency and the minimum historical update frequency to calculate a quotient; The quotient value is matched with a preset quotient value, and the preset priority corresponding to the successfully matched preset quotient value is used as the priority of the message to be sent corresponding to the current signal.

6. The generation method according to any one of claims 1 to 5, characterized in that: The generating a message to be sent corresponding to the current signal based on the message data, the message bit, and the message identifier includes: splicing the message data, the message bits, and the message identifier based on a preset order to obtain an initial message; A verification data field is added to the end of the initial message to generate a message to be sent corresponding to the current signal; wherein the verification data field is used to verify the correctness of the message.

7. The generation method according to any one of claims 1 to 5, characterized in that: The generating method further comprises: If the bus load of the message being sent is less than a preset threshold, and the length of the message to be sent corresponding to the current signal is greater than a preset length, the message to be sent corresponding to the current signal is split into multiple sub-messages for sending; If the bus load of the sent message is greater than or equal to the preset threshold, and the current signal is a designated signal, the sending order of the to-be-sent message corresponding to the current signal is adjusted to a front position for sending.

8. A device for generating a message to be sent, characterized in that: The generating device comprises: A determination module, configured to determine a target compression strategy for compressing the current signal according to the type of the current signal; a compression module, configured to compress the current signal according to the target compression strategy, obtain message data corresponding to the current signal, and generate message bits representing the type of the target compression strategy; A generation module is used to generate a message to be sent corresponding to the current signal based on the message data, the message bits, and the message identifier; wherein the message identifier is an identifier determined according to the source end of the current signal.

9. An electronic device, characterized in that: include: Controller; A memory for storing one or more programs, which, when executed by a controller, enables the controller to implement the generation method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the generation method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Time series data storage method and device, time series data query method and device, equipment and storage medium

    CN111552687A

  • Compression preprocessing encoder for astronomical catalogue and application

    CN116405037A

  • Power data transmission system, method, device and equipment and storage medium

    CN117411875A

  • Data stream compression method and system and storage medium

    CN117879617A

  • Data communication method and system

    JP2004341884A