CN-116800695-B - Signal packaging method, device, computer equipment and storage medium
Abstract
The invention relates to the technical field of vehicle communication and discloses a signal packaging method, a device, computer equipment and a storage medium, wherein the method provided by the invention comprises the steps of obtaining a signal to be packaged and attribute information of the signal to be packaged; the method comprises the steps of grouping signals to be packaged based on attribute information, determining a signal group to be packaged and the priority of the signal group to be packaged, inquiring in a created PDU based on the size of the signal group to be packaged, determining a target PDU corresponding to the signal group to be packaged, and packaging the signals to be packaged in the signal group to be packaged into the target PDU based on a priority configuration file and the priority of the signal group to be packaged, so as to obtain a packaging result, wherein the priority configuration file is used for representing the corresponding relation between the priority and a packaging strategy. According to the method, the packing sequence and focus are flexibly configured according to the strategy requirements of different signal packing, so that the cost problem caused by the change of the priority in the signal packing process is reduced, and the relevant basis is increased for the modification of the signal packing priority strategy.
Inventors
- CHEN YONGHENG
- LI DECAI
- CHEN YIRAN
Assignees
- 北京经纬恒润科技股份有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20230721
Claims (10)
- 1. A method of signal packaging, the method comprising: acquiring a signal to be packaged and attribute information of the signal to be packaged; grouping the signals to be packaged based on the attribute information, and determining a signal group to be packaged and the priority of the signal group to be packaged; acquiring the residual size of the created PDU, inquiring in the created PDU based on the size of the signal group to be packaged, and determining a target PDU corresponding to the signal group to be packaged, wherein the target PDU is the created PDU with the residual size larger than the size of the signal group to be packaged; And based on a priority configuration file and the priority of the signal group to be packaged, packaging the signals to be packaged in the signal group to be packaged into the target PDU to obtain a packaging result, wherein the priority configuration file is used for representing the corresponding relation between the priority and the packaging strategy.
- 2. The method of claim 1, wherein obtaining attribute information of the signal to be packetized comprises: the method comprises the steps of obtaining a signal demand table and a signal forwarding demand table, wherein the signal demand table is used for representing first attribute information of signals to be packaged, and the signal forwarding demand table is used for representing second attribute information of signals to be packaged with a routing relationship, the first attribute information comprises a sending period, a sent signal group and a sending node, and the second attribute information comprises a routing type, a sending network segment and a target network segment; analyzing the signal demand table and the signal forwarding demand table to obtain first attribute information and second attribute information of the signal to be packaged, wherein the attribute information of the signal to be packaged comprises the first attribute information and the second attribute information.
- 3. The method of claim 2, wherein the grouping the signals to be packaged based on the attribute information, determining a group of signals to be packaged and a priority of the group of signals to be packaged, comprises: Grouping the signals to be packaged based on the first attribute information to obtain an initial packaging signal group; Grouping and adjusting signals to be packaged in the initial packaging signal group based on the second attribute information to obtain the signal group to be packaged; and determining the priority of the signal group to be packaged by utilizing the corresponding relation between the priority and the attribute information.
- 4. The method of claim 1, wherein the determining the target PDU corresponding to the signal group to be packetized based on the querying in the created PDU of the size of the signal group to be packetized comprises: The method comprises the steps of obtaining the sizes of all signals to be packaged in the signal group to be packaged, and summing the sizes of all signals to be packaged in the signal group to be packaged to obtain the required size of the signal group to be packaged; and determining the target PDU based on the required size of the signal group to be packaged and the residual size of the created PDU.
- 5. The method of claim 1, wherein the encapsulating signals to be encapsulated within the signal group to be encapsulated into the target PDU based on the priority profile and the priority of the signal group to be encapsulated, to obtain an encapsulated result, comprises: determining a target packaging strategy of the signal group to be packaged based on the priority configuration file and the priority of the signal group to be packaged; Packaging the signals to be packaged in the signal group to be packaged based on the target packaging strategy to obtain packaging signals; and if the size of the packaging signal is smaller than the residual size of the target PDU, adding the packaging signal into the target PDU to obtain the packaging result.
- 6. The method of claim 5, wherein the encapsulating signals to be encapsulated within the signal group to be encapsulated into the target PDU based on the priority profile and the priority of the signal group to be encapsulated, further comprises: If the size of the packing signal is larger than the residual size of the target PDU, creating a new PDU and adding the packing signal into the new PDU to obtain the packing result.
- 7. The method according to any one of claims 1 to 6, wherein the packaging the signals to be packaged in the signal group to be packaged into the target PDU based on the priority profile and the priority of the signal group to be packaged, further comprises: Acquiring signals to be packaged with a routing relationship in the signal group to be packaged; If the signal to be packaged with the routing relation changes after the signal to be packaged is packaged, sending out a packaging judgment prompt to determine whether the signal to be packaged is required to be packaged currently.
- 8. A signal packaging apparatus, the apparatus comprising: the acquisition module is used for acquiring the signal to be packaged and attribute information of the signal to be packaged; the grouping module is used for grouping the signals to be packaged based on the attribute information and determining a signal group to be packaged and the priority of the signal group to be packaged; The inquiring module is used for acquiring the residual size of the created PDU, inquiring in the created PDU based on the size of the signal group to be packaged, and determining a target PDU corresponding to the signal group to be packaged, wherein the target PDU is the created PDU with the residual size being larger than the size of the signal group to be packaged; And the packaging module is used for packaging the signals to be packaged in the signal group to be packaged into the target PDU based on the priority configuration file and the priority of the signal group to be packaged so as to obtain a packaging result, wherein the priority configuration file is used for representing the corresponding relation between the priority and the packaging strategy.
- 9. A computer device, comprising: A memory and a processor, the memory and the processor being communicatively coupled to each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the signal packaging method of any of claims 1 to 7.
- 10. A computer-readable storage medium having stored thereon computer instructions for causing a computer to perform the signal packaging method of any one of claims 1 to 7.
Description
Signal packaging method, device, computer equipment and storage medium Technical Field The present invention relates to the field of vehicle communications, and in particular, to a signal packaging method, apparatus, computer device, and storage medium. Background In the design phase of the automobile CAN and CAN-FD bus network, the signal packaging problem of PDU (Protocol Data Unit ) often occurs, namely, different types of message data are abstracted into data packets with uniform ID and name, and are distributed in proper PDU. Aiming at the signal packaging problem in the design process, an automation scheme exists to a certain extent at present, and the signal CAN be packaged into corresponding PDU (protocol data unit) by a sender ECU (Electronic Control Unit, an electronic control unit) and a receiver ECU simply according to the length of the signal, so that the CAN/CAN-FD bus controller CAN conveniently transmit the signal. But still handled in a manual packing manner in face of the complex signal packing requirements. Disclosure of Invention In view of the above, the present invention provides a signal packaging method, apparatus, computer device and storage medium, so as to solve the problem of PDU signal packaging. In a first aspect, the present invention provides a signal packaging method, the method comprising: acquiring a signal to be packaged and attribute information of the signal to be packaged; grouping the signals to be packaged based on the attribute information, and determining a signal group to be packaged and the priority of the signal group to be packaged; inquiring in the created PDU based on the size of the signal group to be packaged, and determining a target PDU corresponding to the signal group to be packaged; And based on a priority configuration file and the priority of the signal group to be packaged, packaging the signals to be packaged in the signal group to be packaged into the target PDU to obtain a packaging result, wherein the priority configuration file is used for representing the corresponding relation between the priority and the packaging strategy. According to the signal packaging method provided by the embodiment of the invention, the signals to be packaged are grouped based on the attribute information of the signals to be packaged, unified packaging management of the signals to be packaged of the same or similar types is realized, the processing process of signal packaging is simplified, the target PDU capable of accommodating the signal group to be packaged is obtained by inquiring in the created PDU based on the size of the signal group to be packaged, the accuracy of the obtained target PDU is ensured, the packaging of the signals to be packaged is carried out based on the priority configuration file, when the packaging strategy is adjusted, only the priority configuration file is needed to be adjusted, the adjustment of the whole packaging process is avoided, the packaging sequence and focus are flexibly configured according to the strategy requirements of different signal packaging, the cost problem caused by the change of the priority in the signal packaging process is reduced, and the relevant basis is increased for the modification of the signal packaging priority strategy. In some optional embodiments, acquiring attribute information of the signal to be packaged includes: Acquiring a signal demand table and a signal forwarding demand table, wherein the signal demand table is used for representing first attribute information of the signals to be packaged, and the signal forwarding demand table is used for representing second attribute information of the signals to be packaged with a routing relationship; analyzing the signal demand table and the signal forwarding demand table to obtain first attribute information and second attribute information of the signal to be packaged, wherein the attribute information of the signal to be packaged comprises the first attribute information and the second attribute information. According to the signal packaging method provided by the embodiment of the invention, as some signals to be packaged have a routing relationship, and some signals do not have a routing relationship, the first attribute information and the second attribute information of the signals to be packaged are respectively represented by the signal demand table and the signal forwarding demand table, so that unified management of different types of attribute information is realized. In some optional embodiments, the grouping the signals to be packaged based on the attribute information, determining a signal group to be packaged and a priority of the signal group to be packaged, includes: Grouping the signals to be packaged based on the first attribute information to obtain an initial packaging signal group; Grouping and adjusting signals to be packaged in the initial packaging signal group based on the second attribute information to obtain the signal g