Background
With the development of vehicle-mounted communication systems and the gradual maturity of mobile ad hoc network technologies, in order to realize real-time, dynamic and intelligent management of vehicles, a Dedicated Short Range Communication (DSRC) protocol for vehicle networking is internationally and specially developed. The DSRC organically connects the vehicle with the vehicle, the vehicle and the roadside information acquisition equipment through bidirectional information transmission, and supports point-to-point and point-to-multipoint communication.
The Mobile Slotted ALOHA (MS-ALOHA) mechanism is a time-sharing based DSRC MAC (Medium Access Control) layer Access and resource allocation mechanism, and the resource allocation is based on a frame structure and takes a slot as a unit. Referring to fig. 1, each N slots form a Frame (denoted as Frame), and slots in each Frame are numbered 0 to N-1, and are cyclically repeated between frames. Only one vehicle is allowed to transmit in each slot, that is, a TDMA (Time Division Multiple Access) mode is adopted between the vehicles. The vehicle not only transmits data of the application layer but also needs to transmit FI (Frame Information) in the occupied time slot, where the occupied state of each slot in one Frame is indicated, for example, one possible FI structure is shown in fig. 2.
The basic idea of the MS-ALOHA mechanism is: when any node (such as a vehicle) joins the network, it needs to occupy a timeslot through the idle timeslot resources in the monitoring frame, and if the node does not actively give up the occupied timeslot resources, the occupied timeslot can be used all the time to transmit data, during which other nodes cannot use the timeslot. In an occupied time slot, a node needs to periodically send FI, which carries the condition that other nodes within a two-hop range away from the node occupy the time slot, obtained by the node, indicates the occupation status information (also called time slot status information and time slot information) of each time slot perceived by the node, and gives the time slot for each time slot: time slot occupation state information, STI (temporary resource identifier) corresponding to a node occupying a time slot or may be referred to as a node identifier, and a priority state of the node occupying the time slot (which may also be considered as a priority state corresponding to data sent by the node occupying the time slot in the time slot); the timeslot occupation state information may express four occupation states of the timeslot: (00) the time slot is represented as an idle state, (10) the time slot is represented as being occupied by other nodes which are one hop away from the node (for short, occupied by one hop of node) or occupied by the node, (11) the time slot is represented as being occupied by other nodes which are two hops away from the node (for short, occupied by two hops of node), (01) the time slot is represented as being occupied by more than two other nodes, namely, a collision state; in the time slot which is not occupied by the node, each node can judge the condition that each node occupies the time slot in the adjacent three-hop range by monitoring FI (Fi) sent by the node of the adjacent one hop, and when the time slot resource occupied by the node is found to collide with the resource used by other nodes, a new idle time slot is reserved again. In order to facilitate subsequent description, the following description modes are uniformly adopted for FI and internal information content thereof in the invention:
the node transmitting Frame Information (FI) is called: an FI message, which may also be referred to as FI for short;
the occupation status information corresponding to each time slot indicated in the FI is called: a time slot information domain corresponding to each time slot in the FI message;
three types of information (namely, the slot occupation state, the STI and the priority information) given in the occupation status information corresponding to each slot in the FI are respectively called as: the time slot occupation state sub-field, STI sub-field and priority sub-field contained in the time slot information field of each time slot;
it should be noted that the above description is only provided for convenience of the following description, and other description manners may be adopted.
Under the MS-ALOHA mechanism, in the maintenance process of occupied time slots, a node needs to maintain an (N-1) × N time slot state cache table for storing time slot information fields of each time slot carried in FI messages sent by adjacent nodes received on corresponding time slots. For example, referring to fig. 3, the dimension of the time slot state cache table shown in fig. 3 is N × N, and since FI messages sent by the nodes themselves in occupied time slots do not need to be stored, the time slot state cache table actually maintained by the nodes is N-1 rows (assuming that each node only occupies one time slot), and all the (N-1) × N time slot state cache tables described in the subsequent contents of the present invention refer to time slot information for sending FI without storing the time slots occupied by the nodes themselves; the detection field corresponding to the timeslot refers to a timeslot information field corresponding to the timeslot in the FI message sent by occupying the timeslot and is called a "detection field" of the timeslot, and the non-detection field refers to a timeslot information field corresponding to the timeslot in the FI sent by not occupying the timeslot and is called a non-detection field "of the timeslot. Wherein the default value is the default value.
When a node receives an FI message on a time slot, the information content of the row corresponding to the time slot in the time slot state cache table (namely, the content recorded before covering a frame period) is always covered by the information content of the time slot carried in the newly received FI message. The specific process is as follows:
the FI message is generated and sent by the node in the time slot occupied by the node, and each field (domain) needs to be filled according to a certain rule, wherein the field comprises a time slot occupation state sub-domain, an STI sub-domain and a priority sub-domain. After the transmission is finished, the node clears the transmitted FI information.
The method comprises the steps that a node needs to receive FI messages sent by surrounding nodes on a time slot which is not occupied by the node, a time slot state cache table is updated according to the received FI messages, whether the time slot occupied by the node is maintained successfully or not and the occupied state of each time slot of the time slot which is not occupied by the node are judged before the time slot occupied by the node is reached, wherein when the FI is not received on the time slot which is not occupied by the node, the node fills a default value into each domain of a line corresponding to the time slot in the time slot state cache table. The Default value is currently processed in the idle state (00), although other processing manners may be defined.
Under the MS-ALOHA mechanism, any node judges that the time slot resource has collision and has the following two conditions:
1) and the time slot resources occupied by the nodes are collided.
In the (N-1) × N time slot state cache table, if any one of the following conditions occurs in the time slot information indicated on the column (N-1 elements) corresponding to the time slot occupied by the node itself, the time slot occupied by the node itself is considered to be collided:
a. one or more time slot information corresponding to the N-1 element indicates that the time slot is occupied by other nodes different from the node STI (the corresponding time slot occupation status is indicated as 10), and the priority of the node itself is not the highest of all nodes occupying the time slot (including all other nodes indicating that the time slot is the same as that occupied by the node in the time slot information corresponding to the node and the N-1 element).
b. One or more time slot information corresponding to the N-1 element indicates that the time slot is occupied by other nodes different from the node STI (the corresponding time slot occupation status is indicated as 10), and the priority of the node is the highest priority but not the only highest priority node (since there are only 4 priority levels, there may be multiple nodes with the same priority level) in all nodes occupying the time slot (including all other nodes indicating that the time slot corresponding to the node and the N-1 element occupies the same time slot as the node). The node may choose to send FI on its currently occupied slot + N, and in the following flow, if this occurs again, the node may send at slot p +2 × N again with probability p, and think that slot resource collision occurs with probability (1-p).
2) And the time slot resources occupied by the non-nodes are collided.
For N-1 elements in a time slot state cache table corresponding to any time slot occupied by a non-node, if two or more time slot information indicating that the time slot is occupied by two or more nodes (namely STI is different) occurs (the corresponding time slot occupation state indication is 10), the time slot resource is determined to be collided.
Detailed Description
In the embodiment of the present invention, the maintenance modes of FI of each time slot in a frame by each node may be divided into the following two types:
the first maintenance mode is as follows: and storing the FI in an accumulation mode. That is, in one frame period, a node receives FI transmitted by another node in a time slot occupied by another node, and obtains time slot state information of each time slot by analyzing the stored FI, as shown in fig. 3.
The second maintenance mode is as follows: and saving FI in an iterative mode. That is, a node only stores one vector related to the current occupied state of each timeslot, which is called a timeslot state vector (also called a timeslot state table) and is subsequently called a timeslot state vector (table), and one possible timeslot state vector (table) is shown in fig. 4, when the node receives FI sent by another node, a timeslot information unit corresponding to each timeslot in the locally stored timeslot state vector (table) is updated according to a timeslot information field corresponding to each timeslot in the newly received FI, and the timeslot information is maintained by maintaining the timeslot state vector (table). When a node needs to transmit the FI determined by the node, the FI to be transmitted is generated according to the information in the saved time slot state vector (table).
It should be noted that the above description is only provided for convenience of the following description, and other description manners may be adopted.
On the other hand, in the embodiment of the present invention, a node may occupy multiple time slot resources, and when the node occupies multiple time slot resources, to maintain the multiple time slot resources occupied by the node, time slots related to the node are divided into the following categories (specifically, see fig. 5):
1. self-occupied time slot: in the embodiment of the present invention, a time slot in which a node successfully occupies to send an FI and/or a data packet is defined as a self-occupied time slot of the node, that is: and only when the node sends the FI and/or the data packet in the corresponding time slot, the node considers the time slot as the self-occupied time slot from the time of occupying the time slot to send the FI and/or the data packet until the node releases the time slot.
Specifically, the self-occupied time slots of the nodes can be further divided into the following two types:
self-occupied main time slot: the node self-occupies a specific time slot in the time slot. Each node may determine one of the self-occupied time slots as its own primary time slot. And the node performs time slot management operation in the main time slot.
Self-occupied slave time slot: and in the self-occupied time slot, the nodes except the main time slot are in other self-occupied time slots. The node only transmits FI and/or data on the self-occupied slave time slot, and does not perform operations such as time slot management, time slot state vector (table) clearing and the like.
Of course, the nodes may not make the above distinction for the self-occupied time slots.
2. Applying for a time slot: the MAC layer compares the data quantity of the data packet of the high layer needing to be sent in the buffer queue with the transmission capacity which can be provided by the self-occupation time slot or the use time slot (including the application time slot) of the node, and applies for a new time slot if the data quantity of the data packet is larger than the transmission capacity which can be improved by the self-occupation time slot or the use time slot (including the application time slot). The application time slot can be converted into a self-occupation time slot only after the node determines to use the application time slot to send the data packet or use the application time slot to send the data packet;
based on the technical definition, the time slot resources occupied by the nodes can be divided in the following way:
1) the node uses the time slot: for convenience of subsequent description, the time slot occupied by the node and the time slot being applied by the node are collectively referred to as a node use time slot. In some specific scenarios, the time slots used by the nodes may also include only the time slots occupied by the nodes.
2) The non-node uses the time slot: all slots in the frame except the slot used by the node.
Preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
In the embodiment of the invention, when a high layer issues a data packet to a first node, corresponding sending time delay is associated for each data packet, different data packets may correspond to different sending time delays, each time the first node receives one data packet, a timer is set according to the time delay requirement of the data packet, and when the timer is over time, namely, the time reaching the maximum sending time delay, the corresponding data packet needs to be sent before the time. In this embodiment, for any one data packet, a length of time from a current time to a latest transmission time point corresponding to a transmission delay of the data packet is referred to as a transmission remaining time of the any one data packet, and obviously, the data packet in the buffer usually corresponds to different transmission remaining times, and the timer corresponding to each data packet is used to indicate the transmission remaining time of the corresponding data packet. If a packet is not successfully transmitted before the corresponding timer expires, the packet is discarded.
Referring to fig. 6, in the embodiment of the present invention, a detailed flow of the first node performing the timeslot resource collision processing is as follows:
step 600: and the first node stores the new data packet when receiving a new data packet sent by a high layer, and maintains the sending residual time of the new data packet according to the sending time delay corresponding to the new data packet.
In the embodiment of the invention, a first node receives data packets sent by a high layer in sequence according to a set sequence, and when receiving a new data packet, the first node stores the new data packet into a local MAC cache, and simultaneously, a timer associated with the new data packet is set according to the sending delay corresponding to the new data packet, and the timer maintains the sending residual time of the new data packet.
Step 610: and when the first node determines that the time slot used by the first node is collided according to the received FIs sent by other nodes, determining the set data packet in the stored data packets.
In the embodiment of the present invention, step 600 and step 610 are two independent operation processes, and are triggered by different events (step 600 is triggered by receiving a high-level data packet, and step 610 is triggered by receiving FI sent by other nodes), and the execution processes do not have a precedence relationship.
In this embodiment, the first node may perform collision judgment on the time slot used by itself by using, but not limited to, the following manners:
and a self-occupied time slot collision judgment mode: if the first node determines that the self-occupied time slot is occupied by other nodes (such as one-hop node occupation, two-hop node occupation, three-hop node occupation, and..) or is collided according to the received FIs sent by the other nodes, it is determined that the self-occupied time slot is collided.
The newly applied time slot collision judgment mode comprises the following steps: before a newly applied time slot arrives, if a first node determines that the newly applied time slot is occupied by other nodes (such as one-hop node occupation, two-hop node occupation, three-hop node occupation, and..) or is collided according to received FIs sent by other nodes, it is determined that the newly applied time slot is collided.
On the other hand, in the embodiment of the present invention, when the first node determines the specific location of the set data packet in the existing data packet, the following two ways may be adopted, but are not limited to:
the first mode is as follows: and the first node determines the data packet with the minimum sending remaining time in the MAC cache as the set data packet.
The second way is: the first node determines that the data packets with the minimum transmission remaining time in the MAC cache are the set data packets from the data packet with the minimum transmission remaining time, wherein the data packets are the (N + 1) th data packets which are arranged according to the ascending order of the transmission remaining time, and N is the number of the time slots which can be used by the first node between the current time and the first backward time slot with collision.
Step 620: and the first node judges the time slot resources of each data packet in sequence from the set data packet to the stored data packets according to the sequence of the sending remaining time from small to large, wherein when the sending remaining time corresponding to any one data packet is determined, and the number of the data packets needing to be sent is larger than the number of the time slots which are not collided and currently used by the first node, a new time slot resource is applied based on the sending remaining time of any one data packet.
In practical applications, FI may also be referred to as SI (slot information)
In the embodiment of the present invention, after the first node determines the set data packets in the first manner, the first node sequentially performs time slot resource determination on each data packet in the MAC cache from the data packet with the smallest transmission remaining time according to the ascending order of the transmission remaining time.
After the first node determines the set data packets by adopting the second mode, the first node sequentially judges the time slot resources of each data packet in the MAC cache from N +1 data packets according to the ascending sequence of the sending remaining time. This is because, starting from the packet with the minimum transmission time to the nth packet, the part of packets can be guaranteed to be transmitted through the time slot which can be used by the first node from the current time to the time slot where the collision occurs, and therefore, in order to save the calculation amount and improve the collision processing efficiency, the first node can directly start the time slot resource determination from the N +1 packets.
The slot resource determination mentioned in the above two ways means: and judging whether the number of the data packets to be sent is greater than the number of the time slots which are not collided and are currently used by the first node or not in the sending residual time corresponding to the data packets, if so, applying for a new time slot resource based on the sending residual time of the data packets, and otherwise, reading the next data packet in the MAC cache and continuing to judge the time slot resource.
On the other hand, in the embodiment of the present invention, when the first node applies for a new timeslot resource based on the remaining transmission time of any one data packet (hereinafter referred to as data packet X), a timeslot resource application interval may be determined according to the remaining transmission time of the data packet X, where the application interval includes a duration from the current time to the end of the remaining transmission time of the data packet X, and then the first node selects a suitable timeslot from the determined application interval as a new application timeslot,
for example, in the embodiment of the present invention, the first node determines, according to locally maintained timeslot status information (i.e., a locally maintained timeslot status cache table or timeslot status vector), whether there is an idle timeslot in the system from the current time to the end of the remaining time for sending the data packet X; if yes, randomly selecting a time slot in the idle time slot as a new application time slot, wherein the new application time slot is used for sending a data packet X; otherwise, three processing modes can be adopted, one mode is to discard the data packet X, the other mode is to keep placing the data packet X in the buffer and terminate the time slot application process (namely, the time slot application process caused by time slot resource determination on the data packet X) to continue to perform time slot resource determination on the next data packet, the last mode is to select a low-priority data packet which has the sending residual time lower than that of the data packet X and the priority lower than that of the data packet X from the stored data packets, and delete the selected low-priority data packet from the buffer, preferably, when a plurality of low-priority data packets which have the residual time lower than that of the data packet X and the priority lower than that of the data packet X exist, discard the data packet which has the sending residual time minimum (or maximum) from the data packet with the lowest priority. It should be noted that, in order to increase the probability of successful packet transmission, the first node may set a delay margin for the packet X. The delay margin is that when the timer length for maintaining the transmission remaining time is set according to the transmission delay of the data packet X, the first node does not set the timer length for maintaining the transmission remaining time strictly according to the length of the transmission delay requirement, but leaves a certain delay margin, and when the data packet X cannot be successfully transmitted within the initially set transmission remaining time, the timer length for maintaining the transmission remaining time is updated according to the delay margin, so that the probability that the data packet X is successfully transmitted within the time delay requirement range of the data packet X is increased. Particularly, when the priorities corresponding to different data packets are different, the sending success rate of the data packets with different priorities can be ensured by setting different time delay margins. An example of using the delay margin is: the transmission delay of the data packet X is set to 100ms, that is, the data packet X is required to be transmitted within 100ms, and the delay margin of the data packet X is determined to be 20ms according to the priority (or according to other rules) of the data packet X, then the initially set timer length for maintaining the transmission remaining time is equal to the transmission delay (100 ms) minus the delay margin (20 ms) to be 80ms (it should be noted that, here, the timer length for maintaining the transmission remaining time is set only considering the delay margin, and other margins may need to be considered in an actual system, such as a hardware processing time margin, etc., at this time, other margin values also need to be removed from the timer length for maintaining the transmission remaining time, such as a hardware processing time margin of 5ms in addition to the delay margin of 20ms, and the transmission remaining time is 75ms at this time). Assuming that no idle slot is found when a new slot resource needs to be applied within the remaining transmission time (80 ms) of the data packet X, and the delay margin of the data packet X is not 0 (20 ms), the first node updates the remaining transmission time to be 100ms according to the delay margin value (i.e., adds the delay margin value to the remaining transmission time, then sets the delay margin value to 0), and then applies for a new slot resource within the updated remaining transmission time. The setting mode of the data packet delay margin can be one-stage (i.e. the delay margin value is released at one time), or multi-stage (i.e. the delay margin value is released for multiple times), and the setting mode of the delay margin does not belong to the scope of the invention, and is not described in detail here.
Based on the above analysis, when a delay margin is set for the data packet X and the corresponding delay margin is not 0, if a new time slot resource needs to be applied for in the remaining transmission time of the data packet X but no idle time slot exists, the first node may further adopt the following processing manners in addition to the three processing manners: updating the transmission remaining time corresponding to the data packet X according to the time length indicated by the time delay margin, selecting an idle time slot as a new application time slot in an application interval determined by the updated transmission remaining time, if no idle time slot still exists in the updated transmission remaining time, discarding the data packet X, and stopping time slot resource judgment for the subsequent data packet, or reserving the data packet X, stopping the time slot application process for the data packet X, and continuing time slot resource judgment for the subsequent data packet, or selecting a low-priority data packet with the transmission remaining time smaller than the data packet X and the priority lower than the data packet X from the stored data packets, and deleting the selected low-priority data packet from the cache, preferably, when a plurality of low-priority data packets with the transmission remaining time smaller than the data packet X and the priority lower than the data packet X exist, and discarding the data packet with the shortest remaining time in the data packets with the lowest priority.
For any determined data packet, the method can be adopted to apply for a new timeslot resource, which is not described herein again. On the other hand, after selecting the newly applied time slot from the idle time slots, the first node needs to add the newly applied time slot to the application time slot list and update the newly applied time slot
The above embodiments are further described in detail below using several specific application scenarios.
The first application scenario is as follows: and the node A judges that the self-occupied time slot is collided according to the received FIs sent by other nodes, and starts to execute time slot resource judgment aiming at each data packet respectively according to the ascending sequence of the sending remaining time from the data packet with the minimum sending remaining time in the MAC cache.
Referring to fig. 7, in the embodiment of the present invention, it is assumed that the current time point is a time slot 0 of a Frame 2, one Frame includes 8 time slots, and a node a occupies three time slots in one Frame period: slot 2, slot 5, and slot 7. There are 3 data packets to be sent, namely data packet a, data packet b, and data packet c, in the current sending buffer, and each data packet is stored in the sending buffer according to the sequence from the higher layer to the MAC layer (at this time, it is not sorted according to the sending remaining time corresponding to the data packet), and the correspondence between the three data packets and the sending remaining time is specifically shown in table 1.
The time slot state vector (table) currently maintained by the node a is specifically shown in table 2, and the occupation state of each time slot in the time slot state vector (table) is defined as: 10 represents occupation by a 1-hop node; 11 represents occupation by a two-hop node; 01 denotes a collision time slot; 00 denotes an idle slot or a slot occupied by a three-hop node:
TABLE 1
Data packet identification |
a |
b |
c |
Remaining time corresponding to data packet |
6 |
3 |
8 |
TABLE 2
Slot 0 |
Slot 1 |
Slot 2 |
Slot 3 |
Slot 4 |
Slot 5 |
Slot 6 |
Slot 7 |
00 |
b:10 |
a:10 |
00 |
00 |
a:10 |
00 |
a:10 |
Then, the specific process of the node a performing the timeslot resource collision processing is as follows:
1): the FI sent by the node B is received by the node A in the time slot 1 of the Frame 2 as follows:
TABLE 3
Slot 0 |
Slot 1 |
Slot 2 |
Slot 3 |
Slot 4 |
Slot 5 |
Slot 6 |
Slot 7 |
00 |
b:10 |
a:10 |
00 |
00 |
01 |
00 |
a:10 |
2): the node a updates the self-maintained time slot state vector (table) according to the received FI transmitted by the other node, which is specifically shown in table 4:
TABLE 4
Slot 0 |
Slot 1 |
Slot 2 |
Slot 3 |
Slot 4 |
Slot 5 |
Slot 6 |
Slot 7 |
00 |
b:10 |
a:10 |
00 |
00 |
01 |
00 |
a:10 |
3): and the node A judges that the self-occupied time slot 5 collides according to the updated time slot state vector (table), and deletes the self-occupied time slot 5 from the self-occupied time slot list. Meanwhile, the node a sequentially performs time slot resource determination on each data packet in the transmission cache from the data packet with the minimum transmission remaining time according to the ascending order of the transmission remaining time corresponding to the data packet, specifically as follows:
judging whether the number of the data packets to be transmitted is less than or equal to the number of the time slot resources (including self-occupation time slots and application time slots) used by the node A in the transmission residual time indicated by the timer corresponding to the current data packet
If so, processing the next data packet in the sending cache;
otherwise, starting the process of applying for the new time slot resource, wherein the application interval of the new time slot resource is from the current time to the end of the sending residual time maintained by the timer corresponding to the current data packet.
In this embodiment, the time slot resource determination specifically includes:
the node A firstly checks the data packet b with the minimum sending remaining time, judges that the number of the data packets to be sent in the sending remaining time (namely 2 time slots) is 1 (only one data packet b exists), and is less than or equal to the current using time slot number 1 (namely one time slot 2) of the node A, so that the node A judges the time slot resource of the next data packet (namely the data packet a) with the minimum sending remaining time in the sending cache;
the node a checks the data packet a, and determines that the number of data packets to be transmitted in the remaining transmission time (i.e., 5 timeslots) is 2 (i.e., the data packet a and the data packet b), which is greater than the number 1 of currently used timeslots (i.e., one timeslot 2) of the node a, so that the node a needs to apply for a new timeslot resource in the remaining transmission time of the data packet a.
At this time, node a can know, according to the slot state vector (table) currently maintained locally (e.g., table 4), that there are currently idle slots existing in the remaining time for transmitting packet a: the method comprises the steps that a time slot 3, a time slot 4 and a time slot 6 are adopted, a node A randomly selects the time slot 3 as a new application time slot, the application time slot 3 is added into an application time slot list of the node A, and then time slot resource judgment is carried out on the next data packet (namely, the data packet c) with the minimum sending residual time in a sending cache;
the node a checks the data packet c, determines that the number of data packets to be transmitted in the remaining transmission time (i.e., 7 time slots) is 3 (i.e., the data packet a, the data packet b, and the data packet c) and is less than or equal to the number of currently used time slots 3 (i.e., the time slot 2, the time slot 5, and the time slot 7) of the node a, and since no other data packet exists in the transmission buffer, the collision processing process is finished, and then the subsequent processing is performed according to the normal data transceiving process.
It should be noted that, the timeslot state vector (table) maintained by the node a in the embodiment of the present invention may be a timeslot state vector (table) used by the node a in a normal update process, or may also be a timeslot state vector (table) maintained by the node a for timeslot resource selection (e.g., "temporary timeslot state vector (table)" or "historical timeslot state vector (table)"), and the timeslot state vector (table) used for timeslot resource selection may be obtained in various ways, which is not limited in the present invention, and may be generated by a timeslot state buffer table or by historical timeslot state information recorded by the node. The reason that the application time slot may be selected through the temporarily stored time slot state vector (table) is that in some time slot state vector (table) maintenance modes, the time slot state vector (table) maintained by the node a is periodically emptied, when the time slot state vector (table) is maintained in this mode, if the node a finds that the time slot resources used by the node a collide after the time slot state vector (table) is just emptied, at this time, because the node a cannot obtain accurate time slot occupation condition information, the application time slot selection is still performed according to the currently perceived idle time slot, so that time slots occupied by other nodes may be selected, and further, data packet transmission of the node a and other nodes is influenced.
In this case, the node may transfer or partially transfer the timeslot status information recorded in the timeslot status vector (table) into the temporary timeslot status vector (table) before the node resets the timeslot status vector (table) each time, the timeslot status information in the temporary timeslot status vector (table) may be updated according to the timeslot status indication information (or other information that can be used to determine the timeslot status) received in a new reset period and sent by other nodes or submitted by the lower layer of node a, and currently, the temporary timeslot status vector (table) may not be updated using the information, but the content in the temporary timeslot status vector (vector) table is updated according to the content in the timeslot status vector (table) only at each time of the timeslot status vector (table) reset.
When the update period of the time slot state vector (table) is relatively short, such as 100ms, and the periodic topology change of the node is not very large, the difference between the time slot state reflected in the temporary time slot state vector (table) and the time slot state updated in real time in the time slot state vector (table) is not very large, and at this time, the application requirement can be met by applying the time slot resource by using the temporary time slot state table.
The second application scenario is as follows: and the node A judges that the self-occupied time slot is collided according to the received FIs sent by other nodes, and starts to execute time slot resource judgment for each data packet respectively according to the ascending sequence of the sending remaining time from the (N + 1) th data packet set in the MAC cache.
Referring to fig. 8, in the embodiment of the present invention, it is assumed that the current time point is a time slot 0 of a Frame 2, one Frame includes 8 time slots, and a node a has three used time slots in one Frame period, where the time slot 2 and the time slot 7 are self-occupied time slots, and the time slot 5 is an application time slot. The current transmission cache has 3 data packets to be transmitted, namely a data packet a, a data packet b and a data packet c, after entering the transmission cache, the data packets are sorted from small to large according to the transmission remaining time, and the corresponding relation between the three data packets and the transmission remaining time is specifically shown in table 5.
The time slot state vector (table) currently maintained by the node a is specifically shown in table 6, and the occupation state of each time slot in the time slot state vector (table) is defined as: 10 represents occupation by a 1-hop node; 11 represents occupation by a two-hop node; 01 denotes a collision time slot; 00 denotes an idle slot or a slot occupied by a three-hop node:
TABLE 5
Data packet identification |
b |
a |
c |
Remaining time corresponding to data packet |
3 |
6 |
8 |
TABLE 6
Slot 0 |
Slot 1 |
Slot 2 |
Slot 3 |
Slot 4 |
Slot 5 |
Slot 6 |
Slot 7 |
00 |
b:10 |
a:10 |
00 |
00 |
00 |
00 |
a:10 |
Then, the specific process of the node a performing the timeslot resource collision processing is as follows:
1): the FI transmitted by the node B and received by the node a in the Frame 2 slot 1 is specifically shown in table 7:
TABLE 7
Slot 0 |
Slot 1 |
Slot 2 |
Slot 3 |
Slot 4 |
Slot 5 |
Slot 6 |
Slot 7 |
00 |
b:10 |
a:10 |
00 |
00 |
c:10 |
00 |
a:10 |
2): the node a updates the self-maintained time slot state vector (table) according to the received FI, as shown in table 8:
TABLE 8
Slot 0 |
Slot 1 |
Slot 2 |
Slot 3 |
Slot 4 |
Slot 5 |
Slot 6 |
Slot 7 |
00 |
b:10 |
a:10 |
00 |
00 |
c:10 |
00 |
a:10 |
3): and the node A judges that the time slot 5 of the application time slot is occupied by the node c according to the updated time slot state vector (table), namely collision occurs, and the node A deletes the time slot 5 of the application time slot from the application time slot list. Then, determining the number N of time slots that the node a can use between the current time and the time slot where the collision occurs (at this time, there is only one used time slot, that is, the self-occupied time slot 2, where N is 1), reading, by the node a, the N +1 (N +1 takes a value of 2) th data packet, that is, the data packet a, from the transmission buffer, after being sorted (incremented) according to the transmission remaining time, and then, starting from the data packet a, sequentially performing time slot resource determination on each data packet after the data packet a (including the data packet a) according to the transmission remaining time increment order corresponding to each data packet, which is specifically as follows:
judging whether the number of the data packets to be transmitted is less than or equal to the number of the time slot resources (including self-occupation time slots and application time slots) used by the node A in the transmission residual time indicated by the timer corresponding to the current data packet
If so, processing the next data packet in the sending cache;
otherwise, starting the process of applying for the new time slot resource, wherein the application interval of the new time slot resource is from the current time to the end of the sending residual time maintained by the timer corresponding to the current data packet.
In this embodiment, the time slot resource determination specifically includes:
the node a checks the data packet a, and determines that the number of data packets to be transmitted in the remaining transmission time (i.e., 5 slots) is 2 (i.e., the data packet a and the data packet b), which is greater than the number 1 of currently used slots (only slot 2) of the node a, so that the node a needs to apply for a new slot resource in the remaining transmission time of the data packet a.
At this time, node a can know, according to the slot state vector (table) currently maintained locally (e.g., table 8), that there are currently idle slots existing in the remaining time for transmitting packet a: the method comprises the steps that a time slot 3, a time slot 4 and a time slot 6 are adopted, a node A randomly selects the time slot 3 as a new application time slot, the application time slot 3 is added into an application time slot list of the node A, and then time slot resource judgment is carried out on the next data packet (namely the data packet c) with the minimum sending residual time in a sending cache.
The node a checks the data packet c, determines that the number of data packets to be transmitted in the remaining transmission time (i.e., 7 time slots) is 3 (i.e., the data packet a, the data packet b, and the data packet c) and is less than or equal to the number of currently used time slots 3 (i.e., the time slot 2, the time slot 5, and the time slot 7) of the node a, and since no other data packet exists in the transmission buffer, the collision processing process is finished, and then the subsequent processing is performed according to the normal data transceiving process.
Based on the above embodiments, referring to fig. 9, in an embodiment of the present invention, the first node includes a communication unit 90, a determination unit 91, and a main control unit 92, wherein,
the communication unit 90 is configured to store a new data packet every time a new data packet sent by a high layer is received, and maintain the remaining time for sending the new data packet according to the sending delay corresponding to the new data packet;
a determining unit 91, configured to determine a set data packet from stored data packets when determining that a time slot used by the determining unit collides with a received FI sent by another node;
and the main control unit 92 is configured to sequentially perform time slot resource determination on each data packet in the stored data packets in the order from the set data packet to a larger transmission remaining time, wherein when it is determined that the number of data packets to be transmitted is greater than the number of non-collided time slots currently used by the first node in the transmission remaining time corresponding to any one data packet, a new time slot resource is applied based on the transmission remaining time of any one data packet.
In summary, in the embodiment of the present invention, a timeslot collision processing method in an internet of vehicles is redesigned, and when a node determines that timeslot resources (including a self-occupied timeslot and an application timeslot) used by the node collide with each other, the timeslot resources are determined for each data packet in a transmission buffer from a set data packet according to an ascending order of transmission remaining time, and a new timeslot resource is applied based on the transmission remaining time of any data packet when it is determined that the number of data packets to be transmitted is greater than the number of timeslots which are not collided and currently used by a first node within the transmission remaining time corresponding to the data packet. Therefore, in the time division system of the Internet of vehicles, the newly applied time slot resource is determined to meet the time delay requirement of high-level data packet transmission after the time slot resource used by the node is collided, and the timely transmission of the message is ensured, so that the performance of the Internet of vehicles is effectively guaranteed.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made in the embodiments of the present invention without departing from the spirit or scope of the embodiments of the invention. Thus, if such modifications and variations of the embodiments of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to encompass such modifications and variations.