Data transmission method and device

By employing a combination of multicast and unicast messages in ad hoc networks and selectively sending messages based on the status of forwarding devices, the path problem for data transmission between electronic devices in ad hoc networks is solved, improving data transmission efficiency and reducing network congestion.

CN117499984BActive Publication Date: 2025-11-21HONOR DEVICE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210887339.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-26
Publication Date
2025-11-21
Estimated Expiration
2042-07-26

AI Technical Summary

Technical Problem

In self-organizing networks, due to limitations in network access capabilities and the capabilities of the devices themselves, there may not be a single-hop reachable path between some electronic devices, leading to difficulties in data transmission.

Method used

By using a combination of multicast and unicast messages in self-organizing networks, multicast or unicast messages can be selectively sent based on the forwarding capabilities of the destination device, thereby achieving efficient data transmission.

Benefits of technology

It reduces the number of messages that need to be transmitted in the network, lowers the possibility of network congestion, and improves data transmission efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117499984B_ABST
    Figure CN117499984B_ABST
Patent Text Reader

Abstract

The application provides a data transmission method and device. The method is applied to a first device other than a source device in a self-organizing network, and comprises the following steps: receiving a first packet; the first packet is used for transmitting first data; when it is determined that the first packet is a groupcast packet, determining a destination device of the first packet; for a destination device other than the first device in the destination devices, determining a forwarding device of the destination device; the forwarding device is a next-hop device of the first device in a path from the first device to the destination device; when there are multiple destination devices having the same forwarding device, sending a second packet to the same forwarding device; the second packet is a groupcast packet, and the second packet is used for transmitting the first data to the multiple destination devices. The application can realize data transmission in a self-organizing network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data transmission technology, and in particular to data transmission methods and devices. Background Technology

[0002] With the widespread adoption of smartphones, tablets, smartwatches, wireless headphones, and other electronic devices, the number of electronic devices owned by each user has also increased. Due to limitations in network access capabilities and the capabilities of the electronic devices themselves, in some ad hoc network scenarios, there may not be single-hop reachable paths between electronic devices in the network, requiring relay nodes in the network to forward data. How to achieve data transmission in ad hoc networks is a problem that needs to be solved. Summary of the Invention

[0003] This application provides a data transmission method and an apparatus that enable data transmission in an ad hoc network.

[0004] In a first aspect, embodiments of this application provide a data transmission method applied to a first device in an ad hoc network, comprising: receiving a first message; the first message being used to transmit first data; when it is determined that the first message is a multicast message, determining the destination device of the first message; for destination devices other than the first device, determining a forwarding device for the destination device; the forwarding device being the next-hop device of the first device in the path from the first device to the destination device; when multiple destination devices have the same forwarding device, sending a second message to the forwarding device of the multiple destination devices, the second message being a multicast message, the second message being used to transmit the first data to the multiple destination devices. The second message may, for example, be a second multicast message in subsequent embodiments. In this method, when multiple destination devices have the same forwarding device, the first device sends a multicast message to the forwarding device, thereby realizing data transmission between the first device and other destination devices in the ad hoc network. Furthermore, in this method, when multiple destination devices have the same forwarding device, the first device sends a multicast message to the forwarding device, which, compared to the first device sending a unicast message to each destination device, reduces the number of messages that the first device needs to send, thereby reducing the possibility of network congestion.

[0005] In one possible implementation, the method further includes: for destination devices other than the first device, determining the hop count of each destination device; if there exists a destination device whose forwarding device is different from the forwarding devices of all other destination devices and has a hop count of 1, sending a third message to that destination device, wherein the third message is a unicast message and is used to transmit the first data to that destination device. The aforementioned third message may, for example, be a third unicast message as described in subsequent embodiments.

[0006] In one possible implementation, the method further includes: when a forwarding device of a destination device is different from the forwarding devices of other destination devices and has a hop count greater than 1, a fourth message is sent to the forwarding device of that destination device. The fourth message is a unicast message, and the fourth message is used to transmit the first data to the destination device. The aforementioned fourth message may, for example, be a fourth unicast message as described in subsequent embodiments.

[0007] In one possible implementation, the method further includes: when the destination device of the first message includes the first device, obtaining the first data from the first message and processing the first data.

[0008] One possible implementation further includes: if it is determined that the first message is a unicast message, determining the destination device of the first message; if the destination device of the first message is not the first device, obtaining the forwarding device of the destination device of the first message; and sending the first message to the forwarding device. Through the above processing, the first device is able to forward the first message.

[0009] In one possible implementation, it further includes: when the destination device of the first message is the first device, obtaining the first data from the first message and processing the first data.

[0010] In one possible implementation, the method further includes: determining whether the destination device of the first message has received the first data within a first preset time period, and sending the determined information to a second device, where the second device is the device that sent the first message to the first device. Through this process, the first device can feed back the result of whether the destination device of the first message has received the first data to the second device. This feedback continues hop-by-hop, allowing the source device to obtain whether each destination device of the first data has received it, and thus determine whether to retransmit the first data and the destination device for the retransmission.

[0011] In one possible implementation, after receiving the first message, the method further includes: sending a first message to a second device regarding the first message, the first message indicating that the first device has received the first message, and the second device being the device that sent the first message to the first device. The first message may, for example, be a message indication message as described in the following embodiments.

[0012] In one possible implementation, the first message includes a first field, which is a first value used to record whether the first message is a multicast message. Determining that the first message is a multicast message includes: determining that the first field of the first message is a first value.

[0013] In one possible implementation, the first message includes a first field, which is a second value used to record whether the first message is a unicast message. Determining that the first message is a unicast message includes: determining that the first field of the first message is a second value.

[0014] Optionally, the first field mentioned above can be, for example, the multicast field in the embodiments described below. Based on the first field, the first device can quickly and accurately determine whether the first message is a unicast message or a multicast message.

[0015] In one possible implementation, the first message includes a second field, which is used to record the destination device of the first message when the first message is a multicast message. Determining the destination device of the first message includes obtaining the destination device of the first message from the second field of the first message. The second field mentioned above may, for example, be the multicast address field in the following embodiments.

[0016] In one possible implementation, the second field is used to record the address of each destination device of the first message when the first message is a multicast message.

[0017] In one possible implementation, the first device is configured with a routing table, which records the forwarding device for each device in the ad hoc network. The forwarding device is the next-hop device of the first device in the path from the first device to each device in the ad hoc network. Determining the forwarding device for each destination device includes: determining the forwarding device for each destination device based on the routing table.

[0018] Secondly, embodiments of this application provide a data transmission method applied to a source device in an ad hoc network, comprising: determining a destination device for first data; determining a forwarding device for the destination device; the forwarding device being the next-hop device of the source device in the path from the source device to the destination device; and when multiple destination devices have the same forwarding device, sending a fifth message to the forwarding devices of the multiple destination devices, the fifth message being a multicast message, the fifth message being used to transmit the first data to the multiple destination devices. The aforementioned fifth message may, for example, be the first multicast message in the following embodiments. In this method, when multiple destination devices have the same forwarding device, the source device sends a multicast message to the same forwarding device, thereby realizing data transmission from the source device to the destination device. Furthermore, compared to the source device sending unicast messages to each destination device, sending multicast messages to the same forwarding device when multiple destination devices have the same forwarding device reduces the number of messages the source device needs to send, thereby reducing the possibility of network congestion.

[0019] In one possible implementation, the method further includes: determining the hop count of the destination device; if there exists a destination device whose forwarding device is different from the forwarding devices of other destination devices and has a hop count of 1, then sending a sixth message to the destination device. The sixth message is a unicast message, and the sixth message is used to transmit the first data to the destination device. The aforementioned sixth message may, for example, be the first unicast message in the following embodiments.

[0020] In one possible implementation, the method further includes: when a forwarding device of a destination device is different from the forwarding devices of other destination devices and has a hop count greater than 1, a seventh message is sent to the forwarding device of that destination device. The seventh message is a unicast message, and the seventh message is used to transmit the first data to the destination device. The aforementioned seventh message may, for example, be the second unicast message in the following embodiments.

[0021] In one possible implementation, the method further includes: determining whether the destination device of the first data has received the first data within a second preset time period; if at least one destination device has not received the first data, the destination device that has not received the first data is taken as a new destination device and the first data is retransmitted to the new destination device.

[0022] In one possible implementation, the fifth message includes a first field, which is a first value used to record that the first message is a multicast message; the first field is a second value used to record that the first message is a unicast message; and / or, the fifth message includes a second field, which is used to record the destination device of the fifth message when the fifth message is a multicast message.

[0023] In one possible implementation, the source device has a routing table that records the forwarding device for each device in the ad hoc network. The forwarding device is the next-hop device of the source device in the path from the source device to each device in the ad hoc network. Determining the forwarding device of the destination device includes: determining the forwarding device of the destination device according to the routing table.

[0024] Thirdly, embodiments of this application provide a first device, including: a processor; a memory; and one or more computer programs, wherein the computer programs are stored in the memory, and when the computer programs are executed by the processor, the first device performs the method of any one of the first aspects.

[0025] Fourthly, embodiments of this application provide a source device, including: a processor; a memory; and one or more computer programs, wherein the computer programs are stored in the memory, and when the computer programs are executed by the processor, the source device performs the method of any of the second aspects.

[0026] Fifthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the method of either the first or second aspect.

[0027] Sixthly, this application provides a computer program that, when executed by a computer, performs the method of either the first or the second aspect.

[0028] In one possible design, the program in the sixth aspect may be stored wholly or partially on a storage medium packaged with the processor, or it may be stored wholly or partially on a memory not packaged with the processor. Attached Figure Description

[0029] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0030] Figure 1 This is a schematic diagram of a self-organizing network structure provided in an embodiment of this application;

[0031] Figure 2 A schematic flowchart of a data transmission method provided in an embodiment of this application;

[0032] Figure 3 This is a schematic diagram of the UI interface provided in the embodiments of this application;

[0033] Figure 4 This is another schematic diagram of the data transmission method provided in the embodiments of this application;

[0034] Figure 5 This is yet another flowchart illustrating the data transmission method provided in the embodiments of this application;

[0035] Figure 6 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation

[0036] The terminology used in the implementation section of this application is for the purpose of explaining specific embodiments of this application only, and is not intended to limit this application.

[0037] With the widespread adoption of smartphones, tablets, smartwatches, wireless headphones, and other electronic devices, the number of devices owned by each user has increased accordingly. On the one hand, limitations in cost, device size, and power consumption prevent all electronic devices from having cellular access capabilities; on the other hand, current cellular and wireless access point coverage is limited, making it difficult to provide network access in sparsely populated areas. Therefore, the need to establish temporary ad-hoc networks among multiple electronic devices for data interaction and transmission, such as voice and SMS messages, is gradually increasing. However, due to limitations in network access capabilities and the capabilities of the electronic devices themselves, in some ad-hoc network scenarios, there may not be a single-hop reachable path between certain electronic devices, requiring relay devices in the network to forward data. How to achieve data transmission in ad-hoc networks is a problem that needs to be solved.

[0038] The data transmission method provided in this application embodiment can realize data transmission between electronic devices in an ad hoc network.

[0039] The data transmission method described in this application can be applied to Ad Hoc Networks (AD HOCs).

[0040] A self-organizing network (SAN) is a network without fixed routers, where electronic devices acting as nodes can move freely and communicate with each other in any way. A SAN can be considered a peer-to-peer network where all electronic devices are considered equal, eliminating the need for any central control node.

[0041] To better illustrate the data transmission method in the embodiments of this application, the following embodiments of this application will use... Figure 1 The implementation of the data transmission method in this application embodiment will be illustrated using the self-organizing network structure shown as an example. First, the network structure of this self-organizing network will be described.

[0042] The self-organizing network has a star topology and includes nine electronic devices, from device 1 to device 9. Figure 1 The connection between electronic devices indicates that the two electronic devices can communicate directly. For example, devices 1 and 2, devices 1 and 3, and devices 1 and 4 can communicate directly, and data transmission is reachable with a single hop. Devices 1 and 5, 1 and 6, and 1 and 7 cannot communicate directly. When transmitting data, device 4 needs to act as a relay device to forward the data, and data transmission is reachable with multiple hops.

[0043] In the data transmission method of this application embodiment, each device in the ad hoc network can be configured with a routing table, which can be established by the device using periodically sent heartbeat frames. The specific establishment method is not described in this application embodiment.

[0044] Each device's routing table records the path information between that device and other devices in the ad hoc network.

[0045] In this embodiment of the application, a device's routing table may include fields such as device address, forwarding address, and hop count; optionally, it may also include fields such as device name. A record in the routing table can be used to record path information between the device to which the routing table belongs (e.g., device 1) and another device (e.g., device 2) in the ad hoc network.

[0046] The device name can be used to record the names of other devices mentioned above (e.g., device 2).

[0047] The device address can be used to record the addresses of other devices mentioned above (e.g., device 2).

[0048] A forwarding address can be used to record the address of the next-hop device of the device belonging to the routing table in the path from the device to another device (e.g., device 2). This next-hop device can also be called a forwarding device, that is, the device that forwards data to the other device. It should be noted that if the device belonging to the routing table is directly connected to the other device, then the next-hop device of the device belonging to the routing table in the path from the device to the other device is the other device. In this embodiment, the device address of the other device in the routing table is the same as the forwarding address. In other words, if a device (e.g., device 1) is directly connected to another device (e.g., device 2), that is, one-hop reachable from one device to another, then in the routing table of the device (e.g., device 1), the forwarding device of the other device (e.g., device 2) is the device itself. In this embodiment, the forwarding address of the other device (e.g., device 2) is recorded as the device address, that is, the device address is the same as the forwarding address.

[0049] The hop count records the number of hops in the path from the device in the routing table to other devices. For example, Figure 1 For the connection between device 1 and device 2, since device 1 and device 2 are directly connected, the hop count is 1. Figure 1 The path from device 1 to device 8 contains 3 hops: device 1, to device 4, to device 6, and to device 8.

[0050] by Figure 1 Taking device 1 as an example, the routing table configured in device 1 is shown in Table 1 below.

[0051]

[0052]

[0053] Table 1

[0054] In this embodiment, device 1 and device 2 are directly connected without any forwarding device. Therefore, the forwarding device for device 2 is considered to be device 2 itself. Thus, the device address and forwarding address of device 2 in the routing table are the same, with a hop count of 1. Devices 3 and 4 are similar to device 2 and will not be described further. From device 1 to device 5, forwarding is required through device 4. Device 4 is the next-hop device for device 1, which is also the forwarding device for device 5. Therefore, the forwarding address corresponding to the device address of device 5 in the routing table is the address of device 4, with a hop count of 2. Devices 6 and 7 are similar to device 5 and will not be described further. From device 1 to device 8, forwarding is required through devices 4 and 6. Device 4 is the next-hop device for device 1, which is also the forwarding device for device 5. Therefore, the forwarding address corresponding to the device address of device 8 in the routing table is the address of device 4, with a hop count of 3. Device 9 is similar to device 8 and will not be described further.

[0055] The routing table configured in device 4 is shown in Table 2 below.

[0056] Equipment Name Device address Forwarding address Number of jumps Equipment 1 1 1 1 Equipment 2 2 2 1 Equipment 3 3 3 1 Equipment 5 5 5 1 Equipment 6 6 6 1 Equipment 7 7 7 1 Equipment 8 8 6 2 Equipment 9 9 6 2

[0057] Table 2

[0058] For device 4, devices 1 through 3 and devices 5 through 7 are all directly connected to device 4, meaning they are reachable by a single hop. Therefore, in the routing table of device 4, the device address and forwarding address of the above devices are the same, and the hop count is 1. In the path from device 4 to device 8, device 6 is the next-hop device of device 4, which is also the forwarding device of device 8. Therefore, the forwarding address corresponding to the device address of device 8 is the address of device 6, and the hop count is 2. Device 9 is similar to device 8, and will not be described further.

[0059] Figure 1 The principle of establishing routing tables in other devices is the same as that of establishing routing tables in devices 1 and 4 mentioned above. The specific implementation of routing tables in other devices will not be listed here.

[0060] The message structures that can be used in the embodiments of this application are illustrated by way of example.

[0061] The message structure is shown in Table 3 below. The unit for each field in the message is octets.

[0062] The Control field can be 1 Octet and is used to indicate control information in the message header.

[0063] The Length field can be 2 Octets, used to indicate the message length.

[0064] The source address can be 0.5 octets or 4 octets, used to indicate the address of the source device of the message. Optionally, since the same device can be located in two or more ad hoc networks simultaneously, the source address can also be used to indicate the ad hoc network to which the source device belongs in order to further indicate the ad hoc network to which the source device belongs. The specific indication method is not limited in the embodiments of this application.

[0065] The destination address can be 0.5 octets or 4 octets, used to indicate the address of the destination device when the message is a unicast message. Optionally, since the same device can be located in two or more ad hoc networks simultaneously, the destination address can also be used to indicate the ad hoc network to which the destination device belongs in order to further indicate the ad hoc network to which the destination device belongs. The specific indication method is not limited in the embodiments of this application.

[0066] The multicast address is 0 octets or 2 octets, used to indicate the addresses of multiple destination devices when the message is a multicast message. Optionally, the multicast address field can use a 2-byte hashmap to indicate the corresponding destination device. Optionally, since the same device can be located in two or more ad hoc networks simultaneously, the multicast address can also be used to indicate the ad hoc network to which the destination device belongs in order to further indicate the ad hoc network to which the destination device belongs. The specific indication method is not limited in the embodiments of this application.

[0067] The payload has a variable size and is used to carry data that needs to be transmitted in messages.

[0068]

[0069] Table 3

[0070] The structure of the control field in the message is shown in Table 4 below. Each field in the control field is in bits and includes:

[0071] The Version field can be 2 bits and is used to indicate the version information of the protocol used in the message.

[0072] The Service type field can be 3 bits and is used to indicate the specific business type.

[0073] The Multicast field can be 1 bit and is used to indicate whether a message is a multicast message.

[0074] The short address field can be 1 bit and is used to indicate the length of the source address field and the destination address field;

[0075] The Reserve field is 1 bit.

[0076] Field Version Service type Multicast Short Address Reserve Bits 2 3 1 1 1

[0077] Table 4

[0078] Optionally, the multicast address field can be indicated by the multicast field in the control field to indicate whether it exists. For example, when the multicast field is 0, the multicast address field does not exist, and when it is 1, the multicast address field exists.

[0079] Based on the above description of the message structure, the embodiments of this application provide the specific message formats shown in Tables 5 and 6 below. The meanings of each field in Tables 5 and 6 are defined above.

[0080] Table 5 shows the structure of a unicast message provided in an embodiment of this application.

[0081]

[0082] Table 5

[0083] Table 6 shows the structure of a multicast message provided in an embodiment of this application.

[0084]

[0085]

[0086] Table 6

[0087] It should be noted that the above message structure is used as an example in the following embodiments of this application. However, the message structure used in the data transmission method of this application is not limited to the above structure. For example, some fields in the above structure can be merged or omitted, etc., and this application does not limit it.

[0088] Figure 2 This is a schematic diagram of the data transmission method provided in the embodiments of this application, such as... Figure 2 As shown, it includes:

[0089] Step 201: When the source device determines the destination device to send the first data, it acquires the first data.

[0090] A source device is a device in an ad hoc network that sends data to other devices. A source device can be any device in the ad hoc network.

[0091] When a user needs to transmit initial data from a source device to a device in an ad hoc network, they can select the destination device for the initial data within the user interface (UI) provided by the source device. For example... Figure 3 In the interface 310 shown, the source device is Figure 1 Taking device 1 in the example where the user selects devices 2 through 9 in the ad hoc network as the destination devices, the source device can obtain the destination device for the first data based on the user's operations in the UI interface. It should be noted that the number of destination devices can be one or more; the specific number of devices is not limited in this embodiment.

[0092] Alternatively, the source device can record the destination device by using the address of the destination device.

[0093] Optionally, the aforementioned first data may include, but is not limited to, audio data, image data, SMS messages, and other data.

[0094] Step 202: The source device obtains the hop count and forwarding device of the destination device. For the destination device with a hop count of 1 and a forwarding device that is different from the forwarding devices of other destination devices, proceed to step 203. For other destination devices, proceed to step 204.

[0095] Optionally, the source device may have a routing table as shown in Tables 1 and 2 above. In this case, the source device may obtain the hop count and forwarding device of the destination device from the routing table of the source device.

[0096] Step 203: The source device sends the first unicast message to the destination device, and this branch process ends.

[0097] The first unicast message can record the source device, the destination device, and the type of the first unicast message (unicast).

[0098] Optionally, this step may further include: the source device determining within a first duration whether it has received a message indication message for the first unicast message sent by the destination device. This message indication message is used to instruct the destination device to receive the first unicast message. If the source device receives the aforementioned message indication message sent by the destination device within the first duration, the source device determines that the destination device has received the first data; if the source device does not receive the aforementioned message indication message sent by the destination device within the first duration, the source device determines that the destination device has not received the first data.

[0099] It should be noted that each first unicast message can carry some or all of the first data. If a first unicast message carries some of the first data, the source device needs to send multiple first unicast messages to transmit all of the first data.

[0100] Step 204: The source device determines whether there are at least two destination devices with the same forwarding device. If so, proceed to step 205; otherwise, proceed to step 206.

[0101] Step 205: For each group of destination devices with the same forwarding device, the source device sends the first set of broadcast messages to that forwarding device; for each destination device with different forwarding devices, the source device sends a second unicast message to the forwarding device of each destination device. This branch process ends.

[0102] The first group of broadcast messages is used to send the first data to a group of destination devices corresponding to the forwarding device.

[0103] It should be noted that each first group broadcast message can carry some or all of the first data. If a first group broadcast message carries some of the first data, the source device needs to send multiple first group broadcast messages to achieve the transmission of all the first data.

[0104] Optionally, the first set of broadcast messages may record the source device and destination device of the first set of broadcast messages. Specifically, the first set of broadcast messages may include: the address of the source device and the address of each destination device in the set of destination devices.

[0105] Optionally, the first multicast message can be implemented using, for example, the message structure shown in Table 6. In this case, the source address field is used to record the source device of the first multicast message, the multicast field can be set to 1 to indicate that the first multicast message is multicast, and the multicast address field is used to record the destination device of the first multicast message.

[0106] The second unicast message is used to transmit the first data to the destination device.

[0107] It should be noted that each second unicast message can carry part or all of the first data. If a second unicast message carries part of the first data, the source device needs to send multiple second unicast messages to achieve the transmission of all the first data.

[0108] Optionally, the second unicast message may record the source device and destination device of the first unicast message. Specifically, the first unicast message may include the address of the source device and the address of the destination device.

[0109] Optionally, the second unicast message can be implemented using the message structure shown in Table 5. In this case, the source address field is used to record the source device of the first unicast message, the multicast field can be set to 0 to indicate that the second unicast message is unicast, and the destination address field is used to record the destination device of the second unicast message.

[0110] For example, if the source device is Figure 1 Device 1 in the middle, the target device is Figure 1If devices 2 to 9 are in the routing table shown in Table 1, then devices 4 to 9 have the same forwarding device. The forwarding devices of devices 2 and 3 are different from the forwarding devices of other devices. Therefore, for the group of destination devices 4 to 9, device 1 sends the first group of broadcast messages to the forwarding device 4, and sends the second unicast messages to devices 2 and 3 respectively.

[0111] The first group of broadcast messages sent by device 1 to device 4 includes the following information: the source address field is used to record device 1, the multicast field is set to 1, and the multicast address field is used to record devices 4 to 9.

[0112] The second unicast message sent by device 1 to device 2 includes the following information: the source address field is used to record device 1, the multicast field is set to 0, and the destination address field is used to record device 2.

[0113] The second unicast message sent by device 1 to device 3 includes the following information: the source address field is used to record device 1, the multicast field is set to 0, and the destination address field is used to record device 3.

[0114] It should be noted that in practical applications, there may be situations where the same device is located in multiple ad hoc networks. To enable devices simultaneously located in multiple ad hoc networks to distinguish the ad hoc networks to which a message, its source device, and destination device belong, the first multicast message and the first unicast message can further record the ad hoc networks to which the source and destination devices belong when recording the source and destination devices. The information regarding the ad hoc networks to which the source and destination devices belong can be recorded in the source address field, destination address field, or multicast address field, or a new field can be set to record the information of the ad hoc network; this embodiment of the application does not impose limitations on this.

[0115] Optionally, after the source device sends the first set of broadcast messages in this step, it can determine within a first duration whether it has received a message indication message for the first set of broadcast messages from the forwarding device, and within a second duration whether it has received a data indication message for the first set of broadcast messages from the forwarding device. The second duration is longer than the first duration.

[0116] The aforementioned message indication message can be used to indicate whether the forwarding device has received the first multicast message. If no message indication message for the first multicast message is received from the forwarding device within the first time interval, it indicates that the forwarding device has not received the first multicast message. The second time interval can then be stopped, and the transmission of the first multicast message is determined to have failed, meaning the transmission of the first data to the group of destination devices corresponding to the first multicast message has failed. Subsequently, the first data can be retransmitted to the group of destination devices corresponding to the first multicast message. Continuing the previous example, device 1 is the source device, and devices 2-9 are the destination devices. If device 1 does not receive the message indication message sent by device 4, it indicates that device 4 has not received the first multicast message. Accordingly, device 1 can determine that devices 4-9 have not received the first data required to be transmitted by the first multicast message. Afterward, device 1 can retransmit the first data to devices 4-9. The specific transmission method can be, for example, using... Figure 2 The data transmission method shown.

[0117] The aforementioned data indication message can be used to indicate whether each destination device in the group of destination devices corresponding to the first group of broadcast messages has received the first data. If the source device receives the aforementioned message indication message sent by the forwarding device within the first time period and receives the aforementioned data indication message within the second time period, the source device can determine whether each destination device in the group of destination devices corresponding to the first group of broadcast messages has received the first data based on the data indication message. Continuing the previous example, device 1 is the source device, and devices 2 to 9 are the destination devices. The data indication message sent by device 4 to device 1 can be used to indicate whether each device in devices 4 to 9 has received the first data. Accordingly, device 1 can determine which devices in devices 4 to 9 have received the first data in the first group of broadcast messages and which devices have not received the first data in the first group of broadcast messages, and can use the destination devices that have not received the first data as the destination devices for the next retransmission of the first data.

[0118] Optionally, after the source device sends the second unicast message in this step, it can determine within a third time period whether it has received a message indication message for the second unicast message from the forwarding device, and within a fourth time period whether it has received a data indication message for the second unicast message from the forwarding device. The fourth time period is longer than the third time period. The third time period may be equal to or unequal to the first time period, and the second time period may be equal to or unequal to the fourth time period; this embodiment of the application does not impose any limitations on this.

[0119] The aforementioned message indication message for the second unicast message can be used to indicate whether the forwarding device has received the second unicast message. If the forwarding device does not receive the message indication message for the second unicast message within the third time period, it means that the forwarding device has not received the second unicast message. The timer for the fourth time period can then be stopped, and the transmission of the second unicast message is determined to have failed. That is, the transmission of the first data to the destination device corresponding to the second unicast message has failed, and the source device determines that the destination device corresponding to the second unicast message has not received the first data.

[0120] The aforementioned data indication message for the second unicast message can be used to indicate whether the destination device corresponding to the second unicast message has received the first data; if the aforementioned message indication message sent by the forwarding device is received within the third time period, and the aforementioned data indication message is received within the fourth time period, the source device can determine whether the destination device of the second unicast message has received the first data based on the data indication message.

[0121] Optionally, after determining whether all destination devices have received the first data, the source device can then identify the destination devices that have not received the first data and use them as new destination devices to retransmit the first data. For example, if device 1 determines that devices 5 and 8 out of devices 2-9 have not received the first data, it can use devices 5 and 8 as destination devices and retransmit the first data to them. The retransmission method can, for example, use the data transmission method provided in the embodiments of this application.

[0122] It should be noted that the sending of the second unicast message in this step depends on whether there is a destination device whose forwarding address is different from that of other destination devices. If such a destination device does not exist under certain practical application conditions, then the above step of sending the second unicast message can be omitted.

[0123] Step 206: For each destination device with a different forwarding device, the source device sends a second unicast message to the forwarding device of each destination device. This branch of the process ends.

[0124] The implementation of this step can be referred to the relevant explanation and examples of the second unicast message in step 205, which will not be repeated here.

[0125] Figure 2 In the method shown, the source device determines whether to send a unicast or multicast message to the next-hop device based on the forwarding device of the destination device. Compared to the source device sending unicast messages to each destination device, this reduces the number of messages that need to be transmitted, greatly reducing the amount of data transmission between devices in the ad hoc network and the data processing overhead of each device, and reducing the possibility of network congestion in the ad hoc network.

[0126] It should be noted that in practical applications, Figure 2 The execution order of the steps in the illustrated embodiments can be adjusted. For example, in other embodiments provided in this application, after the source device obtains the hop count and forwarding device of the destination device, it can first determine whether there are multiple destination devices with the same forwarding device. For each group of destination devices with the same forwarding device, a multicast message is sent to its forwarding device. For destination devices whose forwarding devices are different from those of other destination devices, it is determined whether the hop count of the destination device is 1. For destination devices with a hop count of 1, a unicast message is sent to that destination device. For destination devices with a hop count greater than 1, a unicast message is sent to the forwarding device of that destination device. For specific implementation details, please refer to [reference needed]. Figure 2 The method shown will not be elaborated here.

[0127] Figure 4 This is a schematic diagram of the data transmission method provided in the embodiments of this application, such as... Figure 4 As shown, it includes:

[0128] Step 401: The first device receives the first message, which is used to transmit the first data.

[0129] The first device can be any device in the self-organizing network other than the source device mentioned above.

[0130] Optionally, the first data may be carried by the payload field of the first message.

[0131] Optionally, after the first device receives the first message, this step may further include: the first device sending a message indication message for the first message to the next-hop device. The message indication message for the first message is used to indicate to the next-hop device that the first device has received the first message.

[0132] The aforementioned upstream device is the device that sends the first message to the first device. This device may be the source device or a relay device in the network.

[0133] Step 402: The first device determines whether the first message is a multicast message or a unicast message. If it is a multicast message, proceed to step 406; if it is a unicast message, proceed to step 403.

[0134] Optionally, the first message may include a field for recording whether the first message is a unicast message or a multicast message, such as the multicast field mentioned in the previous example. Different values ​​of this field indicate whether the first message is a unicast message or a multicast message. In this step, the first device can obtain this field from the first message and determine whether the first message is a multicast message or a unicast message based on the value of this field.

[0135] Continuing with the previous example, if the first message is implemented using the structure shown in Table 5 or Table 6, the first device can obtain the value of the multicast field from the first message. If the value is 0, it is determined that the first message is a unicast message; if the value is 1, it is determined that the first message is a multicast message.

[0136] Step 403: The first device obtains the destination device of the first message, and determines whether the destination device of the first message is the first device. If yes, proceed to step 404; otherwise, proceed to step 405.

[0137] Continuing with the previous example, the first device can obtain the destination device of the first message from the first message; specifically, it can obtain the destination device from the destination address of the first message.

[0138] For example, the first device is Figure 1 If the destination device of the first message is device 4, then in this step it can be determined that the destination device of the first message is the first device, and step 404 is executed; if the destination device of the first message is device 5, then in this step it can be determined that the destination device of the first message is not the first device, and step 405 is executed.

[0139] Step 404: The first device processes the first data in the first message, and this branch of the process ends.

[0140] Optionally, this step may further include: the first device sending a message indication message for the first message to the next-hop device. The message indication message for the first message is used to indicate that the first device has received the first message.

[0141] The aforementioned previous-hop device refers to the device that sends the first message to the first device. This previous-hop device may be the source device or a forwarding device for the first message.

[0142] Continuing with the previous example, the first device can obtain the first data from the payload field of the first message.

[0143] Step 405: The first device obtains the hop count of the destination device of the first message. If the hop count is equal to 1, the first message is sent to the destination device. If the hop count is greater than 1, the forwarding device of the destination device of the first message is determined, and the first message is sent to the forwarding device. This branch process ends.

[0144] The first device may be configured with routing tables as shown in Tables 1 and 2. The routing tables record the forwarding devices and hop counts of each device in the ad hoc network. In this step, the first device can determine the hop count and forwarding devices of the destination device of the first packet based on the routing tables.

[0145] Continuing with the example in step 403, the destination device of the first message is device 5. Device 4 can determine that the hop count of device 5 is 1 based on its routing table and send the first message to device 5.

[0146] Optionally, if the hop count is equal to 1, after sending the first message to the destination device, the first device may determine within a fifth preset time period whether it has received a message indication message for the first message sent by the destination device, so as to determine whether the destination device has received the first message and the first data.

[0147] Optionally, if the hop count is greater than 1, after sending the first message to the forwarding device, the first device may determine within a sixth preset time period whether it has received a message indication message for the first message from the forwarding device, and within a seventh time period whether it has received a data indication message for the first message from the forwarding device. The seventh time period is longer than the sixth time period.

[0148] In this step, the message indication message for the first message can be used to indicate that the forwarding device has received the first message; the data indication message for the first message in this step can be used to indicate whether the destination device of the first message has received the first data.

[0149] If no message indication message for the first message is received from the forwarding device within the sixth time period, it indicates that the forwarding device has not received the first message, and the seventh time period can be stopped, indicating that the transmission of the first message has failed, that is, the transmission of the first data to the destination device corresponding to the first message has failed; or, if the aforementioned message indication message is received from the forwarding device within the sixth time period, but no aforementioned data indication message is received within the seventh time period, it is determined that the destination device corresponding to the first message has not received the first data; in both cases, the first device can send a data indication message for the first message to the upstream device, which is used to indicate that the destination device has not received the first data.

[0150] If the first device receives the aforementioned message indication message from the forwarding device within the sixth time period and the aforementioned data indication message within the seventh time period, the first device may forward the data indication message to the previous hop device to indicate to the previous hop device whether the destination device of the first message has received the first data.

[0151] Step 406: The first device acquires each destination device of the first message.

[0152] Since the first message is a multicast message, the first device can obtain the message destined for multiple devices.

[0153] Continuing with the previous example, if the first message is implemented using the structure shown in Table 6, then the first device can obtain each destination device of the first message from the multicast address field of the first message.

[0154] Step 407: The first device determines whether the destination device includes the first device. If it does, proceed to step 408; otherwise, proceed to step 409.

[0155] Step 408: The first device processes the first data in the first message and executes step 409.

[0156] It should be noted that the execution order of steps 408 and 409 is not limited in this embodiment of the application.

[0157] Step 409: The first device obtains the hop count and forwarding device of each destination device other than the first device in the destination devices of the first message. For the destination device with a hop count of 1 and a forwarding device that is different from the forwarding devices of other destination devices, step 410 is executed. For other destination devices, step 411 is executed.

[0158] Optionally, the first device may be configured with a routing table as shown in Tables 1 and 2 above, so that the first device can obtain the hop count of the destination device and the forwarding device according to the routing table.

[0159] Step 410: The first device sends a third unicast message to the destination device, and this branch process ends.

[0160] Optionally, this step may further include: the first device determining within an eighth time period whether it has received a message indication message for the third unicast message sent by the destination device. This message indication message is used to indicate that the destination device has received the third unicast message. If the first device receives the aforementioned message indication message sent by the destination device within the eighth time period, the first device determines that the destination device has received the first data; if the first device does not receive the aforementioned message indication message sent by the destination device within the eighth time period, the first device determines that the destination device has not received the first data.

[0161] Step 411: The first device determines whether there are at least two destination devices with the same forwarding device. If yes, proceed to step 412; otherwise, proceed to step 413.

[0162] Step 412: For each group of destination devices with the same forwarding device, the first device sends a second set of broadcast messages to that forwarding device; for each destination device with different forwarding devices, the first device sends a fourth unicast message to the forwarding device of each destination device. This branch process ends.

[0163] This step can be implemented with reference to step 205. The main difference is that the execution subject is replaced from the source device to the first device, and the destination device is replaced from the destination device of the first data to the destination device of the first message.

[0164] Optionally, after the first device sends the second set of broadcast messages in this step, it can determine within the ninth time period whether it has received a message indication message for the second set of broadcast messages from the forwarding device, and within the tenth time period whether it has received a data indication message for the second set of broadcast messages from the forwarding device. The ninth time period is longer than the tenth time period.

[0165] The aforementioned message indication message can be used to indicate that the forwarding device has received the second group of broadcast messages. If no message indication message for the second group of broadcast messages is received from the forwarding device within the ninth time period, it indicates that the forwarding device has not received the second group of broadcast messages, and the tenth time period can be stopped. The first device determines that the transmission of the second group of broadcast messages has failed, that is, the transmission of the first data to the group of destination devices corresponding to the second group of broadcast messages has failed, and the first device can determine that the group of destination devices corresponding to the second group of broadcast messages has not received the first data.

[0166] The aforementioned data indication message for the second group of broadcast messages can be used to indicate whether each destination device in the group of destination devices corresponding to the second group of broadcast messages has received the first data. If the aforementioned message indication message sent by the forwarding device is received within the ninth time period, and the aforementioned data indication message is not received within the tenth time period, the first device can determine that the group of destination devices corresponding to the second group of broadcast messages has not received the first data; if the aforementioned message indication message sent by the forwarding device is received within the ninth time period, and the aforementioned data indication message is received within the tenth time period, the first device can determine whether each destination device in the group of destination devices corresponding to the second group of broadcast messages has received the first data based on the data indication message.

[0167] Optionally, after the first device sends the fourth unicast message in this step, it can determine within an eleventh time period whether it has received a message indication message for the fourth unicast message from the forwarding device, and within a twelfth time period whether it has received a data indication message for the fourth unicast message from the forwarding device. The twelfth time period is longer than the eleventh time period.

[0168] The aforementioned message indication message for the fourth unicast message can be used to indicate whether the forwarding device has received the fourth unicast message. The aforementioned data indication message for the fourth unicast message can be used to indicate whether the destination device corresponding to the fourth unicast message has received the first data.

[0169] If no message indication message for the fourth unicast message is received from the forwarding device within the eleventh time period, it means that the forwarding device has not received the fourth unicast message. The timer for the twelfth time period can then be stopped, and the transmission of the fourth unicast message is determined to have failed. That is, the transmission of the first data to the destination device corresponding to the fourth unicast message has failed. The first device can determine that the destination device corresponding to the fourth unicast message has not received the first data.

[0170] If the aforementioned message indication message is received from the forwarding device within the eleventh time period, and the aforementioned data indication message is not received within the twelfth time period, the first device can also determine that the destination device corresponding to the fourth unicast message has not received the first data.

[0171] If the aforementioned message indication message sent by the forwarding device is received within the eleventh time period, and the aforementioned data indication message is received within the twelfth time period, the first device can determine whether the destination device of the fourth unicast message has received the first data based on the data indication message.

[0172] Optionally, after determining whether all destination devices of the first message have received the first data, the first device may send a data reception message for the first message to the next-hop device to indicate to the next-hop device whether each destination device of the first message has received the first data. This feedback is repeated level by level, feeding back whether each destination device of the first data has received the first data to the source device, so that the source device can determine whether to retransmit the first data and to which devices to retransmit the first data.

[0173] Step 413: For each destination device with different forwarding devices, the first device sends a fourth unicast message to the forwarding device of each destination device. This branch of the process ends.

[0174] This step can be implemented with reference to step 206. The main difference is that the execution subject is changed from the source device to the first device, and the destination device is changed from the destination device of the first data to the destination device of the first message.

[0175] Optionally, after the first device sends the fourth unicast message, it can also set a duration to receive the message indication message and data indication message sent by the forwarding device. For specific implementation, please refer to step 412, which will not be elaborated here.

[0176] Figure 4 In the method shown, when forwarding the first message, the first device determines whether to send a unicast message or a multicast message based on the forwarding device of the destination device of the first message. Compared with the first device forwarding unicast messages for each destination device, the number of messages that need to be transmitted is reduced, which greatly reduces the amount of data transmission between devices in the ad hoc network and the data processing overhead of the first device, and reduces the possibility of network congestion in the ad hoc network.

[0177] It should be noted that in practical applications, Figure 4The execution order of the steps in the illustrated embodiments can be adjusted. For example, in other embodiments provided in this application, after the first device obtains the hop count and forwarding device of the destination device of the first message, it can first determine whether there are multiple destination devices with the same forwarding device. For each group of destination devices with the same forwarding device, a multicast message is sent to its forwarding device. For destination devices whose forwarding devices are different from those of other destination devices, it is determined whether the hop count of the destination device is 1. For destination devices with a hop count of 1, a unicast message is sent to that destination device. For destination devices with a hop count greater than 1, a unicast message is sent to the forwarding device of that destination device. For specific implementation details, please refer to [reference needed]. Figure 4 The method shown will not be elaborated here.

[0178] The following is based on Figure 1 The self-organizing network structure shown is used to illustrate the data transmission method of the embodiments of this application.

[0179] In the following embodiments, it is assumed that device 1 is the source device, devices 2 to 9 are all destination devices, device 4 is a forwarding device for devices 5 to 9, and device 6 is a forwarding device for devices 8 to 9. Data is transmitted between devices using unicast messages as shown in Table 5 and multicast messages as shown in Table 6. Therefore, the data transmission method of this application embodiment is as follows: Figure 5 As shown, it includes:

[0180] Step 501: Device 1 determines to transmit the first data to devices 2-9.

[0181] Device 1 determines that it will transmit the first data to devices 2 to 9, that is, device 1 determines that the destination devices for the first data are devices 2 to 9.

[0182] Step 502: Device 1 obtains the hop count and forwarding device for each destination device from the routing table.

[0183] If device 1 has a routing table as shown in Table 1, then the hop count and forwarding devices for each device in devices 2 to 9 can be found in Table 1, which will not be elaborated here.

[0184] Step 503: Device 1 determines that the forwarding device of Device 2 (Device 2) is different from the forwarding devices of Devices 3 to 9 and has a hop count of 1. It sends a unicast message 1 to Device 2 and determines whether it receives the message indication message sent by Device 2 within a preset time period t1. Then, it executes step 504.

[0185] The source device of unicast message 1 is device 1, the destination device is device 2, and the payload is the first data.

[0186] In one possible implementation, unicast message 1 can adopt the unicast message structure shown in Table 5, wherein the source address field can be used to indicate that the source device is device 1, the multicast field can be 0 to indicate that the message is a unicast message, the multicast address field is defaulted, the destination address field can be used to indicate that the destination device is device 2, and the specific values ​​of other fields in unicast message 1 can be set in actual application, which is not restricted here.

[0187] Step 504: Device 2 receives unicast message 1, sends message indication message 1 to device 1, and device 2 determines that unicast message 1 is a unicast message and that the destination device is device 2. Device 2 processes the first data in unicast message 1. Correspondingly, device 1 receives message indication message 1 sent by device 2 within time t1, and determines that device 2 has received the first data. This branch process ends.

[0188] The aforementioned message indication message 1 is used to indicate to device 1 that device 2 has received unicast message 1.

[0189] Continuing with the example in step 503, if unicast message 1 uses the message structure shown in Table 5, after receiving unicast message 1, device 2 can obtain the value of the multicast field from the multicast field of unicast message 1, thus determining that unicast message 1 is a unicast message; device 2 can obtain the destination device of the unicast message as device 2 from the destination address field of unicast message 1, thus determining that the destination device of unicast message 1 is device 2; after determining that the destination device of unicast message 1 is device 2, device 2 can obtain the first data from the payload field of unicast message 1 and process the first data.

[0190] In this step, we take the example of device 2 receiving unicast message 1 and promptly sending back message indication message 1. In other embodiments, device 2 may not receive unicast message 1 or may not promptly send back message indication message 1 to device 1. If device 1 does not receive message indication message 1 sent by device 2 within time t1, then device 1 determines that device 2 has not received unicast message 1, that is, it has not received the first data. After that, device 1 can retransmit unicast message 1 to device 2. The retransmission process is not described here.

[0191] It should be noted that since device 3 is similar to device 2, it is reachable from device 1 via a single hop and does not act as a forwarding device for other devices. Therefore, the process of device 1 sending unicast messages to device 3 and device 3 sending message indication messages back can refer to steps 503 to 504 above, and will not be repeated in this embodiment.

[0192] Step 505: Device 1 determines that all forwarding devices from Device 4 to 9 are Device 4, sends multicast message 1 to Device 4, determines whether it receives the message indication message sent by Device 4 within a preset time period t2, and determines whether it receives the data indication message sent by Device 4 within a preset time period t3; then proceeds to step 508.

[0193] The execution order between step 505 and steps 503 to 504 is not restricted.

[0194] Step 506: Device 4 receives multicast message 1 and sends message indication message 2 to device 1; correspondingly, device 1 receives message indication message 2 sent by device 4 within time t2; proceed to step 507.

[0195] Message indication message 2 is used to indicate to device 1 that device 4 has received multicast message 1.

[0196] Step 507: Device 4 determines that the received multicast message 1 is a multicast message and determines that the destination device of multicast message 1 is device 4 to 9.

[0197] The source device of multicast message 1 is device 1, the destination devices are devices 4 to 9, and the payload is the first data.

[0198] In one possible implementation, multicast message 1 can be implemented using the multicast message structure shown in Table 6. The source address field can be used to indicate that the source device is device 1, the multicast field can be 1 to indicate that the message is a multicast message, the multicast address field is used to record that the destination device is device 4 to 9, the destination address field can be omitted, and the specific values ​​of other fields in multicast message 1 can be set in actual applications, which is not restricted here.

[0199] Step 508: Device 4 determines that the destination device includes device 4, processes the first data in multicast message 1; and device 4 obtains the hop count and forwarding device of devices 5 to 9 other than device 4 in the destination device from the routing table.

[0200] Device 4 can obtain the first data from the payload of multicast message 1 and process the first data.

[0201] Device 4 can look up the hop counts and forwarding devices of devices 5 through 9 in its routing table, thereby determining the hop counts and forwarding devices of devices 5 through 9 other than device 4 in the destination device. Taking the routing table in device 4 as shown in Table 2 as an example, device 4 can look up the hop counts and forwarding devices of devices 5 through 9 in Table 2. For details, please refer to Table 2, which will not be elaborated here.

[0202] Step 509: Device 4 determines that the forwarding device of Device 5 (Device 5) is different from the forwarding devices of Devices 6 to 9 and the hop count is equal to 1. It sends a unicast message 2 to Device 5 and determines whether it receives the message indication message sent by Device 5 within a preset time period t4. Then, it executes step 510.

[0203] Step 510: Device 5 receives unicast message 2, sends message indication message 3 to device 4, and determines that unicast message 2 is a unicast message and that the destination device is device 5. Device 5 processes the first data in unicast message 2; correspondingly, device 4 receives message indication message 3 sent by device 5 within time t4. This branch process ends.

[0204] Message indication message 3 is used to indicate to device 4 that device 5 has received unicast message 2.

[0205] Device 4 receives message indication message 3 sent by device 5, which confirms that device 5 has received the data in multicast message 1.

[0206] It should be noted that since device 7 is similar to device 5 and can only be reached by one hop from device 4, and does not act as a forwarding device for other devices, the process of device 4 sending unicast messages to device 7 and device 7 sending message indication messages back can refer to steps 509 to 510 above, and will not be repeated in this embodiment.

[0207] Step 511: Device 4 determines that Device 6 and Devices 8-9 are all forwarding devices of Device 6, sends multicast message 2 to Device 6, and determines whether it receives the message indication message sent by Device 6 within a preset time t5, and whether it receives the data indication message sent by Device 6 within a preset time t6; then proceed to step 512.

[0208] The execution order between step 511 and steps 509 to 510 is not restricted.

[0209] Step 512: Device 6 receives multicast message 2 and sends message indication message 4 to device 4; correspondingly, device 4 receives message indication message 4 sent by device 6 within time t5; proceed to step 513.

[0210] Step 513: Device 6 determines that the received multicast message 2 is a multicast message and identifies the destination devices of multicast message 2 as devices 6, 8, and 9.

[0211] Step 514: Device 6 determines that the destination device includes Device 6, processes the data in multicast message 2; and Device 6 obtains the hop count and forwarding device of devices 8 to 9 from the routing table.

[0212] Specifically, device 6 determines that the forwarding device of device 8 is device 8 with a hop count of 1, and device 9 determines that the forwarding device of device 9 is device 9 with a hop count of 1.

[0213] Step 515: Device 6 determines that the forwarding device of Device 8 (Device 8) is different from the forwarding device of Device 9 (Device 9) and the hop count is 1. It sends a unicast message 3 to the forwarding device of Device 8 (Device 8) and determines whether it receives the message indication message sent by Device 8 within the preset time t7. Then, proceed to step 516.

[0214] Step 516: Device 8 receives unicast message 3, sends message indication message 5 to device 6, and device 8 determines that unicast message 3 is a unicast message and that the destination device is device 8. Device 8 processes the data in unicast message 3, and this branch process ends; correspondingly, device 6 receives message indication message 5 sent by device 8 within time t7.

[0215] It should be noted that, since device 9 is similar to device 8 and is reachable from device 6 via a single hop, and does not act as a forwarding device for other devices, the process of device 6 sending unicast messages to device 9 and device 9 sending message indication messages back can refer to steps 515 to 516 above, and will not be repeated in this embodiment.

[0216] Step 517: Device 6 receives message indication message 4 sent by device 8 within a preset time period t7, and receives message indication message 5 sent by device 9 within a preset time period t8, and sends data indication message 1 to device 4.

[0217] Data indication message 1 is used to indicate to device 4 that devices 6, 8, and 9 have received the first data in multicast message 2.

[0218] Step 518: Device 4 receives data indication message 1 sent by device 6 within the preset time period t6, receives message indication message sent by device 5 within the corresponding time period of device 5, receives message indication message sent by device 7 within the corresponding time period of device 7, and then sends data indication message 2 to device 1.

[0219] Data indication message 2 is used to indicate to device 1 that devices 4 to 9 have all received the data in multicast message 1.

[0220] It should be noted that in practical applications, there may be a situation where one of the devices 4 to 9 does not receive the message. For example, device 5 does not receive the unicast message 2 sent by device 4, and therefore device 4 does not receive the message indication message fed back by device 5. In this case, the data indication message 2 sent by device 4 can indicate that devices 4 and devices 6 to 9 have received the data in multicast message 1, and device 5 has not received the data in multicast message 1.

[0221] Step 519: Device 1 determines whether each of Devices 2 to 9 has received the first data based on the received message indication message and data indication message, and determines whether to retransmit the first data accordingly.

[0222] Specifically, if a device fails to receive the first data, device 1 can identify the device that failed to receive the first data as the new destination device and retransmit the first data. The retransmission process will not be described in detail here.

[0223] The data transmission method provided in this application embodiment, compared to the source device sending unicast messages to each device, can reduce the processing overhead of relay devices and reduce the possibility of network congestion. Continuing the previous example, and assuming that the source device (device 1) sends unicast messages to each destination device (devices 2-9), device 1 needs to send 5 unicast messages with the same data segment but different destination addresses to device 4, which increases the message processing overhead of device 4. Moreover, the message processing overhead increases linearly with the number of destination devices passing through the relay node. Device 6 also has the same problem as device 4, all of which increase the possibility of network congestion. However, in this application embodiment, device 1 only needs to send a single multicast message to device 4, which greatly reduces the amount of data transmission between device 1 and device 2 and the amount of data that device 1 needs to process, thus reducing the possibility of network congestion.

[0224] The data transmission method provided in this application, compared to the data transmission method where the source device broadcasts to each destination device, can improve the utilization of time and frequency resources and the reliability of data transmission. For example, if the source device adopts the data transmission method of broadcasting to each destination device, multiple broadcast channels need to be divided. The frame sequence for broadcasting is performed on device 1, and other devices need to listen to the corresponding broadcast channels, causing other unicast services operating on different channels to become unavailable. On the other hand, dividing too many broadcast channels will affect the transmission efficiency of the entire network. Specifically, when a device operates at 2.4 GHz and occupies 20 MHz of bandwidth at the same time, a total of 10 frequency domain channels are divided, each with a bandwidth of 2 MHz. Under the scheme of using broadcast exclusively, the channel capacity is only 1 / 10 of that under the unicast scheme. However, in this application embodiment, multicast messages do not need to be sent through broadcast channels, so there is no need to divide too many broadcast channels, and it does not affect the sending and receiving of unicast messages operating on different channels.

[0225] The data transmission method provided in this application, compared to the Internet Group Management Protocol (IGMP) multicast protocol, does not require additional multicast routers and the corresponding multicast protocol's collaborative implementation. In existing wired networks based on the Internet Protocol (IP) environment, separate multicast routers and the IGMP protocol are needed to maintain multicast groups. The establishment and updating of these multicast groups require additional control message interactions, making them unsuitable for the scenario of multiple devices forming a temporary self-organizing network.

[0226] In the data transmission method provided in this application embodiment, the control field of the message is provided with a multicast field. The message has different message structures, such as those shown in Table 5 or Table 6, depending on whether the message indicated by the multicast field is a unicast message or a multicast message, thereby supporting the transmission of unicast and multicast messages between devices.

[0227] like Figure 6 The diagram shown is a structural schematic of an electronic device provided in an embodiment of this application. Figure 6 As shown, the electronic device may include: a processor 610, a memory 620, and a communication module 630; wherein,

[0228] Optionally, to further enhance the functionality of the electronic device, it may also include: an antenna, a mobile communication module, a wireless communication module, an audio module, a speaker, a receiver, a microphone, a headphone jack, etc., which are not limited in the embodiments of this application.

[0229] Processor 610 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.

[0230] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.

[0231] The processor 610 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 610 is a cache memory. This memory can store instructions or data that the processor 610 has just used or that are used repeatedly. If the processor 610 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 610, and thus improves the efficiency of the system.

[0232] The memory 620 can be used to store computer executable program code, which includes instructions. The memory 620 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of the electronic device 600 (such as audio data, phonebook, etc.). Furthermore, the memory 620 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. The processor 610 executes various functional applications and data processing of the electronic device 600 by running instructions stored in the memory 620 and / or instructions stored in memory disposed within the processor.

[0233] The communication module 630 is used to communicate with other devices in the self-organizing network. The communication can be wired or wireless, and this application embodiment does not limit the communication.

[0234] The code for the above data transmission method can be stored in the memory 620, and the processor 610 can execute the code in the memory, thereby enabling the electronic device to perform the data transmission method provided in the above embodiments.

[0235] This application provides a data transmission system, including the source device and the first device described in the above embodiments.

[0236] This application also provides an electronic device, including a processor and a memory, wherein the processor is used to execute the method provided in any embodiment of this application.

[0237] This application also provides an electronic device, which includes a storage medium and a central processing unit. The storage medium may be a non-volatile storage medium, and a computer-executable program is stored in the storage medium. The central processing unit is connected to the non-volatile storage medium and executes the computer-executable program to implement the method provided in any embodiment of this application.

[0238] This application also provides a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the method provided in any embodiment of this application.

[0239] This application also provides a computer program product, which includes a computer program that, when run on a computer, causes the computer to perform the method provided in any embodiment of this application.

[0240] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent the existence of A alone, A and B simultaneously, or B alone. A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of singular or plural items. For example, at least one of a, b, and c can represent: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, and c can be single or multiple.

[0241] Those skilled in the art will recognize that the units and algorithm steps described in the embodiments disclosed herein can be implemented using electronic hardware, computer software, or a combination of electronic hardware and software. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0242] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0243] In the several embodiments provided in this application, any function, if implemented as a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a 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 to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0244] The above description is merely a specific embodiment of this application. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the protection scope of this application. The protection scope of this application should be determined by the protection scope of the claims.

Claims

1. A data transmission method, characterized in that, The first device used in ad hoc networks includes: Receive the first message; the first message is used to transmit the first data; When it is determined that the first message is a multicast message, the destination device of the first message is determined; For destination devices other than the first device, determine the forwarding device for the destination device; the forwarding device is the next-hop device of the first device in the path from the first device to the destination device. For the destination devices other than the first device, determine the hop count of the destination device; the hop count of the destination device refers to the number of hops included in the path from the first device to the destination device; When multiple destination devices have the same forwarding device, a second message is sent to the forwarding device of the multiple destination devices. The second message is a multicast message and is used to transmit the first data to the multiple destination devices. When there is a destination device whose forwarding device is different from the forwarding devices of other destination devices and has a hop count of 1, a third message is sent to the destination device. The third message is a unicast message and is used to transmit the first data to the destination device. If a forwarding device for a destination device is different from the forwarding devices for other destination devices and has a hop count greater than 1, a fourth message is sent to the forwarding device of that destination device. The fourth message is a unicast message and is used to transmit the first data to that destination device.

2. The method according to claim 1, characterized in that, Also includes: When the destination device of the first message includes the first device, the first data is obtained from the first message and processed.

3. The method according to claim 1, characterized in that, Also includes: When it is determined that the first message is a unicast message, the destination device of the first message is determined; If the destination device of the first message is not the first device, then obtain the forwarding device of the destination device of the first message; The first message is sent to the forwarding device.

4. The method according to claim 3, characterized in that, Also includes: When the destination device of the first message is the first device, the first data is obtained from the first message and processed.

5. The method according to any one of claims 1 to 4, characterized in that, Also includes: Within a first preset time period, it is determined whether the destination device of the first message has received the first data, and the determined information is sent to the second device, which is the device that sent the first message to the first device.

6. The method according to any one of claims 1 to 4, characterized in that, After receiving the first message, the process further includes: A first message is sent to a second device in response to the first message. The first message is used to indicate that the first device has received the first message. The second device is the device that sent the first message to the first device.

7. The method according to claim 1, characterized in that, The first message includes a first field, which is a first value used to record that the first message is a multicast message. Determining that the first message is a multicast message includes: The first field of the first message is determined to be the first value.

8. The method according to claim 3, characterized in that, The first message includes a first field, the first field being a second value used to record whether the first message is a unicast message, and determining that the first message is a unicast message includes: The first field of the first message is determined to be the second value.

9. The method according to claim 1, characterized in that, The first message includes a second field, which is used to record the destination device of the first message when the first message is a multicast message. Determining the destination device of the first message includes: Obtain the destination device of the first message from the second field of the first message.

10. The method according to claim 9, characterized in that, The second field is specifically used to record the address of each destination device of the first message when the first message is a multicast message.

11. The method according to claim 1, characterized in that, The first device is equipped with a routing table, which is used to record the forwarding device of each device in the ad hoc network. The forwarding device is the next-hop device of the first device in the path from the first device to each device in the ad hoc network. The forwarding device that determines the destination device includes: The forwarding device for the destination device is determined based on the routing table.

12. A data transmission method, characterized in that, Source devices used in ad hoc networks include: Determine the destination device for the first data; Determine the forwarding device for the destination device; the forwarding device is the next-hop device of the source device in the path from the source device to the destination device. When multiple destination devices have the same forwarding device, a fifth message is sent to the forwarding device of the multiple destination devices. The fifth message is a multicast message and is used to transmit the first data to the multiple destination devices. Determine the hop count of the destination device; the hop count of the destination device refers to the number of hops included in the path from the source device to the destination device; When there is a destination device whose forwarding device is different from the forwarding devices of other destination devices and has a hop count of 1, a sixth message is sent to the destination device. The sixth message is a unicast message and is used to transmit the first data to the destination device. If a forwarding device for a destination device is different from the forwarding devices for other destination devices and has a hop count greater than 1, a seventh message is sent to the forwarding device of that destination device. The seventh message is a unicast message and is used to transmit the first data to that destination device.

13. The method according to claim 12, characterized in that, Also includes: Within a second preset time period, determine whether the destination device of the first data has received the first data; If at least one destination device fails to receive the first data, the destination device that failed to receive the first data is designated as a new destination device, and the first data is retransmitted to the new destination device.

14. The method according to claim 12 or 13, characterized in that, The fifth message includes a first field, which is a first value used to record that the fifth message is a multicast message; the first field is a second value used to record that the fifth message is a unicast message; and / or, The fifth message includes a second field, which is used to record the destination device of the fifth message when the fifth message is a multicast message.

15. The method according to claim 12 or 13, characterized in that, The source device is equipped with a routing table, which is used to record the forwarding device of each device in the ad hoc network. The forwarding device is the next-hop device of the source device in the path from the source device to each device in the ad hoc network. The forwarding device that determines the destination device includes: The forwarding device for the destination device is determined based on the routing table.

16. A first device, characterized in that, include: processor; Memory; And one or more computer programs, wherein the computer programs are stored in the memory, and when executed by the processor, the computer programs cause the first device to perform the method of any one of claims 1 to 11.

17. A source device, characterized in that, include: processor; Memory; And one or more computer programs, wherein the computer programs are stored in the memory, and when the computer programs are executed by the processor, cause the source device to perform the method of any one of claims 12 to 15.

18. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when run on a computer, causes the computer to perform the method described in any one of claims 1 to 15.

Citation Information

Patent Citations

  • Multicasting routing method based on secondary link in wireless distributed network

    CN104703243A