CN112367634A - Message sending method and device - Google Patents
Message sending method and device Download PDFInfo
- Publication number
- CN112367634A CN112367634A CN202011248211.9A CN202011248211A CN112367634A CN 112367634 A CN112367634 A CN 112367634A CN 202011248211 A CN202011248211 A CN 202011248211A CN 112367634 A CN112367634 A CN 112367634A
- Authority
- CN
- China
- Prior art keywords
- message
- period value
- period
- offset
- frame
- 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.)
- Granted
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/30—Services specially adapted for particular environments, situations or purposes
- H04W4/40—Services specially adapted for particular environments, situations or purposes for vehicles, e.g. vehicle-to-pedestrians [V2P]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W28/00—Network traffic management; Network resource management
- H04W28/02—Traffic management, e.g. flow control or congestion control
- H04W28/0289—Congestion control
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W28/00—Network traffic management; Network resource management
- H04W28/02—Traffic management, e.g. flow control or congestion control
- H04W28/08—Load balancing or load distribution
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention provides a message sending method and a device, wherein the method comprises the following steps: responding to a congestion time optimization instruction, and acquiring current periodic frame distribution information to be optimized; the period frame distribution information records each frame period message corresponding to each period value and a message sending node to which each frame period message belongs; obtaining the offset interval corresponding to each period value based on the period duration of each period value and the frame number of the period message corresponding to each period value; determining the transmission offset time of each frame period message corresponding to each period value at the message transmission node to which the message transmission node belongs based on the offset interval corresponding to each period value; and sending each sending offset time to a corresponding message sending node, so that each message sending node sends the periodic message corresponding to the offset time according to the received sending offset time. By applying the method provided by the invention, the network congestion can be reduced without reducing the network load rate.
Description
Technical Field
The present invention relates to the field of data communication technologies, and in particular, to a message sending method and apparatus.
Background
In recent years, with the increasing of functions of passenger vehicles, the number of vehicle-mounted controllers is increasing, signal interaction among the controllers is increasing, so that the bus load is higher and higher, network congestion time is prolonged continuously, the cycle deviation of low-priority cycle messages in a whole vehicle is increased, the cycle deviation of low-priority cycle messages sent by external equipment to the whole network is increased, and even a message frame loss phenomenon occurs under extreme conditions, so that the transmission performance of the whole network is reduced.
In the prior art, in order to solve the problem of network congestion, in the process of designing a CAN and CAN fd network, it is usually ensured that the network transmission performance meets the design requirements by reducing the network load rate, that is, under the condition that the network transmission performance cannot meet the design requirements due to the increase of the network load rate, a load reduction manner such as deleting part of useless message signals or increasing the frame period is adopted to ensure the real-time transmission. However, in such a manner, the number of signal interactions of the controller is limited, so that the functional implementation of the controller is affected, and the change range of the controller software caused by the load reduction process is large, and the maintenance cost is high.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a message sending method, which does not need to reduce the network load rate to avoid network congestion.
The invention also provides a message sending device, which is used for ensuring the realization and the application of the method in practice.
A message sending method comprises the following steps:
responding to a congestion time optimization instruction, and acquiring current periodic frame distribution information to be optimized; the period frame distribution information records each frame period message corresponding to each period value and a message sending node to which each frame period message belongs;
obtaining an offset interval corresponding to each period value based on each period value and the frame number of the period message corresponding to each period value;
determining the transmission offset time of each frame period message corresponding to each period value at the message transmission node to which the message transmission node belongs based on the offset interval corresponding to each period value;
and sending each sending offset time to a corresponding message sending node, so that each message sending node sends the periodic message corresponding to the offset time according to the received sending offset time.
Optionally, the above method, where the obtaining of the current periodic frame distribution information to be optimized includes:
analyzing the congestion time optimization instruction to obtain a file identifier contained in the congestion time optimization instruction;
determining a whole network database file corresponding to the file identifier;
and acquiring the current to-be-optimized periodic frame distribution information in the whole network database file.
Optionally, the obtaining the offset interval corresponding to each period value based on each period value and the number of frames of the period packet corresponding to each period value includes:
calculating the period value and the frame number of the period message of the period value to obtain the initial offset interval corresponding to the period value;
comparing the initial offset interval corresponding to the period value with a preset standard offset interval;
if the initial offset interval corresponding to the period value is smaller than the standard offset interval, taking the standard offset interval as the offset interval corresponding to the period value;
if the initial offset interval corresponding to the period value is not smaller than the standard offset interval, the initial offset interval is used as the offset interval corresponding to the period value.
Optionally, the determining, based on the offset interval corresponding to each period value, the transmission offset time of each frame period packet corresponding to each period value at the packet transmission node to which the frame period packet belongs includes:
for each period value, determining the transmission offset time of each frame period message corresponding to the period value according to the time interval corresponding to the period value;
judging whether the transmission offset time of at least one frame period message exists in each frame period message belonging to each message transmission node is zero;
and for the message sending node without the sending offset time of the periodic message being zero, determining the periodic message with the minimum period value in the message sending node, and setting the sending offset time of the periodic message with the minimum period value to be zero so as to obtain the sending offset time of each frame of periodic message corresponding to each period value at the message sending node to which the periodic message belongs.
Optionally, the determining the transmission offset time of each frame period packet corresponding to the period value according to the time interval corresponding to the period value includes:
determining a starting offset time in the period value;
setting initial sending offset time for each frame of the periodic message in sequence according to the initial offset time and the time interval corresponding to the period value;
judging whether the initial transmission offset time of each frame of the periodic message is greater than the period value; if the initial transmission offset time of the periodic message is not greater than the period value, determining the initial transmission offset time of the periodic message as the transmission offset time of the message; if the initial transmission offset time of the periodic message is greater than the period value, subtracting the period value from the initial transmission offset time of the periodic message to obtain the transmission offset time of the periodic message.
A message transmitting apparatus, comprising:
the acquiring unit is used for responding to the congestion time optimization instruction and acquiring the current to-be-optimized periodic frame distribution information; the period frame distribution information records each frame period message corresponding to each period value and a message sending node to which each frame period message belongs;
an execution unit, configured to obtain an offset interval corresponding to each period value based on each period value and a frame number of a period packet corresponding to each period value;
a determining unit, configured to determine, based on the offset interval corresponding to each period value, a transmission offset time of each frame period packet corresponding to each period value at the packet sending node to which the frame period packet belongs;
and the sending unit is used for sending each sending offset time to the corresponding message sending node, so that each message sending node sends the periodic message corresponding to the offset time according to the received sending offset time.
The above apparatus, optionally, the obtaining unit includes:
the analysis subunit is configured to analyze the congestion time optimization instruction to obtain a file identifier included in the congestion time optimization instruction;
the first determining subunit is used for determining the whole network database file corresponding to the file identifier;
and the acquisition subunit is used for acquiring the current to-be-optimized periodic frame distribution information from the whole network database file.
The above apparatus, optionally, the execution unit includes:
a calculating subunit, configured to calculate the period value and the frame number of the period packet of the period value, so as to obtain an initial offset interval corresponding to the period value;
a comparison subunit, configured to compare the initial offset interval corresponding to the period value with a preset standard offset interval;
a first execution subunit, configured to, if the initial offset interval corresponding to the period value is smaller than the standard offset interval, take the standard offset interval as the offset interval corresponding to the period value;
and a second execution subunit, configured to, if the initial offset interval corresponding to the period value is not smaller than the standard offset interval, take the initial offset interval as the offset interval corresponding to the period value.
The above apparatus, optionally, the determining unit includes:
a second determining subunit, configured to determine, for each period value, the transmission offset time of each frame period packet corresponding to the period value according to the time interval corresponding to the period value;
a judging subunit, configured to judge whether there is a transmission offset time of at least one frame period packet in each frame period packet belonging to each packet transmission node, where the transmission offset time is zero;
a third determining subunit, configured to determine, for a packet sending node where there is no transmission offset time of a periodic packet, a periodic packet with a minimum period value in the packet sending node, and set the transmission offset time of the periodic packet with the minimum period value to zero, so as to obtain the transmission offset time of each frame of periodic packet corresponding to each period value at the packet sending node to which the periodic packet belongs.
The above apparatus, optionally, the second determining subunit is configured to:
determining a starting offset time in the period value;
setting initial sending offset time for each frame of the periodic message in sequence according to the initial offset time and the time interval corresponding to the period value;
judging whether the initial transmission offset time of each frame of the periodic message is greater than the period value; if the initial transmission offset time of the periodic message is not greater than the period value, determining the initial transmission offset time of the periodic message as the transmission offset time of the message; if the initial transmission offset time of the periodic message is greater than the period value, subtracting the period value from the initial transmission offset time of the periodic message to obtain the transmission offset time of the periodic message.
Compared with the prior art, the invention has the following advantages:
the invention provides a message sending method and a device, wherein the method comprises the following steps: responding to a congestion time optimization instruction, and acquiring current periodic frame distribution information to be optimized; the period frame distribution information records each frame period message corresponding to each period value and a message sending node to which each frame period message belongs; obtaining an offset interval corresponding to each period value based on each period value and the frame number of the period message corresponding to each period value; determining the transmission offset time of each frame period message corresponding to each period value at the message transmission node to which the message transmission node belongs based on the offset interval corresponding to each period value; and sending each sending offset time to a corresponding message sending node, so that each message sending node sends the periodic message corresponding to the offset time according to the received sending offset time. By applying the method provided by the invention, the message sending node can send the period based on the sending offset time by sending the sending offset time of the message of each frame period to the corresponding message sending node, thereby effectively reducing the network congestion without deleting useless signals of the controller or increasing the frame period and having low maintenance cost.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method for sending a message according to the present invention;
FIG. 2 is a flowchart of a process for obtaining an offset interval corresponding to a period value according to the present invention;
fig. 3 is an exemplary diagram of a network transmission architecture according to the present invention;
fig. 4 is a schematic structural diagram of a message sending apparatus according to the present invention;
fig. 5 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention is operational with numerous general purpose or special purpose computing device environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multi-processor apparatus, distributed computing environments that include any of the above devices or equipment, and the like.
The embodiment of the present invention provides a message sending method, which can be applied to various system platforms, an execution subject of the method can be a computer terminal or a processor of various mobile devices, and a flow chart of the method is shown in fig. 1, and specifically includes:
s101: responding to a congestion time optimization instruction, and acquiring current periodic frame distribution information to be optimized; the period frame distribution information records each frame period message corresponding to each period value and a message sending node to which each frame period message belongs, wherein each frame period message has a period value, and each frame period message with the same period value is used as each frame period message corresponding to the period value.
In the method provided by the embodiment of the invention, the message sending node can be a vehicle-mounted controller.
Optionally, the period frame distribution information includes a correspondence between a period packet identifier and a period value and a correspondence between a period packet identifier and a packet sending node.
Specifically, the current cycle frame distribution information to be optimized may be obtained from a whole network database file corresponding to the congestion time optimization instruction, where the congestion time optimization instruction may be triggered by a user according to a congestion time optimization requirement.
S102: and obtaining the offset interval corresponding to each period value based on each period value and the frame number of the period message corresponding to each period value.
In the method provided in the embodiment of the present invention, the period value includes a period duration of the packet period, for example, the period value may be 10ms, 20ms, 100ms, 1000ms, and the like.
The offset interval refers to a transmission time interval between each frame period message corresponding to each period value.
S103: and determining the transmission offset time of each frame period message corresponding to each period value at the message transmission node to which the message transmission node belongs based on the offset interval corresponding to each period value.
In the method provided in the embodiment of the present invention, each packet sending node corresponds to at least one frame period packet of at least one period value, and each packet sending node may be configured to send its corresponding period packet.
Based on the offset interval corresponding to each period value, the transmission offset time of each frame period message can be determined.
Specifically, the transmission offset time of each frame period message at the message transmission node to which the frame period message belongs may be: the offset time between the time when the message sending node sends the periodic message and the initial time.
The initial time may be a time when the message sending node sends the periodic message with the sending offset time being zero.
S104: and sending each sending offset time to a corresponding message sending node, so that each message sending node sends the periodic message corresponding to the offset time according to the received sending offset time.
In the method provided by the embodiment of the invention, the transmission offset time of each frame of periodic message at the message transmission node to which the periodic message belongs is transmitted to the message transmission node, so that the message transmission node transmits the periodic message based on the transmission offset time.
By applying the method provided by the embodiment of the invention, the message sending node can send the period based on the sending offset time by sending the sending offset time of the message of each frame period to the corresponding message sending node, so that the network congestion can be effectively reduced, the useless signals of the controller do not need to be deleted or the frame period does not need to be increased, and the maintenance cost is low.
Based on the above implementation process, the method provided in the embodiment of the present invention specifically obtains the current periodic frame distribution information to be optimized, including:
analyzing the congestion time optimization instruction to obtain a file identifier contained in the congestion time optimization instruction;
determining a whole network database file corresponding to the file identifier;
and acquiring the current to-be-optimized periodic frame distribution information in the whole network database file.
In the method provided by the embodiment of the present invention, the congestion time optimization instruction is analyzed to obtain instruction information of the congestion time optimization instruction.
Specifically, the instruction information may include a file identifier, the file identifier may be obtained from the instruction information, and a whole-network database file corresponding to the file identifier is determined in a pre-established database file set, where the whole-network database file is a DBC file, and the current cycle frame distribution information to be optimized may be obtained from the whole-network database file.
Based on the above implementation process, specifically, a feasible manner for obtaining the offset interval corresponding to each period value based on each period value and the frame number of the period packet corresponding to each period value is described in fig. 2, and includes:
s201: and calculating the period value and the frame number of the period message of the period value to obtain the initial offset interval corresponding to the period value.
In the method provided in the embodiment of the present invention, the period value and the number of frames of the period packet may be substituted into a preset formula to obtain the initial offset interval corresponding to the period value, where the formula is as follows:
wherein, the TiMay be a period value, NiThe number of frames, P, of the periodic message, which may be a period valueiMay be the initial offset interval corresponding to the period value, and i is the identification of the period value, which may be the sorting order number of the period value.
S202: and comparing the initial offset interval corresponding to the period value with a preset standard offset interval.
In the method provided by the embodiment of the present invention, the standard offset interval may be set based on actual requirements, for example, may be set to 1 ms.
S203: if the initial offset interval corresponding to the period value is smaller than the standard offset interval, the standard offset interval is used as the offset interval corresponding to the period value.
If the standard offset interval is 1ms, the offset interval corresponding to the period value may be set to 1ms when the initial offset interval corresponding to the period value is less than 1 ms.
S204: if the initial offset interval corresponding to the period value is not smaller than the standard offset interval, the initial offset interval is used as the offset interval corresponding to the period value.
In the embodiment of the present invention, a feasible way to obtain the offset interval corresponding to each period value may be to, under the condition that the initial offset interval corresponding to the period value is not less than the standard offset interval, determine whether the initial offset interval is an integer, if the initial offset interval is an integer, take the initial offset interval as the offset interval corresponding to the period value, if the initial offset interval is not an integer, perform a rounding operation on the initial offset interval to obtain the offset interval corresponding to the period value, where the initial offset interval may be rounded downward.
Based on the above implementation process, the method provided in this embodiment of the present invention specifically determines, based on the offset interval corresponding to each period value, the transmission offset time of each frame of periodic packet corresponding to each period value at the packet transmission node to which the frame of periodic packet belongs, and specifically includes:
for each period value, determining the transmission offset time of each frame period message corresponding to the period value according to the time interval corresponding to the period value;
judging whether the transmission offset time of at least one frame period message exists in each frame period message belonging to each message transmission node is zero;
and for the message sending node without the sending offset time of the periodic message being zero, determining the periodic message with the minimum period value in the message sending node, and setting the sending offset time of the periodic message with the minimum period value to be zero so as to obtain the sending offset time of each frame of periodic message corresponding to each period value at the message sending node to which the periodic message belongs.
In the method provided by the embodiment of the present invention, for a packet sending node that has at least one frame period packet with a transmission offset time of zero, the transmission offset time of the period packet in the packet sending node does not need to be changed, and it can be ensured that each packet sending node has at least one frame period packet with a transmission offset time of zero, where an initial time in each packet sending node is a time when the node sends the period packet with a transmission offset time of zero.
Based on the above implementation process, the method provided in this embodiment of the present invention specifically determines the sending offset time of each frame period packet corresponding to the period value according to the time interval corresponding to the period value, including:
determining a starting offset time in the period value;
setting initial sending offset time for each frame of the periodic message in sequence according to the initial offset time and the time interval corresponding to the period value;
judging whether the initial transmission offset time of each frame of the periodic message is greater than the period value; if the initial transmission offset time of the periodic message is not greater than the period value, determining the initial transmission offset time of the periodic message as the transmission offset time of the message; if the initial transmission offset time of the periodic message is greater than the period value, subtracting the period value from the initial transmission offset time of the periodic message to obtain the transmission offset time of the periodic message.
In the method provided by the embodiment of the invention, the initial offset time of the period value can be determined based on the sorting sequence number of the period value, and the sorting sequence number is obtained by sorting from small to large based on each period value.
One possible way to determine the start offset time of the period value based on the sorting order number of the period value may be: subtracting a preset time value from the sequence number of the period value to obtain the initial offset time of the period value, where the preset time value may be 1 ms.
Specifically, the sorting sequence number is i, the initial offset time can be i-1, and the period value is TiThe initial transmission offset time of each period message is respectively as follows: i-1, Pi+i-1,2Pi+i-1,...,(Ni-1)Pi+i-1。
The message sending method provided in the embodiment of the present invention may be applied to a vehicle-mounted controller local area network, which may be a CAN network, and the example diagram of the network transmission architecture thereof, as shown in fig. 3, includes 13 nodes, namely, controller nodes a-M, where the controller nodes are message sending nodes.
Specifically, the period frame distribution information of the vehicle-mounted controller local area network may be obtained first, and the period distribution information of the vehicle-mounted controller local area network is shown in table 1:
TABLE 1
Each period value (i 1, 2, 3.. 12) of the local area network of the vehicle-mounted controller contains 119 frame period messages, each frame of data can be 8 bytes in length, the local area network can transmit data at a baud rate of 500k, and T is a rate of TiIs a period value i, NiThe frame number of the periodic message is the period value i.
In particular, it can be based on the formula Pi=Ti/NiCalculating the offset interval of the periodic messages with the same period value, wherein the calculation result is shown in table 2:
Ti/ms | ni/frame | Pi/ms |
10 | 9(Fr1~Fr9) | 1 |
20 | 15(Fr10~Fr24) | 1 |
25 | 11(Fr25~Fr35) | 2 |
30 | 2(Fr36~Fr37) | 15 |
40 | 1(Fr38) | 40 |
50 | 13(Fr39~Fr51) | 3 |
100 | 32(Fr52~Fr83) | 3 |
200 | 19(Fr84~Fr102) | 10 |
250 | 1(Fr103) | 250 |
400 | 2(Fr104~Fr105) | 200 |
500 | 6(Fr106~Fr112) | 83 |
1000 | 8(Fr113~Fr119) | 125 |
TABLE 2
Specifically, after the offset interval corresponding to each period value is obtained through calculation, the initial transmission offset time of each frame period packet is set, where the initial offset time may be i-1, and the initial transmission offset times of each period packet with the same period value are respectively: i-1, + i-1, 2+ i-1, (-1) + i-1, the initial transmission offset time of each frame period message corresponding to each period value, as shown in table 3:
TABLE 3
After the initial transmission offset time of each frame of periodic message is obtained, whether the initial transmission offset time of each frame of periodic message is greater than the period value can be judged; if the initial transmission offset time of the periodic message is not greater than the period value, determining the initial transmission offset time of the periodic message as the transmission offset time of the message; if the initial transmission offset time of the periodic message is greater than the period value, subtracting the period value from the initial transmission offset time of the periodic message to obtain the transmission offset time of the periodic message; judging whether the transmission offset time of at least one frame period message exists in each frame period message belonging to each message transmission node is zero; and for the message sending node without the sending offset time of the periodic message being zero, determining the periodic message with the minimum period value in the message sending node, and setting the sending offset time of the periodic message with the minimum period value to be zero so as to obtain the sending offset time of each frame of periodic message corresponding to each period value at the message sending node to which the periodic message belongs.
Specifically, the sending offset time of the periodic message belonging to each message sending node is implemented in software of each message sending node, that is, each sending offset time is sent to the corresponding message sending node, so that each message sending node sends the periodic message corresponding to the offset time according to the received sending offset time.
In the method provided by the embodiment of the invention, through comparison of simulation results, when the offset time is not set in the whole network period frame, the maximum congestion time of the network is 49.6ms, and after the offset time is set, the maximum congestion time is 6.76ms, so that the maximum congestion time is obviously reduced, the network performance is obviously improved, and by applying the method provided by the embodiment of the invention, the maximum congestion time of the network under a high load condition can be reduced, and thus the transmission delay of a low-priority message is reduced.
Corresponding to the method described in fig. 1, an embodiment of the present invention further provides a message sending apparatus, which is used for specifically implementing the method in fig. 1, where the message sending apparatus provided in the embodiment of the present invention may be applied to a computer terminal or various mobile devices, and a schematic structural diagram of the message sending apparatus is shown in fig. 4, and specifically includes:
an obtaining unit 401, configured to obtain, in response to the congestion time optimization instruction, current periodic frame distribution information to be optimized; the period frame distribution information records each frame period message corresponding to each period value and a message sending node to which each frame period message belongs;
an executing unit 402, configured to obtain an offset interval corresponding to each period value based on each period value and a frame number of the period packet corresponding to each period value;
a determining unit 403, configured to determine, based on the offset interval corresponding to each period value, a transmission offset time of each frame period packet corresponding to each period value at the packet sending node to which the frame period packet belongs;
a sending unit 404, configured to send each sending offset time to a corresponding packet sending node, so that each packet sending node sends a periodic packet corresponding to the offset time according to the received sending offset time.
In an embodiment provided by the present invention, based on the above scheme, specifically, the obtaining unit 401 includes:
the analysis subunit is configured to analyze the congestion time optimization instruction to obtain a file identifier included in the congestion time optimization instruction;
the first determining subunit is used for determining the whole network database file corresponding to the file identifier;
and the acquisition subunit is used for acquiring the current to-be-optimized periodic frame distribution information from the whole network database file.
In an embodiment of the present invention, based on the above scheme, specifically, the execution unit 402 includes:
a calculating subunit, configured to calculate the period value and the frame number of the period packet of the period value, so as to obtain an initial offset interval corresponding to the period value;
a comparison subunit, configured to compare the initial offset interval corresponding to the period value with a preset standard offset interval;
a first execution subunit, configured to, if the initial offset interval corresponding to the period value is smaller than the standard offset interval, take the standard offset interval as the offset interval corresponding to the period value;
and a second execution subunit, configured to, if the initial offset interval corresponding to the period value is not smaller than the standard offset interval, take the initial offset interval as the offset interval corresponding to the period value.
In an embodiment provided by the present invention, based on the above scheme, specifically, the determining unit 403 includes:
a second determining subunit, configured to determine, for each period value, the transmission offset time of each frame period packet corresponding to the period value according to the time interval corresponding to the period value;
a judging subunit, configured to judge whether there is a transmission offset time of at least one frame period packet in each frame period packet belonging to each packet transmission node, where the transmission offset time is zero;
a third determining subunit, configured to determine, for a packet sending node where there is no transmission offset time of a periodic packet, a periodic packet with a minimum period value in the packet sending node, and set the transmission offset time of the periodic packet with the minimum period value to zero, so as to obtain the transmission offset time of each frame of periodic packet corresponding to each period value at the packet sending node to which the periodic packet belongs.
In an embodiment provided by the present invention, based on the above scheme, specifically, the second determining subunit is configured to:
determining a starting offset time in the period value;
setting initial sending offset time for each frame of the periodic message in sequence according to the initial offset time and the time interval corresponding to the period value;
judging whether the initial transmission offset time of each frame of the periodic message is greater than the period value; if the initial transmission offset time of the periodic message is not greater than the period value, determining the initial transmission offset time of the periodic message as the transmission offset time of the message; if the initial transmission offset time of the periodic message is greater than the period value, subtracting the period value from the initial transmission offset time of the periodic message to obtain the transmission offset time of the periodic message.
The specific principle and the execution process of each unit and each module in the message sending device disclosed in the embodiment of the present invention are the same as those of the message sending method disclosed in the embodiment of the present invention, and refer to the corresponding parts in the message sending method provided in the embodiment of the present invention, which are not described herein again.
The embodiment of the invention also provides a storage medium, which comprises a stored instruction, wherein when the instruction runs, the equipment where the storage medium is located is controlled to execute the message sending method.
An electronic device is provided in an embodiment of the present invention, and the structural diagram of the electronic device is shown in fig. 5, which specifically includes a memory 501 and one or more instructions 502, where the one or more instructions 502 are stored in the memory 501, and are configured to be executed by one or more processors 503 to perform the following operations according to the one or more instructions 502:
responding to a congestion time optimization instruction, and acquiring current periodic frame distribution information to be optimized; the period frame distribution information records each frame period message corresponding to each period value and a message sending node to which each frame period message belongs;
obtaining an offset interval corresponding to each period value based on each period value and the frame number of the period message corresponding to each period value;
determining the transmission offset time of each frame period message corresponding to each period value at the message transmission node to which the message transmission node belongs based on the offset interval corresponding to each period value;
and sending each sending offset time to a corresponding message sending node, so that each message sending node sends the periodic message corresponding to the offset time according to the received sending offset time.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the units may be implemented in the same software and/or hardware or in a plurality of software and/or hardware when implementing the invention.
From the above description of the embodiments, it is clear to those skilled in the art that the present invention can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments.
The above detailed description is provided for a message sending method provided by the present invention, and a specific example is applied in this document to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.
Claims (10)
1. A method for sending a message, comprising:
responding to a congestion time optimization instruction, and acquiring current periodic frame distribution information to be optimized; the period frame distribution information records each frame period message corresponding to each period value and a message sending node to which each frame period message belongs;
obtaining an offset interval corresponding to each period value based on each period value and the frame number of the period message corresponding to each period value;
determining the transmission offset time of each frame period message corresponding to each period value at the message transmission node to which the message transmission node belongs based on the offset interval corresponding to each period value;
and sending each sending offset time to a corresponding message sending node, so that each message sending node sends the periodic message corresponding to the offset time according to the received sending offset time.
2. The method according to claim 1, wherein the obtaining of the current periodic frame distribution information to be optimized comprises:
analyzing the congestion time optimization instruction to obtain a file identifier contained in the congestion time optimization instruction;
determining a whole network database file corresponding to the file identifier;
and acquiring the current to-be-optimized periodic frame distribution information in the whole network database file.
3. The method of claim 1, wherein obtaining the offset interval corresponding to each period value based on each period value and the number of frames of the periodic packet corresponding to each period value comprises:
calculating the period value and the frame number of the period message of the period value to obtain the initial offset interval corresponding to the period value;
comparing the initial offset interval corresponding to the period value with a preset standard offset interval;
if the initial offset interval corresponding to the period value is smaller than the standard offset interval, taking the standard offset interval as the offset interval corresponding to the period value;
if the initial offset interval corresponding to the period value is not smaller than the standard offset interval, the initial offset interval is used as the offset interval corresponding to the period value.
4. The method according to claim 1, wherein the determining the transmission offset time of each frame period packet corresponding to each period value at the packet transmitting node to which the frame period packet belongs based on the offset interval corresponding to each period value comprises:
for each period value, determining the transmission offset time of each frame period message corresponding to the period value according to the time interval corresponding to the period value;
judging whether the transmission offset time of at least one frame period message exists in each frame period message belonging to each message transmission node is zero;
and for the message sending node without the sending offset time of the periodic message being zero, determining the periodic message with the minimum period value in the message sending node, and setting the sending offset time of the periodic message with the minimum period value to be zero so as to obtain the sending offset time of each frame of periodic message corresponding to each period value at the message sending node to which the periodic message belongs.
5. The method of claim 4, wherein determining the transmission offset time of each frame period packet corresponding to the period value according to the time interval corresponding to the period value comprises:
determining a starting offset time in the period value;
setting initial sending offset time for each frame of the periodic message in sequence according to the initial offset time and the time interval corresponding to the period value;
judging whether the initial transmission offset time of each frame of the periodic message is greater than the period value; if the initial transmission offset time of the periodic message is not greater than the period value, determining the initial transmission offset time of the periodic message as the transmission offset time of the message; if the initial transmission offset time of the periodic message is greater than the period value, subtracting the period value from the initial transmission offset time of the periodic message to obtain the transmission offset time of the periodic message.
6. A message transmission apparatus, comprising:
the acquiring unit is used for responding to the congestion time optimization instruction and acquiring the current to-be-optimized periodic frame distribution information; the period frame distribution information records each frame period message corresponding to each period value and a message sending node to which each frame period message belongs;
an execution unit, configured to obtain an offset interval corresponding to each period value based on each period value and a frame number of a period packet corresponding to each period value;
a determining unit, configured to determine, based on the offset interval corresponding to each period value, a transmission offset time of each frame period packet corresponding to each period value at the packet sending node to which the frame period packet belongs;
and the sending unit is used for sending each sending offset time to the corresponding message sending node, so that each message sending node sends the periodic message corresponding to the offset time according to the received sending offset time.
7. The apparatus of claim 6, wherein the obtaining unit comprises:
the analysis subunit is configured to analyze the congestion time optimization instruction to obtain a file identifier included in the congestion time optimization instruction;
the first determining subunit is used for determining the whole network database file corresponding to the file identifier;
and the acquisition subunit is used for acquiring the current to-be-optimized periodic frame distribution information from the whole network database file.
8. The apparatus of claim 6, wherein the execution unit comprises:
a calculating subunit, configured to calculate the period value and the frame number of the period packet of the period value, so as to obtain an initial offset interval corresponding to the period value;
a comparison subunit, configured to compare the initial offset interval corresponding to the period value with a preset standard offset interval;
a first execution subunit, configured to, if the initial offset interval corresponding to the period value is smaller than the standard offset interval, take the standard offset interval as the offset interval corresponding to the period value;
and a second execution subunit, configured to, if the initial offset interval corresponding to the period value is not smaller than the standard offset interval, take the initial offset interval as the offset interval corresponding to the period value.
9. The apparatus of claim 6, wherein the determining unit comprises:
a second determining subunit, configured to determine, for each period value, the transmission offset time of each frame period packet corresponding to the period value according to the time interval corresponding to the period value;
a judging subunit, configured to judge whether there is a transmission offset time of at least one frame period packet in each frame period packet belonging to each packet transmission node, where the transmission offset time is zero;
a third determining subunit, configured to determine, for a packet sending node where there is no transmission offset time of a periodic packet, a periodic packet with a minimum period value in the packet sending node, and set the transmission offset time of the periodic packet with the minimum period value to zero, so as to obtain the transmission offset time of each frame of periodic packet corresponding to each period value at the packet sending node to which the periodic packet belongs.
10. The apparatus of claim 9, wherein the second determining subunit is configured to:
determining a starting offset time in the period value;
setting initial sending offset time for each frame of the periodic message in sequence according to the initial offset time and the time interval corresponding to the period value;
judging whether the initial transmission offset time of each frame of the periodic message is greater than the period value; if the initial transmission offset time of the periodic message is not greater than the period value, determining the initial transmission offset time of the periodic message as the transmission offset time of the message; if the initial transmission offset time of the periodic message is greater than the period value, subtracting the period value from the initial transmission offset time of the periodic message to obtain the transmission offset time of the periodic message.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011248211.9A CN112367634B (en) | 2020-11-10 | 2020-11-10 | Message sending method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011248211.9A CN112367634B (en) | 2020-11-10 | 2020-11-10 | Message sending method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112367634A true CN112367634A (en) | 2021-02-12 |
CN112367634B CN112367634B (en) | 2022-12-13 |
Family
ID=74508679
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011248211.9A Active CN112367634B (en) | 2020-11-10 | 2020-11-10 | Message sending method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112367634B (en) |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001142794A (en) * | 1999-11-18 | 2001-05-25 | Yanmar Agricult Equip Co Ltd | On-vehicle controller |
JP2007081628A (en) * | 2005-09-13 | 2007-03-29 | Nec Electronics Corp | Method, program, and device for designing network |
CN104035901A (en) * | 2014-06-23 | 2014-09-10 | 中国北方车辆研究所 | TTCAN bus timing and data transmitting method |
CN106155014A (en) * | 2016-06-23 | 2016-11-23 | 北京东土科技股份有限公司 | A kind of industry internet field layer wideband bus real-time implementation method |
CN106411443A (en) * | 2015-07-28 | 2017-02-15 | 长城汽车股份有限公司 | Message transmission method, in-vehicle network system and vehicle |
CN106921546A (en) * | 2016-12-30 | 2017-07-04 | 蔚来汽车有限公司 | CAN control method and the communication system using CAN |
US20170280351A1 (en) * | 2016-03-23 | 2017-09-28 | Fedex Corporate Services, Inc. | Methods, non-transitory computer readable media, and systems for improved communication management of a plurality of wireless nodes in a wireless node network |
CN107332749A (en) * | 2017-07-05 | 2017-11-07 | 北京东土科技股份有限公司 | Synchronous method and device based on industry internet field layer wideband bus framework |
CN109743242A (en) * | 2018-12-28 | 2019-05-10 | 联创汽车电子有限公司 | CAN bus message control system and its control method |
CN110798818A (en) * | 2019-07-26 | 2020-02-14 | 北京锦鸿希电信息技术股份有限公司 | Train information transmission method and system for urban rail transit |
US20200198122A1 (en) * | 2018-12-20 | 2020-06-25 | David E. Newman | Identification and Localization of Mobile Robots |
-
2020
- 2020-11-10 CN CN202011248211.9A patent/CN112367634B/en active Active
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001142794A (en) * | 1999-11-18 | 2001-05-25 | Yanmar Agricult Equip Co Ltd | On-vehicle controller |
JP2007081628A (en) * | 2005-09-13 | 2007-03-29 | Nec Electronics Corp | Method, program, and device for designing network |
CN104035901A (en) * | 2014-06-23 | 2014-09-10 | 中国北方车辆研究所 | TTCAN bus timing and data transmitting method |
CN106411443A (en) * | 2015-07-28 | 2017-02-15 | 长城汽车股份有限公司 | Message transmission method, in-vehicle network system and vehicle |
US20170280351A1 (en) * | 2016-03-23 | 2017-09-28 | Fedex Corporate Services, Inc. | Methods, non-transitory computer readable media, and systems for improved communication management of a plurality of wireless nodes in a wireless node network |
CN106155014A (en) * | 2016-06-23 | 2016-11-23 | 北京东土科技股份有限公司 | A kind of industry internet field layer wideband bus real-time implementation method |
CN106921546A (en) * | 2016-12-30 | 2017-07-04 | 蔚来汽车有限公司 | CAN control method and the communication system using CAN |
CN107332749A (en) * | 2017-07-05 | 2017-11-07 | 北京东土科技股份有限公司 | Synchronous method and device based on industry internet field layer wideband bus framework |
US20200198122A1 (en) * | 2018-12-20 | 2020-06-25 | David E. Newman | Identification and Localization of Mobile Robots |
CN109743242A (en) * | 2018-12-28 | 2019-05-10 | 联创汽车电子有限公司 | CAN bus message control system and its control method |
CN110798818A (en) * | 2019-07-26 | 2020-02-14 | 北京锦鸿希电信息技术股份有限公司 | Train information transmission method and system for urban rail transit |
Non-Patent Citations (2)
Title |
---|
ZACHARYVANDER LAAN等: "Operational performance of a congested corridor with lanes dedicated to autonomous vehicle traffic", 《INTERNATIONAL JOURNAL OF TRANSPORTATION SCIENCE AND TECHNOLOGY》 * |
刘剑锋等: "一种CAN总线调度算法在机车制动机上的应用研究", 《小型微型计算机系统》 * |
Also Published As
Publication number | Publication date |
---|---|
CN112367634B (en) | 2022-12-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112115031B (en) | Cluster state monitoring method and device | |
CN111966289B (en) | Partition optimization method and system based on Kafka cluster | |
CN110493065A (en) | The alarm association degree analysis method and system of a kind of cloud center O&M | |
CN112751726B (en) | Data processing method and device, electronic equipment and storage medium | |
CN115277566B (en) | Load balancing method and device for data access, computer equipment and medium | |
CN109766217B (en) | Vehicle machine system fault repairing method and device | |
CN109933610B (en) | Data processing method, device, computer equipment and storage medium | |
CN111915892B (en) | Data request response method, device, computer equipment and medium | |
CN113645287B (en) | Automobile message storage method and device and automobile message storage system | |
CN112784992A (en) | Network data analysis method, functional entity and electronic equipment | |
CN114490078A (en) | Dynamic capacity reduction and expansion method, device and equipment for micro-service | |
CN111200649A (en) | Scheduling method and device and scheduling model generation method and device | |
CN111369281B (en) | Online message processing method, device, equipment and readable storage medium | |
CN114172819B (en) | Method, system, electronic equipment and storage medium for predicting demand resources of NFV network element | |
CN112596985B (en) | IT asset detection method, device, equipment and medium | |
CN112367634B (en) | Message sending method and device | |
CN110875983A (en) | Method, device, equipment and medium for evaluating terminal service quality | |
CN114584627B (en) | Middle station dispatching system and method with network monitoring function | |
CN116956028A (en) | User portrait updating method, device, equipment and storage medium | |
CN112566054B (en) | Method and system for optimizing message interaction process | |
CN110995839B (en) | Method and device for analyzing performance of advertisement system and computer storage medium | |
CN115915192A (en) | Network optimization method and device, electronic equipment and storage medium | |
CN103106103B (en) | Solicited message sorting technique and device | |
CN111625866A (en) | Authority management method, system, equipment and storage medium | |
CN111641959A (en) | Method and device for detecting network environment information |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |