CN117376830A - Geofence matching method, electronic device and computer readable storage medium - Google Patents

Geofence matching method, electronic device and computer readable storage medium Download PDF

Info

Publication number
CN117376830A
CN117376830A CN202311641413.3A CN202311641413A CN117376830A CN 117376830 A CN117376830 A CN 117376830A CN 202311641413 A CN202311641413 A CN 202311641413A CN 117376830 A CN117376830 A CN 117376830A
Authority
CN
China
Prior art keywords
information
wifi
geofence
matching
result
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.)
Pending
Application number
CN202311641413.3A
Other languages
Chinese (zh)
Inventor
董浩
车宇锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202311641413.3A priority Critical patent/CN117376830A/en
Publication of CN117376830A publication Critical patent/CN117376830A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/02Services making use of location information
    • H04W4/021Services related to particular areas, e.g. point of interest [POI] services, venue services or geofences
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/02Services making use of location information
    • H04W4/029Location-based management or tracking services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/11Allocation or use of connection identifiers

Abstract

The application provides a geofence matching method, an electronic device and a computer readable storage medium. The geofence matching method comprises the following steps: acquiring a WIFI scanning result reported by a low-power-consumption processor, wherein the WIFI scanning result is determined according to first WIFI scanning information acquired by the low-power-consumption processor, and the WIFI scanning result is used for representing the state of the low-power-consumption processor; when the WIFI scanning result represents that the state of the low-power-consumption processor is an abnormal state, calling a position service application to acquire second WIFI scanning information; according to the second WIFI scanning information and the preset geofence parameters, a geofence matching result is determined, so that the geofence can still be matched when the state of the low-power-consumption processor is abnormal, the persistence of the geofence matching function is further guaranteed, and the user experience is improved.

Description

Geofence matching method, electronic device and computer readable storage medium
Technical Field
The present application relates to the field of terminals, and in particular, to a geofence matching method, an electronic device, and a computer-readable storage medium.
Background
The low power processor on the electronic device (e.g., mobile phone) continuously runs, and the position of the electronic device is determined based on the scanned wireless fidelity (WIreless Fidelity, WIFI) information, so that the service corresponding to the current position can be recommended to the user or the action corresponding to the current service can be executed.
For example, the low power consumption processor matches the scanned WIFI information with corresponding WIFI information in the geofence parameters to determine whether the electronic device is located within a preset geofence. If the electronic device is determined to be located in the preset geofence, a near field communication (Near Field Communication, NFC) smart card application on the electronic device switches cards corresponding to the current geofence, so that a user can swipe cards based on an NFC function without switching the cards.
However, the WIFI scanning result of the low-power-consumption processor depends on the processing capacity of the processor, and according to the WIFI scanning information obtained by the low-power-consumption processor, a result of abnormal WIFI scanning can be obtained. Under the abnormal condition of WIFI scanning, the electronic equipment cannot complete subsequent geofence matching, whether the electronic equipment is located in a preset geofence or not cannot be determined, and therefore card switching cannot be completed, and user use is affected.
Disclosure of Invention
The application provides a geofence matching method, which solves the problem that geofence matching cannot be completed under the condition that a low-power processor is abnormal in WIFI scanning.
In order to achieve the above purpose, the present application adopts the following technical scheme:
In a first aspect, a geofence matching method is provided, comprising: acquiring a WIFI scanning result reported by a low-power-consumption processor, wherein the WIFI scanning result is determined according to first WIFI scanning information, the WIFI scanning result is used for representing the state of the low-power-consumption processor, and the first WIFI scanning information is information of available WIFI acquired by the low-power-consumption processor from a WIFI chip; when the WIFI scanning result represents that the state of the low-power-consumption processor is an abnormal state, second WIFI scanning information is obtained, wherein the second WIFI scanning information is information of available WIFI obtained from the WIFI chip by a location service application; and determining a geofence matching result according to the second WIFI scanning information and preset geofence parameters.
In the above embodiment, by acquiring the WIFI scanning result reported by the low power consumption processor, when the WIFI scanning result represents that the state of the low power consumption processor is an abnormal state, it is indicated that geofence matching cannot be performed according to the first WIFI scanning information obtained by the low power consumption processor. The second WIFI scanning information is acquired by calling the location service application, and the geofence matching result can be determined according to the second WIFI information and the preset geofence parameters, so that the geofence can still be matched when the state of the low-power-consumption processor is abnormal, the persistence of the geofence matching function is further guaranteed, and the user experience is improved.
In an embodiment, after obtaining the first WIFI scan information, the low power processor determines the WIFI number and/or the WIFI connection information according to the first WIFI scan information, and then determines the WIFI scan result according to the WIFI number and/or the WIFI connection information. For example, if the number of WIFI is 0, or the format of the WIFI connection information does not meet the requirement, determining that the first WIFI scanning information is abnormal, and further determining that the WIFI scanning result is abnormal.
In an embodiment, the first WIFI scan information includes sub-scan information of each scan period in a preset period, the WIFI scan result is determined according to a detection result corresponding to each sub-scan information, and the detection result corresponding to the sub-scan information is determined according to the number of WIFI and/or WIFI connection information corresponding to the sub-scan information. The WIFI scanning result of the preset period is determined according to the detection results corresponding to the plurality of scanning periods, so that the accuracy of the obtained WIFI scanning result can be improved.
In an embodiment, the AP side of the electronic device obtains, while obtaining the WIFI scan result uploaded by the low power consumption processor, first matching information reported by the low power consumption processor, where the first matching information is the matching information of the first WIFI scan information and the geofence parameter, and the first matching information is used to characterize whether information consistent with the first WIFI scan information exists in the geofence parameter. And then, the AP side determines second matching information according to the second WIFI scanning information and the geofence parameters, and determines a geofence matching result according to the first matching information and the second matching information. The second matching information is used for representing whether information consistent with the second WIFI scanning information exists in the geofence parameters or not. By combining the first matching information and the second matching information, the accuracy of the resulting geofence matching result may be improved.
In an embodiment, if the AP-side location service application obtains third WIFI scan information, determining third matching information according to the third WIFI scan information and the geofence parameter; the third WIFI scanning information is information of available WIFI obtained from the WIFI chip by the position service application according to trigger information of preset service, and the third matching information is used for representing whether information consistent with the third WIFI scanning information exists in the geofence parameters. And then, the AP side determines a geofence matching result according to the first matching information, the second matching information and the third matching information. By combining the first matching information, the second matching information and the third matching information, the accuracy of the obtained geofence matching result can be further improved.
In an embodiment, the determining the geofence match result according to the first match information, the second match information, and the third match information includes: and determining a geofence matching result according to the first matching information, the second matching information and the third matching information and priorities corresponding to the first matching information, the second matching information and the third matching information respectively, so that the accuracy of each matching information can be combined, and a more reasonable geofence matching result can be obtained.
In an embodiment, the determining the geofence matching result according to the first matching information, the second matching information, and the third matching information, and priorities corresponding to the first matching information, the second matching information, and the third matching information, respectively, includes:
determining weights corresponding to the first matching information, the second matching information and the third matching information respectively according to priorities corresponding to the first matching information, the second matching information and the third matching information respectively; the higher the priority, the greater the weight; and determining a geofence matching result according to the first matching information, the second matching information and the third matching information and weights corresponding to the first matching information, the second matching information and the third matching information respectively. For example, the first matching information, the second matching information and the third matching information may be weighted and summed according to weights respectively corresponding to the first matching information, the second matching information and the third matching information, so as to obtain a geofence matching result.
In an embodiment, the first matching information has a higher priority than the second matching information and the third matching information. Because the low-power consumption processor can continuously acquire the first WIFI scanning information, the second WIFI scanning information and the third WIFI scanning information are acquired under specific conditions, the stability of the first matching information determined according to the first WIFI scanning information is higher, and the accuracy is also higher. Setting the first matching information to a higher priority can result in a more accurate geofence matching result.
In an embodiment, after the second WIFI scanning information is obtained, when the second WIFI scanning result indicates that the state of the low power consumption processor is a normal state, it indicates that the geofence matching result can be determined according to the WIFI scanning information obtained by the low power consumption processor, and then the AP side instructs the location service application to stop obtaining the WIFI scanning information, so that energy consumption of the electronic device can be saved.
In an embodiment, the location service application invokes the location service application to update the geofence parameters when detecting that the user swipes the card using the electronic card in the NFC function for the first time and that the swipe is successful, where the updated geofence parameters include geofence information corresponding to the electronic card. Updating the geofence parameters by the location services application may improve stability of the resulting geofence parameters.
In a second aspect, there is provided a geofence matching device comprising:
the first acquisition module is used for acquiring a WIFI scanning result reported by the low-power-consumption processor, the WIFI scanning result is determined according to first WIFI scanning information, the WIFI scanning result is used for representing the state of the low-power-consumption processor, and the first WIFI scanning information is information of available WIFI acquired by the low-power-consumption processor from a WIFI chip;
The second acquisition module is used for acquiring second WIFI scanning information when the WIFI scanning result represents that the state of the low-power-consumption processor is an abnormal state, wherein the second WIFI scanning information is information of available WIFI acquired from the WIFI chip by a location service application;
and the determining module is used for determining a geofence matching result according to the second WIFI scanning information and preset geofence parameters.
In an embodiment, the WIFI scanning result is determined by the low power processor according to the WIFI number and/or WIFI connection information, where the WIFI number and/or WIFI connection information is determined according to the first scanning information.
In an embodiment, the first WIFI scan information includes sub-scan information of each scan period in a preset period, the WIFI scan result is determined according to a detection result corresponding to each sub-scan information, and the detection result corresponding to the sub-scan information is determined according to the number of WIFI and/or WIFI connection information corresponding to the sub-scan information.
In an embodiment, the first acquisition module is further configured to:
acquiring first matching information reported by the low-power-consumption processor, wherein the first matching information is the matching information of the first WIFI scanning information and the geofence parameter, and the first matching information is used for representing whether information consistent with the first WIFI scanning information exists in the geofence parameter;
Determining a geofence matching result according to the second WIFI scanning information and a preset geofence parameter, including:
determining second matching information according to the second WIFI scanning information and the geofence parameter, wherein the second matching information is used for representing whether information consistent with the second WIFI scanning information exists in the geofence parameter or not;
and determining a geofence matching result according to the first matching information and the second matching information.
In an embodiment, the first acquisition module is further configured to:
if third WIFI scanning information is acquired, determining third matching information according to the third WIFI scanning information and the geofence parameters; the third WIFI scanning information is information of available WIFI acquired from the WIFI chip by the position service application according to trigger information of preset service, and the third matching information is used for representing whether information consistent with the third WIFI scanning information exists in the geofence parameters;
and determining a geofence matching result according to the first matching information, the second matching information and the third matching information.
In an embodiment, the first acquisition module is further configured to:
And determining a geofence matching result according to the first matching information, the second matching information and the third matching information and priorities corresponding to the first matching information, the second matching information and the third matching information respectively.
In an embodiment, the first acquisition module is further configured to:
determining weights corresponding to the first matching information, the second matching information and the third matching information respectively according to priorities corresponding to the first matching information, the second matching information and the third matching information respectively; the higher the priority, the greater the weight;
and determining a geofence matching result according to the first matching information, the second matching information and the third matching information and weights corresponding to the first matching information, the second matching information and the third matching information respectively.
In an embodiment, the first matching information has a higher priority than the second matching information and the third matching information.
In an embodiment, the second acquisition module is further configured to:
and when the acquired WIFI scanning result represents that the state of the low-power-consumption processor is a normal state, indicating the position service application to stop acquiring the WIFI scanning information.
In an embodiment, the first acquisition module is further configured to:
and under the condition that the user firstly uses the electronic card in the NFC function to swipe the card and the card swipes successfully, invoking the location service application to update the geofence parameters, wherein the updated geofence parameters comprise geofence information corresponding to the electronic card.
In a third aspect, there is provided an electronic device comprising a processor for executing a computer program stored in a memory to implement the method as described in the first aspect above.
In a fourth aspect, a computer readable storage medium is provided, the computer readable storage medium storing a computer program, which when executed by a processor, implements a method as described in the first aspect above.
In a fifth aspect, there is provided a chip comprising a processor coupled to a memory, the processor executing a computer program or instructions stored in the memory to implement a method as described in the first aspect above.
In a sixth aspect, there is provided a computer program product for causing a terminal device to perform the method as described in the first aspect above when the computer program product is run on the terminal device.
It will be appreciated that the advantages of the second to sixth aspects may be found in the relevant description of the first aspect, and are not described here again.
Drawings
Fig. 1 is a software structural block diagram of an electronic device according to an embodiment of the present application;
FIG. 2 is a flowchart of a geofence matching method according to an embodiment of the present application;
fig. 3 is an interface diagram of displaying an electronic card by an NFC smart card application according to an embodiment of the present application;
fig. 4 is a flowchart of a geofence matching method in a card switching scenario of an NFC smart card according to an embodiment of the present application;
FIG. 5 is a specific interactive flowchart of a geofence matching method according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It should be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
As used in this specification and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is detected" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon detection of a [ described condition or event ]" or "in response to detection of a [ described condition or event ]".
In addition, in the description of the present application, the terms "first," "second," and the like are used merely to distinguish between descriptions and are not to be construed as indicating or implying relative importance.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
For example, the electronic device described in the embodiments of the present application may be a device that may be held/operated by one hand, such as a mobile phone, a tablet computer, a handheld computer, a personal digital assistant (personal digital assistant, PDA), an augmented reality (augmented reality, AR), a Virtual Reality (VR) device, a media player, and a wearable device, and the specific form/type of the electronic device is not particularly limited in the embodiments of the present application. The electronic device includes, but is not limited to, a device on which iOS, android, microsoft, hong and mony systems (Harmony OS) or other operating systems are mounted.
The software system of the electronic device may employ a layered architecture, an event driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. In the embodiment of the invention, an Android system with a layered architecture is taken as an example, and the software structure of the electronic equipment is illustrated.
Fig. 1 is a software configuration block diagram of an electronic device according to an embodiment of the present invention.
The layered architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into five layers, from top to bottom, an application layer, an application framework layer, an Zhuoyun row (Android run) and system library, a hardware abstraction layer (Hardware Abstraction Layer, HAL), and a kernel layer, respectively.
The application layer may include a series of application packages.
As shown in fig. 1, the application package may include applications such as a camera, gallery, calendar, phone call, map, navigation, WLAN, bluetooth, music, video, short message, location service, NFC smart card, etc.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for application programs of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 1, the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.
The window manager is used for managing window programs. The window manager can acquire the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make such data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebooks, etc.
The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a text message notification icon may include a view displaying text and a view displaying a picture.
The telephony manager is used to provide the communication functions of the electronic device 100. Such as the management of call status (including on, hung-up, etc.).
The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like.
The notification manager allows the application to display notification information in a status bar, can be used to communicate notification type messages, can automatically disappear after a short dwell, and does not require user interaction. Such as notification manager is used to inform that the download is complete, message alerts, etc. The notification manager may also be a notification in the form of a chart or scroll bar text that appears on the system top status bar, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in a status bar, a prompt tone is emitted, the electronic device vibrates, and an indicator light blinks, etc.
Android run time includes a core library and virtual machines. Android run time is responsible for scheduling and management of the Android system.
The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface manager (surface manager), media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., openGL ES), 2D graphics engines (e.g., SGL), etc.
The surface manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
Media libraries support a variety of commonly used audio, video format playback and recording, still image files, and the like. The media library may support a variety of audio and video encoding formats, such as MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, etc.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
HAL is used to provide a unified hardware access interface and resource management so that upper layer applications can be developed and run independent of the specific hardware platform. HAL includes WIFI interface, bluetooth interface, audio interface, etc.
The kernel layer is a layer between hardware and software. The kernel layer comprises a WIFI driver, a display driver, an audio driver, a sensor driver and the like.
After the NFC intelligent flash card application is installed on the electronic equipment, electronic cards such as access control cards, bus cards and the like can be added according to user operation, so that the electronic equipment can replace an entity card to swipe the card. Meanwhile, when a plurality of electronic cards are added to the electronic equipment, the NFC intelligent flash card application can also switch the cards according to the current position of the electronic equipment, so that the current electronic card for swiping the card is consistent with the position of the electronic equipment, and a user can swipe the card without switching the card.
The NFC smart card application can determine whether the electronic device is located in the designated geofence according to the matching result of the geofence, and switch the card into the card corresponding to the designated geofence when the electronic device is located in the designated geofence. Where a geofence represents a range of locations.
The NFC intelligent flash card application can add a geofence and corresponding geofence parameters for the card when the user swipes the card for the first time, and then whether the electronic equipment is located in the appointed geofence can be determined according to the geofence parameters, so that card switching is performed.
The geofence parameter may be WIFI scan information, among others. The electronic equipment determines whether the electronic equipment is located in the appointed geofence by acquiring the WIFI scanning information and determining whether the current WIFI scanning information is consistent with the WIFI scanning information of the geofence parameter.
In order to realize accurate switching of cards, the electronic equipment needs to acquire WIFI scanning information in real time, in order to reduce power consumption, the electronic equipment acquires the WIFI scanning information according to a set period through the low-power-consumption processor, and the electronic equipment can perform geofence matching in real time according to the WIFI scanning information acquired by the low-power-consumption processor, so that the cards can be switched in time. The low power processor may be a sensor hub.
The WIFI scanning information is acquired by the low-power-consumption processor, when the low-power-consumption processor is abnormal, the abnormal situation of the WIFI scanning information can occur, and then the WIFI scanning information in the geofence parameters cannot be matched, so that card switching cannot be completed, and the use of a user is affected.
Therefore, the low-power-consumption processor determines a WIFI scanning result according to the obtained first WIFI scanning information and reports the WIFI scanning result, when the state of the low-power-consumption processor represented by the WIFI scanning result is an abnormal state, the electronic equipment calls the position service application to obtain second WIFI scanning information, and determines a geofence matching result according to the second WIFI scanning information and preset geofence parameters, so that the WIFI scanning information can still be obtained when the state of the low-power-consumption processor is the abnormal state, geofence matching is completed, and the persistence of the geofence matching function is guaranteed. After the geofence matching is completed, the NFC smart card application can switch cards according to the geofence matching result.
The geofence matching method provided by the present application is described in detail below. The geofence matching method provided by the embodiment of the application is executed on the electronic equipment.
As shown in fig. 2, the geofence matching method provided in an embodiment of the present application includes:
s201: the method comprises the steps of obtaining a WIFI scanning result reported by a low-power-consumption processor, wherein the WIFI scanning result is determined according to first WIFI scanning information, the WIFI scanning result is used for representing the state of the low-power-consumption processor, and the first WIFI scanning information is information of available WIFI obtained by the low-power-consumption processor from a WIFI chip.
The low-power-consumption processor can be a sensor hub, the low-power-consumption processor can call a WIFI software module of the WIFI chip, a scanning request is sent to the WIFI software module, the WIFI software module sends scanned information of available WIFI of the electronic device to the low-power-consumption processor, and the information received by the low-power-consumption processor from the WIFI chip is first WIFI scanning information. The information of available WIFI of the electronic equipment is information of the WIFI which can be accessed by the electronic equipment, and the electronic equipment can be accessed to the WIFI, so that the electronic equipment is indicated to be in a coverage range corresponding to the WIFI. Illustratively, the first WIFI scan information includes one or more BSSIDs and a corresponding received signal strength indication (Received Signal Strength Indication, RSSI). The BSSID indicates the MAC address of the wireless access point, which is the creator of the wireless network and is also the central node of the wireless network. For example, the wireless router is a wireless access point. The RSSI represents the signal strength of the wireless access point resulting from the electronic device scan.
After the low-power consumption processor obtains the first WIFI scanning information, detection parameters can be determined according to the first WIFI scanning information, and the detection parameters comprise the WIFI quantity and/or the WIFI connection information. The number of WIFI also refers to the number of wireless access points, one wireless access point corresponds to one BSSID, and the number of WIFI can be determined according to the number of BSSIDs in the first WIFI scanning information. The WIFI connection information comprises any one or more of a message status code (ack_status), a BSSID and an RSSI, wherein the message status code is the message status code when the WIFI software module sends first WIFI scanning information.
After the low-power-consumption processor determines the detection parameters of the first WIFI scanning information, a WIFI scanning result is determined according to the detection parameters, the WIFI scanning result is used for representing the state of the low-power-consumption processor, the state of the low-power-consumption processor comprises a normal state and an abnormal state, and correspondingly, the WIFI scanning result also comprises the normal state and the abnormal state. For example, if the WIFI number is 0, it is determined that the WIFI scanning result is abnormal, and if the WIFI number is greater than 0, it is determined that the WIFI scanning result is normal. If the message status code is inconsistent with the preset format, the WIFI scanning result is determined to be abnormal, and if the message status code is consistent with the preset format, the WIFI scanning result is determined to be normal. If the BSSID is not in the preset data range, the WIFI scanning result is determined to be abnormal, and if the BSSID is in the preset data range, the WIFI scanning result is determined to be normal. If the RSSI is not in the preset data range, the WIFI scanning result is determined to be abnormal, and if the RSSI is in the preset data range, the WIFI scanning result is determined to be normal.
It can be appreciated that the low power processor may determine that the WIFI scan result is normal or abnormal according to any one or more of the WIFI number, the message status code, the BSSID, and the RSSI.
The low-power consumption processor can also input detection parameters of the first WIFI scanning information into a pre-trained classification model to obtain a WIFI scanning result output by the classification model.
In an embodiment, the first WIFI scan information is WIFI scan information within a preset period, where the preset period includes a plurality of scan periods, and the WIFI scan information of each scan period is sub-scan information, that is, the first WIFI scan information includes a plurality of sub-scan information. For example, the duration of the preset period is T1, the preset period includes a plurality of scanning periods with duration of T2, and the first scanning information includes sub-scanning information corresponding to each duration of T2. The low-power consumption processor determines corresponding sub-detection parameters according to each piece of sub-scanning information, wherein the sub-detection parameters are the WIFI quantity and/or the WIFI connection information in one scanning period. And then, the low-power-consumption processor determines detection results corresponding to the sub-scanning information, namely detection results corresponding to the scanning periods according to the sub-detection parameters, wherein the detection results can be normal or abnormal or normal probability. For example, the electronic device inputs the sub-detection parameters corresponding to each scanning period into the classification model, and obtains the normal probability of each scanning period output by the classification model. And then, the electronic equipment determines a WIFI scanning result in a preset period according to the detection result of each scanning period.
The detection result is probability, and the electronic device performs smoothing processing on the detection result of each scanning period in the preset period to remove abnormal data (erroneous detection result), obtain a detection result after smoothing processing, and determine a WIFI scanning result in the preset period according to the detection result after smoothing processing. For example, in the smoothed probabilities, if the average probability is greater than a preset value or the number of probabilities greater than the preset value is greater than a preset number, the WIFI scanning result in the preset period is determined to be normal.
The electronic device may also perform state transition on the detection result of each scanning period in the preset period. After obtaining the detection result that each scanning period is normal or abnormal, the electronic equipment determines whether the detection result of the current scanning period is consistent with the detection result of the previous period, if so, the electronic equipment continues to obtain the detection result of the next period, and if not, the detection result of the current period is cached. And finally, determining a WIFI scanning result in a preset period according to the detection result cached in the preset period.
In the above embodiment, the detection results of each scanning period in the preset period are counted to determine the WIFI scanning result of the preset period, so that the accuracy of the obtained WIFI scanning result can be improved.
After the low-power consumption processor determines the WIFI scanning result, the WIFI scanning result is reported to an application processor (Application Processor, AP) of the electronic device, for example, the low-power consumption processor may report the WIFI scanning result to a location service application on the AP side.
S202: and when the WIFI scanning result represents that the state of the low-power-consumption processor is an abnormal state, acquiring second WIFI scanning information, wherein the second WIFI scanning information is information of available WIFI acquired from the WIFI chip by the position service application.
Specifically, the AP receives the WIFI scanning result, if the WIFI scanning result is determined to be abnormal, it is determined that the state of the low power consumption processor is an abnormal state, that is, the low power consumption processor is abnormal in the process of receiving or processing the WIFI scanning, so that the first WIFI scanning information uploaded by the low power consumption processor is abnormal WIFI scanning information, and the AP invokes the location service application to obtain second WIFI scanning information from the WIFI chip. The format of the second WIFI scan information is the same as the format of the first WIFI scan information, and also includes one or more BSSIDs and corresponding RSSI. The location service application is a system application, belongs to upper-layer software and is used for determining the location of the electronic equipment.
Illustratively, the location service application invokes the wifimanager.startscan () of the WIFI chip to scan for available WIFI, resulting in second WIFI scan information. The location service application may perform WIFI scanning according to a set period to obtain second WIFI scanning information when determining that the state of the low power consumption processor is an abnormal state. The location service application may also perform WIFI scanning according to a set period when determining that the state of the low power consumption processor is an abnormal state and the electronic device satisfies a preset condition. The electronic device meets preset conditions, including that the electronic device is in a bright screen state or the electronic device is in a non-stationary state (for example, the electronic device is detected to be in a walking state, a riding state and the like), namely, the electronic device performs WIFI scanning under the condition that the WIFI scanning information is determined to be needed, and compared with the continuous WIFI scanning, the power consumption of the electronic device can be reduced.
S203: and determining a geofence matching result according to the second WIFI scanning information and preset geofence parameters.
The preset geofence parameters comprise one or more groups of geofence information, and each group of geofence information comprises a geofence identifier and WIFI scanning information corresponding to the geofence identifier. Each geofence identifier corresponds to one geofence, and the WIFI scanning information corresponding to the geofence identifier refers to information of the WIFI which can cover the corresponding geofence. The WIFI scan information includes one or more BSSIDs and corresponding RSSI. The identification of the geofence may be a serial number or name corresponding to the geofence, e.g., the geofence parameters include WIFI scan information corresponding to an xx cell, WIFI scan information corresponding to an xx building, and so forth.
And the electronic equipment compares the second WIFI scanning information with the WIFI scanning information corresponding to each geofence mark in the geofence parameters to determine whether the WIFI scanning information consistent with the second WIFI scanning information exists or not, and further determines a geofence matching result. The geofence match result may be an identification of the geofence in which the electronic device is located or that the electronic device is not within the geofence. For example, if there is WIFI scan information consistent with the second WIFI scan information, the geofence matching result is that the electronic device is located in a geofence corresponding to the WIFI scan information, and the geofence matching result includes a geofence identifier corresponding to the WIFI scan information consistent with the second WIFI scan information. If the WIFI scanning information consistent with the second WIFI scanning information does not exist, the geofence matching result is that the electronic equipment is not in the geofence.
For example, the electronic device may invoke the location service application to determine whether the second WIFI scan information is consistent with the WIFI scan information corresponding to each geofence identification in the geofence parameters.
The location service application may determine whether there is WIFI scan information consistent with the second WIFI scan information according to a similarity of the second WIFI scan information and the WIFI scan information corresponding to each geofence identifier. For example, the location service application calculates the similarity of the BSSID and the RSSID in the second WIFI scan information and the BSSID and the RSSID in the WIFI scan information corresponding to each geofence identifier. Or determining the same number of BSSIDs in the second WIFI scanning information and the WIFI scanning information corresponding to the geofence identifications by the position service application, and determining the similarity according to the ratio of the same number of BSSIDs to the number of BSSIDs in the WIFI scanning information corresponding to the geofence identifications for the WIFI scanning information corresponding to each geofence identification. And if the WIFI scanning information with the corresponding similarity larger than the set value exists in the WIFI scanning information of the geofence parameters, determining that the second WIFI information is consistent with the WIFI scanning information.
The location service application can also input the second WIFI scanning information and preset geofence parameters into a pre-trained classification model to obtain a geofence matching result output by the classification model.
In an embodiment, the second WIFI scan information is scan information within a preset period, where the preset period includes a plurality of scan periods, and each scan period corresponds to one piece of sub-scan information. The location service application may determine a geofence match result based on sub-scan information for each scan period within a preset period. Specifically, for each scanning period, the location service application determines whether there is WIFI scanning information consistent with sub-scanning information corresponding to the scanning period. If the WIFI scanning information consistent with the sub-scanning information exists, the matching result of the corresponding scanning period is determined to be that the electronic equipment is located in the geofence corresponding to the WIFI scanning information. Otherwise, the result of the matching of the scan period is determined to be that the electronic device is not within the geofence. And the electronic equipment determines a geofence matching result in a preset period according to the matching result of each scanning period. For example, if the matching results of the scanning periods in the preset time period are the same, and the electronic equipment is located in the geofence corresponding to the cell a, the geofence matching result is determined to be that the electronic equipment is located in the geofence corresponding to the cell a.
In one embodiment, the location service application, after determining the geofence match result, sends the geofence match result to the NFC smart card application, which switches cards according to the geofence match result. For example, if the geofence match results in the electronic device being located within one of the geofences, the electronic card is switched to the electronic card corresponding to that geofence. If the geofence match results in the electronic device not being within the geofence, the card is not switched. For example, if the geofence match results in the electronic device being located within a geofence identified as "corporate gate inhibition," the electronic card is switched to the electronic card identified as "corporate gate inhibition.
Correspondingly, the geofence parameters may also be added based on the first swipe information received from the NFC smart card application. The NFC smart card application sends the first card swiping information to the location service application when detecting that a user swipes a card using an electronic card in the NFC function for the first time and the card swipes successfully. The electronic equipment invokes the location service application to receive current WIFI scanning information sent by the WIFI chip, and updates the geofence parameters according to the current WIFI scanning information, namely, the geofence information corresponding to the electronic card is added into the geofence parameters. The geofence information corresponding to the electronic card includes a geofence identification and WIFI scan information corresponding to the geofence identification. The geofence identification may be the name or serial number of the geofence or the name or serial number of the electronic card.
In other embodiments, when the NFC smart card application detects that the user uses the electronic card in the NFC function for the first time to swipe the card and the swipe card is successful, after sending the first-time swipe card information to the location service application, the location service application may also send an indication of adding the geofence parameter to the low-power processor, where the low-power processor receives, according to the indication of adding the geofence parameter, current WIFI scan information sent by the WIFI chip, and adds, according to the current WIFI scan information, geofence information corresponding to the current geofence.
It can be appreciated that the NFC smart card application may add multiple electronic cards, where, when any one electronic card is detected to be the first card swipe and the card swipe is successful, the NFC smart card application sends the first card swipe information to the location service application, so that the location service application adds the geofence parameter corresponding to the electronic card according to the first card swipe information.
In the above embodiment, when the WIFI scanning result reported by the low power consumption processor indicates that the state of the low power consumption processor is an abnormal state, it is indicated that geofence matching cannot be performed according to the first WIFI scanning information obtained by the low power consumption processor. The second WIFI scanning information is acquired by calling the location service application, and the geofence matching result can be determined according to the second WIFI information and the preset geofence parameters, so that the geofence can still be matched when the state of the low-power-consumption processor is abnormal, the persistence of the geofence matching function is further guaranteed, and the user experience is improved.
The low-power consumption processor continuously acquires first WIFI scanning information according to a set period, determines a WIFI scanning result according to the first WIFI scanning information, and sends the WIFI scanning result to the AP side. In an embodiment, after the electronic device invokes the location service application to obtain the second WIFI scan information, if the WIFI scan result sent by the low power consumption processor is obtained again, and the obtained WIFI scan result is normal, that is, the obtained WIFI scan result indicates that the state of the low power consumption processor is a normal state, the electronic device instructs the location service application to stop obtaining the second WIFI scan information. At this time, the low power consumption processor may determine a geofence matching result according to the first WIFI scan information and the geofence parameter, send the geofence matching result to the NFC smart card application through the location service application, and the NFC smart card application switches cards according to the geofence matching result. Because the low-power-consumption processor can continuously acquire the first WIFI scanning information, when the state of the WIFI scanning result representing the low-power-consumption processor is in a normal state, the position service application stops acquiring the WIFI information, and the power consumption of the electronic equipment can be reduced while NFC automatic switching is realized.
In an embodiment, after the low power consumption processor obtains the first WIFI scan information, the first matching information is determined according to the first WIFI scan information and the geofence parameter while determining a WIFI scan result according to a detection parameter corresponding to the first WIFI scan information, and the first matching information is reported to the location service application. The first matching information is used for representing whether information consistent with the first WIFI scanning information exists in the geofence parameters. The first matching information may be similarity of the first WIFI scan information and the corresponding WIFI scan information represented by each geofence in the geofence parameters, or may be an identifier of the geofence corresponding to the WIFI scan information with the highest similarity to the first WIFI scan information, or may be an identifier of the geofence that the electronic device enters according to the first WIFI information, or the electronic device does not enter the geofence. The low-power-consumption processor can input the first WIFI scanning information and the geofence parameters into a pre-trained classification model to obtain first matching information output by the classification model.
After the second WIFI scanning information is obtained, the location service application determines the similarity of the second WIFI scanning information and the corresponding WIFI scanning information represented by each geofence in the geofence parameters, and determines second matching information according to the similarity. Or the location service application inputs the second WIFI scanning information and the geofence information into a pre-trained classification model to obtain second matching information output by the classification model. The second matching information is used for representing whether information consistent with the second WIFI scanning information exists in the geofence parameters. For example, the second matching information may be similarity between the second WIFI scan information and the WIFI scan information corresponding to each geofence identifier, or may be an identifier of the geofence that the electronic device enters according to the second WIFI information, or the electronic device does not enter the geofence.
After the first matching information and the second matching information are obtained, the location service application determines a geofence matching result according to the first matching information and the second matching information. The location service application may determine that the electronic device is in the geofence based on the first matching information, or that the electronic device is not in the geofence, and may determine that the electronic device is in the geofence based on the second matching information. And if the first matching information is consistent with the second matching information, namely the identification of the geofence which is determined to be entered by the electronic equipment according to the first matching information and the second matching information is the same, or the first matching information and the second matching information both indicate that the electronic equipment does not enter the geofence, the first matching information or the second matching information is used as a geofence matching result. And if the first matching information and the second matching information are inconsistent, determining a geofence matching result according to the priority of the first matching information and the second matching information. The first matching information is the similarity of the first WIFI scanning information and the WIFI scanning information corresponding to each geofence identifier in the geofence parameters, and the second matching information is the similarity of the second WIFI scanning information and the WIFI scanning information corresponding to each geofence identifier in the geofence parameters, and the weight when calculating the similarity is determined according to the priorities of the first matching information and the second matching information, wherein the higher the priority is, the greater the weight is. And then, according to the weights corresponding to the first matching information and the second matching information, carrying out weighted summation on the similarity corresponding to the first matching information and the second matching information to obtain the similarity corresponding to each WIFI scanning information in the geofence parameters, and determining whether the similarity larger than a set value exists. And if the similarity is larger than the set value, determining the geofence identification corresponding to the similarity as a geofence matching result, and if the similarity is not larger than the set value, determining that the electronic equipment is not in the geofence. Because the low-power consumption processor can continuously acquire the first WIFI scanning information, the first WIFI scanning information is more stable, and the first matching information obtained according to the first WIFI scanning information is more accurate, so that the priority of the first matching information can be set to be higher than that of the second matching information.
It can be understood that the location service application does not acquire the second WIFI scanning information under the condition that the WIFI scanning result reported by the low power consumption processor is received to be normal, and only determines the geofence matching result according to the first matching information.
The location service application can acquire second WIFI scanning information from the WIFI chip when the scanning result reported by the low-power-consumption processor is abnormal, and can execute a WIFI monitoring function when the triggering information of the preset service is detected to monitor third WIFI scanning information of the WIFI chip. The location service application may invoke a listener (listener) to listen to broadcast information of the WIFI chip, including the wifi_state_changed_action, and obtain third WIFI scanning information.
The preset service is a service capable of triggering WIFI monitoring, for example, the preset service may be an operation of opening a page displaying WIFI scanning information detected by the mobile phone, and the preset service may also be an operation of opening a WIFI function detected by the mobile phone.
And under the condition that the first matching information and the second matching information are obtained, if the third WIFI scanning information is obtained, the position service application determines the third matching information according to the third WIFI scanning information and the geofence parameters. The third matching information is used for representing whether information consistent with the third WIFI scanning information exists in the geofence parameters. For example, the third matching information may be similarity between the third WIFI scan information and the WIFI scan information corresponding to each geofence identifier, or may be an identifier of the geofence that the electronic device enters according to the third WIFI information, or the electronic device does not enter the geofence. The location service application may input the third WIFI scan information and the geofence information into a pre-trained classification model to obtain third matching information output by the classification model.
Thereafter, the location service application determines a geofence match result based on the first, second, and third match information.
In one embodiment, the location service application determines the geofence matching result based on the first, second, and third matching information, and the priorities to which the first, second, and third matching information correspond, respectively.
In an embodiment, the location service application determines weights corresponding to the first matching information, the second matching information, and the third matching information according to priorities corresponding to the first matching information, the second matching information, and the third matching information, and determines geofence matching results according to the weights corresponding to the first matching information, the second matching information, and the third matching information, and the weights corresponding to the first matching information, the second matching information, and the third matching information. Wherein the higher the priority, the greater the weight. For example, the first matching information is the similarity of the first WIFI scan information and the WIFI scan information corresponding to each geofence in the geofence parameters, the second matching information is the similarity of the second WIFI scan information and the WIFI scan information corresponding to each geofence in the geofence parameters, and the third matching information is the similarity of the third WIFI scan information and the WIFI scan information corresponding to each geofence in the geofence parameters, and for the WIFI scan information corresponding to each geofence, the weighted summation is performed on the similarity corresponding to each WIFI scan information according to the similarity corresponding to the first matching information, the similarity corresponding to the second matching information, the similarity corresponding to the third matching information, and the weights corresponding to the first matching information, the second matching information, and the third matching information, so as to obtain the target similarity corresponding to each WIFI scan information, that is, the target similarity corresponding to each geofence. The location services application then determines a maximum target similarity based on the target similarity for each geofence. If the maximum target similarity meets the threshold, determining that the electronic equipment enters a geofence corresponding to the maximum target similarity, otherwise, determining that the electronic equipment does not enter the geofence.
In an embodiment, the first matching information has a higher priority than the second matching information and the third matching information. Correspondingly, the weight corresponding to the first matching information is higher than the weight corresponding to the second matching information and the third matching information. Because the low-power consumption processor can continuously acquire the first WIFI scanning information, the first WIFI scanning information is more stable, and the first matching information obtained according to the first WIFI scanning information is more accurate, so that the accuracy of the determined geofence matching result is improved by setting the first matching information to a higher priority.
In another embodiment, the location service application may determine the priority of the first matching information according to the WIFI scan result. Specifically, if the location service application receives the information that the WIFI scanning result is abnormal, the second WIFI scanning information is acquired, and then the second matching information is determined. In this case, the priority of the second matching information is set to be the highest, if the third WIFI scan information is acquired, the geofence matching result is determined according to the first matching information, the second matching information, and the third matching information, and if the third WIFI scan information is not acquired, the geofence matching result is determined according to the first matching information and the second matching information. And if the position service application receives the information that the WIFI scanning result is normal, stopping acquiring the second WIFI scanning information. In this case, the priority of the first matching information is set to be the highest, if the third WIFI scan information is acquired, the geofence matching result is determined according to the first matching information and the third matching information, and if the third WIFI scan information is not acquired, the geofence matching result is determined according to the first matching information.
In one embodiment, for each scan cycle, the location services application determines geofence matching results using the method described above. The preset time period comprises a plurality of scanning periods, and the position service application determines a geofence matching result in the preset time period according to geofence matching results corresponding to the scanning periods, wherein the geofence matching result corresponding to each scanning period can be similarity with each WIFI scanning information in the geofence parameters or probability of matching with each geofence in the geofence parameters. For example, the geofence matching result of each scanning period in the preset period may be smoothed to remove abnormal data (erroneous matching result), obtain a smoothed matching result, and determine the geofence matching result in the preset period according to the smoothed matching result. For example, if the average similarity corresponding to one of the WIFI scan information is greater than a preset value in the preset period, it is determined that the geofence matching result is that the electronic device enters the geofence corresponding to the WIFI scan information.
The electronic device can also perform state transition on the matching result of each geofence in a preset period. After obtaining the matching results of entering or exiting the rail corresponding to each scanning period, the electronic equipment determines whether the matching result of the geofence in the current scanning period is consistent with the matching result of the geofence in the previous period, if so, continuously obtaining the matching result of the geofence in the next scanning period, and if not, caching the matching result of the geofence in the current scanning period. And finally, determining the geofence matching result in the preset time period according to the geofence matching result cached in the preset time period.
In the embodiment, the geofence matching result in the preset time period is determined according to the geofence matching results of a plurality of scanning periods, so that the data reliability is improved.
The following describes a specific interaction flow of the geofence matching method provided in the embodiment of the present application, taking a card switching scenario of the geofence matching method for an NFC smart card as an example.
The NFC smart card application adds the electronic card according to user operation and then switches the card according to the geofence matching result. Illustratively, as shown in fig. 3, the electronic device displays, on a display interface, an electronic card added in the NFC smart card application upon detecting an operation of opening the card package by the user. For example, the names of the added electronic cards are "home", "district gate", "company entrance guard card", "bus card", respectively. The electronic cards currently arranged in the first row, or cards with "default" identification, are cards that can currently be swiped. For example, if the identification "default" exists on an electronic card named "home", then "home" is the card that can currently be swiped. The NFC intelligent flash card application switches cards, namely, cards matched with the geofence are set to be cards which can be swiped currently, so that a user can swipe cards directly without any operation.
As shown in fig. 4, after the user starts up, the NFC smart card application, the location service application, the HAL process, and the sensorhub, WIFI software complete initialization. Thereafter, the HAL process sends a request to establish a connection to the sensorh ub so that the HAL process establishes a connection with the sensorh ub. And the NFC intelligent flash card application sends a connection establishment request to the location service application under the condition that the HAL process and the sensor rhub are detected to be successfully connected, so that the NFC intelligent flash card application and the location service application establish connection.
Under the condition that the NFC intelligent flash card application and the location service application successfully establish connection, for any electronic card in the NFC intelligent flash card, the NFC intelligent flash card application sends an indication of adding the geofence to the location service application under the condition that the electronic card is detected to be swiped for the first time and the card swipe is successful. The location service application obtains the WIFI scanning information from the WIFI software according to the indication of adding the geofence. The location service application then sends the WIFI scan information to the sensorhunb through the HAL process. The sensor rhub caches or updates the WIFI scanning information and adds a geofence identifier to the WIFI scanning information, wherein the WIFI scanning information and the corresponding geofence identifier are a group of geofence information in the geofence parameters. The sensorrhub then sends the operation result and the geofence identification to the NFC smart card application via the HAL process and the location service application. The result of the operation is whether the information of success or success of updating is cached.
And then, the sensor rhub sends indication information for starting WIFI scanning to the WIFI software according to a set period, and the WIFI software sends first WIFI scanning information obtained by scanning to the sensor rhub according to the received indication information. And the Sensorhub determines a WIFI scanning result according to the detection parameters corresponding to the first WIFI scanning information, and sends the WIFI scanning result to the location service application through the HAL process. And when the position service application determines that the WIFI scanning result is normal, stopping acquiring the second WIFI scanning information. And the location service application determines a geofence matching result according to the obtained second WIFI scanning information or the first matching information which is reported by the sensor and is determined according to the first WIFI scanning information, and sends the geofence matching result to the NFC intelligent flash card application. When the geofence matching result is that the geofence is entered, the NFC intelligent flash card application switches the card to the card corresponding to the geofence. When the user swipes the card, the electronic device may not display the page of the NFC smart card, or may display the electronic card for swiping the card on the display interface.
A specific interaction flow of the geofence matching method provided in an embodiment of the present application is shown in FIG. 5.
After the NFC smart card of the application layer is started, a software development kit (Software Development Kit, SDK) of the integrated location service application establishes connection with the location service application in the system application. The NFC smart card application sends an indication to the location service application to add a geofence parameter corresponding to a first card if the first card swipes one of the electronic cards (e.g., the first card) and the card swipes successfully. And the location service application acquires the WIFI scanning information from the WIFI chip according to the indication of adding the geofence parameter. And then, the location service application sends WIFI scanning information to the sensor rhub through the HAL layer, invokes a storage function in the sensor rhub, caches or updates the WIFI scanning information in the sensor rhub, and adds a geofence identifier for the WIFI scanning information. The sensor rhub then sends the operation result and the geofence identification to the location service application via the HAL layer, causing the location service application to update the geofence parameters. The location service application then sends the operation result and the geofence identification to the NFC smart card application. The NFC smart card application may also instruct the location service application to delete the geofence parameter corresponding to the electronic card according to an instruction from the user to delete the electronic card.
The method comprises the steps that the sensor rhub sends indication information for starting WIFI scanning to WIFI software of a WIFI chip according to a set period, and the WIFI software sends first WIFI scanning information obtained through scanning to the sensor rhub. The sensor hub matches the first WIFI scanning information with the geofence parameters (namely compares the first WIFI scanning information with the WIFI scanning information corresponding to each geofence identifier in the geofence parameters) to obtain first matching information, wherein the first matching information is the geofence identifier of the geofence which the electronic equipment enters or the geofence which the electronic equipment does not enter. The sensor hub may determine the first matching information by using a pre-stored WIFI fingerprint matching algorithm. The WIFI fingerprint matching algorithm may be an algorithm for calculating a similarity of the first WIFI scan information and each WIFI scan information in the geofence parameters, and the WIFI fingerprint matching algorithm may also be a classification model for determining a geofence matching result according to the first WIFI scan information and the geofence parameters. And then, the sensor hub sends the first matching information to the location service application through a WIFI fence event uploading link constructed by the HAL layer. The Sensorub matches the first WIFI scanning information and the geofence parameters, and simultaneously determines detection parameters corresponding to the first WIFI scanning information, determines a WIFI scanning result according to the detection parameters and a parameter anomaly detection algorithm, and sends the WIFI scanning result to the location service application through a WIFI scanning detection event uploading link constructed by the HAL layer. The parameter anomaly detection algorithm is an algorithm for determining whether the detection parameter is normal or abnormal according to the detection parameter. And the scanning event processing module of the location service application analyzes the received information to obtain a WIFI scanning result, and whether the WIFI scanning result is abnormal or not is determined. If the WIFI scanning result is abnormal, starting the WIFI scanning function, and acquiring second WIFI scanning information. If the WIFI scanning result is normal, the WIFI scanning is not performed. Meanwhile, the position service application monitors WIFI scanning information according to a triggering request of a preset service to obtain third WIFI scanning information, and determines third matching information according to the third WIFI scanning information and the geofence parameters. And a WIFI fence matching algorithm fusion module in the position service application determines second matching information according to the second scanning information and the geofence parameters, and determines a geofence matching result according to the first matching information, the second matching information and the third matching information. And then, the location service application sends the geofence matching result to the NFC intelligent flash card application, and the NFC intelligent flash card switches the electronic card according to the geofence matching result.
It is understood that the first matching information, the second matching information, and the third matching information may be the same event or different events. For example, the first matching information, the second matching information and the third matching information may be the similarity of WIFI scan information, or may be the similarity, the event of entering or exiting the fence, the matching result, and the like, respectively. The WIFI fence matching algorithm fusion module of the location service application can obtain matching results of entering the fence or exiting the fence according to different events, then determine final geofence matching results, and comprehensively judge the final geofence matching results according to priorities corresponding to the different events.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic of each process, and should not limit the implementation process of the embodiment of the present application in any way.
By way of example, fig. 6 shows a schematic structural diagram of the electronic device 100.
The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, keys 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identity module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It should be understood that the illustrated structure of the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
It should be understood that the interfacing relationship between the modules illustrated in the embodiments of the present invention is only illustrative, and is not meant to limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also use different interfacing manners, or a combination of multiple interfacing manners in the foregoing embodiments.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc., as applied to the electronic device 100. The wireless communication module 160 may be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
The electronic device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information. The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device 100. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 121 may be used to store computer executable program code including instructions. The internal memory 121 may include a storage program area and a storage data area. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data created during use of the electronic device 100 (e.g., audio data, phonebook, etc.), and so on. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like. The processor 110 performs various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
The touch sensor 180K, also referred to as a "touch device". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is for detecting a touch operation acting thereon or thereabout. The touch sensor may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to touch operations may be provided through the display 194. In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100 at a different location than the display 194.
It should be noted that, because the content of information interaction and execution process between the above devices/units is based on the same concept as the method embodiment of the present application, specific functions and technical effects thereof may be referred to in the method embodiment section, and will not be described herein again.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present application implements all or part of the flow of the method of the above embodiments, and may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, where the computer program, when executed by a processor, may implement the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a camera device/electronic apparatus, a recording medium, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Such as a U-disk, removable hard disk, magnetic or optical disk, etc.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/network device and method may be implemented in other manners. For example, the apparatus/network device embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions in actual implementation, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
Finally, it should be noted that: the foregoing is merely a specific embodiment of the present application, but the protection scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present disclosure should be covered in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (12)

1. A geofence matching method, comprising:
acquiring a WIFI scanning result reported by a low-power-consumption processor, wherein the WIFI scanning result is determined according to first WIFI scanning information, the WIFI scanning result is used for representing the state of the low-power-consumption processor, and the first WIFI scanning information is information of available WIFI acquired by the low-power-consumption processor from a WIFI chip;
when the WIFI scanning result represents that the state of the low-power-consumption processor is an abnormal state, second WIFI scanning information is obtained, wherein the second WIFI scanning information is information of available WIFI obtained from the WIFI chip by a location service application;
and determining a geofence matching result according to the second WIFI scanning information and preset geofence parameters.
2. The method of claim 1, wherein the WIFI scan result is determined by the low power processor according to a WIFI number and/or WIFI connection information, the WIFI number and/or WIFI connection information being determined according to the first WIFI scan information.
3. The method of claim 2, wherein the first WIFI scan information includes sub-scan information of each scan period in a preset period, the WIFI scan result is determined according to a detection result corresponding to each sub-scan information, and the detection result corresponding to the sub-scan information is determined according to the number of WIFI and/or WIFI connection information corresponding to the sub-scan information.
4. The method according to claim 1, wherein the method further comprises:
acquiring first matching information reported by the low-power-consumption processor, wherein the first matching information is the matching information of the first WIFI scanning information and the geofence parameter, and the first matching information is used for representing whether information consistent with the first WIFI scanning information exists in the geofence parameter;
determining a geofence matching result according to the second WIFI scanning information and a preset geofence parameter, including:
determining second matching information according to the second WIFI scanning information and the geofence parameter, wherein the second matching information is used for representing whether information consistent with the second WIFI scanning information exists in the geofence parameter or not;
And determining a geofence matching result according to the first matching information and the second matching information.
5. The method of claim 4, wherein said determining a geofence match result from said first match information and said second match information comprises:
if third WIFI scanning information is acquired, determining third matching information according to the third WIFI scanning information and the geofence parameters; the third WIFI scanning information is information of available WIFI acquired from the WIFI chip by the position service application according to trigger information of preset service, and the third matching information is used for representing whether information consistent with the third WIFI scanning information exists in the geofence parameters;
and determining a geofence matching result according to the first matching information, the second matching information and the third matching information.
6. The method of claim 5, wherein said determining a geofence match result from said first, second, and third match information comprises:
and determining a geofence matching result according to the first matching information, the second matching information and the third matching information and priorities corresponding to the first matching information, the second matching information and the third matching information respectively.
7. The method of claim 6, wherein the determining the geofence match result based on the first, second, and third match information, and the respective priorities of the first, second, and third match information, comprises:
determining weights corresponding to the first matching information, the second matching information and the third matching information respectively according to priorities corresponding to the first matching information, the second matching information and the third matching information respectively; the higher the priority, the greater the weight;
and determining a geofence matching result according to the first matching information, the second matching information and the third matching information and weights corresponding to the first matching information, the second matching information and the third matching information respectively.
8. The method of claim 6, wherein the first matching information has a higher priority than the second matching information and the third matching information.
9. The method according to any one of claims 1 to 8, wherein after the acquiring the second WIFI scan information, the method further comprises:
And when the acquired WIFI scanning result represents that the state of the low-power-consumption processor is a normal state, indicating the position service application to stop acquiring the WIFI scanning information.
10. The method according to any one of claims 1 to 8, wherein before the obtaining the WIFI scan result reported by the low power consumption processor, the method further comprises:
and under the condition that the user firstly uses the electronic card in the NFC function to swipe the card and the card swipes successfully, invoking the location service application to update the geofence parameters, wherein the updated geofence parameters comprise geofence information corresponding to the electronic card.
11. An electronic device comprising a processor for executing a computer program stored in a memory to implement the method of any one of claims 1 to 10.
12. A computer readable storage medium storing a computer program, which when executed by a processor implements the method of any one of claims 1 to 10.
CN202311641413.3A 2023-12-04 2023-12-04 Geofence matching method, electronic device and computer readable storage medium Pending CN117376830A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311641413.3A CN117376830A (en) 2023-12-04 2023-12-04 Geofence matching method, electronic device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311641413.3A CN117376830A (en) 2023-12-04 2023-12-04 Geofence matching method, electronic device and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN117376830A true CN117376830A (en) 2024-01-09

Family

ID=89398748

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311641413.3A Pending CN117376830A (en) 2023-12-04 2023-12-04 Geofence matching method, electronic device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN117376830A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130093627A1 (en) * 2011-10-13 2013-04-18 Microsoft Corporation Power-aware tiered geofencing and beacon watchlists
CN107923980A (en) * 2015-08-12 2018-04-17 三星电子株式会社 Method and apparatus for providing positional information
CN112637758A (en) * 2020-08-05 2021-04-09 华为技术有限公司 Equipment positioning method and related equipment thereof
CN116668580A (en) * 2022-10-26 2023-08-29 荣耀终端有限公司 Scene recognition method, electronic device and readable storage medium
CN116684525A (en) * 2022-09-30 2023-09-01 荣耀终端有限公司 Event reminding method, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130093627A1 (en) * 2011-10-13 2013-04-18 Microsoft Corporation Power-aware tiered geofencing and beacon watchlists
CN107923980A (en) * 2015-08-12 2018-04-17 三星电子株式会社 Method and apparatus for providing positional information
CN112637758A (en) * 2020-08-05 2021-04-09 华为技术有限公司 Equipment positioning method and related equipment thereof
CN116684525A (en) * 2022-09-30 2023-09-01 荣耀终端有限公司 Event reminding method, electronic equipment and storage medium
CN116668580A (en) * 2022-10-26 2023-08-29 荣耀终端有限公司 Scene recognition method, electronic device and readable storage medium

Similar Documents

Publication Publication Date Title
CN111724775B (en) Voice interaction method and electronic equipment
CN110460981B (en) Bluetooth object searching method and electronic equipment
CN110602686B (en) Method for using remote SIM module and electronic equipment
CN112817634B (en) COTA package downloading method and device
CN113641271B (en) Application window management method, terminal device and computer readable storage medium
CN113973398A (en) Wireless network connection method, electronic equipment and chip system
CN115333941A (en) Method for acquiring application running condition and related equipment
CN116070035B (en) Data processing method and electronic equipment
CN116033069B (en) Notification message display method, electronic device and computer readable storage medium
CN114172925B (en) Network distribution method and equipment
CN117376830A (en) Geofence matching method, electronic device and computer readable storage medium
CN117076089B (en) Application management method, terminal device and storage medium
CN116095230B (en) Application program recommendation method, terminal device and readable storage medium
CN115828227B (en) Method for identifying advertisement popup, electronic equipment and storage medium
CN117234398B (en) Screen brightness adjusting method and electronic equipment
CN116056176B (en) APN switching method and related equipment
CN116088955B (en) Process processing method and terminal equipment
CN113409041B (en) Electronic card selection method, device, terminal and storage medium
CN116233749B (en) Message pushing method, mobile terminal and computer readable storage medium
CN116668997A (en) Positioning method, user interface and electronic equipment
CN117707561A (en) Card data updating method, electronic device and computer readable storage medium
CN117692977A (en) Network residence method and related equipment
CN116264600A (en) Incoming call reminding method, electronic device and computer readable storage medium
CN117879981A (en) Display method and electronic equipment
CN117812534A (en) Enhanced positioning method based on target area, electronic equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination