Methods and terminal equipment for resource allocation in wireless ad hoc networks

By grouping terminal devices in a wireless ad hoc network and employing a dynamic frequency hopping mechanism, the problem of terminal devices being unable to effectively utilize system bandwidth is solved, thereby improving communication efficiency and spectrum resource utilization.

CN117156564BActive Publication Date: 2025-10-31HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210545071.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-19
Publication Date
2025-10-31
Estimated Expiration
2042-05-19

AI Technical Summary

Technical Problem

In wireless ad hoc networks, terminal devices operate on narrow frequency bands, which prevents them from effectively utilizing the system's bandwidth resources and affects communication efficiency.

Method used

By using a grouped dynamic frequency hopping communication mechanism, terminal devices are grouped and communicate using the same frequency band in static resource time slots, while dynamic resource time slots are negotiated to make reasonable use of system spectrum resources.

Benefits of technology

It improves the communication efficiency of terminal devices in wireless ad hoc networks, and enhances the system's transmission capacity and frequency domain resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117156564B_ABST
    Figure CN117156564B_ABST
Patent Text Reader

Abstract

This application provides a method and terminal device for resource allocation in a wireless ad hoc network, belonging to the field of communication technology. The method includes: a master terminal device sending a wireless ad hoc network broadcast message; receiving access request messages from multiple slave terminal devices and connecting the slave terminal devices to the wireless ad hoc network system; grouping the multiple terminal devices connected to the wireless ad hoc network system into N groups; determining a resource allocation strategy based on the grouping results of the terminal devices, including that terminal devices in the same group use the same frequency band in static resource time slots, and that any two groups of terminal devices use the same frequency band in at least one static resource time slot; and sending the resource allocation strategy to the slave terminal devices, enabling the slave terminal devices to communicate according to the resource allocation strategy. This method improves communication efficiency by proposing a grouped dynamic frequency hopping communication mechanism, enabling terminal devices to efficiently utilize the system's time and frequency resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a method and terminal device for resource allocation in a wireless ad hoc network. Background Technology

[0002] Wireless ad hoc networks are a new type of wireless network architecture that differs from traditional cellular networks. Nodes in the network are peers, and each node can send and receive signals. Compared to traditional cellular networks, wireless ad hoc networks offer advantages such as flexible and easy network setup, high network reliability, and wide coverage.

[0003] In point-to-point (D2D) transmission within wireless ad hoc networks, due to limitations in factors such as antenna power, transmit power, and receiver sensitivity of the terminal devices, they typically operate on narrower frequency bands—far smaller than the available spectrum resources of the system—in order to achieve longer communication distances. For example, terminal devices in a wireless ad hoc network may communicate using a 2MHz band, while the 2.4GHz system offers up to 80MHz of open spectrum resources. Since wireless ad hoc networks are often decentralized or weakly centralized, how to rationally allocate the larger system frequency band resources to the terminal devices within the network to maximize system transmission efficiency has become a significant challenge. Summary of the Invention

[0004] This application provides a method for allocating resources in a wireless ad hoc network. By proposing a group dynamic frequency hopping communication mechanism, it addresses the problem that in a wireless ad hoc network scenario, the system bandwidth is greater than the device's operating bandwidth, causing terminal devices communicating on narrow bandwidth to be unable to effectively utilize the system's bandwidth resources to improve communication efficiency.

[0005] Firstly, a method for resource allocation in a wireless ad hoc network is provided, applied to a master terminal device, the master terminal device being used to initiate the wireless ad hoc network, the method comprising:

[0006] Send a wireless ad hoc network broadcast message, the wireless ad hoc network broadcast message including the access information of the wireless ad hoc network system;

[0007] Receive multiple access request messages sent by terminal devices and connect the multiple terminal devices to the wireless ad hoc network system;

[0008] Multiple terminal devices accessing the wireless ad hoc network system are grouped into N groups, where each group includes at least one of the terminal devices, and the terminal devices include the master terminal device and the slave terminal device, where N is an integer greater than 2.

[0009] Based on the grouping results corresponding to the multiple terminal devices, a resource allocation strategy is determined. The resource allocation strategy includes that the terminal devices in the same group use the same frequency band in static resource time slots, and that the terminal devices in any two groups use the same frequency band in at least one static resource time slot.

[0010] The resource allocation strategy is sent to the terminal device.

[0011] In conjunction with the first aspect, in some implementations of the first aspect, N is an even number greater than 2, and determining the resource allocation strategy based on the grouping results corresponding to the multiple terminal devices specifically includes:

[0012] Based on the grouping results of the plurality of terminal devices, the same frequency band is allocated to each pair of groups in each static resource time slot, such that any two groups of terminal devices use the same frequency band in the at least one static resource time slot.

[0013] In conjunction with the first aspect, in some implementations of the first aspect, the step of allocating the same frequency band to every two groups in each static resource time slot according to the grouping results of the plurality of terminal devices specifically includes:

[0014] According to the system frequency band of the wireless ad hoc network system, M frequency bands are divided. The M frequency bands are used for N groups of terminal devices to communicate between each other on different static resource time slots, where N = M * 2.

[0015] Each static resource time slot is paired with N groups to obtain a target combination result, wherein the target combination result is a combination in the static resource time slot consisting of any two groups.

[0016] The M working frequency bands are respectively allocated to the M combinations in each of the static time slots, so that two groups of terminal devices in the same combination use the same frequency band in the same static resource time slot.

[0017] In conjunction with the first aspect, in some implementations of the first aspect, the resource allocation strategy includes a frequency hopping sequence, the frequency hopping sequence being used to indicate the frequency band of the terminal device in each of the static resource time slots, and the method further includes:

[0018] Based on the same frequency band allocated to each pair of static resource time slots, the frequency hopping sequences corresponding to the terminal devices of the N groups are determined respectively.

[0019] In conjunction with the first aspect, in some implementations of the first aspect, the resource allocation strategy is also used to instruct the terminal device to conduct negotiation communication in at least one dynamic resource time slot.

[0020] In conjunction with the first aspect, in some implementations of the first aspect, the slave terminal device includes a first slave terminal device and a second slave terminal device, and the method further includes:

[0021] Obtain the resource reclamation request message sent by the first slave terminal device, wherein the resource reclamation request message is used to indicate that none of the terminal devices in the group to which the first slave terminal device belongs can achieve single-hop communication with at least one terminal device in another group;

[0022] In response to the resource reclamation request message, the static resource time slot corresponding to the group where the first terminal device is located and the other at least one group using the same frequency band is changed to a dynamic resource time slot. The dynamic resource time slot is used for negotiation communication between the terminal devices in the group where the first terminal device is located and the other at least one group.

[0023] In conjunction with the first aspect, in some implementations of the first aspect, the step of grouping multiple terminal devices accessing the wireless ad hoc network system into N groups specifically includes:

[0024] The master terminal device receives a packet request message sent by the slave terminal device, the packet request message being used to request the master terminal device to send a packet to the slave terminal device;

[0025] In response to the group request message, the multiple terminal devices of the wireless ad hoc system are randomly grouped to obtain N groups; or,

[0026] The master terminal device receives a grouping request message sent by the slave terminal device, the grouping request message being used to request the master terminal device to group the slave terminal device and the target terminal device into the same group;

[0027] In response to the grouping request message, the slave terminal device and the target terminal device are grouped into the same group.

[0028] Secondly, a method for resource allocation in a wireless ad hoc network is provided, applied to a terminal device, the method comprising:

[0029] The main terminal device receives a wireless ad hoc network broadcast message sent by the main terminal device. The wireless ad hoc network broadcast message includes the access information of the wireless ad hoc network system. The main terminal device is used to initiate the wireless ad hoc network.

[0030] In response to the wireless ad hoc network broadcast message, an access request message is sent to the main terminal device, the access request message being used to request access to the wireless ad hoc network system;

[0031] Send a packet request message to the master terminal device, the packet request message being used to request the master terminal device to group the slave terminal device;

[0032] The system receives a resource allocation strategy sent by the main terminal device. The resource allocation strategy includes that terminal devices in the same group use the same frequency band in static resource time slots, and that terminal devices in any two groups use the same frequency band in at least one static resource time slot.

[0033] In conjunction with the second aspect, in some implementations of the second aspect, the resource allocation strategy includes a frequency hopping sequence, the frequency hopping sequence being used to indicate the frequency band of the terminal device in each of the static resource time slots, and the method further includes:

[0034] When communication is performed on the corresponding static resource time slot, the frequency band is switched to the corresponding frequency band on different static time slots according to the frequency hopping sequence.

[0035] In conjunction with the second aspect, in some implementations of the second aspect, sending the packet request message to the main terminal device further includes:

[0036] Based on historical communication records, identify the target terminal device with the most historical communication transactions;

[0037] The master terminal device sends the group request message, which requests the master terminal device to group the slave terminal device and the target terminal device into the same group.

[0038] In conjunction with the second aspect, in some implementations of the second aspect, the method further includes:

[0039] Send the heartbeat packet corresponding to the terminal device, and listen for heartbeat packets sent by other terminal devices;

[0040] Based on the heartbeat packet monitoring results, it is determined that the terminal device in the group where the terminal device is located cannot achieve single-hop communication with the terminal device in at least one other group;

[0041] A resource reclamation request message is sent to the master terminal device, the resource reclamation request message being used to indicate that none of the terminal devices in the group to which the slave terminal device belongs can perform single-hop communication with terminal devices in at least one other group.

[0042] In conjunction with the second aspect, in some implementations of the second aspect, the resource allocation strategy is further used to instruct the terminal device to use dynamic resources for communication in at least one dynamic resource time slot, the dynamic resources being used for negotiation communication between the terminal devices, and the method further includes:

[0043] A dynamic negotiation request message is sent to a first terminal device in the static resource time slot. The first terminal device is the terminal device that communicates with the slave terminal device in the current static resource time slot. The dynamic negotiation request message is used to request to continue communicating with the first terminal device using the dynamic resource time slot.

[0044] Receive a dynamic negotiation response message sent by the first terminal device, wherein the dynamic negotiation response message is used to indicate the target dynamic resource time slot and target frequency band for continuing communication;

[0045] When the first dynamic resource time slot is reached, communication with the second terminal device continues on the target frequency band.

[0046] Thirdly, a wireless ad hoc network system is provided, the wireless ad hoc network system including a master terminal device and multiple slave terminal devices, the master terminal device being used to initiate a wireless ad hoc network, and the master terminal device being used to execute the method as described in any implementation of the first aspect above, and the slave terminal devices being used to execute the method as described in any implementation of the second aspect above.

[0047] Fourthly, a computer-readable storage medium is provided that stores computer-executable program instructions, which, when executed on a computer, cause the computer to perform the method as described in any of the implementations of the first and second aspects above.

[0048] Fifthly, a computer program product is provided, the computer program product including computer program code, which, when run on a computer, causes the computer to perform the method as described in any implementation of the first aspect above. Attached Figure Description

[0049] Figure 1 This is a schematic diagram of the system architecture applicable to a method for allocating resources in a wireless ad hoc network provided in an embodiment of this application.

[0050] Figure 2 This is a schematic diagram of the structure of a terminal device 100 provided in an embodiment of this application.

[0051] Figure 3 This is a software structure block diagram of a terminal device 100 provided in an embodiment of this application.

[0052] Figure 4 This is a schematic flowchart illustrating how a terminal device accesses a wireless ad hoc network system, as provided in an embodiment of this application.

[0053] Figure 5This is a schematic flowchart illustrating how a master terminal device groups terminal devices in a wireless ad hoc network system, as provided in an embodiment of this application.

[0054] Figure 6 This is a schematic diagram of the grouping results of terminal devices in a wireless ad hoc network system provided in an embodiment of this application.

[0055] Figure 7 This is a schematic diagram illustrating resource allocation in a wireless ad hoc network, as provided in an embodiment of this application.

[0056] Figure 8 This is a schematic diagram illustrating another method of resource allocation in a wireless ad hoc network, as provided in an embodiment of this application.

[0057] Figure 9 This is a schematic diagram illustrating another method of resource allocation in a wireless ad hoc network, as provided in an embodiment of this application.

[0058] Figure 10 This is a schematic diagram of the topology of a wireless ad hoc network system provided in an embodiment of this application.

[0059] Figure 11 This is a schematic diagram of the topology in another wireless ad hoc network system provided in an embodiment of this application.

[0060] Figure 12 This is a schematic flowchart illustrating how to obtain the network status of adjacent terminal devices, as provided in an embodiment of this application.

[0061] Figure 13 This is a schematic diagram of the topology in another wireless ad hoc network system provided in an embodiment of this application.

[0062] Figure 14 This is a schematic flowchart illustrating a method for allocating resources in a wireless ad hoc network, as provided in an embodiment of this application.

[0063] Figure 15 A schematic flowchart illustrating another method for allocating resources in a wireless ad hoc network, provided in an embodiment of this application. Detailed Implementation

[0064] It should be noted that the terminology used in the implementation section of the embodiments of this application is only used to explain the specific embodiments of this application and is not intended to limit this application. In the description of the embodiments of this application, unless otherwise stated, " / " means "or", for example, A / B can mean A or B; "and / or" in this document is merely a description of the association relationship of related obstacles, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. In addition, in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more, "at least one" or "one or more" means one, two or more.

[0065] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.

[0066] References to "one embodiment" or "some embodiments" as used in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0067] For ease of understanding, some technical terms involved in the embodiments of this application will be explained and described below.

[0068] 1. Resource allocation

[0069] In the wireless ad hoc network system of this application embodiment, resources mainly include frequency band resources, time resources, and spatial resources. Inter-node communication and service transmission both depend on the acquisition of wireless resources. Wireless resource allocation refers to controlling, managing, and scheduling system resources through certain strategies to make full use of the wireless ad hoc network's system resources, meet the communication needs of each node and service, and ensure the network's quality of service. The scheme in this application embodiment mainly involves the allocation of time-domain and frequency-domain resources in the wireless ad hoc network system; therefore, the resource allocation in this application embodiment can also be described as time-frequency resource allocation.

[0070] 2. Static allocation

[0071] Static allocation refers to the fixed allocation of wireless resources to various network nodes based on preset network parameters. Static allocation can be a one-time allocation or multiple allocations. The advantages of the static allocation method are its simple algorithm, the lack of need for temporary adjustments based on network topology, link channel quality, or sudden node service demands, and the absence of resource request and authorization processes, allowing for timely transmission and reception with low latency when communication is required. Its disadvantages include low resource utilization and poor fairness. The static resource allocation method is suitable for wireless ad hoc network scenarios with minimal topology changes and stable service demands. For ease of description, the resources allocated statically in this application embodiment will be referred to as static resources.

[0072] 3. Dynamic allocation

[0073] Dynamic allocation refers to a process where, after the network stabilizes, each node calculates resource allocation based on its neighbors, and terminal devices negotiate the resources used for communication according to specific communication needs. Its advantages include rapid response to changes in neighbor channel quality, fast resource allocation results, and short convergence time. For ease of description, the resources allocated dynamically in this application will be referred to as dynamic resources.

[0074] 4. Groups, Combinations

[0075] In this embodiment, the terminal devices in the wireless ad hoc network system can be divided into multiple groups, and each group may include at least one terminal device. In one possible implementation, the terminal devices in the wireless ad hoc network system can be divided into an even number of groups, such as 16 groups.

[0076] In this embodiment of the application, after the terminal devices of the wireless ad hoc network are divided into multiple groups, these groups can be combined in each time slot of the frequency hopping cycle, such as combining these groups in pairs in each time slot. For example, taking 16 groups as an example, after combining them in pairs, 8 combinations can be formed, and each combination includes 2 groups.

[0077] 5. Static resource time slots and dynamic resource time slots

[0078] For ease of understanding, in this application embodiment, the time slot for communication using static resources by the terminal device is referred to as the static resource time slot, and the time slot for communication using dynamic resources by the terminal device is referred to as the dynamic resource time slot. Here, using static resources for communication means that the terminal device can use corresponding frequency bands to communicate in different time slots according to a preset frequency hopping sequence. This frequency hopping sequence is used to indicate which frequency band a terminal device uses in a given time slot. For example, as follows... Figure 9As shown, a frequency hopping sequence can be used to indicate which frequency band a specific (or group / combination) terminal device uses in each time slot from time slot 0 to time slot 15. When a terminal device communicates on a static resource time slot, it uses the corresponding frequency band in each time slot from time slot 0 to time slot 15 according to a fixed frequency hopping sequence. In this case, time slots 0 to 15 are called static resource time slots. Alternatively, if a fixed frequency hopping sequence is not set for the terminal device corresponding to time slots 16 to 23, then the terminal device can dynamically negotiate which frequency band to use in which time slot according to communication needs. In this case, time slots 16 to 23 are called dynamic resource time slots.

[0079] It should be noted that the preset static resource time slots in the embodiments of this application can be converted into dynamic resource time slots. For example, if two groups of terminal devices are assigned to use the same frequency band G for communication in time slot A, and if these two groups of terminal devices are not within the single-hop communication range of the other, then the static resource time slots corresponding to the frequency band G used by these two groups of terminal devices can be changed to dynamic resource time slots. This allows the two groups of terminal devices to flexibly negotiate communication based on their own communication needs, thereby improving the utilization rate of frequency domain resources.

[0080] The wireless ad hoc network resource allocation method provided in this application group terminal devices in the wireless ad hoc network communication system and enables any two groups of terminal devices to communicate using the same narrow frequency band in at least one time slot during the frequency modulation period. This allows the wireless ad hoc network to reasonably utilize the air interface resources of the wireless ad hoc network system and improve system capacity while satisfying the requirement for narrowband communication between terminal devices.

[0081] For example, such as Figure 1 The diagram shown illustrates the system architecture to which a method for allocating resources in a wireless ad hoc network, as provided in an embodiment of this application, is applicable.

[0082] The system architecture includes multiple terminal devices (such as terminal devices 1 to 4), which have signal transmission and reception functions and can realize wireless self-organizing networks through various communication methods, such as wireless fidelity (Wi-Fi), 6th generation mobile communication technology (6G), 5th generation mobile communication technology (5G), and so on.

[0083] From the perspective of the functional roles of terminal devices in a wireless ad hoc network, the multiple terminal devices in this system architecture can be divided into master terminal devices and slave terminal devices. The master terminal device can initiate the wireless ad hoc network, while the slave terminal devices can access the wireless ad hoc network system. The following explanation uses a system architecture including one master terminal device and multiple slave terminal devices as an example.

[0084] In some embodiments, the master terminal device may be a device deployed in a wireless ad hoc network to provide network functions for slave terminal devices, and may have network access functions and resource allocation functions. In the embodiments of this application, the master terminal device may also be described as a network node or an access device. The master terminal device may be used to receive wireless ad hoc network access requests, device grouping requests, and resource allocation requests from slave terminal devices, and may also use its own communication capabilities and computing resources to perform operations such as connecting slave terminal devices to the wireless ad hoc network system, grouping slave terminal devices, and allocating air interface resources to slave terminal devices.

[0085] In some embodiments, a slave terminal device can be a device to be accessed during the process of multiple terminal devices self-organizing a wireless ad hoc network. After the wireless ad hoc network system is organized, each terminal device (including master terminal devices and slave terminal devices) can be a peer communication node, and there is no master-slave distinction at this time.

[0086] For example, terminal devices in a wireless ad hoc network system architecture can be various types of electronic devices, such as handheld devices, in-vehicle devices, wearable devices, computing devices or other processing devices connected to a wireless modem, mobile stations (MS), subscriber units, cellular phones, smartphones, wireless data cards, personal digital assistant (PDA) computers, tablets, wireless modems, handsets, laptop computers, machine-type communication (MTC) terminals, and Internet of Things (IoT) devices, etc.

[0087] In some embodiments, wireless communication can occur between the master terminal device and the slave terminal devices, as well as between the slave terminal devices themselves, via air interface resources. These air interface resources can be allocated to the slave terminal devices by the master terminal device during the organization of the wireless ad hoc network. Air interface resources may include time-domain resources, frequency-domain resources, etc.

[0088] Optionally, the main terminal device in the system architecture of this application embodiment can also be a network device other than a wireless ad hoc network, and this application implementation does not limit this.

[0089] It should be noted that the embodiments of this application can be applied to any wireless ad hoc network communication system that includes an entity that needs to send information and an entity that needs to receive information. The system architecture shown in the figure above is only an exemplary implementation of the embodiments of this application. However, in actual applications, the system architecture may also include more or fewer communication nodes, and the embodiments of this application do not limit this.

[0090] For example, such as Figure 2 The diagram shown is a structural schematic of a terminal device 100 provided in an embodiment of this application.

[0091] Terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0092] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the terminal device 100. In other embodiments of this application, the terminal device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

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

[0094] The controller can serve as the central nervous system and command center of the terminal device 100. The controller can generate operation control signals based on the instruction opcode and timing signals to control the fetching and execution of instructions.

[0095] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 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 110, and thus improves the efficiency of the system.

[0096] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0097] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C buses. The processor 110 can couple to the touch sensor 180K, charger, flash, camera 193, etc., through different I2C bus interfaces. For example, the processor 110 can couple to the touch sensor 180K through the I2C interface, enabling the processor 110 and the touch sensor 180K to communicate through the I2C bus interface, thereby realizing the touch function of the terminal device 100.

[0098] The I2S interface can be used for audio communication. In some embodiments, the processor 110 may include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface to enable the function of answering phone calls through a Bluetooth headset.

[0099] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via the PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering phone calls through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0100] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface to enable music playback through Bluetooth headphones.

[0101] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to enable the shooting function of the terminal device 100. The processor 110 and the display screen 194 communicate via the DSI interface to enable the display function of the terminal device 100.

[0102] The GPIO interface can be configured via software. It can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to a camera 193, a display screen 194, a wireless communication module 160, an audio module 170, a sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0103] USB port 130 is a USB standard compliant interface, specifically a Mini USB port, Micro USB port, or USB Type-C port. USB port 130 can be used to connect a charger to charge terminal device 100, and can also be used for data transfer between terminal device 100 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other terminals, such as AR devices.

[0104] It is understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are merely illustrative and do not constitute a structural limitation on the terminal device 100. In other embodiments of this application, the terminal device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0105] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the terminal device 100. While charging the battery 142, the charging management module 140 can also supply power to the terminal via the power management module 141.

[0106] The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, providing power to the processor 110, internal memory 121, external memory, display screen 194, camera 193, and wireless communication module 160, etc. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 141 may also be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be located in the same device.

[0107] The wireless communication function of the terminal device 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.

[0108] Antennas 1 and 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with a tuning switch.

[0109] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the terminal device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.

[0110] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 194. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.

[0111] The wireless communication module 160 can provide solutions for wireless communication applications on the terminal device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0112] In some embodiments, antenna 1 of terminal device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling terminal device 100 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).

[0113] The terminal device 100 implements display functions through a GPU, a display screen 194, and an application processor. The display screen 194 is used to display images, videos, etc.

[0114] Terminal device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.

[0115] A digital signal processor (DSP) is used to process digital signals, including digital image signals and other digital signals. For example, when terminal device 100 selects a frequency, the DSP performs Fourier transforms on the frequency energy. A video codec is used to compress or decompress digital video. An NPU (Neural Processing Unit) is a neural network (NN) computing processor that, by borrowing from the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, rapidly processes input information and can continuously learn on its own.

[0116] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card. The internal memory 121 can be used to store computer executable program code, which includes instructions.

[0117] Terminal device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.

[0118] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. Gyroscope sensor 180B can be used to determine the motion posture of terminal device 100. Magnetic sensor 180D includes a Hall sensor. Terminal device 100 can use magnetic sensor 180D to detect the opening and closing of the flip cover. Accelerometer 180E can detect the magnitude of acceleration of terminal device 100 in various directions (generally three axes). When terminal device 100 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the terminal's posture, applied to applications such as screen orientation switching and pedometers. Proximity sensor 180G can include, for example, a light-emitting diode (LED) and a photodetector, such as a photodiode. The LED can be an infrared LED. Terminal device 100 emits infrared light outward through the LED. Ambient light sensor 180L is used to sense ambient light brightness. Terminal device 100 can adaptively adjust the brightness of display screen 194 according to the sensed ambient light brightness. Fingerprint sensor 180H is used to collect fingerprints. Temperature sensor 180J is used to detect temperature. The touch sensor 180K, also known as the "touch panel," can be located on the display screen 194. The touch sensor 180K and the display screen 194 together form a touchscreen, also called a "touch screen." The touch sensor 180K detects touch operations applied to or near it. The bone conduction sensor 180M can acquire vibration signals.

[0119] In addition, the terminal device 100 also includes a barometric pressure sensor 180C and a distance sensor 180F. The barometric pressure sensor 180C is used to measure air pressure. In some embodiments, the terminal device 100 calculates altitude using the air pressure value measured by the barometric pressure sensor 180C to assist in positioning and navigation.

[0120] A distance sensor 180F is used to measure distance. The terminal device 100 can measure distance via infrared or laser. In some embodiments, during a shooting scene, the terminal device 100 can utilize the distance sensor 180F to measure distance for rapid focusing.

[0121] For example, the software system of terminal device 100 may adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This embodiment of the invention uses the layered architecture Android system as an example to illustrate the software structure of terminal device 100. Figure 3 This is a software structure block diagram of the terminal device 100 according to an embodiment of this application.

[0122] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

[0123] The application layer can include a series of application packages. For example... Figure 3 As shown, the application package can include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, cloned applications, etc.

[0124] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions. For example... Figure 3 As shown, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.

[0125] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.

[0126] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.

[0127] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.

[0128] The phone manager is used to provide communication functions for terminal device 100. For example, it manages call status (including connection, hang-up, etc.).

[0129] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.

[0130] The notification manager allows applications to display notifications in the status bar. These can be used to convey informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of download completion or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating the device, or flashing indicator lights.

[0131] The Android Runtime consists of core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.

[0132] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.

[0133] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as obstacle lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0134] The system library can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), short-range Wi-Fi modules, etc.

[0135] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.

[0136] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.

[0137] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0138] A 2D graphics engine is a graphics engine for 2D drawing.

[0139] Short-range Wi-Fi modules are used to create hotspots on Wi-Fi channels, such as 2.4G or 5G channels.

[0140] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.

[0141] The self-organizing network resource allocation method provided in this application first groups the terminal devices in the self-organizing network system and makes the terminal devices in each pair of groups use the same dynamic frequency hopping communication mechanism, so that the terminal devices in different groups can efficiently utilize the air interface resources of the self-organizing network system to communicate on a narrow frequency band. This method enables the terminal devices in the self-organizing network system to make reasonable use of air interface resources and improve system capacity.

[0142] To better understand the wireless ad hoc network resource allocation method provided in this application embodiment, the following describes the specific implementation process of terminal device grouping in the wireless ad hoc network resource allocation method provided in this application embodiment, in conjunction with the accompanying drawings.

[0143] For example, such as Figure 4 The diagram shown is a schematic flowchart of a method for allocating resources in a wireless ad hoc network according to an embodiment of this application.

[0144] It should be noted that the terminal device grouping process involved in the wireless ad hoc network resource allocation method provided in this application embodiment can be executed during the process of a terminal device accessing the wireless ad hoc network system. For ease of understanding, Figure 4 This embodiment provides a brief overview of the process of accessing a wireless ad hoc network system from a terminal device. For more specific implementation details of this access process, please refer to existing procedures. This embodiment will not elaborate on these details.

[0145] For example, when a master terminal device organizes a wireless ad hoc network system, the process of a slave terminal device accessing the wireless ad hoc network system may include the following steps:

[0146] S401, the main terminal device broadcasts a synchronization frame, which includes access information for the wireless ad hoc network system.

[0147] Among them, the main terminal device can be a terminal device that initiates a wireless self-organizing network.

[0148] In some embodiments, the master terminal device may broadcast a synchronization time slot. The synchronization frame may include access information of the wireless ad hoc network system. Specifically, the connection information of the wireless ad hoc network system may be connection information of a network initiated by the master terminal device. For example, when the master terminal device is a router, the type of the wireless ad hoc network is a Wi-Fi wireless ad hoc network. In this case, the synchronization frame broadcast message may include the Service Set Identifier (SSID) and corresponding password of the Wi-Fi network.

[0149] S402, the terminal device sends an access request message to the main terminal device.

[0150] The access request message is used to request access to the wireless ad hoc network.

[0151] In some embodiments, after receiving a synchronization time slot from the master terminal device from the terminal device, the terminal device can send an access request message to the master terminal device based on the access information of the wireless ad hoc network system in the synchronization time slot, in order to request access to the wireless ad hoc network system.

[0152] S403, the master terminal device sends an access response message to the slave terminal device.

[0153] The access response message is used to indicate the result of the terminal device's request to access the network of the master terminal device. The access result may be, for example, the master terminal device confirming that the terminal device can access the wireless ad hoc network system.

[0154] S404, The terminal device sends an authentication request message to the master terminal device, which carries a packet request message.

[0155] The authentication request message can be used to request the master terminal device to authorize the slave terminal device with relevant network usage permissions. The packet request message is used to request the master terminal device to group the slave terminal device.

[0156] Specifically, the group request message can be used to request the master terminal device to group the slave terminal device with the target terminal device. In this case, the group request message can carry, for example, the identifier corresponding to the target terminal device; or, the group request message can be used only to request the master terminal device to group the slave terminal device, without requiring it to be grouped with any particular device.

[0157] S405, the master terminal device groups the slave terminal device according to the slave terminal device's packet request message.

[0158] S406, the master terminal device sends an authentication response message to the slave terminal device, and the authentication request message carries a packet response message.

[0159] The authentication response message is used to notify the terminal device of the authentication result, and the packet response message is used to inform the terminal device of the packet result.

[0160] The following describes the specific implementation method of the master terminal device grouping the slave terminal device according to the slave terminal device's grouping request message in step S405.

[0161] It should be noted that the master terminal device can adopt different grouping methods depending on the specific request content of the grouping request message. For example: Method 1, when the grouping request message requests the master terminal device to group the slave terminal device and the target terminal device into the same group, the master terminal device can group the slave terminal device and the requested target terminal device into the same group according to the grouping request message; Method 2, when the grouping request message only requests to group the slave terminal device without specifying which device it should be grouped with, the master terminal device can randomly group the terminal devices accessing the wireless ad hoc network system; Method 3, when the grouping request message only requests to group the slave terminal device without specifying which device it should be grouped with, the master terminal device can also group the terminal devices accessing the wireless ad hoc network system according to preset grouping rules.

[0162] For the first method described above, for example, the slave terminal device can first determine which (or which) target terminal devices it wants to be in the same group with; then, it carries the identifier of the target terminal device it wants to be in the same group in a group request message, and sends a group request message to the master terminal device in step S404 to request to be in the same group as the target terminal device. There are several ways for the slave terminal device to determine which (or which) target terminal devices it wants to be in the same group with. For example, the slave terminal device can select the device with the most historical communication records as the target terminal device to be in the same group; another example is that the slave terminal device can select the device with more than a preset threshold of historical communication records as the target terminal device to be in the same group; yet another example is that the slave terminal device can negotiate with other devices it has communicated with before requesting the group, etc. This application embodiment does not limit the method by which the slave terminal device determines the target terminal devices in the same group.

[0163] It should be understood that by requesting the master terminal device to group the slave terminal device and the target terminal device with frequent communication based on historical communication records, the slave terminal device can improve the efficiency of communication between terminal devices with high communication needs by enabling these frequently communicating terminal devices to use the same frequency hopping mechanism for subsequent communication.

[0164] For the second method described above, for example, the slave terminal device sends a group request message to the master terminal device, requesting the master terminal device to group the slave terminal device; in response to the group request message, the master terminal device can randomly assign the slave terminal device to one of the preset groups.

[0165] For the third method described above, for example, the slave terminal device sends a group request message to the master terminal device, requesting the master terminal device to group the slave terminal device; in response to the group request message, the master terminal device can assign the slave terminal device to a certain group according to a preset grouping rule. The preset grouping rule could be, for example, that the master terminal device assigns the slave terminal devices to preset groups sequentially according to their group numbers, based on the order in which the master terminal device receives group request messages from different slave terminal devices.

[0166] For example, the process by which the master terminal device groups the slave terminal devices according to method three described above can be found in [reference needed]. Figure 5 As shown. For ease of understanding, this example uses a wireless ad hoc network system with N pre-defined groups (N being an even number greater than 2) and n terminal devices that need to be grouped (n being greater than or equal to N).

[0167] In some embodiments, N groups can be preset before grouping the slave terminal devices. When the master terminal device receives a grouping request message sent by slave terminal device 1 (corresponding to...) Figure 5 In step S501-1), the first terminal device can be assigned to the first group (corresponding to...). Figure 5 In step S502-1), a packet response message is then sent to the slave terminal device, informing the slave terminal device of the packet it belongs to (corresponding to...). Figure 5 Step S503-1). When the master terminal device receives the second packet request message sent by the slave terminal device in the ad hoc network (corresponding to...) Figure 5 In step S501-2), the second device can be assigned to the second group (corresponding to...). Figure 5 In step S502-2), a packet response message (corresponding to) is then sent to the terminal device. Figure 5 In step S503-2), the master terminal device informs the slave terminal device of its packet. Similarly, when the master terminal device receives a packet request message (corresponding to) from the Nth slave terminal device in the ad hoc network... Figure 5 In step S501-N, the Nth terminal device can be assigned to the Nth group (corresponding to...). Figure 5 In step S502-N), a packet response message (corresponding to) is then sent to the terminal device. Figure 5In step S503-N), the master terminal device informs the slave terminal device of its corresponding packet. When the master terminal device receives a packet request message from the (N+1)th slave terminal device in the ad hoc network, it can regroup the packets, assigning the (N+1)th slave terminal device to group 1, and then send a packet response message to the slave terminal device. This process continues until the master terminal device receives a packet request message from the nth slave terminal device in the ad hoc network (corresponding to...). Figure 5 In step S501-n), the nth terminal device is assigned to the xth group (x is the remainder of n divided by N) (corresponding to Figure 5 In step S502-n), a packet response message (corresponding to) is then sent to the terminal device. Figure 5 In step S503-n), the slave terminal device is informed of its group, and the group of all connected slave terminal devices is completed.

[0168] It should be noted that the grouping methods described above are merely examples. In practical applications, the main terminal device can also group devices in the self-organizing network system according to other preset methods, and this application embodiment does not limit this.

[0169] It is worth noting that the master terminal device, as a terminal device in the ad hoc network, also needs to be assigned to a group. The master terminal device can assign itself to a group randomly or according to a preset group assignment method. For example, the master terminal device can assign itself and one or more terminal devices that communicate with it most frequently to the same group based on historical communication records.

[0170] It should also be noted that, for ease of understanding, Figure 4 This embodiment illustrates how a packet request message is carried in an authentication request message and a packet response message is carried in an authentication response message. However, the packet request message and packet response message in this embodiment are not limited to being carried in the authentication request message and authentication response message respectively. For example, in some embodiments, the packet request message can be carried in the access request message and the packet response message can be carried in the access response message; furthermore, in some other embodiments, during the access process, the slave terminal device can send a packet request message to the master terminal device independently, and the master terminal device can send a packet response message to the slave terminal device independently, instead of carrying them in other interaction messages. This embodiment does not limit the specific manner in which the master terminal device and the slave terminal device interact with the packet request message and the packet response message.

[0171] The preceding text described how to group terminal devices in a wireless ad hoc network system. To better understand the wireless ad hoc network resource allocation method provided in this application embodiment, the specific allocation method involving air interface resources in this method is described below.

[0172] The following example illustrates how terminal devices in an ad hoc network are divided into 16 groups (groups 0 to 15), and how time slots of at least one group number are used as the frequency hopping period.

[0173] It should be noted that the resource allocation method in the wireless ad hoc network provided in this application embodiment may include static resource allocation, or a combination of static and dynamic resource allocation. Static resource allocation primarily involves grouping terminal devices and allocating air interface resources according to a pre-set resource allocation strategy. The static resource allocation strategy in this application embodiment is used to indicate the fixed frequency hopping sequence of each group of terminal devices on different static resource time slots, that is, to indicate which frequency band each terminal device in the wireless ad hoc network system uses on each static resource time slot.

[0174] For example, the resource allocation strategy may include the following two aspects: (1) During the frequency hopping period, terminal devices in the same group perform frequency hopping communication using the same frequency hopping sequence to ensure that terminal devices in the same group have communication opportunities in each static resource time slot. (2) During the frequency hopping period, any two groups communicate at least once using the same frequency band in the same static resource time slot to ensure that any two groups of devices have at least one communication opportunity in each frequency hopping period.

[0175] It should be understood that the bandwidth used for communication between terminal devices can be narrower compared to the available system frequency bands of a wireless ad hoc network system. Regarding the first aspect of the resource allocation strategy mentioned above, terminal devices in the same group have the same frequency hopping sequence. If resource allocation is based solely on the strategy in aspect (1), then terminal devices in the same group can only operate on a narrower frequency band simultaneously, making it difficult to fully utilize the system spectrum resources of the wireless ad hoc network. To overcome this problem, the number of groups can be increased. In this way, in order to enable each pair of groups to use the same frequency band in the same static resource time slot, the number of frequency bands required will also be increased, thereby improving the utilization rate of the system spectrum resources of the wireless ad hoc network.

[0176] Regarding the second aspect of the above resource allocation strategy, its implementation process may include: firstly, performing multiple rounds of pairwise combinations on each group in the wireless ad hoc network, and forming a combination of any two groups after the multiple rounds of combinations are completed; the result of each round of grouping can correspond to a static resource time slot, and the two groups in the same combination use the same frequency band in a static resource time slot, while groups in different combinations use different frequency bands in the same static resource time slot.

[0177] In practical implementation, there are multiple ways to achieve the above-mentioned pairwise combination results. For example: first, group 0 is paired with other groups in different rounds, and the remaining uncombined groups are randomly paired; then, group 1 is paired with other groups except group 0 in different rounds, and the remaining uncombined groups are randomly paired; then, group 2 is paired with other groups except group 0 and group 1 in different rounds, and the remaining uncombined groups are randomly paired, and so on until all groups have been paired with other groups at least once, and so on. Based on the requirement that any two groups of devices have been paired in each frequency hopping cycle, this application embodiment does not limit the pairwise combination method between groups.

[0178] Since the number of groups determines the length of the frequency hopping period, and thus the communication delay between terminal devices (especially terminal devices in different groups), the number of groups should not be too large in order to ensure the communication efficiency between terminal devices. Therefore, based on the above analysis, the wireless ad hoc network resource allocation method provided in this application embodiment can follow the following grouping rules: (1) Terminal devices with more communication needs can be preferentially allocated to the same group; (2) The number of terminal devices included in each group should be as even as possible.

[0179] It should be noted that the grouping rules listed above are exemplary rules that take into account the communication latency of terminal devices. In practical applications, other grouping methods can also be used, such as randomly grouping terminal devices, grouping them according to their location, etc. This application embodiment does not limit these methods. Taking the 16 groups in the example above as an example, one possible grouping result can be as follows: Figure 6 As shown.

[0180] In some embodiments, within each time slot, two groups located in the same combination can use the same frequency band, while groups located in different combinations use different frequency bands. For example, in the first time slot, if the first combination includes group 0 and group 8, then group 0 and group 8 can use the same frequency band in the first time slot; while group 0 and other groups (such as group 1, group 2, etc.) located in different combinations, then group 1 and other groups (such as group 8) use different frequency bands in the first time slot.

[0181] It should be understood that by using the same frequency band for two groups in the same time slot and the same frequency band for groups in different combinations, communication opportunities can be provided for groups in the same combination within a time slot. At the same time, communication between groups in the same combination will not be affected by communication interference from terminal devices outside the group, thus ensuring the communication efficiency and effect between terminal devices in the same combination.

[0182] For example, the process of enabling two groups in the same combination to use the same frequency band and groups in different combinations to use different frequency bands may include: the main terminal device can divide the frequency bands into a corresponding number based on the number of combinations after pairwise combinations, according to the available wireless ad hoc network system frequency bands; and then, allocate these frequency bands to the terminal devices in different combinations in a time slot.

[0183] For example, after pairwise grouping the 16 groups, resulting in 8 combinations, the system can be divided into 8 frequency bands, such as numbering these 8 bands from 0 to 7. Then, these 8 frequency bands can be allocated to the terminal devices in each of the 8 combinations corresponding to each time slot. For example,... Figure 7 As shown, assuming that after 16 pairwise groupings, any two groups can be combined within the frequency hopping cycle, to ensure that any two groups have a communication opportunity, these 16 combinations within the frequency hopping cycle can correspond to 16 static resource time slots (time slot 0 to time slot 15). In these 16 static resource time slots, the terminal devices in the wireless ad hoc network system use static resources for communication; that is, the terminal devices communicate according to a fixed frequency hopping sequence within these 16 static resource time slots, i.e., using a preset static resource allocation strategy. This static resource allocation strategy can include: terminal devices in the same combination within each static resource time slot use the same frequency band for communication, and the combination methods corresponding to different time slots are different, ensuring that any two groups have a chance to use the same frequency band within the static resource time slots, thereby achieving communication opportunities for any two groups within the frequency hopping cycle.

[0184] It should be understood that the frequency hopping period here refers to the period corresponding to the static resource time slot.

[0185] In some embodiments, when a terminal device in a wireless ad hoc network accesses a master terminal device and the terminal devices are grouped, the master terminal device can determine a static resource allocation strategy. For example, the master terminal device can determine the static resource allocation strategy based on the grouping of the terminal devices. Specifically, the master terminal device can determine the static resource allocation strategy based on the grouping of the terminal devices in the wireless ad hoc network by: determining the number of frequency bands based on the number of groups of terminal devices in the wireless ad hoc network; or determining the number of frequency bands based on the number of combinations formed by pairwise combinations of the groups in the wireless ad hoc network. For example, when the terminal devices in the wireless ad hoc network are divided into 16 groups, the number of frequency bands is determined to be half the number of groups; when the groups to which the terminal devices belong in the wireless ad hoc network belong to are combined in pairs to form 8 groups, the number of frequency bands is determined to be consistent with the number of combinations.

[0186] For example, one possible way to determine a resource allocation strategy may include: assuming the devices are divided into N groups, where N is an even number, group number i = 0, 1, ..., N-1, static resource time slots t = 0, 1, 2, ..., N-1, and the frequency point index corresponding to the working frequency band of the i-th group in the t-th time slot is f(i,t), then f(i,t) can be determined according to the following formula (1-1):

[0187]

[0188] Taking i=16 and N=16 as an example, the frequency bands allocated to different groups of terminal devices in different static resource time slots according to the above algorithm can be as follows: Figure 8 As shown.

[0189] It should be noted that the above-described method of determining the working frequency bands corresponding to different groups of terminal devices in different time slots according to formula (1-1) is only an example, and the embodiments of this application do not limit it. If a frequency band determination algorithm can enable any two groups of terminal devices to use the same frequency band within the frequency hopping period, it can be used in the wireless ad hoc network resource allocation method provided in this application.

[0190] In some embodiments, the master terminal device can send a static resource allocation policy (i.e., a frequency hopping sequence) to the slave terminal devices. After obtaining the static resource allocation policy, the terminal devices in the wireless ad hoc network can switch the frequency band they use in different time slots within the frequency hopping cycle according to the static resource allocation policy. Figure 7 As shown, for example, if the static resource allocation strategy instructs the 5th group of terminal devices that the working frequency domain resource corresponding to time slot 5 is frequency domain resource 5 (or the 5th frequency band), then when time slot 5 is reached, the 5th group of terminal devices will switch its working frequency band to the 5th frequency band; or, for example, if the static resource allocation strategy instructs the 8th group of terminal devices that the working frequency domain resource corresponding to time slot 12 is frequency domain resource 6 (or the 6th frequency band), then when time slot 12 is reached, all terminal devices in the 8th group will switch their working frequency band to the 6th frequency band.

[0191] In the static resource time slots of this application embodiment, any group of terminal devices can have another group of terminal devices using the same frequency domain resources, and terminal devices from different groups using the same frequency band can communicate with each other. For example, in time slot 0, both group 0 and group 8 communicate on frequency domain resource 0 (or frequency band 0), and at this time, the terminal devices in group 0 and group 8 have the opportunity to communicate with each other. As another example, in time slot 1, both group 0 and group 1 operate on frequency domain resource 7 (or frequency band 7), and at this time, the terminal devices in group 0 can have the opportunity to communicate with the terminal devices in group 1.

[0192] In some embodiments, each frequency hopping cycle may be followed by multiple time slots for the terminal device to communicate using dynamic resources. For example, such as... Figure 9 As shown, in each communication cycle, the terminal devices in the wireless ad hoc network system can be configured to use static resources for communication from time slot 0 to time slot 15, and use dynamic resources for communication from time slot 16 to time slot 22.

[0193] In some embodiments, when a terminal device communicates using static resources in a certain time slot of a frequency hopping cycle, if the transmitted data has not been completed, the terminal device may negotiate to continue data transmission using dynamic resources in the time slot corresponding to the static resources.

[0194] It should be understood that by setting static and dynamic resources in each communication cycle, the terminal device can continue to use dynamic resources to perform communication tasks when it is unable to complete the communication task using static resources (such as after transmitting data), thereby improving the communication efficiency of the terminal device.

[0195] Considering the influence of factors such as the location, network status, and communication needs of terminal devices, some terminal devices may not communicate even if they are designed to use the same frequency band in the same time slot, resulting in the unnecessary waste of resources allocated to these terminal devices. To address this situation, the wireless ad hoc network resource allocation method provided in this application reclaims resources from offline terminal devices to avoid the waste of static resources, thereby improving the communication efficiency of terminal devices with communication needs.

[0196] For situations requiring resource recycling, such as... Figure 10 As shown, assuming that in the aforementioned 16 groups, groups 0 to 7 are relatively close in location, and groups 8 to 15 are relatively close in location, but groups 0 to 7 and groups 8 to 15 are relatively far apart, then in some possible scenarios, the terminal devices in groups 0 to 7 can meet the conditions for mutual communication, and the terminal devices in groups 8 to 15 can also meet the conditions for mutual communication. However, any terminal device in groups 0 to 7 and any terminal device in groups 8 to 15 cannot achieve mutual communication due to distance. In this case, even if one group in groups 0 to 7 and one group in groups 8 to 15 are set to use the same frequency band in the same time slot, the two groups of terminal devices will not be able to communicate successfully. In this case, static resources that cannot achieve successful communication can be reclaimed, and the terminal devices in this situation can be set to perform dynamic negotiation communication on the corresponding time-frequency resources to improve the flexibility of communication between terminal devices.

[0197] Or, such as Figure 11As shown, single-hop communication can be achieved between any two groups from groups 0 to 7, and between any two groups from groups 9 to 15. However, single-hop communication cannot be achieved between any group from groups 0 to 7 and any group from groups 9 to 15 (e.g., ...). Figure 11 As shown, it is necessary to use the terminal device in group 8 as a relay node. In this case, even if one of the groups from 0 to 7 and one of the groups from 9 to 15 are configured to use the same frequency band in the same time slot, the two groups of terminal devices cannot communicate successfully on that frequency band. In this case, the static resources that cannot achieve successful communication can be reclaimed, and the terminal devices in this case can be configured to perform dynamic negotiation communication on the corresponding time-frequency resources to improve the flexibility of communication between terminal devices.

[0198] It should be noted that the above Figure 10 and Figure 11 The embodiments are merely exemplary cases where resource recycling is required. In practical applications, there are many other situations where resource recycling is required. For example, if there is no communication requirement between certain groups of terminal devices, the static resources corresponding to these groups can also be recycled. This application does not limit this.

[0199] The following section, in conjunction with the accompanying diagram, describes the specific implementation process of resource recycling.

[0200] For example, such as Figure 12 The diagram shown is a schematic flowchart illustrating resource reclamation in a method for allocating resources in a wireless ad hoc network according to an embodiment of this application. The execution entity of this process can be any terminal device in the wireless ad hoc network system, and specifically may include the following steps:

[0201] S1201, the target terminal device listens for heartbeat packets sent by other terminal devices.

[0202] The target terminal device can be any terminal device in the wireless ad hoc network system. Other terminal devices in this step can refer to either those adjacent to the target terminal device or those not adjacent to it. For ease of understanding, we assume that the terminal devices adjacent to the target terminal device are adjacent terminal device 1 and adjacent terminal device 2.

[0203] In some embodiments, each terminal device in a wireless ad hoc network system can send heartbeat packets in a specific time slot, and a target terminal device can perform a heartbeat listening operation in that specific time slot. For example, in each communication cycle, a specific time slot can be set for a terminal device to send its own heartbeat packet and listen to the heartbeat packets of other terminal devices. For instance, the 23rd time slot in each communication cycle can be set for terminal devices to send and listen to heartbeat packets.

[0204] For example, a heartbeat packet may include the identifier of the terminal device, network status (such as online), group to which it belongs, and its location, etc.

[0205] S1202, the adjacent terminal device 1 periodically sends heartbeat packets.

[0206] S1203, the adjacent terminal device 2 periodically sends heartbeat packets.

[0207] S1204, the target terminal device determines the network status of other terminal devices based on the heartbeat packet monitoring results.

[0208] In some embodiments, the target terminal device can determine the network status of neighboring terminal devices based on the heartbeat packets it has detected. For example, the target terminal device can determine other terminal devices adjacent to it based on the location of other terminal devices included in the heartbeat packets; or, for example, the target terminal device can determine other terminal devices adjacent to it based on the identifiers of other terminal devices included in the heartbeat packets.

[0209] In some embodiments, the target terminal device can determine the network status of neighboring terminal devices based on the heartbeat packets of other terminal devices it has listened to. For example, when it listens to the heartbeat packets of a terminal device adjacent to the target terminal device, the target terminal device can determine that the neighboring terminal device is in an online state. For terminal devices whose heartbeat packets are not listened to, the target terminal device determines that these terminal devices are in an offline state (or cannot communicate directly).

[0210] In some embodiments, for terminal devices that have detected heartbeat packets, the target terminal device can determine which group these terminal devices belong to based on the heartbeat packets.

[0211] It should be noted that in some cases, terminal devices within a certain group can listen to the heartbeat packets of terminal devices in all other groups, indicating that the target terminal device can communicate with all other groups. However, in other cases, a certain group may only listen to the heartbeat packets of terminal devices in some other groups, and cannot listen to the heartbeat packets of terminal devices in other groups. In other words, a certain group can only communicate with terminal devices in some groups, and cannot communicate with terminal devices in other groups. In this case, the static resources allocated to that group and the other group can be reclaimed. Specifically, the time-domain resources using the same frequency band corresponding to that group and the other group can be used for dynamic negotiation. That group and the other group can flexibly negotiate communication with other groups they want to communicate with using these time-domain resources, without having to switch their frequency bands according to a fixed frequency hopping sequence, and can only communicate with the other group in the group.

[0212] For example, assuming that by monitoring heartbeat packets as described above, the terminal devices in group 1 determine that they cannot communicate directly with the terminal devices in group 15, then the frequency domain resources corresponding to groups 1 and 15 in time slot 0 can be set as dynamic resources. That is, with... Figure 7 and Figure 9 Unlike other groups, Groups 1 and 15 do not need to switch their frequency bands according to a static resource allocation strategy; instead, they can flexibly negotiate communication dynamically with terminal devices in other groups. For example... Figure 13 As shown, time slots 16 to 23 are reserved dynamic resources, allowing each terminal device in each group to negotiate and use frequency domain resources for communication. For groups located within the same cluster but unable to communicate directly between pairs of terminal devices, the time slots originally allocated to these groups for communication on the same frequency band can also be set as dynamic resources, such as... Figure 13 The blank areas in time slots 0 to 15 shown (i.e., the areas without numbers in the boxes).

[0213] For example, such as Figure 14 The diagram shown is a schematic flowchart of the dynamic negotiation communication in the wireless ad hoc network resource allocation method provided in the embodiments of this application.

[0214] Combination Figure 13 The resource allocation results shown, taking the communication between terminal devices in Group 1 and Group 5 as an example, introduce the dynamic negotiation process between terminal devices involved in the resource allocation method of wireless ad hoc networks.

[0215] like Figure 13 As shown, both Group 1 and Group 5 communicate using frequency 6 in time slot 6. At this time, the first terminal device in Group 1 can communicate with the second terminal device in Group 6. Assuming that after the first and second terminal devices have exchanged data in time slot 6, there is still other data that needs to be exchanged, then the first and second terminal devices can dynamically negotiate in time slot 6 to use the same frequency band again in a subsequent time slot to continue data exchange.

[0216] For example, in time slot 6, all terminal devices in group 1 and all terminal devices in group 5 switch their operating frequency to frequency 6. Then, on frequency 6, the first terminal device and the second terminal device perform a preset data interaction. After the preset data interaction is completed, if the second terminal device determines that it needs to continue data interaction with the first terminal device, it can send a dynamic negotiation request message to the first terminal device, requesting the first terminal device to continue data interaction with the second terminal device using a specific frequency in a subsequent time slot. In response to the dynamic negotiation request message, the first terminal device can determine the subsequently available time slots and frequencies, and send a dynamic negotiation response message to the second terminal device, indicating the available time slots and frequencies for continued data interaction. For example, the dynamic negotiation response message may include the identifiers corresponding to time slot 18 and frequency 0, thereby indicating that the first terminal device and the second terminal device can continue data interaction in time slot 18 using frequency 0.

[0217] Next, when time slot 18 arrives, both the first and second terminal devices can switch their operating frequencies to frequency 0 and continue data interaction via frequency 0. After the preset data interaction is completed, if the first terminal device determines that it needs to continue data interaction with the second terminal device, it can send a dynamic negotiation request message to the second terminal device, requesting the second terminal device to continue data interaction with it via a specific frequency in a subsequent time slot. In response to this dynamic negotiation request message, the second terminal device can determine the available time slots and frequencies and send a dynamic negotiation response message to the first terminal device, indicating the available time slots and frequencies for continued data interaction. For example, the dynamic negotiation response message may include the identifiers corresponding to time slot 22 and frequency 1, thereby indicating that the second and first terminal devices can continue data interaction via frequency 1 in time slot 22.

[0218] Next, when time slot 22 arrives, the first terminal device and the second terminal device can switch their operating frequency to frequency 1 respectively, and then continue to interact with data through frequency 1.

[0219] It should be noted that the above Figure 14 The first terminal device in group 1 and the second terminal device in group 5 involved in the embodiments, as well as the time slots and frequency points negotiated by the two terminal devices, are only examples. In actual applications, any terminal device in each group of the wireless ad hoc network system can use the above method to dynamically negotiate the time slots and frequency points for continued communication with other group terminal devices. This application embodiment does not limit this.

[0220] For example, such as Figure 15The diagram shown is a schematic flowchart illustrating a method for resource allocation in a wireless ad hoc network according to an embodiment of this application. The process may include the following steps:

[0221] S1501, Send a wireless ad hoc network broadcast message, which includes access information of the wireless ad hoc network system.

[0222] In some embodiments, when the main terminal device initiates a wireless ad hoc network system, it may send a wireless ad hoc network broadcast message. This broadcast message may include, for example, access information of the wireless ad hoc network system. For instance, if the main terminal device is a Wi-Fi router, the access information may be the SSID and corresponding password of the main terminal device's Wi-Fi network.

[0223] S1502, receive access request messages sent by multiple terminal devices, and connect the multiple terminal devices to the wireless ad hoc network system.

[0224] The process of connecting a terminal device to a wireless ad hoc network system can be found in the above text. Figure 4 The descriptions in the embodiments will not be repeated here.

[0225] S1503, group the multiple terminal devices accessing the wireless ad hoc network system into N groups, where each group includes at least one terminal device, including a master terminal device and a slave terminal device, and N is an integer greater than 2.

[0226] In some embodiments, after a slave terminal device accesses the wireless ad hoc network system, it can send a packet request message to the master terminal device. The packet request message is used to request the master terminal device to group the slave terminal device. After receiving the packet request message sent by the slave terminal device, the master terminal device can respond to the packet request message by randomly grouping multiple terminal devices in the wireless ad hoc network system to obtain N groups. Alternatively, after receiving the packet request message sent by the slave terminal device, the master terminal device can respond to the request in the packet request message to group the slave terminal device and the target terminal device into the same group.

[0227] S1504, Based on the grouping results corresponding to multiple terminal devices, determine the resource allocation strategy. The resource allocation strategy includes that terminal devices in the same group use the same frequency band in static resource time slots, and terminal devices in any two groups use the same frequency band in at least one static resource time slot.

[0228] In some embodiments, N is an even number greater than 2. The process of determining the resource allocation strategy based on the grouping results corresponding to the plurality of terminal devices may specifically include: allocating the same frequency band to every two groups in each static resource time slot according to the grouping results of the plurality of terminal devices, such that any two groups of terminal devices use the same frequency band in at least one static resource time slot.

[0229] The process of allocating the same frequency band to every two groups in each static resource time slot based on the grouping results of the multiple terminal devices can specifically include: dividing M frequency bands according to the system frequency bands of the wireless ad hoc network system, where the M frequency bands are used for communication between pairs of N groups of terminal devices in different static resource time slots, where N = M * 2; combining the N groups corresponding to each static resource time slot in pairs to obtain a target combination result, where the target combination result is a combination consisting of any two groups in the static resource time slot; and allocating the M working frequency bands to the M combinations in each static time slot, so that the two groups of terminal devices in the same combination use the same frequency band in the same static resource time slot.

[0230] The process of combining each of the N groups corresponding to each static resource time slot into pairs to obtain the target combination result can be found in the process of combining multiple groups in multiple rounds as described above, and will not be repeated here.

[0231] In some embodiments, the resource allocation strategy in this application may further be used to instruct the terminal device to conduct negotiation communication in at least one dynamic resource time slot. The dynamic resource time slot may, for example, correspond to... Figure 9 Time slots 16 to 23.

[0232] S1505, send the resource allocation policy to the terminal device.

[0233] In some embodiments, the master terminal device can determine the frequency hopping sequence corresponding to each of the N groups of terminal devices based on the same frequency band allocated to every two groups on each static resource time slot. Then, the master terminal device can write this frequency hopping sequence into the resource allocation policy and send it to the slave terminal devices.

[0234] In some embodiments, the slave terminal device may receive a resource allocation strategy sent by the master terminal device, and then switch the corresponding frequency band on different static resource time slots according to the frequency modulation sequence indicated in the resource allocation strategy.

[0235] In some embodiments, the master terminal device can also reclaim static resources that are not actually usable. For example, a slave terminal device can obtain the network status of neighboring terminals by listening to heartbeat packets, and then request the master terminal device to reclaim specific static resources based on the network status of the neighboring terminal devices. For example, this process may include: the slave terminal device sending its own heartbeat packet and listening to heartbeat packets sent by other terminal devices; determining, based on the heartbeat packet listening results, that terminal devices in the slave terminal device's group cannot achieve single-hop communication with at least one terminal device in another group; and then, the slave terminal device sending a resource reclamation request message to the master terminal device, the resource reclamation request message indicating that terminal devices in the slave terminal device's group cannot achieve single-hop communication with at least one terminal device in another group.

[0236] In some embodiments, the master terminal device may obtain a resource reclamation request message sent by the first slave terminal device, and in response to the resource reclamation request message, change the static resource time slot corresponding to the group to which the first terminal device belongs and the other at least one group using the same frequency band to a dynamic resource time slot. The dynamic resource time slot is used for negotiation communication between the terminal devices in the group to which the first terminal device belongs and the other at least one group.

[0237] In some embodiments, terminal devices in a wireless ad hoc network can negotiate to continue communication on available dynamic resource time slots in static resource time slots, allowing communication tasks not completed in static resource time slots to continue execution in dynamic resource time slots. For example, a slave terminal device can send a dynamic negotiation request message to a second terminal device (another group of terminal devices communicating with the slave device in the current static resource time slot) in a static resource time slot. This dynamic negotiation request message requests to continue communication with the second terminal device using a dynamic resource time slot. The slave terminal device can receive a dynamic negotiation response message from the second terminal device, indicating the target dynamic resource time slot and target frequency band for continued communication. When the target dynamic resource time slot is reached, communication with the second terminal device continues on the target frequency band.

[0238] The wireless ad hoc network resource allocation method provided in this application group terminal devices in the wireless ad hoc network communication system and enables any two groups of terminal devices to communicate using the same narrow frequency band in at least one time slot during the frequency modulation period. This allows the wireless ad hoc network to reasonably utilize the air interface resources of the wireless ad hoc network system and improve system capacity while satisfying the requirement for narrowband communication between terminal devices.

[0239] Based on the same technical concept, embodiments of this application also provide a computer-readable storage medium storing computer-executable program instructions, which, when executed on a computer, cause the computer or processor to perform one or more steps of any of the above methods.

[0240] Based on the same technical concept, embodiments of this application also provide a computer program product containing instructions, the computer program product including computer program code, which, when run on a computer, causes the computer or processor to perform one or more steps of any of the above methods.

[0241] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0242] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

[0243] The above description is merely a specific implementation of the embodiments of this application, but the protection scope of the embodiments of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the embodiments of this application should be covered within the protection scope of the embodiments of this application. Therefore, the protection scope of the embodiments of this application should be determined by the protection scope of the claims.

Claims

1. A method for resource allocation in a wireless ad hoc network, characterized in that, Applied to a main terminal device, the main terminal device being used to initiate the wireless ad hoc network, the method includes: Send a wireless ad hoc network broadcast message, the wireless ad hoc network broadcast message including the access information of the wireless ad hoc network system; Receive multiple access request messages sent by terminal devices and connect the multiple terminal devices to the wireless ad hoc network system; Multiple terminal devices accessing the wireless ad hoc network system are grouped into N groups, where each group includes at least one of the terminal devices, and the terminal devices include the master terminal device and the slave terminal device, where N is an integer greater than 2. Based on the grouping results corresponding to the multiple terminal devices, a resource allocation strategy is determined. The resource allocation strategy includes that the terminal devices in the same group use the same frequency band in static resource time slots, and that the terminal devices in any two groups use the same frequency band in at least one static resource time slot. The resource allocation strategy is sent to the terminal device.

2. The method according to claim 1, characterized in that, Where N is an even number greater than 2, the step of determining the resource allocation strategy based on the grouping results corresponding to the multiple terminal devices specifically includes: Based on the grouping results of the plurality of terminal devices, the same frequency band is allocated to every two groups in each static resource time slot, such that the terminal devices in any two groups use the same frequency band in at least one static resource time slot.

3. The method according to claim 2, characterized in that, The step of allocating the same frequency band to every two groups in each static resource time slot according to the grouping results of the multiple terminal devices specifically includes: According to the system frequency band of the wireless ad hoc network system, M frequency bands are divided. The M frequency bands are used for N groups of terminal devices to communicate between each other on different static resource time slots, where N = M * 2. Each static resource time slot is paired with N groups to obtain a target combination result, wherein the target combination result is a combination in the static resource time slot consisting of any two groups. The M working frequency bands are respectively allocated to the M combinations in each of the static resource time slots, so that two groups of terminal devices in the same combination use the same frequency band in the same static resource time slot.

4. The method according to claim 2 or 3, characterized in that, The resource allocation strategy includes a frequency hopping sequence, which is used to indicate the frequency band of the terminal device in each static resource time slot. The method further includes: Based on the same frequency band allocated to each pair of static resource time slots, the frequency hopping sequences corresponding to the terminal devices of the N groups are determined respectively.

5. The method according to any one of claims 1-3, characterized in that, The resource allocation strategy is also used to instruct the terminal device to conduct negotiation communication in at least one dynamic resource time slot.

6. The method according to any one of claims 1-3, characterized in that, The slave terminal device includes a first slave terminal device, and the method further includes: Obtain the resource reclamation request message sent by the first slave terminal device, wherein the resource reclamation request message is used to indicate that none of the terminal devices in the group to which the first slave terminal device belongs can perform single-hop communication with at least one terminal device in another group; In response to the resource reclamation request message, the static resource time slot corresponding to the group where the first terminal device is located and the other at least one group using the same frequency band is changed to a dynamic resource time slot. The dynamic resource time slot is used for negotiation communication between the terminal devices in the group where the first terminal device is located and the other at least one group.

7. The method according to any one of claims 1-3, characterized in that, The step of grouping multiple terminal devices accessing the wireless ad hoc network system to obtain N groups specifically includes: The master terminal device receives a packet request message sent by the slave terminal device, the packet request message being used to request the master terminal device to send a packet to the slave terminal device; In response to the group request message, the multiple terminal devices of the wireless ad hoc system are randomly grouped to obtain N groups; or, The master terminal device receives a grouping request message sent by the slave terminal device, the grouping request message being used to request the master terminal device to group the slave terminal device and the target terminal device into the same group; In response to the grouping request message, the slave terminal device and the target terminal device are grouped into the same group.

8. A method for resource allocation in a wireless ad hoc network, characterized in that, Applied to a terminal device, the method includes: The main terminal device receives a wireless ad hoc network broadcast message sent by the main terminal device. The wireless ad hoc network broadcast message includes the access information of the wireless ad hoc network system. The main terminal device is used to initiate the wireless ad hoc network. In response to the wireless ad hoc network broadcast message, an access request message is sent to the main terminal device, the access request message being used to request access to the wireless ad hoc network system; Send a packet request message to the master terminal device, the packet request message being used to request the master terminal device to group the slave terminal device; The system receives a resource allocation strategy sent by the main terminal device. The resource allocation strategy includes that terminal devices in the same group use the same frequency band in static resource time slots, and that terminal devices in any two groups use the same frequency band in at least one static resource time slot.

9. The method according to claim 8, characterized in that, The resource allocation strategy includes a frequency hopping sequence, which is used to indicate the frequency band of the terminal device in each static resource time slot. The method further includes: When communication is performed on the static resource time slot, the frequency band is switched to the corresponding frequency band on different static resource time slots according to the frequency hopping sequence.

10. The method according to claim 8 or 9, characterized in that, Sending the packet request message to the main terminal device further includes: Based on historical communication records, identify the target terminal device with the most historical communication transactions; The master terminal device sends the group request message, which requests the master terminal device to group the slave terminal device and the target terminal device into the same group.

11. The method according to claim 8 or 9, characterized in that, The method further includes: Send the heartbeat packet corresponding to the terminal device, and listen for heartbeat packets sent by other terminal devices; Based on the heartbeat packet monitoring results, it is determined that the terminal device in the group where the terminal device is located cannot achieve single-hop communication with the terminal device in at least one other group; A resource reclamation request message is sent to the master terminal device, the resource reclamation request message being used to indicate that none of the terminal devices in the group to which the slave terminal device belongs can perform single-hop communication with terminal devices in at least one other group.

12. The method according to claim 8 or 9, characterized in that, The resource allocation strategy is further used to instruct the terminal device to use dynamic resources for communication in at least one dynamic resource time slot, the dynamic resources being used for negotiation communication between the terminal devices, and the method further includes: A dynamic negotiation request message is sent to a second terminal device in the static resource time slot. The second terminal device is another group of terminal devices that communicate with the slave terminal device in the current static resource time slot. The dynamic negotiation request message is used to request to continue communicating with the second terminal device using the dynamic resource time slot. Receive a dynamic negotiation response message sent by the second terminal device, the dynamic negotiation response message being used to indicate the target dynamic resource time slot and target frequency band for continuing communication; When the target dynamic resource time slot is reached, communication with the second terminal device continues on the target frequency band.

13. A wireless ad hoc network system, characterized in that, The wireless ad hoc network system includes a master terminal device and multiple slave terminal devices. The master terminal device is used to initiate the wireless ad hoc network and is also used to perform the method as described in any one of claims 1 to 7. The slave terminal devices are used to perform the method as described in any one of claims 8 to 12.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable program instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1 to 12.

Citation Information

Patent Citations

  • Resource allocation method and device based on virtual link

    CN111278017A

  • Resource allocation method for wireless ad hoc network

    CN111818653A