Address allocation method and device, equipment and medium

By introducing dynamic IP address allocation by group owners and synchronizing topology information in P2P groups, the problem of devices automatically obtaining IP addresses is solved, achieving efficient IP address management and stable communication connections.

CN121567680APending Publication Date: 2026-02-24深圳开鸿数字产业发展有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511743981.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-25
Publication Date
2026-02-24

AI Technical Summary

Technical Problem

In existing technologies, devices in P2P groups cannot automatically obtain IP addresses, leading to complex configurations and problems such as duplicate allocation and network connection errors.

Method used

By responding to the client's address request, the group owner selects an IP address for the client and synchronizes that IP address to the entire P2P group, thereby achieving dynamic IP address allocation and topology map information updates.

Benefits of technology

It enables dynamic IP address allocation for devices within a P2P group, avoiding address conflicts, improving network management efficiency and security, and ensuring the continuity and stability of communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121567680A_ABST
    Figure CN121567680A_ABST
Patent Text Reader

Abstract

The invention discloses an address allocation method and device, equipment and a medium, and the method comprises the steps: a group owner selects a first IP address for a first group client in response to an address request sent by the first group client; and the group owner sends the first IP address to the first group client, and synchronizes the first IP address to other group clients in the P2P group, so that each group client in the P2P group obtains the topological graph information of the P2P group. According to the method and the device, the dynamic allocation of the IP addresses of the group clients is realized, the IP addresses of the clients in the P2P group are efficiently acquired, the IP address conflict problem is effectively avoided, and the efficiency and the security of network management are remarkably improved. Besides, redistribution and synchronization of the IP address can be rapidly completed whether the group client is newly added or the P2P group structure is adjusted, and continuity and stability of communication in the P2P group are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet technology, and in particular to an address allocation method, apparatus, device and medium. Background Technology

[0002] WiFi P2P (also known as WiFi Direct) is a common technology that allows devices to communicate directly over WiFi without relying on traditional wireless routers, thus providing greater flexibility and convenience for device connections. Applications built on P2P technology, such as file transfer, content sharing, and interactive games, all require knowledge of the other device's IP address.

[0003] However, group clients cannot obtain the IP addresses of themselves or other group clients within the P2P group via the P2P protocol. This prevents direct communication between group clients within a P2P group via WiFi. Currently, the common practice is to assign static IP addresses to all devices within a P2P group. This requires network knowledge from the configuration personnel, and static IP addresses lack flexibility. Whenever a new device joins the P2P group, its IP address must be manually configured, increasing configuration complexity and workload, and also increasing the risk of duplicate IP address assignments, which can lead to network connection errors.

[0004] Therefore, the existing technology still needs to be improved and enhanced. Summary of the Invention

[0005] The technical problem to be solved by this application is to provide an address allocation method, apparatus, device and medium to address the shortcomings of the prior art.

[0006] To address the aforementioned technical problems, this application provides an address allocation method in its first aspect, applied to a P2P group, wherein the P2P group includes a group owner and several group clients; the address allocation method specifically includes: The group owner responds to the address request sent by the first group client and selects a first IP address for the first group client; The group owner sends the first IP address to the first group client and synchronizes the first IP address to other group clients in the P2P group, so that each group client in the P2P group can know the topology information of the P2P group.

[0007] The address allocation method, wherein before the group owner responds to the address request sent by the first group client and selects a first IP address for the first group client, the method further includes: When the first group client joins the P2P group, the group owner and the first group client establish a connection through negotiation, so that the group owner can receive the address request sent by the first group client through the connection.

[0008] The address allocation method, wherein the group owner responds to the address request sent by the first group client and selects a first IP address for the first group client, specifically includes: The group owner listens for address requests sent by group clients; Upon receiving an address request from the first group client, the group owner selects an available address from the address resource pool for the first group client to obtain the first IP address corresponding to the first group client.

[0009] The address allocation method, wherein before the group owner selects an available address for the first group client from the address resource pool, the method further includes: The group owner reads the physical address of the first group client from the address request and checks whether the physical address is bound to an IP address; When the physical address is not bound to an IP address, the group owner selects an available address for the first group client from the address resource pool. When the physical address is bound to an IP address, the group owner sends its own IP address and the IP address bound to the physical address to the first group client.

[0010] In the address allocation method, when the group owner sends the first IP address to the first group client, the group owner simultaneously sends its own IP address to the first group client.

[0011] The address allocation method further includes: The group owner reclaims the second IP address assigned to the second group client that exited the P2P group; The group owner synchronizes the second IP address with other group clients in the P2P group, so that each group client in the P2P group updates the topology information of the P2P group based on the second IP address.

[0012] The address allocation method further includes: The group owner receives IP address renewal requests from clients in the third group within their P2P group; The group owner processes the lease renewal request for the third group client based on the IP address.

[0013] A second aspect of this application provides an address allocation device for allocating IP addresses to a P2P group, wherein the P2P group includes a group owner and several group clients; the address allocation device specifically includes: The address allocation module is used to respond to the address request sent by the first group client and select a first IP address for the first group client; The link management module is used to send the first IP address to the first group client and synchronize the first IP address to other group clients in the P2P group, so that each group client in the P2P group can know the topology information of the P2P group.

[0014] A third aspect of this application provides a computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the steps in any of the address allocation methods described above.

[0015] A fourth aspect of this application provides a terminal device, which includes: a processor and a memory; The memory stores a computer-readable program that can be executed by the processor; When the processor executes the computer-readable program, it implements the steps in any of the address allocation methods described above.

[0016] Beneficial Effects: Compared with existing technologies, this application provides an address allocation method, apparatus, device, and medium. The method includes a group owner responding to an address request sent by a first group client and selecting a first IP address for the first group client; the group owner sending the first IP address to the first group client and synchronizing the first IP address to other group clients in the P2P group, so that each group client in the P2P group can obtain the topology information of the P2P group. This application realizes the dynamic allocation of group client IP addresses, efficiently obtains the IP addresses of each client within the P2P group, effectively avoids IP address conflicts, and significantly improves the efficiency and security of network management. Furthermore, whether adding a new group client or adjusting the P2P group structure, the reallocation and synchronization of IP addresses can be completed quickly, ensuring the continuity and stability of communication within the P2P group. Attached Figure Description

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

[0018] Figure 1 A flowchart illustrating the address allocation method provided in this application embodiment.

[0019] Figure 2 This is a general technical framework diagram of the address allocation method provided in the embodiments of this application.

[0020] Figure 3 This is a flowchart illustrating the process of selecting an IP address.

[0021] Figure 4 This is a flowchart illustrating the IP address management process.

[0022] Figure 5 This is a schematic block diagram of the address allocation device provided in the embodiments of this application.

[0023] Figure 6 A schematic block diagram of the terminal device provided in the embodiments of this application. Detailed Implementation

[0024] This application provides an address allocation method, apparatus, device, and medium. To make the objectives, technical solutions, and effects of this application clearer and more explicit, the following detailed description is provided with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only for explaining this application and are not intended to limit this application.

[0025] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this application means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any units and all combinations of one or more associated listed items.

[0026] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.

[0027] It should be understood that the sequence number and size of each step in this embodiment do not imply the order of execution. The execution order of each process is determined by its function and internal logic, and should not constitute any limitation on the implementation process of this application embodiment.

[0028] Research has revealed that WiFi P2P (also known as WiFi Direct) is a common technology that allows devices to communicate directly via WiFi without relying on traditional wireless routers, thus providing greater flexibility and convenience for device connections. Applications built on P2P technology, such as file transfer, content sharing, and interactive games, all require knowledge of the other device's IP address.

[0029] However, group clients cannot obtain the IP addresses of themselves or other group clients within the P2P group via the P2P protocol. This prevents direct communication between group clients within a P2P group via WiFi. Currently, the common solution is to assign static IP addresses to all devices within a P2P group. This requires network knowledge from the configuration personnel, and static IP addresses lack flexibility. Whenever a new device joins the P2P group, its IP address must be manually configured, increasing configuration complexity and workload, and increasing the risk of duplicate IP address allocation, leading to network connection errors. Alternatively, Dynamic Host Configuration Protocol (DMP) is used for IP address allocation. However, existing DMP implementations only assign IP addresses to group clients; group clients within the P2P group still cannot know each other's IP addresses and therefore cannot communicate directly via WiFi.

[0030] To address the aforementioned issues, in this embodiment, the group owner responds to an address request sent by a first group client and selects a first IP address for the first group client. The group owner then sends the first IP address to the first group client and synchronizes it with other group clients within the P2P group, enabling each group client in the P2P group to access the P2P group's topology information. This application achieves dynamic allocation of group client IP addresses, efficiently obtaining the IP addresses of each group client within the P2P group, effectively avoiding IP address conflicts, and significantly improving network management efficiency and security. Furthermore, whether adding a new group client or adjusting the P2P group structure, IP address reallocation and synchronization can be completed quickly, ensuring the continuity and stability of communication within the P2P group, allowing group clients within the P2P group to communicate directly via WiFi.

[0031] The application content will be further explained below with reference to the accompanying drawings and through the description of the embodiments.

[0032] This embodiment provides an address allocation method for allocating IP addresses to a P2P group. The P2P cluster includes at least one P2P group, and each P2P group includes a group owner. and several group clients The group owner and each group client All participants have access to the topology information of the P2P group, through which they can identify the group owners within the P2P group. and each group client The IP address, i.e., any terminal device in the P2P group (such as a group client). Both can be used to access another terminal device (such as another group client). The IP address is used to communicate directly via WiFi P2P.

[0033] Among them, several group clients Each group client in All are group owners The client assigned to it, and newly added to the P2P group. Group owner The new group owner will be Assign IP addresses and assign new group owners. The assigned IP address is synchronized to other group clients in the P2P group. Meanwhile, when a certain group client Leaving the P2P group, group owner The group client that exited will be recycled. The IP address, and the group clients that will be recycled. The IP address is synchronized to other group clients in the P2P group. This not only provides benefits to group clients. Dynamically assigning addresses also allows each group client in a P2P group to... All obtained group owner Other group clients The IP address, and can also be used based on group clients in the P2P group. It updates itself in real time to keep up with changes, ensuring that group members in the P2P group can communicate directly via WiFi P2P, and also avoiding communication interruptions caused by invalid or unknown addresses, thus improving the stability and reliability of P2P group communication.

[0034] like Figure 1and Figure 2 As shown, the address allocation method provided in this application embodiment specifically includes: S10. The group owner responds to the address request sent by the first group client and selects a first IP address for the first group client.

[0035] Specifically, the group owner is the core management node of the P2P group, and the first group client is the device node that joins the P2P group. Both the group owner and the first group client can be smartphones, tablets, smart TVs, or other terminal devices that support WiFi P2P functionality.

[0036] The first group client sending the address request can be either an existing member of the P2P group or a newly applying member. In other words, after the group owner and group clients form a P2P group, the group owner can assign IP addresses to the group clients within the group. Furthermore, when a new group client joins the P2P group, the group owner can also assign an IP address to the new client, thus dynamically assigning an address to each group client joining the P2P group.

[0037] Furthermore, the address request is sent by the first group client to the group owner, requesting the group owner to assign it an IP address. In other words, before the group owner responds to the address request sent by the first group client, the first group client establishes a connection with the group owner and sends the address request through that connection, so that the group owner receives and responds to the address request, thereby assigning an IP address to the first group client.

[0038] Based on this, before the group owner responds to the address request sent by the first group client and selects a first IP address for the first group client, the method further includes: When the first group client joins the P2P group, the group owner and the first group client establish a connection through negotiation, so that the group owner can receive the address request sent by the first group client through the connection.

[0039] Specifically, a client joining a P2P group refers to the first client actively requesting to join the P2P group. The group owner receives the client's request, which may include key data such as the client's device identifier and network configuration information. The group owner then verifies the client's identity based on the key data in the request. After successful verification, the group owner negotiates a stable connection with the client. The client can then use this connection to send address requests, which the group owner can receive and respond to. During the identity verification process, the group owner can first verify the received device identifier to confirm its legitimacy and check if the network configuration information complies with preset security policies and specifications. If the device identifier is not in the legitimate registration list, or if the network configuration information is abnormal (e.g., contains malicious code), the group owner will reject the client's request and send an error message. Conversely, if the device identifier is valid and the network configuration information is normal, the identity verification will pass, and the group owner will proceed to the step of communicating and negotiating with the first group client to establish a stable connection.

[0040] In one embodiment, the group owner responding to the address request sent by the first group client and selecting a first IP address for the first group client specifically includes: S11. The group owner listens for address requests sent by group clients; S12. Upon receiving an address request from the first group client, the group owner selects an available address from the address resource pool for the first group client to obtain the first IP address corresponding to the first group client.

[0041] In step S11, the group owner can listen for address requests sent by the first group client through the Dynamic Host Configuration Protocol (DHCP) service. That is, after establishing a P2P group, the group owner can enable DHCP to listen for address requests (i.e., IP address request information). The address request includes the device identifier of the first group client, such as its physical address (i.e., MAC address). This device identifier is used as the address allocation credential for the first group client. The system uses this device identifier to determine whether an IP address should be allocated to the first group client. This ensures the legitimacy of the first group client and avoids duplicate IP address allocations to it.

[0042] In step S12, the address resource pool stores multiple pre-configured IP addresses, which may include IP addresses already assigned to group clients and IP addresses that can be assigned. That is, the address resource pool includes both assigned and assignable IP addresses. Therefore, when assigning a first IP address to a first group client, an IP address can be selected from the assignable IP addresses in the address resource pool to obtain an available address for assignment to the first group client.

[0043] Furthermore, before selecting an available address for the first group of clients, it can be checked whether an IP address has already been assigned to the first group of clients, and then an IP address can be assigned to the first group of clients based on the detection result. Based on this, in one embodiment, before the group owner selects an available address for the first group of clients from the address resource pool, the method further includes: The group owner reads the physical address of the first group client from the address request and checks whether the physical address is bound to an IP address; When the physical address is not bound to an IP address, the group owner selects an available address for the first group client from the address resource pool. When the physical address is bound to an IP address, the group owner sends its own IP address and the IP address bound to the physical address to the first group client.

[0044] Specifically, the physical address serves as the identity identifier for the first group of clients, and it is bound to the IP address assigned to each client. This allows the system to determine whether an IP address has already been assigned to a client based on the physical address. In other words, the group owner maintains an IP address allocation table that stores the mapping between physical addresses and IP addresses. A search can be performed in this table using the physical address as an index to determine whether an IP address has been assigned to that physical address.

[0045] When a physical address is not bound to an IP address, it indicates that a first IP address needs to be assigned to the first group client. The group owner will then select an available address from the address resource pool to assign a first IP address to the first group client. When a physical address is bound to an IP address, it means that an IP address has already been assigned to the first group client. To avoid duplicate IP address assignments and resulting IP address confusion, no new IP address is assigned to the first group client. Instead, the group owner sends its own IP address and the IP address bound to the physical address to the first group client. This allows the first group client to obtain its assigned IP address and the group owner's IP address, enabling a P2P connection between the first group client and the group owner.

[0046] It should be noted that, in order for the first group client to obtain the IP addresses of other group clients in the P2P group, the group owner will also synchronize the IP addresses and physical addresses of other group clients to the first group client, so that the first group client can obtain the P2P group's topology information. The group owner's IP address, the IP address bound to the physical address, the available IP address, and the IP addresses and physical addresses of other group clients can all be sent in the form of messages, and can be sent in one or more messages.

[0047] To further illustrate step S10, a specific embodiment of step S10 is given below. Specifically, as follows... Figure 3 As shown, in this specific implementation example, the specific implementation process of step S10 can be as follows: Group participants receive a join request from the first group client and negotiate a connection with the first group client; When the negotiation connection is successful, the group participants and the first group client successfully establish a group and start the Dynamic Host Configuration Protocol service to listen for group address requests; the first group client receives the event report of the successful connection with the group participants and sends an IP address request to the group participants. Group participants request an available IP address from the IP address resource pool based on the IP address, and send an IP address request reply to the first group client based on the available IP address, wherein the IP address request reply includes the first IP address; The first group of clients verifies whether the first IP address is accessible via the network; If network access is available, the first group client sends an acknowledgment message to inform the group participants that the first IP address has been received and is available. If network access is not available, the first group client sends an error message to inform the group participants that the first IP address has been received and is unavailable.

[0048] S20. The group owner sends the first IP address to the first group client and synchronizes the first IP address to other group clients in the P2P group, so that each group client in the P2P group can know the topology information of the P2P group.

[0049] Specifically, the topology information reflects the network architecture of the P2P group. This information can include the group owner and group clients within the P2P group, as well as the IP addresses assigned to the group owner and the first group client. Therefore, when the group owner sends the first IP address to the first group client, they can directly send the P2P group's topology information to that first group client. Alternatively, the group owner can synchronize their own IP address and physical address with the IP addresses and physical addresses of other group clients to the first group client, allowing the first group client to construct the P2P group's topology information independently. In addition to ensuring that the first group of clients knows its own IP address, the IP addresses of other group clients, and the IP address of the group owner, it is also necessary to ensure that other group clients know the IP address of the first group client. This allows the first group client to proactively establish P2P connections with other group clients, and also enables other group clients to proactively establish P2P connections with the first group client. In other words, after assigning a first IP address to the first group client, this first IP address needs to be synchronized with other group clients in the P2P group, so that other group clients can update the topology information they maintain based on the first group client's first IP address.

[0050] Of course, in practical applications, after assigning IP addresses to the first group of clients, the group owner can update the P2P group's topology information based on those IP addresses. Then, the updated topology information is sent to other group clients, allowing them to directly use the received information as the latest topology for the P2P group. This ensures the consistency and accuracy of the topology information stored by each group client, improving the overall efficiency and stability of the P2P group. Furthermore, it eliminates the need for each group client to maintain and calculate complex topology update logic, reducing their processing burden.

[0051] Furthermore, in practical applications, new group clients will join the P2P group, and some group clients will leave the P2P group. Therefore, in addition to assigning IP addresses to group clients joining the P2P group, the group owner will also reclaim the IP addresses of group clients leaving the P2P group to ensure the accuracy of the topology map information.

[0052] Therefore, as Figure 4 As shown, the address allocation method may further include: The group owner reclaims the second IP address assigned to the second group client that exited the P2P group; The group owner synchronizes the second IP address with other group clients in the P2P group, so that each group client in the P2P group updates the topology information of the P2P group based on the second IP address.

[0053] Specifically, a socket connection is established between the group owner and the group clients in the P2P group. Then, the group owner detects the group owner's departure from the P2P group through the P2P protocol and sends a message to other group clients through the socket connection to inform them of the change. This ensures that all group clients in the P2P group are aware of the change in the group clients and can update the topology information of the P2P group accordingly.

[0054] This application embodiment, by monitoring the exit operation of a second group client, can promptly obtain event information indicating that a second group client has left the P2P group. Upon detecting this exit operation, the group owner quickly initiates an address reclamation process, reclaiming the second IP address originally allocated to the second group client. This reclamation action ensures the effective management and rational utilization of IP address resources, avoiding waste. After reclamation, the group owner immediately synchronizes the reclaimed second IP address with the remaining group clients in the P2P group, enabling other group clients to promptly understand the changes in IP addresses within the group. This allows them to update the P2P group's topology information based on the new address information, ensuring the accuracy and real-time nature of the entire P2P group's topology.

[0055] Furthermore, when allocating IP addresses to the first group of clients, a usage time limit can be configured for that IP address. Before the usage time of the IP address reaches the limit, the first group of clients can apply to renew the lease of the IP address. Then, the group owner will extend the usage time of the IP address based on the renewal request from the third group of clients. Therefore, the address allocation method may also include: The group owner receives IP address renewal requests from clients in the third group within their P2P group; The group owner processes the lease renewal request for the third group client based on the IP address.

[0056] Specifically, the group owner can set an initial IP address usage time limit for each group client. This initial limit can be different for each client in the P2P group. Then, when a third group client uses the IP address and approaches its initial usage time limit, the third group client is allowed to initiate an IP address renewal request to renew the IP address lease. This renewal request can be sent from the third group client to the group owner via the P2P connection.

[0057] Upon receiving an IP address renewal request, the group owner can reassess whether to extend the IP address usage period for the third-party group client. If the renewal is approved, the new lease period is recalculated, and a successful renewal notification is sent to the third-party group client, who can then continue using the IP address. If the renewal is not approved, a failed renewal notification is sent to the third-party group client. This approach ensures the reasonable allocation of network resources while providing flexibility to group clients. The group owner can flexibly decide whether to extend the IP address usage period for requesting renewal based on actual network usage, client needs, and their own strategies. For important or urgent network-using group clients, if their requests are reasonable, approving renewals ensures the continuity of their business. Conversely, for unnecessary or excessively resource-consuming clients, denying renewals avoids wasting network resources and improves overall network efficiency.

[0058] In summary, this embodiment provides an address allocation method. The method includes a group owner responding to an address request sent by a first group client, selecting a first IP address for the first group client; the group owner sending the first IP address to the first group client and synchronizing the first IP address to other group clients in the P2P group, so that each group client in the P2P group can obtain the topology information of the P2P group. This application achieves dynamic allocation of group client IP addresses, efficiently obtaining the IP addresses of each client within the P2P group, effectively avoiding IP address conflicts, and significantly improving the efficiency and security of network management. Furthermore, whether adding a new group client or adjusting the P2P group structure, the reallocation and synchronization of IP addresses can be completed quickly, ensuring the continuity and stability of communication within the P2P group.

[0059] Based on the above address allocation method, this embodiment provides an address allocation device for allocating IP addresses to a P2P group, wherein the P2P group includes a group owner and several group clients; for example Figure 5 As shown, the address allocation device specifically includes: The address allocation module 100 is used to respond to the address request sent by the group client and select a target IP address for the group client; The link management module 200 is used to send the target IP address to the group client and send address synchronization information to other group clients in the P2P group to which the group owner belongs, so that each group client in the P2P group can know the topology information of the P2P group.

[0060] Based on the above address allocation method, this embodiment provides a computer-readable storage medium that stores one or more programs that can be executed by one or more processors to implement the steps in the address allocation method described in the above embodiment.

[0061] This application also provides an electronic device, such as Figure 6 As shown, it includes at least one processor 21 and memory 22, and may also include a communications interface 23 and a bus 24. The processor 21, memory 22, and communications interface 23 can communicate with each other via the bus 24. The communications interface 23 can transmit information. The processor 21 can invoke logical instructions stored in the memory 22 to execute the methods described in the above embodiments.

[0062] Furthermore, the logical instructions in the aforementioned memory 22 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium.

[0063] The memory 22, as a computer-readable storage medium, can be configured to store software programs, computer-executable programs, such as program instructions or modules corresponding to the methods in the embodiments of this disclosure. The processor 21 executes functional applications and data processing by running the software programs, instructions, or modules stored in the memory 22, thereby implementing the methods in the above embodiments.

[0064] The memory 22 may include a program storage area and a data storage area. The program storage area may store the operating system and application programs required for at least one function; the data storage area may store data created based on the use of the refrigerator. Furthermore, the memory 22 may include high-speed random access memory (RAM) and non-volatile memory. Examples include various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, as well as transient storage media.

[0065] Furthermore, the specific process of loading and executing multiple instruction processors in the aforementioned storage medium and terminal device has been described in detail in the above method, and will not be repeated here.

[0066] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. An address allocation method, characterized in that, This method is applied to P2P groups, which include a group owner and several group clients; the address allocation method specifically includes: The group owner responds to the address request sent by the first group client and selects a first IP address for the first group client; The group owner sends the first IP address to the first group client and synchronizes the first IP address to other group clients in the P2P group, so that each group client in the P2P group can know the topology information of the P2P group.

2. The address allocation method according to claim 1, characterized in that, Before the group owner responds to the address request sent by the first group client and selects a first IP address for the first group client, the method further includes: When the first group client joins the P2P group, the group owner and the first group client establish a connection through negotiation, so that the group owner can receive the address request sent by the first group client through the connection.

3. The address allocation method according to claim 1, characterized in that, The process of the group owner responding to the address request sent by the first group client and selecting a first IP address for the first group client specifically includes: The group owner listens for address requests sent by group clients; Upon receiving an address request from the first group client, the group owner selects an available address from the address resource pool for the first group client to obtain the first IP address corresponding to the first group client.

4. The address allocation method according to claim 3, characterized in that, Before the group owner selects an available address for the first group client from the address resource pool, the method further includes: The group owner reads the physical address of the first group client from the address request and checks whether the physical address is bound to an IP address; When the physical address is not bound to an IP address, the group owner selects an available address for the first group client from the address resource pool. When the physical address is bound to an IP address, the group owner sends its own IP address and the IP address bound to the physical address to the first group client.

5. The address allocation method according to claim 1, characterized in that, When the group owner sends the first IP address to the first group client, the group owner simultaneously sends its own IP address to the first group client.

6. The address allocation method according to claim 1, characterized in that, The method further includes: The group owner reclaims the second IP address assigned to the second group client that exited the P2P group; The group owner synchronizes the second IP address with other group clients in the P2P group, so that each group client in the P2P group updates the topology information of the P2P group based on the second IP address.

7. The address allocation method according to claim 1, characterized in that, The method further includes: The group owner receives IP address renewal requests from clients in the third group within their P2P group; The group owner processes the lease renewal request for the third group client based on the IP address.

8. An address allocation device, characterized in that, A device for assigning IP addresses to P2P groups, wherein the P2P groups include a group owner and several group clients; the address allocation device specifically includes: The address allocation module is used to respond to the address request sent by the first group client and select a first IP address for the first group client; The link management module is used to send the first IP address to the first group client and synchronize the first IP address to other group clients in the P2P group, so that each group client in the P2P group can know the topology information of the P2P group.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs that can be executed by one or more processors to implement the steps in the address allocation method as described in any one of claims 1-7.

10. A terminal device, characterized in that, include: Processor and memory; The memory stores a computer-readable program that can be executed by the processor; When the processor executes the computer-readable program, it implements the steps of the address allocation method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Method, device and computer-readable recording medium for communication on Wi-Fi direct multi-group network

    CN109314847A

  • Method, device and equipment for acquiring IP addresses of group users

    CN112689029A