CN112689029A - Method, device and equipment for acquiring IP address of group user - Google Patents

Method, device and equipment for acquiring IP address of group user Download PDF

Info

Publication number
CN112689029A
CN112689029A CN202011600971.1A CN202011600971A CN112689029A CN 112689029 A CN112689029 A CN 112689029A CN 202011600971 A CN202011600971 A CN 202011600971A CN 112689029 A CN112689029 A CN 112689029A
Authority
CN
China
Prior art keywords
address
group user
dhcp
group
service process
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011600971.1A
Other languages
Chinese (zh)
Inventor
朱雪生
宋子全
庞秀娟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hisense Visual Technology Co Ltd
Original Assignee
Hisense Visual Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hisense Visual Technology Co Ltd filed Critical Hisense Visual Technology Co Ltd
Priority to CN202011600971.1A priority Critical patent/CN112689029A/en
Publication of CN112689029A publication Critical patent/CN112689029A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention provides a method, a device and equipment for acquiring an IP address of a group user, wherein the method comprises the following steps: allocating an Internet Protocol (IP) address to at least one group user through a Dynamic Host Configuration Protocol (DHCP) service process; acquiring the allocated IP address through the DHCP service process, and storing the IP address to a local file; and determining a group user to be connected, and reading the IP address of the group user in the local file. By utilizing the method provided by the invention, the distributed IP address is stored in the local file, the group owner does not need to passively wait for the connection of the group user, and the IP address of the group user can be directly acquired.

Description

Method, device and equipment for acquiring IP address of group user
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method, an apparatus, and a device for acquiring an IP address of a group user.
Background
The point-to-point wireless internet access (Wi-Fi Peer-to-Peer, Wi-Fi P2P) refers to supporting the wireless devices to connect with each other in a point-to-point manner in a wireless network without a router, so as to realize the communication between the devices.
In the existing Wi-Fi P2P connection scheme, after the device connection is successful, the role of the device is negotiated and allocated as a Group Client (GC) or a Group Owner (GO). A device in a group user role may directly acquire an Internet Protocol (IP) address of a group owner connected to the device; the device in the role of the group owner cannot directly acquire the IP of the group user connected to the device.
The method for acquiring the IP address of the group user in the related technology comprises the following steps:
(1) the proposed device is negotiated to assign a group user role by setting the proposed value when the device establishes a Wi-Fi P2P connection.
The method does not fundamentally solve the problem that the group user cannot acquire the IP of the group owner, and when the recommended values of the connected devices are the same, the roles of the group user and the group owner are random, so that the role of the device cannot be guaranteed to be the group user.
(2) When the device is allocated to the role of the group owner, a Socket is created and monitored, and when the group user is actively connected, the IP of the group user is obtained through a Socket.
The method for acquiring the group user IP needs to create additional communication service and establish a monitoring port, passively relies on the group user to actively establish connection, and cannot acquire the group user IP when the group owner actively connects the group user.
Disclosure of Invention
The invention provides a method, a device and equipment for acquiring an IP address of a group user, and solves the problem that a group owner cannot directly acquire the IP address of the group user in the existing Wi-Fi P2P connection scheme.
In a first aspect, the present invention provides a method for acquiring an IP address of a group user, which is applied to a GO device of a group owner, and the method includes:
allocating an Internet Protocol (IP) address to at least one group user through a Dynamic Host Configuration Protocol (DHCP) service process;
acquiring the allocated IP address through the DHCP service process, and storing the IP address to a local file;
and determining a group user to be connected, and reading the IP address of the group user in the local file.
Optionally, the acquiring, by the DHCP service process, the allocated IP address, and before storing the IP address in a local file, further includes:
acquiring an original DHCP service process for allocating an IP address;
and adding a service unit for storing an IP address to a local file in the original DHCP service process to obtain the DHCP service process.
Optionally, allocating an IP address to at least one group user through a DHCP service process, including:
receiving DHCP discovery data broadcasted by at least one group user in a local area network;
sending DHCP suggestion data to the at least one group user, wherein the suggestion data comprises an IP address suggested to be adopted;
receiving DHCP request data which is sent by the at least one group user and confirms to adopt the IP address, wherein the DHCP request data comprises a Media Access Control (MAC) address of the corresponding group user;
and sending DHCP response data to the at least one group user to indicate that the IP address allocation of the corresponding group user is completed.
Optionally, acquiring the allocated IP address through the DHCP service process, and storing the IP address in a local file, including:
acquiring an IP address distributed to the at least one group user and an MAC address of the corresponding group user according to the DHCP request data;
and associating the IP address with the corresponding MAC address and storing the IP address and the corresponding MAC address to a local file.
Optionally, determining a group user to be connected, and reading an IP address of the group user in the local file, including:
determining the MAC address of the group user to be connected according to the DHCP request data;
and reading an IP address corresponding to the MAC address in the local file according to the MAC address, and taking the IP address as the IP address of the group user.
Optionally, the local file comprises at least one of:
a system attribute of the group owner;
storing a file at an IP address created in the file list of the group owner.
Optionally, before the IP address allocated to the at least one group user through the DHCP service process, the method further includes:
searching equipment supporting point-to-point wireless internet Wi-Fi P2P, and selecting at least one group user establishing connection from the searched equipment; or receiving a request for establishing connection sent by at least one group user;
establishing a connection with the at least one group user via Wi-Fi P2P protocol.
In a second aspect, the present invention provides an apparatus for acquiring an IP address of a group user, including a memory and a processor, wherein:
the memory is used for storing a computer program;
the processor is used for reading the program in the memory and executing the following steps:
allocating an Internet Protocol (IP) address to at least one group user through a Dynamic Host Configuration Protocol (DHCP) service process;
acquiring the allocated IP address through the DHCP service process, and storing the IP address to a local file;
and determining a group user to be connected, and reading the IP address of the group user in the local file.
Optionally, the processor acquires the allocated IP address through the DHCP service process, and before storing the IP address in a local file, the processor is further configured to:
acquiring an original DHCP service process for allocating an IP address;
and adding a service unit for storing an IP address to a local file in the original DHCP service process to obtain the DHCP service process.
Optionally, the processor allocates an IP address to at least one group user through a DHCP service process, including:
receiving DHCP discovery data broadcasted by at least one group user in a local area network;
sending DHCP suggestion data to the at least one group user, wherein the suggestion data comprises an IP address suggested to be adopted;
receiving DHCP request data which is sent by the at least one group user and confirms to adopt the IP address, wherein the DHCP request data comprises a Media Access Control (MAC) address of the corresponding group user;
and sending DHCP response data to the at least one group user to indicate that the IP address allocation of the corresponding group user is completed.
Optionally, the acquiring, by the processor, the allocated IP address through the DHCP service process, and storing the IP address in a local file includes:
acquiring an IP address distributed to the at least one group user and an MAC address of the corresponding group user according to the DHCP request data;
and associating the IP address with the corresponding MAC address and storing the IP address and the corresponding MAC address to a local file.
Optionally, the determining, by the processor, a group user to be connected, and reading an IP address of the group user in the local file includes:
determining the MAC address of the group user to be connected according to the DHCP request data;
and reading an IP address corresponding to the MAC address in the local file according to the MAC address, and taking the IP address as the IP address of the group user.
Optionally, the local file comprises at least one of:
a system attribute of the group owner;
storing a file at an IP address created in the file list of the group owner.
Optionally, the processor is further configured to, before the IP address allocated to the at least one group user by using a DHCP service process:
searching equipment supporting point-to-point wireless internet Wi-Fi P2P, and selecting at least one group user establishing connection from the searched equipment; or receiving a request for establishing connection sent by at least one group user;
establishing a connection with the at least one group user via Wi-Fi P2P protocol.
In a third aspect, the present invention provides an apparatus for acquiring IP addresses of group users, including:
the address allocation unit is used for allocating an Internet Protocol (IP) address for at least one group user through a Dynamic Host Configuration Protocol (DHCP) service process;
the address storage unit is used for acquiring the allocated IP address through the DHCP service process and storing the IP address to a local file;
and the address reading unit is used for determining a group user to be connected and reading the IP address of the group user in the local file.
Optionally, the address storage unit obtains the allocated IP address through the DHCP service process, and stores the IP address in a local file, and further configured to:
acquiring an original DHCP service process for allocating an IP address;
and adding a service unit for storing an IP address to a local file in the original DHCP service process to obtain the DHCP service process.
Optionally, the allocating, by the address allocating unit, an IP address to at least one group user through a DHCP service process includes:
receiving DHCP discovery data broadcasted by at least one group user in a local area network;
sending DHCP suggestion data to the at least one group user, wherein the suggestion data comprises an IP address suggested to be adopted;
receiving DHCP request data which is sent by the at least one group user and confirms to adopt the IP address, wherein the DHCP request data comprises a Media Access Control (MAC) address of the corresponding group user;
and sending DHCP response data to the at least one group user to indicate that the IP address allocation of the corresponding group user is completed.
Optionally, the acquiring, by the address storage unit, the allocated IP address through the DHCP service process, and storing the IP address in a local file includes:
acquiring an IP address distributed to the at least one group user and an MAC address of the corresponding group user according to the DHCP request data;
and associating the IP address with the corresponding MAC address and storing the IP address and the corresponding MAC address to a local file.
Optionally, the determining, by the address reading unit, a group user to be connected, and reading an IP address of the group user in the local file includes:
determining the MAC address of the group user to be connected according to the DHCP request data;
and reading an IP address corresponding to the MAC address in the local file according to the MAC address, and taking the IP address as the IP address of the group user.
Optionally, the local file comprises at least one of:
a system attribute of the group owner;
storing a file at an IP address created in the file list of the group owner.
Optionally, the address allocating unit, before the IP address allocated to the at least one group user by using a DHCP service process, is further configured to:
searching equipment supporting point-to-point wireless internet Wi-Fi P2P, and selecting at least one group user establishing connection from the searched equipment; or receiving a request for establishing connection sent by at least one group user;
establishing a connection with the at least one group user via Wi-Fi P2P protocol.
In a fourth aspect, the present invention provides a computer program medium having a computer program stored thereon, which when executed by a processor, performs the steps of a method of acquiring IP addresses of group users as provided in the first aspect above.
The method, the device and the equipment for acquiring the IP addresses of the group users have the following beneficial effects that:
the distributed IP address is stored to a local file through a DHCP service process, the connection of the group user does not need to be passively waited, and the group owner can directly acquire the IP address of the group user.
Drawings
Fig. 1 is a schematic diagram of an application scenario for acquiring IP addresses of group users according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for acquiring an IP address of a group user by a group owner GO device according to an embodiment of the present invention;
fig. 3 is a flowchart of a method for allocating IP addresses to group users through a DHCP service process according to an embodiment of the present invention;
fig. 4 is an interaction flowchart of a method for acquiring IP addresses of group users according to an embodiment of the present invention;
fig. 5 is an interaction diagram of group owner GO devices allocating and storing IP addresses according to an embodiment of the present invention;
fig. 6 is a schematic diagram of an apparatus for acquiring an IP address of a group user according to an embodiment of the present invention;
fig. 7 is a schematic diagram of an apparatus for acquiring an IP address of a group of users according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the description of the embodiments of the present application, "/" means "or" unless otherwise specified, for example, a/B may mean a or B; "and/or" in the text is only an association relationship describing an associated object, and means that three relationships may exist, for example, a and/or B may mean: in the description of the embodiments of the present application, "a" or "a" refers to two or more, and other terms and the like should be understood similarly, the preferred embodiments described herein are only used for explaining and explaining the present application, and are not used for limiting the present application, and features in the embodiments and examples of the present application may be combined with each other without conflict.
It should be noted that the embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Hereinafter, some terms in the embodiments of the present disclosure are explained to facilitate understanding by those skilled in the art.
(1) In the embodiment of the disclosure, the term "point-to-point wireless internet access" (Wi-Fi Peer-to-Peer, Wi-Fi P2P), also called Wi-Fi Direct, allows wireless devices to be interconnected in a point-to-point manner, and is greatly improved in transmission speed and transmission distance compared with bluetooth. Wi-Fi Direct devices are devices that support peer-to-peer connections, which support both infrastructure networks and P2P connections.
(2) The term "Internet Protocol (IP) address" in the embodiments of the present disclosure is a unified address format provided by the IP, and allocates a logical address to each network and each host on the Internet, so as to mask the difference of physical addresses.
(3) In the embodiments of the present disclosure, the term "Media Access Control (MAC) Address, also referred to as a local area network Address, MAC Address, ethernet Address or physical Address, is an Address used to identify the location of a network device.
(4) In the embodiment of the present disclosure, the term "Socket" (Socket) is an abstraction of an endpoint for performing bidirectional communication between application processes on different hosts in a network, and one Socket corresponds to one end of the process communication on the network, and provides a mechanism for the application layer processes to exchange data by using a network protocol.
(5) In the embodiment of the present disclosure, the term "Dynamic Host Configuration Protocol" (DHCP) is a network Protocol of a local area network, and means that a server controls a segment of IP address range, and a client can automatically obtain an IP address and a subnet mask allocated by the server when logging in the server.
(6) The term "DHCP service code" (DNSmasq) in the disclosed embodiments is a small and convenient tool for configuring DNS and DHCP, suitable for small networks, that provides DNS functionality and optionally DHCP functionality.
(7) The term "Real Time Streaming Protocol" (RTSP) in the embodiments of the present disclosure defines how a one-to-many application can efficiently transmit multimedia data over an IP network.
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In view of the problem that a group owner cannot directly obtain an IP address of a group user in an existing Wi-Fi P2P connection scheme, the present application provides a method, an apparatus, and a device for obtaining an IP address of a group user.
A method, an apparatus, and a device for acquiring an IP address of a group user in the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Example 1
As shown in fig. 1, an embodiment of the present invention provides a schematic diagram of an application scenario for acquiring IP addresses of group users, where the application scenario includes:
a group owner GO device 101 for allocating an internet protocol IP address to at least one group user through a dynamic host configuration protocol DHCP service process; acquiring the allocated IP address through the DHCP service process, and storing the IP address to a local file; determining a group user to be connected, and reading the IP address of the group user in the local file;
a group user GC device 102, configured to establish a connection with the group owner GO device, and receive an IP address assigned by the group owner GO device.
It should be noted that the schematic diagram of the application scenario shown in fig. 1 is only an example provided by the embodiment of the present invention, and does not limit the embodiment of the present invention at all, and in the specific implementation, the addition or deletion of the entity device may be performed according to the specific implementation situation. For example, the group owner GO device may establish a one-to-one connection with a group user GC device in the application scenario, where only one group user GC device 102 exists in the application scenario; the group owner GO device may establish connections with multiple group user GC devices, where multiple group user GC devices 102 exist in the application scenario.
It should be noted that, in the scenario of Wi-Fi P2P connection, only one group owner GO device exists among the devices connected to each other.
The group owner and the group user refer to the roles played by the devices in the Wi-Fi P2P connection, and do not limit the implementation functions of the devices, and the group owner GO device and the group user GC device may be any physical devices with networking functions. Such as smart terminals, smart appliances, smart home devices, etc.
As an optional implementation manner, the application scenario is a multi-screen interaction scenario between the intelligent terminal and the intelligent television device.
An embodiment of the present invention provides a flowchart of a method for a group owner GO device to obtain an IP address of a group user, as shown in fig. 2, including:
step S201, an internet protocol IP address is distributed to at least one group user through a dynamic host configuration protocol DHCP service process;
before the above IP address allocated to at least one group user through the DHCP service process, the method further includes:
1. selecting a device to establish a Wi-Fi P2P connection:
embodiment 1: actively look for Wi-Fi P2P enabled devices.
(1) Searching for equipment supporting point-to-point wireless internet Wi-Fi P2P;
device Discovery phase Device Discovery: and finding out devices which are within a certain range and support Wi-Fi P2P through the Wi-Fi P2P.
The number of the searched devices supporting Wi-Fi P2P may be one or more, and the situation that no device supporting Wi-Fi P2P exists may occur.
When the device supporting the Wi-Fi P2P is not found, the finding is continued, and when the finding time is larger than a preset threshold value, a prompt of finding failure is sent.
(2) Selecting at least one group user for establishing connection in the searched equipment;
device Selection phase Device Selection: after the device A finds the device B, the device A sends prompt information to the user so that the user can select whether to be paired with the device B according to requirements.
When the number of the searched devices supporting Wi-Fi P2P is one, sending prompt information to a user so that the user can select whether to pair with the searched device supporting Wi-Fi P2P according to requirements;
when the number of the searched devices supporting Wi-Fi P2P is multiple, prompt information is sent to the user, so that the user can select whether to pair with the searched devices supporting Wi-Fi P2P and which devices are paired according to requirements.
Embodiment 2: waiting for a connection request by a device that supports Wi-Fi P2P.
The group user searches for devices supporting point-to-point wireless internet Wi-Fi P2P, and selects a group owner GO device for establishing connection from the searched devices.
A group owner GO device receives a request sent by at least one group user to establish a connection.
2. Establishing a connection with the at least one group user via Wi-Fi P2P protocol.
And establishing the connection between the devices according to the Wi-Fi Direct technical specification.
The connection establishment phase also comprises the allocation of roles among the devices, wherein the roles comprise a Group Owner and at least one Group user Group Client.
Note that, in the device that selects to establish the Wi-Fi P2P connection in step 1, no role has been assigned yet, and the description is made from the perspective of the device assigned as the group owner GO device in step 2.
The above process can also be explained by the following way:
the first device searches for a device supporting Wi-Fi P2P through Wi-Fi P2P;
the first equipment selects at least one second equipment for establishing connection from the searched equipment;
establishing a connection between the first device and a second device via Wi-Fi P2P, and determining roles for the first device and the second device, the roles including a group owner and at least one group user.
The first device and the second device may be in a role of a group owner or a group user.
When the first device is in the role of a group user, the number of the second devices is 1.
After the group owner GO equipment is determined, the group owner GO equipment is used as a DHCP Server, the group user GC equipment is used as a DHCP Client, an IP address is distributed to the group user GC equipment through the group owner GO equipment through a DHCP protocol, and the function of a DHCP service process is realized by using DNSmasq in an Android system. The specific steps of the DNSmasq work are as follows:
as shown in fig. 3, an embodiment of the present invention provides a flowchart of a method for allocating an IP address to a group user through a DHCP service process, where the method includes:
step S301, receiving DHCP discovery data broadcasted by at least one group user in a local area network;
the group user GC device initiates a DHCP discover packet, i.e. the above DHCP DISCOVERY data, in the local area network, in order to discover a DHCP Server capable of providing an IP.
And the group owner GO equipment receives the DHCP discover packet initiated by the at least one group user GC equipment.
Step S302, sending DHCP suggestion data to the at least one group user, wherein the suggestion data comprises IP addresses suggested to be adopted;
after receiving the DHCP discover packet, the available DHCP Server sends a DHCP OFFER packet, that is, the DHCP advice data, and gives a response to the DHCP Client, thereby notifying the DHCP Client that an IP address can be provided.
The format of the IP address carried in the DHCP offer data may be "IP address: 192.168.3.1".
Step S303, receiving DHCP request data for confirming to adopt the IP address sent by the at least one group user, wherein the DHCP request data comprises a Media Access Control (MAC) address of a corresponding group user;
after receiving the DHCP OFFER packet, the DHCP Client sends a DHCP REQUEST packet, i.e., the DHCP REQUEST data, requesting allocation of an IP address.
And the DHCP Server receives a DHCP REQUEST packet sent by the at least one DHCP Client, wherein the DHCP REQUEST packet comprises the MAC address of the DHCP Client.
The format of the MAC address carried in the DHCP request data may be "MAC address: 8e aa 37:09:19:8d ".
Step S304, sending DHCP response data to the at least one group user, indicating that the IP address allocation of the corresponding group user is completed.
The DHCP Server sends DHCP ACK data packet, namely DHCP response data and confirmation information.
Step S202, acquiring the allocated IP address through the DHCP service process, and storing the IP address to a local file;
an existing DHCP service process does not have a function of storing an IP address to a local file, and therefore, before the DHCP service process acquires an allocated IP address and stores the IP address to a local file, the DNSmasq is modified to have a function of storing an IP address to a local file, where the modification method includes:
acquiring an original DHCP service process for allocating an IP address;
and adding a service unit for storing an IP address to a local file in the original DHCP service process to obtain the DHCP service process.
It should be noted that the above operation of modifying the DHCP service process may be performed by the node at any time before the IP address is stored in the local file.
After the DHCP ACK packet is sent, acquiring an allocated IP address through the DHCP service process, and storing the IP address to a local file, including:
acquiring an IP address distributed to the at least one group user and an MAC address of the corresponding group user according to the DHCP request data;
and associating the IP address with the corresponding MAC address and storing the IP address and the corresponding MAC address to a local file.
It should be noted that, the local file stores an IP address of at least one group user, the IP address is associated with a MAC address of a corresponding group user, the associated MAC address is used for distinguishing, and the associated MAC address is used as an identifier of the query.
The format of the IP address and the associated MAC address may be "MAC address 1: 8e aa:37:09:19:8 d; IP address 1:192.168.3.1 ".
It should be noted that the local file includes at least one of the following:
a system attribute of the group owner;
storing a file at an IP address created in the file list of the group owner.
As an alternative embodiment, the system attribute is dhcp.
Step S203, determining a group user to be connected, and reading an IP address of the group user in the local file.
Determining the MAC address of the group user to be connected according to the DHCP request data;
and reading an IP address corresponding to the MAC address in the local file according to the MAC address, and taking the IP address as the IP address of the group user.
When the group owner GO device needs to actively connect to the group user GC device, the IP allocated by the group owner GO device for the group user GC device may be read from a local file, for example, a system attribute dhcp.
And after the group owner GO device acquires the IP address of the group user GC device, establishing RTSP connection with the group user GC device through the IP address.
Taking a one-to-one connection between a group owner GO device and a group user GC device as an example, as shown in fig. 4, an embodiment of the present invention provides an interactive flowchart of a method for acquiring an IP address of a group user, including:
step S401, the device A searches for a device supporting Wi-Fi P2P within a certain range through Wi-Fi P2P;
the step S401 is a Device Discovery phase.
Step S402, after the device A finds the device B, the device A sends prompt information to a user so that the user can select whether to pair with the device B according to requirements, if yes, the step S403 is executed, and if not, the step S401 is executed;
the step S402 selects the phase Device Selection for the Device.
Step S403, establishing connection between the equipment A and the equipment B according to the Wi-Fi Direct technical specification;
step S404, the device a and the device B perform role negotiation to determine roles of a group owner GO device and a group user GC device.
In this embodiment, the device a is determined to be a group user GC device, and the device B is determined to be a group owner GO device.
Step S405, the group owner GO device distributes an IP address for the group user GC device through a DHCP service process, and writes the IP address into the attribute of the android system after sending a DHCP ACK data packet;
as shown in fig. 5, an interactive schematic diagram of group owner GO device assignment and IP address storage is provided in an embodiment of the present invention.
1. The GC equipment of the group user initiates a DHCP discover packet in the local area network;
and the group owner GO equipment receives the DHCP discover packet initiated by the group user GC equipment.
2. The group owner GO equipment sends a DHCP OFFER packet to inform the group user GC equipment that an IP address can be provided;
3. after receiving the DHCP OFFER packet, the group user GC equipment sends a DHCP REQUEST packet to REQUEST for IP allocation;
4. and the group owner GO equipment sends a DHCP ACK data packet and confirms information.
And after the DHCP ACK data packet is sent, writing the IP address into the attribute of the android system.
Step S406, reading the android system attribute by the group owner GO device, acquiring the IP address of the GC device of the opposite end group user, and establishing RTSP connection.
The above steps S403 to S406 are Connection Setup phases.
Step S407, after the RTSP connection is established, the group owner GO device and the group user GC device perform capability negotiation.
The step S407 is a Capability Negotiation stage.
The above step S407 and the subsequent communication process between the group owner GO device and the group user GC device are not the key contents of the present invention, and the existing scheme may be applied to this step, and will not be described herein again.
Example 2
An embodiment of the present invention provides a schematic diagram of an apparatus 600 for acquiring an IP address of a group user, including a memory 601 and a processor 602, as shown in fig. 6, where:
the memory is used for storing a computer program;
the processor is used for reading the program in the memory and executing the following steps:
allocating an Internet Protocol (IP) address to at least one group user through a Dynamic Host Configuration Protocol (DHCP) service process;
acquiring the allocated IP address through the DHCP service process, and storing the IP address to a local file;
and determining a group user to be connected, and reading the IP address of the group user in the local file.
Optionally, the processor acquires the allocated IP address through the DHCP service process, and before storing the IP address in a local file, the processor is further configured to:
acquiring an original DHCP service process for allocating an IP address;
and adding a service unit for storing an IP address to a local file in the original DHCP service process to obtain the DHCP service process.
Optionally, the processor allocates an IP address to at least one group user through a DHCP service process, including:
receiving DHCP discovery data broadcasted by at least one group user in a local area network;
sending DHCP suggestion data to the at least one group user, wherein the suggestion data comprises an IP address suggested to be adopted;
receiving DHCP request data which is sent by the at least one group user and confirms to adopt the IP address, wherein the DHCP request data comprises a Media Access Control (MAC) address of the corresponding group user;
and sending DHCP response data to the at least one group user to indicate that the IP address allocation of the corresponding group user is completed.
Optionally, the acquiring, by the processor, the allocated IP address through the DHCP service process, and storing the IP address in a local file includes:
acquiring an IP address distributed to the at least one group user and an MAC address of the corresponding group user according to the DHCP request data;
and associating the IP address with the corresponding MAC address and storing the IP address and the corresponding MAC address to a local file.
Optionally, the determining, by the processor, a group user to be connected, and reading an IP address of the group user in the local file includes:
determining the MAC address of the group user to be connected according to the DHCP request data;
and reading an IP address corresponding to the MAC address in the local file according to the MAC address, and taking the IP address as the IP address of the group user.
Optionally, the local file comprises at least one of:
a system attribute of the group owner;
storing a file at an IP address created in the file list of the group owner.
Optionally, the processor is further configured to, before the IP address allocated to the at least one group user by using a DHCP service process:
searching equipment supporting point-to-point wireless internet Wi-Fi P2P, and selecting at least one group user establishing connection from the searched equipment; or receiving a request for establishing connection sent by at least one group user;
establishing a connection with the at least one group user via Wi-Fi P2P protocol.
An embodiment of the present invention provides a schematic diagram of a device for acquiring an IP address of a group user, as shown in fig. 7, including:
an address allocation unit 701, configured to allocate an internet protocol IP address to at least one group user through a dynamic host configuration protocol DHCP service process;
an address storage unit 702, configured to obtain an allocated IP address through the DHCP service process, and store the IP address in a local file;
an address reading unit 703 is configured to determine a group user to be connected, and read an IP address of the group user in the local file.
Optionally, the address storage unit obtains the allocated IP address through the DHCP service process, and stores the IP address in a local file, and further configured to:
acquiring an original DHCP service process for allocating an IP address;
and adding a service unit for storing an IP address to a local file in the original DHCP service process to obtain the DHCP service process.
Optionally, the allocating, by the address allocating unit, an IP address to at least one group user through a DHCP service process includes:
receiving DHCP discovery data broadcasted by at least one group user in a local area network;
sending DHCP suggestion data to the at least one group user, wherein the suggestion data comprises an IP address suggested to be adopted;
receiving DHCP request data which is sent by the at least one group user and confirms to adopt the IP address, wherein the DHCP request data comprises a Media Access Control (MAC) address of the corresponding group user;
and sending DHCP response data to the at least one group user to indicate that the IP address allocation of the corresponding group user is completed.
Optionally, the acquiring, by the address storage unit, the allocated IP address through the DHCP service process, and storing the IP address in a local file includes:
acquiring an IP address distributed to the at least one group user and an MAC address of the corresponding group user according to the DHCP request data;
and associating the IP address with the corresponding MAC address and storing the IP address and the corresponding MAC address to a local file.
Optionally, the determining, by the address reading unit, a group user to be connected, and reading an IP address of the group user in the local file includes:
determining the MAC address of the group user to be connected according to the DHCP request data;
and reading an IP address corresponding to the MAC address in the local file according to the MAC address, and taking the IP address as the IP address of the group user.
Optionally, the local file comprises at least one of:
a system attribute of the group owner;
storing a file at an IP address created in the file list of the group owner.
Optionally, the address allocating unit, before the IP address allocated to the at least one group user by using a DHCP service process, is further configured to:
searching equipment supporting point-to-point wireless internet Wi-Fi P2P, and selecting at least one group user establishing connection from the searched equipment; or receiving a request for establishing connection sent by at least one group user;
establishing a connection with the at least one group user via Wi-Fi P2P protocol.
The present invention also provides a computer program medium having stored thereon a computer program that, when executed by a processor, implements the steps of a method of acquiring an IP address of a group user as provided in embodiment 1 above, applied to a group owner GO device.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical division, and in actual implementation, there may be other divisions, for example, multiple modules or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may be stored in a computer readable storage medium.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product.
The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can store or a data storage device, such as a server, a data center, etc., that is integrated with one or more available media. The usable medium may 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)), among others.
The technical solutions provided by the present application are introduced in detail, and the present application applies specific examples to explain the principles and embodiments of the present application, and the descriptions of the above examples are only used to help understand the method and the core ideas of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. A method for obtaining an IP address of a group user is applied to a group owner GO device, and is characterized by comprising the following steps:
allocating an Internet Protocol (IP) address to at least one group user through a Dynamic Host Configuration Protocol (DHCP) service process;
acquiring the allocated IP address through the DHCP service process, and storing the IP address to a local file;
and determining a group user to be connected, and reading the IP address of the group user in the local file.
2. The method of claim 1, wherein before obtaining the allocated IP address through the DHCP service process and storing the IP address in a local file, the method further comprises:
acquiring an original DHCP service process for allocating an IP address;
and adding a service unit for storing an IP address to a local file in the original DHCP service process to obtain the DHCP service process.
3. The method of claim 1, wherein assigning an IP address to at least one group subscriber via a DHCP service process comprises:
receiving DHCP discovery data broadcasted by at least one group user in a local area network;
sending DHCP suggestion data to the at least one group user, wherein the suggestion data comprises an IP address suggested to be adopted;
receiving DHCP request data which is sent by the at least one group user and confirms to adopt the IP address, wherein the DHCP request data comprises a Media Access Control (MAC) address of the corresponding group user;
and sending DHCP response data to the at least one group user to indicate that the IP address allocation of the corresponding group user is completed.
4. The method of claim 3, wherein obtaining the allocated IP address through the DHCP service process and storing the IP address in a local file comprises:
acquiring an IP address distributed to the at least one group user and an MAC address of the corresponding group user according to the DHCP request data;
and associating the IP address with the corresponding MAC address and storing the IP address and the corresponding MAC address to a local file.
5. The method of claim 3, wherein determining a group user to be connected, and reading an IP address of the group user in the local file comprises:
determining the MAC address of the group user to be connected according to the DHCP request data;
and reading an IP address corresponding to the MAC address in the local file according to the MAC address, and taking the IP address as the IP address of the group user.
6. The method of claim 1, wherein the local file comprises at least one of:
a system attribute of the group owner;
storing a file at an IP address created in the file list of the group owner.
7. The method of claim 1, wherein the step of assigning the IP address to the at least one group user via a DHCP service process further comprises:
searching equipment supporting point-to-point wireless internet Wi-Fi P2P, and selecting at least one group user establishing connection from the searched equipment; or receiving a request for establishing connection sent by at least one group user;
establishing a connection with the at least one group user via Wi-Fi P2P protocol.
8. An apparatus for obtaining an IP address of a group user, comprising a memory and a processor, wherein:
the memory is used for storing a computer program;
the processor is used for reading the program in the memory and executing the method for acquiring the IP address of the group user as claimed in any one of claims 1 to 7.
9. An apparatus for obtaining an IP address of a group user, comprising:
the address allocation unit is used for allocating an Internet Protocol (IP) address for at least one group user through a Dynamic Host Configuration Protocol (DHCP) service process;
the address storage unit is used for acquiring the allocated IP address through the DHCP service process and storing the IP address to a local file;
and the address reading unit is used for determining a group user to be connected and reading the IP address of the group user in the local file.
10. A computer program medium having stored thereon a computer program which, when being executed by a processor, carries out the steps of a method of acquiring IP addresses of group users according to any one of claims 1 to 7.
CN202011600971.1A 2020-12-30 2020-12-30 Method, device and equipment for acquiring IP address of group user Pending CN112689029A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011600971.1A CN112689029A (en) 2020-12-30 2020-12-30 Method, device and equipment for acquiring IP address of group user

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011600971.1A CN112689029A (en) 2020-12-30 2020-12-30 Method, device and equipment for acquiring IP address of group user

Publications (1)

Publication Number Publication Date
CN112689029A true CN112689029A (en) 2021-04-20

Family

ID=75454379

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011600971.1A Pending CN112689029A (en) 2020-12-30 2020-12-30 Method, device and equipment for acquiring IP address of group user

Country Status (1)

Country Link
CN (1) CN112689029A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113114798A (en) * 2021-04-22 2021-07-13 荣耀终端有限公司 Method for acquiring Internet protocol IP address and electronic equipment
CN115499489A (en) * 2022-11-16 2022-12-20 苏州浪潮智能科技有限公司 Method, device, equipment and readable medium for managing sub-network in link

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101600001A (en) * 2009-06-29 2009-12-09 中兴通讯股份有限公司 Acquisition methods and device based on the configuration information of dynamic host allocation protocol
CN101986643A (en) * 2010-10-25 2011-03-16 中兴通讯股份有限公司 Mobile television program home network sharing method and system
CN102833363A (en) * 2012-08-20 2012-12-19 大唐移动通信设备有限公司 IP (Internet Protocol) address allocation method, device and system
CN105245629A (en) * 2015-09-25 2016-01-13 互联网域名系统北京市工程研究中心有限公司 DHCP-based host communication method and device
CN109714717A (en) * 2012-02-24 2019-05-03 三星电子株式会社 Method and apparatus for distributing IP address within a wireless communication network
CN110035133A (en) * 2018-01-12 2019-07-19 珠海全志科技股份有限公司 The method and apparatus of peer device IP address is obtained in Android WiFi-Direct connection

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101600001A (en) * 2009-06-29 2009-12-09 中兴通讯股份有限公司 Acquisition methods and device based on the configuration information of dynamic host allocation protocol
CN101986643A (en) * 2010-10-25 2011-03-16 中兴通讯股份有限公司 Mobile television program home network sharing method and system
CN109714717A (en) * 2012-02-24 2019-05-03 三星电子株式会社 Method and apparatus for distributing IP address within a wireless communication network
CN102833363A (en) * 2012-08-20 2012-12-19 大唐移动通信设备有限公司 IP (Internet Protocol) address allocation method, device and system
CN105245629A (en) * 2015-09-25 2016-01-13 互联网域名系统北京市工程研究中心有限公司 DHCP-based host communication method and device
CN110035133A (en) * 2018-01-12 2019-07-19 珠海全志科技股份有限公司 The method and apparatus of peer device IP address is obtained in Android WiFi-Direct connection

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113114798A (en) * 2021-04-22 2021-07-13 荣耀终端有限公司 Method for acquiring Internet protocol IP address and electronic equipment
CN115499489A (en) * 2022-11-16 2022-12-20 苏州浪潮智能科技有限公司 Method, device, equipment and readable medium for managing sub-network in link
CN115499489B (en) * 2022-11-16 2023-02-28 苏州浪潮智能科技有限公司 Method, device, equipment and readable medium for managing sub-network in link

Similar Documents

Publication Publication Date Title
US8125993B2 (en) Network element having a DHCP lease timer
CN105959906B (en) Network equipment communication method and device and network equipment communication method and device
CN102404418B (en) Method, device and system for distributing IP (internet protocol) address for user terminal
CN111865621B (en) Method and device for accessing gateway
CN107113892B (en) Method and device for automatically networking gateway equipment
CN102790813B (en) Communication method as well as system and terminal equipment based on IPv6 (internet protocol version 6) network
JP2003229856A (en) Communication equipment and communication control method
WO2017020790A1 (en) Multi-screen control method and device
CN112689029A (en) Method, device and equipment for acquiring IP address of group user
CN111031149B (en) Server management method, system, equipment and computer readable storage medium
US20240098806A1 (en) Service data flow continuity for a ue in a system involving a gateway device
WO2013143433A1 (en) Wireless data sharing method and sharing realization terminal
US20130042018A1 (en) Apparatus and method for providing streaming service
WO2023221708A1 (en) Pdn dialing method, system and apparatus, multi-pdn dialing configuration method, system and apparatus, and device and storage medium
WO2020048177A1 (en) Set top box management method and apparatus, and device and storage medium
JP5522494B2 (en) Method, remote access server and system for quality of service configuration
CN108934022B (en) Registration method and device
KR102560548B1 (en) Access point, home gateway and home network system, and method for performing ip communication on the home network system
KR101506852B1 (en) Method for Selecting Network Mode, Mobile Router Therefor
CN105591941B (en) A kind of wireless roaming method and device
JP5777464B2 (en) COMMUNICATION DEVICE, COMMUNICATION SYSTEM, COMMUNICATION METHOD, AND PROGRAM
KR102023115B1 (en) Communication method based on integrated flat id and system
CN107770070B (en) Information transmission method, equipment and system
WO2015157945A1 (en) Information transmission method, device, and system
CN112714202B (en) Equipment configuration method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20210420

RJ01 Rejection of invention patent application after publication