WO2018103447A1 - Method and device for enabling wi-fi/hotspot - Google Patents

Method and device for enabling wi-fi/hotspot Download PDF

Info

Publication number
WO2018103447A1
WO2018103447A1 PCT/CN2017/105509 CN2017105509W WO2018103447A1 WO 2018103447 A1 WO2018103447 A1 WO 2018103447A1 CN 2017105509 W CN2017105509 W CN 2017105509W WO 2018103447 A1 WO2018103447 A1 WO 2018103447A1
Authority
WO
WIPO (PCT)
Prior art keywords
socket connection
target firmware
wifi
hotspot
firmware
Prior art date
Application number
PCT/CN2017/105509
Other languages
French (fr)
Chinese (zh)
Inventor
蒋世民
黄园
Original Assignee
广东欧珀移动通信有限公司
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
Priority to CN201611119593.9A priority Critical patent/CN106686627B/en
Priority to CN201611119593.9 priority
Application filed by 广东欧珀移动通信有限公司 filed Critical 广东欧珀移动通信有限公司
Publication of WO2018103447A1 publication Critical patent/WO2018103447A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/02Arrangements for optimising operational condition
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup

Abstract

Disclosed in the embodiments of the present invention is a method for enabling Wi-Fi/a hotspot, the method comprising: receiving a Wi-Fi/hotspot enabling instruction, reading a configuration file corresponding to the Wi-Fi/hotspot enabling instruction to determine a target firmware corresponding to the Wi-Fi/hotspot enabling instruction and loading same; establishing a socket connection with the target firmware; if the socket connection establishment fails, acquiring a history loading period corresponding to the target firmware, calculating the average loading period with the history loading period; and determining on the next occasion, according to the average loading period, a first execution time for establishing a socket connection with the target firmware, establishing a socket connection with the target firmware when the first execution time is reached. Also, further provided in the embodiments of the present invention is a device for enabling the Wi-Fi/hotspot. The embodiments of the present invention can improve the speed of enabling the Wi-Fi/hotspot.

Description

WiFi/热点的开启方法及装置WiFi/hotspot opening method and device 技术领域Technical field
本发明涉及计算机技术领域,尤其涉及一种WiFi/热点的开启方法及装置。The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for enabling a WiFi/hotspot.
背景技术Background technique
目前大部分移动终端平台(ISO平台或者Android平台等),均配备了Wifi芯片,同时支持连接路由器上网(即STA模式)或者作为WiFi热点供他人连接(即AP模式,Access Point)。At present, most mobile terminal platforms (ISO platform or Android platform, etc.) are equipped with Wifi chips, and support connection routers to access the Internet (ie, STA mode) or as a WiFi hotspot for others to connect (ie, AP mode, Access Point).
在Android系统中,在接收到WiFi/热点的开启指令之后会去加载固件,然后创建socket进行监控,这个进行监控的模块就是wifimonitor(WiFi网络监视器),wifimonitor的作用就是建立与固件的消息通信。在建立socket的过程中,如果相应的固件没有加载完成,socket的建立就会失败;在socket建立失败的情况下,wifimonitor就会去周期性的尝试去建立与固件的socket连接,直到超时或者连接建立成功。一般情况下,Android系统中这个周期性的尝试的周期是一个固定的值,也就是说,对于不同的硬件设备,wifimonitor尝试建立与固件之间的socket连接的周期是相同的和固定不变的。但是,对于不同的硬件设备,其加载固件的速度是不一样的,如果太快就加重系统负担,而太慢就会影响wifi或者热点打开速度,因此,相同的固定不变的wifimonitor尝试建立与固件之间的socket连接的周期的设置是不合理的。In the Android system, after receiving the WiFi/hotspot open command, the firmware will be loaded, and then the socket will be created for monitoring. The module for monitoring is wifimonitor (WiFi network monitor), and the function of wifimonitor is to establish message communication with the firmware. . In the process of establishing a socket, if the corresponding firmware is not loaded, the socket establishment will fail; in the case of socket establishment failure, wifimonitor will periodically try to establish a socket connection with the firmware until timeout or connection. Established successfully. In general, the periodicity of this periodic attempt in the Android system is a fixed value, that is, for different hardware devices, the cycle of wifimonitor attempting to establish a socket connection with the firmware is the same and fixed. . However, for different hardware devices, the speed of loading firmware is different. If it is too fast, it will increase the system load, and too slow will affect the speed of wifi or hotspot opening. Therefore, the same fixed wifimonitor tries to establish and The setting of the socket connection period between firmwares is unreasonable.
发明内容Summary of the invention
基于此,为解决传统技术中因为设置相同的固定不变的wifimonitor尝试建立与固件之间的socket连接的周期导致的WiFi和/或热点打开的速度过慢的技术问题,特提出了一种WiFi/热点的开启方法。Based on this, in order to solve the technical problem that the speed of WiFi and/or hotspot opening is too slow due to the setting of the same fixed wifimonitor attempting to establish a socket connection with the firmware in the conventional technology, a WiFi is proposed. / Hotspot opening method.
一种WiFi/热点的开启方法,包括:A method for opening a WiFi/hotspot includes:
接收WiFi/热点开启指令,读取与所述WiFi/热点开启指令对应的配置文件确定与所述WiFi/热点开启指令对应目标固件并进行加载; Receiving a WiFi/hotspot open command, reading a configuration file corresponding to the WiFi/hotspot open command, determining a target firmware corresponding to the WiFi/hotspot open command, and loading;
建立与所述目标固件之间的socket连接;Establishing a socket connection with the target firmware;
若所述socket连接建立失败,则获取与所述目标固件对应的历史加载时长,计算与所述历史加载时长的平均加载时长;If the socket connection fails to be established, obtaining a historical loading duration corresponding to the target firmware, and calculating an average loading duration of the historical loading duration;
根据所述平均加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第一执行时间,在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接。Determining, according to the average loading duration, a first execution time of performing the socket connection with the target firmware next time, performing execution between the establishing and the target firmware when the first execution time arrives Socket connection.
可选的,在其中一个实施例中,所述建立与所述目标固件之间的socket连接之后还包括:Optionally, in an embodiment, after the establishing the socket connection with the target firmware, the method further includes:
在所述socket连接建立失败时,获取与所述目标固件加载的最近一次加载时长,根据所述最近一次加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第二执行时间,在所述第二执行时间到达时执行所述建立与所述目标固件之间的socket连接。When the socket connection establishment fails, obtaining a latest loading duration that is loaded with the target firmware, and determining, according to the latest loading duration, that the second execution of the socket connection between the establishment and the target firmware is performed next time. Time, performing a socket connection between the establishment and the target firmware when the second execution time arrives.
可选的,在其中一个实施例中,所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接之后还包括:Optionally, in one embodiment, after the performing the socket connection between the establishing and the target firmware when the first execution time is reached, the method further includes:
监测所述socket连接是否建立成功,若否,则,则执行所述建立与所述目标固件之间的socket连接。Monitoring whether the socket connection is successfully established, and if not, performing the socket connection between the establishment and the target firmware.
可选的,在其中一个实施例中,所述建立与所述目标固件之间的socket连接之后还包括:Optionally, in an embodiment, after the establishing the socket connection with the target firmware, the method further includes:
计算所述socket连接建立失败的失败次数,在所述失败次数超过预设的阈值时,生成WiFi/热点开启失败的提示消息并进行展示;The number of failures of the socket connection establishment failure is calculated, and when the number of failures exceeds a preset threshold, a prompt message indicating that the WiFi/hotspot fails to be generated is generated and displayed;
注销所述已加载的目标固件。Log out of the loaded target firmware.
可选的,在其中一个实施例中,所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接之后还包括:Optionally, in one embodiment, after the performing the socket connection between the establishing and the target firmware when the first execution time is reached, the method further includes:
若所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接时socket连接建立失败,则获取预设的周期时长,并根据所述周期时长周期性的执行所述建立与所述目标固件之间的socket连接直至所述socket连接建立成功。If the socket connection fails to be established when the socket connection between the establishment and the target firmware is performed when the first execution time is reached, acquiring a preset period duration, and periodically performing according to the period duration The establishing a socket connection with the target firmware until the socket connection is successfully established.
可选的,在其中的一个实施例中,所述确定与所述WiFi/热点开启指令对应目标固件并进行加载,包括: Optionally, in one of the embodiments, the determining, corresponding to the WiFi/hotspot open command, and loading, includes:
根据所述配置文件信息确定与所述WiFi/热点开启指令对应的目标固件;其中,所述目标固件是与所述WiFi/热点的开启需要加载的相关的所有的固件;加载所述目标固件。Determining target firmware corresponding to the WiFi/hotspot open command according to the profile information; wherein the target firmware is all firmware related to loading of the WiFi/hotspot to be loaded; loading the target firmware.
此外,为解决传统技术中因为设置相同的固定不变的wifimonitor尝试建立与固件之间的socket连接的周期导致的WiFi和/或热点打开的速度过慢的技术问题,特提出了一种WiFi/热点的开启装置。In addition, in order to solve the technical problem in the conventional technology that the WiFi and/or the hotspot is turned on slowly due to the setting of the same fixed wifimonitor attempting to establish a socket connection with the firmware, a WiFi/ Hotspot opening device.
一种WiFi/热点的开启装置,包括:A WiFi/hotspot opening device includes:
目标固件加载模块,用于接收WiFi/热点开启指令,读取与所述WiFi/热点开启指令对应的配置文件确定与所述WiFi/热点开启指令对应目标固件并进行加载;a target firmware loading module, configured to receive a WiFi/hotspot open command, and read a configuration file corresponding to the WiFi/hotspot open command to determine a target firmware corresponding to the WiFi/hotspot open command and load the target firmware;
socket连接建立模块,用于建立与所述目标固件之间的socket连接;a socket connection establishing module, configured to establish a socket connection with the target firmware;
平均加载时长确定模块,用于在所述socket连接建立失败时,获取与所述目标固件对应的历史加载时长,计算与所述历史加载时长的平均加载时长;An average load duration determining module, configured to acquire a historical loading duration corresponding to the target firmware when the socket connection fails to be established, and calculate an average loading duration of the historical loading duration;
第一执行时间确定模块,用于根据所述平均加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第一执行时间,在所述第一执行时间到达时调用所述socket连接建立模块。a first execution time determining module, configured to determine, according to the average loading time, a first execution time of performing a socket connection between the establishment and the target firmware, and calling the first execution time when the first execution time is reached Socket connection building module.
可选的,在其中一个实施例中,所述目标固件加载模块,具体用于根据所述配置文件信息确定与所述WiFi/热点开启指令对应的目标固件;其中,所述目标固件是与所述WiFi/热点的开启需要加载的相关的所有的固件;以及加载所述目标固件。Optionally, in one embodiment, the target firmware loading module is specifically configured to determine target firmware corresponding to the WiFi/hotspot open command according to the configuration file information; wherein the target firmware is The opening of the WiFi/hotspot requires loading all relevant firmware; and loading the target firmware.
可选的,在其中一个实施例中,所述装置还包括第二执行时间确定模块,用于在所述socket连接建立失败时,获取与所述目标固件加载的最近一次加载时长,根据所述最近一次加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第二执行时间,在所述第二执行时间到达时调用所述socket连接建立模块。Optionally, in one embodiment, the apparatus further includes a second execution time determining module, configured to acquire a last loading time loaded with the target firmware when the socket connection establishment fails, according to the The last load duration determines a second execution time at which the socket connection between the establishment and the target firmware is executed next time, and the socket connection establishment module is invoked when the second execution time arrives.
可选的,在其中一个实施例中,所述装置还包括socket连接监控模块,用于监测所述socket连接是否建立成功,在所述socket连接建立失败时,调用所述socket连接建立模块。 Optionally, in an embodiment, the device further includes a socket connection monitoring module, configured to monitor whether the socket connection is successfully established, and invoke the socket connection establishing module when the socket connection establishment fails.
可选的,在其中一个实施例中,所述装置还包括目标固件注销模块,用于计算所述socket连接建立失败的失败次数,在所述失败次数超过预设的阈值时,生成WiFi/热点开启失败的提示消息并进行展示;注销所述已加载的目标固件。Optionally, in one embodiment, the device further includes a target firmware deregistration module, configured to calculate a number of failures of the socket connection establishment failure, and generate a WiFi/hotspot when the number of failures exceeds a preset threshold. Open the failed prompt message and display it; log out the loaded target firmware.
可选的,在其中一个实施例中,所述装置还包括周期执行模块,用于在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接时socket连接建立失败时,获取预设的周期时长,并根据所述周期时长周期性的调用所述socket连接建立模块直至所述socket连接建立成功。Optionally, in one embodiment, the apparatus further includes a periodic execution module, configured to fail to establish a socket connection when the establishing a socket connection with the target firmware is performed when the first execution time arrives And acquiring a preset period duration, and periodically calling the socket connection establishing module according to the period duration until the socket connection is successfully established.
进一步的,为解决传统技术中因为设置相同的固定不变的wifimonitor尝试建立与固件之间的socket连接的周期导致的WiFi和/或热点打开的速度过慢的技术问题,还提出了一种移动终端,包括:Further, in order to solve the technical problem in the conventional technology that the WiFi and/or the hotspot is turned on slowly due to the setting of the same fixed wifimonitor attempting to establish a socket connection with the firmware, a mobile is also proposed. Terminals, including:
处理器和存储器;其中,所述处理器通过调用所述存储器中的代码或指令以执行如前所述的WiFi/热点的开启方法。A processor and a memory; wherein the processor performs a WiFi/hotspot opening method as previously described by invoking code or instructions in the memory.
一种移动终端,包括:A mobile terminal includes:
处理器和存储器;其中,所述处理器通过调用所述存储器中的代码或指令以执行如下操作:a processor and a memory; wherein the processor performs the following operations by calling code or instructions in the memory:
接收WiFi/热点开启指令,读取与所述WiFi/热点开启指令对应的配置文件,确定与所述WiFi/热点开启指令对应目标固件并进行加载;Receiving a WiFi/hotspot open command, reading a configuration file corresponding to the WiFi/hotspot open command, determining a target firmware corresponding to the WiFi/hotspot open command, and loading;
建立与所述目标固件之间的socket连接;Establishing a socket connection with the target firmware;
若所述socket连接建立失败,则获取与所述目标固件对应的历史加载时长,计算与所述历史加载时长的平均加载时长;If the socket connection fails to be established, obtaining a historical loading duration corresponding to the target firmware, and calculating an average loading duration of the historical loading duration;
根据所述平均加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第一执行时间,在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接。Determining, according to the average loading duration, a first execution time of performing the socket connection with the target firmware next time, performing execution between the establishing and the target firmware when the first execution time arrives Socket connection.
可选的,在本发明的一个实施例中,所述建立与所述目标固件之间的socket连接之后,所述处理器还执行以下操作:Optionally, in an embodiment of the present invention, after the establishing a socket connection with the target firmware, the processor further performs the following operations:
在所述socket连接建立失败时,获取与所述目标固件加载的最近一次加载 时长,根据所述最近一次加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第二执行时间,在所述第二执行时间到达时执行所述建立与所述目标固件之间的socket连接。Obtaining the last load loaded with the target firmware when the socket connection establishment fails a duration, determining, according to the last load duration, a second execution time of performing a socket connection with the target firmware next time, performing the establishing and the target firmware when the second execution time arrives Socket connection between.
可选的,在本发明的一个实施例中,所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接之后,所述处理器还执行以下操作:Optionally, in an embodiment of the present invention, after performing the socket connection between the establishing and the target firmware when the first execution time arrives, the processor further performs the following operations:
监测所述socket连接是否建立成功,若否,则,则执行所述建立与所述目标固件之间的socket连接。Monitoring whether the socket connection is successfully established, and if not, performing the socket connection between the establishment and the target firmware.
可选的,在本发明的一个实施例中,所述建立与所述目标固件之间的socket连接之后,所述处理器还执行如下操作:Optionally, in an embodiment of the present invention, after the establishing a socket connection with the target firmware, the processor further performs the following operations:
计算所述socket连接建立失败的失败次数,在所述失败次数超过预设的阈值时,生成WiFi/热点开启失败的提示消息并进行展示;The number of failures of the socket connection establishment failure is calculated, and when the number of failures exceeds a preset threshold, a prompt message indicating that the WiFi/hotspot fails to be generated is generated and displayed;
注销所述已加载的目标固件。Log out of the loaded target firmware.
可选的,在本发明的一个实施例中,所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接之后,所述处理器还执行以下操作:Optionally, in an embodiment of the present invention, after performing the socket connection between the establishing and the target firmware when the first execution time arrives, the processor further performs the following operations:
若所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接时socket连接建立失败,则获取预设的周期时长,并根据所述周期时长周期性的执行所述建立与所述目标固件之间的socket连接直至所述socket连接建立成功。If the socket connection fails to be established when the socket connection between the establishment and the target firmware is performed when the first execution time is reached, acquiring a preset period duration, and periodically performing according to the period duration The establishing a socket connection with the target firmware until the socket connection is successfully established.
可选的,在本发明的一个实施例中,所述确定与所述WiFi/热点开启指令对应目标固件并进行加载,包括:Optionally, in an embodiment of the present invention, the determining, according to the WiFi/hotspot opening instruction, the target firmware is loaded and loaded, including:
根据所述配置文件信息确定与所述WiFi/热点开启指令对应的目标固件;其中,所述目标固件是与所述WiFi/热点的开启需要加载的相关的所有的固件;Determining, according to the profile information, target firmware corresponding to the WiFi/hotspot open command; wherein the target firmware is all firmware related to loading of the WiFi/hotspot;
加载所述目标固件。Load the target firmware.
一种存储介质,所述存储介质中存储有程序代码,当所述程序代码被执行 时,处理器执行以下操作:A storage medium in which program code is stored, when the program code is executed When the processor does the following:
接收WiFi/热点开启指令,读取与所述WiFi/热点开启指令对应的配置文件,确定与所述WiFi/热点开启指令对应目标固件并进行加载;Receiving a WiFi/hotspot open command, reading a configuration file corresponding to the WiFi/hotspot open command, determining a target firmware corresponding to the WiFi/hotspot open command, and loading;
建立与所述目标固件之间的socket连接;Establishing a socket connection with the target firmware;
若所述socket连接建立失败,则获取与所述目标固件对应的历史加载时长,计算与所述历史加载时长的平均加载时长;If the socket connection fails to be established, obtaining a historical loading duration corresponding to the target firmware, and calculating an average loading duration of the historical loading duration;
根据所述平均加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第一执行时间,在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接。Determining, according to the average loading duration, a first execution time of performing the socket connection with the target firmware next time, performing execution between the establishing and the target firmware when the first execution time arrives Socket connection.
可选的,在本发明的一个实施例中,所述建立与所述目标固件之间的socket连接之后,所述处理器还执行以下操作:Optionally, in an embodiment of the present invention, after the establishing a socket connection with the target firmware, the processor further performs the following operations:
在所述socket连接建立失败时,获取与所述目标固件加载的最近一次加载时长,根据所述最近一次加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第二执行时间,在所述第二执行时间到达时执行所述建立与所述目标固件之间的socket连接。When the socket connection establishment fails, obtaining a latest loading duration that is loaded with the target firmware, and determining, according to the latest loading duration, that the second execution of the socket connection between the establishment and the target firmware is performed next time. Time, performing a socket connection between the establishment and the target firmware when the second execution time arrives.
可选的,在本发明的一个实施例中,所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接之后,所述处理器还执行以下操作:Optionally, in an embodiment of the present invention, after performing the socket connection between the establishing and the target firmware when the first execution time arrives, the processor further performs the following operations:
监测所述socket连接是否建立成功,若否,则,则执行所述建立与所述目标固件之间的socket连接。Monitoring whether the socket connection is successfully established, and if not, performing the socket connection between the establishment and the target firmware.
可选的,在本发明的一个实施例中,所述建立与所述目标固件之间的socket连接之后,所述处理器还执行如下操作:Optionally, in an embodiment of the present invention, after the establishing a socket connection with the target firmware, the processor further performs the following operations:
计算所述socket连接建立失败的失败次数,在所述失败次数超过预设的阈值时,生成WiFi/热点开启失败的提示消息并进行展示;The number of failures of the socket connection establishment failure is calculated, and when the number of failures exceeds a preset threshold, a prompt message indicating that the WiFi/hotspot fails to be generated is generated and displayed;
注销所述已加载的目标固件。Log out of the loaded target firmware.
可选的,在本发明的一个实施例中,所述在所述第一执行时间到达时执行 所述建立与所述目标固件之间的socket连接之后,所述处理器还执行以下操作:Optionally, in an embodiment of the present invention, the performing is performed when the first execution time arrives After the establishing a socket connection with the target firmware, the processor further performs the following operations:
若所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接时socket连接建立失败,则获取预设的周期时长,并根据所述周期时长周期性的执行所述建立与所述目标固件之间的socket连接直至所述socket连接建立成功。If the socket connection fails to be established when the socket connection between the establishment and the target firmware is performed when the first execution time is reached, acquiring a preset period duration, and periodically performing according to the period duration The establishing a socket connection with the target firmware until the socket connection is successfully established.
可选的,在本发明的一个实施例中,所述确定与所述WiFi/热点开启指令对应目标固件并进行加载,包括:Optionally, in an embodiment of the present invention, the determining, according to the WiFi/hotspot opening instruction, the target firmware is loaded and loaded, including:
根据所述配置文件信息确定与所述WiFi/热点开启指令对应的目标固件;其中,所述目标固件是与所述WiFi/热点的开启需要加载的相关的所有的固件;Determining, according to the profile information, target firmware corresponding to the WiFi/hotspot open command; wherein the target firmware is all firmware related to loading of the WiFi/hotspot;
加载所述目标固件。Load the target firmware.
实施本发明实施例,将具有如下有益效果:Implementation of the embodiments of the present invention will have the following beneficial effects:
采用了上述WiFi/热点的开启方法和装置之后,在接收到WiFi/热点开启指令之后即加载与开启WiFi/热点的相应的固件,并通过建立与固件之间的socket连接来建立与固件之间的消息通信;若上述socket连接建立失败,则说明固件加载还未完成,在此种情况下,根据当前终端历史加载固件的时长来估计本次固件加载的时长并在该时长达到时再次尝试建立socket连接。相较于传统技术中在第一建立socket连接失败后按照固定的周期尝试建立socket连接的技术方案来讲,根据终端的历史加载固件的速度来估算终端当前加载固件的时间并按照该时间来确定再次socket连接建立的时间的方案,避免了过大的周期时长影响WiFi/热点的开启的速度,也避免了过小的周期时长加重了终端系统的负担,加快了WiFi/热点的开启速度,并减轻了终端系统的负担,提升了用户体验。After adopting the above WiFi/hotspot opening method and device, after receiving the WiFi/hotspot open command, the corresponding firmware of the WiFi/hotspot is loaded and opened, and the socket connection between the firmware and the firmware is established between the firmware and the firmware. Message communication; if the above socket connection fails to be established, it indicates that the firmware loading has not been completed. In this case, the duration of the firmware loading is estimated according to the duration of the firmware loading in the current terminal history, and the attempt is established again when the duration is reached. Socket connection. Compared with the technical solution of attempting to establish a socket connection according to a fixed period in the first establishment of a socket connection failure in the conventional technology, the speed of loading the firmware according to the history of the terminal is used to estimate the time at which the terminal currently loads the firmware and determine according to the time. The solution of the socket connection establishment time again avoids the excessive cycle duration affecting the opening speed of the WiFi/hotspot, and avoids the excessive cycle time lengthening the burden of the terminal system, speeding up the opening speed of the WiFi/hotspot, and Reduce the burden on the terminal system and improve the user experience.
附图说明DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。 In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any creative work.
其中:among them:
图1为一个实施例中一种WiFi/热点的开启方法的流程示意图;1 is a schematic flowchart of a method for enabling a WiFi/hotspot in an embodiment;
图2为一个实施例中一种热点设置界面的界面示意图;2 is a schematic diagram of an interface of a hotspot setting interface in an embodiment;
图3为一个实施例中一种WiFi设置界面的界面示意图;3 is a schematic diagram of an interface of a WiFi setting interface in an embodiment;
图4为一个实施例中一种WiFi/热点的开启装置的结构示意图;4 is a schematic structural diagram of a WiFi/hotspot opening device in an embodiment;
图5为一个实施例中运行前述WiFi/热点的开启方法的计算机设备的结构示意图。FIG. 5 is a schematic structural diagram of a computer device that runs the foregoing WiFi/hotspot opening method in an embodiment.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
为解决传统技术中因为设置相同的固定不变的wifimonitor尝试建立与固件之间的socket连接的周期导致的WiFi和/或热点打开的速度过慢的技术问题,在本实施例中,特提出了一种WiFi/热点的开启方法,该方法的实现可依赖于计算机程序,该计算机程序可运行于基于冯诺依曼体系的计算机系统之上,该计算机系统可以是智能手机、笔记本电脑、平板电脑等安装有无线网卡或Wi-Fi芯片的支持AP模式和STA模式的计算机设备。该计算机程序可以是智能手机或平板电脑等智能终端上的Wi-Fi连接管理程序或热点管理程序等计算机程序。具体的,如图1所示,上述WiFi/热点的开启方法包括如下步骤S102-S108:In order to solve the technical problem in the conventional technology that the speed of WiFi and/or hotspot opening is too slow due to the setting of the same fixed wifimonitor attempting to establish a socket connection with the firmware, in this embodiment, a special proposal is made. A method for opening a WiFi/hotspot, the implementation of the method may depend on a computer program running on a computer system based on a von Neumann system, which may be a smartphone, a laptop, a tablet A computer device that supports an AP mode and a STA mode, such as a wireless network card or a Wi-Fi chip. The computer program may be a computer program such as a Wi-Fi connection management program or a hotspot management program on a smart terminal such as a smartphone or a tablet. Specifically, as shown in FIG. 1 , the method for enabling the WiFi/hotspot includes the following steps S102-S108:
步骤S102:接收WiFi/热点开启指令,读取与所述WiFi/热点开启指令对应的配置文件确定与所述WiFi/热点开启指令对应目标固件并进行加载。Step S102: Receive a WiFi/hotspot open command, and read a configuration file corresponding to the WiFi/hotspot open command to determine a target firmware corresponding to the WiFi/hotspot open command and load the target firmware.
在本实施例中,用户可以通过热点设置界面中相应的热点开启按钮或控件输入热点开启请求,例如,在如图2所示的热点设置页面中,用户可以通过编号A所示的按钮输入热点开启请求。In this embodiment, the user can input a hotspot open request through a corresponding hotspot open button or a control in the hotspot setting interface. For example, in the hotspot setting page shown in FIG. 2, the user can input the hotspot through the button indicated by the number A. Open the request.
在另一个实施例中,用户可以通过WiFi设置页面中相应的WiFi开启按钮或控件输入WiFi开启请求或WiFi连接请求,例如,在如图3所示的热点设置页面中,用户可以通过编号B所示的按钮输入WiFi开启请求,开启WiFi并 扫描周围环境中的WiFi;或者,可以通过选择编号C所示的区域中展示的多个WiFi标识来连接入该WIFi标识对应的无线WiFi。In another embodiment, the user may input a WiFi open request or a WiFi connection request through a corresponding WiFi open button or control in the WiFi settings page. For example, in the hotspot setting page shown in FIG. 3, the user may pass the number B. The button shown enters the WiFi on request, and the WiFi is turned on. Scan the WiFi in the surrounding environment; or, connect the wireless WiFi corresponding to the WIFi logo by selecting multiple WiFi identifiers displayed in the area indicated by the number C.
在接收到用户输入的WiFi/热点开启请求之后,首先需要读取WiFi热点对应的配置文件信息,然后根据配置文件信息去加载与WiFi热点的开启需要加载的相关的所有的固件,即目标固件,并加载上述目标固件。After receiving the WiFi/hotspot open request input by the user, firstly, the configuration file information corresponding to the WiFi hotspot needs to be read, and then all the firmware related to the opening of the WiFi hotspot, that is, the target firmware, is loaded according to the configuration file information. And load the above target firmware.
步骤S104:建立与所述目标固件之间的socket连接。Step S104: Establish a socket connection with the target firmware.
在本实施例中,在开启WiFi/热点的过程中,需要创建socket进行监控,在Android系统中,该进行监控的模块即为WiFimonitor,即建立应用层与WiFi或热点对应的加载的固件之间的消息通信。一般情况下,在接收到WiFi/热点开启指令之后即开始创建上述应用层与目标固件之间的socket连接以对终端的消息通讯进行监控。但是,若步骤S102中加载的目标固件没有加载成功,则在建立与目标固件的socket连接的过程中会建立失败;反之,若在执行步骤S104之前,目标固件已经加载成功,则本步骤中socket连接建立成功,socket连接建立成功则说明开启WiFi/热点的所有进程已经执行完毕,WiFi/热点成功开启。In this embodiment, in the process of enabling the WiFi/hotspot, a socket needs to be created for monitoring. In the Android system, the module for monitoring is a WiFimonitor, that is, between the application firmware and the loaded firmware corresponding to the WiFi or the hotspot. Message communication. Generally, after receiving the WiFi/hotspot open command, the socket connection between the application layer and the target firmware is started to monitor the message communication of the terminal. However, if the target firmware loaded in step S102 is not successfully loaded, a failure is established in the process of establishing a socket connection with the target firmware; otherwise, if the target firmware has been successfully loaded before performing step S104, the socket in this step If the connection is successfully established, the successful establishment of the socket connection means that all the processes for enabling the WiFi/hotspot have been executed, and the WiFi/hotspot is successfully enabled.
步骤S106:若所述socket连接建立失败,则获取与所述目标固件对应的历史加载时长,计算与所述历史加载时长的平均加载时长。Step S106: If the socket connection fails to be established, obtain a historical loading duration corresponding to the target firmware, and calculate an average loading duration from the historical loading duration.
在本实施例中,若socket连接建立失败,则需要重新尝试建立socket连接直至超过或者socket连接建立成功。在传统技术中,在重新尝试建立socket连接的过程中,是按照预设的轮询周期进行的,并且,该轮询周期是固定的,对于不同的终端,其轮询周期也是一样的,但是,不同的终端设备的处理能力不同,因此,在进行处理的过程中应当考虑各个不同的设备的处理能力。In this embodiment, if the socket connection establishment fails, it is necessary to re-attempt to establish a socket connection until the socket connection is established successfully. In the conventional technology, in the process of re-attempting to establish a socket connection, the polling period is performed according to a preset polling period, and the polling period is fixed, and the polling period is the same for different terminals, but Different terminal devices have different processing capabilities. Therefore, the processing capabilities of different devices should be considered in the process of processing.
具体的,在本实施例中,获取在终端中存储的或者缓存的与WiFi连接或者热点开启的过程中加载固件的历史记录,在该加载固件的历史记录中包含了每一次加载固件的加载时长。上述历史记录以及历史记录中包含的每一次加载固件的加载时长代表了当前终端的历史加载固件的情况,反映了终端加载固件的能力和处理速度。Specifically, in this embodiment, the history of loading the firmware stored in the terminal or cached during the connection with the WiFi connection or the hotspot is obtained, and the loading history of the loaded firmware is included in the history of the loaded firmware. . The above history and the loading time of each loaded firmware included in the history record represent the history of the current terminal loading firmware, reflecting the ability of the terminal to load firmware and processing speed.
在本实施例中,根据历史记录以及历史记录中包含的每一次加载固件的加载时长(即历史加载时长),计算与历史加载时长对应的平均加载时长;即根 据历史记录中包含的每一次加载固件的加载时长的平均值作为平均加载时长,该平均加载时长反映了该终端对于固件加载的平均能力。In this embodiment, the average loading duration corresponding to the historical loading duration is calculated according to the history record and the loading duration of each loaded firmware included in the history record (ie, the historical loading duration); According to the average value of the loading time of each loaded firmware included in the history record, the average loading time reflects the average capacity of the terminal for firmware loading.
需要说明的是,在本实施例中,上述获取的历史加载时长还可以是一定时间范围内的,因为终端系统的损耗以及终端上安装的应用的改变,终端系统的处理能力会随着时间的推移而改变,因此,过久之前的目标固件的加载时长对于确定终端当前的固件加载速度的评估并不具备可靠性,因此,在本实施例中,上述获取的历史加载时长为预设的时间之内的历史加载时长或者预设的加载次数之内的历史加载时长。It should be noted that, in this embodiment, the historical loading duration of the foregoing acquisition may also be within a certain time range. The processing capability of the terminal system may be over time due to the loss of the terminal system and the change of the application installed on the terminal. The change of the target firmware is not reliable for determining the current firmware loading speed of the terminal. Therefore, in this embodiment, the historical loading time obtained is a preset time. The historical load duration within the duration or the preset load time within the preset load times.
步骤S108:根据所述平均加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第一执行时间,在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接。Step S108: determining, according to the average loading duration, a first execution time of performing the socket connection with the target firmware next time, performing the establishing and the target firmware when the first execution time arrives Socket connection between.
在本实施例中,不同于传统技术中预设的轮询周期来确定在建立socket连接失败之后的再次尝试建立socket连接的时间,而是通过上述步骤S106中根据加载目标固件的历史加载时长确定的平均加载时长来确定再次尝试建立socket连接的时间。In this embodiment, the time of re-attempting to establish a socket connection after the socket connection failure is established is determined differently from the polling period preset in the conventional technology, but is determined according to the historical loading time of the loading target firmware in the above step S106. The average load duration is used to determine when to try to establish a socket connection again.
具体的,根据平均加载时长来确定下一次尝试建立socket连接的执行时间,即第一执行时间。例如,在一个实施例中,根据固件加载的开始时间以及平均加载时长来确定第一执行时间。并且,在第一执行时间到达时,再次尝试建立socket连接。Specifically, the execution time of the next attempt to establish a socket connection, that is, the first execution time, is determined according to the average loading duration. For example, in one embodiment, the first execution time is determined based on the start time of the firmware load and the average load duration. And, when the first execution time arrives, try to establish a socket connection again.
在本实施例中,因为在第一执行时间到达时,目标固件的加载也有可能还未完成,在此种情况下,socket连接的建立可能会再次失败,在此种情况下,应该确定socket连接再次建立失败的处理机制。In this embodiment, since the loading of the target firmware may not be completed when the first execution time arrives, in this case, the establishment of the socket connection may fail again. In this case, the socket connection should be determined. Establish a failure handling mechanism again.
在一个可选的实施例中,上述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接之后还包括:监测所述socket连接是否建立成功,若否,则,则执行所述建立与所述目标固件之间的socket连接。In an optional embodiment, after the performing the socket connection between the establishing and the target firmware when the first execution time arrives, the method further includes: monitoring whether the socket connection is successfully established, and if not, And performing the socket connection between the establishing and the target firmware.
在一个可选的实施例中,所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接之后还包括:若所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接时socket连接建立失败,则循环执行所述建立与所述目标固件之间的socket连接直至所述socket连接建立 成功。In an optional embodiment, after the performing the socket connection between the establishing and the target firmware when the first execution time arrives, the method further includes: if the first execution time arrives Performing a socket connection establishment failure when the socket connection between the target firmware is performed, and performing a socket connection between the establishing and the target firmware until the socket connection is established. success.
也就是说,若步骤S108中再次建立socket连接的过程中再次失败,则不断重新尝试socket连接的建立直至socket连接建立成功,按照历史加载时长可以确定,就算在步骤S108中socket连接建立失败,其目标固件的加载应该已经快完成,因此,为了加快WiFi/热点的开启速度,可以不断的重新尝试socket连接的建立直至socket连接建立成功。That is to say, if the socket connection fails again in the process of establishing the socket connection in step S108, the establishment of the socket connection is continuously re-attempted until the socket connection is successfully established, and the history loading time can be determined, even if the socket connection establishment fails in step S108, The loading of the target firmware should have been completed quickly. Therefore, in order to speed up the opening of the WiFi/hotspot, the establishment of the socket connection can be continuously re-tried until the socket connection is successfully established.
在另一个实施例中,所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接之后还包括:若所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接时socket连接建立失败,则获取预设的周期时长,并根据所述周期时长周期性的执行所述建立与所述目标固件之间的socket连接直至所述socket连接建立成功。In another embodiment, after the performing the socket connection between the establishing and the target firmware when the first execution time arrives, the method further includes: if the performing the first execution time arrives, executing the location Establishing a socket connection failure when establishing a socket connection with the target firmware, acquiring a preset period duration, and performing the socket connection with the target firmware periodically according to the period duration to be performed until the socket connection is established The socket connection is successfully established.
也就是说,在本实施例中,在步骤S108中再次建立socket失败之后,虽说目标固件的加载可能快完成,但是也要考虑其他因素的影响,减少对系统资源的占用。即,按照预设的周期时长(例如,0.5s)来周期性的尝试socket连接的建立直至socket连接建立成功,在保证了WiFi/热点开启的速度的前提下,也减少了对系统资源的过度占用。That is to say, in the present embodiment, after the socket fails to be established again in step S108, although the loading of the target firmware may be completed quickly, other factors may also be considered to reduce the occupation of system resources. That is, periodically, the socket connection is established according to the preset period duration (for example, 0.5 s) until the socket connection is successfully established, and the system resources are excessively reduced while ensuring the speed of the WiFi/hotspot opening. Occupied.
在本实施例中,在socket连接的建立过程中,还可能出现另外一种情况,即不断的出现socket连接建立失败的情况,并且socket连接建立的失败不是因为目标固件的未加载成功导致的,而是因为其他原因,在此种情况下,持续不断的尝试socket连接的建立直至socket连接建立成功是不可取的,所以,还应当建立一种Socket连接建立的放弃机制。In this embodiment, during the establishment of the socket connection, another situation may occur, that is, the socket connection establishment failure occurs continuously, and the failure of the socket connection establishment is not caused by the unloaded success of the target firmware. For other reasons, in this case, it is not advisable to continuously try to establish the socket connection until the socket connection is successfully established. Therefore, a quit connection establishment abandonment mechanism should also be established.
具体的,在一个可选的实施例中,所述建立与所述目标固件之间的socket连接之后还包括:计算所述socket连接建立失败的失败次数,在所述失败次数超过预设的阈值时,生成WiFi/热点开启失败的提示消息并进行展示;注销所述已加载的目标固件。Specifically, in an optional embodiment, after the establishing the socket connection with the target firmware, the method further includes: calculating a number of failures of the socket connection establishment failure, where the number of failures exceeds a preset threshold At the same time, a prompt message indicating that the WiFi/hotspot fails to be generated is generated and displayed; the loaded target firmware is unregistered.
具体的,在建立socket连接的过程中,统计socket连接建立失败的失败次数,并且,在该失败次数超过预设的阈值的情况下,即说明了socket连接的建立已经尝试了足够次数和时间,但还是建立失败,在此种情况下,可放弃socket连接的建立,并且生成WiFi/热点开启失败的提示消息,用来提示用户WiFi/ 热点开启失败,请重新尝试。进一步地,为了减少不必要的对系统资源的占用,对于步骤S102中已经加载的目标固件进行注销,以释放占用的系统资源。Specifically, in the process of establishing a socket connection, the number of failed socket connection establishment failures is counted, and when the number of failures exceeds a preset threshold, it indicates that the establishment of the socket connection has been tried for a sufficient number of times and time. However, the establishment fails. In this case, the establishment of the socket connection can be abandoned, and a prompt message indicating that the WiFi/hotspot fails to be generated is used to prompt the user to WiFi/ The hotspot failed to open, please try again. Further, in order to reduce unnecessary occupation of system resources, the target firmware that has been loaded in step S102 is deregistered to release the occupied system resources.
在另一个可选的实施例中,上述根据目标固件的历史加载时长来确定下一次执行建立与所述目标固件之间的socket连接的执行时间的过程中,下一次执行建立与所述目标固件之间的socket连接的执行时间的确定还可以通过其他方式确定。In another optional embodiment, in the process of determining the execution time of the socket connection between the target firmware and the target firmware according to the historical loading time of the target firmware, the next execution and the target firmware are executed. The determination of the execution time of the socket connection between the other can also be determined by other means.
具体的,在一个实施例中,所述建立与所述目标固件之间的socket连接之后还包括:在所述socket连接建立失败时,获取与所述目标固件加载的最近一次加载时长,根据所述最近一次加载时长确定下一次执行所述的第二执行时间,在所述第二执行时间到达时执行所述建立与所述目标固件之间的socket连接。Specifically, in an embodiment, after the establishing the socket connection with the target firmware, the method further includes: acquiring, after the socket connection establishment fails, a last loading time loaded with the target firmware, according to the The last load duration determines that the second execution time is performed next time, and the socket connection between the establishment and the target firmware is performed when the second execution time arrives.
也就是说,用上一次加载目标固件的加载时长来估算本次加载目标固件的加载时长,因为,上一次加载目标固件的终端环境与本地加载目标固件的终端环境较为接近,更能代表终端当前的处理能力或固件加载能力。That is to say, the loading time of the target firmware is loaded with the loading time of the last loading target firmware, because the terminal environment of the last loading target firmware is closer to the terminal environment of the local loading target firmware, and is more representative of the current terminal. Processing power or firmware loading capabilities.
此外,为解决传统技术中因为设置相同的固定不变的wifimonitor尝试建立与固件之间的socket连接的周期导致的WiFi和/或热点打开的速度过慢的技术问题,在一个实施例中,如图4所示,还提出了一种WiFi/热点的开启装置,包括目标固件加载模块102、socket连接建立模块104、平均加载时长确定模块106以及第一执行时间确定模块108,其中:In addition, in order to solve the technical problem in the conventional art that the speed of WiFi and/or hotspot opening is too slow due to the period in which the same fixed wifimonitor is set to establish a socket connection with the firmware, in one embodiment, As shown in FIG. 4, a WiFi/hotspot opening device is further provided, including a target firmware loading module 102, a socket connection establishing module 104, an average loading duration determining module 106, and a first execution time determining module 108, wherein:
目标固件加载模块102,用于接收WiFi/热点开启指令,读取与所述WiFi/热点开启指令对应的配置文件确定与所述WiFi/热点开启指令对应目标固件并进行加载;The target firmware loading module 102 is configured to receive a WiFi/hotspot open command, and read a configuration file corresponding to the WiFi/hotspot open command to determine a target firmware corresponding to the WiFi/hotspot open command and load the target firmware;
socket连接建立模块104,用于建立与所述目标固件之间的socket连接;a socket connection establishing module 104, configured to establish a socket connection with the target firmware;
平均加载时长确定模块106,用于在所述socket连接建立失败时,获取与所述目标固件对应的历史加载时长,计算与所述历史加载时长的平均加载时长;The average loading duration determining module 106 is configured to acquire a historical loading duration corresponding to the target firmware when the socket connection fails to be established, and calculate an average loading duration of the historical loading duration;
第一执行时间确定模块108,用于根据所述平均加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第一执行时间,在所述第一执行时间到达时调用所述socket连接建立模块。a first execution time determining module 108, configured to determine, according to the average loading time, a first execution time of performing a socket connection between the establishment and the target firmware next time, and calling the first execution time when the first execution time arrives The socket connection establishment module is described.
可选的,在本实施例中,如图4所示,上述装置还包括第二执行时间确定 模块110,用于在所述socket连接建立失败时,获取与所述目标固件加载的最近一次加载时长,根据所述最近一次加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第二执行时间,在所述第二执行时间到达时调用所述socket连接建立模块104。Optionally, in this embodiment, as shown in FIG. 4, the foregoing apparatus further includes a second execution time determination. The module 110 is configured to acquire, after the socket connection establishment fails, a last loading duration that is loaded with the target firmware, and determine, according to the latest loading duration, that the socket between the establishment and the target firmware is executed next time. The second execution time of the connection, the socket connection establishment module 104 is invoked when the second execution time arrives.
可选的,在本实施例中,如图4所示,上述装置还包括socket连接监控模块112,用于监测所述socket连接是否建立成功,在所述socket连接建立失败时,调用所述socket连接建立模块104。Optionally, in this embodiment, as shown in FIG. 4, the foregoing apparatus further includes a socket connection monitoring module 112, configured to monitor whether the socket connection is successfully established, and invoke the socket when the socket connection fails to be established. Connection establishment module 104.
可选的,在本实施例中,如图4所示,上述装置还包括目标固件注销模块114,用于计算所述socket连接建立失败的失败次数,在所述失败次数超过预设的阈值时,生成WiFi/热点开启失败的提示消息并进行展示;注销所述已加载的目标固件。Optionally, in this embodiment, as shown in FIG. 4, the apparatus further includes a target firmware deregistration module 114, configured to calculate a number of failures of the socket connection establishment failure, when the number of failures exceeds a preset threshold. , generating a prompt message for the WiFi/hotspot open failure and displaying; unregistering the loaded target firmware.
可选的,在本实施例中,如图4所示,上述装置还包括周期执行模块116,用于在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接时socket连接建立失败时,获取预设的周期时长,并根据所述周期时长周期性的调用所述socket连接建立模块直至所述socket连接建立成功。Optionally, in this embodiment, as shown in FIG. 4, the apparatus further includes a period execution module 116, configured to perform the socket connection between the establishing and the target firmware when the first execution time arrives. When the socket connection fails to be established, the preset period duration is obtained, and the socket connection establishment module is periodically invoked according to the period duration until the socket connection is successfully established.
实施本发明实施例,将具有如下有益效果:Implementation of the embodiments of the present invention will have the following beneficial effects:
采用了上述WiFi/热点的开启方法和装置之后,在接收到WiFi/热点开启指令之后即加载与开启WiFi/热点的相应的固件,并通过建立与固件之间的socket连接来建立与固件之间的消息通信;若上述socket连接建立失败,则说明固件加载还未完成,在此种情况下,根据当前终端历史加载固件的时长来估计本次固件加载的时长并在该时长达到时再次尝试建立socket连接。相较于传统技术中在第一建立socket连接失败后按照固定的周期尝试建立socket连接的技术方案来讲,根据终端的历史加载固件的速度来估算终端当前加载固件的时间并按照该时间来确定再次socket连接建立的时间的方案,避免了过大的周期时长影响WiFi/热点的开启的速度,也避免了过小的周期时长加重了终端系统的负担,加快了WiFi/热点的开启速度,并减轻了终端系统的负担,提升了用户体验。After adopting the above WiFi/hotspot opening method and device, after receiving the WiFi/hotspot open command, the corresponding firmware of the WiFi/hotspot is loaded and opened, and the socket connection between the firmware and the firmware is established between the firmware and the firmware. Message communication; if the above socket connection fails to be established, it indicates that the firmware loading has not been completed. In this case, the duration of the firmware loading is estimated according to the duration of the firmware loading in the current terminal history, and the attempt is established again when the duration is reached. Socket connection. Compared with the technical solution of attempting to establish a socket connection according to a fixed period in the first establishment of a socket connection failure in the conventional technology, the speed of loading the firmware according to the history of the terminal is used to estimate the time at which the terminal currently loads the firmware and determine according to the time. The solution of the socket connection establishment time again avoids the excessive cycle duration affecting the opening speed of the WiFi/hotspot, and avoids the excessive cycle time lengthening the burden of the terminal system, speeding up the opening speed of the WiFi/hotspot, and Reduce the burden on the terminal system and improve the user experience.
在一个实施例中,如图5所示,图5展示了一种运行上述WiFi/热点的开 启方法的基于冯诺依曼体系的计算机系统的终端。该计算机系统可以是包含有WiFi芯片的可以连接WiFi热点的智能手机、平板电脑、掌上电脑、笔记本电脑或个人电脑等终端设备。具体的,可包括通过系统总线连接的外部输入接口1001、处理器1002、存储器1003和输出接口1004。其中,外部输入接口1001可选的可至少包括网络接口10012(在本实施例中,即为WiFi芯片)。存储器1003可包括外存储器10032(例如硬盘、光盘或软盘等)和内存储器10034。输出接口1004可至少包括显示屏10042等设备。In one embodiment, as shown in FIG. 5, FIG. 5 illustrates an operation of running the above WiFi/hotspot. The terminal of the computer system based on the von Neumann system. The computer system may be a terminal device including a WiFi chip, a smart phone, a tablet computer, a palmtop computer, a notebook computer or a personal computer that can be connected to a WiFi hotspot. Specifically, an external input interface 1001, a processor 1002, a memory 1003, and an output interface 1004 connected through a system bus may be included. The external input interface 1001 can optionally include at least a network interface 10012 (in this embodiment, a WiFi chip). The memory 1003 may include an external memory 10032 (eg, a hard disk, an optical disk, or a floppy disk, etc.) and an internal memory 10034. The output interface 1004 can include at least a device such as a display 10042.
在本实施例中,本方法的运行基于计算机程序,该计算机程序的程序文件存储于前述基于冯诺依曼体系的计算机系统的外存储器10032中,在运行时被加载到内存储器10034中,然后被编译为机器码之后传递至处理器1002中执行,从而使得基于冯诺依曼体系的计算机系统中形成逻辑上的目标固件加载模块102、socket连接建立模块104、平均加载时长确定模块106、第一执行时间确定模块108、第二执行时间确定模块110、socket连接监控模块112、目标固件注销模块114以及周期执行模块116。且在上述WiFi/热点的开启方法执行过程中,输入的参数均通过外部输入接口1001接收,并传递至存储器1003中缓存,然后输入到处理器1002中进行处理,处理的结果数据或缓存于存储器1003中进行后续地处理,或被传递至输出接口1004进行输出。In this embodiment, the operation of the method is based on a computer program whose program file is stored in the external memory 10032 of the aforementioned von Neumann system-based computer system, loaded into the internal memory 10034 at runtime, and then After being compiled into a machine code, it is passed to the processor 1002 for execution, so that the logical target firmware loading module 102, the socket connection establishing module 104, the average loading duration determining module 106, and the first in the von Neumann system-based computer system are formed. An execution time determination module 108, a second execution time determination module 110, a socket connection monitoring module 112, a target firmware logout module 114, and a cycle execution module 116. And during the execution of the above-mentioned WiFi/hotspot opening method, the input parameters are all received through the external input interface 1001, and transferred to the buffer in the memory 1003, and then input to the processor 1002 for processing, and the processed result data is cached in the memory. Subsequent processing is performed in 1003 or passed to output interface 1004 for output.
具体的,在本实施例中,上述处理器1002具体用于执行如下操作:Specifically, in this embodiment, the processor 1002 is specifically configured to perform the following operations:
接收WiFi/热点开启指令,读取与所述WiFi/热点开启指令对应的配置文件确定与所述WiFi/热点开启指令对应目标固件并进行加载;Receiving a WiFi/hotspot open command, reading a configuration file corresponding to the WiFi/hotspot open command, determining a target firmware corresponding to the WiFi/hotspot open command, and loading;
建立与所述目标固件之间的socket连接;Establishing a socket connection with the target firmware;
若所述socket连接建立失败,则获取与所述目标固件对应的历史加载时长,计算与所述历史加载时长的平均加载时长;If the socket connection fails to be established, obtaining a historical loading duration corresponding to the target firmware, and calculating an average loading duration of the historical loading duration;
根据所述平均加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第一执行时间,在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接。Determining, according to the average loading duration, a first execution time of performing the socket connection with the target firmware next time, performing execution between the establishing and the target firmware when the first execution time arrives Socket connection.
可选的,在一个实施例中,上述处理器1002还用于在所述socket连接建立失败时,获取与所述目标固件加载的最近一次加载时长,根据所述最近一次加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第二 执行时间,在所述第二执行时间到达时执行所述建立与所述目标固件之间的socket连接。Optionally, in an embodiment, the processor 1002 is further configured to: when the socket connection fails to be established, acquire a last loading duration that is loaded with the target firmware, and determine a next execution according to the latest loading duration. The second establishing a socket connection with the target firmware Execution time, the socket connection between the establishment and the target firmware is performed when the second execution time arrives.
可选的,在一个实施例中,上述处理器1002还用于监测所述socket连接是否建立成功,若否,则,则执行所述建立与所述目标固件之间的socket连接。Optionally, in an embodiment, the processor 1002 is further configured to monitor whether the socket connection is successfully established, and if not, perform the socket connection between the establishment and the target firmware.
可选的,在一个实施例中,上述处理器1002还用于计算所述socket连接建立失败的失败次数,在所述失败次数超过预设的阈值时,生成WiFi/热点开启失败的提示消息并进行展示;注销所述已加载的目标固件。Optionally, in an embodiment, the processor 1002 is further configured to calculate a failure number of the socket connection establishment failure, and generate a prompt message of the WiFi/hotspot activation failure when the number of failures exceeds a preset threshold. Show; unregister the loaded target firmware.
可选的,在一个实施例中,上述处理器1002还用于若所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接时socket连接建立失败,则获取预设的周期时长,并根据所述周期时长周期性的执行所述建立与所述目标固件之间的socket连接直至所述socket连接建立成功。Optionally, in an embodiment, the processor 1002 is further configured to: if the socket connection establishment fails when the socket connection between the establishing and the target firmware is performed when the first execution time arrives, Obtaining a preset period duration, and periodically performing the socket connection with the target firmware according to the periodic duration to establish that the socket connection is successfully established.
本发明还提供了一种存储介质,所述存储介质中存储有程序代码,当所述程序代码被执行时,处理器执行以下操作:The present invention also provides a storage medium in which program code is stored, and when the program code is executed, the processor performs the following operations:
接收WiFi/热点开启指令,读取与所述WiFi/热点开启指令对应的配置文件,确定与所述WiFi/热点开启指令对应目标固件并进行加载;Receiving a WiFi/hotspot open command, reading a configuration file corresponding to the WiFi/hotspot open command, determining a target firmware corresponding to the WiFi/hotspot open command, and loading;
建立与所述目标固件之间的socket连接;Establishing a socket connection with the target firmware;
若所述socket连接建立失败,则获取与所述目标固件对应的历史加载时长,计算与所述历史加载时长的平均加载时长;If the socket connection fails to be established, obtaining a historical loading duration corresponding to the target firmware, and calculating an average loading duration of the historical loading duration;
根据所述平均加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第一执行时间,在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接。Determining, according to the average loading duration, a first execution time of performing the socket connection with the target firmware next time, performing execution between the establishing and the target firmware when the first execution time arrives Socket connection.
可选的,在本发明的一个实施例中,所述建立与所述目标固件之间的socket连接之后,所述处理器还执行以下操作:Optionally, in an embodiment of the present invention, after the establishing a socket connection with the target firmware, the processor further performs the following operations:
在所述socket连接建立失败时,获取与所述目标固件加载的最近一次加载时长,根据所述最近一次加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第二执行时间,在所述第二执行时间到达时执行所述建立与所述目标固件之间的socket连接。 When the socket connection establishment fails, obtaining a latest loading duration that is loaded with the target firmware, and determining, according to the latest loading duration, that the second execution of the socket connection between the establishment and the target firmware is performed next time. Time, performing a socket connection between the establishment and the target firmware when the second execution time arrives.
可选的,在本发明的一个实施例中,所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接之后,所述处理器还执行以下操作:Optionally, in an embodiment of the present invention, after performing the socket connection between the establishing and the target firmware when the first execution time arrives, the processor further performs the following operations:
监测所述socket连接是否建立成功,若否,则,则执行所述建立与所述目标固件之间的socket连接。Monitoring whether the socket connection is successfully established, and if not, performing the socket connection between the establishment and the target firmware.
可选的,在本发明的一个实施例中,所述建立与所述目标固件之间的socket连接之后,所述处理器还执行如下操作:Optionally, in an embodiment of the present invention, after the establishing a socket connection with the target firmware, the processor further performs the following operations:
计算所述socket连接建立失败的失败次数,在所述失败次数超过预设的阈值时,生成WiFi/热点开启失败的提示消息并进行展示;The number of failures of the socket connection establishment failure is calculated, and when the number of failures exceeds a preset threshold, a prompt message indicating that the WiFi/hotspot fails to be generated is generated and displayed;
注销所述已加载的目标固件。Log out of the loaded target firmware.
可选的,在本发明的一个实施例中,所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接之后,所述处理器还执行以下操作:Optionally, in an embodiment of the present invention, after performing the socket connection between the establishing and the target firmware when the first execution time arrives, the processor further performs the following operations:
若所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接时socket连接建立失败,则获取预设的周期时长,并根据所述周期时长周期性的执行所述建立与所述目标固件之间的socket连接直至所述socket连接建立成功。If the socket connection fails to be established when the socket connection between the establishment and the target firmware is performed when the first execution time is reached, acquiring a preset period duration, and periodically performing according to the period duration The establishing a socket connection with the target firmware until the socket connection is successfully established.
可选的,在本发明的一个实施例中,所述确定与所述WiFi/热点开启指令对应目标固件并进行加载,包括:Optionally, in an embodiment of the present invention, the determining, according to the WiFi/hotspot opening instruction, the target firmware is loaded and loaded, including:
根据所述配置文件信息确定与所述WiFi/热点开启指令对应的目标固件;其中,所述目标固件是与所述WiFi/热点的开启需要加载的相关的所有的固件;Determining, according to the profile information, target firmware corresponding to the WiFi/hotspot open command; wherein the target firmware is all firmware related to loading of the WiFi/hotspot;
加载所述目标固件。Load the target firmware.
以上所揭露的仅为本发明较佳实施例而已,当然不能以此来限定本发明之权利范围,因此依本发明权利要求所作的等同变化,仍属本发明所涵盖的范围。 The above is only the preferred embodiment of the present invention, and the scope of the present invention is not limited thereto, and thus equivalent changes made in the claims of the present invention are still within the scope of the present invention.

Claims (20)

  1. 一种WiFi/热点的开启方法,其特征在于,包括:A method for opening a WiFi/hotspot, comprising:
    接收WiFi/热点开启指令,读取与所述WiFi/热点开启指令对应的配置文件,确定与所述WiFi/热点开启指令对应目标固件并进行加载;Receiving a WiFi/hotspot open command, reading a configuration file corresponding to the WiFi/hotspot open command, determining a target firmware corresponding to the WiFi/hotspot open command, and loading;
    建立与所述目标固件之间的socket连接;Establishing a socket connection with the target firmware;
    若所述socket连接建立失败,则获取与所述目标固件对应的历史加载时长,计算与所述历史加载时长的平均加载时长;If the socket connection fails to be established, obtaining a historical loading duration corresponding to the target firmware, and calculating an average loading duration of the historical loading duration;
    根据所述平均加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第一执行时间,在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接。Determining, according to the average loading duration, a first execution time of performing the socket connection with the target firmware next time, performing execution between the establishing and the target firmware when the first execution time arrives Socket connection.
  2. 根据权利要求1所述的WiFi/热点的开启方法,其特征在于,所述建立与所述目标固件之间的socket连接之后还包括:The method for opening a WiFi/hotspot according to claim 1, wherein the establishing a socket connection with the target firmware further comprises:
    在所述socket连接建立失败时,获取与所述目标固件加载的最近一次加载时长,根据所述最近一次加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第二执行时间,在所述第二执行时间到达时执行所述建立与所述目标固件之间的socket连接。When the socket connection establishment fails, obtaining a latest loading duration that is loaded with the target firmware, and determining, according to the latest loading duration, that the second execution of the socket connection between the establishment and the target firmware is performed next time. Time, performing a socket connection between the establishment and the target firmware when the second execution time arrives.
  3. 根据权利要求1所述的WiFi/热点的开启方法,其特征在于,所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接之后还包括:The method for opening a WiFi/hotspot according to claim 1, wherein the performing the socket connection between the establishing and the target firmware when the first execution time is reached further comprises:
    监测所述socket连接是否建立成功,若否,则,则执行所述建立与所述目标固件之间的socket连接。Monitoring whether the socket connection is successfully established, and if not, performing the socket connection between the establishment and the target firmware.
  4. 根据权利要求1所述的WiFi/热点的开启方法,其特征在于,所述建立与所述目标固件之间的socket连接之后还包括:The method for opening a WiFi/hotspot according to claim 1, wherein the establishing a socket connection with the target firmware further comprises:
    计算所述socket连接建立失败的失败次数,在所述失败次数超过预设的阈值时,生成WiFi/热点开启失败的提示消息并进行展示; The number of failures of the socket connection establishment failure is calculated, and when the number of failures exceeds a preset threshold, a prompt message indicating that the WiFi/hotspot fails to be generated is generated and displayed;
    注销所述已加载的目标固件。Log out of the loaded target firmware.
  5. 根据权利要求1所述的WiFi/热点的开启方法,其特征在于,所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接之后还包括:The method for opening a WiFi/hotspot according to claim 1, wherein the performing the socket connection between the establishing and the target firmware when the first execution time is reached further comprises:
    若所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接时socket连接建立失败,则获取预设的周期时长,并根据所述周期时长周期性的执行所述建立与所述目标固件之间的socket连接直至所述socket连接建立成功。If the socket connection fails to be established when the socket connection between the establishment and the target firmware is performed when the first execution time is reached, acquiring a preset period duration, and periodically performing according to the period duration The establishing a socket connection with the target firmware until the socket connection is successfully established.
  6. 根据权利要求1至5任一所述的方法,其特征在于,所述确定与所述WiFi/热点开启指令对应目标固件并进行加载,包括:The method according to any one of claims 1 to 5, wherein the determining and loading the target firmware corresponding to the WiFi/hotspot opening instruction comprises:
    根据所述配置文件信息确定与所述WiFi/热点开启指令对应的目标固件;其中,所述目标固件是与所述WiFi/热点的开启需要加载的相关的所有的固件;Determining, according to the profile information, target firmware corresponding to the WiFi/hotspot open command; wherein the target firmware is all firmware related to loading of the WiFi/hotspot;
    加载所述目标固件。Load the target firmware.
  7. 一种WiFi/热点的开启装置,其特征在于,包括:A device for opening a WiFi/hotspot, comprising:
    目标固件加载模块,用于接收WiFi/热点开启指令,读取与所述WiFi/热点开启指令对应的配置文件确定与所述WiFi/热点开启指令对应目标固件并进行加载;a target firmware loading module, configured to receive a WiFi/hotspot open command, and read a configuration file corresponding to the WiFi/hotspot open command to determine a target firmware corresponding to the WiFi/hotspot open command and load the target firmware;
    socket连接建立模块,用于建立与所述目标固件之间的socket连接;a socket connection establishing module, configured to establish a socket connection with the target firmware;
    平均加载时长确定模块,用于在所述socket连接建立失败时,获取与所述目标固件对应的历史加载时长,计算与所述历史加载时长的平均加载时长;An average load duration determining module, configured to acquire a historical loading duration corresponding to the target firmware when the socket connection fails to be established, and calculate an average loading duration of the historical loading duration;
    第一执行时间确定模块,用于根据所述平均加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第一执行时间,在所述第一执行时间到达时调用所述socket连接建立模块。a first execution time determining module, configured to determine, according to the average loading time, a first execution time of performing a socket connection between the establishment and the target firmware, and calling the first execution time when the first execution time is reached Socket connection building module.
  8. 根据权利要求7所述的WiFi/热点的开启装置,其特征在于,所述装置还包括第二执行时间确定模块,用于在所述socket连接建立失败时,获取与所 述目标固件加载的最近一次加载时长,根据所述最近一次加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第二执行时间,在所述第二执行时间到达时调用所述socket连接建立模块。The device for enabling a WiFi/hotspot according to claim 7, wherein the device further comprises a second execution time determining module, configured to acquire and acquire the socket connection when the socket connection fails. Determining a last loading time of the target firmware loading, determining, according to the last loading time, a second execution time of performing the socket connection between the establishment and the target firmware next time, and calling when the second execution time arrives The socket connection establishing module.
  9. 根据权利要求7所述的WiFi/热点的开启装置,其特征在于,所述装置还包括socket连接监控模块,用于监测所述socket连接是否建立成功,在所述socket连接建立失败时,调用所述socket连接建立模块。The device for opening a WiFi/hotspot according to claim 7, wherein the device further comprises a socket connection monitoring module, configured to monitor whether the socket connection is successfully established, and when the socket connection fails to be established, the device is called. The socket connection establishment module is described.
  10. 根据权利要求7所述的WiFi/热点的开启装置,其特征在于,所述装置还包括目标固件注销模块,用于计算所述socket连接建立失败的失败次数,在所述失败次数超过预设的阈值时,生成WiFi/热点开启失败的提示消息并进行展示;注销所述已加载的目标固件。The device for opening a WiFi/hotspot according to claim 7, wherein the device further comprises a target firmware unregistering module, configured to calculate a number of failures of the socket connection establishment failure, where the number of failures exceeds a preset At the threshold, a prompt message indicating that the WiFi/hotspot fails to be generated is generated and displayed; the loaded target firmware is logged out.
  11. 根据权利要求7所述的WiFi/热点的开启装置,其特征在于,所述装置还包括周期执行模块,用于在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接时socket连接建立失败时,获取预设的周期时长,并根据所述周期时长周期性的调用所述socket连接建立模块直至所述socket连接建立成功。The device for enabling WiFi/hotspot according to claim 7, wherein the device further comprises a cycle execution module, configured to perform execution between the establishment and the target firmware when the first execution time arrives When the socket connection fails to be established in the socket connection, the preset period duration is obtained, and the socket connection establishment module is periodically invoked according to the period duration until the socket connection is successfully established.
  12. 根据权利要求7至11任一所述的WiFi/热点的开启装置,其特征在于,所述目标固件加载模块,具体用于根据所述配置文件信息确定与所述WiFi/热点开启指令对应的目标固件;其中,所述目标固件是与所述WiFi/热点的开启需要加载的相关的所有的固件;以及The device for opening a WiFi/hotspot according to any one of claims 7 to 11, wherein the target firmware loading module is configured to determine a target corresponding to the WiFi/hotspot opening command according to the configuration file information. Firmware; wherein the target firmware is all firmware related to loading of the WiFi/hotspot;
    加载所述目标固件。Load the target firmware.
  13. 一种移动终端,其特征在于,包括:A mobile terminal, comprising:
    处理器和存储器;其中,所述处理器通过调用所述存储器中的代码或指令以执行如下操作:a processor and a memory; wherein the processor performs the following operations by calling code or instructions in the memory:
    接收WiFi/热点开启指令,读取与所述WiFi/热点开启指令对应的配置文件, 确定与所述WiFi/热点开启指令对应目标固件并进行加载;Receiving a WiFi/hotspot open command, and reading a configuration file corresponding to the WiFi/hotspot open command, Determining and loading the target firmware corresponding to the WiFi/hotspot opening instruction;
    建立与所述目标固件之间的socket连接;Establishing a socket connection with the target firmware;
    若所述socket连接建立失败,则获取与所述目标固件对应的历史加载时长,计算与所述历史加载时长的平均加载时长;If the socket connection fails to be established, obtaining a historical loading duration corresponding to the target firmware, and calculating an average loading duration of the historical loading duration;
    根据所述平均加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第一执行时间,在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接。Determining, according to the average loading duration, a first execution time of performing the socket connection with the target firmware next time, performing execution between the establishing and the target firmware when the first execution time arrives Socket connection.
  14. 根据权利要求13所述的移动终端,其特征在于,所述建立与所述目标固件之间的socket连接之后,所述处理器还执行以下操作:The mobile terminal according to claim 13, wherein after the establishing a socket connection with the target firmware, the processor further performs the following operations:
    在所述socket连接建立失败时,获取与所述目标固件加载的最近一次加载时长,根据所述最近一次加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第二执行时间,在所述第二执行时间到达时执行所述建立与所述目标固件之间的socket连接。When the socket connection establishment fails, obtaining a latest loading duration that is loaded with the target firmware, and determining, according to the latest loading duration, that the second execution of the socket connection between the establishment and the target firmware is performed next time. Time, performing a socket connection between the establishment and the target firmware when the second execution time arrives.
  15. 根据权利要求13所述的移动终端,其特征在于,所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接之后,所述处理器还执行以下操作:The mobile terminal according to claim 13, wherein said processor further performs the following operations after said establishing a socket connection with said target firmware upon arrival of said first execution time:
    监测所述socket连接是否建立成功,若否,则,则执行所述建立与所述目标固件之间的socket连接。Monitoring whether the socket connection is successfully established, and if not, performing the socket connection between the establishment and the target firmware.
  16. 根据权利要求13所述的移动终端,其特征在于,所述建立与所述目标固件之间的socket连接之后,所述处理器还执行如下操作:The mobile terminal according to claim 13, wherein after the establishing a socket connection with the target firmware, the processor further performs the following operations:
    计算所述socket连接建立失败的失败次数,在所述失败次数超过预设的阈值时,生成WiFi/热点开启失败的提示消息并进行展示;The number of failures of the socket connection establishment failure is calculated, and when the number of failures exceeds a preset threshold, a prompt message indicating that the WiFi/hotspot fails to be generated is generated and displayed;
    注销所述已加载的目标固件。Log out of the loaded target firmware.
  17. 根据权利要求13所述的移动终端,其特征在于,所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接之后,所述处理 器还执行以下操作:The mobile terminal according to claim 13, wherein said processing is performed after said establishing a socket connection with said target firmware is performed when said first execution time arrives It also does the following:
    若所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接时socket连接建立失败,则获取预设的周期时长,并根据所述周期时长周期性的执行所述建立与所述目标固件之间的socket连接直至所述socket连接建立成功。If the socket connection fails to be established when the socket connection between the establishment and the target firmware is performed when the first execution time is reached, acquiring a preset period duration, and periodically performing according to the period duration The establishing a socket connection with the target firmware until the socket connection is successfully established.
  18. 根据权利要求13至17任一所述的方法,其特征在于,所述确定与所述WiFi/热点开启指令对应目标固件并进行加载,包括:The method according to any one of claims 13 to 17, wherein the determining and loading the target firmware corresponding to the WiFi/hotspot opening instruction comprises:
    根据所述配置文件信息确定与所述WiFi/热点开启指令对应的目标固件;其中,所述目标固件是与所述WiFi/热点的开启需要加载的相关的所有的固件;Determining, according to the profile information, target firmware corresponding to the WiFi/hotspot open command; wherein the target firmware is all firmware related to loading of the WiFi/hotspot;
    加载所述目标固件。Load the target firmware.
  19. 一种存储介质,其特征在于,所述存储介质中存储有程序代码,当所述程序代码被执行时,处理器执行以下操作:A storage medium, wherein the storage medium stores program code, and when the program code is executed, the processor performs the following operations:
    接收WiFi/热点开启指令,读取与所述WiFi/热点开启指令对应的配置文件,确定与所述WiFi/热点开启指令对应目标固件并进行加载;Receiving a WiFi/hotspot open command, reading a configuration file corresponding to the WiFi/hotspot open command, determining a target firmware corresponding to the WiFi/hotspot open command, and loading;
    建立与所述目标固件之间的socket连接;Establishing a socket connection with the target firmware;
    若所述socket连接建立失败,则获取与所述目标固件对应的历史加载时长,计算与所述历史加载时长的平均加载时长;If the socket connection fails to be established, obtaining a historical loading duration corresponding to the target firmware, and calculating an average loading duration of the historical loading duration;
    根据所述平均加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第一执行时间,在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接。Determining, according to the average loading duration, a first execution time of performing the socket connection with the target firmware next time, performing execution between the establishing and the target firmware when the first execution time arrives Socket connection.
  20. 根据权利要求19所述的存储介质,其特征在于,所述建立与所述目标固件之间的socket连接之后,所述处理器还执行以下操作:The storage medium according to claim 19, wherein after said establishing a socket connection with said target firmware, said processor further performs the following operations:
    在所述socket连接建立失败时,获取与所述目标固件加载的最近一次加载时长,根据所述最近一次加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第二执行时间,在所述第二执行时间到达时执行所述建立与所述目标固件之间的socket连接。 When the socket connection establishment fails, obtaining a latest loading duration that is loaded with the target firmware, and determining, according to the latest loading duration, that the second execution of the socket connection between the establishment and the target firmware is performed next time. Time, performing a socket connection between the establishment and the target firmware when the second execution time arrives.
PCT/CN2017/105509 2016-12-07 2017-10-10 Method and device for enabling wi-fi/hotspot WO2018103447A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201611119593.9A CN106686627B (en) 2016-12-07 2016-12-07 WiFi/hotspot starting method and device
CN201611119593.9 2016-12-07

Publications (1)

Publication Number Publication Date
WO2018103447A1 true WO2018103447A1 (en) 2018-06-14

Family

ID=58869250

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/105509 WO2018103447A1 (en) 2016-12-07 2017-10-10 Method and device for enabling wi-fi/hotspot

Country Status (2)

Country Link
CN (1) CN106686627B (en)
WO (1) WO2018103447A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106686627B (en) * 2016-12-07 2020-01-14 Oppo广东移动通信有限公司 WiFi/hotspot starting method and device
CN109587829A (en) * 2018-11-16 2019-04-05 青岛海信电器股份有限公司 A kind of method, apparatus and terminal that terminal is used as website and hot spot to work simultaneously

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104661191A (en) * 2013-11-15 2015-05-27 深圳市快播科技有限公司 Local area network communication method, system and terminal, and information sharing device
CN105024882A (en) * 2015-07-23 2015-11-04 上海极测信息科技有限公司 C/S structure based WIFI communication testing system and method
CN105282299A (en) * 2014-06-11 2016-01-27 中兴通讯股份有限公司 Application starting device and method
CN106686627A (en) * 2016-12-07 2017-05-17 广东欧珀移动通信有限公司 WiFi/hotspot starting method and device

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6748244B2 (en) * 2001-11-21 2004-06-08 Intellisist, Llc Sharing account information and a phone number between personal mobile phone and an in-vehicle embedded phone
CN102098761B (en) * 2009-12-10 2013-08-07 华为终端有限公司 Mobile communication terminal and network access method thereof
CN102238267A (en) * 2010-04-28 2011-11-09 鸿富锦精密工业(深圳)有限公司 Mobile terminal and communication service condition conversion control method thereof
US9262347B2 (en) * 2013-10-30 2016-02-16 Intel Corporation Method, apparatus and system for measuring latency in a physical unit of a circuit
CN104702608B (en) * 2015-03-13 2018-04-06 吴培希 WiFi shared systems
CN105653008B (en) * 2015-12-29 2019-12-03 北京金山安全软件有限公司 A kind of night sleep messages reminding method, device and electronic equipment
CN106020942B (en) * 2016-05-05 2019-03-26 四川安嵌科技有限公司 A kind of WiFi equipment multiplexing method and device based on multisystem
CN106027294A (en) * 2016-05-13 2016-10-12 广东欧珀移动通信有限公司 Firmware loading method and system for terminal network access
CN105939225B (en) * 2016-06-23 2019-04-02 微梦创科网络科技(中国)有限公司 A kind of method and device that business executes

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104661191A (en) * 2013-11-15 2015-05-27 深圳市快播科技有限公司 Local area network communication method, system and terminal, and information sharing device
CN105282299A (en) * 2014-06-11 2016-01-27 中兴通讯股份有限公司 Application starting device and method
CN105024882A (en) * 2015-07-23 2015-11-04 上海极测信息科技有限公司 C/S structure based WIFI communication testing system and method
CN106686627A (en) * 2016-12-07 2017-05-17 广东欧珀移动通信有限公司 WiFi/hotspot starting method and device

Also Published As

Publication number Publication date
CN106686627A (en) 2017-05-17
CN106686627B (en) 2020-01-14

Similar Documents

Publication Publication Date Title
US9871741B2 (en) Resource management based on device-specific or user-specific resource usage profiles
US9678797B2 (en) Dynamic resource management for multi-process applications
US20140208328A1 (en) Method for terminal acceleration, terminal and storage medium
WO2018103447A1 (en) Method and device for enabling wi-fi/hotspot
US20140215497A1 (en) Mobile Terminal and Method for Adjusting Operation Load Thereof
US10142891B2 (en) Communication method using plurality of networks and device supporting the same
US11080117B2 (en) System and method for introducing functionality to an application for use with a network service
JP6388964B2 (en) Method and apparatus for reducing power consumption and mobile terminal
US20110197193A1 (en) Device and method for controlling communication between bios and bmc
WO2017162052A1 (en) Operation method and device for mobile terminal
WO2017054405A1 (en) Bluetooth paging method and device
US20210117231A1 (en) Task processing method and apparatus
US20160286594A1 (en) Method for establishing communications between peer devices, wireless communication device using the same and computer-readable medium
US20120327849A1 (en) Method for controlling network connection of wireless network device and associated wireless network device
WO2015096033A1 (en) Method for detecting whether hardware of intelligent terminal is running abnormally and intelligent terminal
CN111143031A (en) Method and device for changing capacity of virtual machine
CN106603526B (en) WiFi/hotspot starting method and device
CN110602672A (en) Bluetooth device reconnection method, device, terminal and computer readable storage medium
CN107704279B (en) Data loading method and device
US9348667B2 (en) Apparatus for managing application program and method therefor
WO2016165674A1 (en) Trusted environment operating method and device for terminal
US20140310711A1 (en) Method for determining performance of process of application and computer system
CN108563523B (en) Information callback method, equipment and storage medium
CN106933607B (en) Plug-in operation method and device
US20200374366A1 (en) Method and system for communication between two devices

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17878620

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase in:

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17878620

Country of ref document: EP

Kind code of ref document: A1