Communication optimal path selection method and device for ad hoc network relay and medium

By constructing the probability spatial information between the device and the relay and the relay, calculating the connection probability and path efficiency ratio of the path, determining the shortest path for data transmission, the problem of poor path selection in the relay communication of the ad hoc network is solved, and the communication quality and data transmission efficiency are improved.

CN120151981APending Publication Date: 2025-06-13GUANGXI NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510379197.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-28
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

The prior art fails to fully consider the connection uncertainty between the device and the relay, the relay and the relay in the ad hoc network relay communication, resulting in the selected paths that may be inoptimal and affect the communication quality.

Method used

By recording the information and communication time between the device and the relay, the probability spatial information of the device on the relay is constructed; the relay information and communication time between the relay is recorded, the probability spatial information between the relay is constructed; multiple paths between the sending device and the receiving device are listed, the connection probability and path efficiency ratio of each path are calculated, and the shortest path is determined for data frame transmission.

Benefits of technology

It effectively solves the communication problem in complex environments, and even in scenarios where the base station signal cannot be covered, communication between the transmitting device and the receiving device can be realized, improving the efficiency and reliability of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120151981A_ABST
    Figure CN120151981A_ABST
Patent Text Reader

Abstract

The invention provides a communication optimal path selection method and device for an ad hoc network relay and a medium, and relates to the technical field of emergency communication. The method comprises the following steps: firstly, recording information and communication time of equipment connected with the relay, and constructing probability space information of the equipment on the relay; meanwhile, recording relay information and communication time to construct relay probability space information; listing a plurality of paths passing through the relay node between the sending device and the receiving device, and calculating the connection probability of each path according to the probability space information; and finally, calculating a path performance ratio according to the path connection probability and the number of nodes, and determining a shortest path for data frame transmission. According to the invention, the communication problem in complex environments such as caves can be solved, communication between devices can be realized when base station signals cannot be covered, the data transmission efficiency and reliability can be improved, and rapid and accurate transmission of data frames can be ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention mainly relates to the technical field of emergency communication, and particularly relates to a method, device and medium for selecting the optimal communication path of self-organizing network relay. Background Art

[0002] In the field of emergency communication, the importance of self-organizing network relay communication is becoming increasingly prominent. Especially in complex environments such as rock caves, due to their complex geological structures and special spatial environments, it is difficult for traditional base station signals to achieve effective coverage. This makes the conventional communication means relying on base stations unable to work properly, resulting in communication blockages and seriously affecting the transmission of information.

[0003] When the existing technology determines the communication path between a sending device and a receiving device, it often fails to fully consider the uncertainty of the connections between devices and relays, and between relays and relays. It simply selects a path based on distance or a fixed network topology, ignoring the key factor of communication connection probability. This leads to the selected path may not be optimal, and in the actual communication process, the stability and efficiency of data transmission are low, and problems such as data loss and delay are likely to occur. For example, in a self-organizing network, some relay nodes may have a low connection probability with other nodes due to signal interference or equipment failures, etc., but the existing path selection methods may still select paths including these relay nodes, thus affecting the communication quality. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a method, device and medium for selecting the optimal communication path of self-organizing network relay in view of the deficiencies of the existing technology.

[0005] The technical solution of the present invention to solve the above technical problem is as follows: A method for selecting the optimal communication path of self-organizing network relay includes the following steps:

[0006] S1. Record the device information of the devices connected to the relay and their communication times, and construct the probability space information of the devices on the relay according to the device information and their communication times, where the devices include the sending device and the receiving device;

[0007] S2. Record the relay information between relays and their communication times, and construct the probability space information between relays according to the relay information between relays and their communication times;

[0008] S3. List multiple paths passing through relay nodes between the sending device and the receiving device, and calculate the connection probabilities of each path according to the probability space information of the devices on the relay and the probability space information between relays;

[0009] S4. Calculate the path efficiency ratio based on the connection probabilities of each path and the number of nodes in each path, determine the shortest path according to the path efficiency ratios of all paths, and transmit the data frame based on the shortest path.

[0010] Another technical solution for the present invention to solve the above technical problems is as follows: A communication optimal path selection device for self-organizing network relay, comprising:

[0011] A device and relay probability space construction module, configured to record the device information of the devices connected to the relay and their communication times, and construct the probability space information of the devices on the relay according to the device information and their communication times, where the devices include a sending device and a receiving device;

[0012] A relay - to - relay probability space construction module, configured to record the relay information between relays and their communication times, and construct the probability space information between relays according to the relay information between relays and their communication times;

[0013] A connection probability calculation module, configured to list multiple paths passing through relay nodes between the sending device and the receiving device, and calculate the connection probabilities of each path respectively according to the probability space information of the devices on the relay and the probability space information between relays;

[0014] A shortest path determination module, configured to calculate the path efficiency ratio based on the connection probabilities of each path and the number of nodes in each path, determine the shortest path according to the path efficiency ratios of all paths, and transmit the data frame based on the shortest path.

[0015] Another technical solution for the present invention to solve the above technical problems is as follows: A communication optimal path selection device for LoRa self - organizing network relay, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the communication optimal path selection method for LoRa self - organizing network relay as described above is implemented.

[0016] Another technical solution for the present invention to solve the above technical problems is as follows: A computer - readable storage medium stores a computer program, and when the computer program is executed by a processor, the communication optimal path selection method for LoRa self - organizing network relay as described above is implemented.

[0017] The beneficial effects of the present invention are as follows: By constructing the probability space information of the device on the relay and the probability space information between relays, the communication problem in complex environments such as rock caves can be effectively solved. Even in scenarios where the base station signal cannot cover, communication between the sending device and the receiving device can be achieved. By listing multiple paths and calculating the connection probability and path efficiency ratio of each path, the shortest path can be determined, thereby improving the efficiency and reliability of data transmission and ensuring that data frames can be transmitted quickly and accurately. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 It is a schematic flowchart of a communication optimal path selection method provided by an embodiment of the present invention;

[0019] Figure 2 It is a schematic structural diagram of a LoRa ad-hoc network provided by an embodiment of the present invention;

[0020] Figure 3 It is a time series diagram of the connection between a device and a relay provided by an embodiment of the present invention;

[0021] Figure 4 It is a time series diagram of the connection between relays provided by an embodiment of the present invention;

[0022] Figure 5 It is a relationship diagram between the data link layer and the network layer provided by an embodiment of the present invention;

[0023] Figure 6 It is a schematic diagram of a data frame provided by an embodiment of the present invention;

[0024] Figure 7 It is a schematic diagram of the functional modules of a communication optimal path selection device provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0025] The principles and features of the present invention will be described below with reference to the accompanying drawings. The examples given are only for explaining the present invention and are not intended to limit the scope of the present invention.

[0026] An embodiment of the present invention provides a communication optimal path selection method, device, and medium for an ad-hoc network relay, enabling two or more source nodes to perform low-power, long-distance communication through a single or multiple relay nodes. The present invention can not only achieve timely and effective connection of nodes in a LoRa ad-hoc network, ensure communication between the source node and the destination node in a rock cave environment, but also greatly simplify the IP protocol and realize simple and efficient transmission of data packets in the ad-hoc network. The following will be described in detail through specific embodiments.

[0027] Embodiment 1: As Figure 1 shown, an embodiment of the present invention provides a communication optimal path selection method for an ad-hoc network relay, including the following steps:

[0028] S1. Record the device information of the relay-connected devices and their communication times, and construct the probability space information of the devices on the relay according to the device information and their communication times. The devices include sending devices and receiving devices;

[0029] S2. Record the relay information between relays and their communication times, and construct the probability space information between relays according to the relay information between relays and their communication times;

[0030] S3. List multiple paths passing through relay nodes between the sending device and the receiving device, and calculate the connection probabilities of each path respectively according to the probability space information of the devices on the relay and the probability space information between relays;

[0031] S4. Calculate the path efficiency ratio according to the connection probability of each path and the number of nodes of each path, determine the shortest path according to the path efficiency ratios of all paths, and transmit the data frame based on the shortest path.

[0032] In this embodiment, by constructing the probability space information of the devices on the relay and the probability space information between relays, the communication problem in complex environments such as rock caves can be effectively solved. Even in scenarios where the base station signal cannot cover, the communication between the sending device and the receiving device can be realized.

[0033] By listing multiple paths and calculating the connection probability and path efficiency ratio of each path, the shortest path can be determined, thereby improving the efficiency and reliability of data transmission and ensuring that the data frame can be transmitted quickly and accurately.

[0034] This method is applicable to LoRa ad-hoc networks. The LoRa technology has the characteristics of low power consumption and long-distance communication, enabling it to operate stably in special environments such as rock caves, and this method can be dynamically adjusted according to different network topologies, with strong adaptability.

[0035] Preferably, in the step S1, constructing the probability space information of the devices on the relay according to the device information and their communication times includes:

[0036] Obtain the corresponding device codes and their connection times n at different times from the device information of multiple devices E n connected to the relay R k , and aggregate each device code to obtain the device code set U i ; kn ;

[0037] Statistically obtain the total device connection time N by the communication times of the devices connected to the relay R n , and divide the connection times n corresponding to the device code set U i by the total device connection time N kn to obtain the probability p of each device code in the device code set Ui Total connection time N with the device i Perform ratio calculation to obtain the communication connection probability corresponding to each device code, through the device code set U kn Construct the probability space information of the device on the relay R based on the device code set U n and the communication connection probability corresponding to each device code

[0038] LoRa (Long-Range) technology is a wireless communication technology designed specifically for the low-power wide-area network (LPWAN) communication field. The core of its technology lies in spread-spectrum modulation, and its significant feature is that it can achieve long-distance communication while maintaining a low energy consumption level. Compared with traditional wireless communication technologies such as WiFi, Bluetooth, and ZigBee, LoRa can achieve effective data transmission at a longer spatial distance in terms of data transmission range. In the complex and changeable cave environment, due to the uniqueness of the geological structure and spatial limitations, traditional communication infrastructure construction solutions such as building mine cave base stations are unrealistic. Even with the existing wireless communication technologies currently available, the complex geomorphic features inside the cave are difficult to meet the actual requirements of efficient and economical communication.

[0039] As Figure 2 shown below, taking the LoRa ad-hoc network structure as an example, it can be applied to the cave communication environment. R1, R2, and R3 are simulated relay nodes, and Es1, Es2, Es3... Esn are sending devices, while Er1, Er2, Er3... Ern are receiving devices.

[0040] Record and update the time series and communication status of each device in the relay node in real time, calculate the communication connection probability of the device on the relay in the complete probability space, and determine the relay node accessed by the device.

[0041] The time series of each device (sending device and receiving device) on the relay node R1 is as Figure 3 shown.

[0042] Construct a device code set, as shown in Table 1. Table 1 is the device-relay communication access table.

[0043] Table 1:

[0044]

[0045] Table 2 is the probability space P1 information. As shown in Table 2, construct the probability space information of the device on the relay R based on the device code set and the communication connection probability corresponding to each device code. n on the relay R

[0046] Table 2:

[0047]

[0048] Among them, {a 1 , a 2 , a 3 ,... a i} represents the set of time series of device communications on the R1 relay node, {b 1 , b 2 , b 3 ,... b i} represents the set of time series of device communications on the R2 relay node, {c 1 , c 2 , c 3 ,... c i} represents the set of time series of device communications on the R3 relay node; in the probability space P1, {P k1 , P k2 , P k3} represents the communication connection probabilities of device E k on the R1, R2, and R3 relay nodes.

[0049] Set of R1 device codes: A = {a 1 , a 2 , a 3 ..., a i-1 , a i}, a total of i devices (transmitting or receiving devices), N moments;

[0050] If the corresponding devices E 1 , E 2 ..., E k appear in set A n 1 , n 2 ,..., n i times respectively, where E k includes transmitting and receiving devices, Es1, Es2, Es3…Esn are transmitting devices, and Er1, Er2, Er3…Ern are receiving devices.

[0051] Then the probability subspace

[0052]

[0053] In the formula, A k1 = {A 11 , A 21 , A 31 ..., A k1} represents the set of devices with communication connections on the R1 relay node, represents the communication connection probability of device A k1 on the R1 relay node.

[0054] Similarly, it can be obtained that: probability subspace

[0055]

[0056] Probability subspace

[0057]

[0058] In the formula, B k2 ={B 12 , B 22 , B 32 ..., B k2} represents the set of devices communicatively connected to the relay node R2, represents the communication connection probability of device B k2 on the R2 relay node; C k3 ={C 13 , C 23 , C 33 ..., C k3} represents the set of devices communicatively connected to the R3 relay node, represents the communication connection probability of device C k3 on the R3 relay node.

[0059] In the above embodiments, by obtaining the device code and its connection times from the device information of multiple devices connected to the relay, and combining the total connection time of the devices to calculate the communication connection probability, the probability space information of the devices on the relay can be accurately constructed, providing a more accurate basis for subsequent path selection.

[0060] The combination of the device code set and the communication connection probability can more accurately determine the relay node accessed by the device, reduce the possibility of incorrect device access, and improve the communication efficiency and stability of the entire network.

[0061] By recording and updating the time series and communication status of each device in the relay node in real time, the communication connection probability of the device on the relay can be calculated in the complete probability space, further enhancing the reliability and adaptability of the network, enabling it to better cope with complex communication environments.

[0062] Preferably, in S2, constructing the probability space information between relays according to the relay information between relays and their communication times includes:

[0063] Obtaining the corresponding relay code and its connection times n n at different times from the relay information of each relay connected to relay R j , and aggregating each relay code to obtain the relay code set U qn ;

[0064] Statistical communication times of the devices connected to relay R n to obtain the total relay connection time Nj , the set U of relay codes kn The corresponding connection times n j And the total connection time N of the relay j Perform ratio calculation to obtain the communication connection probability corresponding to each relay code. Through the set U of relay codes qn And the communication connection probabilities corresponding to each relay code, construct the probability space information between relays.

[0065] Similar to the device-relay communication access table, construct a set of relay codes, which is used to reflect the potential communication connections between relay nodes. By recording and updating the time series between relays, use the probability space P2 to characterize the probability space of one relay on another relay, and the feasibility of each communication path can be evaluated

[0066] Taking the LoRa ad-hoc network structure as an example below, R1, R2, and R3 are simulated relay nodes.

[0067] Record and update the time series and communication status of each device in the relay nodes in real time, calculate the communication connection probability of the device on the relay in the complete probability space, and determine the relay node accessed by the device.

[0068] The time series of the connection between relay node R1 and other relays is as Figure 4 shown.

[0069] Construct a set of relay codes, as shown in Table 3, and Table 3 is the relay-relay communication access table.

[0070] Table 3:

[0071]

[0072]

[0073] Table 4 is the information of the probability space P2. As shown in Table 4, the probability space information between relays is constructed through the set of relay codes and the communication connection probabilities corresponding to each relay code.

[0074] Table 4:

[0075]

[0076] Among them, {x 1 , x 2 , x 3 ,... x j} represents the set of time series of the relays connected to the R1 relay node, and {y 1 , y 2 , y 3 ,.. y j} represents the set of time series of the relays connected to the R2 relay node, and {z1 , z 2 , z 3 ,..z j}, which represents the set of time series of connections to relays on node R3; in the probability space P2, {P q1 , P q2 , P q3}, which represents the communication connection probabilities of device F q on relays R1, R2, and R3.

[0077] Set of device codes for R1: X = {x 1 , x 2 , x 3 ..., x j-1 , x j}, a total of j devices at M moments;

[0078] If the corresponding devices F 1 , F 2 ..., F k appear in set A n' 1 , n' 2 ...n' j times respectively,

[0079] then the probability subspace

[0080]

[0081] In the formula, X q1 = {X 11 , X 21 , X 31 .., X q1}, which represents the set of relays with communication connections on relay R1, represents the communication connection probability of relay X q1 on relay R1.

[0082] Similarly, it can be obtained that: the probability subspace

[0083]

[0084] The probability subspace

[0085]

[0086] In the formula, Y q2 = {Y 12 , Y 22 , Y 32 .., Y q2}, which represents the set of relays with communication connections on relay R2, represents the communication connection probability of relay B k2 on relay R2; Z q3= {Z 13 , Z 23 , Z 33 ..., Z q3} represents the set of relays connected by communication on relay R3. represents relay C k3 The probability of communication connection on relay R3.

[0087] In the above embodiments, by constructing the relay code set and the communication connection probability, the probability space information between relays can be accurately constructed, thereby optimizing the communication connection between relay nodes and improving the communication efficiency and reliability between relay nodes.

[0088] The probability space information between relays can more accurately reflect the communication connection situation between each relay node, provide a more accurate evaluation basis for path selection, help select a better communication path, and reduce the delay and packet loss phenomena in the data transmission process.

[0089] This method can record and update the time series and communication status between relay nodes in real time, enabling it to dynamically adapt to changes in the network topology, improve the flexibility and adaptability of the network, and better handle complex network environments.

[0090] Preferably, in S3, list multiple paths passing through relay nodes between the sending device and the receiving device, and calculate the connection probability of each path according to the probability space information of the device on the relay and the probability space information between relays, including:

[0091] List multiple paths passing through relay nodes between the sending device and the receiving device, and the paths include multiple segments of communication links;

[0092] Respectively obtain the communication connection probabilities corresponding to each communication link in the same path from the probability space information of the device on the relay and the probability space information between relays, and perform a product calculation on the communication connection probabilities in the same path to obtain the connection probability corresponding to the same path. Through this process, calculate the connection probabilities corresponding to each path.

[0093] For example, if the sending device is E sk , and the receiving device is E rk , simulate that relays R1, R2, and R3 form a relay ad-hoc network. Taking the sending device accessing relay R1 as an example, forward the data frame through each relay node (at this time, the judgment field in the frame header is 0x01, and the optimal path calculated below is used for transmission, and the transmission between nodes is point-to-point) to the receiving device, and list the reachable path sorting as:

[0094] Path 1: E sk Sends out the data frame with P(a k1) The communication probability reaches R1 and then reaches E with probability P(a k1 ) rk , that is, E sk →R1→E rk ;

[0095] Path two: E sk Sends a data frame and reaches R1 with probability P(a k1 ), then reaches R2 with probability P(x 21 ), and finally reaches E with probability P(b k2 ) rk , that is, E sk →R1→R2→E rk ;

[0096] Path three: E sk Sends a data frame and reaches R1 with probability P(a k1 ), then reaches R3 with probability P(x 31 ), and finally reaches E with probability P(c k3 ) rk , that is, E sk →R1→R3→E rk ;

[0097] Path four: E sk Sends a data frame and reaches R1 with probability P(a k1 ), first reaches R2 with probability P(x 21 ), then reaches R3 with probability P(y 32 ), and finally reaches E with probability P(c k3 ) rk , that is, E sk →R1→R2→R3→E rk ;

[0098] Path five: E sk Sends a data frame with probability P(a k1 ) and reaches R1, first reaches R3 with probability P(x 31 ), then reaches R2 with probability P(z 23 ), and finally reaches E with probability P(b k2 ) rk , that is, E sk →R1→R3→R2→E rk ;

[0099] According to the probability space calculated in the first and second steps, calculate the probability of each segment of communication on each path. For example, the probability of path one is the communication probability between device E sk and R1 plus the communication probability between R1 and Erk The communication probability between; the probability of Path 2 is the communication probability between Es1 and R1 multiplied by the communication probability between R1 and R2, and then multiplied by the communication probability between R2 and Er1, and so on;

[0100] where the connection between the device and the relay point, and between the relay and the relay node has a certain probability

[0101] According to the above formula, respectively represent the communication probabilities of the devices connected to the relays R1, R2, and R3, respectively represent the communication probabilities between relay R1 and relays R2 and R3, represents the communication probability between relay R2 and relay R3, represents the communication probability between relay R3 and relay R2.

[0102] In the above embodiments, by listing multiple paths and calculating the connection probabilities of each path respectively, the optimal path can be determined quickly and accurately, improving the efficiency and accuracy of path selection and reducing the computational complexity in the path selection process.

[0103] Multiplying the communication connection probabilities of each communication in the same path to obtain the connection probability corresponding to the same path can more accurately evaluate the communication quality of each path, so as to select the path with the highest connection probability for data transmission, optimize the data transmission path, and improve the efficiency and reliability of data transmission.

[0104] This method can comprehensively consider the probability space information of the device on the relay and the probability space information between the relays, comprehensively evaluate the communication performance of each path, so as to select the optimal path, enhance the performance of the entire network, and improve the throughput and response speed of the network.

[0105] Preferably, in S4, calculate the path efficiency ratio according to the connection probabilities of each path and the number of nodes of each path, and determine the shortest path according to the path efficiency ratios of all paths, and perform data frame transmission based on the shortest path, including:

[0106] Assume that s is the number of communication connection probabilities between adjacent nodes obtained on the path, r is the lower limit of summation, s + 1 is the number of nodes on the path, calculate the logarithm of the connection probability of the path, then take the absolute value of the logarithm, and calculate the path efficiency ratio according to the path efficiency ratio formula and the logarithm-calculated connection probability of the path and the number of nodes of the path. The path efficiency ratio formula is:

[0107]

[0108] where w represents the path efficiency ratio, and i, j represent adjacent nodes in the same path;

[0109] Table 5 is a table of path efficiency ratios. As shown in Table 5, the corresponding relationship between paths and efficiency is given.

[0110] Table 5:

[0111]

[0112] Finally, the maximum value is selected from the path efficiency ratios w of all paths, and data frames are transmitted based on the shortest path.

[0113] As Figure 5 shown, before the process of data transmission, it is also necessary to define data frames. This process is carried out in the data link layer, and the process of determining the shortest path is carried out in the network layer:

[0114] In the data link layer, first, data frames are defined. Data frames are the basic units of data transmission. After the data transmission and forwarding are processed in the network layer, the data frames are processed by the frame format recovery unit to ensure that the data frames are restored to the appropriate format.

[0115] In the network layer, first, a device-relay access table is constructed, and the probability space P1 of the device on the relay is obtained through this table; then, a relay-relay intercommunication table is constructed to obtain the probability space P2 of the reachable paths between relay nodes; then, the path sorting is calculated according to P1 and P2, that is, the relevant parameters of each reachable path are calculated; finally, the shortest path is selected to realize the transmission and forwarding of data between devices through relays. The whole process reflects the processing logic of this algorithm for efficient data transmission in the LoRa ad-hoc network.

[0116] As Figure 6 shown, it also includes step S5: Before the process of data transmission, data frames are defined, and data transmission is carried out according to the defined data frames. Among them, the data frames are composed of a frame header and a frame tail. The frame header includes a flag field, an information frame start field, an address field, and a judgment field. The frame tail includes an information frame end field and an error detection field.

[0117] Frame header: The starting point of data frame transmission, identifying the start position of the data frame.

[0118] Frame tail: Synchronously identifying the end position of the data frame.

[0119] Among them, the frame header is divided into four fields, and the frame tail is divided into three fields.

[0120] The first field of the frame header and the third field of the frame tail are both flag fields F (Flag), which are specified as 0x7E, indicating that the characters following it are represented in hexadecimal.

[0121] The second field FF of the frame header indicates the start of the information frame.

[0122] The third field of the frame header represents the address, which can be the relay node address for the sending end to enter the ad-hoc network, that is, the next-hop address.

[0123] The fourth field of the frame header represents a judgment. When it is 0x01, the information part is the message to be transmitted. When it is 0x00, the information part is the "signal" for sensing between nodes and between nodes and users.

[0124] The first field of the frame tail, FE, indicates the end of the information frame.

[0125] The second field of the frame tail, error detection: cyclic redundancy check (CRC). By performing specific mathematical operations on each bit in the data frame, a checksum is generated and appended to the end of the data frame. At the receiving end, the received data frame is verified through the same operation process. If the verification result matches, it indicates that the data frame has not experienced errors during transmission and can be received normally. Otherwise, it indicates that the data frame may have problems such as loss, duplication, or out-of-order during transmission, and the receiving end will choose to discard the frame and request retransmission to ensure the integrity and accuracy of the data.

[0126] In the above embodiments, by calculating the path efficiency ratio and selecting the maximum value from the path efficiency ratios of all paths, the shortest path can be accurately determined, ensuring that the data frame can be transmitted at the fastest speed, and improving the efficiency and real-time performance of data transmission.

[0127] The calculation of the path efficiency ratio takes into account the connection probability and the number of nodes of the path, can comprehensively evaluate the communication performance and stability of the path, select the most reliable path for data transmission, reduce errors and loss phenomena during data transmission, and improve the reliability of data transmission.

[0128] By selecting the path with the highest path efficiency ratio for data transmission, the utilization of network resources can be optimized, the use of unnecessary relay nodes and communication links can be reduced, the energy consumption and cost of the network can be lowered, and the economic benefits of the network can be improved.

[0129] In the LoRa ad-hoc network, data frames are transmitted between user nodes and relay nodes, and between relay nodes, and can adapt to changes in the network topology, ensuring that data can be efficiently and reachably transmitted in a complex and changeable cave environment.

[0130] Embodiment 2: As Figure 7 shown, the embodiment of the present invention also provides a communication optimal path selection device for ad-hoc network relay, including:

[0131] The device and relay probability space construction module is used to record the device information of the devices connected to the relay and their communication times, and construct the probability space information of the devices on the relay according to the device information and their communication times. The devices include sending devices and receiving devices;

[0132] The inter-relay probability space construction module is used to record the relay information between relays and their communication times, and construct the probability space information between relays according to the relay information between relays and their communication times;

[0133] The connection probability calculation module is used to list multiple paths passing through relay nodes between the sending device and the receiving device, and calculate the connection probabilities of each path respectively according to the probability space information of the devices on the relay and the probability space information between relays;

[0134] The shortest path determination module is used to calculate the path efficiency ratio according to the connection probabilities of each path and the number of nodes of each path, and determine the shortest path according to the path efficiency ratios of all paths, and transmit the data frame based on the shortest path.

[0135] Preferably, in the device and relay probability space construction module, constructing the probability space information between relays according to the relay information between relays and their communication times includes:

[0136] Obtaining the corresponding device codes and their connection times n at different times from the device information of multiple devices E n connected to relay R k and aggregating each device code to obtain the device code set U i ; kn ;

[0137] Counting the communication times of the devices connected to relay R n to obtain the total device connection time, and calculating the ratio of the corresponding connection times n kn of the device code set U i to the total device connection time to obtain the communication connection probability corresponding to each device code, and constructing the probability space information of the devices on relay R kn through the device code set U n and the communication connection probability corresponding to each device code.

[0138] Preferably, in the inter-relay probability space construction module, constructing the probability space information between relays according to the relay information between relays and their communication times includes:

[0139] Obtaining the corresponding relay codes and their connection times n at different times from the relay information of each relay connected to relay R n and aggregating each relay code to obtain the relay code set U j ;qn ;

[0140] Statistics and relay R n Obtain the total relay connection time N at the communication moment of the devices connected to R j , and for the set of relay codes U kn The corresponding connection times n j and the total relay connection time N j Perform a ratio calculation to obtain the communication connection probability corresponding to each relay code. Construct the probability space information between relays through the set of relay codes U qn and the communication connection probabilities corresponding to each relay code.

[0141] Embodiment 3: The embodiment of the present invention also provides a communication optimal path selection device for an ad-hoc network relay, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the communication optimal path selection method for the ad-hoc network relay as described above is implemented.

[0142] Embodiment 4: The embodiment of the present invention also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the communication optimal path selection method for the ad-hoc network relay as described above is implemented.

[0143] It should be noted that, in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variation thereof is intended to cover a non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device.

[0144] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the above-described devices and units can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.

[0145] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0146] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or may be distributed across multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiments of the present invention.

[0147] In addition, the functional units in the embodiments of the present invention may be integrated into one processing unit, may exist separately as individual physical units, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0148] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of the embodiments of the present invention. The aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs and other various media that can store program codes.

[0149] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A method for selecting an optimal communication path for a self-organizing network relay, characterized in that: The steps include: S1. Record the device information and communication time of the device connected to the relay, and construct the probability space information of the device on the relay according to the device information and communication time, wherein the device includes a sending device and a receiving device; S2. Record the relay information and communication time between relays, and construct the probability space information between relays according to the relay information and communication time between relays; S3, listing multiple paths between the sending device and the receiving device passing through the relay node, and calculating the connection probability of each path according to the probability space information of the device on the relay and the probability space information between the relays; S4. Calculate the path efficiency ratio according to the connection probability of each path and the number of nodes of each path, determine the shortest path according to the path efficiency ratios of all paths, and transmit the data frame based on the shortest path.

2. The method for selecting the optimal communication path according to claim 1, characterized in that: In step S1, constructing the probability space information of the device on the relay according to the device information and its communication time includes: Obtain corresponding device codes and the number of connections at different times from device information of multiple devices connected to the relay, and collect the device codes to obtain a device code set; The communication time of the devices connected to the relay is counted to obtain the total device connection time. The number of connections corresponding to the device code set is calculated by ratio with the total device connection time to obtain the communication connection probability corresponding to each device code. The probability space information of the device on the relay is constructed through the device code set and the communication connection probability corresponding to each device code.

3. The method for selecting the optimal communication path according to claim 1, characterized in that: In S2, the probability space information between relays is constructed according to the relay information between relays and the communication time thereof, including: Obtaining corresponding relay codes and the number of connections at different times from the relay information of each relay connected to the relay, and collecting each relay code to obtain a relay code set; The communication time of the devices connected to the relay is counted to obtain the total number of relay connection times, and the ratio of the number of connections corresponding to the relay code set to the total number of relay connection times is calculated to obtain the communication connection probability corresponding to each relay code. The probability space information between relays is constructed through the relay code set and the communication connection probability corresponding to each relay code.

4. The method for selecting the optimal communication path according to claim 3, characterized in that: In S3, multiple paths between the sending device and the receiving device passing through the relay node are listed, and the connection probability of each path is calculated according to the probability space information of the device on the relay and the probability space information between the relays, including: List multiple paths between a sending device and a receiving device through relay nodes, wherein the paths include multiple communication links; The communication connection probability corresponding to each communication link in the same path is obtained from the probability space information of the device on the relay and the probability space information between the relays, and the product of each communication connection probability in the same path is calculated to obtain the connection probability corresponding to the same path. In this process, the connection probability corresponding to each path is calculated.

5. The method for selecting the optimal communication path according to claim 3, characterized in that: In S4, the path efficiency ratio is calculated according to the connection probability of each path and the number of nodes of each path, and the shortest path is determined according to the path efficiency ratios of all paths, and the data frame is transmitted based on the shortest path, including: Assume that s is the number of communication connection probabilities between adjacent nodes obtained on the path, r is the lower limit of the summation, s+1 is the number of nodes on the path, perform logarithmic calculation on the connection probability of the path, then take the absolute value of the logarithm, and calculate the path effectiveness ratio based on the path effectiveness ratio formula and the number of nodes of the path calculated by logarithm. The path effectiveness ratio formula is: Among them, w represents the path efficiency ratio, i and j represent adjacent nodes in the same path; The maximum value is selected from the path efficiency ratios w of all paths, and the data frame is transmitted based on the shortest path.

6. The method for selecting the optimal communication path according to claim 1, characterized in that: The step S5 is also included: Before the data transmission process, a data frame is defined, and data transmission is performed according to the defined data frame, wherein the data frame consists of a frame header and a frame trailer, the frame header includes a flag field, an information frame start field, an address field and a judgment field, and the frame trailer includes an information frame end field and an error detection field.

7. The method for selecting the optimal communication path according to claim 6, characterized in that: The value of the flag field is 0x7E, indicating that the subsequent characters are in hexadecimal; The information frame start field indicates the start of the identification information frame; The address field indicates the address of the next-hop relay node; The judgment field indicates that when the value is 0x01, it indicates the content of the transmitted message, and when the value is 0x00, it indicates the induction signal between nodes; The information frame end field indicates the end of the identification information frame; The error detection field generates a check code through a cyclic redundancy check, which is used for the receiving device to detect whether an error occurs in the data frame during transmission. If the check result matches, the data frame is received normally, otherwise, the receiving device discards the data frame and requests retransmission.

8. A communication optimal path selection device for a self-organizing network relay, characterized in that: include: A device and relay probability space construction module, which is used to record the device information and communication time of the device connected to the relay, and to construct the probability space information of the device on the relay according to the device information and communication time, wherein the device includes a sending device and a receiving device; The relay probability space construction module is used to record the relay information and communication time between relays, and construct the probability space information between relays according to the relay information and communication time between relays; A connection probability calculation module is used to list multiple paths between the sending device and the receiving device through the relay node, and calculate the connection probability of each path according to the probability space information of the device on the relay and the probability space information between the relays; The shortest path determination module is used to calculate the path efficiency ratio according to the connection probability of each path and the number of nodes of each path, and determine the shortest path according to the path efficiency ratios of all paths, and transmit data frames based on the shortest path.

9. A communication optimal path selection device for a self-organizing network relay, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for selecting the optimal communication path of the ad hoc network relay according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the method for selecting an optimal communication path for a relay in an ad hoc network as claimed in any one of claims 1 to 7 is implemented.