CN113114798B - Method for acquiring Internet protocol IP address and electronic equipment - Google Patents

Method for acquiring Internet protocol IP address and electronic equipment Download PDF

Info

Publication number
CN113114798B
CN113114798B CN202110437395.1A CN202110437395A CN113114798B CN 113114798 B CN113114798 B CN 113114798B CN 202110437395 A CN202110437395 A CN 202110437395A CN 113114798 B CN113114798 B CN 113114798B
Authority
CN
China
Prior art keywords
address
electronic device
preset
port
electronic equipment
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.)
Active
Application number
CN202110437395.1A
Other languages
Chinese (zh)
Other versions
CN113114798A (en
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.)
Honor Device Co Ltd
Original Assignee
Honor Device 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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202110437395.1A priority Critical patent/CN113114798B/en
Publication of CN113114798A publication Critical patent/CN113114798A/en
Application granted granted Critical
Publication of CN113114798B publication Critical patent/CN113114798B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]

Abstract

The embodiment of the application provides an Internet Protocol (IP) address obtaining method and electronic equipment, relates to the technical field of electronic equipment, and can simplify the interaction process between the electronic equipment and a wireless Access Point (AP) and improve the speed of obtaining the IP address by the electronic equipment. The specific scheme comprises the following steps: after the electronic device establishes a connection with the AP, the AP may broadcast a preset Beacon frame, where the preset Beacon frame includes indication information, and the indication information is used to indicate that the AP has a capability of actively sending an IP address allocated by the AP to the electronic device. The AP may then transmit a first IP address, which is an IP address assigned by the AP to the electronic device. The electronic device may start monitoring at a preset port when receiving a preset Beacon frame from the AP, where the preset port is used to receive the first IP address, and the preset port may be configured in the electronic device in advance, or the preset port may be indicated to the electronic device by the AP. Thereafter, the electronic device may receive the first IP address from the AP from the preset port.

Description

Method for acquiring Internet protocol IP address and electronic equipment
Technical Field
The embodiment of the application relates to the technical field of communication, in particular to a method and equipment for acquiring an IP address.
Background
With the development of technology, more and more electronic devices (such as mobile phones, notebook computers, etc.) perform Wireless communication through Wireless Fidelity (WIFI) technology. In the process of wireless communication of the electronic device through the WIFI technology, the electronic device needs to acquire an IP Address, and performs network connection through the Internet Protocol Address (IP) Address.
Currently, when acquiring an IP address, an electronic device needs to broadcast a request message to request to acquire the IP address. Thereafter, at least one Wireless Access Point (AP) may provide an IP address to the electronic device. The electronic device may then select an IP address from the plurality of IP addresses and broadcast a message packet to characterize that the electronic device has accepted an IP address. The AP may then send a response message to the electronic device.
However, according to the above technical solution, the electronic device needs to complete multiple interactions with the AP to acquire the IP address. Not only the process is more complicated, but also the speed of obtaining the IP address is slower.
Disclosure of Invention
The application provides an IP address acquisition method and electronic equipment, which can simplify the interaction process between the electronic equipment and an AP and improve the speed of acquiring the IP address by the electronic equipment.
In a first aspect, the present application provides a method for acquiring an IP address.
In the method, the electronic device establishes a connection with the AP. After the electronic device is connected with the AP, the AP can allocate an IP address to the electronic device. And then, the AP may broadcast a preset Beacon frame, where the preset Beacon frame includes indication information, and the indication information is used to indicate that the AP has a capability of actively sending an IP address allocated by the AP to the electronic device. The AP may then transmit a first IP address, which is an IP address assigned by the AP to the electronic device. The electronic device may start monitoring at a preset port when receiving a preset Beacon frame from the AP, where the preset port is used to receive the first IP address, and the preset port may be configured in the electronic device in advance, or the preset port may be indicated to the electronic device by the AP. Thereafter, the electronic device may receive the first IP address from the AP from the preset port.
Based on the technical scheme, after the AP can broadcast the preset Beacon frame carrying the indication information to indicate that the AP can actively send the first IP address, the electronic equipment can receive the first IP address from the AP. Compared with the conventional technology, the electronic equipment acquires the IP address through the four stages of the DHCP, and the process of acquiring the IP address by the electronic equipment is simplified in the embodiment of the application. Therefore, the speed of acquiring the IP address by the electronic equipment can be increased, the time consumed by connecting the electronic equipment with the WiFi is reduced, and the use experience of a user is improved.
With reference to the first aspect, in another possible design manner, the AP may periodically send an Action frame to the electronic device, where the Action frame includes the first IP address. Thereafter, the electronic device may receive an Action frame from the AP from the preset port.
It can be understood that the AP periodically sends the Action frame, which can improve the success rate of sending the first IP address by the AP. Therefore, the time for the electronic equipment to acquire the first IP address can be shortened, and the speed for the electronic equipment to acquire the first IP address is improved.
With reference to the first aspect, in one possible design, the AP may periodically broadcast a first message, where the first message includes the first IP address. Thereafter, the electronic device may receive a first message from the AP from the pre-set port, the first message including the first IP address.
With reference to the first aspect, in another possible design manner, the AP includes a plurality of queues, each of the plurality of queues has a different priority, the priority is used to indicate an order in which the AP processes different queues of the plurality of queues, and the AP processing queue sends data in the queue to the AP. That is, the AP may preferentially transmit data in a queue with a higher priority than data in a queue with a lower priority.
The AP may add the first IP address to a highest priority queue of the plurality of queues.
It can be understood that the AP adds the first IP address to the high-priority queue, which can improve the ability of the first IP address to preempt the air interface, reduce the time for the AP to wait for sending the first IP address, and further improve the speed for the electronic device to obtain the first IP address.
With reference to the first aspect, in another possible design manner, the preset port indicates to the electronic device by the AP that: the preset Beacon frame further comprises a port number, and the port number is used for identifying the preset port.
With reference to the first aspect, in another possible design manner, after the electronic device receives the first IP address from the AP through the preset port, the electronic device may send a first response message to the AP, where the first response message is used to indicate that the electronic device has received the first IP address. The AP may receive a first response message from the electronic device.
In this way, after receiving the first response message, the AP may determine that the electronic device has received the first IP address.
With reference to the first aspect, in another possible design manner, after the electronic device receives the first IP address from the AP from the default port, the electronic device may stop listening to the default port.
It is understood that the electronic device may stop the preset port from continuing to listen after having received the first IP address. In this way, the power consumption of the electronic device can be reduced.
With reference to the first aspect, in another possible design manner, the indication information includes a first value or a second value, where the first value is used to indicate that the AP has the capability of actively sending the IP address allocated by the AP to the electronic device, and the second value is used to indicate that the AP does not have the capability of actively sending the IP address allocated by the AP to the electronic device. After the AP broadcasts the preset Beacon frame, the electronic equipment determines whether the AP has the capability of actively sending the IP address allocated by the AP to the electronic equipment or not according to the indication information. If the indication information includes the first value, the AP broadcasts the first message periodically.
With reference to the first aspect, in another possible design manner, if the indication information includes the second value, the electronic device sends a DHCP DISCOVER message to the AP.
That is, if the indication information includes the second value, it indicates that the AP does not have the capability of actively transmitting the IP address allocated by the AP to the electronic device. Therefore, the electronic device may send a DHCP DISCOVER message to the AP, and obtain an IP address allocated by the AP based on a Dynamic Host Configuration Protocol (DHCP).
In a second aspect, the present application provides a method for acquiring an IP address. In the method, the electronic device receives a preset Beacon frame from the wireless access point AP, and may start monitoring through a preset port, where the preset port is used to receive the first IP address, and the preset port may be configured in the electronic device in advance, or the preset port may be indicated to the electronic device by the AP. The preset Beacon frame comprises indication information, and the indication information is used for indicating that the AP has the capability of actively sending the IP address allocated by the AP to the electronic equipment. Thereafter, the electronic device may receive the first IP address from the AP from the preset port. The electronic device may then send a first response message to the AP indicating that the electronic device has received the first IP address.
Based on the above scheme, after the AP can broadcast the preset Beacon frame carrying the indication information to indicate that the AP can actively send the first IP address, the electronic device may receive the first IP address from the AP. Compared with the conventional technology, the electronic equipment acquires the IP address through the four stages of the DHCP, and the process of acquiring the IP address by the electronic equipment is simplified in the embodiment of the application. Therefore, the speed of acquiring the IP address by the electronic equipment can be increased, the time consumed by connecting the electronic equipment with the WiFi is reduced, and the use experience of a user is improved.
With reference to the second aspect, in a possible design manner, the electronic device may receive an Action frame from the AP from the preset port, where the Action frame includes the first IP address. Alternatively, the electronic device may receive a first message from the AP from the preset port, the first message including the first IP address.
With reference to the second aspect, in another possible design manner, the preset port is indicated to the electronic device by the AP as: the preset Beacon frame further comprises a port number, and the port number is used for identifying the preset port.
With reference to the second aspect, in another possible design manner, after the electronic device receives the first IP address from the AP from the preset port, the electronic device may stop listening to the preset port.
It is understood that the electronic device may stop the preset port from continuing to listen after having received the first IP address. In this way, the power consumption of the electronic device can be reduced.
In a third aspect, the present application provides a method for acquiring an IP address. In the method, the wireless access point AP can broadcast a preset Beacon frame, the preset Beacon frame comprises indication information, and the indication information is used for indicating that the AP has the capability of actively sending the IP address allocated by the AP to the electronic equipment. Thereafter, the AP may transmit a first IP address, which is an IP address assigned by the AP to the electronic device. The AP may then receive a first response message from the electronic device indicating that the electronic device has received the first IP address.
Based on the scheme, the AP can broadcast the preset Beacon frame carrying the indication information to indicate that the AP can actively send the first IP address. And, the AP may send the first IP address without any action instruction triggering the AP to send the first IP address. Compared with the conventional technology, the electronic equipment acquires the IP address through the four stages of the DHCP, and the process of acquiring the IP address by the electronic equipment is simplified in the embodiment of the application. Therefore, the speed of acquiring the IP address by the electronic equipment can be increased, the time consumed by connecting the electronic equipment with the WiFi is reduced, and the use experience of a user is improved.
With reference to the third aspect, in a possible design manner, the AP may periodically send an Action frame to the electronic device, where the Action frame includes the first IP address. Alternatively, the AP may periodically broadcast a first message including the first IP address.
With reference to the third aspect, in another possible design, the AP may include a plurality of queues, where a priority of each of the plurality of queues is different, the priority is used to indicate an order in which the AP processes different queues of the plurality of queues, and the AP processes the queue to send data in the queue to the AP. The AP may add the first IP address to a highest priority queue of the plurality of queues.
It can be understood that the AP adds the first IP address to the high-priority queue, which can improve the ability of the first IP address to preempt the air interface, reduce the time for the AP to wait for sending the first IP address, and further improve the speed for the electronic device to obtain the first IP address.
With reference to the third aspect, in another possible design manner, the preset port indicates to the electronic device by the AP that: the preset Beacon frame further comprises a port number, and the port number is used for identifying the preset port.
In a fourth aspect, the present application provides an electronic device comprising: a memory and a processor, the memory coupled to the processor; the memory is also for storing computer program code, the computer program code comprising computer instructions; the computer instructions, when executed by the processor, cause the electronic device to perform the method as set forth in the second aspect and any one of its possible designs.
In a fifth aspect, the present application provides an AP, comprising: a memory and a processor, the memory coupled to the processor; the memory is also for storing computer program code, the computer program code comprising computer instructions; the computer instructions, when executed by the processor, cause the AP to perform the method of the third aspect and any one of its possible designs.
In a sixth aspect, the present application provides a communication system comprising the electronic device of the fourth aspect and the AP of the fifth aspect, where the communication system is capable of performing the method according to the first aspect and any possible design thereof.
In a seventh aspect, the present application provides a chip system, which is applied to an electronic device. The system-on-chip includes one or more interface circuits and one or more processors. The interface circuit and the processor are interconnected by a line. The interface circuit is configured to receive a signal from a memory of the electronic device and to transmit the signal to the processor, the signal including computer instructions stored in the memory. When executed by a processor, the computer instructions cause an electronic device to perform the method of the second aspect and any of its possible designs.
In an eighth aspect, the present application provides a chip system, which is applied to an AP. The system-on-chip includes one or more interface circuits and one or more processors. The interface circuit and the processor are interconnected by a line. The interface circuit is configured to receive a signal from a memory of the electronic device and to transmit the signal to the processor, the signal including computer instructions stored in the memory. When executed by a processor, the computer instructions cause the AP to perform the method according to the third aspect and any of its possible designs.
In a ninth aspect, the present application provides a computer storage medium comprising computer instructions which, when run on an electronic device, cause the electronic device to perform the method according to the second aspect and any of its possible design approaches.
In a tenth aspect, the present application provides a computer storage medium comprising computer instructions which, when run on an AP, cause the AP to perform the method according to the third aspect and any one of its possible design approaches.
In an eleventh aspect, the present application provides a computer program product for causing a computer to perform the method according to the first, second or third aspect and any possible design thereof when the computer program product runs on the computer.
It should be understood that, for the electronic device according to the fourth aspect, the AP according to the fifth aspect, the communication system according to the sixth aspect, the chip systems according to the seventh aspect and the eighth aspect, and the computer storage medium according to the ninth aspect and the tenth aspect, the advantageous effects that can be achieved by the computer program product according to the eleventh aspect may refer to the advantageous effects in the first aspect and any one of the possible design manners thereof, and are not repeated herein.
Drawings
Fig. 1A is a flowchart illustrating an interaction between an electronic device and an AP according to an embodiment of the present disclosure;
fig. 1B is a flowchart of a method for acquiring an IP address according to an embodiment of the present disclosure;
fig. 2A is a schematic diagram illustrating a communication system according to an embodiment of the present application;
fig. 2B is a schematic diagram of another communication system according to an embodiment of the present application;
fig. 2C is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present disclosure;
fig. 3 is a flowchart of another method for acquiring an IP address according to an embodiment of the present disclosure;
fig. 4 is a schematic diagram illustrating an example of a frame structure according to an embodiment of the present application;
fig. 5A is a schematic diagram of an example of another frame structure provided in the embodiment of the present application;
fig. 5B is a schematic diagram of an example of another frame structure provided in the embodiment of the present application;
fig. 6 is a schematic diagram of an example of another frame structure provided in the embodiment of the present application;
fig. 7 is a flowchart of another method for acquiring an IP address according to an embodiment of the present disclosure;
fig. 8A is a schematic diagram illustrating an apparatus for acquiring an IP address according to an embodiment of the present disclosure;
fig. 8B is a schematic diagram illustrating another IP address obtaining apparatus according to an embodiment of the present disclosure;
fig. 9 is a schematic structural component diagram of a chip system according to an embodiment of the present disclosure.
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.
The "/" character in this application generally indicates that the former and latter associated objects are in an "or" relationship. For example, A/B may be understood as A or B.
The terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present embodiment, "a plurality" means two or more unless otherwise specified.
Furthermore, the terms "including" and "having," and any variations thereof, as referred to in the description of the present application, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or modules is not limited to the listed steps or modules but may alternatively include other steps or modules not listed or inherent to such process, method, article, or apparatus.
In addition, in the embodiments of the present application, words such as "exemplary" or "for example" are used to mean serving as examples, illustrations or explanations. Any embodiment or design described herein as "exemplary" or "e.g.," is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "e.g.," is intended to present concepts in a concrete fashion.
With the development of technology, more and more electronic devices (such as mobile phones, notebook computers, etc.) perform Wireless communication through Wireless Fidelity (WIFI) technology. In the process of connecting the electronic device to the WiFi, the electronic device needs to acquire an IP address and perform network connection through the IP address.
In the conventional art, before the electronic device acquires the IP address, the electronic device needs to establish a connection with the AP. For example, as shown in fig. 1A, the electronic device may perform a Scanning (Scan) process, i.e., searching for a WiFi hotspot that is closer to the electronic device. And, the AP may broadcast a Beacon frame, which includes: an Extended Service Set Identifier (ESSID) of the AP, BSSID (i.e., MAC address) of the AP, encryption scheme (e.g., no password, Wired Equivalent Privacy protocol (WEP) WEP encryption, Wi-Fi network secured Access (WPA), or WPA2 encryption), transmission rate, and so on. Thereafter, the AP and the electronic device may perform an Authentication (Auth) procedure (e.g., a procedure in which a user inputs a password and the AP performs Authentication). Then, the AP and the electronic device may perform an Association (Association) process. For example, the Assoc process may be: the electronic device may send an association request frame to the AP; thereafter, the AP may add the parameter information of the electronic device to the database and send an association response to the electronic device. The AP and the electronic device may then perform a four-way handshake procedure to establish a connection.
Then, the electronic device may obtain the IP address through four stages of a Dynamic Host Configuration Protocol (DHCP). Wherein, the four phases of the DHCP include: a discovery phase, a provisioning phase, a selection phase, and a validation phase. For example, as shown in fig. 1B, an electronic device (e.g., a mobile phone) may broadcast a DHCP DISCOVER message to request to acquire an IP address. Wherein, the DHCP DISCOVER message includes: the IP address of the mobile phone, the IP address of the AP and the MAC address of the mobile phone are respectively 0.0.0.0.0 and 255.255.255. And then, at least one AP which receives the DHCP DISCOVER message and can provide the IP address sends a DHCP OFFER message to the mobile phone. The DHCP OFFER message includes information such as an IP address of the AP, an IP address of the mobile phone, a subnet mask, and an IP address provided for the mobile phone. Then, the mobile phone may receive at least one DHCP DISCOVER message, select an IP address from the plurality of DHCP OFFER messages (usually, select an IP address carried in the first received DHCP OFFER message), and broadcast a DHCP REQUEST message to indicate that the mobile phone has obtained the IP address, where the DHCP REQUEST message carries the IP address obtained by the mobile phone and the IP address of the AP providing the IP address. The AP providing the IP address may then send a DHCP ACK message to the handset to acknowledge the IP address.
It should be noted that, specifically, for the way of acquiring the IP address by the electronic device through the DHCP, an open source protocol (e.g., DHCP Server ver: 4.2.5) may be referred to, which is not described herein again.
However, in the conventional technology, the electronic device needs to go through the four phases (discovery phase, provision phase, selection phase and confirmation phase) to acquire the IP address. Not only the process is more complicated, but also the speed of acquiring the IP address is lower.
Therefore, the embodiment of the application provides an IP address acquisition method, which is applied to the process of acquiring the IP address by the electronic equipment. In the method, the electronic device may receive an IP address from the AP, where the IP address is an address allocated by the AP to the electronic device. Thereafter, the electronic device may send a response message to indicate that the electronic device has received the IP address. That is, only two interactions are required between the electronic device and the AP, and the electronic device can acquire the IP address. Therefore, the method provided by the application can simplify the interaction process between the electronic equipment and the AP, and improve the speed of acquiring the IP address by the electronic equipment.
Before specifically describing the embodiments of the present application, a communication system applied to the embodiments of the present application will be described.
In some embodiments, the communication system may include an electronic device and at least one AP. Illustratively, as shown in fig. 2A, the communication system includes an electronic device (e.g., a handset) 201 and an AP202, where the handset 201 and the AP202 can perform wireless communication, and a distance between the handset 201 and the AP202 is smaller than a preset distance threshold.
In other embodiments, the communication system comprises a plurality of electronic devices and at least one AP. Illustratively, as shown in fig. 2B, the communication system includes a plurality of electronic devices (e.g., a handset 201 and a handset 203) and an AP202, where the handset 201 and the handset 203 can both perform wireless communication with the AP202, and a distance between the handset 201 and the AP202 and a distance between the handset 203 and the AP202 are both smaller than a preset distance threshold.
For example, the electronic device (which may also be referred to as a Station (STA)) in the embodiment of the present application may be a tablet computer, a mobile phone, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a Personal Digital Assistant (PDA), an Augmented Reality (AR) device, a vehicle-mounted device, and the like, and the embodiment of the present application does not particularly limit the specific form of the electronic device.
The executing body of the method for acquiring the IP address provided by the present application may be an acquiring apparatus of the IP address, and the executing apparatus may be the electronic device shown in fig. 2C. Meanwhile, the execution device may also be a Central Processing Unit (CPU) of the electronic device, or a control module for acquiring an IP address in the electronic device. The embodiment of the present application takes a method for an electronic device to execute an IP address as an example, and describes the method for acquiring an IP address provided in the embodiment of the present application.
Referring to fig. 2C, the electronic device provided in the present application is described by taking the electronic device as the mobile phone 200 (which may also be the mobile phone 201 or the mobile phone 203) shown in fig. 2C as an example. Where the cell phone 200 shown in fig. 2C is merely one example of an electronic device, and the cell phone 200 may have more or fewer components than shown in the figures, may combine two or more components, or may have a different configuration of components. The various components shown in fig. 2C may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
As shown in fig. 2C, the handset 200 may include: the mobile communication device comprises a processor 210, an external memory interface 220, an internal memory 221, a Universal Serial Bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, a sensor module 280, keys 290, a motor 291, an indicator 292, a camera 293, a display 294F, and the like.
The sensor module 280 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.
Processor 210 may include one or more processing units, such as: the processor 210 may include an Application Processor (AP), a modem processor, a baseband processor, and/or a neural-Network Processing Unit (NPU), among others. The different processing units may be separate devices or may be integrated into one or more processors.
A memory may also be provided in processor 210 for storing instructions and data. In some embodiments, the memory in processor 210 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 210. If the processor 210 needs to use the instruction or data again, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 210, thereby increasing the efficiency of the system.
In some embodiments, processor 210 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, a Subscriber Identity Module (SIM) interface, and/or a Universal Serial Bus (USB) interface, among others.
It should be understood that the connection relationship between the modules illustrated in this embodiment is only an exemplary illustration, and does not constitute a limitation to the structure of the mobile phone 200. In other embodiments, the mobile phone 200 may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
The charge management module 240 is configured to receive a charging input from a charger. The charger may be a wireless charger or a wired charger. The charging management module 240 may also supply power to the electronic device through the power management module 241 while charging the battery 242.
The power management module 241 is used to connect the battery 242, the charging management module 240 and the processor 210. The power management module 241 receives input from the battery 242 and/or the charging management module 240, and provides power to the processor 210, the internal memory 221, the external memory, the display 294, the camera 293, and the wireless communication module 260. In some embodiments, the power management module 241 and the charging management module 240 may also be disposed in the same device.
The wireless communication function of the mobile phone 200 can be implemented by the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, the modem processor, the baseband processor, and the like. In some embodiments, antenna 1 of handset 200 is coupled to mobile communication module 250 and antenna 2 is coupled to wireless communication module 260, such that handset 200 may communicate with networks and other devices via wireless communication techniques. For example, in the embodiment of the present application, the handset 200 may receive a message from the AP through a wireless communication technology.
The wireless communication module 260 may provide a solution for wireless communication including Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) networks), Bluetooth (BT), and the like, applied to the mobile phone 200. For example, in the embodiment of the present application, the mobile phone 200 may access a WiFi network through the wireless communication module 260.
The wireless communication module 260 may be one or more devices integrating at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 210. The wireless communication module 260 may also receive a signal to be transmitted from the processor 210, frequency-modulate and amplify the signal, and convert the signal into electromagnetic waves via the antenna 2 to radiate the electromagnetic waves.
The mobile phone 200 implements the display function through the GPU, the display screen 294, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 294 and an application processor. The display screen 294 is used to display images, video, and the like. The display screen 294 includes a display panel.
The external memory interface 220 may be used to connect an external memory card, such as a Micro SD card, to extend the storage capability of the mobile phone 200. The external memory card communicates with the processor 210 through the external memory interface 220 to implement a data storage function. For example, files such as music, video, etc. are saved in an external memory card.
Internal memory 221 may be used to store computer-executable program code, including instructions. The processor 210 executes various functional applications and data processing of the cellular phone 200 by executing instructions stored in the internal memory 221. For example, in the present embodiment, the processor 210 may execute instructions stored in the internal memory 221, and the internal memory 221 may include a program storage area and a data storage area.
The mobile phone 200 can implement an audio function through the audio module 270, the speaker 270A, the receiver 270B, the microphone 270C, the earphone interface 270D, and the application processor. Such as music playing, recording, etc.
The keys 290 include a power-on key, a volume key, etc. The keys 290 may be mechanical keys. Or may be touch keys.
Although not shown in fig. 2C, the mobile phone 200 may also be a flash, a micro-projector, a Near Field Communication (NFC) device, etc., and will not be described herein.
The methods in the following embodiments may be implemented in the system architecture and the electronic device having the hardware structure.
In some embodiments, the AP may interact with at least one electronic device, and the AP may broadcast a Beacon frame (e.g., a preset Beacon frame) carrying indication information, where the indication information is used to indicate that the AP has a capability of actively sending an IP address allocated by the AP to the electronic device, and each electronic device in the at least one electronic device may recognize the indication information. After that, any of the electronic devices may acquire the indication information from the AP. The AP may then transmit the first IP address, which is the IP address that the AP assigns to the electronic device. The electronic device may then receive the first IP address from the AP and reply with a response message indicating that the electronic device has received the first IP address.
The AP has the capability of actively sending the IP address allocated by the AP to the electronic device, and means that: the AP may actively send the IP address allocated by the AP to the electronic device without receiving any indication message (e.g., DHCP DISCOVER message). Therefore, the process of acquiring the IP address by the electronic equipment can be simplified, and the speed of acquiring the IP address by the electronic equipment can be further improved.
For example, an application scenario shown in fig. 2A is taken as an example, that is, an electronic device is a mobile phone 201, and an AP is an AP202, to describe the method for acquiring an IP address provided in the embodiment of the present application. The AP202 may send a preset Beacon frame carrying the indication information, and the cell phone 201 may identify the indication information sent by the AP 202. As shown in fig. 3, the method for acquiring an IP address may include: S301-S307.
S301, AP202 broadcasts a preset Beacon frame.
The preset Beacon frame includes indication information, where the indication information is used to indicate that the AP202 has a capability of actively sending an IP address allocated by the AP202 to the cell phone 201. For example, if the field name of the indication information is "FAST IE", the value of the indication information is 1 (for example, as shown in fig. 4).
In this embodiment, the AP202 may periodically broadcast the preset Beacon frame. For example, the AP202 may broadcast the preset Beacon frame every preset duration a. For example, the preset time period a may be 0.01 second, 0.1 second, 1 second, or the like, and the preset time period a is not limited in the embodiment of the present application.
In this embodiment, before the AP202 broadcasts the preset Beacon frame, the handset 201 may establish a connection with the AP 202. After the handset 201 establishes a connection with the AP202, the AP202 can allocate an IP address to the handset 201.
It should be noted that, the process of establishing the connection between the handset 201 and the AP202 may refer to the description of fig. 1A, and is not described herein again.
S302, the handset 201 receives the preset Beacon frame from the AP 202.
In this embodiment, the mobile phone 201 may identify the indication information in the preset Beacon frame. That is, the handset 201 may parse the preset Beacon frame to determine whether the AP202 has the capability of actively sending the IP address allocated by the AP202 to the handset 201.
In some embodiments, if the indication information exists in the preset Beacon frame, the handset 201 may determine that the AP202 can actively send the first IP address, and the handset 201 may perform S303.
In other embodiments, after the handset 201 receives the preset Beacon frame from the AP202, the handset 201 determines whether the AP202 has the capability of actively sending the IP address allocated by the AP202 to the handset 201 according to the indication information. The indication information comprises a first numerical value or a second numerical value. The first and second values may be any two different values. For example, the first value may be 1 and the second value may be 0.
In one possible design, when the indication message includes the first value, the handset 201 may determine that the AP202 has the capability of actively sending the IP address allocated by the AP202 to the handset 201, and the handset 201 may perform S303. When the indication information includes the second value, the mobile phone 201 may determine that the AP202 does not have the capability of actively sending the IP address allocated by the AP202 to the mobile phone 201, and the mobile phone 201 may send a DHCP DISCOVER message to the AP 202. That is, the handset 201 can acquire the first IP address based on DHCP. Specifically, for the description that the mobile phone 201 obtains the first IP address through four stages (i.e., a discovery stage, a provision stage, a selection stage, and a confirmation stage) of DHCP in the conventional technology, reference may be made to the description of fig. 1B in the foregoing embodiment, which is not described herein again.
It should be noted that after the handset 201 receives the preset Beacon frame from the AP202, the handset 201 and the AP202 may perform an Auth procedure, an Assoc procedure, and a four-way handshake procedure. For specific description of the Auth procedure, the Assoc procedure, and the four-way handshake procedure, reference may be made to the description of fig. 1A in the foregoing embodiment, and the description of the Auth procedure, the Assoc procedure, and the four-way handshake procedure in the conventional technology, which are not described herein again.
Note that the AP202 can actively transmit the first IP address. In this embodiment, after the mobile phone 201 executes the Auth process, the Assoc process, and the four-way handshake process, the mobile phone 201 does not need to send a DHCP DISCOVER message.
S303, the mobile phone 201 starts a preset port to monitor.
Wherein the predetermined port is configured to receive the first IP address from the AP 202.
It should be noted that, in the embodiment of the present application, the preset port in the mobile phone 201 is not limited. That is, any one of the ports in the handset 201 may be a preset port to obtain the first IP address.
In some embodiments, the predetermined port may be designated by AP 202. Specifically, the Beacon frame may further include a port number, where the port number is used to identify a preset port. For example, if the preset Beacon frame includes a Port number, the field name of the Port number is "Fast Port", and the value of the Port number is "8899" (e.g., as shown in fig. 5A), the preset Port may be the Port 8899 in the electronic device. Optionally, the preset Beacon frame may include a plurality of port numbers, and each port number corresponds to one preset port. For example, if the field name of the Port number is "Fast Port" and the value of the Port number is "8899, 25, 68" (as shown in fig. 5B, for example), the preset ports may be Port 8899, Port 25, and Port 68 in the electronic device.
After the handset 201 receives the preset Beacon frame from the AP202, the handset 201 may get the port number. Then, the mobile phone 201 may determine a preset port corresponding to the port number, and start the preset port to perform monitoring, so as to obtain the first IP address. For example, if the handset 201 receives the default Beacon frame as shown in fig. 5A, i.e. the port number is "8899", and the port with the port number "8899" is assumed to be port a. The handset 201 may then initiate port a to listen. That is, the handset 201 can obtain the first IP address through the port a. For another example, if the handset 201 receives the preset Beacon frame as shown in fig. 5B, that is, the port numbers are "8899, 25, and 68", and it is assumed that the port with the port number of "8899" is port a, the port with the port number of "25" is port B, and the port with the port number of "68" is port c. The handset 201 can start the port a, the port b and the port c to listen simultaneously. That is, the handset 201 can obtain the first IP address allocated by the AP202 through any one of the port a, the port b, and the port c.
In other embodiments, the default port may be designated by the handset 201. For example, when the mobile phone 201 leaves the factory, a worker may configure at least one port in the mobile phone 201 as a preset port to obtain the first IP address. For example, the predetermined port may be port a in the handset 201. For another example, the predetermined ports may be port a, port b, and port c in the handset 201.
In this embodiment, the mobile phone 201 may start the preset port listening at the following time a, time b, time c, or time d to acquire the first IP address.
At the time a, the handset 201 may start the preset port listening after receiving the preset Beacon frame from the AP 202. For example, after receiving the preset Beacon frame shown in fig. 5A, the handset 201 may start port a listening.
At the time b, the handset 201 may start the preset port to monitor during the process of Auth between the handset 201 and the AP 202. Or, the handset 201 may start the preset port listening after the handset 201 and the AP202 complete Auth.
At the time c, the mobile phone 201 may start the preset port listening during the Assoc process between the mobile phone 201 and the AP 202. Alternatively, the handset 201 may start the preset port listening after the handset 201 and the AP202 complete Assoc.
At the time d, the handset 201 may start the preset port listening during the four-way handshake between the handset 201 and the AP 202. Alternatively, the handset 201 may start the preset port listening after the handset 201 completes the four-way handshake with the AP 202. In the following embodiment, the method of the present application is described by taking an example that the mobile phone 201 starts the preset port listening at the time "a", that is, the mobile phone 201 starts the preset port listening after receiving the preset Beacon frame from the AP 202.
S304, AP202 transmits the first IP address.
The first IP address is a first IP address allocated by the AP202 to the handset 201.
In the embodiment of the present application, the AP202 may transmit the first IP address in the following manner.
In a first mode, AP202 may send an Action frame to handset 201, where the Action frame includes the first IP address. Optionally, the Action frame further includes: IP address and subnet mask of AP 202. Illustratively, if the field name of the first IP address is "Fast IP", the value of the first IP address is "192.168.1.1" (e.g., as shown in fig. 6).
In a second manner, the AP202 may broadcast the first IP address via a User Datagram Protocol (UDP).
In a third way, AP202 may broadcast a message carrying the first IP address over UDP. In particular, AP202 may broadcast a first message over UDP, the first message including a first IP address. Optionally, the first message further includes: IP address and subnet mask of AP 202. In the following embodiment, the method of the embodiment of the present application is described by taking an example in which the AP202 broadcasts the first IP address through UDP.
It can be understood that the AP202 may send the first IP address to the mobile phone 201 without receiving an indication message (DHCP DISCOVER message) sent by the mobile phone 201. Therefore, the time consumed by the AP202 for waiting to receive the DHCP DISCOVER message in the process of acquiring the first IP address by the mobile phone 201 can be reduced, and the speed of acquiring the first IP address by the mobile phone 201 is improved.
It should be noted that AP202 may need to send other messages when it is ready to send the first IP address. This may result in AP202 sending the first IP address after sending other messages, which prolongs the time for AP202 to send the first IP address.
In some embodiments, to reduce the time that AP202 waits to transmit the first IP address, AP202 may raise the priority of transmitting the first IP address so that AP202 may transmit the first IP address preferentially. Specifically, AP202 includes a plurality of queues, each of the plurality of queues having a different priority, the priority being used to indicate an order in which AP202 processes the different queues of the plurality of queues. Where AP202 processing queue sends data in the queue to AP 202. That is, AP202 may transmit data in the queue preferentially when the priority of the queue is higher.
Prior to AP202 transmitting the first IP address, AP202 may add the first IP address to a first queue, which is the highest priority queue of the plurality of queues. AP202 may then transmit the data in the queue in order of queue priority from high to low.
It should be noted that, AP202 may also add the first message or the Action frame (i.e., in the above-mentioned manner one and manner three) to the first queue, which is not limited in this embodiment of the present application.
It can be understood that, the AP202 adds the first IP address to the WiFi high priority queue, which can improve the ability of the first IP address to preempt an air interface, reduce the time for the AP202 to wait for sending the first IP address, and further improve the speed for the mobile phone 201 to obtain the first IP address.
Of course, when the AP202 transmits the first IP address, there may be a case where the transmission fails. Thus, even if the AP202 transmits the first IP address, the mobile phone 201 cannot acquire the first IP address.
In some embodiments, to ensure that AP202 can successfully transmit the first IP address, AP202 may periodically transmit the first IP address. Specifically, AP202 may send the first IP address once every first preset duration. The first preset time period is not limited in the embodiment of the present application. For example, the first preset time period may be 0.05 seconds. For another example, the first preset time period may be 0.1 second.
It should be noted that, AP202 may also send the first message and the Action frame periodically (i.e., in the manner one and the manner three described above), which is not limited in this embodiment of the present application.
It is understood that AP202 may improve the success rate of AP202 transmitting the first IP address by transmitting the first IP address multiple times. Therefore, the time for the mobile phone 201 to acquire the first IP address can be reduced, and the speed for the mobile phone 201 to acquire the first IP address is increased.
S305, the mobile phone 201 receives the first IP address.
In some embodiments, when the AP202 sends an Action frame to the handset 201 (i.e., in the first manner described above), the handset 201 may receive the Action frame through the preset port to obtain the first IP address. When the AP202 broadcasts the first IP address through UDP (i.e., in the second manner described above), the handset 201 may receive the first IP address through the preset port. When the AP202 broadcasts a message carrying the first IP address through UDP (that is, in the third manner described above), the cell phone 201 may receive the first message through the preset port to obtain the first IP address.
S306, the mobile phone 201 sends a first response message.
Wherein the first response message is used to indicate that the handset 201 has received the first IP address.
In some embodiments, if the AP202 sends the first IP address in the first manner, that is, the AP202 sends an Action frame to the cell phone 201, after the cell phone 201 receives the Action frame, the cell phone 201 may send an Action acknowledgement message to the AP.
In other embodiments, if AP202 sends the first IP address in manner two (or manner three), that is, AP202 broadcasts the first IP address via UDP, handset 201 may broadcast an Acknowledgement Character (ACK) via UDP after handset 201 receives the first IP address.
In some embodiments, after the handset 201 sends the first response message, the handset 201 may stop the preset port listening.
It is to be appreciated that after the handset 201 obtains the first IP address, the handset 201 need not obtain the IP address. Therefore, the handset 201 can stop the preset port listening to reduce the power consumption of the handset 201.
S307, the AP202 receives the first response message.
In some embodiments, if AP202 is periodically transmitting the first IP address, AP202 may stop transmitting the first IP address after AP202 receives the first response message.
Based on the above technical solution, the AP202 may broadcast a preset Beacon frame carrying the indication information to indicate that the AP202 can actively send the first IP address. After that, the handset 201 may start the preset port listening. After the WIFi link layer establishment (i.e., the Auth procedure, asoc procedure, and four-way handshake procedure shown in fig. 1A), AP202 may send the first IP address. After the handset 201 receives the first IP address, a first response message may be sent to the AP202 to indicate that the handset 201 has received the first IP address. Thus, compared with the conventional technology in which the mobile phone 201 acquires the IP address through four DHCP stages, the process of acquiring the IP address by the mobile phone 201 is simplified in the embodiment of the present application. Therefore, the speed of acquiring the IP address by the mobile phone 201 can be increased, the time consumed by connecting the mobile phone 201 with WiFi is reduced, and the use experience of a user is improved.
In other embodiments, if the AP202 cannot broadcast the preset Beacon frame carrying the indication information, that is, the Beacon frame in the conventional technology is sent by the AP202, after the mobile phone 201 receives the Beacon frame, it is determined that the Beacon frame does not carry the indication information, that is, the AP202 cannot actively send the first IP address. Then, the handset 201 can obtain the first IP address through four DHCP stages in the conventional technology. Specifically, for the description that the mobile phone 201 obtains the first IP address through four stages (i.e., a discovery stage, a provision stage, a selection stage, and a confirmation stage) of DHCP in the conventional technology, reference may be made to the description of fig. 1B in the foregoing embodiment, which is not described herein again.
In other embodiments, an AP may interact with a plurality of electronic devices, the AP may broadcast a preset Beacon frame carrying indication information, and the plurality of electronic devices include: an electronic device that can recognize the indication information and an electronic device that cannot recognize the indication information.
Exemplarily, an application scenario shown in fig. 2B is taken as an example, that is, a plurality of electronic devices include a mobile phone 201 and a mobile phone 203, and an AP is an AP202, which introduces an IP address obtaining method provided in the embodiment of the present application. The mobile phone 201 is an electronic device capable of identifying the indication information, the mobile phone 203 is an electronic device incapable of identifying the indication information, and the AP202 is an AP capable of broadcasting the preset Beacon frame. As shown in fig. 7, after S301, the method for acquiring an IP address may include: S701-S705.
It should be noted that, the method for the handset 201 to obtain the IP address may refer to the methods in S301 to S307, which are not described herein again.
S701, the mobile phone 203 receives the preset Beacon frame from the AP 202.
In this embodiment, the mobile phone 203 cannot identify the indication information in the preset Beacon frame. That is, handset 203 cannot determine whether AP202 is able to actively transmit the first IP address. In addition, the handset 203 cannot start the preset port listening.
In a possible design, if the mobile phone 203 cannot recognize the indication information in the default Beacon frame, the mobile phone 203 performs S702.
It should be noted that after the handset 201 receives the preset Beacon frame from the AP202, the handset 201 and the AP202 may perform an Auth procedure, an Assoc procedure, and a four-way handshake procedure. For specific description of the Auth procedure, the Assoc procedure, and the four-way handshake procedure, reference may be made to the description of fig. 1A in the foregoing embodiment, and the description of the Auth procedure, the Assoc procedure, and the four-way handshake procedure in the conventional technology, which are not described herein again.
S702, the mobile phone 203 broadcasts a DHCP DISCOVER message.
The DHCP DISCOVER message is used to request to acquire a first IP address.
S703, AP202 sends a DHCP OFFER message to mobile 203.
The DHCP OFFER message includes information such as an IP address of the AP, a target IP address, a first IP address, and a subnet mask.
S704, the mobile phone 203 broadcasts a DHCP REQUEST message.
The DHCP REQUEST message is used to indicate that the mobile phone 203 has acquired the first IP address.
S705, AP202 sends a DHCP ACK message to handset 203.
Wherein, the DHCP ACK message is used to confirm the first IP address.
It should be noted that, for the description of the four DHCP stages in S702 to S704, reference may be made to a method for acquiring an IP address by an electronic device through DHCP in the conventional technology, which is not described herein again.
Based on the above technical solution, if the mobile phone 201 can identify the preset Beacon frame, the mobile phone 201 does not need to send a DHCP DISCOVER message. Handset 201 may receive the first IP address that AP202 is actively sending. If the mobile phone 203 cannot recognize the preset Beacon frame, the mobile phone 203 sends a DHCP DISCOVER message to obtain the first IP address. In this way, any electronic device (an electronic device that can recognize the preset Beacon frame and an electronic device that cannot recognize the preset Beacon frame) can acquire the IP address from the AP 202.
The scheme provided by the embodiment of the application is mainly introduced from the perspective of electronic equipment. It is understood that the electronic device comprises corresponding hardware structures and/or software modules for performing the respective functions in order to realize the above-mentioned functions. Those skilled in the art will readily appreciate that the steps of a method for obtaining an IP address of the examples described in connection with the embodiments disclosed herein may be implemented in hardware or a combination of hardware and computer software. Whether a function is performed as hardware or as software driven hardware in an electronic device depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiment of the present application, according to the above method example, a functional module or a functional unit of an apparatus for acquiring an IP address may be divided, for example, each functional module or functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated module may be implemented in a form of hardware, or may be implemented in a form of a software functional module or a functional unit. The division of the modules or units in the embodiment of the present application is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
Please refer to fig. 8A, which illustrates a schematic diagram of an apparatus for acquiring an IP address according to an embodiment of the present application. The IP address obtaining device may be a functional module in the electronic device (e.g., the mobile phone 200) for implementing the method according to the embodiment of the present application. As shown in fig. 8A, the means for acquiring the IP address may include: a receiving unit 801, a processing unit 802 and a transmitting unit 803.
The receiving unit 801 is configured to support the mobile phone 200 to perform: information from other devices is received. For example, the receiving unit 801 is used to support the handset 200 to perform S302, S305 in the above-described method embodiments, and/or other processes for the techniques described herein.
The processing unit 802 is configured to support the mobile phone 200 to perform: it is determined whether the other device is capable of actively sending the first IP address. For example, the processing unit 802 is configured to enable the handset 200 to perform S303 in the above-described method embodiments, and/or other processes for the techniques described herein.
The sending unit 803 is configured to support the mobile phone 200 to perform: and sending the information to other devices. For example, the sending unit 803 is used to support the handset 200 to perform S306 in the above-described method embodiments, and/or other processes for the techniques described herein.
Other embodiments of the present application provide an electronic device (e.g., the mobile phone 200 shown in fig. 2C), which may include: a memory and one or more processors. The memory is coupled to the processor. The electronic device may further include a camera. Or, the electronic device may be externally connected with a camera. The memory is for storing computer program code comprising computer instructions. When the processor executes the computer instructions, the electronic device may perform various functions or steps performed by the mobile phone in the above-described method embodiments. The structure of the electronic device may refer to the structure of the mobile phone 200 shown in fig. 2C.
Please refer to fig. 8B, which illustrates a schematic diagram of another apparatus for acquiring an IP address according to an embodiment of the present application. The IP address obtaining apparatus may be a functional module in the above-mentioned electronic device (e.g. AP202) for implementing the method according to the embodiment of the present application. As shown in fig. 8B, the means for acquiring the IP address may include: a receiving unit 804 and a transmitting unit 805.
Wherein the receiving unit 804 is configured to support the AP202 to perform: information from other devices is received. For example, receiving unit 804 is used to support AP202 to perform S307 in the above-described method embodiments, and/or other processes for the techniques described herein.
The sending unit 805 is configured to support the AP202 to perform: and sending the information to other devices. For example, the sending unit 805 is configured to support the AP202 to perform S301, S304, S703, S705 in the above method embodiments, and/or other processes for the techniques described herein.
Other embodiments of the present application provide an AP, which may include: a memory and one or more processors. The memory is coupled to the processor. The memory is used to store computer program code, which includes computer instructions. When the processor executes the computer instructions, the AP may perform the various functions or steps performed by the handset in the above-described method embodiments.
An embodiment of the present application further provides a chip system, as shown in fig. 9, where the chip system includes at least one processor 901 and at least one interface circuit 902. The processor 901 and the interface circuit 902 may be interconnected by wires. For example, the interface circuit 902 may be used to receive signals from other devices (e.g., a memory of an electronic device). Also for example, the interface circuit 902 may be used to send signals to other devices, such as the processor 901. Illustratively, the interface circuit 902 may read instructions stored in the memory and send the instructions to the processor 901. When executed by the processor 901, the instructions may cause an electronic device (such as the mobile phone 200 shown in fig. 2C) or an AP to perform the steps in the above embodiments. Of course, the chip system may further include other discrete devices, which is not specifically limited in this embodiment of the present application.
An embodiment of the present application further provides a computer storage medium, where the computer storage medium includes computer instructions, and when the computer instructions are run on the electronic device (e.g., the mobile phone 200 shown in fig. 2C), the electronic device is caused to perform various functions or steps performed by the mobile phone in the foregoing method embodiment.
The embodiment of the present application further provides a computer storage medium, where the computer storage medium includes computer instructions, and when the computer instructions are run on the AP, the AP is enabled to execute each function or step executed by the mobile phone in the foregoing method embodiment.
The embodiment of the present application further provides a computer program product, which when running on a computer, causes the computer to execute each function or step executed by the mobile phone in the above method embodiments.
Through the description of the above embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical functional division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another device, or some features may be omitted, or not executed. 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 units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may be one physical unit or a plurality of physical units, that is, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially or partially contributed to by the prior art, or all or part of the technical solutions may be embodied in the form of a software product, where the software product is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only an embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present disclosure should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (17)

1. The method for acquiring the IP address of the Internet protocol is characterized in that the method is applied to electronic equipment to acquire the IP address distributed to the electronic equipment by a wireless Access Point (AP); the AP comprises a plurality of queues, the priority of each queue in the plurality of queues is different, the priority is used for indicating the sequence of processing different queues in the plurality of queues by the AP, and the AP processing queue transmits data in the queues for the AP;
the method comprises the following steps:
the electronic equipment establishes connection with the AP; after the electronic equipment establishes connection with the AP, the AP can allocate an IP address to the electronic equipment;
the AP broadcasts a preset Beacon frame, wherein the preset Beacon frame comprises indication information, and the indication information is used for indicating that the AP has the capability of actively sending the IP address allocated by the AP to the electronic equipment;
the AP adds a first IP address into a queue with the highest priority in the queues;
the AP periodically broadcasts a first message, wherein the first message comprises the first IP address, and the first IP address is an IP address allocated to the electronic equipment by the AP;
the electronic equipment starts a preset port to monitor when receiving the preset Beacon frame from the AP; the preset port is used for receiving the first IP address, and the preset port is pre-configured in the electronic device, or the preset port is indicated to the electronic device by the AP;
the electronic device receives the first message from the AP from the preset port, wherein the first message comprises the first IP address.
2. The method of claim 1, wherein the preset port is indicated to the electronic device by the AP as: the preset Beacon frame further comprises a port number, and the port number is used for identifying the preset port.
3. The method of claim 1 or 2, wherein after the electronic device receives the first IP address from the AP from the pre-set port, the method further comprises:
the electronic equipment sends a first response message to the AP, wherein the first response message is used for indicating that the electronic equipment receives the first IP address;
the AP receives the first response message from the electronic device.
4. The method of claim 1 or 2, wherein after the electronic device receives the first message from the AP from the pre-set port, the method further comprises:
and the electronic equipment stops the monitoring of the preset port.
5. The method according to claim 1 or 2, wherein the indication information includes a first value or a second value, the first value is used to indicate that the AP has the capability of actively transmitting the IP address allocated by the AP to the electronic device, and the second value is used to indicate that the AP does not have the capability of actively transmitting the IP address allocated by the AP to the electronic device;
after the AP broadcasts a preset Beacon frame, the method further includes:
the electronic equipment receives the preset Beacon frame;
the electronic equipment determines whether the AP has the capability of actively sending the IP address allocated by the AP to the electronic equipment or not according to the indication information;
the AP periodically broadcasts a first message, comprising:
if the indication information includes the first value, the AP broadcasts the first message periodically.
6. The method of claim 5, further comprising:
and if the indication information comprises the second numerical value, the electronic equipment sends a DHCP DISCOVER message to the AP.
7. A method for acquiring an IP address, the method comprising:
the electronic equipment receives a preset Beacon frame from the AP and starts a preset port to monitor; the preset port is used for receiving a first IP address, and the preset port is configured in the electronic device in advance, or the preset port is indicated to the electronic device by the AP; the preset Beacon frame comprises indication information, and the indication information is used for indicating that the AP has the capability of actively sending the IP address allocated by the AP to the electronic equipment;
the electronic equipment receives the first IP address from the AP from the preset port;
the electronic device sends a first response message to the AP, wherein the first response message is used for indicating that the electronic device has received the first IP address.
8. The method of claim 7, wherein the electronic device receiving the first IP address from the AP from the default port comprises:
the electronic equipment receives an Action frame from the AP from the preset port, wherein the Action frame comprises the first IP address; alternatively, the first and second electrodes may be,
the electronic device receives a first message from the AP from the preset port, wherein the first message comprises the first IP address.
9. The method according to claim 7 or 8, wherein the preset port is indicated to the electronic device by the AP: the preset Beacon frame further comprises a port number, and the port number is used for identifying the preset port.
10. The method of claim 7 or 8, wherein after the electronic device receives the first IP address from the AP from the pre-set port, the method further comprises:
and the electronic equipment stops the monitoring of the preset port.
11. A method for acquiring an IP address, the method comprising:
the method comprises the steps that an AP broadcasts a preset Beacon frame, wherein the preset Beacon frame comprises indication information, and the indication information is used for indicating that the AP has the capability of actively sending an IP address allocated by the AP for the electronic equipment;
the AP sends a first IP address, wherein the first IP address is an IP address distributed by the AP for the electronic equipment;
the AP receives a first response message from the electronic equipment, wherein the first response message is used for indicating that the electronic equipment receives the first IP address.
12. The method of claim 11, wherein the AP sending the first IP address comprises:
the AP periodically sends an Action frame to the electronic equipment, wherein the Action frame comprises the first IP address; alternatively, the first and second liquid crystal display panels may be,
the AP periodically broadcasts a first message, wherein the first message comprises the first IP address.
13. The method of claim 11 or 12, wherein the AP comprises a plurality of queues, and wherein each of the plurality of queues has a different priority, and wherein the priority is used to indicate an order in which the AP processes different ones of the plurality of queues, and wherein the AP processes data in the queues for the AP;
before the AP sends the first IP address on the preset port, the method further includes:
and the AP adds the first IP address into the queue with the highest priority in the queues.
14. The method according to claim 11 or 12, wherein the preset port is indicated to the electronic device by the AP as: the preset Beacon frame further comprises a port number, and the port number is used for identifying the preset port.
15. An electronic device, characterized in that the electronic device comprises: a memory and one or more processors; the memory coupled with the processor, the memory for storing computer program code, the computer program code comprising computer instructions that, when executed by the one or more processors, cause the electronic device to perform the method of any of claims 7-10.
16. An AP, the AP comprising: a memory and one or more processors; the memory coupled with the processor, the memory for storing computer program code, the computer program code comprising computer instructions that, when executed by the one or more processors, cause the AP to perform the method of any of claims 11-14.
17. A computer storage medium comprising computer instructions that, when executed on an electronic device, cause the electronic device to perform the method of any of claims 7-10.
CN202110437395.1A 2021-04-22 2021-04-22 Method for acquiring Internet protocol IP address and electronic equipment Active CN113114798B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110437395.1A CN113114798B (en) 2021-04-22 2021-04-22 Method for acquiring Internet protocol IP address and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110437395.1A CN113114798B (en) 2021-04-22 2021-04-22 Method for acquiring Internet protocol IP address and electronic equipment

Publications (2)

Publication Number Publication Date
CN113114798A CN113114798A (en) 2021-07-13
CN113114798B true CN113114798B (en) 2022-05-10

Family

ID=76719772

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110437395.1A Active CN113114798B (en) 2021-04-22 2021-04-22 Method for acquiring Internet protocol IP address and electronic equipment

Country Status (1)

Country Link
CN (1) CN113114798B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114363394A (en) * 2021-12-23 2022-04-15 杭州当虹科技股份有限公司 Edge equipment discovery method based on BUSYBOX

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101217499A (en) * 2008-01-21 2008-07-09 中兴通讯股份有限公司 Array dispatching method
CN102404133A (en) * 2010-09-09 2012-04-04 北京中星微电子有限公司 Method and device for internet protocol (IP) network data interaction

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101188514A (en) * 2007-11-09 2008-05-28 华为技术有限公司 Method, device and system for automatically discovering network element device
CN101287017B (en) * 2008-05-19 2013-12-25 郑宽永 Active IP address allocating method and system
CN101656763B (en) * 2009-09-11 2013-03-13 华为技术有限公司 IP address automatic distribution method, client and server
JP5331163B2 (en) * 2011-05-31 2013-10-30 株式会社バッファロー IP address assignment system, DHCP server, and IP address assignment method
US20150237003A1 (en) * 2014-02-18 2015-08-20 Benu Networks, Inc. Computerized techniques for network address assignment
CN110784939B (en) * 2019-11-04 2022-01-21 上海庆科信息技术有限公司 Data communication method, device and system
CN112689029A (en) * 2020-12-30 2021-04-20 海信视像科技股份有限公司 Method, device and equipment for acquiring IP address of group user

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101217499A (en) * 2008-01-21 2008-07-09 中兴通讯股份有限公司 Array dispatching method
CN102404133A (en) * 2010-09-09 2012-04-04 北京中星微电子有限公司 Method and device for internet protocol (IP) network data interaction

Also Published As

Publication number Publication date
CN113114798A (en) 2021-07-13

Similar Documents

Publication Publication Date Title
US11582592B2 (en) Communication device
US20210144534A1 (en) Communication Device
US11297666B2 (en) Electronic device and method for forming Wi-Fi direct group thereof
EP3893109B1 (en) Method and device for connecting bluetooth devices
US11277744B2 (en) Wi-Fi hotspot connection method and terminal
US20230106898A1 (en) Communication method and apparatus, and storage medium
WO2021138914A1 (en) Method and apparatus for indicating data transmission, communication device and storage medium
CN111050415B (en) Wireless data transmission method convenient to operate
CN110870353B (en) WiFi connection method and terminal
CN113038627B (en) File sharing method, mobile device and computer storage medium
CN113114798B (en) Method for acquiring Internet protocol IP address and electronic equipment
US9883545B2 (en) Apparatus and method for selecting channel in wireless communication system
US20240090049A1 (en) Method and apparatus for establishing bluetooth link, device, and storage medium
CN111557102B (en) Information transmission method, device, communication equipment and storage medium
CN112469014A (en) Method and electronic equipment for configuring Bluetooth connection parameters
CN112640533A (en) Electronic device for providing AP list and method for operating electronic device
CN113473539B (en) Data transmission method and electronic equipment
KR102550512B1 (en) Communication apparatus and control method thereof
WO2023272669A1 (en) Paging method and related apparatus
EP4175343A1 (en) Electronic device, wireless communication method and non-transitory computer-readable storage medium
CN115150832A (en) Network access method and device
CN116391437A (en) Information transmission method, device, communication equipment and storage medium
CN114698060A (en) Method and device for rapidly discovering wireless access point

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
GR01 Patent grant
GR01 Patent grant