WO2018103447A1 - WiFi/热点的开启方法及装置 - Google Patents
WiFi/热点的开启方法及装置 Download PDFInfo
- 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
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W24/00—Supervisory, monitoring or testing arrangements
- H04W24/02—Arrangements for optimising operational condition
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
Definitions
- the present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for enabling a WiFi/hotspot.
- the firmware 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. .
- wifimonitor WiFi network monitor
- the socket establishment 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.
- 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. .
- a method for opening a WiFi/hotspot includes:
- 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;
- the method further includes:
- 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.
- the method further includes:
- the method further includes:
- 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;
- the method further includes:
- 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.
- the determining, corresponding to the WiFi/hotspot open command, and loading includes:
- 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.
- a WiFi/ Hotspot opening device 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.
- a WiFi/hotspot opening device includes:
- 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;
- a socket connection establishing module configured to establish a socket connection with the target firmware
- 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
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- Terminals including:
- 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:
- processor performs the following operations by calling code or instructions in the memory:
- 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;
- the processor after the establishing a socket connection with the target firmware, the processor further performs the following operations:
- the processor 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:
- the processor after the establishing a socket connection with the target firmware, the processor further performs the following operations:
- 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;
- the processor 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:
- 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.
- the determining, according to the WiFi/hotspot opening instruction, the target firmware is loaded and loaded, including:
- target firmware corresponding to the WiFi/hotspot open command; wherein the target firmware is all firmware related to loading of the WiFi/hotspot;
- 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;
- the processor after the establishing a socket connection with the target firmware, the processor further performs the following operations:
- 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.
- the processor 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:
- the processor after the establishing a socket connection with the target firmware, the processor further performs the following operations:
- 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;
- 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:
- 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.
- the determining, according to the WiFi/hotspot opening instruction, the target firmware is loaded and loaded, including:
- target firmware corresponding to the WiFi/hotspot open command; wherein the target firmware is all firmware related to loading of the WiFi/hotspot;
- 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.
- the socket connection between the firmware and the firmware is established between the firmware and the firmware.
- 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.
- 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.
- FIG. 1 is a schematic flowchart of a method for enabling a WiFi/hotspot in an embodiment
- FIG. 2 is a schematic diagram of an interface of a hotspot setting interface in an embodiment
- FIG. 3 is a schematic diagram of an interface of a WiFi setting interface in an embodiment
- FIG. 4 is a schematic structural diagram of a WiFi/hotspot opening device in an embodiment
- FIG. 5 is a schematic structural diagram of a computer device that runs the foregoing WiFi/hotspot opening method in an embodiment.
- 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.
- the method for enabling the WiFi/hotspot includes the following steps S102-S108:
- 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.
- the user can input a hotspot open request through a corresponding hotspot open button or a control in the hotspot setting interface.
- a 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.
- 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.
- a WiFi open request or a WiFi connection request through a corresponding WiFi open button or control in the WiFi settings page.
- 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.
- 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.
- Step S104 Establish a socket connection with the target firmware.
- a socket needs to be created for monitoring.
- 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.
- step S102 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- the execution time of the next attempt to establish a socket connection is determined according to the average loading duration.
- 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.
- the establishment of the socket connection may fail again.
- the socket connection should be determined. Establish a failure handling mechanism again.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- a WiFi/hotspot opening device 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:
- 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;
- a socket connection establishing module 104 configured to establish a socket connection with the target firmware
- 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;
- 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 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.
- 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 configured to monitor whether the socket connection is successfully established, and invoke the socket when the socket connection fails to be established.
- 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.
- 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.
- 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.
- a period execution module 116 configured to perform the socket connection between the establishing and the target firmware when the first execution time arrives.
- 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.
- 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.
- the socket connection between the firmware and the firmware is established between the firmware and the firmware.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- the processor 1002 is specifically configured to perform the following operations:
- 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;
- 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.
- 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.
- 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.
- 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:
- 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;
- the processor after the establishing a socket connection with the target firmware, the processor further performs the following operations:
- 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.
- the processor 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:
- the processor after the establishing a socket connection with the target firmware, the processor further performs the following operations:
- 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;
- the processor 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:
- 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.
- the determining, according to the WiFi/hotspot opening instruction, the target firmware is loaded and loaded, including:
- target firmware corresponding to the WiFi/hotspot open command; wherein the target firmware is all firmware related to loading of the WiFi/hotspot;
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Telephone Function (AREA)
- Stored Programmes (AREA)
Abstract
本发明实施例公开了一种WiFi/热点的开启方法,包括:接收WiFi/热点开启指令,读取与所述WiFi/热点开启指令对应的配置文件确定与所述WiFi/热点开启指令对应目标固件并进行加载;建立与所述目标固件之间的socket连接;若所述socket连接建立失败,则获取与所述目标固件对应的历史加载时长,计算与所述历史加载时长的平均加载时长;根据所述平均加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第一执行时间,在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接。此外,本发明实施例还公开了一种WiFi/热点的开启装置。采用本发明实施例,可提高WiFi/热点的开启速度。
Description
本发明涉及计算机技术领域,尤其涉及一种WiFi/热点的开启方法及装置。
目前大部分移动终端平台(ISO平台或者Android平台等),均配备了Wifi芯片,同时支持连接路由器上网(即STA模式)或者作为WiFi热点供他人连接(即AP模式,Access Point)。
在Android系统中,在接收到WiFi/热点的开启指令之后会去加载固件,然后创建socket进行监控,这个进行监控的模块就是wifimonitor(WiFi网络监视器),wifimonitor的作用就是建立与固件的消息通信。在建立socket的过程中,如果相应的固件没有加载完成,socket的建立就会失败;在socket建立失败的情况下,wifimonitor就会去周期性的尝试去建立与固件的socket连接,直到超时或者连接建立成功。一般情况下,Android系统中这个周期性的尝试的周期是一个固定的值,也就是说,对于不同的硬件设备,wifimonitor尝试建立与固件之间的socket连接的周期是相同的和固定不变的。但是,对于不同的硬件设备,其加载固件的速度是不一样的,如果太快就加重系统负担,而太慢就会影响wifi或者热点打开速度,因此,相同的固定不变的wifimonitor尝试建立与固件之间的socket连接的周期的设置是不合理的。
发明内容
基于此,为解决传统技术中因为设置相同的固定不变的wifimonitor尝试建立与固件之间的socket连接的周期导致的WiFi和/或热点打开的速度过慢的技术问题,特提出了一种WiFi/热点的开启方法。
一种WiFi/热点的开启方法,包括:
接收WiFi/热点开启指令,读取与所述WiFi/热点开启指令对应的配置文件确定与所述WiFi/热点开启指令对应目标固件并进行加载;
建立与所述目标固件之间的socket连接;
若所述socket连接建立失败,则获取与所述目标固件对应的历史加载时长,计算与所述历史加载时长的平均加载时长;
根据所述平均加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第一执行时间,在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接。
可选的,在其中一个实施例中,所述建立与所述目标固件之间的socket连接之后还包括:
在所述socket连接建立失败时,获取与所述目标固件加载的最近一次加载时长,根据所述最近一次加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第二执行时间,在所述第二执行时间到达时执行所述建立与所述目标固件之间的socket连接。
可选的,在其中一个实施例中,所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接之后还包括:
监测所述socket连接是否建立成功,若否,则,则执行所述建立与所述目标固件之间的socket连接。
可选的,在其中一个实施例中,所述建立与所述目标固件之间的socket连接之后还包括:
计算所述socket连接建立失败的失败次数,在所述失败次数超过预设的阈值时,生成WiFi/热点开启失败的提示消息并进行展示;
注销所述已加载的目标固件。
可选的,在其中一个实施例中,所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接之后还包括:
若所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接时socket连接建立失败,则获取预设的周期时长,并根据所述周期时长周期性的执行所述建立与所述目标固件之间的socket连接直至所述socket连接建立成功。
可选的,在其中的一个实施例中,所述确定与所述WiFi/热点开启指令对应目标固件并进行加载,包括:
根据所述配置文件信息确定与所述WiFi/热点开启指令对应的目标固件;其中,所述目标固件是与所述WiFi/热点的开启需要加载的相关的所有的固件;加载所述目标固件。
此外,为解决传统技术中因为设置相同的固定不变的wifimonitor尝试建立与固件之间的socket连接的周期导致的WiFi和/或热点打开的速度过慢的技术问题,特提出了一种WiFi/热点的开启装置。
一种WiFi/热点的开启装置,包括:
目标固件加载模块,用于接收WiFi/热点开启指令,读取与所述WiFi/热点开启指令对应的配置文件确定与所述WiFi/热点开启指令对应目标固件并进行加载;
socket连接建立模块,用于建立与所述目标固件之间的socket连接;
平均加载时长确定模块,用于在所述socket连接建立失败时,获取与所述目标固件对应的历史加载时长,计算与所述历史加载时长的平均加载时长;
第一执行时间确定模块,用于根据所述平均加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第一执行时间,在所述第一执行时间到达时调用所述socket连接建立模块。
可选的,在其中一个实施例中,所述目标固件加载模块,具体用于根据所述配置文件信息确定与所述WiFi/热点开启指令对应的目标固件;其中,所述目标固件是与所述WiFi/热点的开启需要加载的相关的所有的固件;以及加载所述目标固件。
可选的,在其中一个实施例中,所述装置还包括第二执行时间确定模块,用于在所述socket连接建立失败时,获取与所述目标固件加载的最近一次加载时长,根据所述最近一次加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第二执行时间,在所述第二执行时间到达时调用所述socket连接建立模块。
可选的,在其中一个实施例中,所述装置还包括socket连接监控模块,用于监测所述socket连接是否建立成功,在所述socket连接建立失败时,调用所述socket连接建立模块。
可选的,在其中一个实施例中,所述装置还包括目标固件注销模块,用于计算所述socket连接建立失败的失败次数,在所述失败次数超过预设的阈值时,生成WiFi/热点开启失败的提示消息并进行展示;注销所述已加载的目标固件。
可选的,在其中一个实施例中,所述装置还包括周期执行模块,用于在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接时socket连接建立失败时,获取预设的周期时长,并根据所述周期时长周期性的调用所述socket连接建立模块直至所述socket连接建立成功。
进一步的,为解决传统技术中因为设置相同的固定不变的wifimonitor尝试建立与固件之间的socket连接的周期导致的WiFi和/或热点打开的速度过慢的技术问题,还提出了一种移动终端,包括:
处理器和存储器;其中,所述处理器通过调用所述存储器中的代码或指令以执行如前所述的WiFi/热点的开启方法。
一种移动终端,包括:
处理器和存储器;其中,所述处理器通过调用所述存储器中的代码或指令以执行如下操作:
接收WiFi/热点开启指令,读取与所述WiFi/热点开启指令对应的配置文件,确定与所述WiFi/热点开启指令对应目标固件并进行加载;
建立与所述目标固件之间的socket连接;
若所述socket连接建立失败,则获取与所述目标固件对应的历史加载时长,计算与所述历史加载时长的平均加载时长;
根据所述平均加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第一执行时间,在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接。
可选的,在本发明的一个实施例中,所述建立与所述目标固件之间的socket连接之后,所述处理器还执行以下操作:
在所述socket连接建立失败时,获取与所述目标固件加载的最近一次加载
时长,根据所述最近一次加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第二执行时间,在所述第二执行时间到达时执行所述建立与所述目标固件之间的socket连接。
可选的,在本发明的一个实施例中,所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接之后,所述处理器还执行以下操作:
监测所述socket连接是否建立成功,若否,则,则执行所述建立与所述目标固件之间的socket连接。
可选的,在本发明的一个实施例中,所述建立与所述目标固件之间的socket连接之后,所述处理器还执行如下操作:
计算所述socket连接建立失败的失败次数,在所述失败次数超过预设的阈值时,生成WiFi/热点开启失败的提示消息并进行展示;
注销所述已加载的目标固件。
可选的,在本发明的一个实施例中,所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接之后,所述处理器还执行以下操作:
若所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接时socket连接建立失败,则获取预设的周期时长,并根据所述周期时长周期性的执行所述建立与所述目标固件之间的socket连接直至所述socket连接建立成功。
可选的,在本发明的一个实施例中,所述确定与所述WiFi/热点开启指令对应目标固件并进行加载,包括:
根据所述配置文件信息确定与所述WiFi/热点开启指令对应的目标固件;其中,所述目标固件是与所述WiFi/热点的开启需要加载的相关的所有的固件;
加载所述目标固件。
一种存储介质,所述存储介质中存储有程序代码,当所述程序代码被执行
时,处理器执行以下操作:
接收WiFi/热点开启指令,读取与所述WiFi/热点开启指令对应的配置文件,确定与所述WiFi/热点开启指令对应目标固件并进行加载;
建立与所述目标固件之间的socket连接;
若所述socket连接建立失败,则获取与所述目标固件对应的历史加载时长,计算与所述历史加载时长的平均加载时长;
根据所述平均加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第一执行时间,在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接。
可选的,在本发明的一个实施例中,所述建立与所述目标固件之间的socket连接之后,所述处理器还执行以下操作:
在所述socket连接建立失败时,获取与所述目标固件加载的最近一次加载时长,根据所述最近一次加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第二执行时间,在所述第二执行时间到达时执行所述建立与所述目标固件之间的socket连接。
可选的,在本发明的一个实施例中,所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接之后,所述处理器还执行以下操作:
监测所述socket连接是否建立成功,若否,则,则执行所述建立与所述目标固件之间的socket连接。
可选的,在本发明的一个实施例中,所述建立与所述目标固件之间的socket连接之后,所述处理器还执行如下操作:
计算所述socket连接建立失败的失败次数,在所述失败次数超过预设的阈值时,生成WiFi/热点开启失败的提示消息并进行展示;
注销所述已加载的目标固件。
可选的,在本发明的一个实施例中,所述在所述第一执行时间到达时执行
所述建立与所述目标固件之间的socket连接之后,所述处理器还执行以下操作:
若所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接时socket连接建立失败,则获取预设的周期时长,并根据所述周期时长周期性的执行所述建立与所述目标固件之间的socket连接直至所述socket连接建立成功。
可选的,在本发明的一个实施例中,所述确定与所述WiFi/热点开启指令对应目标固件并进行加载,包括:
根据所述配置文件信息确定与所述WiFi/热点开启指令对应的目标固件;其中,所述目标固件是与所述WiFi/热点的开启需要加载的相关的所有的固件;
加载所述目标固件。
实施本发明实施例,将具有如下有益效果:
采用了上述WiFi/热点的开启方法和装置之后,在接收到WiFi/热点开启指令之后即加载与开启WiFi/热点的相应的固件,并通过建立与固件之间的socket连接来建立与固件之间的消息通信;若上述socket连接建立失败,则说明固件加载还未完成,在此种情况下,根据当前终端历史加载固件的时长来估计本次固件加载的时长并在该时长达到时再次尝试建立socket连接。相较于传统技术中在第一建立socket连接失败后按照固定的周期尝试建立socket连接的技术方案来讲,根据终端的历史加载固件的速度来估算终端当前加载固件的时间并按照该时间来确定再次socket连接建立的时间的方案,避免了过大的周期时长影响WiFi/热点的开启的速度,也避免了过小的周期时长加重了终端系统的负担,加快了WiFi/热点的开启速度,并减轻了终端系统的负担,提升了用户体验。
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
其中:
图1为一个实施例中一种WiFi/热点的开启方法的流程示意图;
图2为一个实施例中一种热点设置界面的界面示意图;
图3为一个实施例中一种WiFi设置界面的界面示意图;
图4为一个实施例中一种WiFi/热点的开启装置的结构示意图;
图5为一个实施例中运行前述WiFi/热点的开启方法的计算机设备的结构示意图。
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
为解决传统技术中因为设置相同的固定不变的wifimonitor尝试建立与固件之间的socket连接的周期导致的WiFi和/或热点打开的速度过慢的技术问题,在本实施例中,特提出了一种WiFi/热点的开启方法,该方法的实现可依赖于计算机程序,该计算机程序可运行于基于冯诺依曼体系的计算机系统之上,该计算机系统可以是智能手机、笔记本电脑、平板电脑等安装有无线网卡或Wi-Fi芯片的支持AP模式和STA模式的计算机设备。该计算机程序可以是智能手机或平板电脑等智能终端上的Wi-Fi连接管理程序或热点管理程序等计算机程序。具体的,如图1所示,上述WiFi/热点的开启方法包括如下步骤S102-S108:
步骤S102:接收WiFi/热点开启指令,读取与所述WiFi/热点开启指令对应的配置文件确定与所述WiFi/热点开启指令对应目标固件并进行加载。
在本实施例中,用户可以通过热点设置界面中相应的热点开启按钮或控件输入热点开启请求,例如,在如图2所示的热点设置页面中,用户可以通过编号A所示的按钮输入热点开启请求。
在另一个实施例中,用户可以通过WiFi设置页面中相应的WiFi开启按钮或控件输入WiFi开启请求或WiFi连接请求,例如,在如图3所示的热点设置页面中,用户可以通过编号B所示的按钮输入WiFi开启请求,开启WiFi并
扫描周围环境中的WiFi;或者,可以通过选择编号C所示的区域中展示的多个WiFi标识来连接入该WIFi标识对应的无线WiFi。
在接收到用户输入的WiFi/热点开启请求之后,首先需要读取WiFi热点对应的配置文件信息,然后根据配置文件信息去加载与WiFi热点的开启需要加载的相关的所有的固件,即目标固件,并加载上述目标固件。
步骤S104:建立与所述目标固件之间的socket连接。
在本实施例中,在开启WiFi/热点的过程中,需要创建socket进行监控,在Android系统中,该进行监控的模块即为WiFimonitor,即建立应用层与WiFi或热点对应的加载的固件之间的消息通信。一般情况下,在接收到WiFi/热点开启指令之后即开始创建上述应用层与目标固件之间的socket连接以对终端的消息通讯进行监控。但是,若步骤S102中加载的目标固件没有加载成功,则在建立与目标固件的socket连接的过程中会建立失败;反之,若在执行步骤S104之前,目标固件已经加载成功,则本步骤中socket连接建立成功,socket连接建立成功则说明开启WiFi/热点的所有进程已经执行完毕,WiFi/热点成功开启。
步骤S106:若所述socket连接建立失败,则获取与所述目标固件对应的历史加载时长,计算与所述历史加载时长的平均加载时长。
在本实施例中,若socket连接建立失败,则需要重新尝试建立socket连接直至超过或者socket连接建立成功。在传统技术中,在重新尝试建立socket连接的过程中,是按照预设的轮询周期进行的,并且,该轮询周期是固定的,对于不同的终端,其轮询周期也是一样的,但是,不同的终端设备的处理能力不同,因此,在进行处理的过程中应当考虑各个不同的设备的处理能力。
具体的,在本实施例中,获取在终端中存储的或者缓存的与WiFi连接或者热点开启的过程中加载固件的历史记录,在该加载固件的历史记录中包含了每一次加载固件的加载时长。上述历史记录以及历史记录中包含的每一次加载固件的加载时长代表了当前终端的历史加载固件的情况,反映了终端加载固件的能力和处理速度。
在本实施例中,根据历史记录以及历史记录中包含的每一次加载固件的加载时长(即历史加载时长),计算与历史加载时长对应的平均加载时长;即根
据历史记录中包含的每一次加载固件的加载时长的平均值作为平均加载时长,该平均加载时长反映了该终端对于固件加载的平均能力。
需要说明的是,在本实施例中,上述获取的历史加载时长还可以是一定时间范围内的,因为终端系统的损耗以及终端上安装的应用的改变,终端系统的处理能力会随着时间的推移而改变,因此,过久之前的目标固件的加载时长对于确定终端当前的固件加载速度的评估并不具备可靠性,因此,在本实施例中,上述获取的历史加载时长为预设的时间之内的历史加载时长或者预设的加载次数之内的历史加载时长。
步骤S108:根据所述平均加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第一执行时间,在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接。
在本实施例中,不同于传统技术中预设的轮询周期来确定在建立socket连接失败之后的再次尝试建立socket连接的时间,而是通过上述步骤S106中根据加载目标固件的历史加载时长确定的平均加载时长来确定再次尝试建立socket连接的时间。
具体的,根据平均加载时长来确定下一次尝试建立socket连接的执行时间,即第一执行时间。例如,在一个实施例中,根据固件加载的开始时间以及平均加载时长来确定第一执行时间。并且,在第一执行时间到达时,再次尝试建立socket连接。
在本实施例中,因为在第一执行时间到达时,目标固件的加载也有可能还未完成,在此种情况下,socket连接的建立可能会再次失败,在此种情况下,应该确定socket连接再次建立失败的处理机制。
在一个可选的实施例中,上述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接之后还包括:监测所述socket连接是否建立成功,若否,则,则执行所述建立与所述目标固件之间的socket连接。
在一个可选的实施例中,所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接之后还包括:若所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接时socket连接建立失败,则循环执行所述建立与所述目标固件之间的socket连接直至所述socket连接建立
成功。
也就是说,若步骤S108中再次建立socket连接的过程中再次失败,则不断重新尝试socket连接的建立直至socket连接建立成功,按照历史加载时长可以确定,就算在步骤S108中socket连接建立失败,其目标固件的加载应该已经快完成,因此,为了加快WiFi/热点的开启速度,可以不断的重新尝试socket连接的建立直至socket连接建立成功。
在另一个实施例中,所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接之后还包括:若所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接时socket连接建立失败,则获取预设的周期时长,并根据所述周期时长周期性的执行所述建立与所述目标固件之间的socket连接直至所述socket连接建立成功。
也就是说,在本实施例中,在步骤S108中再次建立socket失败之后,虽说目标固件的加载可能快完成,但是也要考虑其他因素的影响,减少对系统资源的占用。即,按照预设的周期时长(例如,0.5s)来周期性的尝试socket连接的建立直至socket连接建立成功,在保证了WiFi/热点开启的速度的前提下,也减少了对系统资源的过度占用。
在本实施例中,在socket连接的建立过程中,还可能出现另外一种情况,即不断的出现socket连接建立失败的情况,并且socket连接建立的失败不是因为目标固件的未加载成功导致的,而是因为其他原因,在此种情况下,持续不断的尝试socket连接的建立直至socket连接建立成功是不可取的,所以,还应当建立一种Socket连接建立的放弃机制。
具体的,在一个可选的实施例中,所述建立与所述目标固件之间的socket连接之后还包括:计算所述socket连接建立失败的失败次数,在所述失败次数超过预设的阈值时,生成WiFi/热点开启失败的提示消息并进行展示;注销所述已加载的目标固件。
具体的,在建立socket连接的过程中,统计socket连接建立失败的失败次数,并且,在该失败次数超过预设的阈值的情况下,即说明了socket连接的建立已经尝试了足够次数和时间,但还是建立失败,在此种情况下,可放弃socket连接的建立,并且生成WiFi/热点开启失败的提示消息,用来提示用户WiFi/
热点开启失败,请重新尝试。进一步地,为了减少不必要的对系统资源的占用,对于步骤S102中已经加载的目标固件进行注销,以释放占用的系统资源。
在另一个可选的实施例中,上述根据目标固件的历史加载时长来确定下一次执行建立与所述目标固件之间的socket连接的执行时间的过程中,下一次执行建立与所述目标固件之间的socket连接的执行时间的确定还可以通过其他方式确定。
具体的,在一个实施例中,所述建立与所述目标固件之间的socket连接之后还包括:在所述socket连接建立失败时,获取与所述目标固件加载的最近一次加载时长,根据所述最近一次加载时长确定下一次执行所述的第二执行时间,在所述第二执行时间到达时执行所述建立与所述目标固件之间的socket连接。
也就是说,用上一次加载目标固件的加载时长来估算本次加载目标固件的加载时长,因为,上一次加载目标固件的终端环境与本地加载目标固件的终端环境较为接近,更能代表终端当前的处理能力或固件加载能力。
此外,为解决传统技术中因为设置相同的固定不变的wifimonitor尝试建立与固件之间的socket连接的周期导致的WiFi和/或热点打开的速度过慢的技术问题,在一个实施例中,如图4所示,还提出了一种WiFi/热点的开启装置,包括目标固件加载模块102、socket连接建立模块104、平均加载时长确定模块106以及第一执行时间确定模块108,其中:
目标固件加载模块102,用于接收WiFi/热点开启指令,读取与所述WiFi/热点开启指令对应的配置文件确定与所述WiFi/热点开启指令对应目标固件并进行加载;
socket连接建立模块104,用于建立与所述目标固件之间的socket连接;
平均加载时长确定模块106,用于在所述socket连接建立失败时,获取与所述目标固件对应的历史加载时长,计算与所述历史加载时长的平均加载时长;
第一执行时间确定模块108,用于根据所述平均加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第一执行时间,在所述第一执行时间到达时调用所述socket连接建立模块。
可选的,在本实施例中,如图4所示,上述装置还包括第二执行时间确定
模块110,用于在所述socket连接建立失败时,获取与所述目标固件加载的最近一次加载时长,根据所述最近一次加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第二执行时间,在所述第二执行时间到达时调用所述socket连接建立模块104。
可选的,在本实施例中,如图4所示,上述装置还包括socket连接监控模块112,用于监测所述socket连接是否建立成功,在所述socket连接建立失败时,调用所述socket连接建立模块104。
可选的,在本实施例中,如图4所示,上述装置还包括目标固件注销模块114,用于计算所述socket连接建立失败的失败次数,在所述失败次数超过预设的阈值时,生成WiFi/热点开启失败的提示消息并进行展示;注销所述已加载的目标固件。
可选的,在本实施例中,如图4所示,上述装置还包括周期执行模块116,用于在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接时socket连接建立失败时,获取预设的周期时长,并根据所述周期时长周期性的调用所述socket连接建立模块直至所述socket连接建立成功。
实施本发明实施例,将具有如下有益效果:
采用了上述WiFi/热点的开启方法和装置之后,在接收到WiFi/热点开启指令之后即加载与开启WiFi/热点的相应的固件,并通过建立与固件之间的socket连接来建立与固件之间的消息通信;若上述socket连接建立失败,则说明固件加载还未完成,在此种情况下,根据当前终端历史加载固件的时长来估计本次固件加载的时长并在该时长达到时再次尝试建立socket连接。相较于传统技术中在第一建立socket连接失败后按照固定的周期尝试建立socket连接的技术方案来讲,根据终端的历史加载固件的速度来估算终端当前加载固件的时间并按照该时间来确定再次socket连接建立的时间的方案,避免了过大的周期时长影响WiFi/热点的开启的速度,也避免了过小的周期时长加重了终端系统的负担,加快了WiFi/热点的开启速度,并减轻了终端系统的负担,提升了用户体验。
在一个实施例中,如图5所示,图5展示了一种运行上述WiFi/热点的开
启方法的基于冯诺依曼体系的计算机系统的终端。该计算机系统可以是包含有WiFi芯片的可以连接WiFi热点的智能手机、平板电脑、掌上电脑、笔记本电脑或个人电脑等终端设备。具体的,可包括通过系统总线连接的外部输入接口1001、处理器1002、存储器1003和输出接口1004。其中,外部输入接口1001可选的可至少包括网络接口10012(在本实施例中,即为WiFi芯片)。存储器1003可包括外存储器10032(例如硬盘、光盘或软盘等)和内存储器10034。输出接口1004可至少包括显示屏10042等设备。
在本实施例中,本方法的运行基于计算机程序,该计算机程序的程序文件存储于前述基于冯诺依曼体系的计算机系统的外存储器10032中,在运行时被加载到内存储器10034中,然后被编译为机器码之后传递至处理器1002中执行,从而使得基于冯诺依曼体系的计算机系统中形成逻辑上的目标固件加载模块102、socket连接建立模块104、平均加载时长确定模块106、第一执行时间确定模块108、第二执行时间确定模块110、socket连接监控模块112、目标固件注销模块114以及周期执行模块116。且在上述WiFi/热点的开启方法执行过程中,输入的参数均通过外部输入接口1001接收,并传递至存储器1003中缓存,然后输入到处理器1002中进行处理,处理的结果数据或缓存于存储器1003中进行后续地处理,或被传递至输出接口1004进行输出。
具体的,在本实施例中,上述处理器1002具体用于执行如下操作:
接收WiFi/热点开启指令,读取与所述WiFi/热点开启指令对应的配置文件确定与所述WiFi/热点开启指令对应目标固件并进行加载;
建立与所述目标固件之间的socket连接;
若所述socket连接建立失败,则获取与所述目标固件对应的历史加载时长,计算与所述历史加载时长的平均加载时长;
根据所述平均加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第一执行时间,在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接。
可选的,在一个实施例中,上述处理器1002还用于在所述socket连接建立失败时,获取与所述目标固件加载的最近一次加载时长,根据所述最近一次加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第二
执行时间,在所述第二执行时间到达时执行所述建立与所述目标固件之间的socket连接。
可选的,在一个实施例中,上述处理器1002还用于监测所述socket连接是否建立成功,若否,则,则执行所述建立与所述目标固件之间的socket连接。
可选的,在一个实施例中,上述处理器1002还用于计算所述socket连接建立失败的失败次数,在所述失败次数超过预设的阈值时,生成WiFi/热点开启失败的提示消息并进行展示;注销所述已加载的目标固件。
可选的,在一个实施例中,上述处理器1002还用于若所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接时socket连接建立失败,则获取预设的周期时长,并根据所述周期时长周期性的执行所述建立与所述目标固件之间的socket连接直至所述socket连接建立成功。
本发明还提供了一种存储介质,所述存储介质中存储有程序代码,当所述程序代码被执行时,处理器执行以下操作:
接收WiFi/热点开启指令,读取与所述WiFi/热点开启指令对应的配置文件,确定与所述WiFi/热点开启指令对应目标固件并进行加载;
建立与所述目标固件之间的socket连接;
若所述socket连接建立失败,则获取与所述目标固件对应的历史加载时长,计算与所述历史加载时长的平均加载时长;
根据所述平均加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第一执行时间,在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接。
可选的,在本发明的一个实施例中,所述建立与所述目标固件之间的socket连接之后,所述处理器还执行以下操作:
在所述socket连接建立失败时,获取与所述目标固件加载的最近一次加载时长,根据所述最近一次加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第二执行时间,在所述第二执行时间到达时执行所述建立与所述目标固件之间的socket连接。
可选的,在本发明的一个实施例中,所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接之后,所述处理器还执行以下操作:
监测所述socket连接是否建立成功,若否,则,则执行所述建立与所述目标固件之间的socket连接。
可选的,在本发明的一个实施例中,所述建立与所述目标固件之间的socket连接之后,所述处理器还执行如下操作:
计算所述socket连接建立失败的失败次数,在所述失败次数超过预设的阈值时,生成WiFi/热点开启失败的提示消息并进行展示;
注销所述已加载的目标固件。
可选的,在本发明的一个实施例中,所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接之后,所述处理器还执行以下操作:
若所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接时socket连接建立失败,则获取预设的周期时长,并根据所述周期时长周期性的执行所述建立与所述目标固件之间的socket连接直至所述socket连接建立成功。
可选的,在本发明的一个实施例中,所述确定与所述WiFi/热点开启指令对应目标固件并进行加载,包括:
根据所述配置文件信息确定与所述WiFi/热点开启指令对应的目标固件;其中,所述目标固件是与所述WiFi/热点的开启需要加载的相关的所有的固件;
加载所述目标固件。
以上所揭露的仅为本发明较佳实施例而已,当然不能以此来限定本发明之权利范围,因此依本发明权利要求所作的等同变化,仍属本发明所涵盖的范围。
Claims (20)
- 一种WiFi/热点的开启方法,其特征在于,包括:接收WiFi/热点开启指令,读取与所述WiFi/热点开启指令对应的配置文件,确定与所述WiFi/热点开启指令对应目标固件并进行加载;建立与所述目标固件之间的socket连接;若所述socket连接建立失败,则获取与所述目标固件对应的历史加载时长,计算与所述历史加载时长的平均加载时长;根据所述平均加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第一执行时间,在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接。
- 根据权利要求1所述的WiFi/热点的开启方法,其特征在于,所述建立与所述目标固件之间的socket连接之后还包括:在所述socket连接建立失败时,获取与所述目标固件加载的最近一次加载时长,根据所述最近一次加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第二执行时间,在所述第二执行时间到达时执行所述建立与所述目标固件之间的socket连接。
- 根据权利要求1所述的WiFi/热点的开启方法,其特征在于,所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接之后还包括:监测所述socket连接是否建立成功,若否,则,则执行所述建立与所述目标固件之间的socket连接。
- 根据权利要求1所述的WiFi/热点的开启方法,其特征在于,所述建立与所述目标固件之间的socket连接之后还包括:计算所述socket连接建立失败的失败次数,在所述失败次数超过预设的阈值时,生成WiFi/热点开启失败的提示消息并进行展示;注销所述已加载的目标固件。
- 根据权利要求1所述的WiFi/热点的开启方法,其特征在于,所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接之后还包括:若所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接时socket连接建立失败,则获取预设的周期时长,并根据所述周期时长周期性的执行所述建立与所述目标固件之间的socket连接直至所述socket连接建立成功。
- 根据权利要求1至5任一所述的方法,其特征在于,所述确定与所述WiFi/热点开启指令对应目标固件并进行加载,包括:根据所述配置文件信息确定与所述WiFi/热点开启指令对应的目标固件;其中,所述目标固件是与所述WiFi/热点的开启需要加载的相关的所有的固件;加载所述目标固件。
- 一种WiFi/热点的开启装置,其特征在于,包括:目标固件加载模块,用于接收WiFi/热点开启指令,读取与所述WiFi/热点开启指令对应的配置文件确定与所述WiFi/热点开启指令对应目标固件并进行加载;socket连接建立模块,用于建立与所述目标固件之间的socket连接;平均加载时长确定模块,用于在所述socket连接建立失败时,获取与所述目标固件对应的历史加载时长,计算与所述历史加载时长的平均加载时长;第一执行时间确定模块,用于根据所述平均加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第一执行时间,在所述第一执行时间到达时调用所述socket连接建立模块。
- 根据权利要求7所述的WiFi/热点的开启装置,其特征在于,所述装置还包括第二执行时间确定模块,用于在所述socket连接建立失败时,获取与所 述目标固件加载的最近一次加载时长,根据所述最近一次加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第二执行时间,在所述第二执行时间到达时调用所述socket连接建立模块。
- 根据权利要求7所述的WiFi/热点的开启装置,其特征在于,所述装置还包括socket连接监控模块,用于监测所述socket连接是否建立成功,在所述socket连接建立失败时,调用所述socket连接建立模块。
- 根据权利要求7所述的WiFi/热点的开启装置,其特征在于,所述装置还包括目标固件注销模块,用于计算所述socket连接建立失败的失败次数,在所述失败次数超过预设的阈值时,生成WiFi/热点开启失败的提示消息并进行展示;注销所述已加载的目标固件。
- 根据权利要求7所述的WiFi/热点的开启装置,其特征在于,所述装置还包括周期执行模块,用于在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接时socket连接建立失败时,获取预设的周期时长,并根据所述周期时长周期性的调用所述socket连接建立模块直至所述socket连接建立成功。
- 根据权利要求7至11任一所述的WiFi/热点的开启装置,其特征在于,所述目标固件加载模块,具体用于根据所述配置文件信息确定与所述WiFi/热点开启指令对应的目标固件;其中,所述目标固件是与所述WiFi/热点的开启需要加载的相关的所有的固件;以及加载所述目标固件。
- 一种移动终端,其特征在于,包括:处理器和存储器;其中,所述处理器通过调用所述存储器中的代码或指令以执行如下操作:接收WiFi/热点开启指令,读取与所述WiFi/热点开启指令对应的配置文件, 确定与所述WiFi/热点开启指令对应目标固件并进行加载;建立与所述目标固件之间的socket连接;若所述socket连接建立失败,则获取与所述目标固件对应的历史加载时长,计算与所述历史加载时长的平均加载时长;根据所述平均加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第一执行时间,在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接。
- 根据权利要求13所述的移动终端,其特征在于,所述建立与所述目标固件之间的socket连接之后,所述处理器还执行以下操作:在所述socket连接建立失败时,获取与所述目标固件加载的最近一次加载时长,根据所述最近一次加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第二执行时间,在所述第二执行时间到达时执行所述建立与所述目标固件之间的socket连接。
- 根据权利要求13所述的移动终端,其特征在于,所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接之后,所述处理器还执行以下操作:监测所述socket连接是否建立成功,若否,则,则执行所述建立与所述目标固件之间的socket连接。
- 根据权利要求13所述的移动终端,其特征在于,所述建立与所述目标固件之间的socket连接之后,所述处理器还执行如下操作:计算所述socket连接建立失败的失败次数,在所述失败次数超过预设的阈值时,生成WiFi/热点开启失败的提示消息并进行展示;注销所述已加载的目标固件。
- 根据权利要求13所述的移动终端,其特征在于,所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接之后,所述处理 器还执行以下操作:若所述在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接时socket连接建立失败,则获取预设的周期时长,并根据所述周期时长周期性的执行所述建立与所述目标固件之间的socket连接直至所述socket连接建立成功。
- 根据权利要求13至17任一所述的方法,其特征在于,所述确定与所述WiFi/热点开启指令对应目标固件并进行加载,包括:根据所述配置文件信息确定与所述WiFi/热点开启指令对应的目标固件;其中,所述目标固件是与所述WiFi/热点的开启需要加载的相关的所有的固件;加载所述目标固件。
- 一种存储介质,其特征在于,所述存储介质中存储有程序代码,当所述程序代码被执行时,处理器执行以下操作:接收WiFi/热点开启指令,读取与所述WiFi/热点开启指令对应的配置文件,确定与所述WiFi/热点开启指令对应目标固件并进行加载;建立与所述目标固件之间的socket连接;若所述socket连接建立失败,则获取与所述目标固件对应的历史加载时长,计算与所述历史加载时长的平均加载时长;根据所述平均加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第一执行时间,在所述第一执行时间到达时执行所述建立与所述目标固件之间的socket连接。
- 根据权利要求19所述的存储介质,其特征在于,所述建立与所述目标固件之间的socket连接之后,所述处理器还执行以下操作:在所述socket连接建立失败时,获取与所述目标固件加载的最近一次加载时长,根据所述最近一次加载时长确定下一次执行所述建立与所述目标固件之间的socket连接的第二执行时间,在所述第二执行时间到达时执行所述建立与所述目标固件之间的socket连接。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201611119593.9 | 2016-12-07 | ||
| CN201611119593.9A CN106686627B (zh) | 2016-12-07 | 2016-12-07 | WiFi/热点的开启方法及装置 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2018103447A1 true WO2018103447A1 (zh) | 2018-06-14 |
Family
ID=58869250
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2017/105509 Ceased WO2018103447A1 (zh) | 2016-12-07 | 2017-10-10 | WiFi/热点的开启方法及装置 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN106686627B (zh) |
| WO (1) | WO2018103447A1 (zh) |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106686627B (zh) * | 2016-12-07 | 2020-01-14 | Oppo广东移动通信有限公司 | WiFi/热点的开启方法及装置 |
| CN109587829B (zh) * | 2018-11-16 | 2022-01-11 | 海信视像科技股份有限公司 | 一种终端同时作为站点和热点工作的方法、装置及终端 |
| CN113986413A (zh) * | 2021-09-22 | 2022-01-28 | 阿里巴巴(中国)有限公司 | 页面显示方法、装置、设备及存储介质 |
| CN115623514A (zh) * | 2022-10-09 | 2023-01-17 | Oppo广东移动通信有限公司 | 无线网络热点的配置方法和终端设备 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104661191A (zh) * | 2013-11-15 | 2015-05-27 | 深圳市快播科技有限公司 | 局域网通信方法、系统、终端及信息分享装置 |
| CN105024882A (zh) * | 2015-07-23 | 2015-11-04 | 上海极测信息科技有限公司 | 基于c/s架构的wifi通讯测试系统及方法 |
| CN105282299A (zh) * | 2014-06-11 | 2016-01-27 | 中兴通讯股份有限公司 | 一种应用启动装置与方法 |
| CN106686627A (zh) * | 2016-12-07 | 2017-05-17 | 广东欧珀移动通信有限公司 | WiFi/热点的开启方法及装置 |
Family Cites Families (9)
| 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 (zh) * | 2009-12-10 | 2013-08-07 | 华为终端有限公司 | 移动通信终端的网络接入方法及移动通信终端 |
| CN102238267A (zh) * | 2010-04-28 | 2011-11-09 | 鸿富锦精密工业(深圳)有限公司 | 移动终端及其通讯使用状态转换控制方法 |
| EP3719659B1 (en) * | 2013-10-30 | 2023-10-04 | INTEL Corporation | A method, apparatus and system for measuring latency in a physical unit of a circuit |
| CN104702608B (zh) * | 2015-03-13 | 2018-04-06 | 吴培希 | WiFi共享系统 |
| CN105653008B (zh) * | 2015-12-29 | 2019-12-03 | 北京金山安全软件有限公司 | 一种夜间休眠消息提示方法、装置及电子设备 |
| CN106020942B (zh) * | 2016-05-05 | 2019-03-26 | 四川安嵌科技有限公司 | 一种基于多系统的WiFi设备复用方法及装置 |
| CN106027294A (zh) * | 2016-05-13 | 2016-10-12 | 广东欧珀移动通信有限公司 | 终端网络接入的固件加载方法和系统 |
| CN105939225B (zh) * | 2016-06-23 | 2019-04-02 | 微梦创科网络科技(中国)有限公司 | 一种业务执行的方法及装置 |
-
2016
- 2016-12-07 CN CN201611119593.9A patent/CN106686627B/zh not_active Expired - Fee Related
-
2017
- 2017-10-10 WO PCT/CN2017/105509 patent/WO2018103447A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104661191A (zh) * | 2013-11-15 | 2015-05-27 | 深圳市快播科技有限公司 | 局域网通信方法、系统、终端及信息分享装置 |
| CN105282299A (zh) * | 2014-06-11 | 2016-01-27 | 中兴通讯股份有限公司 | 一种应用启动装置与方法 |
| CN105024882A (zh) * | 2015-07-23 | 2015-11-04 | 上海极测信息科技有限公司 | 基于c/s架构的wifi通讯测试系统及方法 |
| CN106686627A (zh) * | 2016-12-07 | 2017-05-17 | 广东欧珀移动通信有限公司 | WiFi/热点的开启方法及装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN106686627B (zh) | 2020-01-14 |
| CN106686627A (zh) | 2017-05-17 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10182018B2 (en) | Resource management based on device-specific or user-specific resource usage profiles | |
| CN113590282B (zh) | 算力调度方法、系统、电子设备及计算机可读存储介质 | |
| JP5902355B2 (ja) | コンピューティング装置の無線の再接続所要時間を削減するための混合範囲外/範囲内予測計算 | |
| EP3800589A1 (en) | Task processing method and apparatus | |
| US20140208328A1 (en) | Method for terminal acceleration, terminal and storage medium | |
| WO2018103447A1 (zh) | WiFi/热点的开启方法及装置 | |
| WO2015138150A1 (en) | Dynamic resource management for multi-process applications | |
| US8782643B2 (en) | Device and method for controlling communication between BIOS and BMC | |
| CN111314445A (zh) | 手机控制回收机开门方法及装置 | |
| CN109901881B (zh) | 应用程序的插件加载方法、装置、计算机设备及存储介质 | |
| CN111277659A (zh) | 手机横屏竖屏显示状态检测方法及装置 | |
| KR20130108613A (ko) | 프로세스 간 통신을 위한 방법, 장치 및 컴퓨터 기록 매체 | |
| CN111143031A (zh) | 一种虚拟机的容量更改方法及装置 | |
| US20160286594A1 (en) | Method for establishing communications between peer devices, wireless communication device using the same and computer-readable medium | |
| EP4485877A1 (en) | Method and electronic device for controlling scaling in virtualized radio access network | |
| US20120327849A1 (en) | Method for controlling network connection of wireless network device and associated wireless network device | |
| CN106603526B (zh) | WiFi/热点的开启方法及装置 | |
| WO2017162052A1 (zh) | 移动终端的工作方法及装置 | |
| KR102705465B1 (ko) | 이상 처리 방법, 단말 기기 및 저장 매체 | |
| CN111796949A (zh) | 通讯任务处理方法、装置、设备及存储介质 | |
| WO2017054405A1 (zh) | 一种蓝牙寻呼方法和装置 | |
| CN114356799B (zh) | 数据存储方法、装置、系统与计算机可读存储介质 | |
| CN116450388B (zh) | 看门狗检测方法、设备及存储介质 | |
| CN112416555B (zh) | 一种客户端重启方法及设备、装置、存储介质 | |
| CN114024878A (zh) | 数据传输方法、装置、介质和设备 |
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 |
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 |