CN116723064A - CAN message transmission optimization method, device, equipment and storage medium - Google Patents
CAN message transmission optimization method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN116723064A CN116723064A CN202310863601.4A CN202310863601A CN116723064A CN 116723064 A CN116723064 A CN 116723064A CN 202310863601 A CN202310863601 A CN 202310863601A CN 116723064 A CN116723064 A CN 116723064A
- Authority
- CN
- China
- Prior art keywords
- optimized
- transmission
- message
- preset
- data message
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 230000005540 biological transmission Effects 0.000 title claims abstract description 446
- 238000005457 optimization Methods 0.000 title claims abstract description 130
- 238000000034 method Methods 0.000 title claims abstract description 38
- 238000004088 simulation Methods 0.000 claims description 69
- 238000004590 computer program Methods 0.000 claims description 14
- 230000006870 function Effects 0.000 description 8
- 230000004044 response Effects 0.000 description 5
- 230000008569 process Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 230000003993 interaction Effects 0.000 description 3
- 230000001066 destructive effect Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 101100172132 Mus musculus Eif3a gene Proteins 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000737 periodic effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/40143—Bus networks involving priority mechanisms
- H04L12/40163—Bus networks involving priority mechanisms by assigning priority to messages according to a message field
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/40143—Bus networks involving priority mechanisms
- H04L12/40156—Bus networks involving priority mechanisms by using dedicated slots associated with a priority level
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L2012/40208—Bus networks characterized by the use of a particular bus standard
- H04L2012/40215—Controller Area Network CAN
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The invention discloses a transmission optimization method, a device, equipment and a storage medium of CAN messages, wherein the method comprises the following steps: acquiring a receiving time point of each message in a preset optimizing time period, and acquiring a bus idle time slot sequence according to the length of the message; determining the actual transmission period between the data messages with the same ID identification, and determining a plurality of data message sets to be optimized, of which the transmission period deviation ratio is larger than the deviation ratio threshold value, according to the preset transmission period and the number of the data messages; according to the idle time slot sequence of the bus, the ID identification of the data message to be optimized in each data message set to be optimized and a preset transmission period, carrying out transmission optimization on each data message set to be optimized according to a preset optimization strategy; when any optimized transmission sequence corresponding to the data message set to be optimized exists, sending an adjustment message to a corresponding source node so that the source node executes the optimized transmission sequence. The invention obviously reduces the transmission period deviation of the message in the CAN bus network.
Description
Technical Field
The present invention relates to the field of CAN bus communications technologies, and in particular, to a method and apparatus for optimizing transmission of a CAN packet, a terminal device, and a computer readable storage medium.
Background
At present, the CAN bus is more and more widely applied, particularly in the automobile industry, has the advantages of low cost, high reliability, good instantaneity, strong anti-interference capability and the like, and CAN meet the communication requirements of most modules in the automobile. The CAN bus employs a non-destructive bus arbitration technique such as a communication mode of "carrier sense with collision avoidance, CSMA/CA (Carrier Sense Multiple Access with Collision Avoid, carrier sense multiple access)". If 2 or more nodes require to transmit data at the same time, bus conflicts CAN be generated, the CAN bus CAN detect the conflicts in real time and arbitrate the conflicts, so that the data with high priority CAN be transmitted without any damage, and the data with low priority CAN be arbitrated, and the bus is waited for idle retransmission.
In order to ensure data instantaneity, the prior art generally adopts a non-destructive bus arbitration technology of a CAN bus to arbitrate bus conflicts generated in a message transmission process, however, the arbitration mechanism easily causes overlarge continuous deviation of a transmission period of an arbitrated message in a CAN bus network, so that information interaction between controllers is unstable, and further, the problem of function response delay or deviation occurs.
Disclosure of Invention
The invention provides a transmission optimization method, a device, equipment and a storage medium for CAN messages, which CAN perform transmission optimization on the messages with overlarge transmission period deviation based on bus idle time slots on a current bus, and send adjustment messages to corresponding source nodes according to transmission sequences obtained by optimization, so that the source nodes execute the transmission sequences obtained by optimization, and the transmission period deviation of the messages in a CAN bus network is obviously reduced.
In order to solve the above technical problems, a first aspect of the present invention provides a transmission optimization method for a CAN packet, including the following steps:
acquiring a receiving time point of each message in a preset optimizing time period on a current bus, and acquiring a bus idle time slot sequence according to the receiving time point of each message and the preset message length;
determining an actual transmission period among the data messages with the same ID (identity) according to the receiving time points of the messages, and determining a plurality of data message sets to be optimized, of which the transmission period deviation ratio is greater than a preset deviation ratio threshold value according to the actual transmission period among the data messages, a preset transmission period and the number of the data messages;
According to the current bus idle time slot sequence, the ID identification of the data message to be optimized in each data message set to be optimized and the preset transmission period, sequentially carrying out transmission optimization on each data message set to be optimized according to a preset optimization strategy;
when an optimized transmission sequence with the transmission period deviation ratio corresponding to any one data message set to be optimized being smaller than the preset deviation ratio threshold exists, sending an adjustment message to a source node corresponding to any one data message set to be optimized according to the optimized transmission sequence, so that the source node executes the optimized transmission sequence.
As a preferred solution, according to the current bus idle time slot sequence, the ID identifier of the data packet to be optimized in each data packet set to be optimized, and the preset transmission period, the transmission optimization is sequentially performed on each data packet set to be optimized according to a preset optimization policy, which specifically includes the following steps S31 to S34:
step S31, determining the optimization priority of each data message set to be optimized according to the ID identification of the data message to be optimized in each data message set to be optimized;
Step S32, carrying out message transmission simulation in the current bus idle time slot sequence according to the preset transmission period of each data message to be optimized in the data message set to be optimized with the highest optimization priority;
step S33, if there is an analog transmission sequence with the transmission cycle deviation ratio smaller than the preset deviation ratio threshold, determining that the analog transmission sequence is an optimized transmission sequence corresponding to the data message set to be optimized with the highest current optimization priority, deleting the data message set to be optimized with the highest current optimization priority from the current data message sets to be optimized, and re-executing step S32;
step S34, if no simulation transmission sequence with the transmission period deviation ratio smaller than the preset deviation ratio threshold exists, carrying out message transmission simulation in the current bus idle time slot sequence according to the sequence of the optimization priority and the preset transmission period of each data message to be optimized in the rest data message sets to be optimized; when an optimized transmission sequence with the transmission period deviation ratio corresponding to any one of the rest data message sets to be optimized smaller than the preset deviation ratio threshold value is obtained, deleting the any one of the rest data message sets to be optimized from the current plurality of data message sets to be optimized, and re-executing the step S32;
The simulation transmission sequence comprises a plurality of simulation messages, wherein the number and the message length of the simulation messages are respectively the same as the number and the preset message length of data messages to be optimized in a data message set to be optimized corresponding to the simulation transmission sequence;
the rest data message sets to be optimized are any data message set to be optimized except the data message set to be optimized with the highest optimization priority currently.
As a preferred solution, the method specifically performs the message transmission simulation in the current bus idle time slot sequence according to the preset transmission period of each data message to be optimized in the current data message set to be optimized/the rest data message sets to be optimized with the highest optimization priority:
taking an initial time point of a first section of bus idle time slot in a current bus idle time slot sequence as a current simulation starting point, and carrying out message transmission simulation from the current simulation starting point by using the preset transmission period of each data message to be optimized in the current data message set to be optimized/the rest data message sets to be optimized with the highest optimization priority to obtain a current simulation transmission sequence;
When the transmission period deviation ratio of the current analog transmission sequence is smaller than the preset deviation ratio threshold, updating the current bus idle time slot sequence according to the receiving time point and the message length of each analog message in the current analog transmission sequence;
when the transmission period deviation ratio of the current analog transmission sequence is greater than the preset deviation ratio threshold, carrying out delay processing on the current analog starting point according to the transmission time length of the analog message in the current analog transmission sequence and carrying out message transmission simulation again until the interval between the current analog starting point and the initial time point is equal to the preset transmission period, and judging that no analog transmission sequence with the transmission period deviation ratio corresponding to the data message set to be optimized/the rest data message sets to be optimized with the highest current optimization priority is smaller than the preset deviation ratio threshold exists;
the sending time of the simulation message is obtained by calculating according to the message length of the simulation message and a preset message transmission rate.
As a preferred solution, the determining, according to the actual transmission period, the preset transmission period and the number of the data messages between the data messages, a plurality of data message sets to be optimized, where a transmission period deviation ratio is greater than a preset deviation ratio threshold, specifically includes the following steps:
According to the actual transmission period and the preset transmission period between the data messages, obtaining a transmission period deviation value corresponding to the actual transmission period between the data messages;
determining the transmission cycle deviation times of each data message corresponding to each ID mark in the preset optimization time period according to the comparison result of the transmission cycle deviation value and a preset deviation threshold value;
and according to the transmission cycle deviation times and the number of the data messages, obtaining the transmission cycle deviation proportion of each data message corresponding to each ID mark in the preset optimization time period, and generating the data message set to be optimized according to each data message of which the transmission cycle deviation proportion is larger than the preset deviation proportion threshold value.
Preferably, the determining the actual transmission period between the data messages with the same ID identifier according to the receiving time point of each message specifically includes the following steps:
and calculating a receiving time difference value between any two continuously received data messages with the same ID according to the receiving time point of each message, and taking the receiving time difference value as an actual transmission period between the any two continuously received data messages.
As a preferred solution, the obtaining a bus idle time slot sequence according to the receiving time point of each message and a preset message length specifically includes the following steps:
obtaining the sending duration of each message according to the preset message length and the preset message transmission rate of each message;
according to the receiving time point and the sending time length of each message, calculating a bus idle time slot between any two messages continuously received in the preset optimizing time period, and according to a plurality of bus idle time slots in the preset optimizing time period, obtaining the bus idle time slot sequence.
As a preferred solution, the sending, according to the optimized transmission sequence, an adjustment message to a source node corresponding to the any one data packet set to be optimized, so that the source node executes the optimized transmission sequence specifically includes the following steps:
according to the receiving time point of each analog message in the optimized transmission sequence and the preset transmission period among each data message to be optimized in any one data message set to be optimized, a plurality of adjustment messages are sent to a source node corresponding to the any one data message set to be optimized, so that the source node executes the optimized transmission sequence according to the receiving time point of the last adjustment message received;
The adjustment message at least comprises an ID (identity) identification, a maximum transmission period deviation value and a transmission period deviation ratio of the data message to be optimized in any data message set to be optimized.
Preferably, the method further comprises the steps of:
when an optimized transmission sequence with the transmission period deviation ratio corresponding to any one data message set to be optimized smaller than the preset deviation ratio threshold value does not exist, a pre-alarm message is sent to a source node corresponding to any one data message set to be optimized; the early warning message at least comprises an ID (identity) identification, a maximum transmission period deviation value, a transmission period deviation ratio and state information for representing failure of optimization of the data message to be optimized in any data message set to be optimized.
A second aspect of the embodiment of the present invention provides a transmission optimization device for a CAN packet, including:
the bus idle time slot sequence acquisition module is used for acquiring the receiving time point of each message in a preset optimization time period on the current bus and acquiring a bus idle time slot sequence according to the receiving time point of each message and the preset message length;
the data message set to be optimized is used for determining the actual transmission period among the data messages with the same ID mark according to the receiving time point of each message, and determining a plurality of data message sets to be optimized, of which the transmission period deviation ratio is larger than a preset deviation ratio threshold value according to the actual transmission period among the data messages, a preset transmission period and the number of the data messages;
The transmission optimization module is used for sequentially carrying out transmission optimization on each data message set to be optimized according to a preset optimization strategy according to the current bus idle time slot sequence, the ID identification of the data message to be optimized in each data message set to be optimized and the preset transmission period;
and the transmission adjusting module is used for sending an adjusting message to a source node corresponding to any one data message set to be optimized according to the optimized transmission sequence when the transmission period deviation ratio corresponding to any one data message set to be optimized is smaller than the optimized transmission sequence of the preset deviation ratio threshold value, so that the source node executes the optimized transmission sequence.
A third aspect of an embodiment of the present invention provides a terminal device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor implements the method for optimizing transmission of CAN packets according to any one of the first aspects when the processor executes the computer program.
A fourth aspect of the embodiment of the present invention provides a computer readable storage medium, where the computer readable storage medium includes a stored computer program, where when the computer program runs, the device where the computer readable storage medium is controlled to execute the method for optimizing transmission of CAN packets according to any one of the first aspect.
Compared with the prior art, the method and the device have the advantages that the message with overlarge transmission period deviation CAN be transmitted and optimized based on the bus idle time slot on the current bus, and the adjusting message is sent to the corresponding source node according to the transmission sequence obtained by optimization, so that the source node executes the transmission sequence obtained by optimization, the transmission period deviation of the message in the CAN bus network is obviously reduced, the information interaction stability between controllers is further improved, and the problem of function response delay or deviation is effectively solved.
Drawings
Fig. 1 is a flow chart of a transmission optimization method of a CAN message in an embodiment of the present invention;
FIG. 2 is a schematic diagram of CAN message transmission adjustment in an embodiment of the invention;
fig. 3 is a schematic structural diagram of a transmission optimizing device for CAN messages in an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1 to fig. 2, a first aspect of the embodiment of the present invention provides a transmission optimization method for a CAN packet, including steps S1 to S4 as follows:
step S1, obtaining a receiving time point of each message in a preset optimizing time period on a current bus, and obtaining a bus idle time slot sequence according to the receiving time point of each message and the preset message length;
step S2, determining the actual transmission period among the data messages with the same ID according to the receiving time point of each message, and determining a plurality of data message sets to be optimized, of which the transmission period deviation ratio is greater than a preset deviation ratio threshold value according to the actual transmission period among the data messages, a preset transmission period and the number of the data messages;
step S3, according to the current bus idle time slot sequence, the ID identification of the data message to be optimized in each data message set to be optimized and the preset transmission period, carrying out transmission optimization on each data message set to be optimized in turn according to a preset optimization strategy;
and S4, when an optimized transmission sequence with the transmission period deviation ratio corresponding to any one data message set to be optimized being smaller than the preset deviation ratio threshold exists, sending an adjustment message to a source node corresponding to any one data message set to be optimized according to the optimized transmission sequence, so that the source node executes the optimized transmission sequence.
In step S1, when the CAN bus network is running, a receiving time point of each message in a preset optimization time period on the current bus is obtained, specifically, the optimization time period may be set and adjusted according to an optimization requirement, or may be set according to a preset transmission period corresponding to each message, where in an optional embodiment, the optimization time period is preset to be 10 times of a maximum preset transmission period in all the messages on the current bus. Further, the receiving time point of each message is the time point of ACK response, and in this embodiment, the receiving time point of each message is determined by calling the bottom layer software to obtain the time point of ACK response of each frame of message. Then, in order to facilitate the subsequent transmission optimization of the data message with the excessively large transmission period deviation, the embodiment obtains a bus idle time slot sequence in a preset optimization time period according to the receiving time point of each message and the preset message length.
In step S2, in order to determine whether the transmission period deviation of each message is too large in the preset optimization time period, the embodiment determines the actual transmission period between each data message with the same ID identifier according to the receiving time point of each message, based on the preset transmission period, it can determine whether the actual transmission period of each message transmission is too large for the preset transmission period, and then according to the number of data messages with the same ID identifier, it can determine the transmission period deviation ratio of each data message corresponding to each ID identifier in the preset optimization time period, and form each data message greater than the preset deviation ratio threshold into a data message set to be optimized, which is worth noting that the ID identifiers of each data message to be optimized in the data message set to be optimized are the same.
In step S3, since a certain periodic message may cause a transmission period deviation due to a collision with a message required to be transmitted by another node during a period transmission process in the CAN bus network operation process, and there are typically a plurality of bus idle slots without transmission messages in the CAN bus, in order to avoid the occurrence of bus collision as much as possible, and simultaneously reduce the transmission period deviation of each message as much as possible, the present bus idle slot sequence is utilized to perform transmission optimization on each data message to be optimized, and a feasible optimized transmission sequence is searched in the bus idle slot sequence to avoid the bus collision with the rest transmission messages as much as possible, and ensure that the transmission period deviation ratio is smaller than a preset deviation ratio threshold. In addition, under the most ideal condition, each data message can be periodically transmitted according to the corresponding preset transmission period, so that the preset transmission period of the data message to be optimized in each data message set to be optimized is also considered in the transmission optimization process.
In step S4, when there is an optimized transmission sequence with a transmission period deviation ratio corresponding to a certain data packet set to be optimized being smaller than a preset deviation ratio threshold, it indicates that each data packet to be optimized in the data packet set to be optimized is transmitted according to the optimized transmission sequence, so that the transmission period deviation can be significantly reduced.
The transmission optimization method of the CAN message provided by the embodiment of the invention CAN perform transmission optimization on the message with overlarge transmission period deviation based on the bus idle time slot on the current bus, and send the adjustment message to the corresponding source node according to the transmission sequence obtained by optimization, so that the source node executes the transmission sequence obtained by optimization, thereby obviously reducing the transmission period deviation of the message in the CAN bus network, further improving the information interaction stability between controllers and effectively improving the problem of function response delay or deviation.
As a preferred solution, according to the current bus idle time slot sequence, the ID identifier of the data packet to be optimized in each data packet set to be optimized, and the preset transmission period, the transmission optimization is sequentially performed on each data packet set to be optimized according to a preset optimization policy, which specifically includes the following steps S31 to S34:
step S31, determining the optimization priority of each data message set to be optimized according to the ID identification of the data message to be optimized in each data message set to be optimized;
step S32, carrying out message transmission simulation in the current bus idle time slot sequence according to the preset transmission period of each data message to be optimized in the data message set to be optimized with the highest optimization priority;
Step S33, if there is an analog transmission sequence with the transmission cycle deviation ratio smaller than the preset deviation ratio threshold, determining that the analog transmission sequence is an optimized transmission sequence corresponding to the data message set to be optimized with the highest current optimization priority, deleting the data message set to be optimized with the highest current optimization priority from the current data message sets to be optimized, and re-executing step S32;
step S34, if no simulation transmission sequence with the transmission period deviation ratio smaller than the preset deviation ratio threshold exists, carrying out message transmission simulation in the current bus idle time slot sequence according to the sequence of the optimization priority and the preset transmission period of each data message to be optimized in the rest data message sets to be optimized; when an optimized transmission sequence with the transmission period deviation ratio corresponding to any one of the rest data message sets to be optimized smaller than the preset deviation ratio threshold value is obtained, deleting the any one of the rest data message sets to be optimized from the current plurality of data message sets to be optimized, and re-executing the step S32;
the simulation transmission sequence comprises a plurality of simulation messages, wherein the number and the message length of the simulation messages are respectively the same as the number and the preset message length of data messages to be optimized in a data message set to be optimized corresponding to the simulation transmission sequence;
The rest data message sets to be optimized are any data message set to be optimized except the data message set to be optimized with the highest optimization priority currently.
It should be noted that, in step S31, since the sizes of the ID identifiers of the data messages to be optimized determine the transmission priority of each data message to be optimized, in general, the smaller the ID identifier is, the higher the transmission priority of the corresponding data message to be optimized is, so the embodiment determines the optimization priority of each data message set to be optimized based on the ID identifier of the data message to be optimized in each data message set to be optimized, thereby ensuring that the data message to be optimized with a high transmission priority can be optimized in priority for transmission.
In step S32, with a preset transmission period between each data packet to be optimized in the data packet set to be optimized with the highest current optimization priority, a packet transmission simulation is performed in the current bus idle time slot sequence, so as to obtain a simulated transmission sequence.
In step S33, if there is an analog transmission sequence with a transmission cycle deviation ratio smaller than a preset deviation ratio threshold, it is determined that each data message to be optimized in the data message set to be optimized with the highest current optimization priority is transmitted according to the analog transmission sequence, so that the transmission cycle deviation can be significantly reduced, and therefore the analog transmission sequence is the optimized transmission sequence, and the data message set to be optimized with the highest current optimization priority is deleted from the current plurality of data message sets to be optimized, so as to avoid repeated optimization, and step S32 is re-executed to perform message transmission simulation on the data message set to be optimized with the next optimization priority.
In step S34, if there is no analog transmission sequence with a transmission cycle deviation ratio smaller than a preset deviation ratio threshold, firstly performing message transmission simulation on the rest of the data message sets to be optimized with lower optimization priority in sequence according to the order of optimization priority, when an optimized transmission sequence corresponding to any one of the rest of the data message sets to be optimized is obtained, that is, when optimization is successful, deleting the rest of the data message sets to be optimized which are successful in optimization from the current plurality of data message sets to be optimized, so as to avoid repeated optimization, and then re-executing step S32 to re-perform message transmission simulation on the data message set to be optimized with highest current optimization priority.
As a preferred solution, the method specifically performs the message transmission simulation in the current bus idle time slot sequence according to the preset transmission period of each data message to be optimized in the current data message set to be optimized/the rest data message sets to be optimized with the highest optimization priority:
taking an initial time point of a first section of bus idle time slot in a current bus idle time slot sequence as a current simulation starting point, and carrying out message transmission simulation from the current simulation starting point by using the preset transmission period of each data message to be optimized in the current data message set to be optimized/the rest data message sets to be optimized with the highest optimization priority to obtain a current simulation transmission sequence;
When the transmission period deviation ratio of the current analog transmission sequence is smaller than the preset deviation ratio threshold, updating the current bus idle time slot sequence according to the receiving time point and the message length of each analog message in the current analog transmission sequence;
when the transmission period deviation ratio of the current analog transmission sequence is greater than the preset deviation ratio threshold, carrying out delay processing on the current analog starting point according to the transmission time length of the analog message in the current analog transmission sequence and carrying out message transmission simulation again until the interval between the current analog starting point and the initial time point is equal to the preset transmission period, and judging that no analog transmission sequence with the transmission period deviation ratio corresponding to the data message set to be optimized/the rest data message sets to be optimized with the highest current optimization priority is smaller than the preset deviation ratio threshold exists;
the sending time of the simulation message is obtained by calculating according to the message length of the simulation message and a preset message transmission rate.
It should be noted that, in this embodiment, the message transmission simulation is performed from the initial time point of the first bus idle time slot in the current bus idle time slot sequence, when the transmission period deviation ratio of the currently obtained simulation transmission sequence is smaller than the preset deviation ratio threshold, it indicates that the simulation transmission sequence is the optimized transmission sequence, and the simulation transmission sequence occupies a part of the bus idle time slots in the current bus idle time slot sequence, so that the current bus idle time slot sequence needs to be updated, specifically:
Dividing the current bus idle time slot sequence into 3 parts, wherein the parts are respectively as follows: a first time period from an initial time point of a first bus idle time slot to a receiving time point of a first analog message in the analog transmission sequence, a second time period from the receiving time point of the first analog message to the receiving time point of a last analog message in the analog transmission sequence, and a third time period from the receiving time point of the last analog message in the analog transmission sequence to an ending time point of the last bus idle time slot.
For the first time period, the bus idle time slot in the first time period can be determined directly according to the difference between the initial time point of the bus idle time slot of the first time period and the receiving time point of the first analog message.
For the second time period, according to the message length of each analog message and the preset message transmission rate, the sending duration of each analog message can be obtained, then according to the receiving time point and the sending duration of each analog message, the bus idle time slot between any two continuous analog messages is calculated, for example, if a message A and a message B transmitted after the message A exist, the bus idle time slot between the message A and the message B is the difference between the receiving time point of the message B and the receiving time point of the message A, then the sending duration of the message A is subtracted, and finally a plurality of bus idle time slots in the second time period are determined.
And for the third time period, directly subtracting the receiving time point of the last analog message from the ending time point of the idle time slot of the last bus in the third time period, and subtracting the sending time of the last analog message from the difference result to determine the idle time slot of the bus in the third time period.
And determining an updated bus idle time slot sequence according to the bus idle time slots in the first time period, the plurality of bus idle time slots in the second time period and the bus idle time slots in the third time period.
It should be noted that, when a bus collision condition is encountered in the process of message transmission simulation, that is, the end time point of the current section of bus idle time slot is reached, the next section of bus idle time slot is followed to continue message transmission simulation.
In addition, when calculating the sending duration of the analog message, the preset message transmission rate is specifically a rate of sending 1 byte, and the message length of the analog message is a preset message length corresponding to the data message to be optimized, such as 64 bytes, 128 bytes, and the like, so that the sending duration of the analog message can be obtained by directly multiplying the message length of the analog message with the preset message transmission rate.
As a preferred solution, the determining, according to the actual transmission period, the preset transmission period and the number of the data messages between the data messages, a plurality of data message sets to be optimized, where a transmission period deviation ratio is greater than a preset deviation ratio threshold, specifically includes the following steps:
According to the actual transmission period and the preset transmission period between the data messages, obtaining a transmission period deviation value corresponding to the actual transmission period between the data messages;
determining the transmission cycle deviation times of each data message corresponding to each ID mark in the preset optimization time period according to the comparison result of the transmission cycle deviation value and a preset deviation threshold value;
and according to the transmission cycle deviation times and the number of the data messages, obtaining the transmission cycle deviation proportion of each data message corresponding to each ID mark in the preset optimization time period, and generating the data message set to be optimized according to each data message of which the transmission cycle deviation proportion is larger than the preset deviation proportion threshold value.
Specifically, according to the actual transmission period and the preset transmission period between the data messages, the embodiment obtains the transmission period deviation value corresponding to the actual transmission period between the data messages by the following expression:
transmission period deviation value= |actual transmission period-preset transmission period|/preset transmission period
Further, according to a plurality of actual transmission periods of which the transmission period deviation value is larger than a preset deviation threshold value, the transmission period deviation times of each data message corresponding to each ID mark in a preset optimization time period are determined.
Further, according to the number of transmission cycle deviation times and the number of data messages, the embodiment specifically obtains the transmission cycle deviation ratio of each data message corresponding to each ID identifier in a preset optimization time period through the following expression:
transmission cycle deviation ratio = number of transmission cycle deviations/(number of data messages-1)
Preferably, the determining the actual transmission period between the data messages with the same ID identifier according to the receiving time point of each message specifically includes the following steps:
and calculating a receiving time difference value between any two continuously received data messages with the same ID according to the receiving time point of each message, and taking the receiving time difference value as an actual transmission period between the any two continuously received data messages.
Specifically, for any two continuously received data messages, the actual transmission period between the two continuously received data messages can be obtained by making a difference between the receiving time point of the later received data message and the receiving time point of the earlier received data message.
As a preferred solution, the obtaining a bus idle time slot sequence according to the receiving time point of each message and a preset message length specifically includes the following steps:
Obtaining the sending duration of each message according to the preset message length and the preset message transmission rate of each message;
according to the receiving time point and the sending time length of each message, calculating a bus idle time slot between any two messages continuously received in the preset optimizing time period, and according to a plurality of bus idle time slots in the preset optimizing time period, obtaining the bus idle time slot sequence.
Specifically, the same way as the calculation of the sending duration of the analog message is adopted, and in this embodiment, the sending duration of each message can be obtained by directly multiplying the preset message length of each message by the preset message transmission rate.
Further, for any two messages received continuously, firstly, the receiving time point of the message received later is differenced from the receiving time point of the message received earlier, and then the sending time of the message received earlier is subtracted by utilizing the differenced result, so that the bus idle time slot between the two messages received continuously can be obtained.
As a preferred solution, the sending, according to the optimized transmission sequence, an adjustment message to a source node corresponding to the any one data packet set to be optimized, so that the source node executes the optimized transmission sequence specifically includes the following steps:
According to the receiving time point of each analog message in the optimized transmission sequence and the preset transmission period among each data message to be optimized in any one data message set to be optimized, a plurality of adjustment messages are sent to a source node corresponding to the any one data message set to be optimized, so that the source node executes the optimized transmission sequence according to the receiving time point of the last adjustment message received;
the adjustment message at least comprises an ID (identity) identification, a maximum transmission period deviation value and a transmission period deviation ratio of the data message to be optimized in any data message set to be optimized.
Specifically, as shown in fig. 2, as a message transmission adjustment schematic diagram, based on the receiving time points of each analog message in the optimized transmission sequence, the triggering time points of the adjustment messages can be determined, based on the preset transmission period between each data message to be optimized in the data message set to be optimized, the sending period of the adjustment messages can be determined, and the embodiment sends a plurality of adjustment messages to the corresponding source node based on the determined triggering time points and the preset transmission period, which is worth noting that the sending number of the adjustment messages is not specifically limited in the embodiment, and can be 1, 2, 3 or more than 3, preferably, the embodiment sends 3 adjustment messages to the source node, so as to ensure that the source node can have enough time to receive and prepare for message transmission adjustment at any time after the processing is completed.
In this embodiment, by sending a plurality of adjustment messages to the source node, the source node can execute the optimized transmission sequence according to the received time point of the last adjustment message, for example, execute the optimized transmission sequence after receiving the last adjustment message at intervals of a preset transmission period, or execute the optimized transmission sequence when reaching the 2 nd preset transmission period after receiving only 1 or 2 adjustment messages and not receiving the adjustment message more than 1.5 preset transmission periods.
Preferably, the method further comprises the steps of:
when an optimized transmission sequence with the transmission period deviation ratio corresponding to any one data message set to be optimized smaller than the preset deviation ratio threshold value does not exist, a pre-alarm message is sent to a source node corresponding to any one data message set to be optimized; the early warning message at least comprises an ID (identity) identification, a maximum transmission period deviation value, a transmission period deviation ratio and state information for representing failure of optimization of the data message to be optimized in any data message set to be optimized.
Referring to fig. 3, a second aspect of the embodiment of the present invention provides a transmission optimization apparatus for a CAN packet, including:
The bus idle time slot sequence obtaining module 301 is configured to obtain a receiving time point of each message in a preset optimized time period on a current bus, and obtain a bus idle time slot sequence according to the receiving time point of each message and a preset message length;
the data message set to be optimized acquisition module 302 is configured to determine an actual transmission period between data messages with the same ID identifier according to the receiving time point of each message, and determine a plurality of data message sets to be optimized, where a transmission period deviation ratio is greater than a preset deviation ratio threshold, according to the actual transmission period between each data message, a preset transmission period, and the number of data messages;
the transmission optimization module 303 is configured to perform transmission optimization on each set of data packets to be optimized according to a preset optimization policy according to a current bus idle time slot sequence, an ID identifier of each data packet to be optimized in each set of data packets to be optimized, and the preset transmission period;
and the transmission adjustment module 304 is configured to send an adjustment message to a source node corresponding to any one data message set to be optimized according to the optimized transmission sequence when there is an optimized transmission sequence with a transmission period deviation ratio corresponding to any one data message set to be optimized being smaller than the preset deviation ratio threshold, so that the source node executes the optimized transmission sequence.
As a preferred solution, the transmission optimization module 303 is configured to perform transmission optimization on each set of data messages to be optimized according to a preset optimization policy according to a current bus idle time slot sequence, an ID identifier of each data message to be optimized in each set of data messages to be optimized, and the preset transmission period, and specifically includes executing the following steps S31 to S34:
step S31, determining the optimization priority of each data message set to be optimized according to the ID identification of the data message to be optimized in each data message set to be optimized;
step S32, carrying out message transmission simulation in the current bus idle time slot sequence according to the preset transmission period of each data message to be optimized in the data message set to be optimized with the highest optimization priority;
step S33, if there is an analog transmission sequence with the transmission cycle deviation ratio smaller than the preset deviation ratio threshold, determining that the analog transmission sequence is an optimized transmission sequence corresponding to the data message set to be optimized with the highest current optimization priority, deleting the data message set to be optimized with the highest current optimization priority from the current data message sets to be optimized, and re-executing step S32;
Step S34, if no simulation transmission sequence with the transmission period deviation ratio smaller than the preset deviation ratio threshold exists, carrying out message transmission simulation in the current bus idle time slot sequence according to the sequence of the optimization priority and the preset transmission period of each data message to be optimized in the rest data message sets to be optimized; when an optimized transmission sequence with the transmission period deviation ratio corresponding to any one of the rest data message sets to be optimized smaller than the preset deviation ratio threshold value is obtained, deleting the any one of the rest data message sets to be optimized from the current plurality of data message sets to be optimized, and re-executing the step S32;
the simulation transmission sequence comprises a plurality of simulation messages, wherein the number and the message length of the simulation messages are respectively the same as the number and the preset message length of data messages to be optimized in a data message set to be optimized corresponding to the simulation transmission sequence;
the rest data message sets to be optimized are any data message set to be optimized except the data message set to be optimized with the highest optimization priority currently.
Preferably, the transmission optimizing module 303 is further configured to:
Taking an initial time point of a first section of bus idle time slot in a current bus idle time slot sequence as a current simulation starting point, and carrying out message transmission simulation from the current simulation starting point by using the preset transmission period of each data message to be optimized in the current data message set to be optimized/the rest data message sets to be optimized with the highest optimization priority to obtain a current simulation transmission sequence;
when the transmission period deviation ratio of the current analog transmission sequence is smaller than the preset deviation ratio threshold, updating the current bus idle time slot sequence according to the receiving time point and the message length of each analog message in the current analog transmission sequence;
when the transmission period deviation ratio of the current analog transmission sequence is greater than the preset deviation ratio threshold, carrying out delay processing on the current analog starting point according to the transmission time length of the analog message in the current analog transmission sequence and carrying out message transmission simulation again until the interval between the current analog starting point and the initial time point is equal to the preset transmission period, and judging that no analog transmission sequence with the transmission period deviation ratio corresponding to the data message set to be optimized/the rest data message sets to be optimized with the highest current optimization priority is smaller than the preset deviation ratio threshold exists;
The sending time of the simulation message is obtained by calculating according to the message length of the simulation message and a preset message transmission rate.
As a preferred solution, the to-be-optimized data message set obtaining module 302 is configured to determine, according to the actual transmission period, the preset transmission period, and the number of the data messages between the data messages, a plurality of to-be-optimized data message sets with a transmission period deviation ratio greater than a preset deviation ratio threshold, where the to-be-optimized data message set includes:
according to the actual transmission period and the preset transmission period between the data messages, obtaining a transmission period deviation value corresponding to the actual transmission period between the data messages;
determining the transmission cycle deviation times of each data message corresponding to each ID mark in the preset optimization time period according to the comparison result of the transmission cycle deviation value and a preset deviation threshold value;
and according to the transmission cycle deviation times and the number of the data messages, obtaining the transmission cycle deviation proportion of each data message corresponding to each ID mark in the preset optimization time period, and generating the data message set to be optimized according to each data message of which the transmission cycle deviation proportion is larger than the preset deviation proportion threshold value.
As a preferred solution, the to-be-optimized data packet set obtaining module 302 is configured to determine, according to the receiving time point of each packet, an actual transmission period between each data packet having the same ID identifier, and specifically includes:
and calculating a receiving time difference value between any two continuously received data messages with the same ID according to the receiving time point of each message, and taking the receiving time difference value as an actual transmission period between the any two continuously received data messages.
As a preferred solution, the bus idle time slot sequence obtaining module 301 is configured to obtain a bus idle time slot sequence according to the receiving time point of each message and a preset message length, and specifically includes:
obtaining the sending duration of each message according to the preset message length and the preset message transmission rate of each message;
according to the receiving time point and the sending time length of each message, calculating a bus idle time slot between any two messages continuously received in the preset optimizing time period, and according to a plurality of bus idle time slots in the preset optimizing time period, obtaining the bus idle time slot sequence.
As a preferred solution, the transmission adjustment module 304 is configured to send an adjustment message to a source node corresponding to the any one data message set to be optimized according to the optimized transmission sequence, so that the source node executes the optimized transmission sequence, and specifically includes:
according to the receiving time point of each analog message in the optimized transmission sequence and the preset transmission period among each data message to be optimized in any one data message set to be optimized, a plurality of adjustment messages are sent to a source node corresponding to the any one data message set to be optimized, so that the source node executes the optimized transmission sequence according to the receiving time point of the last adjustment message received;
the adjustment message at least comprises an ID (identity) identification, a maximum transmission period deviation value and a transmission period deviation ratio of the data message to be optimized in any data message set to be optimized.
Preferably, the transmission adjustment module 304 is further configured to:
when an optimized transmission sequence with the transmission period deviation ratio corresponding to any one data message set to be optimized smaller than the preset deviation ratio threshold value does not exist, a pre-alarm message is sent to a source node corresponding to any one data message set to be optimized; the early warning message at least comprises an ID (identity) identification, a maximum transmission period deviation value, a transmission period deviation ratio and state information for representing failure of optimization of the data message to be optimized in any data message set to be optimized.
It should be noted that, the transmission optimization device for the CAN packet provided by the embodiment of the present invention CAN implement all the processes of the transmission optimization method for the CAN packet described in any one of the embodiments, and the functions and the implemented technical effects of each module in the device are respectively the same as those of the transmission optimization method for the CAN packet described in the embodiment, and are not described herein again.
A third aspect of the embodiment of the present invention provides a terminal device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor implements the method for optimizing transmission of CAN packets according to any embodiment of the first aspect when the processor executes the computer program.
The terminal equipment can be computing equipment such as a desktop computer, a notebook computer, a palm computer, a cloud server and the like. The terminal device may include, but is not limited to, a processor, a memory. The terminal device may also include input and output devices, network access devices, buses, and the like.
The processor may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Prog rammable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like, which is a control center of the terminal device, and which connects various parts of the entire terminal device using various interfaces and lines.
The memory may be used to store the computer program and/or module, and the processor may implement various functions of the terminal device by running or executing the computer program and/or module stored in the memory and invoking data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data (such as audio data, phonebook, etc.) created according to the use of the handset, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, smart Media Card (SMC), secure Digital (SD) Card, flash Card (Flash Card), at least one disk storage device, flash memory device, or other volatile solid-state storage device.
A fourth aspect of the embodiments of the present invention provides a computer readable storage medium, where the computer readable storage medium includes a stored computer program, where when the computer program runs, the device where the computer readable storage medium is controlled to execute the method for optimizing transmission of CAN packets according to any one of the embodiments of the first aspect.
From the above description of the embodiments, it will be clear to those skilled in the art that the present invention may be implemented by means of software plus necessary hardware platforms, but may of course also be implemented entirely in hardware. With such understanding, all or part of the technical solution of the present invention contributing to the background art may be embodied in the form of a software product, which may be stored in a storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the method described in the embodiments or some parts of the embodiments of the present invention.
While the foregoing is directed to the preferred embodiments of the present invention, it will be appreciated by those skilled in the art that changes and modifications may be made without departing from the principles of the invention, such changes and modifications are also intended to be within the scope of the invention.
Claims (11)
1. The transmission optimization method of the CAN message is characterized by comprising the following steps of:
acquiring a receiving time point of each message in a preset optimizing time period on a current bus, and acquiring a bus idle time slot sequence according to the receiving time point of each message and the preset message length;
Determining an actual transmission period among the data messages with the same ID (identity) according to the receiving time points of the messages, and determining a plurality of data message sets to be optimized, of which the transmission period deviation ratio is greater than a preset deviation ratio threshold value according to the actual transmission period among the data messages, a preset transmission period and the number of the data messages;
according to the current bus idle time slot sequence, the ID identification of the data message to be optimized in each data message set to be optimized and the preset transmission period, sequentially carrying out transmission optimization on each data message set to be optimized according to a preset optimization strategy;
when an optimized transmission sequence with the transmission period deviation ratio corresponding to any one data message set to be optimized being smaller than the preset deviation ratio threshold exists, sending an adjustment message to a source node corresponding to any one data message set to be optimized according to the optimized transmission sequence, so that the source node executes the optimized transmission sequence.
2. The transmission optimization method of CAN messages according to claim 1, wherein the transmission optimization is sequentially performed on each set of data messages to be optimized according to a preset optimization strategy according to a current bus idle time slot sequence, an ID identifier of each data message to be optimized in each set of data messages to be optimized, and the preset transmission period, and specifically comprises the following steps S31 to S34:
Step S31, determining the optimization priority of each data message set to be optimized according to the ID identification of the data message to be optimized in each data message set to be optimized;
step S32, carrying out message transmission simulation in the current bus idle time slot sequence according to the preset transmission period of each data message to be optimized in the data message set to be optimized with the highest optimization priority;
step S33, if there is an analog transmission sequence with the transmission cycle deviation ratio smaller than the preset deviation ratio threshold, determining that the analog transmission sequence is an optimized transmission sequence corresponding to the data message set to be optimized with the highest current optimization priority, deleting the data message set to be optimized with the highest current optimization priority from the current data message sets to be optimized, and re-executing step S32;
step S34, if no simulation transmission sequence with the transmission period deviation ratio smaller than the preset deviation ratio threshold exists, carrying out message transmission simulation in the current bus idle time slot sequence according to the sequence of the optimization priority and the preset transmission period of each data message to be optimized in the rest data message sets to be optimized; when an optimized transmission sequence with the transmission period deviation ratio corresponding to any one of the rest data message sets to be optimized smaller than the preset deviation ratio threshold value is obtained, deleting the any one of the rest data message sets to be optimized from the current plurality of data message sets to be optimized, and re-executing the step S32;
The simulation transmission sequence comprises a plurality of simulation messages, wherein the number and the message length of the simulation messages are respectively the same as the number and the preset message length of data messages to be optimized in a data message set to be optimized corresponding to the simulation transmission sequence;
the rest data message sets to be optimized are any data message set to be optimized except the data message set to be optimized with the highest optimization priority currently.
3. The transmission optimization method of CAN messages according to claim 2, wherein the method specifically performs the message transmission simulation in the current bus idle time slot sequence according to the preset transmission period of each data message to be optimized in the current data message set to be optimized/the rest data message sets to be optimized with the highest optimization priority:
taking an initial time point of a first section of bus idle time slot in a current bus idle time slot sequence as a current simulation starting point, and carrying out message transmission simulation from the current simulation starting point by using the preset transmission period of each data message to be optimized in the current data message set to be optimized/the rest data message sets to be optimized with the highest optimization priority to obtain a current simulation transmission sequence;
When the transmission period deviation ratio of the current analog transmission sequence is smaller than the preset deviation ratio threshold, updating the current bus idle time slot sequence according to the receiving time point and the message length of each analog message in the current analog transmission sequence;
when the transmission period deviation ratio of the current analog transmission sequence is greater than the preset deviation ratio threshold, carrying out delay processing on the current analog starting point according to the transmission time length of the analog message in the current analog transmission sequence and carrying out message transmission simulation again until the interval between the current analog starting point and the initial time point is equal to the preset transmission period, and judging that no analog transmission sequence with the transmission period deviation ratio corresponding to the data message set to be optimized/the rest data message sets to be optimized with the highest current optimization priority is smaller than the preset deviation ratio threshold exists;
the sending time of the simulation message is obtained by calculating according to the message length of the simulation message and a preset message transmission rate.
4. The transmission optimization method of CAN messages according to claim 1, wherein the determining a plurality of data message sets to be optimized with a transmission period deviation ratio greater than a preset deviation ratio threshold according to the actual transmission period, a preset transmission period and the number of the data messages between the data messages specifically comprises the following steps:
According to the actual transmission period and the preset transmission period between the data messages, obtaining a transmission period deviation value corresponding to the actual transmission period between the data messages;
determining the transmission cycle deviation times of each data message corresponding to each ID mark in the preset optimization time period according to the comparison result of the transmission cycle deviation value and a preset deviation threshold value;
and according to the transmission cycle deviation times and the number of the data messages, obtaining the transmission cycle deviation proportion of each data message corresponding to each ID mark in the preset optimization time period, and generating the data message set to be optimized according to each data message of which the transmission cycle deviation proportion is larger than the preset deviation proportion threshold value.
5. The transmission optimization method of CAN messages according to claim 1, wherein said determining an actual transmission period between data messages having the same ID identifier according to said receiving time point of each said message comprises the steps of:
and calculating a receiving time difference value between any two continuously received data messages with the same ID according to the receiving time point of each message, and taking the receiving time difference value as an actual transmission period between the any two continuously received data messages.
6. The method for optimizing transmission of CAN messages according to claim 1, wherein said obtaining a bus free time slot sequence according to said receiving time point and a preset message length of each said message comprises the steps of:
obtaining the sending duration of each message according to the preset message length and the preset message transmission rate of each message;
according to the receiving time point and the sending time length of each message, calculating a bus idle time slot between any two messages continuously received in the preset optimizing time period, and according to a plurality of bus idle time slots in the preset optimizing time period, obtaining the bus idle time slot sequence.
7. The transmission optimization method of CAN messages according to claim 1, wherein the sending, according to the optimized transmission sequence, an adjustment message to a source node corresponding to the any one data message set to be optimized, so that the source node executes the optimized transmission sequence, specifically includes the following steps:
according to the receiving time point of each analog message in the optimized transmission sequence and the preset transmission period among each data message to be optimized in any one data message set to be optimized, a plurality of adjustment messages are sent to a source node corresponding to the any one data message set to be optimized, so that the source node executes the optimized transmission sequence according to the receiving time point of the last adjustment message received;
The adjustment message at least comprises an ID (identity) identification, a maximum transmission period deviation value and a transmission period deviation ratio of the data message to be optimized in any data message set to be optimized.
8. The transmission optimization method of CAN messages according to any one of claims 1 to 7, further comprising the steps of:
when an optimized transmission sequence with the transmission period deviation ratio corresponding to any one data message set to be optimized smaller than the preset deviation ratio threshold value does not exist, a pre-alarm message is sent to a source node corresponding to any one data message set to be optimized; the early warning message at least comprises an ID (identity) identification, a maximum transmission period deviation value, a transmission period deviation ratio and state information for representing failure of optimization of the data message to be optimized in any data message set to be optimized.
9. A transmission optimization device for CAN messages, comprising:
the bus idle time slot sequence acquisition module is used for acquiring the receiving time point of each message in a preset optimization time period on the current bus and acquiring a bus idle time slot sequence according to the receiving time point of each message and the preset message length;
The data message set to be optimized is used for determining the actual transmission period among the data messages with the same ID mark according to the receiving time point of each message, and determining a plurality of data message sets to be optimized, of which the transmission period deviation ratio is larger than a preset deviation ratio threshold value according to the actual transmission period among the data messages, a preset transmission period and the number of the data messages;
the transmission optimization module is used for sequentially carrying out transmission optimization on each data message set to be optimized according to a preset optimization strategy according to the current bus idle time slot sequence, the ID identification of the data message to be optimized in each data message set to be optimized and the preset transmission period;
and the transmission adjusting module is used for sending an adjusting message to a source node corresponding to any one data message set to be optimized according to the optimized transmission sequence when the transmission period deviation ratio corresponding to any one data message set to be optimized is smaller than the optimized transmission sequence of the preset deviation ratio threshold value, so that the source node executes the optimized transmission sequence.
10. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the transmission optimization method of CAN messages according to any one of claims 1 to 8 when executing the computer program.
11. A computer readable storage medium, characterized in that the computer readable storage medium comprises a stored computer program, wherein the computer program when run controls a device in which the computer readable storage medium is located to execute the transmission optimization method of CAN messages according to any one of claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310863601.4A CN116723064A (en) | 2023-07-14 | 2023-07-14 | CAN message transmission optimization method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310863601.4A CN116723064A (en) | 2023-07-14 | 2023-07-14 | CAN message transmission optimization method, device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116723064A true CN116723064A (en) | 2023-09-08 |
Family
ID=87867939
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310863601.4A Pending CN116723064A (en) | 2023-07-14 | 2023-07-14 | CAN message transmission optimization method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116723064A (en) |
-
2023
- 2023-07-14 CN CN202310863601.4A patent/CN116723064A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108123851B (en) | Survival detection method and device for master-slave node synchronous link in distributed system | |
CN113852563A (en) | Message data transmission method and device, terminal equipment and readable storage medium | |
CN114866250B (en) | Method and device for constructing in-vehicle CAN network freshness value, vehicle and storage medium | |
JP2020080059A (en) | Evaluation device, evaluation method and evaluation program | |
US20210392187A1 (en) | Data transmission and network interface controller | |
WO2017091963A1 (en) | Information processing method and apparatus | |
US20130070781A1 (en) | Probabilistic contention window management | |
CN117221037A (en) | Message sending method and device, electronic equipment and storage medium | |
CN116723064A (en) | CAN message transmission optimization method, device, equipment and storage medium | |
CN116932248A (en) | Event processing method and device based on threads and coroutines and terminal equipment | |
CN111639129A (en) | Transaction processing method and device, electronic equipment and computer-readable storage medium | |
CN116582387A (en) | Message sending method, device and equipment | |
CN112068414B (en) | Multi-system timing method, device, equipment and medium | |
WO2017173804A1 (en) | Access resource adjustment method and device | |
CN110876852B (en) | Network game data processing method and system for micro-service | |
CN112637121A (en) | Data port updating method and device, electronic equipment and readable storage medium | |
CN107506491B (en) | OSD data distribution method and device of distributed file system | |
CN114124754B (en) | Method for processing media data packets in a multimedia network and related products | |
CN115002020B (en) | OSPF-based data processing method and device | |
CN115118795B (en) | Data processing method, expansion device, control system, and storage medium | |
CN111917572B (en) | Transaction request processing method and device, electronic equipment and readable storage medium | |
CN114584630B (en) | Communication method and device based on field bus protocol | |
CN113750517B (en) | Keyboard operation data transmission method and device and keyboard operation execution method and device | |
CN112511603B (en) | Data port updating method and device, electronic equipment and readable storage medium | |
CN112532699B (en) | Data port updating method and device, electronic equipment and readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |