Data packet forwarding method and device, electronic equipment and storage medium
By determining the evaluation score based on the distance and energy consumption of the candidate forwarding path in the Bluetooth Mesh network and selecting the optimal forwarding path, the problem of the routing algorithm causing nodes to frequently forward and exhaust energy is solved, and the stability and life of the network are improved.
Patent Information
- Application Number
- CN202411881950.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-03-21
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The routing algorithm in the Bluetooth Mesh network mainly focuses on the shortest physical distance between nodes, causing some nodes to frequently participate in data forwarding, which ultimately fails due to energy exhaustion, affecting the stability and lifespan of the entire network.
A packet forwarding method is provided, by obtaining multiple candidate forwarding paths corresponding to the target data packet, calculating the evaluation scores of each path, determining the target forwarding path based on distance and energy consumption, and forwarding the data packets according to the path.
In the process of forwarding data packets, comprehensively consider distance and energy consumption, select the optimal forwarding path to achieve balanced energy consumption of each node, avoid nodes from exhausting energy prematurely, and improve the stability and life of the wireless Mesh network.
Smart Images

Figure CN119676790A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet of Things, and in particular to a data packet forwarding method, device, electronic device and storage medium. Background Art
[0002] Bluetooth Mesh Network is a network technology based on Bluetooth technology that allows devices to establish "many-to-many" communication connections, which is particularly suitable for scenarios with large-scale network coverage. Bluetooth Mesh Network technology uses low-power Bluetooth (BLE) broadcasting to send and receive information, breaking through the one-to-one or one-to-many communication limitations of traditional Bluetooth, allowing devices within the network to achieve many-to-many communication, thereby expanding the communication distance and application scenarios of Bluetooth.
[0003] However, routing algorithms in Bluetooth Mesh networks, such as the shortest path algorithm, mainly focus on the shortest physical distance between nodes. This path selection method may cause some nodes to frequently participate in data forwarding and eventually fail due to energy exhaustion, thus affecting the stability and life of the entire network. Summary of the invention
[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the present application provides a data packet forwarding method, device, electronic device and storage medium.
[0005] In a first aspect, the present application provides a data packet forwarding method, which is applied to any node in a wireless mesh network, and the method includes:
[0006] Obtain multiple candidate forwarding paths corresponding to the target data packet;
[0007] Obtaining evaluation scores corresponding to the plurality of candidate forwarding paths, wherein the evaluation scores are determined according to the distance and energy consumption of each of the candidate forwarding paths;
[0008] Determining a target forwarding path among the plurality of candidate forwarding paths according to the evaluation scores;
[0009] The target data packet is forwarded according to the target forwarding path.
[0010] Optionally, a candidate forwarding path of the target data packet at the current node is obtained, including:
[0011] Obtaining the starting node and the target node of the target data packet;
[0012] If the current node and the starting node are the same node, determining the forwarding path between the starting node and the target node as the candidate forwarding path;
[0013] If the current node and the starting node are not the same node, a forwarding path between the starting node and the target node and including the current node is determined as the candidate forwarding path.
[0014] Optionally, obtaining evaluation scores corresponding to the plurality of candidate forwarding paths includes:
[0015] For each of the candidate forwarding paths, obtain actual cost data about the distance and energy consumption from the starting node to the current node, obtain estimated cost data about the distance from the current node to the target node, and obtain node energy weights of each node in the candidate forwarding path except the current node;
[0016] An evaluation score corresponding to each of the candidate forwarding paths is determined according to the actual cost data, the estimated cost data, the node energy weight and a preset evaluation function.
[0017] Optionally, actual cost data on distance and energy consumption from the starting node to the current node is obtained, including:
[0018] Acquire transmission distance data of an actual forwarding path from the starting node to the current node in the candidate forwarding path;
[0019] Acquire energy consumption data of each node in the actual forwarding path forwarding the target data packet;
[0020] The sum of the transmission distance data and the energy consumption data is determined as the actual cost data.
[0021] Optionally, obtaining energy consumption data of each node in the actual forwarding path forwarding the target data packet includes:
[0022] Obtaining transmission energy consumption data and reception energy consumption data of each node in the actual forwarding path;
[0023] The sum of the transmission energy consumption data and the reception energy consumption data of each node in the actual forwarding path is determined as the energy consumption data.
[0024] Optionally, obtaining estimated cost data from the current node to the target node includes:
[0025] Obtaining Euclidean distance data from the current node to the target node in the candidate forwarding path;
[0026] The Euclidean distance data is determined as the estimated cost data.
[0027] Optionally, obtaining the node energy weight of each node in the candidate forwarding path except the current node includes:
[0028] Obtaining the initial energy of each node in the candidate forwarding path except the current node before forwarding the target data packet;
[0029] The inverse of the initial energy of each node is obtained as the node energy weight of each node.
[0030] In a second aspect, the present application provides a data packet forwarding device, which is applied to any node in a wireless Mesh network, and the device includes:
[0031] A first acquisition module, used to acquire multiple candidate forwarding paths corresponding to a target data packet;
[0032] A second acquisition module is used to obtain evaluation scores corresponding to the plurality of candidate forwarding paths, wherein the evaluation scores are determined according to the distance and energy consumption of each of the candidate forwarding paths;
[0033] A first determination module, configured to determine a target forwarding path among the plurality of candidate forwarding paths according to the evaluation scores;
[0034] A forwarding module is used to forward the target data packet according to the target forwarding path.
[0035] Optionally, the first acquisition module includes:
[0036] A first acquisition unit, used to acquire a starting node and a target node of the target data packet;
[0037] A first determining unit, configured to determine a forwarding path between the starting node and the target node as the candidate forwarding path if the current node and the starting node are the same node;
[0038] The second determining unit is configured to determine, if the current node and the starting node are not the same node, a forwarding path between the starting node and the target node and including the current node as the candidate forwarding path.
[0039] Optionally, the second acquisition module includes:
[0040] a second acquisition unit, configured to acquire, for each of the candidate forwarding paths, actual cost data on the distance and energy consumption from the starting node to the current node, acquire estimated cost data on the distance from the current node to the target node, and acquire node energy weights of each node in the candidate forwarding path except the current node;
[0041] The third determining unit is used to determine the evaluation score corresponding to each of the candidate forwarding paths according to the actual cost data, the estimated cost data, the node energy weight and a preset evaluation function.
[0042] Optionally, the second acquiring unit includes:
[0043] A first acquisition subunit, configured to acquire transmission distance data of an actual forwarding path from the starting node to the current node in a candidate forwarding path;
[0044] A second acquisition subunit is used to acquire energy consumption data of each node in the actual forwarding path forwarding the target data packet;
[0045] The first determining subunit is used to determine the sum of the transmission distance data and the energy consumption data as the actual cost data.
[0046] Optionally, the second acquiring subunit is further used for:
[0047] Obtaining transmission energy consumption data and reception energy consumption data of each node in the actual forwarding path;
[0048] The sum of the transmission energy consumption data and the reception energy consumption data of each node in the actual forwarding path is determined as the energy consumption data.
[0049] Optionally, the second acquiring unit includes:
[0050] A third acquisition subunit is used to acquire the Euclidean distance data from the current node to the target node in the candidate forwarding path;
[0051] The second determining subunit is used to determine the Euclidean distance data as the estimated cost data.
[0052] Optionally, the second acquiring unit includes:
[0053] A fourth acquisition subunit, used to acquire the initial energy of each node in the candidate forwarding path except the current node before forwarding the target data packet;
[0054] The fifth acquisition subunit is used to acquire the inverse of the initial energy of each node as the node energy weight of each node.
[0055] In a third aspect, the present application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
[0056] Memory, used to store computer programs;
[0057] The processor is used to implement any data packet forwarding method described in the first aspect when executing a program stored in the memory.
[0058] In a fourth aspect, the present application provides a computer-readable storage medium, on which a program of a data packet forwarding method is stored, and when the program of the data packet forwarding method is executed by a processor, the steps of any of the data packet forwarding methods described in the first aspect are implemented.
[0059] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art:
[0060] The embodiment of the present application determines a target forwarding path among multiple candidate forwarding paths according to an evaluation score determined based on the distance and energy consumption of the candidate forwarding paths, and forwards the target data packet according to the target forwarding path. In the process of forwarding the target data packet, the distance and energy consumption can be comprehensively considered to select the optimal target forwarding path to forward the target data packet. While achieving energy consumption balance of each node, the shortest path and the minimum energy consumption are guaranteed, thereby avoiding premature exhaustion of energy at some nodes, improving the stability and life of the wireless mesh network, and improving the overall performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0062] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0063] Figure 1 A flowchart of a data packet forwarding method provided in an embodiment of the present application;
[0064] Figure 2 A structural diagram of a data packet forwarding device provided in an embodiment of the present application;
[0065] Figure 3 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0066] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0067] Since the routing algorithms in the Bluetooth Mesh network, such as the shortest path algorithm, mainly focus on the shortest physical distance between nodes, this path selection method may cause some nodes to frequently participate in data forwarding, and eventually fail due to energy exhaustion, thereby affecting the stability and life of the entire network. To this end, the embodiments of the present application provide a data packet forwarding method, device, electronic device and storage medium.
[0068] The embodiment of the present application provides a data packet forwarding method, which can be applied to any node in a wireless mesh network. The embodiment of the present application can pre-establish a wireless mesh network model to describe the geographical distribution of the nodes and their connection relationships.
[0069] Each node has the following attributes:
[0070] Position coordinates (x, y): the position of the node on the two-dimensional plane.
[0071] Initial energy (E_initial): The initial energy of the node.
[0072] Neighbor node list: Neighbor nodes that communicate directly with the current node.
[0073] Distance Matrix: The physical distances between nodes.
[0074] Energy consumption model: used to calculate the energy consumption of communication between nodes.
[0075] Among them, energy consumption model: defines the node energy consumption model, including transmission energy consumption and receiving energy consumption, and sets the energy consumption model as follows.
[0076] Transmission energy consumption (E tx ): Energy consumption of node i sending a data packet to node j.
[0077] Receiving energy consumption (E rx ): Energy consumption of node j receiving the data packet sent by node i.
[0078] The energy consumption model formula is as follows:
[0079]
[0080] E tx =E elec ×k;
[0081] Among them, (E elec ) is the electron energy consumption, (E amp ) is the amplifier energy consumption, (k) is the packet size, (d ij ) is the distance from node i to node j.
[0082] like Figure 1As shown, the data packet forwarding method may include the following steps:
[0083] Step S101, obtaining multiple candidate forwarding paths corresponding to the target data packet;
[0084] In an embodiment of the present application, a candidate forwarding path refers to a forwarding path from a starting node to a target node and including a current node, that is, a candidate forwarding path includes a forwarding path after the current node, or a forwarding path before the current node and a forwarding path after the current node.
[0085] In this step, the starting node can be determined according to the starting address of the target data packet, the target node can be determined according to the destination address, and it can be determined whether the current node is the starting node. If the current node is the starting node, all forwarding paths between the current node and the target node are obtained as candidate forwarding paths;
[0086] If the current node is not the starting node, the forwarding path from the starting node to the current node and the forwarding path from the current node to the target node are obtained, and a combination of the two forwarding paths from the starting node to the current node and from the current node to the target node is obtained as a candidate forwarding path.
[0087] In order to save system resources, only the path of actually forwarding the target data packet in the forwarding path from the starting node to the current node and the combination of the forwarding path from the current node to the target node may be obtained as a candidate forwarding path.
[0088] In one embodiment of the present application, obtaining a candidate forwarding path of a target data packet at a current node includes:
[0089] Obtaining the starting node and the target node of the target data packet;
[0090] If the current node and the starting node are the same node, determining the forwarding path between the starting node and the target node as the candidate forwarding path;
[0091] If the current node and the starting node are not the same node, a forwarding path between the starting node and the target node and including the current node is determined as the candidate forwarding path.
[0092] Step S102, obtaining evaluation scores corresponding to the plurality of candidate forwarding paths;
[0093] In the embodiment of the present application, the evaluation score is determined according to the distance and energy consumption of each candidate forwarding path;
[0094] In this step, the distance and energy consumption of each candidate forwarding path may be obtained respectively, and the evaluation score may be calculated in combination with a preset evaluation function.
[0095] Step S103, determining a target forwarding path among the plurality of candidate forwarding paths according to the evaluation scores;
[0096] In this step, the candidate forwarding path with the smallest evaluation score among the multiple candidate forwarding paths may be determined as the target forwarding path.
[0097] Step S104: forwarding the target data packet according to the target forwarding path.
[0098] In this step, the next hop node can be determined according to the target forwarding path, and then the target data packet can be sent to the next hop node. After the next hop node receives the target data packet, the target forwarding path can be re-determined according to this process to determine the next hop node, and the target data packet can be forwarded until the target data packet is transmitted to the target node.
[0099] By redetermining the target forwarding path at each node, it can better match the current distance and the current energy consumption status of each node, improve the accuracy of determining the final forwarding path (which may be different from the target forwarding path determined by each node), and thus better achieve energy balance among nodes.
[0100] The embodiment of the present application determines a target forwarding path among multiple candidate forwarding paths according to an evaluation score determined based on the distance and energy consumption of the candidate forwarding paths, and forwards the target data packet according to the target forwarding path. In the process of forwarding the target data packet, the distance and energy consumption can be comprehensively considered to select the optimal target forwarding path to forward the target data packet. While achieving energy consumption balance of each node, the shortest path and the minimum energy consumption are guaranteed, thereby avoiding premature exhaustion of energy at some nodes, improving the stability and life of the wireless mesh network, and improving the overall performance.
[0101] In another embodiment of the present application, step S102 obtains evaluation scores corresponding to the plurality of candidate forwarding paths, including:
[0102] Step S201, for each of the candidate forwarding paths, obtaining actual cost data on distance and energy consumption from the starting node to the current node, obtaining estimated cost data on the distance from the current node to the target node, and obtaining node energy weights of each node in the candidate forwarding path except the current node;
[0103] Step S202 , determining an evaluation score corresponding to each of the candidate forwarding paths according to the actual cost data, the estimated cost data, the node energy weight and a preset evaluation function.
[0104] In the embodiment of the present application, the evaluation function is:
[0105] [f(n)=g(n)+h(n)+w(i)];
[0106] w(i)=1 / E(i);
[0107] Where: (g(n)) is the actual cost from the starting node to the current node n, including energy consumption and transmission distance, (h(n)) is the estimated cost from the current node n to the target node, using Euclidean distance, E(i) is the initial energy of each node, and w(i) is the initial energy weight of each node.
[0108] In this step, the actual cost data, the estimated cost data, and the node energy weight may be brought into a preset evaluation function to obtain an evaluation score corresponding to each candidate forwarding path.
[0109] The embodiment of the present application calculates the evaluation score corresponding to each candidate forwarding path according to the actual cost data, the estimated cost data, and the node energy weight for each candidate forwarding path, thereby comprehensively considering the distance and energy consumption so as to select the optimal target forwarding path to forward the target data packet. While achieving balanced energy consumption of each node, it ensures the shortest path and the minimum energy consumption, avoids premature energy exhaustion of some nodes, improves the stability and life of the wireless Mesh network, and improves the overall performance.
[0110] In another embodiment of the present application, step S201 obtains actual cost data about distance and energy consumption from the starting node to the current node, including:
[0111] Step S301, obtaining transmission distance data of an actual forwarding path from the starting node to the current node in a candidate forwarding path;
[0112] In the embodiment of the present application, the transmission distance data of the actual forwarding path from the starting node to the current node may refer to the sum of the distances of the various nodes passed from the starting node to the current node.
[0113] Step S302, obtaining energy consumption data of each node in the actual forwarding path forwarding the target data packet;
[0114] In one embodiment of the present application, step S302 obtains energy consumption data of each node in the actual forwarding path forwarding the target data packet, including:
[0115] Obtaining transmission energy consumption data and reception energy consumption data of each node in the actual forwarding path;
[0116] The sum of the transmission energy consumption data and the reception energy consumption data of each node in the actual forwarding path is determined as the energy consumption data.
[0117] Among them, the transmission energy consumption data and the reception energy consumption data can be calculated by the energy consumption model mentioned above. The energy consumption model can be updated in real time or regularly to ensure the accuracy of the energy consumption data of each node, thereby facilitating more accurate determination of the target forwarding path.
[0118] Step S303: determining the sum of the transmission distance data and the energy consumption data as the actual cost data.
[0119] The embodiment of the present application determines the sum of the transmission distance data and the energy consumption data as the actual cost data, thereby comprehensively considering the distance and energy consumption, avoiding the frequent use of nodes with lower energy, so as to select the optimal target forwarding path to forward the target data packet, and while achieving balanced energy consumption of each node, ensure the shortest path and minimum energy consumption, avoid some nodes from running out of energy prematurely, improve the stability and life of the wireless Mesh network, and improve the overall performance.
[0120] In another embodiment of the present application, step S201 of acquiring estimated cost data from the current node to the target node includes:
[0121] Step S401, obtaining Euclidean distance data from the current node to the target node in the candidate forwarding path;
[0122] In the embodiment of the present application, the Euclidean distance data may refer to the straight-line distance from the current node to the target node.
[0123] Step S402: determining the Euclidean distance data as the estimated cost data.
[0124] The embodiment of the present application determines the Euclidean distance data as the estimated cost data, thereby taking the distance into consideration so as to select the optimal target forwarding path to forward the target data packet. While achieving balanced energy consumption of each node, it ensures the shortest path and minimum energy consumption, avoids premature energy exhaustion of some nodes, improves the stability and life of the wireless Mesh network, and improves the overall performance.
[0125] In another embodiment of the present application, step S201 obtains the node energy weight of each node in the candidate forwarding path except the current node, including:
[0126] Step S501, obtaining the initial energy of each node in the candidate forwarding path except the current node before forwarding the target data packet;
[0127] In the embodiment of the present application, the initial energy refers to the initial energy at the current moment, that is, the initial energy before forwarding the target data packet, that is, the remaining energy after forwarding other data packets and before forwarding the target data packet.
[0128] Step S502: Obtain the inverse of the initial energy of each node as the node energy weight of each node.
[0129] The embodiment of the present application determines the inverse of the initial energy of each node in the candidate forwarding path except the current node before forwarding the target data packet as the node energy weight, and dynamically adjusts the node energy weight to ensure balanced energy consumption and avoid frequent use of nodes with lower energy, so as to facilitate the selection of the optimal target forwarding path to forward the target data packet. While achieving balanced energy consumption of each node, it ensures the shortest path and minimum energy consumption, avoids some nodes from running out of energy prematurely, improves the stability and life of the wireless Mesh network, and improves the overall performance.
[0130] For ease of understanding, the present application also provides an embodiment in practical application, as follows:
[0131] Assume that there are three nodes A, B and C in a wireless mesh network, and their initial energies are 100, 50 and 75 respectively. The node energy weights at the current moment are:
[0132] w A =1 / 100=0.01
[0133] w B =1 / 50=0.02
[0134] w C =1 / 75=0.0133
[0135] During the path search process, assume that there are two possible forwarding paths from node A to node C:
[0136] 1. A→B→C
[0137] 2. A→C
[0138] The evaluation function of path selection is:
[0139] f(n)=g(n)+h(n)+α·wi
[0140] Assuming α is 1, the values of g(n) and h(n) are:
[0141] g(A→B)=10,h(B→C)=10
[0142] g(A→C)=20,h(C→C)=0
[0143] f(A→B→C)=(10+10)+0.02+0.0133=20.0333;
[0144] f(A→C)=20+0.0133=20.0133;
[0145] Finally, the forwarding path A→C with the smallest evaluation score can be selected as the target forwarding path.
[0146] In another embodiment of the present application, a data packet forwarding device is also provided, which is applied to any node in a wireless Mesh network, such as Figure 2 As shown, the device comprises:
[0147] A first acquisition module 11 is used to acquire multiple candidate forwarding paths corresponding to a target data packet;
[0148] A second acquisition module 12 is used to obtain evaluation scores corresponding to the plurality of candidate forwarding paths, wherein the evaluation scores are determined according to the distance and energy consumption of each candidate forwarding path;
[0149] A first determination module 13, configured to determine a target forwarding path among the plurality of candidate forwarding paths according to the evaluation scores;
[0150] The forwarding module 14 is configured to forward the target data packet according to the target forwarding path.
[0151] Optionally, the first acquisition module includes:
[0152] A first acquisition unit, used to acquire a starting node and a target node of the target data packet;
[0153] A first determining unit, configured to determine a forwarding path between the starting node and the target node as the candidate forwarding path if the current node and the starting node are the same node;
[0154] The second determining unit is configured to determine, if the current node and the starting node are not the same node, a forwarding path between the starting node and the target node and including the current node as the candidate forwarding path.
[0155] Optionally, the second acquisition module includes:
[0156] a second acquisition unit, configured to acquire, for each of the candidate forwarding paths, actual cost data on the distance and energy consumption from the starting node to the current node, acquire estimated cost data on the distance from the current node to the target node, and acquire node energy weights of each node in the candidate forwarding path except the current node;
[0157] The third determining unit is used to determine the evaluation score corresponding to each of the candidate forwarding paths according to the actual cost data, the estimated cost data, the node energy weight and a preset evaluation function.
[0158] Optionally, the second acquiring unit includes:
[0159] A first acquisition subunit, configured to acquire transmission distance data of an actual forwarding path from the starting node to the current node in a candidate forwarding path;
[0160] A second acquisition subunit is used to acquire energy consumption data of each node in the actual forwarding path forwarding the target data packet;
[0161] The first determining subunit is used to determine the sum of the transmission distance data and the energy consumption data as the actual cost data.
[0162] Optionally, the second acquiring subunit is further used for:
[0163] Obtaining transmission energy consumption data and reception energy consumption data of each node in the actual forwarding path;
[0164] The sum of the transmission energy consumption data and the reception energy consumption data of each node in the actual forwarding path is determined as the energy consumption data.
[0165] Optionally, the second acquiring unit includes:
[0166] A third acquisition subunit is used to acquire the Euclidean distance data from the current node to the target node in the candidate forwarding path;
[0167] The second determining subunit is used to determine the Euclidean distance data as the estimated cost data.
[0168] Optionally, the second acquiring unit includes:
[0169] A fourth acquisition subunit, used to acquire the initial energy of each node in the candidate forwarding path except the current node before forwarding the target data packet;
[0170] The fifth acquisition subunit is used to acquire the inverse of the initial energy of each node as the node energy weight of each node.
[0171] In another embodiment of the present application, an electronic device is provided, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus;
[0172] Memory, used to store computer programs;
[0173] The processor is used to implement the data packet forwarding method described in any of the above method embodiments when executing the program stored in the memory.
[0174] In the electronic device provided by the embodiment of the present invention, the processor can determine the target forwarding path among multiple candidate forwarding paths by executing the program stored in the memory, according to the evaluation score determined by the distance and energy consumption of the candidate forwarding paths, and forward the target data packet according to the target forwarding path. In the process of forwarding the target data packet, the distance and energy consumption can be comprehensively considered to select the optimal target forwarding path to forward the target data packet, while achieving energy consumption balance of each node, ensuring the shortest path and minimum energy consumption, avoiding premature exhaustion of energy of some nodes, improving the stability and life of the wireless mesh network, and improving the overall performance.
[0175] The communication bus 1140 mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus 1140 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0176] The communication interface 1120 is used for communication between the electronic device and other devices.
[0177] The memory 1130 may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0178] The above-mentioned processor 1110 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0179] In another embodiment of the present application, a computer-readable storage medium is provided, on which a program of a data packet forwarding method is stored. When the program of the data packet forwarding method is executed by a processor, the steps of the data packet forwarding method described in any of the aforementioned method embodiments are implemented.
[0180] 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 such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0181] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A data packet forwarding method, characterized in that: Applied to any node in a wireless mesh network, the method comprises: Obtain multiple candidate forwarding paths corresponding to the target data packet; Obtaining evaluation scores corresponding to the plurality of candidate forwarding paths, wherein the evaluation scores are determined according to the distance and energy consumption of each of the candidate forwarding paths; Determining a target forwarding path among the plurality of candidate forwarding paths according to the evaluation scores; The target data packet is forwarded according to the target forwarding path.
2. The data packet forwarding method according to claim 1, characterized in that: Get the candidate forwarding path of the target data packet at the current node, including: Obtaining the starting node and the target node of the target data packet; If the current node and the starting node are the same node, determining the forwarding path between the starting node and the target node as the candidate forwarding path; If the current node and the starting node are not the same node, a forwarding path between the starting node and the target node and including the current node is determined as the candidate forwarding path.
3. The data packet forwarding method according to claim 1, characterized in that: Obtaining evaluation scores corresponding to the plurality of candidate forwarding paths includes: For each of the candidate forwarding paths, obtain actual cost data about the distance and energy consumption from the starting node to the current node, obtain estimated cost data about the distance from the current node to the target node, and obtain node energy weights of each node in the candidate forwarding path except the current node; An evaluation score corresponding to each of the candidate forwarding paths is determined according to the actual cost data, the estimated cost data, the node energy weight and a preset evaluation function.
4. The data packet forwarding method according to claim 3, characterized in that: Get the actual cost data about the distance and energy consumption from the starting node to the current node, including: Acquire transmission distance data of an actual forwarding path from the starting node to the current node in the candidate forwarding path; Acquire energy consumption data of each node in the actual forwarding path forwarding the target data packet; The sum of the transmission distance data and the energy consumption data is determined as the actual cost data.
5. The data packet forwarding method according to claim 4, characterized in that: Obtaining energy consumption data of each node in the actual forwarding path forwarding the target data packet includes: Obtaining transmission energy consumption data and reception energy consumption data of each node in the actual forwarding path; The sum of the transmission energy consumption data and the reception energy consumption data of each node in the actual forwarding path is determined as the energy consumption data.
6. The data packet forwarding method according to claim 3, characterized in that: Obtaining estimated cost data from the current node to the target node, including: Obtaining Euclidean distance data from the current node to the target node in the candidate forwarding path; The Euclidean distance data is determined as the estimated cost data.
7. The data packet forwarding method according to claim 3, characterized in that: Obtaining the node energy weight of each node in the candidate forwarding path except the current node, including: Obtaining the initial energy of each node in the candidate forwarding path except the current node before forwarding the target data packet; The inverse of the initial energy of each node is obtained as the node energy weight of each node.
8. A data packet forwarding device, characterized in that: Applied to any node in a wireless Mesh network, the device includes: A first acquisition module, used to acquire multiple candidate forwarding paths corresponding to a target data packet; A second acquisition module is used to obtain evaluation scores corresponding to the plurality of candidate forwarding paths, wherein the evaluation scores are determined according to the distance and energy consumption of each of the candidate forwarding paths; A first determination module, configured to determine a target forwarding path among the plurality of candidate forwarding paths according to the evaluation scores; A forwarding module is used to forward the target data packet according to the target forwarding path.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the data packet forwarding method according to any one of claims 1 to 7 when executing a program stored in a memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program of the data packet forwarding method, and when the program of the data packet forwarding method is executed by a processor, the steps of the data packet forwarding method described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Information transmission method based on wireless sensor network and apparatus thereof
CN103517365A
Energy optimization routing algorithm in consideration of energy balance
CN103945482A
Multi-target three-dimensional path planning method
CN110501020A
Non-uniform clustering low-power-consumption multi-hop routing control method based on fuzzy logic
CN113038564A