Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
At present, with the development of wireless communication technologies such as Bluetooth Low Energy (BLE) and wifi antenna, applications based on the wireless communication technologies are increasing, for example, an offline payment scene based on a Beacon (Beacon) and an access control application scene based on Beacon. In these application scenarios, the user does not need to scan the two-dimensional code, perform a corresponding touch operation through an interface of an application program, or align a scanning device with a mobile phone, and the like, and only needs to locate the mobile terminal within a radiation range of broadcast information of a broadcasting device (e.g., a payment device, a gate access device, and the like), and then perform related identity information verification (e.g., face information verification, fingerprint information verification, and the like) to realize offline payment, gate opening, gate access opening, and the like, which is very convenient for the user to use, and thus is popular with the user. In the application scenarios such as the payment scenario, the gate scenario, the access control scenario and the like based on the wireless communication technology, broadcast equipment (for example, payment equipment, gate equipment, broadcast equipment and the like) can send broadcast messages, and mobile terminals around the broadcast equipment scan the broadcast messages, so that after receiving the broadcast messages, the mobile terminals can perform corresponding operations according to the broadcast messages, and complete off-line payment, gate opening, access control opening and the like.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating a verification system of a scan control method according to an embodiment of the present disclosure. The system shown in fig. 1 includes a mobile terminal 100, a broadcasting device 200, and a server 300. The mobile terminal 100 may be a mobile phone or a tablet computer, and the mobile terminal 100 stores an account pre-bound by a user. The broadcasting apparatus 200 is configured to collect authentication information of a user and transmit the authentication information to the server 300, and the server 300 is configured to perform a verification operation according to the received authentication information.
During the operation of the system, the broadcasting device 200 may transmit the broadcast message in the set wireless communication mode, wherein the dotted circle around the broadcasting device 200 in fig. 1 represents the coverage of the broadcast message transmitted by the broadcasting device 200. Optionally, the wireless communication mode includes a bluetooth BLE mode or a wifi Aware mode. Accordingly, the mobile terminal 100 may search for nearby wireless signals in the set wireless communication mode, so that when the mobile terminal 100 comes within the range of the dotted circle shown in fig. 1, it may receive the broadcast message transmitted by the broadcasting device 200.
As one way, after the mobile terminal 100 may receive the broadcast message sent by the broadcasting device 200, the mobile terminal 100 may establish a wireless connection with the broadcasting device 200 based on a currently used wireless communication mode, and after the wireless connection is established, the mobile terminal 100 may obtain a device identifier that uniquely identifies the broadcasting device from data stored in the broadcasting device. As another way, in order to reduce the power consumption of the mobile terminal 100, the broadcast device 200 may carry its own device identifier in the broadcast message sent by itself, so that after receiving the broadcast message sent by the broadcast device 200, the mobile terminal 100 may obtain the device identifier of the broadcast device 200 that sends the broadcast message from the broadcast message 200.
Optionally, after acquiring the device identifier of the broadcasting device 200, the mobile terminal 100 may send the acquired device identifier and the account stored in itself to the server 300 through the base station 310 and the gateway 311 of the mobile communication network. Furthermore, the mobile terminal 100 may also send the acquired device identifier and the account number stored by the mobile terminal to the server 300 through the wireless hotspot 320. When the server 300 receives the device identifier and the account sent by the mobile terminal 100, the device identifier and the account are bound, so as to represent that the user belonging to the account is in the vicinity of the broadcasting device 200 to which the device identifier belongs. Furthermore, after the broadcasting device 200 sends the collected authentication information to the server 300 during the verification process, the server 300 may complete the verification operation of the account when the account corresponding to the authentication information is verified to be bound to the device identifier of the broadcasting device 200.
Specifically, taking payment verification as an example, as shown in fig. 2, since the mobile terminal 100 can obtain the device identifier of the broadcasting device 200 through the broadcast message sent by the broadcasting device 200, the mobile terminal 100 can complete the operation of binding the payment account with the device identifier of the broadcasting device 200 without the need of the user to operate the mobile terminal (for example, the mobile terminal may be placed in a pants pocket all the time in the drawing). In the payment process, after the user only needs to collect the authentication information at the broadcasting device 200, the broadcasting device 200 can send the collected authentication information to the server 300 to complete the payment, and further, the user does not need to operate the mobile terminal, so that the user does not need to manually perform the payment operation in the whole process.
Taking the access control verification as an example, as shown in fig. 3, since the mobile terminal 100 can obtain the device identifier of the broadcasting device 200 through the broadcast message sent by the broadcasting device 200, the mobile terminal 100 can complete the uploading verification of the user account and the device identifier of the broadcasting device 200 without the need of the user to operate the mobile terminal (for example, the mobile terminal may be placed in a trouser pocket all the time in the figure). In the access control verification process, after the user only needs to collect the authentication information at the broadcasting equipment 200, the broadcasting equipment 200 can send the collected authentication information to the server 300 to complete matching verification, and further the user does not need to operate the mobile terminal, so that the user does not need to manually perform access control verification operation in the whole process.
However, through long-term research, the inventor finds that, with the rapid development of technologies based on bluetooth low energy BLE and wifi Aware, the types and the number of broadcast devices based on bluetooth low energy BLE or wifi Aware are more and more, and accordingly, the mobile terminal may receive broadcast messages sent by a plurality of broadcast devices all the time, so that the mobile terminal receives a large number of data packets to frequently wake up an application processor of the mobile terminal, which results in an increase in power consumption and spam information of the mobile terminal. In view of the above problems, the inventor proposes a scan control method, apparatus, mobile terminal and storage medium provided by embodiments of the present application to reduce power consumption of the mobile terminal by switching between using a first scan mode and a second scan mode according to a scanned broadcast message. The specific scan control method is described in detail in the following embodiments.
Referring to fig. 4, fig. 4 is a schematic flowchart illustrating a scan control method according to an embodiment of the present application. The scanning control method is used for switching between a first scanning mode and a second scanning mode according to the condition of the scanned broadcast messages so as to reduce the power consumption of the mobile terminal. In a specific embodiment, the scan control method is applied to the scan control apparatus 400 shown in fig. 6 and the mobile terminal 100 (fig. 7) configured with the scan control apparatus 400. The following will describe a specific process of this embodiment by taking a mobile terminal as an example, and it is understood that the mobile terminal applied in this embodiment may be a smart phone, a tablet computer, a wearable electronic device, and the like, and is not limited specifically herein, where the mobile terminal includes an application processor. As will be described in detail with respect to the flow shown in fig. 4, the scan control method may specifically include the following steps:
step S101: when the mobile terminal scans broadcast messages sent by broadcast equipment in a first scanning mode, a first scanning result is obtained, and the application processor is awakened to process the first scanning result.
In this embodiment, the broadcasting device may send out the broadcast message based on the Bluetooth Low Energy (BLE) mode or based on the WIFI Aware mode. Taking the bluetooth low energy BLE as an example, the broadcasting device may carry a device identifier uniquely identifying the broadcasting device in a specific field of a transmitted data packet during the process of transmitting the broadcast message in the bluetooth BLE mode, and it is understood that the device identifier may be added to a header, a suffix, a word, or the like of the specific field, which is not limited herein.
Correspondingly, the mobile terminal can also scan the broadcast message based on the bluetooth low energy BLE mode or the WIFI Aware mode, so as to scan and receive the broadcast message sent by the broadcasting equipment through the bluetooth low energy BLE, or receive the broadcast message sent by the broadcasting equipment through the WIFI Aware, and thus the mobile terminal can obtain the carried equipment identifier of the broadcasting equipment from the received broadcast message. For example, if the mobile terminal scans the broadcast message through the bluetooth low energy BLE mode and scans the broadcast message sent by the broadcasting device based on the bluetooth low energy BLE mode, the data packet corresponding to the broadcast message may be analyzed to obtain the device identifier carried in the data packet.
It should be noted that, if the broadcasting device sends the broadcast message in the wifi Aware mode, the broadcasting device may also broadcast the device identifier of the broadcasting device in a similar manner, and accordingly, the mobile terminal may also obtain the device identifier of the broadcasting device in a similar manner, which is not described herein again.
Further, in order to avoid that the device identifier sent by the broadcasting device is intercepted by other illegal devices, as a way, the broadcasting device can encrypt the device identifier in the process of generating the data packet of the broadcast message, so that even if other illegal devices can obtain the broadcast message by an illegal means, only the encrypted device identifier can be obtained, that is, the device identifier cannot be directly obtained, and thus, the security of the broadcasting device can be improved.
In addition, in one case, if other illegal users break the format of the data packet of the broadcast message sent by the broadcast equipment, the broadcast message can be simulated by other illegal electronic equipment with an access server to send the broadcast message, so that even if the users are not in the coverage range of the wireless signal of the legal broadcast equipment at present, the illegal electronic equipment can still send the user identification of the users and the equipment identification of certain broadcast equipment to the server to indicate the server to verify, and the broadcast equipment is started when the verification is successful, thereby causing potential safety hazards to the users.
As a way to improve the above problem, in the process of generating the broadcast message, the broadcasting device may add a specific field in the data packet of the broadcast message for storing a specific identifier for identifying whether the broadcast message is sent by a legitimate broadcasting device. In this way, when the mobile terminal receives the broadcast message, the mobile terminal identifies whether the received broadcast message has a specified identifier; if the received broadcast message is identified to have the specified identifier, the received broadcast message is determined to be the broadcast message sent by the broadcast equipment, and the equipment identifier of the broadcast equipment is acquired from the broadcast message sent by the broadcast equipment.
Moreover, the specified identification can be dynamically updated, so that the safety of the broadcast message is further improved. For example, the server may store the respective assigned identities of each broadcasting device, and may periodically update the stored assigned identities of each broadcasting device, and when the server updates the assigned identity of a certain broadcasting device, the server pushes the updated assigned identity to the corresponding broadcasting device, so that the broadcasting device writes the updated assigned identity into the generated broadcast message. Correspondingly, after receiving the broadcast message, the mobile terminal sends the analyzed designated identifier to the server for verification, and only when the verification returned by the server is received, the device identifier of the broadcast device carried in the received broadcast message is used as the device identifier sent by the legal broadcast device.
It should be noted that, in the case that the designated identifier included in the broadcast message may be configured fixedly and updated dynamically, as a manner, the mobile terminal may determine, according to the format of the parsed designated identifier, whether the designated identifier in the currently received broadcast message is configured fixedly or updated dynamically, and further determine a subsequent verification manner according to the determined configuration manner of the designated identifier. For example, a fixed configuration of assigned identifiers may be set to begin with the character "G", while a dynamic configuration of assigned identifiers may be set to begin with the character "D", and the mobile terminal may determine its configuration based on the first character of the assigned identifiers parsed from the broadcast message. In addition, different broadcasting devices may be identified by different specified identifiers, for example, G1, G2, and G3..
Specifically, the mobile terminal may directly verify whether the format of the analyzed designated identifier meets the designated rule through the mobile terminal when determining that the designated identifier is in the fixed configuration, and when determining that the designated identifier is in the dynamic configuration, the mobile terminal may send the designated identifier to the server, so that the server performs verification according to the newly configured designated identifier. By the method, even if the configuration modes of the designated identifiers in the broadcast messages sent by different broadcast devices are different, the mobile terminal can be flexibly adapted, and the adaptation capability between the mobile terminal and different broadcast devices is further improved.
Further, the mobile terminal is preset with a first scanning mode, and after the broadcast scanning service is started, the mobile terminal may scan the broadcast message sent by the broadcast equipment based on the first scanning mode, where the first scanning mode is a real-time reporting mode, that is, when the mobile terminal scans the broadcast message sent by the broadcast equipment, for example, scans a beacon packet sent by the broadcast equipment, the application processor of the mobile terminal is immediately awakened, and if the user is always within the transmission range of the broadcast equipment, the application processor of the mobile terminal is always in an awakened state. As a manner, when the mobile terminal scans a broadcast message sent by a broadcasting device in a first scanning mode, a first scanning result is obtained, it can be understood that the first scanning result at least includes the broadcast message sent by the broadcasting device, and accordingly, the mobile terminal wakes up its application processor to process the first scanning result, for example, wake up the application processor to perform operations such as payment, opening a door, etc. in response to the first scanning result, which is not limited herein.
Step S102: and switching the first scanning mode to a second scanning mode.
In this embodiment, since the first scanning mode wakes up the application processor of the mobile terminal every time the broadcast message is scanned, and when the mobile terminal is within the transmission range of the broadcast device, the application processor of the mobile terminal is always woken up, power consumption of the mobile terminal is increased, cruising ability of the mobile terminal is shortened, and user experience is poor. As an implementation manner, after it is determined that the mobile terminal scans a broadcast message sent by the broadcasting device in the first scanning mode, the first scanning mode may be switched to the second scanning mode, where the second scanning mode may be stored locally in the mobile terminal after being preset, and after it is determined that the mobile terminal scans the broadcast message sent by the broadcasting device in the first scanning mode, the second scanning mode is locally obtained from the mobile terminal, and the first scanning mode is switched to the second scanning mode as the current scanning mode of the mobile terminal.
The second scanning mode may be a batch reporting mode, that is, when the mobile terminal scans the broadcast message sent by the broadcast device, for example, when the mobile terminal scans a beacon data packet sent by the broadcast device, the application processor of the mobile terminal is not waken immediately, but the application processor is waken to perform batch processing on the broadcast message sent by the broadcast device within a specified time period after a specified time, for example, the application processor is waken to perform operations such as payment and door opening in response to a scanning result, which is not limited herein. As a mode, the mobile terminal may include BLE firmware, and the mobile terminal may report the scanning result to the application processor through BLE firmware every specified time period and wake up the application processor to process the scanning result, so that even if the mobile terminal is within the transmission range of the broadcasting device, the application processor may not be in the wake-up state all the time, thereby reducing power consumption of the mobile terminal, extending cruising ability of the mobile terminal, and improving user experience.
Step S103: and scanning the broadcast message sent by the broadcast equipment in the second scanning mode to obtain a second scanning result in a preset period.
As one manner, after switching the first scanning mode to the second scanning mode, the mobile terminal may continue to scan the broadcast message sent by the broadcasting device in the second scanning mode, where the broadcasting device may include one broadcasting device or may include a plurality of different broadcasting devices, which is not limited herein. In this embodiment, after the mobile terminal scans the broadcast message sent by the broadcast device in the second scanning mode, the scanning result in the preset period may be obtained and recorded as the second scanning result, it can be understood that because the second scanning mode is the batch scanning mode, the application processor is awakened according to the preset period to process the second scanning result, and therefore, the mobile terminal may cache the second scanning result in the preset period and report the cached second scanning result to the application processor when the preset period is over. As a mode, the preset period may be manually set by a user, may be automatically set by the mobile terminal, and in addition, the preset period may be stored locally in the mobile terminal after being preset, may be stored in the server after being preset and transmitted to the mobile terminal through the network, and further, the preset period may be set as a fixed value or a dynamic value, which is not limited herein.
Step S104: and awakening the application processor to process the second scanning result at intervals of the preset period, and judging whether the second scanning result comprises a broadcast message sent by the broadcast equipment.
In this embodiment, in the process of scanning the broadcast message sent by the broadcast device in the second scanning mode, the application processor may be awakened to process the second scanning result every preset period, and meanwhile, the content included in the second scanning result may be detected to determine whether the broadcast message sent by the broadcast device is included in the second scanning result.
Specifically, as one mode, the broadcast message sent by the broadcast device in the second scanning result may be marked, and the mobile terminal may determine whether the broadcast message sent by the broadcast device is included in the second scanning result by determining whether the mark is included in the second scanning result, and it may be understood that, when the mark is included in the second scanning result, it may be determined that the broadcast message sent by the broadcast device is included in the second scanning result, and when the mark is not included in the second scanning result, it may be determined that the broadcast message sent by the broadcast device is not included in the second scanning result. When there are multiple broadcast messages sent by the broadcasting device included in the second scanning result, the multiple broadcast messages may be labeled with the same label, for example, all labeled with "X", or may be labeled with different labels, for example, sequentially labeled with "X1", "X2", and "X3", which is not limited herein.
As another mode, when the mobile terminal scans the broadcast message sent by the broadcast device, the broadcast message is temporarily buffered, and then the second scanning result includes data, that is, the second scanning result is non-empty, and when the mobile terminal does not scan the broadcast message sent by the broadcast device, no buffer information is generated, and then the second scanning result does not include data, that is, the second scanning result is empty. Therefore, after the second scanning result is obtained, it may be determined whether data is included in the second scanning result, that is, whether the second scanning result is "empty", when it is determined that data is included in the second scanning result, that is, it is determined that the second scanning result is "non-empty", it may be determined that the broadcast message sent by the broadcasting device is included in the second scanning result, and when it is determined that data is not included in the second scanning result, that is, it is determined that the second scanning result is "empty", it may be determined that the broadcast message sent by the broadcasting device is not included in the second scanning result. Of course, it may be understood that other more manners may also be adopted to determine whether the second scanning result includes the broadcast message sent by the broadcast device, which is not described herein again.
Step S105: and when the second scanning result does not include the broadcast message sent by the broadcasting equipment, switching the second scanning mode to the first scanning mode.
In this embodiment, when the determination result indicates that the second scanning result does not include the broadcast message sent by the broadcasting device, the indication indicates that the mobile terminal does not scan the broadcast message sent by the broadcasting device in the preset period, which indicates that the mobile terminal has left the transmission range of the broadcasting device, and therefore, the second scanning mode may be switched to the first scanning mode, so as to reduce power consumption of the mobile terminal, prolong cruising ability of the mobile terminal, and improve user experience.
Specifically, because the second scanning mode periodically wakes up the application processor according to a preset period, that is, the application processor is periodically woken up regardless of whether the broadcast message sent by the broadcasting device is included in the second scanning result, when the environment in which the mobile terminal is located does not have a transmission source of the broadcasting device, that is, the mobile terminal does not scan the broadcast message sent by the broadcasting device, the application processor is still periodically woken up, which causes an increase in power consumption of the mobile terminal, and therefore, as a way, when the broadcast message sent by the broadcasting device is not included in the second scanning result, the second scanning mode is switched to the first scanning mode, it can be understood that the first scanning mode is a real-time scanning mode, that is, the first scanning mode wakes up the application processor when the broadcast message sent by the broadcasting device is scanned, and does not wake up the application processor when the broadcast message sent by the broadcasting device is not scanned, therefore, when the mobile terminal does not scan the broadcast message sent by the broadcasting equipment in the second scanning mode, the second scanning mode is switched to the first scanning mode, and the power consumption of the mobile terminal can be reduced.
Of course, when the mobile terminal scans the broadcast message sent by the broadcast device again in the first scanning mode, the first scanning mode may be switched to the second scanning mode again, and the above steps S101 to S105 are repeated, which is not described herein again.
In the scanning control method, apparatus, mobile terminal and storage medium provided in an embodiment of the present application, when the mobile terminal scans a broadcast message sent by a broadcasting device in a first scanning mode, the mobile terminal obtains a first scanning result, wakes up an application processor to process the first scanning result, switches the first scanning mode to a second scanning mode, scans the broadcast message sent by the broadcasting device in the second scanning mode, obtains a second scanning result in a preset period, wakes up the application processor to process the second scanning result at preset intervals, and determines whether the broadcast message sent by the broadcasting device is included in the second scanning result, and switches the second scanning mode to the first scanning mode when the broadcast message sent by the broadcasting device is not included in the second scanning result, so as to determine, according to the condition of the scanned broadcast message, and switching to use the first scanning mode and the second scanning mode to reduce the power consumption of the mobile terminal.
Referring to fig. 5, fig. 5 is a schematic flowchart illustrating a scan control method according to another embodiment of the present application. The method is applied to the mobile terminal, which includes an application processor and a screen, and as will be described in detail with respect to the flow shown in fig. 5, the scan control method may specifically include the following steps:
step S201: and when detecting that the mobile terminal is changed from a static state to a motion state, controlling the mobile terminal to scan the broadcast messages sent by the broadcast equipment in the first scanning mode.
In this embodiment, the motion state of the mobile terminal may be detected in real time, so as to determine whether to control the mobile terminal to scan the broadcast message sent by the broadcast device according to whether the mobile terminal is in the motion state. As one way, when it is detected that the mobile terminal changes from a stationary state to a moving state, the mobile terminal may be controlled to scan for broadcast messages sent by a broadcasting device in a first scanning mode.
It can be understood that, in the process that a user uses a mobile terminal to pay in a BLE mode or a WIFI Aware mode, and open an access control, the user can move the mobile terminal to the vicinity of the broadcasting equipment, so that the mobile terminal enters the radiation range of the broadcast message of the broadcasting equipment, and the broadcast message sent by the broadcasting equipment can be scanned. Therefore, when the mobile terminal is detected to change from a static state to a motion state, BLE scanning or WIFI Aware scanning of the mobile terminal can be started, the broadcast message sent by the broadcast equipment is scanned, and when the broadcast message sent by the broadcast equipment is received, subsequent payment operation, access control opening operation and the like are completed by utilizing the broadcast message.
And when the mobile terminal is in a static state, the BLE scanning or WIFI Aware scanning of the mobile terminal is in a closed state, namely, the broadcast message sent by the broadcast equipment is not scanned. That is to say, if the user is in a stationary state during payment or gate inhibition or the like using the mobile terminal, the mobile terminal is already in a radiation range of the broadcast message of the broadcast device, the mobile terminal has scanned the broadcast message of the broadcast device, and has received information used for performing the payment or gate inhibition process, such as a device ID in the broadcast message of the broadcast device, and therefore BLE scanning or WIFI alarm scanning of the mobile terminal is in a closed state, and the mobile terminal is prevented from being in a communication scanning state for a long time and frequently waking up an application processor, so that power consumption of the mobile terminal is saved.
In the embodiment of the application, the mobile terminal can detect the motion state of the mobile terminal through the motion sensor. The motion sensor can be a sensor which can still normally work when the mobile terminal is in a screen-off state, can be in an awakening state for a long time, and can awaken an application processor of the mobile phone. That is to say, the user can make the mobile terminal in the screen-off state during the use of the mobile terminal, and the motion sensor can monitor the motion state of the mobile terminal. Specifically, the motion sensor may not be limited, and may be, for example, an AMD motion detection sensor, and may also be, for example, a motion _ detect sensor.
Of course, the specific manner of detecting the motion state of the mobile terminal may not be limited in the embodiment of the present application.
Step S202: and when the mobile terminal scans the broadcast message sent by the broadcast equipment in the first scanning mode, detecting the current state of the screen.
In this embodiment, the mobile terminal further includes a screen. The current state of the screen may also be detected when the mobile terminal scans for a broadcast message issued by the broadcasting device in the first scanning mode.
As a mode, the current brightness of the screen may be detected, and it can be understood that, since the current brightness of the screen of the mobile terminal may change in real time, in order to improve the accuracy of detecting the current brightness of the screen of the mobile terminal, the current brightness of the screen of the mobile terminal may be detected in real time. The current brightness of the screen of the mobile terminal may be a specific brightness value, for example, the current brightness of the screen of the mobile terminal may be 50 nits, may be 80 nits, and the like; the current brightness of the screen of the mobile terminal may also be a ratio, for example, the screen brightness of the current brightness is 50%, and may be 80%, where 50% refers to that the current brightness of the screen of the mobile terminal is 50% of the maximum brightness, and 80% indicates that the current brightness of the screen of the mobile terminal is 80% of the maximum brightness. Therefore, the current state of the screen of the mobile terminal can be detected by detecting the current brightness of the screen, and when the brightness value or the brightness ratio of the screen of the mobile terminal is detected to be not 0, the current state of the screen of the mobile terminal can be determined to be a bright screen state; when it is detected that the brightness value or the brightness ratio of the screen of the mobile terminal is 0, it may be determined that the current state of the screen of the mobile terminal is a screen-off state.
As another mode, a state value corresponding to a screen of the mobile terminal may be detected, where when the screen of the mobile terminal is in a bright screen state, the screen of the mobile terminal may correspond to a state value "1", and when the screen of the mobile terminal is in a dead screen state, the screen of the mobile terminal may correspond to a state value "0", so that a current state of the screen of the mobile terminal may be detected by detecting the state value corresponding to the screen of the mobile terminal, and it may be understood that when the state value corresponding to the screen of the mobile terminal is detected to be "1", the current state of the screen of the mobile terminal may be determined to be in a bright screen state; when it is detected that the state value corresponding to the screen of the mobile terminal is "0", it may be determined that the current state of the screen of the mobile terminal is a screen-off state.
Step S203: and when the current state of the screen is the screen-off state, acquiring a first scanning result, and awakening the application processor to process the first scanning result.
As a mode, when the detection result represents that the current state of the screen of the mobile terminal is the screen-off state, under a general condition, the mobile terminals are all placed in a bag or a pocket, that is, the application processor of the mobile terminal is in a non-awake state, so that the first scanning result can be obtained, and the application processor is awakened to process the first scanning result, so that the user can complete the verification process of payment and door opening without taking out the mobile terminal.
Step S204: and when the current state of the screen is a bright screen state, detecting whether the mobile terminal is in a WIFI connection state.
As a mode, when the current state of the screen of the mobile terminal is represented by the detection result as a bright screen state, under a general condition, the mobile terminal may use the WIFI network, for example, the mobile terminal may use the WIFI network of 2.4GHZ, and when the mobile terminal scans the broadcast message sent by the broadcasting device through the bluetooth low energy BLE in a BLE mode, the mobile terminal may occupy the network of 2.4GHZ, so that an influence on the WIFI rate is inevitably caused, for example, an influence on the throughput rate of the WIFI is caused to the mobile terminal, and further, experiences of a user in surfing the internet, a game and the like are influenced. Therefore, in this embodiment, when the detection result indicates that the current state of the screen of the mobile terminal is the bright screen state, whether the mobile terminal is in the WIFI connection state may be detected, for example, when it is detected that the mobile terminal performs data transmission through WIFI, it may be determined that the mobile terminal is in the WIFI connection state.
Step S205: and when the mobile terminal is in the WIFI connection state, acquiring the WIFI rate of the mobile terminal.
Further, when the mobile terminal is in a WIFI connection state, the WIFI rate of the mobile terminal may be further obtained, where the WIFI rate of the mobile terminal may be implemented by WIFI speed measurement software, or may be calculated by calculating a traffic change within a period of time, specifically, obtaining a total traffic g0 of the mobile terminal at a time t0, and obtaining a total traffic g1 of the mobile terminal at a time t1, where a time t1 is a time point after a time t0, the WIFI rate is g1-g0/t1-t0, where t1-t0 is generally a fixed constant, for example, t1-t0 ═ 2s, and the WIFI rate may be calculated for no 2 s.
Step S206: and when the WIFI rate of the mobile terminal is greater than a rate threshold, reducing the scanning duty ratio of the mobile terminal for scanning the broadcast message sent by the broadcast equipment, wherein the scanning duty ratio is the ratio of single scanning time to scanning interval.
In this embodiment, the mobile terminal obtains the rate threshold, where the rate threshold may be set manually by a user, may be set automatically by the mobile terminal, or may be set by the server and transmitted to the mobile terminal, and in addition, the rate threshold may be preset and stored locally in the mobile terminal, or may be preset and stored in the server, which is not limited herein. As a mode, after the WIFI rate of the mobile terminal is obtained, the WIFI rate of the mobile terminal may be compared with a rate threshold to determine whether the WIFI rate of the mobile terminal is greater than the rate threshold, where when the WIFI rate of the mobile terminal is greater than the rate threshold, it may be considered that the mobile terminal is accessing the WIFI network at a high speed, for example, watching a video, playing a game, and the like, and therefore, in order not to affect the user experience, the scanning duty cycle of the broadcast message sent by the broadcast device scanned by the mobile terminal may be reduced, where the scanning duty cycle is a ratio of a single scanning time to a scanning interval. It can be understood that when the mobile terminal performs the BLE scanning mode, the mobile terminal performs scanning at a certain scanning frequency, and there is a time interval between adjacent scans, and there is a single scanning time in each scanning. By reducing the scanning duty ratio of the scanning broadcast equipment, namely reducing the single scanning time or increasing the scanning interval (reducing the scanning frequency), the actual scanning time of the mobile terminal is reduced, so that the time that the scanning of the mobile terminal occupies the 2.4GHZ antenna is reduced, and the influence of the scanning on the WIFI rate is reduced.
Step S207: and monitoring the WIFI rate of the mobile terminal.
Further, after the scanning duty ratio of the broadcast message sent by the broadcast device is reduced, the broadcast message sent by the broadcast device is kept to be scanned by the reduced scanning duty ratio, and the WIFI rate of the mobile terminal is monitored, wherein the WIFI rate of the mobile terminal can be monitored in real time, the WIFI rate of the mobile terminal can be monitored according to a preset time interval, the WIFI rate of the mobile terminal can also be monitored according to a mode set by a user, and the monitoring is not limited herein.
Step S208: and when the WIFI rate of the mobile terminal is smaller than the rate threshold, restoring the scanning duty ratio of the mobile terminal for scanning the broadcast message sent by the broadcast equipment.
When the WIFI rate of the mobile terminal is monitored to be smaller than the rate threshold value, the mobile terminal is characterized not to use a high-speed WIFI network, namely the mobile terminal does not watch videos, play games and the like through the WIFI network, therefore, the user experience of watching videos, playing games and the like by the user cannot be influenced by normally scanning the broadcast messages sent by the broadcast equipment in a BLE mode, and therefore, as a mode, the scanning duty ratio of the mobile terminal scanning the broadcast messages sent by the broadcast equipment can be recovered.
Step S209: and switching the first scanning mode to a second scanning mode.
Step S210: and scanning the broadcast message sent by the broadcast equipment in the second scanning mode to obtain a second scanning result in a preset period.
Step S211: and awakening the application processor to process the second scanning result at intervals of the preset period, and judging whether the second scanning result comprises a broadcast message sent by the broadcast equipment.
For detailed description of steps S309 to S211, please refer to steps S102 to S104, which are not described herein again.
Step S212: and when the second scanning result does not include the broadcast message sent by the broadcast equipment, detecting the state information of the mobile terminal.
Step S213: and when the state information of the mobile terminal is detected to be a motion state, switching the second scanning mode to the first scanning mode.
As a manner, when it is determined that the second scanning result does not include the broadcast message sent by the broadcasting device, the state information of the mobile terminal may be detected, wherein when it is detected that the state information of the mobile terminal is in a motion state, the mobile terminal is controlled to continue to start the scanning service function, and the second scanning mode is switched to the first scanning mode; and when the state information of the mobile terminal is detected to be in a static state, controlling the mobile terminal to close the scanning service function, namely controlling the mobile terminal to stop scanning the broadcast message sent by the broadcast equipment.
In another embodiment of the present application, a scanning control method is provided, when it is detected that a mobile terminal changes from a static state to a moving state, controlling the mobile terminal to scan a broadcast message sent by a broadcasting device in a first scanning mode. When the mobile terminal scans a broadcast message transmitted from a broadcasting device in a first scanning mode, detects a current state of a screen, when the current state of the screen is the screen-off state, acquiring a first scanning result, and waking up the application processor to process the first scanning result, when the current state of the screen is a bright screen state, detecting whether the mobile terminal is in a WIFI connection state, when the mobile terminal is in a WIFI connection state, acquiring the WIFI rate of the mobile terminal, when the WIFI rate of the mobile terminal is greater than the rate threshold value, the scanning duty ratio of the mobile terminal for scanning the broadcast messages sent by the broadcast equipment is reduced, wherein the scanning duty ratio is the ratio of single scanning time to scanning interval time, the WIFI rate of the mobile terminal is monitored, and when the WIFI rate of the mobile terminal is smaller than the rate threshold, restoring the scanning duty ratio of the broadcast message sent by the mobile terminal scanning broadcast equipment. Switching the first scanning mode into a second scanning mode, scanning the broadcast messages sent by the broadcasting equipment by the second scanning mode, acquiring a second scanning result in a preset period, waking up the application processor at intervals of the preset period to process the second scanning result, judging whether the second scanning result comprises the broadcast messages sent by the broadcasting equipment, detecting the state information of the mobile terminal when the second scanning result does not comprise the broadcast messages sent by the broadcasting equipment, and switching the second scanning mode into the first scanning mode when the state information of the mobile terminal is detected to be in a motion state. Compared with the scanning control method shown in fig. 4, in this embodiment, the mobile terminal is further controlled to start scanning when it is detected that the mobile terminal is changed from the static state to the moving state, and the mobile terminal is controlled to stop scanning when the mobile terminal is in the static state, so that the scanning applicability of the mobile terminal is improved.
Referring to fig. 6, fig. 6 is a block diagram illustrating a scan control apparatus 400 according to an embodiment of the present disclosure. The scan control apparatus 400 is applied to the mobile terminal described above, which includes an application processor. As will be explained below with respect to the block diagram shown in fig. 6, the scan control apparatus 400 includes: a first scanning result obtaining module 410, a first mode switching module 420, a second scanning result obtaining module 430, a scanning result determining module 440, and a second mode switching module 450, wherein:
the first scanning result obtaining module 410 is configured to obtain a first scanning result when the mobile terminal scans a broadcast message sent by a broadcasting device in a first scanning mode, and wake up the application processor to process the first scanning result. Further, the first scanning result acquiring module 410 includes: the current state detection submodule, the first scanning result acquisition submodule, the WIFI connection state detection submodule, the WIFI rate acquisition submodule, the scanning duty cycle reduction submodule, the WIFI rate monitoring submodule and the scanning duty cycle recovery submodule, wherein:
and the current state detection submodule is used for detecting the current state of the screen when the mobile terminal scans the broadcast message sent by the broadcast equipment in the first scanning mode.
And the first scanning result acquisition submodule is used for acquiring a first scanning result when the current state of the screen is the screen-off state, and awakening the application processor to process the first scanning result.
And the WIFI connection state detection submodule is used for detecting whether the mobile terminal is in a WIFI connection state or not when the current state of the screen is a bright screen state.
And the WIFI rate obtaining submodule is used for obtaining the WIFI rate of the mobile terminal when the mobile terminal is in the WIFI connection state.
And the scanning duty ratio reducing submodule is used for reducing the scanning duty ratio of the mobile terminal for scanning the broadcast message sent by the broadcast equipment when the WIFI rate of the mobile terminal is greater than a rate threshold value, and the scanning duty ratio is the ratio of single scanning time to scanning interval.
And the WIFI rate monitoring submodule is used for monitoring the WIFI rate of the mobile terminal.
And the scanning duty cycle recovery submodule is used for recovering the scanning duty cycle of the mobile terminal for scanning the broadcast message sent by the broadcast equipment when the WIFI rate of the mobile terminal is smaller than the rate threshold.
A first mode switching module 420, configured to switch the first scanning mode to a second scanning mode.
The second scanning result obtaining module 430 is configured to scan the broadcast message sent by the broadcast device in the second scanning mode, and obtain a second scanning result in a preset period.
The scanning result determining module 440 is configured to wake up the application processor at intervals of the preset period to process the second scanning result, and determine whether the second scanning result includes a broadcast message sent by the broadcast device.
A second mode switching module 450, configured to switch the second scanning mode to the first scanning mode when the second scanning result does not include the broadcast message sent by the broadcasting device. Further, the second mode switching module 450 includes: a status information detection sub-module and a scanning mode switching sub-module, wherein:
and the state information detection submodule is used for detecting the state information of the mobile terminal when the second scanning result does not include the broadcast message sent by the broadcast equipment.
And the scanning mode switching submodule is used for switching the second scanning mode into the first scanning mode when the state information of the mobile terminal is detected to be a motion state.
Further, the scan control apparatus 400 further includes: a scan control module, wherein:
and the scanning control module is used for controlling the mobile terminal to scan the broadcast message sent by the broadcast equipment in the first scanning mode when the mobile terminal is detected to be changed from a static state to a motion state.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and modules may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, the coupling between the modules may be electrical, mechanical or other type of coupling.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
Referring to fig. 7, a block diagram of a mobile terminal 100 according to an embodiment of the present disclosure is shown. The mobile terminal 100 may be a smart phone, a tablet computer, an electronic book, or other electronic devices capable of running an application program. The mobile terminal 100 in the present application may include one or more of the following components: a processor 110, a memory 120, an application processor 130, a screen 140, and one or more applications, wherein the one or more applications may be stored in the memory 120 and configured to be executed by the one or more processors 110, the one or more programs configured to perform the method as described in the aforementioned method embodiments.
Processor 110 may include one or more processing cores, among other things. The processor 110 interfaces with various components throughout the mobile terminal 100 using various interfaces and lines, and performs various functions of the mobile terminal 100 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 120 and invoking data stored in the memory 120. Alternatively, the processor 110 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 110 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 110, but may be implemented by a communication chip.
The Memory 120 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 120 may be used to store instructions, programs, code sets, or instruction sets. The memory 120 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like. The storage data area may also store data created by the terminal 100 in use, such as a phonebook, audio-video data, chat log data, and the like.
Further, the screen 140 may be a Liquid Crystal Display (LCD) and an Organic Light-Emitting Diode (OLED). The screen 130 is used to display information input by a user, information provided to the user, and various graphic user interfaces of the mobile terminal, which may be composed of graphics, text, icons, numbers, video, and any combination thereof.
Referring to fig. 8, a block diagram of a computer-readable storage medium according to an embodiment of the present application is shown. The computer-readable medium 500 has stored therein a program code that can be called by a processor to execute the method described in the above-described method embodiments.
The computer-readable storage medium 500 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium 500 includes a non-volatile computer-readable storage medium. The computer readable storage medium 500 has storage space for program code 510 for performing any of the method steps of the method described above. The program code can be read from or written to one or more computer program products. The program code 510 may be compressed, for example, in a suitable form.
To sum up, according to the scan control method, apparatus, mobile terminal and storage medium provided in this embodiment of the present application, when the mobile terminal scans a broadcast message sent by a broadcasting device in a first scan mode, the mobile terminal obtains the first scan result, wakes up an application processor to process the first scan result, switches the first scan mode to a second scan mode, scans the broadcast message sent by the broadcasting device in the second scan mode, obtains a second scan result in a preset period, wakes up the application processor to process the second scan result every preset period, and determines whether the broadcast message sent by the broadcasting device is included in the second scan result, and when the broadcast message sent by the broadcasting device is not included in the second scan result, switches the second scan mode to the first scan mode, so that according to the condition of the scanned broadcast message, and switching to use the first scanning mode and the second scanning mode to reduce the power consumption of the mobile terminal.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not necessarily depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.