CN113114798B - A method and electronic device for obtaining an Internet Protocol IP address - Google Patents
A method and electronic device for obtaining an Internet Protocol IP address Download PDFInfo
- 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
- electronic device
- address
- preset
- port
- mobile phone
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 150
- 230000008569 process Effects 0.000 claims abstract description 59
- 238000012544 monitoring process Methods 0.000 claims abstract description 19
- 230000004044 response Effects 0.000 claims description 25
- 230000009471 action Effects 0.000 claims description 23
- 238000012545 processing Methods 0.000 claims description 19
- 238000004590 computer program Methods 0.000 claims description 15
- 230000003993 interaction Effects 0.000 abstract description 6
- 238000004891 communication Methods 0.000 description 34
- 238000013461 design Methods 0.000 description 28
- 238000005516 engineering process Methods 0.000 description 22
- 230000006870 function Effects 0.000 description 19
- 238000010586 diagram Methods 0.000 description 12
- 238000007726 management method Methods 0.000 description 11
- 238000012790 confirmation Methods 0.000 description 5
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000010295 mobile communication Methods 0.000 description 3
- 238000013528 artificial neural network Methods 0.000 description 2
- 230000003190 augmentative effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000013500 data storage Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 210000000988 bone and bone Anatomy 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000010348 incorporation Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 229920001690 polydopamine Polymers 0.000 description 1
- 230000005855 radiation Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5007—Internet protocol [IP] addresses
- H04L61/5014—Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
Description
技术领域technical field
本申请实施例涉及通信技术领域,尤其涉及一种IP地址的获取方法及设备。The embodiments of the present application relate to the field of communication technologies, and in particular, to a method and device for obtaining an IP address.
背景技术Background technique
随着科技的发展,越来越多的电子设备(例如手机、笔记本电脑等)通过无线保真(Wireless Fidelity,WIFI)技术进行无线通信。在电子设备通过WIFI技术进行无线通信的过程中,电子设备需要获取一个IP地址,并通过该互联网协议地址(Internet ProtocolAddress,IP)地址进行网络连接。With the development of science and technology, more and more electronic devices (such as mobile phones, notebook computers, etc.) perform wireless communication through wireless fidelity (Wireless Fidelity, WIFI) technology. In the process that the electronic device performs wireless communication through the WIFI technology, the electronic device needs to obtain an IP address, and perform network connection through the Internet Protocol Address (Internet Protocol Address, IP) address.
目前,电子设备获取IP地址时,需要广播一个请求消息,以请求获取IP地址。之后,至少一个无线访问接入点(Wireless Access Point,AP)可以向电子设备提供IP地址。接着,电子设备可以从多个IP地址中选择一个IP地址,并广播一个消息包,以表征电子设备已经接受了一个IP地址。然后,AP可以向电子设备发送一个响应消息。Currently, when an electronic device acquires an IP address, it needs to broadcast a request message to request to acquire the IP address. Afterwards, at least one wireless access point (Wireless Access Point, AP) can provide an IP address to the electronic device. Next, the electronic device may select an IP address from a plurality of IP addresses, and broadcast a message packet to indicate that the electronic device has accepted an IP address. The AP can then send a response message to the electronic device.
然而,上述技术方案,电子设备需要与AP之间完成多次交互,才可以获取到IP地址。不仅过程较为繁琐,而且获取IP地址的速度较慢。However, in the above technical solution, the electronic device needs to complete multiple interactions with the AP before it can obtain the IP address. Not only is the process more cumbersome, but also the speed of obtaining an IP address is slow.
发明内容SUMMARY OF THE INVENTION
本申请提供一种IP地址的获取方法及电子设备,能够简化电子设备与AP之间的交互过程,提高了电子设备获取IP地址的速度。The present application provides a method and an electronic device for obtaining an IP address, which can simplify the interaction process between the electronic device and the AP, and improve the speed at which the electronic device obtains the IP address.
第一方面,本申请提供一种IP地址的获取方法。In a first aspect, the present application provides a method for obtaining an IP address.
该方法中,电子设备与AP建立连接。其中,电子设备与AP建立连接之后,AP能够为电子设备分配IP地址。之后,AP可以广播预设信标Beacon帧,该预设Beacon帧包括指示信息,指示信息用于指示AP具备主动发送AP为电子设备分配的IP地址的能力。接着,AP 可以发送第一IP地址,第一IP地址是AP为电子设备分配的IP地址。电子设备接收到来自 AP的预设Beacon帧,则可以启动预设端口监听,该预设端口用于接收第一IP地址,预设端口可以预先配置在电子设备中,或者预设端口可以是AP向电子设备指示的。之后,电子设备可以从预设端口接收到来自AP的第一IP地址。In this method, the electronic device establishes a connection with the AP. Wherein, after the electronic device establishes a connection with the AP, the AP can assign an IP address to the electronic device. After that, the AP may broadcast a preset beacon Beacon frame, where the preset Beacon frame includes indication information, where the indication information is used to indicate that the AP has the ability to actively send the IP address allocated by the AP to the electronic device. Next, the AP may send the first IP address, where the first IP address is the IP address assigned by the AP to the electronic device. When the electronic device receives the preset Beacon frame from the AP, it can start monitoring the preset port, and the preset port is used to receive the first IP address. The preset port can be pre-configured in the electronic device, or the preset port can be an AP directed to electronic equipment. After that, the electronic device may receive the first IP address from the AP from the preset port.
基于上述技术方案,在AP可以广播携带有指示信息的预设Beacon帧,以指示该AP能够主动发送第一IP地址之后,电子设备便可以接收到来自AP的第一IP地址。相较于常规技术,电子设备通过DHCP的四个阶段获取IP地址,本申请实施例中简化了电子设备获取IP地址的过程。如此,能够提高电子设备获取IP地址的速度,进而减少电子设备连接WiFi耗费的时间,提升了用户的使用体验。Based on the above technical solution, 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 can receive the first IP address from the AP. Compared with the conventional technology, the electronic device obtains the IP address through four stages of DHCP, and the embodiment of the present application simplifies the process of obtaining the IP address by the electronic device. In this way, the speed at which the electronic device obtains the IP address can be improved, thereby reducing the time it takes for the electronic device to connect to the WiFi, and improving the user experience.
结合第一方面,在另一种可能的设计方式中,AP可以向电子设备周期性发送动作Action 帧,Action帧包括第一IP地址。之后,电子设备可以从预设端口接收来自AP的Action帧。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. After that, the electronic device can receive the Action frame from the AP from the preset port.
可以理解的是,AP周期性地发送Action帧,可以提高AP发送第一IP地址的成功率。如此,能够减少电子设备获取第一IP地址的时间,提高了电子设备获取第一IP地址的速度。It can be understood that, the AP periodically sends the Action frame, which can improve the success rate of the AP sending the first IP address. In this way, the time for the electronic device to obtain the first IP address can be reduced, and the speed of the electronic device to obtain the first IP address is improved.
结合第一方面,在一种可能的设计方式中,AP可以周期性广播第一消息,第一消息包括第一IP地址。之后,电子设备可以从预设端口接收来自AP的第一消息,第一消息包括第一 IP地址。With reference to the first aspect, in a possible design manner, the AP may periodically broadcast the first message, where the first message includes the first IP address. After that, the electronic device may receive the first message from the AP from the preset port, where the first message includes the first IP address.
结合第一方面,在另一种可能的设计方式中,AP包括多个队列,多个队列中每个队列的优先级不同,优先级用于指示AP处理多个队列中不同队列的顺序,AP处理队列为AP发送队列中的数据。也就是说,相较于优先级较低的队列中的数据,AP可以优先发送优先级较高的的队列中的数据。With reference to the first aspect, in another possible design manner, the AP includes multiple queues, and each queue in the multiple queues has a different priority, and the priority is used to indicate the order in which the AP processes different queues in the multiple queues. The processing queue is for the AP to send data in the queue. That is to say, the AP can send the data in the queue with the higher priority in preference to the data in the queue with the lower priority.
AP可以将第一IP地址加入多个队列中优先级最高的队列。The AP may add the first IP address to the queue with the highest priority among the multiple queues.
可以理解的是,AP将第一IP地址加入高优先队列,能够提高第一IP地址抢占空口的能力,减少AP等待发送第一IP地址的时间,进而提高电子设备获取第一IP地址的速度。It can be understood that adding the first IP address to the high priority queue by the AP 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 thereby improve the speed at which the electronic device obtains the first IP address.
结合第一方面,在另一种可能的设计方式中,预设端口是AP向电子设备指示的为:预设Beacon帧还包括端口号,端口号用于标识预设端口。With reference to the first aspect, in another possible design manner, the preset port is indicated by the AP to the electronic device: the preset Beacon frame further includes a port number, and the port number is used to identify the preset port.
结合第一方面,在另一种可能的设计方式中,在电子设备从预设端口接收到来自AP的第一IP地址之后,电子设备可以向AP发送第一响应消息,第一响应消息用于指示电子设备已接收到第一IP地址。AP可以接收来自电子设备的第一响应消息。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 preset port, the electronic device may send a first response message to the AP, where the first response message is used for Indicates that the electronic device has received the first IP address. The AP may receive the first response message from the electronic device.
这样一来,AP接收到第一响应消息之后,便可以确定电子设备已经接收到第一IP地址。In this way, after the AP receives the first response message, it can determine that the electronic device has received the first IP address.
结合第一方面,在另一种可能的设计方式中,在电子设备从预设端口接收到来自AP的第一IP地址之后,电子设备可以停止预设端口监听。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 preset port, the electronic device may stop monitoring the preset port.
可以理解的是,电子设备已经接收到第一IP地址,便可以停止预设端口继续监听。如此,可以降低电子设备的功耗。It can be understood that, after the electronic device has received the first IP address, it can stop the preset port and continue to monitor. In this way, the power consumption of the electronic device can be reduced.
结合第一方面,在另一种可能的设计方式中,指示信息包括第一数值或第二数值,第一数值用于指示AP具备主动发送AP为电子设备分配的IP地址的能力,第二数值用于指示AP 不具备主动发送AP为电子设备分配的IP地址的能力。在AP广播预设Beacon帧之后,电子设备根据指示信息,确定AP是否具备主动发送AP为电子设备分配的IP地址的能力。若指示信息包括第一数值,AP周期性广播第一消息。In combination with the first aspect, in another possible design manner, the indication information includes a first value or a second value, the first value is used to indicate that the AP has the ability to actively send the IP address assigned by the AP to the electronic device, and the second value is It is used to indicate that the AP does not have the ability to actively send the IP address assigned by the AP to the electronic device. After the AP broadcasts the preset Beacon frame, the electronic device determines, according to the indication information, whether the AP has the ability to actively send the IP address allocated by the AP to the electronic device. If the indication information includes the first value, the AP periodically broadcasts the first message.
结合第一方面,在另一种可能的设计方式中,若指示信息包括第二数值,电子设备向AP 发送DHCP DISCOVER报文。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.
也就是说,若指示信息包括第二数值,则说明AP不具备主动发送AP为电子设备分配的 IP地址的能力。因此,电子设备可以向AP发送DHCP DISCOVER报文,基于动态主机配置协议(Dynamic Host Configuration Protocol,DHCP)获取AP分配的IP地址。That is, if the indication information includes the second value, it means that the AP does not have the ability to actively send the IP address allocated by the AP to the electronic device. Therefore, the electronic device can send a DHCP DISCOVER message to the AP, and obtain the IP address allocated by the AP based on the Dynamic Host Configuration Protocol (Dynamic Host Configuration Protocol, DHCP).
第二方面,本申请提供一种IP地址的获取方法。该方法中,电子设备接收到来自无线访问接入点AP的预设Beacon帧,可以启动预设端口监听,该预设端口用于接收第一IP地址,预设端口可以预先配置在电子设备中,或者预设端口可以是AP向电子设备指示的。预设Beacon帧包括指示信息,指示信息用于指示AP具备主动发送AP为电子设备分配的IP地址的能力。之后,电子设备可以从预设端口接收到来自AP的第一IP地址。然后,电子设备可以向AP发送第一响应消息,第一响应消息用于指示电子设备已接收到第一IP地址。In a second aspect, the present application provides a method for obtaining an IP address. In this method, the electronic device receives the preset Beacon frame from the wireless access point AP, and can start monitoring the preset port, the preset port is used to receive the first IP address, and the preset port can be pre-configured in the electronic device , or the preset port may be indicated by the AP to the electronic device. The preset Beacon frame includes indication information, where the indication information is used to indicate that the AP has the ability to actively send the IP address allocated by the AP to the electronic device. After that, the electronic device may receive the first IP address from the AP from the preset port. Then, 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.
基于上述方案,在AP可以广播携带有指示信息的预设Beacon帧,以指示该AP能够主动发送第一IP地址之后,电子设备便可以接收到来自AP的第一IP地址。相较于常规技术,电子设备通过DHCP的四个阶段获取IP地址,本申请实施例中简化了电子设备获取IP地址的过程。如此,能够提高电子设备获取IP地址的速度,进而减少电子设备连接WiFi耗费的时间,提升了用户的使用体验。Based on the above solution, 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 can receive the first IP address from the AP. Compared with the conventional technology, the electronic device obtains the IP address through four stages of DHCP, and the embodiment of the present application simplifies the process of obtaining the IP address by the electronic device. In this way, the speed at which the electronic device obtains the IP address can be improved, thereby reducing the time it takes for the electronic device to connect to the WiFi, and improving the user experience.
结合第二方面,在一种可能的设计方式中,电子设备可以从预设端口接收来自AP的 Action帧,Action帧包括第一IP地址。或者,电子设备可以从预设端口接收来自AP的第一消息,第一消息包括第一IP地址。With reference to the second aspect, in a possible design manner, the electronic device may receive an Action frame from the AP from a preset port, where the Action frame includes the first IP address. Alternatively, the electronic device may receive the first message from the AP from the preset port, where the first message includes the first IP address.
结合第二方面,在另一种可能的设计方式中,预设端口是AP向电子设备指示的为:预设Beacon帧还包括端口号,端口号用于标识预设端口。With reference to the second aspect, in another possible design manner, the preset port is indicated by the AP to the electronic device: the preset Beacon frame further includes a port number, and the port number is used to identify the preset port.
结合第二方面,在另一种可能的设计方式中,在电子设备从预设端口接收到来自AP的第一IP地址之后,电子设备可以停止预设端口监听。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 monitoring the preset port.
可以理解的是,电子设备已经接收到第一IP地址,便可以停止预设端口继续监听。如此,可以降低电子设备的功耗。It can be understood that, after the electronic device has received the first IP address, it can stop the preset port and continue to monitor. In this way, the power consumption of the electronic device can be reduced.
第三方面,本申请提供一种IP地址的获取方法。该方法中,无线访问接入点AP可以广播预设Beacon帧,预设Beacon帧包括指示信息,指示信息用于指示AP具备主动发送AP为电子设备分配的IP地址的能力。之后,AP可以发送第一IP地址,第一IP地址是AP为电子设备分配的IP地址。然后,AP可以接收来自电子设备的第一响应消息,第一响应消息用于指示电子设备已接收到第一IP地址。In a third aspect, the present application provides a method for obtaining an IP address. In this method, the wireless access point AP can broadcast a preset Beacon frame, and the preset Beacon frame includes indication information, and the indication information is used to indicate that the AP has the ability to actively send the IP address allocated by the AP to the electronic device. After that, the AP can send the first IP address, where the first IP address is the IP address assigned by the AP to the electronic device. Then, the AP may receive a first response message from the electronic device, where the first response message is used to indicate that the electronic device has received the first IP address.
基于上述方案,AP可以广播携带有指示信息的预设Beacon帧,以指示该AP能够主动发送第一IP地址。并且,AP可以在没有任何动作指令触发AP发送第一IP地址的情况下,发送第一IP地址。相较于常规技术,电子设备通过DHCP的四个阶段获取IP地址,本申请实施例中简化了电子设备获取IP地址的过程。如此,能够提高电子设备获取IP地址的速度,进而减少电子设备连接WiFi耗费的时间,提升了用户的使用体验。Based on the above solution, the AP may broadcast a preset Beacon frame carrying indication information to indicate that the AP can actively send the first IP address. Moreover, 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 device obtains the IP address through four stages of DHCP, and the embodiment of the present application simplifies the process of obtaining the IP address by the electronic device. In this way, the speed at which the electronic device obtains the IP address can be improved, thereby reducing the time it takes for the electronic device to connect to the WiFi, and improving the user experience.
结合第三方面,在一种可能的设计方式中,AP可以向电子设备周期性发送Action帧, Action帧包括第一IP地址。或者,AP可以周期性广播第一消息,第一消息包括第一IP地址。With reference to the third aspect, in a possible design manner, the AP may periodically send Action frames to the electronic device, where the Action frames include the first IP address. Alternatively, the AP may periodically broadcast the first message, where the first message includes the first IP address.
结合第三方面,在另一种可能的设计方式中,AP可以包括多个队列,多个队列中每个队列的优先级不同,优先级用于指示AP处理多个队列中不同队列的顺序,AP处理队列为AP 发送队列中的数据。AP可以将第一IP地址加入多个队列中优先级最高的队列。With reference to the third aspect, in another possible design manner, the AP may include multiple queues, each of the multiple queues has a different priority, and the priority is used to indicate the order in which the AP processes different queues in the multiple queues, The AP processing queue is the data in the AP sending queue. The AP may add the first IP address to the queue with the highest priority among the multiple queues.
可以理解的是,AP将第一IP地址加入高优先队列,能够提高第一IP地址抢占空口的能力,减少AP等待发送第一IP地址的时间,进而提高电子设备获取第一IP地址的速度。It can be understood that adding the first IP address to the high priority queue by the AP 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 thereby improve the speed at which the electronic device obtains the first IP address.
结合第三方面,在另一种可能的设计方式中,预设端口是AP向电子设备指示的为:预设Beacon帧还包括端口号,端口号用于标识预设端口。With reference to the third aspect, in another possible design manner, the preset port is indicated by the AP to the electronic device: the preset Beacon frame further includes a port number, and the port number is used to identify the preset port.
第四方面,本申请提供一种电子设备,该电子设备包括:存储器和处理器,上述存储器与上述处理器耦合;存储器还用于存储计算机程序代码,计算机程序代码包括计算机指令;当计算机指令被所述处理器执行时,使得电子设备执行如第二方面及其任一种可能的设计方式所述的方法。In a fourth aspect, the present application provides an electronic device, the electronic device comprising: a memory and a processor, the memory is coupled to the processor; the memory is further used to store computer program code, and the computer program code includes computer instructions; when the computer instructions are When executed by the processor, the electronic device is caused to execute the method described in the second aspect and any possible design manner thereof.
第五方面,本申请提供一种AP,该AP包括:存储器和处理器,上述存储器与上述处理器耦合;存储器还用于存储计算机程序代码,计算机程序代码包括计算机指令;当计算机指令被所述处理器执行时,使得AP执行如第三方面及其任一种可能的设计方式所述的方法。In a fifth aspect, the present application provides an AP, the AP includes: a memory and a processor, the memory is coupled to the processor; the memory is further used to store computer program code, and the computer program code includes computer instructions; when the computer instructions are described When executed by the processor, the AP is caused to execute the method described in the third aspect and any possible design manners thereof.
第六方面,本申请提供一种通信系统,该通信系统包括第四方面所述的电子设备和第五方面所述的AP,该通信系统可以执行如如第一方面及其任一种可能的设计方式所述的方法。In a sixth aspect, the present application provides a communication system, the communication system includes the electronic device described in the fourth aspect and the AP described in the fifth aspect, the communication system can perform the first aspect and any one of its possible Design method described.
第七方面,本申请提供一种芯片系统,该芯片系统应用于电子设备。该芯片系统包括一个或多个接口电路和一个或多个处理器。该接口电路和处理器通过线路互联。该接口电路用于从电子设备的存储器接收信号,并向处理器发送该信号,该信号包括存储器中存储的计算机指令。当处理器执行所述计算机指令时,电子设备执行如第二方面及其任一种可能的设计方式所述的方法。In a seventh aspect, the present application provides a chip system, which is applied to an electronic device. The chip system includes one or more interface circuits and one or more processors. The interface circuit and the processor are interconnected by wires. The interface circuit is configured to receive signals from the memory of the electronic device and send the signals to the processor, the signals including computer instructions stored in the memory. When the processor executes the computer instructions, the electronic device executes the method described in the second aspect and any possible design manners thereof.
第八方面,本申请提供一种芯片系统,该芯片系统应用于AP。该芯片系统包括一个或多个接口电路和一个或多个处理器。该接口电路和处理器通过线路互联。该接口电路用于从电子设备的存储器接收信号,并向处理器发送该信号,该信号包括存储器中存储的计算机指令。当处理器执行所述计算机指令时,AP执行如第三方面及其任一种可能的设计方式所述的方法。In an eighth aspect, the present application provides a chip system, where the chip system is applied to an AP. The chip system includes one or more interface circuits and one or more processors. The interface circuit and the processor are interconnected by wires. The interface circuit is configured to receive signals from the memory of the electronic device and send the signals to the processor, the signals including computer instructions stored in the memory. When the processor executes the computer instructions, the AP executes the method described in the third aspect and any possible design manners thereof.
第九方面,本申请提供一种计算机存储介质,该计算机存储介质包括计算机指令,当所述计算机指令在电子设备上运行时,使得所述电子设备执行如第二方面及其任一种可能的设计方式所述的方法。In a ninth aspect, the present application provides a computer storage medium, the computer storage medium comprising computer instructions, when the computer instructions are executed on an electronic device, the electronic device is made to perform the second aspect and any one of its possible implementations. Design method described.
第十方面,本申请提供一种计算机存储介质,该计算机存储介质包括计算机指令,当所述计算机指令在AP上运行时,使得所述AP执行如第三方面及其任一种可能的设计方式所述的方法。In a tenth aspect, the present application provides a computer storage medium, the computer storage medium comprising computer instructions, when the computer instructions are executed on an AP, the AP is made to perform the third aspect and any possible design manner thereof the method described.
第十一方面,本申请提供一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如第一方面、第二方面或者第三方面及其任一种可能的设计方式所述的方法。In an eleventh aspect, the present application provides a computer program product, which, when the computer program product is run on a computer, causes the computer to perform the first aspect, the second aspect or the third aspect and any possible possibilities thereof. Design method described.
可以理解地,上述提供的第四方面所述的电子设备,第五方面所述的AP,第六方面所述的通信系统,第七方面和第八方面所述的芯片系统,第九方面和第十方面所述的计算机存储介质,第十一方面所述的计算机程序产品所能达到的有益效果,可参考如第一方面及其任一种可能的设计方式中的有益效果,此处不再赘述。It can be understood that the electronic device described in the fourth aspect, the AP described in the fifth aspect, the communication system described in the sixth aspect, the chip system described in the seventh aspect and the eighth aspect, the ninth aspect and the For the computer storage medium described in the tenth aspect, the beneficial effects that can be achieved by the computer program product described in the eleventh aspect can be referred to as the beneficial effects in the first aspect and any possible design methods thereof. Repeat.
附图说明Description of drawings
图1A为本申请实施例提供的一种电子设备与AP交互的流程图;FIG. 1A is a flowchart of interaction between an electronic device and an AP according to an embodiment of the present application;
图1B为本申请实施例提供的一种获取IP地址的方法流程图;1B is a flowchart of a method for obtaining an IP address provided by an embodiment of the present application;
图2A为本申请实施例提供的一种通信系统的组成示意图;2A is a schematic diagram of the composition of a communication system provided by an embodiment of the present application;
图2B为本申请实施例提供的另一种通信系统的组成示意图;FIG. 2B is a schematic diagram of the composition of another communication system provided by an embodiment of the present application;
图2C为本申请实施例提供的一种电子设备的硬件结构示意图;2C is a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present application;
图3为本申请实施例提供的另一种获取IP地址的方法流程图;3 is a flowchart of another method for obtaining an IP address provided by an embodiment of the present application;
图4为本申请实施例提供的一种帧结构的实例示意图;FIG. 4 is a schematic diagram of an example of a frame structure provided by an embodiment of the present application;
图5A为本申请实施例提供的另一种帧结构的实例示意图;5A is a schematic diagram of an example of another frame structure provided by an embodiment of the present application;
图5B为本申请实施例提供的另一种帧结构的实例示意图;5B is a schematic diagram of an example of another frame structure provided by an embodiment of the present application;
图6为本申请实施例提供的另一种帧结构的实例示意图;6 is a schematic diagram of an example of another frame structure provided by an embodiment of the present application;
图7为本申请实施例提供的另一种获取IP地址的方法流程图;7 is a flowchart of another method for obtaining an IP address provided by an embodiment of the present application;
图8A为本申请实施例提供的一种IP地址的获取装置的组成示意图;8A is a schematic diagram of the composition of an apparatus for obtaining an IP address provided by an embodiment of the present application;
图8B为本申请实施例提供的另一种IP地址的获取装置的组成示意图;8B is a schematic diagram of the composition of another apparatus for obtaining an IP address according to an embodiment of the present application;
图9为本申请实施例提供的一种芯片系统的结构组成示意图。FIG. 9 is a schematic structural composition diagram of a chip system according to an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。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. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.
本申请中字符“/”,一般表示前后关联对象是一种“或者”的关系。例如,A/B可以理解为A或者B。In this application, the character "/" generally indicates that the related objects before and after are an "or" relationship. For example, A/B can be understood as A or B.
术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。The terms "first" and "second" are only used for descriptive purposes, and should not 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 expressly or implicitly include one or more of that feature. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.
此外,本申请的描述中所提到的术语“包括”和“具有”以及它们的任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或模块的过程、方法、系统、产品或设备没有限定于已列出的步骤或模块,而是可选地还包括其他没有列出的步骤或模块,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或模块。Furthermore, references to the terms "comprising" and "having" in the description of this application, and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or modules is not limited to the listed steps or modules, but may optionally also include other unlisted steps or modules, or optionally also Other steps or modules inherent to these processes, methods, products or devices are included.
另外,在本申请实施例中,“示例性的”、或者“例如”等词用于表示作例子、例证或说明。本申请中被描述为“示例性的”或“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”、或者“例如”等词旨在以具体方式呈现概念。In addition, in the embodiments of the present application, words such as "exemplary" or "for example" are used to represent examples, illustrations or illustrations. Any embodiment or design described in this application as "exemplary" or "such as" should not be construed as preferred or advantageous over other embodiments or designs. Rather, use of words such as "exemplary" or "such as" is intended to present concepts in a specific manner.
随着科技的发展,越来越多的电子设备(例如手机、笔记本电脑等)通过无线保真(Wireless Fidelity,WIFI)技术进行无线通信。在电子设备连接WiFi的过程中,电子设备需要获取一个 IP地址,并通过该IP地址进行网络连接。With the development of science and technology, more and more electronic devices (such as mobile phones, notebook computers, etc.) perform wireless communication through wireless fidelity (Wireless Fidelity, WIFI) technology. In the process of connecting an electronic device to WiFi, the electronic device needs to obtain an IP address and perform network connection through the IP address.
常规技术中,在电子设备获取IP地址之前,电子设备需要与AP建立连接。示例性的,如图1A所示,电子设备可以执行扫描(Scanning,Scan)过程,即搜索距离电子设备较近的 WiFi热点。并且,AP可以广播信标Beacon帧,该Beacon帧包括:AP的服务区别号(Extended Service Set Identifier,ESSID)、AP的BSSID(即MAC地址)、加密方式(例如无密码、有线等效保密协议(Wired Equivalent Privacy,WEP)WEP加密、Wi-Fi网络安全接入(Wi-Fi Protected Access,WPA)或者WPA2加密)、传输速率等。之后,AP与电子设备可以执行认证(Authentication,Auth)过程(例如用户输入密码,AP进行验证的过程)。接着,AP与电子设备可以执行关联(Association,Assoc)过程。例如,该Assoc过程可以为:电子设备可以向AP发送关联请求帧;之后,AP可以将该电子设备的参数信息添加到数据库,并向电子设备发送关联响应。然后,AP与电子设备可以执行四次握手过程,以建立连接。In the conventional technology, before the electronic device obtains the IP address, the electronic device needs to establish a connection with the AP. Exemplarily, as shown in FIG. 1A , the electronic device may perform a scanning (Scanning, Scan) process, that is, search for WiFi hotspots that are close to the electronic device. In addition, the AP can broadcast a beacon Beacon frame, and the Beacon frame includes: the AP's Extended Service Set Identifier (ESSID), the AP's BSSID (that is, the MAC address), and the encryption method (for example, no password, Wired Equivalent Privacy Protocol) (Wired Equivalent Privacy, WEP) WEP encryption, Wi-Fi network security access (Wi-Fi Protected Access, WPA) or WPA2 encryption), transmission rate, etc. Afterwards, the AP and the electronic device may perform an authentication (Authentication, Auth) process (for example, a process in which the user enters a password and the AP performs authentication). Next, the AP and the electronic device may perform an association (Association, Assoc) process. For example, the Assoc process may be: the electronic device may send an association request frame to the AP; then, the AP may add parameter information of the electronic device to the database, and send an association response to the electronic device. Then, the AP and the electronic device can perform a four-way handshake process to establish a connection.
之后,电子设备可以通过动态主机配置协议(Dynamic Host ConfigurationProtocol,DHCP) 的四个阶段,获取IP地址。其中,该DHCP的四个阶段包括:发现阶段、提供阶段、选择阶段和确认阶段。示例性的,如图1B所示,电子设备(例如手机)可以广播DHCPDISCOVER 报文,以请求获取IP地址。其中,该DHCP DISCOVER报文包括:手机的IP地址、AP的IP地址、手机的MAC地址,手机的IP地址为0.0.0.0,AP的IP地址为255.255.255.255。之后,至少一个接收到DHCP DISCOVER报文,且能够提供IP地址的AP均会向手机发送DHCP OFFER报文。其中,该DHCP OFFER报文包括AP的IP地址、手机的IP地址、子网掩码、以及为手机提供的IP地址等信息。接着,手机可以接收到至少一个DHCP DISCOVER报文,并从多个DHCPOFFER报文中选择一个IP地址(通常选择第一个接收到的DHCP OFFER报文中携带的IP地址),广播DHCP REQUEST报文,以指示手机已获取到IP地址,该DHCP REQUEST报文中携带有手机获取的IP地址和提供该IP地址的AP的IP地址。然后,提供该IP地址的AP可以向手机发送DHCP ACK报文,以确认该IP地址。After that, the electronic device can obtain the IP address through the four stages of the Dynamic Host Configuration Protocol (Dynamic Host Configuration Protocol, DHCP). Among them, the four stages of the DHCP include: discovery stage, offer stage, selection stage and confirmation stage. Exemplarily, as shown in FIG. 1B , an electronic device (such as a mobile phone) may broadcast a DHCPDISCOVER message to request to obtain an IP address. 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. The IP address of the mobile phone is 0.0.0.0, and the IP address of the AP is 255.255.255.255. After that, at least one AP that receives the DHCP DISCOVER message and can provide an IP address will send a DHCP OFFER message to the mobile phone. The DHCP OFFER message includes information such as the IP address of the AP, the IP address of the mobile phone, the subnet mask, and the IP address provided for the mobile phone. Then, the mobile phone can receive at least one DHCP DISCOVER message, select an IP address from multiple DHCPOFFER messages (usually select the IP address carried in the first received DHCP OFFER message), and broadcast a DHCP REQUEST message , to indicate that the mobile phone has obtained an IP address, and the DHCP REQUEST message carries the IP address obtained by the mobile phone and the IP address of the AP that provides the IP address. Then, the AP that provides the IP address can send a DHCP ACK message to the mobile phone to confirm the IP address.
需要说明的是,具体对于电子设备通过DHCP获取IP地址的方式,可以参考开源协议(如 DHCP Server ver:4.2.5),此处不予赘述。It should be noted that, for a specific manner in which an electronic device obtains an IP address through DHCP, reference may be made to an open source protocol (eg, DHCP Server ver: 4.2.5), which will not be repeated here.
然而,上述常规技术中,电子设备需要经过上述四个阶段(发现阶段、提供阶段、选择阶段和确认阶段)才能够获取到IP地址。不仅过程较为繁琐,而且获取IP地址的速度较低。However, in the above-mentioned conventional technology, the electronic device needs to go through the above-mentioned four stages (discovery stage, provision stage, selection stage and confirmation stage) before it can obtain the IP address. Not only is the process more cumbersome, but also the speed of obtaining an IP address is low.
为此,本申请实施例提供了一种IP地址的获取方法,该方法应用于电子设备获取IP地址的过程中。该方法中,电子设备可以接收来自AP的IP地址,该IP地址为AP为电子设备分配的地址。之后,电子设备可以发送响应消息,以指示电子设备已经接收到该IP地址。也就是说,电子设备与AP之间仅需要两次交互,电子设备就可以获取IP地址。因此,本申请所提供的方法,能够简化电子设备与AP之间的交互过程,提高了电子设备获取IP地址的速度。To this end, an embodiment of the present application provides a method for obtaining an IP address, and the method is applied in a process of obtaining an IP address by an electronic device. In this method, the electronic device can receive an IP address from the AP, where the IP address is an address assigned by the AP to the electronic device. Afterwards, the electronic device may send a response message to indicate that the electronic device has received the IP address. That is to say, only two interactions are required between the electronic device and the AP, and the electronic device can obtain the IP address. Therefore, the method provided by the present application can simplify the interaction process between the electronic device and the AP, and improve the speed at which the electronic device obtains the IP address.
在具体介绍本申请实施例之前,先介绍应用于本申请实施例中的通信系统。Before introducing the embodiments of the present application in detail, a communication system applied to the embodiments of the present application is first introduced.
在一些实施例中,该通信系统可以包括一个电子设备和至少一个AP。示例性的,如图 2A所示,该通信系统包括电子设备(例如手机)201和AP202,手机201与AP202可以进行无线通信,且手机201与AP202之间的距离小于预设距离阈值。In some embodiments, the communication system may include an electronic device and at least one AP. Exemplarily, as shown in FIG. 2A, the communication system includes an electronic device (such as a mobile phone) 201 and an
在另一些实施例中,该通信系统多个电子设备和至少一个AP。示例性的,如图2B所示,该通信系统包括多个电子设备(例如手机201和手机203)和AP202,手机201和手机203均可以与AP202可以进行无线通信,且手机201与AP202之间的距离、手机203与AP202 之间的距离均小于预设距离阈值。In other embodiments, the communication system includes multiple electronic devices and at least one AP. Exemplarily, as shown in FIG. 2B , the communication system includes a plurality of electronic devices (such as a
示例性的,本申请实施例中的电子设备(也可以称为站点(Station,STA))可以是平板电脑、手机、桌面型、膝上型、手持计算机、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本,以及蜂窝电话、个人数字助理(personaldigital assistant, PDA)、增强现实(augmented reality,AR)\虚拟现实(virtualreality,VR)设备、车载设备等设备,本申请实施例对该电子设备的具体形态不作特殊限制。Exemplarily, the electronic device (also referred to as a Station (STA)) in this embodiment of the present application may be a tablet computer, a mobile phone, a desktop, a laptop, a handheld computer, a notebook computer, an ultra-mobile personal computer (ultra -mobile personal computer, UMPC), netbooks, and cellular phones, personal digital assistants (personal digital assistants, PDAs), augmented reality (augmented reality, AR) \ virtual reality (virtual reality, VR) devices, in-vehicle devices and other devices, this application implements For example, the specific form of the electronic device is not particularly limited.
本申请提供的IP地址的获取方法的执行主体可以为IP地址的获取装置,该执行装置可以为图2C所示的电子设备。同时,该执行装置还可以为该电子设备的中央处理器(Central Processing Unit,CPU),或者该电子设备中的用于获取IP地址的控制模块。本申请实施例中以电子设备执行IP地址的获取方法为例,说明本申请实施例提供的IP地址的获取方法。The executing subject of the IP address obtaining method provided by the present application may be an IP address obtaining device, and the executing device may be the electronic device shown in FIG. 2C . Meanwhile, the executing device may also be a central processing unit (Central Processing Unit, CPU) of the electronic device, or a control module in the electronic device for acquiring an IP address. In the embodiment of the present application, the method for obtaining the IP address provided by the embodiment of the present application is described by taking the method for obtaining an IP address performed by an electronic device as an example.
请参考图2C,本申请这里以电子设备为图2C所示的手机200(也可以是上述手机201 或者手机203)为例,对本申请提供的电子设备进行介绍。其中,图2C所示的手机200仅仅是电子设备的一个范例,并且手机200可以具有比图中所示出的更多的或者更少的部件,可以组合两个或更多的部件,或者可以具有不同的部件配置。图2C中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。Please refer to FIG. 2C . In this application, the electronic device provided by the present application is introduced by taking the electronic device as the mobile phone 200 shown in FIG. 2C (it may also be the above-mentioned
如图2C所示,手机200可以包括:处理器210,外部存储器接口220,内部存储器221,通用串行总线(universal serial bus,USB)接口230,充电管理模块240,电源管理模块241,电池242,天线1,天线2,移动通信模块250,无线通信模块260,音频模块270,扬声器270A,受话器270B,麦克风270C,耳机接口270D,传感器模块280,按键290,马达291,指示器292,摄像头293,以及显示屏294F等。As shown in FIG. 2C , the mobile phone 200 may include: a
其中,上述传感器模块280可以包括压力传感器,陀螺仪传感器,气压传感器,磁传感器,触摸传感器,环境光传感器和骨传导传感器等传感器。The aforementioned sensor module 280 may include sensors such as a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, a touch sensor, an ambient light sensor, and a bone conduction sensor.
处理器210可以包括一个或多个处理单元,例如:处理器210可以包括应用处理器(application processor,AP),调制解调处理器,基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The
处理器210中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器210 中的存储器为高速缓冲存储器。该存储器可以保存处理器210刚用过或循环使用的指令或数据。如果处理器210需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器210的等待时间,因而提高了系统的效率。A memory may also be provided in the
在一些实施例中,处理器210可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, the
可以理解的是,本实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对手机200的结构限定。在另一些实施例中,手机200也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that, the interface connection relationship between the modules illustrated in this embodiment is only a schematic illustration, and does not constitute a structural limitation of the mobile phone 200 . In other embodiments, the mobile phone 200 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
充电管理模块240用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。充电管理模块240为电池242充电的同时,还可以通过电源管理模块241 为电子设备供电。The
电源管理模块241用于连接电池242,充电管理模块240与处理器210。电源管理模块 241接收电池242和/或充电管理模块240的输入,为处理器210,内部存储器221,外部存储器,显示屏294,摄像头293,和无线通信模块260等供电。在一些实施例中,电源管理模块241和充电管理模块240也可以设置于同一个器件中。The
手机200的无线通信功能可以通过天线1,天线2,移动通信模块250,无线通信模块260,调制解调处理器以及基带处理器等实现。在一些实施例中,手机200的天线1和移动通信模块250耦合,天线2和无线通信模块260耦合,使得手机200可以通过无线通信技术与网络以及其他设备通信。例如,本申请实施例中,手机200可以通过无线通信技术接收来自AP的消息。The wireless communication function of the mobile phone 200 can be realized by the
无线通信模块260可以提供应用在手机200上的包括无线局域网(wireless localarea networks,WLAN)(如(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT)等无线通信的解决方案。例如,本申请实施例中,手机200可以通过无线通信模块260接入WiFi网络。The
无线通信模块260可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块 260经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器210。无线通信模块260还可以从处理器210接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The
手机200通过GPU,显示屏294,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏294和应用处理器。显示屏294用于显示图像,视频等。该显示屏294包括显示面板。The mobile phone 200 realizes 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 the application processor. Display screen 294 is used to display images, videos, and the like. The display screen 294 includes a display panel.
外部存储器接口220可以用于连接外部存储卡,例如Micro SD卡,实现扩展手机200的存储能力。外部存储卡通过外部存储器接口220与处理器210通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The
内部存储器221可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器210通过运行存储在内部存储器221的指令,从而执行手机200的各种功能应用以及数据处理。例如,在本申请实施例中,处理器210可以通过执行存储在内部存储器221中的指令,内部存储器221可以包括存储程序区和存储数据区。
手机200可以通过音频模块270,扬声器270A,受话器270B,麦克风270C,耳机接口270D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The mobile phone 200 can implement audio functions through an
按键290包括开机键,音量键等。按键290可以是机械按键。也可以是触摸式按键。The keys 290 include a power-on key, a volume key, and the like. Keys 290 may be mechanical keys. It can also be a touch key.
尽管图2C未示出,手机200还可以闪光灯、微型投影装置、近场通信(Near FieldCommunication,NFC)装置等,在此不再赘述。Although not shown in FIG. 2C , the mobile phone 200 may also use a flashlight, a pico-projection device, a near field communication (Near Field Communication, NFC) device, etc., which will not be repeated here.
以下实施例中的方法均可以在上述系统架构和具有上述硬件结构的电子设备中实现。The methods in the following embodiments can all be implemented in the above-mentioned system architecture and the electronic device having the above-mentioned hardware structure.
在一些实施例中,AP可以与至少一个电子设备进行交互,该AP可以广播携带指示信息的Beacon帧(例如预设Beacon帧),该指示信息用于指示AP具备主动发送AP为电子设备分配的IP地址的能力,该至少一个电子设备中的每个电子设备均可以识别该指示信息。之后,上述任一电子设备可以获取来自AP的指示信息。之后,AP可以发送该第一IP地址,该第一IP地址是AP为电子设备分配的IP地址。然后,电子设备可以接收来自AP的第一IP地址,并回复响应消息,以指示电子设备已经接收到第一IP地址。In some embodiments, the AP can interact with at least one electronic device, and the AP can broadcast a Beacon frame (for example, a preset Beacon frame) carrying indication information, and the indication information is used to indicate that the AP has the ability to actively send the information allocated by the AP to the electronic device. IP address capability, each of the at least one electronic device can identify the indication information. Afterwards, any of the above-mentioned electronic devices can acquire the indication information from the AP. Afterwards, the AP may send the first IP address, where the first IP address is the IP address assigned by the AP to the electronic device. Then, the electronic device may receive the first IP address from the AP, and reply with a response message to indicate that the electronic device has received the first IP address.
需要说明的是,AP具备主动发送AP为电子设备分配的IP地址的能力,是指:AP在未接收到任何指示消息(例如DHCP DISCOVER报文)的情况下,可以主动发送AP为电子设备分配的IP地址。如此,能够简化电子设备获取IP地址的过程,进而可以提高电子设备获取IP地址的速度。It should be noted that the AP has the ability to actively send the IP address allocated by the AP to the electronic device, which means that the AP can actively send the AP to allocate the electronic device without receiving any indication message (such as a DHCP DISCOVER message). IP address. In this way, the process of acquiring the IP address by the electronic device can be simplified, and further, the speed of acquiring the IP address by the electronic device can be improved.
示例性的,以图2A所示的应用场景为例,即电子设备为手机201,AP为AP202为例,介绍本申请实施例提供的一种IP地址的获取方法。其中,AP202可以发送携带指示信息的预设Beacon帧,手机201可以识别AP202发送的指示信息。如图3所示,该IP地址的获取方法可以包括:S301-S307。Illustratively, taking the application scenario shown in FIG. 2A as an example, that is, the electronic device is the
S301、AP202广播预设Beacon帧。S301 and AP202 broadcast the preset Beacon frame.
其中,预设Beacon帧包括指示信息,该指示信息用于指示AP202具备主动发送AP202 为手机201分配的IP地址的能力。示例性的,假如上述指示信息的字段名称为“FASTIE”,上述指示信息的值为1(例如图4所示)。The preset Beacon frame includes indication information, and the indication information is used to indicate that the
在本申请实施例中,AP202可以周期性广播预设Beacon帧。示例性的,AP202可以每间隔预设时长a广播一次预设Beacon帧。例如,上述预设时长a可以为0.01秒、0.1秒或者1秒等,本申请实施例对预设时长a不作限定。In this embodiment of the present application, the
在本申请实施例中,AP202广播预设Beacon帧之前,手机201可以与AP202建立连接。其中,手机201与AP202建立连接之后,AP202能够为手机201分配IP地址。In this embodiment of the present application, before the AP202 broadcasts the preset Beacon frame, the
需要说明的是,手机201与AP202建立连接的过程,可以参考上述对图1A的介绍,此处不予赘述。It should be noted that, for the process of establishing the connection between the
S302、手机201接收来自AP202的预设Beacon帧。S302, the
在本申请实施例中,手机201可以识别预设Beacon帧中的指示信息。也就是说,手机 201可以解析预设Beacon帧,确定AP202是否具备主动发送AP202为手机201分配的IP地址的能力。In this embodiment of the present application, the
在一些实施例中,若预设Beacon帧中存在指示信息,手机201则可以确定AP202能够主动发送第一IP地址,手机201则可以执行S303。In some embodiments, if there is indication information in the preset Beacon frame, the
在另一些实施例中,在手机201接收来自AP202的预设Beacon帧之后,手机201根据指示信息确定AP202是否具备主动发送AP202为手机201分配的IP地址的能力。其中,指示信息包括第一数值或第二数值。第一数值和第二数值可以为任意两个不相同的值。例如,该第一数值可以为1,第二数值可以为0。In other embodiments, after the
一种可能的设计中,当指示信息包括第一数值,手机201则可以确定AP202具备主动发送AP202为手机201分配的IP地址的能力,手机201则可以执行S303。当指示信息包括第二数值,手机201则可以确定AP202不具备主动发送AP202为手机201分配的IP地址的能力,手机201则可以向AP202发送DHCP DISCOVER报文。也就是说,手机201可以基于 DHCP获取第一IP地址。具体对于手机201通过常规技术中DHCP的四个阶段(即发现阶段、提供阶段、选择阶段和确认阶段),获取第一IP地址的说明,可以参考上述实施例对于图1B 的介绍,此处不予赘述。In a possible design, when the indication information includes the first value, the
需要说明的是,在手机201接收来自AP202的预设Beacon帧后,手机201与AP202可以执行Auth过程、Assoc过程和四次握手过程。具体对于Auth过程、Assoc过程和四次握手过程的说明,可以参考上述实施例中对于图1A的介绍,以及常规技术中对Auth过程、Assoc 过程和四次握手过程的介绍,此处不予赘述。It should be noted that, after the
需要说明的是,由于AP202能够主动发送第一IP地址。本申请实施例中,在手机201执行完Auth过程、Assoc过程和四次握手过程之后,手机201则无需发送DHCP DISCOVER 报文。It should be noted that, because the
S303、手机201启动预设端口监听。S303, the
其中,该预设端口用于接收来自AP202的第一IP地址。Wherein, the preset port is used to receive the first IP address from AP202.
需要说明的是,本申请实施例对手机201中的预设端口不作限定。也就是说,手机201 中的任一端口均可以为预设端口,以获取第一IP地址。It should be noted that, the embodiment of the present application does not limit the preset ports in the
在一些实施例中,该预设端口可以由AP202指定。具体的,上述Beacon帧还可以包括端口号,该端口号用于标识预设端口。示例性的,假如上述预设Beacon帧包括一个端口号,端口号的字段名称为“Fast Port”,端口号的值为“8899”(例如图5A所示),则该预设端口可以为电子设备中的端口8899。可选的,上述预设Beacon帧可以包括多个端口号,每个端口号对应一个预设端口。例如,假如端口号的字段名称为“Fast Port”,端口号的值为“8899, 25,68”(例如图5B所示),则预设端口可以为电子设备中的端口8899、端口25和端口68。In some embodiments, the preset port may be specified by
在手机201接收到来自AP202的预设Beacon帧之后,手机201可以得到端口号。接着,手机201可以确定端口号对应的预设端口,并启动该预设端口进行监听,以获取第一IP地址。例如,假如手机201接收到如图5A所示的预设Beacon帧,即端口号的值为“8899”,且假设端口号的值为“8899”的端口为端口a。手机201则可以启动端口a进行监听。也就是说,手机201可以通过端口a获取第一IP地址。又例如,假如手机201接收到如图5B所示的预设Beacon帧,即端口号的值为“8899,25,68”,且假设端口号的值为“8899”的端口为端口a,端口号的值为“25”的端口为端口b,端口号的值为“68”的端口为端口c。手机201 则可以启动端口a、端口b和端口c同时进行监听。也就是说,手机201可以通过端口a、端口b和端口c中任一端口均可以获取AP202分配的第一IP地址。After the
在另一些实施例中,该预设端口可以由手机201指定。示例性的,在手机201出厂时,工作人员可以配置手机201中的至少一个端口为预设端口,以获取第一IP地址。例如,该预设端口可以为手机201中的端口a。又例如,该预设端口可以为手机201中的端口a、端口b和端口c。In other embodiments, the preset port may be designated by the
在本申请实施例中,手机201可以在以下时机a、时机b、时机c或者时机d启动预设端口监听,以获取第一IP地址。In this embodiment of the present application, the
时机a,手机201可以在接收到来自AP202的预设Beacon帧后,启动预设端口监听。例如,手机201接收到如图5A所示的预设Beacon帧后,可以启动端口a监听。At timing a, the
时机b,手机201可以在手机201与AP202进行Auth的过程中,启动预设端口监听。或者,手机201可以在手机201与AP202完成Auth后,启动预设端口监听。At timing b, the
时机c,手机201可以在手机201与AP202进行Assoc的过程中,启动预设端口监听。或者,手机201可以在手机201与AP202完成Assoc后,启动预设端口监听。At timing c, the
时机d,手机201可以在手机201与AP202进行四次握手的过程中,启动预设端口监听。或者,手机201可以在手机201与AP202完成四次握手后,启动预设端口监听。以下实施例中,以手机201在时机a启动预设端口监听,即手机201在接收到来自AP202的预设Beacon 帧后,启动预设端口监听为例,介绍本申请实施例的方法。At timing d, the
S304、AP202发送第一IP地址。S304. The
其中,该第一IP地址为AP202为手机201分配的第一IP地址。The first IP address is the first IP address allocated by the
在本申请实施例中,AP202可以通过以下方式发送第一IP地址。In this embodiment of the present application, the
方式一,AP202可以向手机201发送动作Action帧,该Action帧包括第一IP地址。可选的,该Action帧还包括:AP202的IP地址和子网掩码等信息。示例性的,假如第一IP地址的字段名称为“Fast IP”,第一IP地址的值为“192.168.1.1”(例如图6所示)。
方式二,AP202可以通过用户数据报协议(User Datagram Protocol,UDP)广播第一IP 地址。In a second manner, the
方式三,AP202可以通过UDP广播携带有第一IP地址的消息。具体的,AP202可以UDP广播第一消息,该第一消息包括第一IP地址。可选的,该第一消息还包括:AP202的IP地址和子网掩码等信息。以下实施例中,以AP202通过UDP广播第一IP地址为例,介绍本申请实施例的方法。In a third way, the
可以理解的是,AP202无需接收手机201发送的指示消息(DHCP DISCOVER报文),就可以向手机201发送第一IP地址。如此,可以减少在手机201获取第一IP地址的过程中,AP202等待接收DHCP DISCOVER报文所耗费的时间,提高了手机201获取第一IP地址的速度。It can be understood that the
需要说明的是,AP202在准备发送第一IP地址时,可能还会需要发送其他的消息。如此,可能会导致AP202在发送完其他的消息后,再发送该第一IP地址,延长了AP202发送第一 IP地址的时间。It should be noted that, when the
在一些实施例中,为了减少AP202等待发送第一IP地址的时间,AP202可以提升发送第一IP地址的优先级,使AP202可以优先发送第一IP地址。具体的,AP202包括多个队列,多个队列中的每个队列的优先级不同,优先级用于指示AP202处理多个队列中不同队列的顺序。其中,AP202处理队列为AP202发送队列中的数据。也就是说,当队列的优先级较高时,AP202可以优先发送该队列中的数据。In some embodiments, in order to reduce the time for the
在AP202发送第一IP地址之前,AP202可以将第一IP地址加入第一队列,该第一队列为多个队列中优先级最高的队列。之后,AP202可以按照队列优先级从高到低的顺序,发送队列中的数据。Before the
需要说明的是,AP202也可以将第一消息或者Action帧(即上述方式一和方式三)加入第一队列,本申请实施例对此不作限定。It should be noted that the
可以理解的是,AP202将第一IP地址加入WiFi高优先队列,能够提高第一IP地址抢占空口的能力,减少AP202等待发送第一IP地址的时间,进而提高手机201获取第一IP地址的速度。It can be understood that, adding the first IP address to the WiFi high-priority queue by the
当然,AP202发送第一IP地址时,可能存在发送失败的情况。这样一来,即使AP202发送了第一IP地址,手机201也无法获取到第一IP地址。Of course, when the
在一些实施例中,为了保障AP202能够成功发送第一IP地址,AP202可以周期性发送该第一IP地址。具体的,AP202可以每间隔第一预设时长发送一次第一IP地址。其中,本申请实施例对该第一预设时长不作限定。例如,该第一预设时长可以为0.05秒。又例如,该第一预设时长可以为0.1秒。In some embodiments, in order to ensure that the
需要说明的是,AP202也可以周期性发送第一消息和Action帧(即上述方式一和方式三),本申请实施例对此不作限定。It should be noted that the
可以理解的是,AP202通过多次发送第一IP地址,可以提高AP202发送第一IP地址的成功率。如此,能够减少手机201获取第一IP地址的时间,提高了手机201获取第一IP地址的速度。It can be understood that, by sending the first IP address multiple times by the
S305、手机201接收第一IP地址。S305. The
在一些实施例中,当AP202发送向手机201发送Action帧(即上述方式一)时,手机201可以通过预设端口接收该Action帧,以获取第一IP地址。当AP202通过UDP广播第一 IP地址(即上述方式二)时,手机201可以通过预设端口接收第一IP地址。当AP202通过 UDP广播携带有第一IP地址的消息(即上述方式三)时,手机201可以通过预设端口接收该第一消息,以获取第一IP地址。In some embodiments, when the
S306、手机201发送第一响应消息。S306, the
其中,该第一响应消息用于指示手机201已经接收到该第一IP地址。The first response message is used to indicate that the
在一些实施例中,若AP202以方式一发送第一IP地址,即AP202向手机201发送Action 帧,则在手机201接收到该Action帧后,手机201可以向AP发送Action确认信息。In some embodiments, if the
在另一些实施例中,若AP202以方式二(或者方式三)发送第一IP地址,即AP202通过UDP广播第一IP地址,则在手机201接收到该第一IP地址后,手机201可以通过UDP 广播确认字符(Acknowledge character,ACK)。In other embodiments, if the
在一些实施例中,在手机201发送第一响应消息之后,手机201可以停止预设端口监听。In some embodiments, after the
可以理解的是,在手机201获取到第一IP地址之后,手机201无需获取IP地址。因此,手机201可以停止预设端口监听,以降低手机201的功耗。It can be understood that, after the
S307、AP202接收第一响应消息。S307. The
在一些实施例中,若AP202在周期性发送第一IP地址,则在AP202接收到第一响应消息之后,AP202可以停止发送第一IP地址。In some embodiments, if the
基于上述技术方案,AP202可以广播携带有指示信息的预设Beacon帧,以指示该AP202 能够主动发送第一IP地址。之后,手机201可以启动预设端口监听。在WIFi链路层建立(即图1A所示的Auth过程、Assoc过程和四次握手过程)后,AP202可以发送第一IP地址。在手机201接收到第一IP地址后,可以向AP202发送第一响应消息,以指示手机201已经接收到该第一IP地址。如此,相较于常规技术中手机201通过DHCP的四个阶段获取IP地址,本申请实施例中简化了手机201获取IP地址的过程。如此,能够提高手机201获取IP地址的速度,进而减少手机201连接WiFi耗费的时间,提升了用户的使用体验。Based on the above technical solution, the
在另一些实施例中,若AP202不能广播携带有指示信息的预设Beacon帧,即AP202发送的为常规技术中的Beacon帧,则手机201接收该Beacon帧之后,确认该Beacon帧中未携带有上述指示信息,即AP202不能够主动发送第一IP地址。之后,手机201可以通过常规技术中DHCP的四个阶段,获取第一IP地址。具体对于手机201通过常规技术中DHCP的四个阶段(即发现阶段、提供阶段、选择阶段和确认阶段),获取第一IP地址的说明,可以参考上述实施例对于图1B的介绍,此处不予赘述。In other embodiments, if the
在另一些实施例中,AP可以与多个电子设备进行交互,该AP可以广播携带指示信息的预设Beacon帧,该多个电子设备包括:可以识别指示信息的电子设备和不能识别指示信息的电子设备。In other embodiments, the AP can interact with multiple electronic devices, the AP can broadcast a preset Beacon frame carrying the indication information, and the multiple electronic devices include: an electronic device that can recognize the indication information and an electronic device that cannot recognize the indication information. Electronic equipment.
示例性的,以图2B所示的应用场景为例,即多个电子设备包括手机201和手机203,AP 为AP202为例,介绍本申请实施例提供的一种IP地址的获取方法。其中,手机201为可以识别指示信息的电子设备,手机203为不能识别指示信息的电子设备,AP202为可以广播上述预设Beacon帧的AP。如图7所示,在S301之后,该IP地址的获取方法可以包括:S701-S705。2B is taken as an example, that is, multiple electronic devices include
需要说明的是,手机201获取IP地址的方式,可以参考上述S301-S307中的方法,此处不予赘述。It should be noted that, for the manner in which the
S701、手机203接收来自AP202的预设Beacon帧。S701, the
在本申请实施例中,手机203不能识别预设Beacon帧中的指示信息。也就是说,手机 203无法确定AP202是否能够主动发送第一IP地址。并且,手机203也无法启动预设端口监听。In this embodiment of the present application, the
一种可能的设计中,若手机203不能识别预设Beacon帧中的指示信息,手机203则执行 S702。In a possible design, if the
需要说明的是,在手机201接收来自AP202的预设Beacon帧后,手机201与AP202可以执行Auth过程、Assoc过程和四次握手过程。具体对于Auth过程、Assoc过程和四次握手过程的说明,可以参考上述实施例中对于图1A的介绍,以及常规技术中对Auth过程、Assoc 过程和四次握手过程的介绍,此处不予赘述。It should be noted that, after the
S702、手机203广播DHCP DISCOVER报文。S702, the
其中,该DHCP DISCOVER报文用于请求获取第一IP地址。Wherein, the DHCP DISCOVER message is used to request to obtain the first IP address.
S703、AP202向手机203发送DHCP OFFER报文。S703 , the
其中,该DHCP OFFER报文包括AP的IP地址、目标IP地址、第一IP地址和子网掩码等信息。The DHCP OFFER message includes information such as the IP address, target IP address, first IP address, and subnet mask of the AP.
S704、手机203广播DHCP REQUEST报文。S704, the
其中,该DHCP REQUEST报文用于指示手机203已经获取到第一IP地址。The DHCP REQUEST message is used to indicate that the
S705、AP202向手机203发送DHCP ACK报文。S705 , the
其中,该DHCP ACK报文用于确认该第一IP地址。The DHCP ACK message is used to confirm the first IP address.
需要说明的是,具体对于上述S702-S704中DHCP四个阶段的介绍,可以参考常规技术中电子设备通过DHCP获取IP地址的方法,此处不予赘述。It should be noted that, for the specific introduction of the four stages of DHCP in the above S702-S704, reference may be made to the method for obtaining an IP address by an electronic device through DHCP in the conventional technology, which will not be repeated here.
基于上述技术方案,若手机201能够识别预设Beacon帧,手机201则无需发送DHCPDISCOVER报文。手机201可以接收到AP202主动发送的第一IP地址。若手机203不能识别预设Beacon帧,手机203则发送DHCP DISCOVER报文,以获取第一IP地址。如此,任一电子设备(能够识别预设Beacon帧的电子设备和不能识别预设Beacon帧的电子设备)均可以获取来自AP202的IP地址。Based on the above technical solution, if the
上述主要从电子设备的角度对本申请实施例提供的方案进行了介绍。可以理解的是,电子设备为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本申请所公开的实施例描述的各示例的一种IP地址的获取方法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是电子设备软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。The solutions provided by the embodiments of the present application have been introduced above mainly from the perspective of electronic devices. It can be understood that, in order to realize the above-mentioned functions, the electronic device includes corresponding hardware structures and/or software modules for executing each function. Those skilled in the art should easily realize that the steps of a method for obtaining an IP address in each example described in conjunction with the embodiments disclosed in this application can be implemented in hardware or in a combination of hardware and computer software. Whether a function is performed by hardware or electronic device software driving hardware depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.
本申请实施例可以根据上述方法示例对一种IP地址的获取装置进行功能模块或者功能单元的划分,例如,可以对应各个功能划分各个功能模块或者功能单元,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块或者功能单元的形式实现。其中,本申请实施例中对模块或者单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In this embodiment of the present application, a device for obtaining an IP address may be divided into functional modules or functional units according to the foregoing method examples. For example, each functional module or functional unit may be divided according to each function, or two or more The functions are integrated in a processing module. The above-mentioned integrated modules can be implemented in the form of hardware, and can also be implemented in the form of software function modules or functional units. Wherein, the division of modules or units in the embodiments of the present application is schematic, and is only a logical function division, and there may be other division manners in actual implementation.
请参考图8A,其示出本申请实施例提供的一种IP地址的获取装置的示意图。该IP地址的获取装置可以是上述电子设备(如手机200)中,用于实现本申请实施例的方法的功能模块。如图8A所示,该IP地址的获取装置可以包括:接收单元801、处理单元802和发送单元803。Please refer to FIG. 8A , which shows a schematic diagram of an apparatus for acquiring an IP address provided by an embodiment of the present application. The apparatus for obtaining the IP address may be a functional module in the above-mentioned electronic device (eg, the mobile phone 200 ) for implementing the method of the embodiment of the present application. As shown in FIG. 8A , the apparatus for obtaining the IP address may include: a receiving
其中,接收单元801用于支持手机200执行:接收来自其他设备的信息。例如,接收单元801用于支持手机200执行上述方法实施例中的S302,S305,和/或用于本文所描述的技术的其它过程。The receiving
处理单元802用于支持手机200执行:确定其他设备是否能够主动发送第一IP地址。例如,处理单元802用于支持手机200执行上述方法实施例中的S303,和/或用于本文所描述的技术的其它过程。The
发送单元803用于支持手机200执行:向其他设备发送信息。例如,发送单元803用于支持手机200执行上述方法实施例中的S306,和/或用于本文所描述的技术的其它过程。The sending
本申请另一些实施例提供了一种电子设备(如图2C所示的手机200),该电子设备可以包括:存储器和一个或多个处理器。该存储器和处理器耦合。该电子设备还可以包括摄像头。或者,该电子设备可以外接摄像头。该存储器用于存储计算机程序代码,该计算机程序代码包括计算机指令。当处理器执行计算机指令时,电子设备可执行上述方法实施例中手机执行的各个功能或者步骤。该电子设备的结构可以参考图2C所示的手机200的结构。Other embodiments of the present application provide an electronic device (such as the mobile phone 200 shown in FIG. 2C ), the electronic device may include: a memory and one or more processors. The memory is coupled to the processor. The electronic device may also include a camera. Alternatively, the electronic device may be externally connected to a camera. The memory is used to store computer program code comprising computer instructions. When the processor executes the computer instructions, the electronic device can execute various functions or steps executed by the mobile phone in the foregoing method embodiments. For the structure of the electronic device, reference may be made to the structure of the mobile phone 200 shown in FIG. 2C .
请参考图8B,其示出本申请实施例提供的另一种IP地址的获取装置的示意图。该IP地址的获取装置可以是上述电子设备(如AP202)中,用于实现本申请实施例的方法的功能模块。如图8B所示,该IP地址的获取装置可以包括:接收单元804和发送单元805。Please refer to FIG. 8B , which shows a schematic diagram of another apparatus for obtaining an IP address provided by an embodiment of the present application. The apparatus for obtaining the IP address may be a functional module in the above-mentioned electronic device (eg, AP 202 ) for implementing the method of the embodiment of the present application. As shown in FIG. 8B , the apparatus for obtaining the IP address may include: a receiving
其中,接收单元804用于支持AP202执行:接收来自其他设备的信息。例如,接收单元 804用于支持AP202执行上述方法实施例中的S307,和/或用于本文所描述的技术的其它过程。The receiving
发送单元805用于支持AP202执行:向其他设备发送信息。例如,发送单元805用于支持AP202执行上述方法实施例中的S301,S304,S703,S705,和/或用于本文所描述的技术的其它过程。The sending
本申请另一些实施例提供了一种AP,该AP可以包括:存储器和一个或多个处理器。该存储器和处理器耦合。存储器用于存储计算机程序代码,该计算机程序代码包括计算机指令。当处理器执行计算机指令时,AP可执行上述方法实施例中手机执行的各个功能或者步骤。Other embodiments of the present application provide an AP, where the AP 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 including computer instructions. When the processor executes the computer instructions, the AP can execute various functions or steps executed by the mobile phone in the foregoing method embodiments.
本申请实施例还提供一种芯片系统,如图9所示,该芯片系统包括至少一个处理器901 和至少一个接口电路902。处理器901和接口电路902可通过线路互联。例如,接口电路902 可用于从其它装置(例如电子设备的存储器)接收信号。又例如,接口电路902可用于向其它装置(例如处理器901)发送信号。示例性的,接口电路902可读取存储器中存储的指令,并将该指令发送给处理器901。当所述指令被处理器901执行时,可使得电子设备(如图2C所示的手机200)或者AP执行上述实施例中的各个步骤。当然,该芯片系统还可以包含其他分立器件,本申请实施例对此不作具体限定。An embodiment of the present application further provides a chip system. As shown in FIG. 9 , the chip system includes at least one
本申请实施例还提供一种计算机存储介质,该计算机存储介质包括计算机指令,当所述计算机指令在上述电子设备(如图2C所示的手机200)上运行时,使得该电子设备执行上述方法实施例中手机执行的各个功能或者步骤。An embodiment of the present application further provides a computer storage medium, where the computer storage medium includes computer instructions, when the computer instructions are executed on the above electronic device (the mobile phone 200 shown in FIG. 2C ), the electronic device is made to execute the above method. Each function or step performed by the mobile phone in the embodiment.
本申请实施例还提供一种计算机存储介质,该计算机存储介质包括计算机指令,当所述计算机指令在上述AP上运行时,使得该AP执行上述方法实施例中手机执行的各个功能或者步骤。Embodiments of the present application further provide a computer storage medium, where the computer storage medium includes computer instructions, when the computer instructions are executed on the AP, the AP enables the AP to perform various functions or steps performed by the mobile phone in the above method embodiments.
本申请实施例还提供一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行上述方法实施例中手机执行的各个功能或者步骤。Embodiments of the present application further provide a computer program product, which, when the computer program product runs on a computer, enables the computer to perform various functions or steps performed by the mobile phone in the above method embodiments.
通过以上实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。From the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of the description, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions can be allocated by Different functional modules are completed, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be Incorporation may either be integrated into another device, or some features may be omitted, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place, or may be distributed to multiple different places . Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等) 或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, which are stored in a storage medium , including several instructions to make a device (which may be a single-chip microcomputer, a chip, etc.) or a processor (processor) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a removable hard disk, a read only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk and other media that can store program codes.
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above contents are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the present application should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims (17)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110437395.1A CN113114798B (en) | 2021-04-22 | 2021-04-22 | A method and electronic device for obtaining an Internet Protocol IP address |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110437395.1A CN113114798B (en) | 2021-04-22 | 2021-04-22 | A method and electronic device for obtaining an Internet Protocol IP address |
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 | A method and electronic device for obtaining an Internet Protocol IP address |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113114798B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114363394A (en) * | 2021-12-23 | 2022-04-15 | 杭州当虹科技股份有限公司 | Edge device discovery method based on BUSYBOX |
Citations (2)
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 IP network data interaction |
Family Cites Families (7)
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 equipment |
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 |
-
2021
- 2021-04-22 CN CN202110437395.1A patent/CN113114798B/en active Active
Patent Citations (2)
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 IP network data interaction |
Also Published As
Publication number | Publication date |
---|---|
CN113114798A (en) | 2021-07-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3893109B1 (en) | Method and device for connecting bluetooth devices | |
EP3537742B1 (en) | Method and apparatus for discovering a device in a wireless communication network | |
EP2387205B1 (en) | Method and System for Providing Wi-Fi Service by Wi-Fi Device | |
EP4145879B1 (en) | Wi-fi hotspot connection method and terminal | |
US10193933B2 (en) | System and method for post-discovery communication within a neighborhood-aware network | |
CN114697929B (en) | Connection establishment method and electronic device | |
CN111615220B (en) | Device connection method and device based on neighbor-aware network | |
CN113038627B (en) | File sharing method, mobile device and computer storage medium | |
US20240090049A1 (en) | Method and apparatus for establishing bluetooth link, device, and storage medium | |
KR102036686B1 (en) | Apparatus and method for selecting channel in wireless communication system | |
CN110870353B (en) | A method and terminal for WiFi connection | |
WO2021138914A1 (en) | Method and apparatus for indicating data transmission, communication device and storage medium | |
CN113114798B (en) | A method and electronic device for obtaining an Internet Protocol IP address | |
CN112469014A (en) | Method and electronic equipment for configuring Bluetooth connection parameters | |
KR20130043336A (en) | Display device, and access point connection method of a display device | |
WO2022160967A1 (en) | Communication method, mobile device, electronic device, and computer-readable storage medium | |
CN114698060B (en) | Method and device for quickly discovering wireless access point | |
JP7278087B2 (en) | COMMUNICATION DEVICE, CONTROL METHOD THEREOF, AND PROGRAM | |
CN117715149B (en) | Processing method and device in router connection | |
CN116782234B (en) | WiFi connection method and related equipment | |
KR102170409B1 (en) | Method and apparatus for providing ip address in wireless communication network | |
CN119450644A (en) | A method and device for establishing a Wi-Fi point-to-point connection | |
CN118714549A (en) | Mobile hotspot control method and electronic device | |
WO2024093597A1 (en) | Method for configuring a plurality of devices, device, and system |
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 | ||
CP03 | Change of name, title or address | ||
CP03 | Change of name, title or address |
Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040 Patentee after: Honor Terminal Co.,Ltd. Country or region after: China Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong Patentee before: Honor Device Co.,Ltd. Country or region before: China |