Information age optimization method and system under pure Aloha protocol in LoRa
By building a packet collision model in the LoRa network and using deep learning algorithm to dynamically select channels and spread spectrum factors, the problem of AoI optimization in the LoRa network is solved, achieving higher data transmission success rate and network anti-interference ability.
Patent Information
- Application Number
- CN202510312463.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-13
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2045-03-13
AI Technical Summary
The LoRa network has a long AoI during data transmission, especially in high-density equipment and complex environments, which affects the real-time and efficiency of the system. It is difficult for existing methods to fully adapt to dynamically changing network environments.
By building a packet collision model, calculate the probability and overlap probability of data packet selection of the same channel, and dynamically select channel and spread spectrum factors using deep learning SAC algorithm and TD3 algorithm to optimize the system's AoI.
It effectively reduces packet collisions, improves data transmission success rate and network throughput, improves the network's anti-interference ability and real-time response ability, and enhances the stability and security of the system.
Smart Images

Figure CN120166424A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of the Internet of Things, and particularly relates to a method and system for optimizing the Age of Information (AoI) of uplink packet transmission under the pure Aloha protocol in LoRa. Background Art
[0002] With the rapid development of Internet of Things technology, Low-Power Wide-Area Network (LPWAN) has become one of the key technologies to support large-scale device connections. As a mainstream solution in LPWAN, LoRa technology has been widely applied in many fields such as smart cities, agricultural monitoring, environmental monitoring, and logistics tracking due to its long-distance communication, low power consumption, and broad application prospects. However, the communication quality and timeliness issues of LoRa networks are still one of the key factors restricting their applications. Especially, the latency problem of information during data transmission directly affects the network response speed and system real-time performance.
[0003] Currently, there is little research on the AoI optimization problem of LoRa networks at home and abroad. AoI is an important indicator to measure the freshness of data in the network, representing the time delay from data generation to the receiving end receiving this data. In the Internet of Things system, low AoI usually means that the network can promptly reflect changes in the external environment and support real-time decision-making and response. However, when LoRa networks conduct data transmission, there is a certain time delay. Especially in high-density device and complex environments, it may lead to a long AoI, thus affecting the real-time performance and efficiency of the system.
[0004] Existing methods usually select channels and spreading factors (SF) through traditional greedy algorithms, traditional algorithms, etc. to reduce collisions or improve signal quality. However, these traditional methods often cannot fully adapt to the dynamically changing network environment. Therefore, how to intelligently adjust the channels and spreading factors of LoRa networks based on the dynamic network state to optimize AoI has become a research hotspot. As a technology that can adaptively optimize complex system strategies, Deep Reinforcement Learning (DRL) provides a new way to solve this problem. By training a deep reinforcement learning model, the optimal transmission strategy can be dynamically selected in the actual network environment, which can not only effectively reduce the occurrence of collisions and retransmissions, but also be adjusted in real time under changing network conditions to optimize the transmission efficiency and timeliness of information. Summary of the Invention
[0005] A method and system for optimizing the Age of Information (AoI) of uplink packet transmission under the pure Aloha protocol in LoRa, characterized by specifically including the following steps:
[0006] S1: By analyzing the performance characteristics of the overall LoRa network, it is obtained that packet collision is the main factor affecting the age of information. Using the fact that packets frequently collide under the pure Aloha protocol, three necessary conditions for packet collision are obtained, and a packet collision model is constructed.
[0007] S2: Calculate the probability that two packets are transmitted at the same rate, including the following steps:
[0008] S2-1: Calculate the rate R of the packet b , and obtain R b which is mainly determined by SF. Within the gateway range, if two terminals select the same SF when sending packets, their rates are the same;
[0009] S2-2: According to the traditional method, when packets are assigned SF according to the distance between the terminal and the gateway, calculate the probability and quantity of packets selecting the same SF within the gateway range, which are and N SF = P SF N;
[0010] S3: According to the packet collision model, calculate the probability mass function that packets select the same channel as
[0011] S4: According to the packet collision model, calculate the probability that packets overlap with each other.
[0012] S4-1: By calculating the air transmission time of the packet, the air transmission time (ToA) is important data for optimizing AoI. It is calculated that the ToA of the packet is closely related to SF. The larger the SF, the larger the ToA and the stronger the anti-interference ability. The smaller the SF, the smaller the ToA and the weaker the anti-interference ability.
[0013] S4-2: Packet overlap means that the ToA between packets overlaps. The overlap of two packets is regarded as the intersection of two Poisson processes. The probability that packets overlap with each other is Calculate the probability that the transmission time of packet i overlaps with the transmission times of the remaining packets during the transmission process as From the fact that packets still follow a Poisson distribution process with the same parameters after collision, the retransmission probability is equal to the first collision probability, that is
[0014] S5: According to the packet collision model and the calculated probability of packet collision, when the time for the terminal to exceed the sending of the ACK confirmation frame at the LoRa gateway, the packet will be retransmitted. It can be seen that packets can be divided into first transmission and retransmission, and the calculation formulas for the age of information of the first transmission and retransmission are obtained, which are AoI = T SF and AoI = T SF + T out+P 1st *T SF ;
[0015] S6: According to the packet collision model and the calculated packet collision probability in S1 - S5, the parameters affecting the final AoI of the system are SF and the channel. The SAC algorithm and TD3 algorithm of deep learning are used to allocate SF and the channel, and training is carried out to optimize the system AoI.
[0016] S6 - 1: Map the continuous actions in the SAC algorithm to discrete ones, and design the action set as A = {SF(i), C(i)}, where SF(i) is the set of SFs allocated to each terminal in the i - th time slot, and C(i) is the set of channels allocated to each terminal in the i - th time slot;
[0017] S6 - 2: Set the state set in the SAC algorithm as S = {A o (i), T a (i), A(i), EX(i), R t (i)}, where A o (i) is the set of AoIs of the latest packets sent by each terminal to the gateway in the i - th time slot, T a (i) is the set of remaining air - transmission times of the packets in the previous time slot for each terminal, A(i) is the set of actions allocated in the previous time slots of the packets, EX(i) is the entire time - slot length that the packets not transmitted completely in the i - th time slot will experience without collision, and R t (i) represents the remaining number of times of packet re - transmission;
[0018] S6 - 3: Since the purpose of AoI optimization is to make AoI as small as possible, the reward function takes the negative value of the AoI in each round, and the reward function is designed as
[0019] The beneficial effects of the present invention are as follows:
[0020] (1) By introducing deep reinforcement learning to optimize the SF selection in the LoRaWAN network, the present invention effectively reduces packet collisions, improves the data transmission success rate and network throughput. At the same time, the dynamic SF selection improves the anti - interference ability of the network, reduces communication interruptions caused by static allocation, enhances the system's resistance to malicious attacks or failures, and improves the network security.
[0021] (2) By optimizing the AoI management, the present invention reduces the delay caused by packet re - transmission, effectively improves the real - time response ability of the system. Especially in a high - density network environment, optimizing the re - transmission mechanism reduces bandwidth occupation and resource waste, while reducing the risk of packet collisions and the security hazards caused by frequent re - transmission, thereby improving the stability and security of the system.
[0022] Other advantages, objectives, and features of the present invention will be set forth to some extent in the following description, and to some extent, will be apparent to those skilled in the art based on an examination of the following, or can be learned from the practice of the present invention. The objectives and other advantages of the present invention can be achieved and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be described in detail preferably with reference to the accompanying drawings, where:
[0024] Figure 1 is a flowchart of the method in the specific embodiment of the present invention;
[0025] Figure 2 is a schematic diagram of the distance from the gateway to the terminal in the specific embodiment of the present invention
[0026] Figure 3 is the uplink data packet transmission collision process in the specific embodiment of the present invention
[0027] Figure 4 is the data packet transmission and retransmission process in the specific embodiment of the present invention
[0028] Figure 5 is the data packet transmission situation of each terminal in the specific embodiment of the present invention SPECIFIC EMBODIMENTS
[0029] The following illustrates the embodiments of the present invention through specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. The technical solutions of the present invention will be further introduced below in combination with the specific embodiments and the accompanying drawings.
[0030] The present invention proposes a method and system for optimizing the AoI of uplink data packet transmission under the pure Aloha protocol in LoRa. Please refer to Figure 1 as shown, the specific method process is described as follows:
[0031] Step 1: The characteristic of the LoRaWAN is that the terminal uses the Aloha protocol to broadcast uplink data to the surrounding gateways. As long as the gateway within the transmission range of the terminal may receive the data packet. In this embodiment, it is obtained that there are two conditions for data packet collision to occur in the transmission diagram: two data packets must be transmitted at the same rate, transmitted on the same channel, and the transmission durations overlap with each other.
[0032] It should be noted that, for the ease of analysis, in this embodiment, all terminal devices are evenly distributed around a gateway device. Each terminal device generates data packets according to a Poisson process with parameter λ. There are a total of N terminal devices. Assume that the data packets are transmitted under the channel conditions of a fixed bandwidth and coding rate.
[0033] Step 2: Calculate the probability that two data packets are transmitted at the same rate, including the following steps:
[0034] Step 2-1: The same rate means that the data packets in the gateway transmit data at the same rate at the same time, and the rate is R b The calculation formula is where SF is a very important parameter in the LoRa network. Different SF values determine the number of original bits carried by a symbol, and its value range is 7 to 12. The bandwidth (BW) has three values: 125, 250, and 500 kHz, and the coding rate According to the formula, it can be obtained that if the data packets are to be transmitted at the same rate, when the bandwidth and coding rate are fixed, two data packets with the same SF have the same rate;
[0035] Step 2-2: Calculate the probability of the same SF in the gateway.
[0036] It should be noted that in the traditional method, the SF of the data packets is allocated according to the distance between the terminal and the gateway. The data packets sent between different terminals are independent. Referring to Figure 2 the position diagrams of the gateway and the terminal in, it can be obtained therefrom that when the distance from the terminal to the gateway is 0 < r ≤ r7, SF = 7 is assigned to the terminal; when the distance is r7 < r ≤ r8, the SF of the terminal is 8, and so on. It is stipulated that the distance of the terminal around the gateway does not exceed r6;
[0037] Then the probabilities and numbers of terminals selecting SF are respectively and N SF = P SF N;
[0038] Furthermore, according to the data packet rate R calculated in Step 2-1 b , the same spreading factor has the same data rate. However, this method of statically allocating SF will cause serious conflicts among the nodes that are relatively close. Therefore, in the present invention, the SF will be randomly selected through deep reinforcement learning to reduce the conflicts caused by the distance.
[0039] Step 3: According to the data packet collision model, calculate the probability that the data packets select the same channel. The channel is the channel selected by the terminal in the gateway for transmission. It should be noted that in this embodiment, all channel states are the same, and the number of main channels is M, which are {C1, C2,..., CM}, and the probability that each terminal selects a channel is 1 / M. Each terminal can only select one channel, and a channel can accommodate data packets sent by multiple terminals. Then the event that a terminal selects a channel can be modeled as a multinomial distribution;
[0040] Furthermore, let c i be defined as the number of terminals that select channel C i , where i = 1, 2, …, M. Then c1 + c2 + ··· + c M = N; the probability mass function of the multinomial distribution is Simplifying and summarizing, we get
[0041] Step 4: According to the data packet collision model, calculate the probability of overlap between data packets.
[0042] Step 4-1: By calculating the air transmission time of the data packet, the air transmission time (ToA) is the time that the data packet spends in the wireless medium, and the calculation formula is ToA = T preamble + T payload , where T preamble is the duration of the preamble, and the calculation formula is T preamble = (n preamble + 4.25) * T s , T payload is the duration of the payload, and the calculation formula is T payload = n payload * T s , n preamble is the number of preamble symbols, and the calculation formula is where T s is the symbol duration, and the calculation formula is
[0043] It should be noted that PL is the payload length, SF is the spreading factor, and its value range is 6 - 12. Since 6 is specifically used for high-speed communication and is not applicable in most cases, the value range of the spreading factor selected in the present invention is 7 - 12. CRC represents whether cyclic redundancy check is enabled, CRC = 1 represents enabled, and vice versa. H represents whether implicit header mode is used, H = 1 represents enabled, and vice versa. DE represents whether low-rate optimization is enabled, DE = 1 represents enabled, and vice versa. CR is the coding rate, and its value is {1, 2, 3, 4}. Its purpose is to improve the reliability of data transmission by adding additional check bits to allow a certain number of errors to be corrected at the receiving end.
[0044] It should be noted that LoRa uses chirp spread spectrum modulation technology for transmission. Each symbol is spread by a linear frequency modulation code with a length of 2 SF . The symbol time refers to the time length occupied by these linear frequency modulation codes in the air, which is mainly determined by the bandwidth and the spreading factor. The larger the spreading factor, the more information each symbol carries, and the longer the symbol duration. This can improve the communication distance and anti-interference ability, but will reduce the data transmission rate. The narrower the bandwidth, the longer the transmission time of each symbol, but the signal stability can be maintained at a farther distance. In LoRa communication, the bandwidth can be 125 kHz, 250 kHz or 500 kHz.
[0045] As an important data for optimizing AoI, the calculated ToA of the data packet is closely related to SF. The larger SF, the larger ToA and the stronger anti-interference ability; the smaller SF, the smaller ToA and the weaker anti-interference ability.
[0046] Step 4-2: The overlap of the data packets means that the ToA between the occurrences of the data packets overlaps. The overlap of two data packets is regarded as the intersection of two Poisson processes.
[0047] It should be noted that in the Class A transmission mode, the behaviors of different terminals sending data packets follow Poisson distribution processes with different parameters. The data packets transmitted between terminals are independent of each other. The probability of having k data packets arriving within a unit time is where k = 0, 1, 2... λ > 0.
[0048] Furthermore, referring to Figure 3 for the example diagram of data packet collision, where T SF is the air transmission time of the uplink data packet transmitted with the same SF, and t is the time interval of the overlap between data packets. For the case where two data packets overlap, it can be regarded as the intersection of two Poisson processes, that is, the time interval between the two data packets is less than or equal to T SF . Therefore, the probability of overlap between two uplink data packets is P(0, λ i T SF ) represents the probability that no data packet arrives at terminal i within the time interval T SF . Similarly, for P(0, λ j T SF ), substituting the probability of having k data packets arriving within a unit time into the calculation, the overlap probability of the data packets is obtained as
[0049] It should be noted that under the condition of the same rate and the same channel, the number of terminals within the gateway range is α. The probability that the transmission time of data packet i overlaps with that of the remaining data packets during the transmission process is Then the probability of the first transmission collision is α is the number of terminals with the same rate and channel. After the data packet collides, it still follows a Poisson distribution process with the same parameters. Then the probability of the retransmitted data packet colliding is the same as the probability of the first transmission collision, that is, P Re = P 1st , where P Re is the probability of collision during retransmission.
[0050] Step 5: According to the collision model of the data packet and the calculated probability of the data packet collision, when the LoRa gateway exceeds the time to send the ACK confirmation frame, the terminal will retransmit the data packet. It can be seen that the data packet can be divided into the first transmission and retransmission.
[0051] It should be noted that if a collision occurs during the data packet transmission process, the gateway will not send an ACK confirmation data frame to the terminal. After exceeding the time T out that the terminal waits for the ACK confirmation data frame, the terminal will immediately retransmit the data frame. For details, please refer to Figure 4 the data packet transmission and retransmission process in. Then the age of information can be divided into two parts, the age of information when the data packet is successfully transmitted for the first time and the age of information when the data packet is successfully retransmitted. Therefore, the calculation formula for the age of information is
[0052] Furthermore, according to the calculation formula of the age of information and referring to Figure 4 the data packet transmission situation among terminals, each terminal generates data packets according to a Poisson distribution with intensity λ. For the convenience of deep reinforcement learning algorithm training, the time is divided according to the time slot T sl to perform segmentation. Each time slot is a step, and the corresponding SF and channel are allocated at the beginning of each time slot. As Figure 3 in, after the data packet 1 is generated by the terminal 1, the terminal 1 immediately transmits the data packet. Before the data packet transmission is completed, the data packet 2 is generated. The data packet 2 is discarded and the data packet 1 is continued to be transmitted until completion. It is stipulated that when two terminals select the same SF and channel and the data packets overlap, the data packets collide. For example, in the figure, the terminal 2 and the terminal 4 select the same channel in the time slot 3, then the data packet 9 and the data packet 5 collide. If the system stipulates that retransmission of data packets is allowed, then the data packet 9 and the data packet 5 start to calculate T out at the end of the time slot 3, for example, if T out = T sl , then the data packet 9 and the data packet 5 will be transmitted at the beginning of the time slot 5.
[0053] Accordingly, the optimization of the age of information can be decoupled into the selection of SF and channel. In this embodiment, the SAC and TD algorithms are used to dynamically select SF and channel to optimize the AoI.
[0054] Step 6: According to the packet collision model and the calculated packet collision probability in S1 - S5, the parameters affecting the final AoI of the system are SF and the channel. Use the SAC algorithm and TD3 algorithm of deep learning to allocate SF and the channel, and train to optimize the system AoI.
[0055] Step 6 - 1: It should be noted that the actions of deep learning are the SF and the channel that the terminal needs to select each time. Map the continuous actions in the SAC algorithm to discrete ones. Let the action set of deep reinforcement learning be A = {SF(i), C(i)}, where SF(i) is the set of SFs allocated to each terminal in the i - th time slot, SF(i) = {SF1(i), SF2(i)…SF n (i)}; C(i) is the set of channels allocated to each terminal in the i - th time slot, C(i) = {C1(i), C2(i)…C n (i)}.
[0056] Step 6 - 2: Let the state set be S = {A o (i), T a (i), A(i), EX(i), R t (i)}, where A o (i) is the set of AoIs of the latest packets sent by each terminal to the gateway in the i - th time slot, T a (i) is the set of remaining air - transmission times of the packets in the previous time slot for each terminal. If the packet is not transmitted completely in the i - th time slot, is the remaining air - transmission time of the j - th terminal before. If the packet of the j - th terminal has been transmitted completely before, then is 0; A(i) is the set of actions allocated to the packet in the previous time slot. If the packet in the previous time slot is still being transmitted in the i - th time slot, then A j (i) is the action allocated to the j - th terminal before; EX(i) is the entire time - slot length that the packet not transmitted completely in the i - th time slot will experience without collision; R t (i) represents the remaining number of packet re - transmissions. For the convenience of calculation, flatten the state into a one - dimensional vector, then the state S is a one - dimensional array with a length of 4N.
[0057] Step 6 - 3: According to the AoI optimization goal of minimizing the AoI as much as possible, the reward function should be the negative value of the average AoI of the entire LoRa network after each step. Design the reward function as
[0058] Although embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of the present invention, and the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method and system for optimizing information age under the pure Aloha protocol in LoRa, characterized in that: The method specifically comprises the following steps: S1: By analyzing the performance characteristics of the overall LoRa network, it is found that packet collision is the main factor affecting the information age. Using the frequent collisions of packets under the pure Aloha protocol, three necessary conditions for packet collisions are obtained, and a packet collision model is constructed; S2: Calculate the probability that two data packets are transmitted at the same rate; S3: According to the packet collision model, the probability mass function of packets selecting the same channel is calculated as follows: S4: According to the data packet collision model, the probability of overlap between data packets is calculated. S5: According to the collision model of data packets and the calculated probability of data packet collision, the terminal will resend the data packet when the LoRa gateway exceeds the time to send the ACK confirmation frame. It can be seen that the data packet can be divided into the first transmission and the retransmission. The calculation formulas for the first transmission and retransmission of the information age are obtained, which are AoI=T SF and AoI = T SF +T out +P 1st *T SF ; S6: According to the packet collision model in S1 to S5 and the calculated packet collision probability, the parameters that affect the final AoI of the system are SF and channel. The SAC algorithm and TD3 algorithm of deep learning are used to allocate SF and channel, and train to optimize the system AoI.
2. The information age optimization method and system under the pure Aloha protocol in LoRa according to claim 1, characterized in that: In step S1, by analyzing the performance characteristics of the overall LoRa network, three necessary conditions for data packet collision under the pure Aloha protocol are obtained, and a data packet collision model is constructed accordingly.
3. The method and system for optimizing information age under the pure Aloha protocol in LoRa according to claim 1, characterized in that: In step S2, the transmission probability between two data packets is calculated, and in step S3, the probability mass function of the data packets selecting the same channel is calculated. In step S4, the probability of overlap between data packets is calculated, and the probability of collision between data packets is obtained comprehensively. Finally, in step S5, the calculation formula for the first retransmission and retransmission of the information age is obtained based on the collision model and the collision probability.
4. The method and system for optimizing information age under the pure Aloha protocol in LoRa according to claim 1, characterized in that: In step S6, the SAC algorithm and TD3 algorithm of deep reinforcement learning are used to allocate SF and channels according to the theoretical calculation in S5 to optimize the overall system AoI.
Citation Information
Patent Citations
Information age minimization method and system for concealed transmission system of Internet of Things
CN114786174A
Polarization code incremental redundancy hybrid automatic repeat request-based information age optimization method
CN116094656A
Multi-cluster live video system scheduling method combining data value and information age
CN116156654A
Wireless monitoring network scheduling method and system based on dynamic reduction strategy space
CN116456372A
Apparatus, and associated method, for selecting retransmission of packet data
US6317854B1