[go: up one dir, main page]

CN114449446B - A virtual card switching method and electronic equipment - Google Patents

A virtual card switching method and electronic equipment Download PDF

Info

Publication number
CN114449446B
CN114449446B CN202110921394.4A CN202110921394A CN114449446B CN 114449446 B CN114449446 B CN 114449446B CN 202110921394 A CN202110921394 A CN 202110921394A CN 114449446 B CN114449446 B CN 114449446B
Authority
CN
China
Prior art keywords
fence
gnss
electronic device
gps
card
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110921394.4A
Other languages
Chinese (zh)
Other versions
CN114449446A (en
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 CN202110921394.4A priority Critical patent/CN114449446B/en
Priority to PCT/CN2022/089662 priority patent/WO2023015962A1/en
Publication of CN114449446A publication Critical patent/CN114449446A/en
Application granted granted Critical
Publication of CN114449446B publication Critical patent/CN114449446B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Telephone Function (AREA)

Abstract

本申请实施例公开了一种虚拟卡切换方法及电子设备,涉及电子设备领域,以简化用户使用虚拟卡刷卡的过程,降低刷卡的耗时,从而提高用户体验。具体方案为:在电子设备在第一刷卡点首次采用第一虚拟卡完成数据交互的情况下,电子设备获取电子设备的第一GNSS位置信息以及第一GNSS精度;电子设备根据第一GNSS位置信息,第一GNSS精度,以及第二虚拟卡所对应的第二GNSS围栏,建立并存储第一虚拟卡所对应的第一GNSS围栏;第二虚拟卡是多个虚拟卡中电子设备已建立并存储GNSS围栏的虚拟卡;在电子设备监测到电子设备的位置到达第一GNSS围栏的范围内的情况下,电子设备将第一虚拟卡激活。

Figure 202110921394

The embodiment of the present application discloses a virtual card switching method and an electronic device, which relate to the field of electronic devices, so as to simplify the process of swiping a virtual card by a user, reduce time-consuming swiping, and improve user experience. The specific solution is: when the electronic device uses the first virtual card to complete data interaction for the first time at the first card swiping point, the electronic device obtains the first GNSS position information and the first GNSS accuracy of the electronic device; , the first GNSS accuracy, and the second GNSS fence corresponding to the second virtual card, establish and store the first GNSS fence corresponding to the first virtual card; the second virtual card is the electronic device in multiple virtual cards that has been established and stored The virtual card of the GNSS fence; when the electronic device monitors that the position of the electronic device reaches the range of the first GNSS fence, the electronic device activates the first virtual card.

Figure 202110921394

Description

一种虚拟卡切换方法及电子设备A virtual card switching method and electronic equipment

技术领域technical field

本申请涉及电子设备领域,尤其涉及一种虚拟卡切换方法及电子设备。The present application relates to the field of electronic equipment, in particular to a virtual card switching method and electronic equipment.

背景技术Background technique

近场通信(near field communication,NFC)技术已逐步推广到小型化的电子设备中,如手机。在具备NFC功能的手机中,可以配置多张NFC虚拟卡,从而可以实现公交车刷卡、交易支付、门禁解锁等多种功能。Near field communication (near field communication, NFC) technology has been gradually extended to miniaturized electronic devices, such as mobile phones. In a mobile phone with NFC function, multiple NFC virtual cards can be configured, so that multiple functions such as bus card swiping, transaction payment, and access control unlocking can be realized.

然而,在面对不同的刷卡需求时,用户需要手动选择虚拟卡,导致刷卡过程的较为繁琐,耗时较长。However, when faced with different card swiping requirements, the user needs to manually select a virtual card, which makes the card swiping process more cumbersome and time-consuming.

发明内容Contents of the invention

本申请实施例提供一种虚拟卡切换方法及电子设备,能够简化用户刷卡的过程,降低刷卡的耗时,从而提高用户体验。Embodiments of the present application provide a virtual card switching method and an electronic device, which can simplify the process of swiping a card for a user, reduce time-consuming swiping a card, and thereby improve user experience.

为达到上述目的,本申请实施例采用如下技术方案:In order to achieve the above purpose, the embodiment of the present application adopts the following technical solutions:

第一方面,本申请实施例提供一种虚拟卡切换方法,应用于电子设备,该电子设备具备NFC功能,且该电子设备包括多个虚拟卡。该虚拟卡切换方法可以包括:在电子设备在第一刷卡点首次采用第一虚拟卡完成数据交互的情况下,电子设备获取电子设备的第一全球导航卫星系统GNSS位置信息以及第一GNSS精度;该第一虚拟卡为多个虚拟卡中的虚拟卡;电子设备根据该第一GNSS位置信息,该第一GNSS精度,以及第二虚拟卡所对应的第二GNSS围栏,建立并存储第一虚拟卡所对应的第一GNSS围栏;该第二虚拟卡是多个虚拟卡中电子设备已建立并存储GNSS围栏的虚拟卡;在电子设备监测到电子设备的位置到达该第一GNSS围栏的范围内的情况下,电子设备将该第一虚拟卡激活。In a first aspect, an embodiment of the present application provides a virtual card switching method, which is applied to an electronic device, where the electronic device has an NFC function, and the electronic device includes multiple virtual cards. The virtual card switching method may include: when the electronic device uses the first virtual card to complete data interaction at the first card swiping point for the first time, the electronic device acquires the first GNSS position information and the first GNSS accuracy of the electronic device; The first virtual card is a virtual card among multiple virtual cards; the electronic device establishes and stores the first virtual card according to the first GNSS position information, the first GNSS accuracy, and the second GNSS fence corresponding to the second virtual card. The first GNSS fence corresponding to the card; the second virtual card is a virtual card in which the electronic device has established and stored the GNSS fence among the multiple virtual cards; the electronic device monitors that the position of the electronic device reaches the range of the first GNSS fence In the case of , the electronic device activates the first virtual card.

基于第一方面所述的方法,电子设备在某个刷卡点首次使用某个虚拟卡完成交易时,根据电子设备当前的GNSS位置信息,建立该虚拟卡对应的GNSS地理围栏。之后当用户持电子设备再次进入到该GNSS地理围栏的范围内时,电子设备可以自动将该GNSS地理围栏对应的虚拟卡激活。从而在面对不同的刷卡需求时,能够避免用户手动选择需要激活的虚拟卡,从而简化用户刷卡的过程,降低刷卡的时长,提升用户体验。且本申请的方案是根据GNSS位置信息,建立对应的地理围栏,GNSS位置信息可利用电子设备的短距离芯片来获取。而短距离芯片是电子设备的标准配置,因此即使电子设备不具备Wi-Fi围栏能力,仍然可以在用户刷卡前实现对应虚拟卡的自动激活,进一步提高了用户的使用体验。此外,本申请的方案根据已建立的GNSS围栏,建立新的GNSS围栏,能够使新建立的虚拟卡对应的GNSS围栏与已建立的GNSS围栏之间均不存在重叠区域,从而在用户持电子设备到达对应的GNSS围栏的范围内时,电子设备可以准确的激活对应的虚拟卡。Based on the method described in the first aspect, when the electronic device uses a certain virtual card to complete a transaction at a certain card swiping point for the first time, according to the current GNSS position information of the electronic device, a GNSS geofence corresponding to the virtual card is established. Afterwards, when the user enters the range of the GNSS geo-fence again with the electronic device, the electronic device can automatically activate the virtual card corresponding to the GNSS geo-fence. Therefore, when faced with different card swiping requirements, the user can avoid manually selecting the virtual card that needs to be activated, thereby simplifying the process of the user swiping the card, reducing the duration of swiping the card, and improving user experience. Moreover, the solution of the present application is to establish a corresponding geographic fence based on the GNSS position information, and the GNSS position information can be obtained by using the short-distance chip of the electronic device. The short-distance chip is a standard configuration of electronic equipment, so even if the electronic equipment does not have the Wi-Fi fence capability, it can still realize the automatic activation of the corresponding virtual card before the user swipes the card, further improving the user experience. In addition, the scheme of the present application establishes a new GNSS fence based on the established GNSS fence, so that there is no overlapping area between the GNSS fence corresponding to the newly established virtual card and the established GNSS fence, so that when the user holds the electronic device When arriving within the range of the corresponding GNSS fence, the electronic device can accurately activate the corresponding virtual card.

结合第一方面,在另一种可能的实现方式中,上述电子设备根据第一GNSS位置信息,第一GNSS精度,以及第二虚拟卡所对应的第二GNSS围栏,建立第一虚拟卡所对应的第一GNSS围栏,可以包括:电子设备建立第一虚拟卡对应的初始GNSS围栏;初始GNSS 围栏为以第一GNSS位置信息为圆心,以预设长度为半径的圆形区域;在电子设备确定初始GNSS围栏与第二GNSS围栏不存在重叠区域的情况下,电子设备将初始GNSS围栏作为第一GNSS围栏。With reference to the first aspect, in another possible implementation manner, the above-mentioned electronic device establishes a GNSS corresponding to the first virtual card according to the first GNSS position information, the first GNSS accuracy, and the second GNSS fence corresponding to the second virtual card. The first GNSS fence may include: the electronic device establishes an initial GNSS fence corresponding to the first virtual card; the initial GNSS fence is a circular area with the first GNSS position information as the center and a preset length as the radius; When there is no overlapping area between the initial GNSS fence and the second GNSS fence, the electronic device uses the initial GNSS fence as the first GNSS fence.

基于该可能的实现方式,通过在初始GNSS围栏已建立的GNSS围栏均不存在重叠区域时,将初始GNSS围栏作为虚拟卡对应的GNSS围栏,能够使得虚拟卡对应的GNSS围栏范围较大,从而在用户持电子设备到达对应的GNSS围栏的范围内时,电子设备可以准确的激活对应的虚拟卡。Based on this possible implementation, by using the initial GNSS fence as the GNSS fence corresponding to the virtual card when there is no overlapping area between the established GNSS fences of the initial GNSS fence, the range of the GNSS fence corresponding to the virtual card can be made larger. When the user reaches the range of the corresponding GNSS fence with the electronic device, the electronic device can accurately activate the corresponding virtual card.

结合第一方面,在另一种可能的实现方式中,上述电子设备根据第一GNSS位置信息,第一GNSS精度,以及第二虚拟卡所对应的第二GNSS围栏,建立第一虚拟卡所对应的第一GNSS围栏,还可以包括:在电子设备确定初始GNSS围栏与第二GNSS围栏中的第三 GNSS围栏存在重叠区域的情况下,电子设备根据第一GNSS位置信息、第一GNSS精度、以及建立第三GNSS围栏时的第二GNSS位置信息和第二GNSS精度,确定第一半径;电子设备根据第一GNSS位置信息以及第一半径,建立第一GNSS围栏,第一GNSS围栏与第三GNSS围栏不存在重叠区域。With reference to the first aspect, in another possible implementation manner, the above-mentioned electronic device establishes a GNSS corresponding to the first virtual card according to the first GNSS position information, the first GNSS accuracy, and the second GNSS fence corresponding to the second virtual card. The first GNSS fence may also include: when the electronic device determines that there is an overlapping area between the initial GNSS fence and the third GNSS fence in the second GNSS fence, the electronic device according to the first GNSS position information, the first GNSS accuracy, and The second GNSS position information and the second GNSS accuracy when establishing the third GNSS fence determine the first radius; the electronic device establishes the first GNSS fence according to the first GNSS position information and the first radius, and the first GNSS fence and the third GNSS Fences do not overlap.

基于该可能的实现方式,通过已建立的GNSS围栏的GNSS位置信息和GNSS精度,动态确定新建立的GNSS围栏的半径,可以使得新建立的GNSS围栏与已建立的GNSS围栏不存在重叠区域,从而在用户持电子设备到达对应的GNSS围栏的范围内时,电子设备可以准确的激活对应的虚拟卡。Based on this possible implementation, the radius of the newly established GNSS fence can be dynamically determined through the GNSS position information and GNSS accuracy of the established GNSS fence, so that there is no overlapping area between the newly established GNSS fence and the established GNSS fence, thereby When the user reaches the range of the corresponding GNSS fence with the electronic device, the electronic device can accurately activate the corresponding virtual card.

结合第一方面,在另一种可能的实现方式中,在第二GNSS围栏中与初始GNSS围栏存在重叠区域的第三GNSS围栏为一个的情况下,第一半径为通过如下公式获得:In combination with the first aspect, in another possible implementation, in the case where there is one third GNSS fence that overlaps with the initial GNSS fence in the second GNSS fence, the first radius is obtained by the following formula:

Figure BDA0003207551810000021
Figure BDA0003207551810000021

其中,lx为第一半径,cx为第一GNSS精度,cy为第二GNSS精度,l为第一GNSS位置信息与第二GNSS位置信息之间的距离,d为初始GNSS围栏与第三GNSS围栏边界之间的缓冲宽度。Among them, l x is the first radius, c x is the first GNSS accuracy, cy is the second GNSS accuracy, l is the distance between the first GNSS position information and the second GNSS position information, and d is the distance between the initial GNSS fence and the second GNSS position information. Buffer width between three GNSS fence boundaries.

基于该可能的实现方式,可以根据已建立的GNSS围栏的GNSS位置信息和GNSS精度,动态确定新建立的GNSS围栏的半径,从而使得新建立的GNSS围栏与已建立的GNSS 围栏不存在重叠区域,在用户持电子设备到达对应的GNSS围栏的范围内时,电子设备可以准确的激活对应的虚拟卡。Based on this possible implementation, the radius of the newly established GNSS fence can be dynamically determined according to the GNSS position information and GNSS accuracy of the established GNSS fence, so that there is no overlapping area between the newly established GNSS fence and the established GNSS fence, When the user reaches the range of the corresponding GNSS fence with the electronic device, the electronic device can accurately activate the corresponding virtual card.

结合第一方面,在另一种可能的实现方式中,在第二GNSS围栏中与初始GNSS围栏存在重叠区域的第三GNSS围栏为多个的情况下,第一半径为与多个第三GNSS围栏一一对应的多个lx中最小的lx,lx通过如下公式获得:In combination with the first aspect, in another possible implementation, in the case that there are multiple third GNSS fences in the second GNSS fence that overlap with the initial GNSS fence, the first radius is equal to the multiple third GNSS fences. The smallest l x among the multiple l x corresponding to the fence one-to-one, l x is obtained by the following formula:

Figure BDA0003207551810000022
Figure BDA0003207551810000022

其中,cx为第一GNSS精度,cy为第二GNSS精度,l为第一GNSS位置信息与第二 GNSS位置信息之间的距离,d为初始GNSS围栏与第三GNSS围栏边界之间的缓冲宽度。Among them, c x is the first GNSS accuracy, c y is the second GNSS accuracy, l is the distance between the first GNSS position information and the second GNSS position information, d is the distance between the initial GNSS fence and the third GNSS fence boundary buffer width.

基于该可能的实现方式,可以根据多个已建立的GNSS围栏的GNSS位置信息和GNSS精度,动态确定新建立的GNSS围栏的半径,从而使得新建立的GNSS围栏与多个已建立的GNSS围栏均不存在重叠区域,在用户持电子设备到达对应的GNSS围栏的范围内时,电子设备可以准确的激活对应的虚拟卡。Based on this possible implementation, the radius of the newly established GNSS fence can be dynamically determined according to the GNSS position information and GNSS accuracy of multiple established GNSS fences, so that the newly established GNSS fence is equal to the multiple established GNSS fences. There is no overlapping area, and when the user reaches the range of the corresponding GNSS fence with the electronic device, the electronic device can accurately activate the corresponding virtual card.

结合第一方面,在另一种可能的实现方式中,上述虚拟卡切换方法还可以包括:电子设备根据第一GNSS位置信息、第一GNSS精度、第二GNSS位置信息以及第二GNSS精度,确定第二半径;电子设备根据第二GNSS位置信息以及第二半径,更新第三GNSS围栏;第二半径通过以下公式获得:With reference to the first aspect, in another possible implementation, the virtual card switching method may further include: the electronic device determines the The second radius; the electronic device updates the third GNSS fence according to the second GNSS position information and the second radius; the second radius is obtained by the following formula:

Figure BDA0003207551810000031
Figure BDA0003207551810000031

其中,ly为第二半径,cx为第一GNSS精度,cy为第二GNSS精度,l为第一GNSS位置信息与第二GNSS位置信息之间的距离,d为初始GNSS围栏与第三GNSS围栏边界之间的缓冲宽度。Among them, l y is the second radius, c x is the first GNSS accuracy, c y is the second GNSS accuracy, l is the distance between the first GNSS position information and the second GNSS position information, d is the initial GNSS fence and the second GNSS Buffer width between three GNSS fence boundaries.

基于该可能的实现方式,可以确定出已建立的GNSS围栏对应的新的半径,根据该新的半径更新已建立的GNSS围栏,从而使得已建立的GNSS围栏与新建立的GNSS围栏不存在重叠区域,在用户持电子设备到达对应的GNSS围栏的范围内时,电子设备可以准确的激活对应的虚拟卡。Based on this possible implementation, the new radius corresponding to the established GNSS fence can be determined, and the established GNSS fence can be updated according to the new radius, so that there is no overlapping area between the established GNSS fence and the newly established GNSS fence , when the user holds the electronic device within the range of the corresponding GNSS fence, the electronic device can accurately activate the corresponding virtual card.

结合第一方面,在另一种可能的实现方式中,对于每个第三GNSS围栏,上述虚拟卡切换方法还可以包括:电子设备根据第一GNSS位置信息与第二GNSS位置信息之间的距离,第一半径以及初始GNSS围栏与第三GNSS围栏边界之间的缓冲宽度,确定第二半径;在第二半径小于第三GNSS围栏原半径的情况下,电子设备根据第二GNSS位置信息以及第二半径更新第三GNSS围栏。With reference to the first aspect, in another possible implementation, for each third GNSS fence, the above virtual card switching method may further include: the electronic device according to the distance between the first GNSS position information and the second GNSS position information , the first radius and the buffer width between the initial GNSS fence and the third GNSS fence boundary, determine the second radius; when the second radius is smaller than the original radius of the third GNSS fence, the electronic device uses the second GNSS position information and the first The second radius updates the third GNSS fence.

基于该可能的实现方式,可以确定出多个已建立的GNSS围栏对应的新的半径,根据该新的半径分别更新已建立的GNSS围栏,从而使得多个已建立的GNSS围栏与新建立的GNSS围栏不存在重叠区域,在用户持电子设备到达对应的GNSS围栏的范围内时,电子设备可以准确的激活对应的虚拟卡。Based on this possible implementation, new radii corresponding to multiple established GNSS fences can be determined, and the established GNSS fences can be updated according to the new radii, so that multiple established GNSS fences and newly established GNSS There is no overlapping area between the fences, and when the user reaches the range of the corresponding GNSS fence with the electronic device, the electronic device can accurately activate the corresponding virtual card.

结合第一方面,在另一种可能的实现方式中,预设长度为2千米。With reference to the first aspect, in another possible implementation manner, the preset length is 2 kilometers.

基于该可能的实现方式,可以准确的确定出初始GNSS围栏的范围,且能够使得虚拟卡对应的GNSS围栏范围较大,从而在用户持电子设备到达对应的GNSS围栏的范围内时,电子设备可以准确的激活对应的虚拟卡。Based on this possible implementation, the range of the initial GNSS fence can be accurately determined, and the range of the GNSS fence corresponding to the virtual card can be made larger, so that when the user reaches the range of the corresponding GNSS fence with the electronic device, the electronic device can Accurately activate the corresponding virtual card.

结合第一方面,在另一种可能的实现方式中,第一虚拟卡具体为多个虚拟卡中预定类型的虚拟卡。With reference to the first aspect, in another possible implementation manner, the first virtual card is specifically a virtual card of a predetermined type among the plurality of virtual cards.

基于该可能的实现方式,通过第一虚拟卡为多个虚拟卡中预定类型的虚拟卡,可以在电子设备在某个刷卡点首次使用某个虚拟卡完成交易时,使电子设备快速确定出是否建立该虚拟卡对应的围栏。Based on this possible implementation, by using the first virtual card as a virtual card of a predetermined type among the plurality of virtual cards, it is possible for the electronic device to quickly determine whether to Build the fence corresponding to the virtual card.

结合第一方面,在另一种可能的实现方式中,GNSS包括全球卫星定位系统GPS、全球导航卫星系统GLONASS,北斗卫星导航系统BDS,准天顶卫星系统QZSS或星基增强系统SBAS。In combination with the first aspect, in another possible implementation manner, the GNSS includes the global satellite positioning system GPS, the global navigation satellite system GLONASS, the Beidou satellite navigation system BDS, the quasi-zenith satellite system QZSS or the satellite-based augmentation system SBAS.

基于该可能的实现方式,通过GNSS包括全球卫星定位系统GPS、全球导航卫星系统GLONASS,北斗卫星导航系统BDS,准天顶卫星系统QZSS或星基增强系统SBAS,可以使电子设备建立虚拟卡对应的不同类型的GNSS围栏。Based on this possible implementation, through GNSS including the global satellite positioning system GPS, the global navigation satellite system GLONASS, the Beidou satellite navigation system BDS, the quasi-zenith satellite system QZSS or the satellite-based augmentation system SBAS, the electronic device can establish a virtual card corresponding Different types of GNSS fences.

第二方面,本申请实施例提供一种虚拟卡切换装置,该虚拟卡切换装置可以应用于电子设备,用于实现上述第一方面中的方法。该虚拟卡切换装置的功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的模块,例如,获取模块、建立模块、存储模块和激活模块等。In a second aspect, an embodiment of the present application provides a virtual card switching device, which can be applied to an electronic device to implement the method in the first aspect above. The function of the virtual card switching device can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the above functions, for example, an acquisition module, an establishment module, a storage module, and an activation module.

其中,获取模块,可以用于在电子设备在第一刷卡点首次采用第一虚拟卡完成数据交互的情况下,获取电子设备的第一全球导航卫星系统GNSS位置信息以及第一GNSS精度;第一虚拟卡为多个虚拟卡中的虚拟卡Among them, the acquisition module can be used to acquire the first global navigation satellite system GNSS position information and the first GNSS accuracy of the electronic device when the electronic device uses the first virtual card to complete data interaction for the first time at the first card swiping point; the first The virtual card is a virtual card among multiple virtual cards

建立模块,可以用于根据第一GNSS位置信息,第一GNSS精度,以及第二虚拟卡所对应的第二GNSS围栏,建立第一虚拟卡所对应的第一GNSS围栏;第二虚拟卡是多个虚拟卡中电子设备已建立并存储GNSS围栏的虚拟卡。The establishment module can be used to establish the first GNSS fence corresponding to the first virtual card according to the first GNSS position information, the first GNSS accuracy, and the second GNSS fence corresponding to the second virtual card; the second virtual card is multiple A virtual card in which the electronic device has established and stored a GNSS fence.

存储模块,可以用于存储第一虚拟卡所对应的第一GNSS围栏。The storage module can be used to store the first GNSS fence corresponding to the first virtual card.

激活模块,可以用于在电子设备监测到电子设备的位置到达第一GNSS围栏的范围内的情况下,将第一虚拟卡激活。The activation module may be configured to activate the first virtual card when the electronic device monitors that the position of the electronic device is within the range of the first GNSS fence.

结合第二方面,在另一种可能的实现方式中,建立模块,具有用于建立第一虚拟卡对应的初始GNSS围栏;初始GNSS围栏为以第一GNSS位置信息为圆心,以预设长度为半径的圆形区域。建立模块,还用于在确定初始GNSS围栏与第二GNSS围栏不存在重叠区域的情况下,将初始GNSS围栏作为第一GNSS围栏。In conjunction with the second aspect, in another possible implementation, the establishment module has an initial GNSS fence for establishing the first virtual card corresponding; the initial GNSS fence is centered on the first GNSS position information, with a preset length of The radius of the circular area. The establishment module is further configured to use the initial GNSS fence as the first GNSS fence when it is determined that there is no overlapping area between the initial GNSS fence and the second GNSS fence.

结合第二方面,在另一种可能的实现方式中,上述虚拟卡切换装置还可以包括:确定模块。确定模块,可以用于在确定初始GNSS围栏与第二GNSS围栏中的第三GNSS围栏存在重叠区域的情况下,根据第一GNSS位置信息、第一GNSS精度、以及建立第三GNSS 围栏时的第二GNSS位置信息和第二GNSS精度,确定第一半径。建立模块,具体用于根据第一GNSS位置信息以及第一半径,建立第一GNSS围栏,第一GNSS围栏与第三GNSS 围栏不存在重叠区域。With reference to the second aspect, in another possible implementation manner, the above virtual card switching device may further include: a determining module. The determination module can be used for determining that the initial GNSS fence overlaps with the third GNSS fence in the second GNSS fence, according to the first GNSS position information, the first GNSS accuracy, and the first GNSS fence when establishing the third GNSS fence. With two GNSS position information and a second GNSS accuracy, a first radius is determined. The establishment module is specifically used to establish the first GNSS fence according to the first GNSS position information and the first radius, and there is no overlapping area between the first GNSS fence and the third GNSS fence.

结合第二方面,在另一种可能的实现方式中,在第二GNSS围栏中与初始GNSS围栏存在重叠区域的第三GNSS围栏为一个的情况下,第一半径为通过如下公式获得:In combination with the second aspect, in another possible implementation, in the case where there is one third GNSS fence that overlaps with the initial GNSS fence in the second GNSS fence, the first radius is obtained by the following formula:

Figure BDA0003207551810000041
Figure BDA0003207551810000041

其中,lx为第一半径,cx为第一GNSS精度,cy为第二GNSS精度,l为第一GNSS位置信息与第二GNSS位置信息之间的距离,d为初始GNSS围栏与第三GNSS围栏边界之间的缓冲宽度。Among them, l x is the first radius, c x is the first GNSS accuracy, cy is the second GNSS accuracy, l is the distance between the first GNSS position information and the second GNSS position information, and d is the distance between the initial GNSS fence and the second GNSS position information. Buffer width between three GNSS fence boundaries.

结合第二方面,在另一种可能的实现方式中,在第二GNSS围栏中与初始GNSS围栏存在重叠区域的第三GNSS围栏为多个的情况下,第一半径为与多个第三GNSS围栏一一对应的多个lx中最小的lx,lx通过如下公式获得:In conjunction with the second aspect, in another possible implementation, in the case that there are multiple third GNSS fences in the second GNSS fence that overlap with the initial GNSS fence, the first radius is equal to the multiple third GNSS fences. The smallest l x among the multiple l x corresponding to the fence one-to-one, l x is obtained by the following formula:

Figure BDA0003207551810000042
Figure BDA0003207551810000042

其中,cx为第一GNSS精度,cy为第二GNSS精度,l为第一GNSS位置信息与第二 GNSS位置信息之间的距离,d为初始GNSS围栏与第三GNSS围栏边界之间的缓冲宽度。Among them, c x is the first GNSS accuracy, c y is the second GNSS accuracy, l is the distance between the first GNSS position information and the second GNSS position information, d is the distance between the initial GNSS fence and the third GNSS fence boundary buffer width.

结合第二方面,在另一种可能的实现方式中,确定模块,还可以用于根据第一GNSS位置信息、第一GNSS精度、第二GNSS位置信息以及第二GNSS精度,确定第二半径;第二半径通过以下公式获得:With reference to the second aspect, in another possible implementation manner, the determining module may also be configured to determine the second radius according to the first GNSS position information, the first GNSS accuracy, the second GNSS position information, and the second GNSS accuracy; The second radius is obtained by the following formula:

Figure BDA0003207551810000043
Figure BDA0003207551810000043

其中,ly为第二半径,cx为第一GNSS精度,cy为第二GNSS精度,l为第一GNSS位置信息与第二GNSS位置信息之间的距离,d为初始GNSS围栏与第三GNSS围栏边界之间的缓冲宽度。上述虚拟卡切换装置还可以包括:更新模块。更新模块,可以用于根据第二 GNSS位置信息以及第二半径,更新第三GNSS围栏。Among them, l y is the second radius, c x is the first GNSS accuracy, c y is the second GNSS accuracy, l is the distance between the first GNSS position information and the second GNSS position information, d is the initial GNSS fence and the second GNSS Buffer width between three GNSS fence boundaries. The above virtual card switching device may further include: an update module. The update module can be used to update the third GNSS fence according to the second GNSS position information and the second radius.

结合第二方面,在另一种可能的实现方式中,对于每个第三GNSS围栏,确定模块,还可以用于,根据第一GNSS位置信息与第二GNSS位置信息之间的距离,第一半径以及初始GNSS围栏与第三GNSS围栏边界之间的缓冲宽度,确定第二半径。更新模块,具体用于在第二半径小于第三GNSS围栏原半径的情况下,根据第二GNSS位置信息以及第二半径更新第三GNSS围栏。With reference to the second aspect, in another possible implementation manner, for each third GNSS fence, the determination module may also be configured to, according to the distance between the first GNSS position information and the second GNSS position information, the first The radius and the buffer width between the initial GNSS fence and the boundary of the third GNSS fence determine a second radius. The update module is specifically configured to update the third GNSS fence according to the second GNSS position information and the second radius when the second radius is smaller than the original radius of the third GNSS fence.

结合第二方面,在另一种可能的实现方式中,预设长度为2千米。With reference to the second aspect, in another possible implementation manner, the preset length is 2 kilometers.

结合第二方面,在另一种可能的实现方式中,第一虚拟卡具体为多个虚拟卡中预定类型的虚拟卡。With reference to the second aspect, in another possible implementation manner, the first virtual card is specifically a virtual card of a predetermined type among the multiple virtual cards.

结合第二方面,在另一种可能的实现方式中,GNSS包括全球卫星定位系统GPS、全球导航卫星系统GLONASS,北斗卫星导航系统BDS,准天顶卫星系统QZSS或星基增强系统SBAS。With reference to the second aspect, in another possible implementation manner, the GNSS includes the global satellite positioning system GPS, the global navigation satellite system GLONASS, the Beidou satellite navigation system BDS, the quasi-zenith satellite system QZSS or the satellite-based augmentation system SBAS.

第三方面,本申请实施例提供一种电子设备,包括:处理器,用于存储该处理器可执行指令的存储器。该处理器被配置为执行上述指令时,使得该电子设备实现如第一方面或第一方面的可能的实现方式中任一项所述的虚拟卡切换方法。In a third aspect, an embodiment of the present application provides an electronic device, including: a processor, and a memory configured to store instructions executable by the processor. When the processor is configured to execute the above instructions, the electronic device implements the virtual card switching method described in any one of the first aspect or possible implementation manners of the first aspect.

第四方面,本申请实施例提供一种计算机可读存储介质,其上存储有计算机程序指令。当计算机程序指令被电子设备执行时,使得电子设备实现如第一方面或第一方面的可能的实现方式中任一项所述的虚拟卡切换方法。In a fourth aspect, the embodiment of the present application provides a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by the electronic device, the electronic device is made to implement the virtual card switching method described in any one of the first aspect or possible implementation manners of the first aspect.

第五方面,本申请实施例提供一种计算机程序产品,包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,使得电子设备实现如第一方面或第一方面的可能的实现方式中任一项所述的虚拟卡切换方法。In the fifth aspect, the embodiment of the present application provides a computer program product, including computer readable code, when the computer readable code is run in the electronic device, the electronic device realizes the possible functions of the first aspect or the first aspect. Implement the virtual card switching method described in any one of the manners.

应当理解的是,上述第二方面至第五方面的有益效果可以参见上述第一方面中的相关描述,在此不再赘述。It should be understood that, for the beneficial effects of the above-mentioned second aspect to the fifth aspect, reference may be made to relevant descriptions in the above-mentioned first aspect, and details are not repeated here.

附图说明Description of drawings

图1为本申请实施例提供的NFC虚拟卡的应用场景示意图;Fig. 1 is a schematic diagram of the application scenario of the NFC virtual card provided by the embodiment of the present application;

图2为本申请实施例提供的电子设备的显示界面示意图;FIG. 2 is a schematic diagram of a display interface of an electronic device provided in an embodiment of the present application;

图3为本申请实施例提供的电子设备的结构示意图;FIG. 3 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;

图4为本申请实施例提供的虚拟卡切换方法的框架示意图一;FIG. 4 is a first schematic diagram of the framework of the virtual card switching method provided by the embodiment of the present application;

图5为本申请实施例提供的虚拟卡切换方法的框架示意图二;FIG. 5 is a second schematic diagram of the framework of the virtual card switching method provided by the embodiment of the present application;

图6为本申请实施例提供的一种虚拟卡对应的地理围栏建立方法示意图一;FIG. 6 is a schematic diagram 1 of a method for establishing a geo-fence corresponding to a virtual card provided by an embodiment of the present application;

图7为本申请实施例提供的一种虚拟卡对应的地理围栏建立方法示意图二;FIG. 7 is a second schematic diagram of a method for establishing a geo-fence corresponding to a virtual card provided in an embodiment of the present application;

图8为本申请实施例提供的地理围栏的示意图一;FIG. 8 is a first schematic diagram of a geo-fence provided by an embodiment of the present application;

图9为本申请实施例提供的地理围栏的示意图二;FIG. 9 is a second schematic diagram of the geo-fence provided by the embodiment of the present application;

图10为本申请实施例提供的一种虚拟卡切换方法示意图一;FIG. 10 is a first schematic diagram of a virtual card switching method provided by the embodiment of the present application;

图11为本申请实施例提供的虚拟卡切换的示意图;FIG. 11 is a schematic diagram of virtual card switching provided by the embodiment of the present application;

图12为本申请实施例提供的一种虚拟卡切换方法示意图二;FIG. 12 is a second schematic diagram of a virtual card switching method provided by the embodiment of the present application;

图13为本申请实施例提供的一种虚拟卡切换装置的结构示意图。FIG. 13 is a schematic structural diagram of a virtual card switching device provided by an embodiment of the present application.

具体实施方式detailed description

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the application with reference to the drawings in the embodiments of the application. Apparently, the described embodiments are only some of the embodiments of the application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.

术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本申请的描述中,除非另有说明,“多个”的含义是两个或两个以上。The terms "first" and "second" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of indicated technical features. Thus, a feature defined as "first" and "second" may explicitly or implicitly include one or more of these features. In the description of the present application, unless otherwise specified, "plurality" means two or more.

目前,NFC技术已逐步推广到小型化的电子设备中。支持NFC功能的电子设备,如手机,可以在与NFC读卡器(如,销售点(point of sale,POS)机)靠近的情况下,与NFC 读卡器进行数据交换,从而实现各类NFC功能,如刷卡、数据传递等。例如,如图1所示,手机101具有NFC功能,用户在乘坐公交车时,可以将手机101靠近公交车上的NFC读卡器102,从而手机101可以与公交车上的NFC读卡器102进行数据交换,即手机101完成乘坐公交费用的支付。At present, NFC technology has been gradually extended to miniaturized electronic devices. Electronic devices that support NFC functions, such as mobile phones, can exchange data with NFC card readers when they are close to NFC card readers (such as point of sale (POS) machines), thereby realizing various NFC card readers. Functions, such as card swiping, data transfer, etc. For example, as shown in Figure 1, mobile phone 101 has NFC function, and the user can put mobile phone 101 close to the NFC card reader 102 on the bus when taking a bus, so that mobile phone 101 can communicate with the NFC card reader 102 on the bus. Perform data exchange, that is, the mobile phone 101 completes the payment of the bus fare.

通常,支持NFC功能的电子设备可以包括用于实现近距离通信的应用程序(如,称为 NFC应用)。NFC应用具备模拟非接触集成电路(integrated circuit,IC)卡的仿真功能。例如,NFC应用可以包括卡包应用、公交应用、银行类应用、门禁应用等。Generally, an electronic device supporting an NFC function may include an application program (eg, called an NFC application) for implementing short-distance communication. The NFC application has an emulation function of emulating a contactless integrated circuit (integrated circuit, IC) card. For example, NFC applications may include card package applications, bus applications, banking applications, access control applications, and the like.

每个NFC应用中包括至少一张虚拟卡,如,虚拟交通卡、虚拟门禁卡和虚拟银行卡等。每张虚拟卡可以对应一个标识,该标识可以为应用程序标识(applet identifier,AID),也可以为标识(identity,ID)。当虚拟卡支持AID识别时,该虚拟卡可以用AID来标识。而有些虚拟卡不支持AID识别,例如Mifare系列卡,如小区门禁卡,则可以用ID来标识。NFC应用的虚拟卡与标识之间的映射关系可以存储在电子设备的存储器中,还可以存储在云端。作为一种示例,以上述映射关系存储于电子设备的存储器中,NFC应用为卡包应用为例。在电子设备的存储器中存储的卡包应用的虚拟卡与标识之间的映射关系如表1所示。Each NFC application includes at least one virtual card, such as a virtual transportation card, a virtual access control card, and a virtual bank card. Each virtual card may correspond to an identifier, and the identifier may be an application program identifier (applet identifier, AID) or an identifier (identity, ID). When the virtual card supports AID identification, the virtual card can be identified by the AID. And some virtual cards do not support AID identification, such as Mifare series cards, such as residential access control cards, can be identified by ID. The mapping relationship between the virtual card and the identification of the NFC application can be stored in the memory of the electronic device, and can also be stored in the cloud. As an example, assume that the above mapping relationship is stored in the memory of the electronic device, and the NFC application is a card package application as an example. Table 1 shows the mapping relationship between the virtual card and the identifier of the card package application stored in the memory of the electronic device.

表1Table 1

Figure BDA0003207551810000061
Figure BDA0003207551810000061

根据表1可知,在电子设备中,卡包应用可以包括多张不同类型的虚拟卡,如小区门禁卡、公共交通卡以及智能门锁卡。同时多张虚拟卡中有一张虚拟卡的激活状态为已激活,如标识为AID2的智能门锁卡的激活状态为已激活。According to Table 1, in the electronic device, the card package application may include multiple virtual cards of different types, such as community access control cards, public transport cards and smart door lock cards. At the same time, the activation status of one of the multiple virtual cards is activated, for example, the activation status of the smart door lock card identified as AID2 is activated.

在电子设备接收到NFC场强信息(即电子设备靠近一NFC读卡器)的情况下,电子设备默认由已激活的虚拟卡与所靠近的NFC读卡器进行数据交互(即完成交易)。处于已激活的虚拟卡,往往是预先配置的默认卡。在NFC读卡器与默认卡匹配时,NFC读卡器与电子设备之间可数据交互成功。但是,NFC读卡器与默认卡不匹配时,就会出现数据交互失败。在NFC读卡器与默认卡不匹配时,需要用户手动选择正确的虚拟卡,才能实现与NFC读卡器的成功交互。When the electronic device receives the NFC field strength information (that is, the electronic device is close to an NFC card reader), the electronic device defaults to the activated virtual card for data interaction with the nearby NFC card reader (that is, completes the transaction). On the activated virtual card, often the pre-configured default card. When the NFC card reader matches the default card, the data exchange between the NFC card reader and the electronic device can be successful. However, when the NFC card reader does not match the default card, data interaction failure will occur. When the NFC card reader does not match the default card, the user needs to manually select the correct virtual card to achieve successful interaction with the NFC card reader.

例如,以电子设备是手机为例。如图2中的(a)所示,手机的卡包应用中的默认卡是智能门锁卡,也即,处于已激活状态的虚拟卡为智能门锁卡。在手机靠近公交车的NFC读卡器时,手机可接收到包括标识(如,AID1)的指示信息。之后,手机可以利用默认卡与公交车上的NFC读卡器进行数据交互。如果此时用户启动手机的卡包应用,手机可显示图 2中的(b)所示的刷卡界面201,用于提示用户正尝试以默认卡(即智能门锁卡)与NFC 读卡器进行数据交互。当然,也可能是手机响应于接收到的指示信息亮屏,并显示卡包应用的界面,如,显示上述刷卡界面201。另外,手机还可比较指示信息中的标识(即,AID1) 与默认卡的标识(即,AID2)是否相同。手机在确定两者不同时,可显示如图2中的(c) 所示的刷卡界面202,并显示“刷卡失败,切换激活卡”的提示信息。之后,用户可手动选择正确的虚拟卡激活。如,手机接收到用户对公共交通卡的选择操作,作为响应,可以将当前处于激活状态的智能门锁卡去激活,并将公共交通卡激活。之后,手机再次靠近公交车上的NFC读卡器时,利用激活的公共交通卡与公交车上的NFC读卡器进行数据交互,即可执行金额扣除等操作,并通知公交车的NFC读卡器,完成刷卡。一般的,在完成刷卡之后,手机还可以将公共交通卡去激活,并重新激活默认卡(即,智能门锁卡)。For example, take the electronic device as a mobile phone as an example. As shown in (a) in FIG. 2 , the default card in the card package application of the mobile phone is a smart door lock card, that is, the virtual card in an activated state is a smart door lock card. When the mobile phone is close to the NFC card reader of the bus, the mobile phone can receive instruction information including the identification (eg, AID1). After that, the mobile phone can use the default card to exchange data with the NFC card reader on the bus. If the user starts the card package application of the mobile phone at this time, the mobile phone can display the card swiping interface 201 shown in (b) in FIG. Data interaction. Of course, it is also possible that the screen of the mobile phone is turned on in response to the received instruction information, and displays the interface of the card package application, for example, the above-mentioned card swiping interface 201 is displayed. In addition, the mobile phone can also compare whether the identifier (ie, AID1) in the indication information is the same as that of the default card (ie, AID2). When the mobile phone determines that the two are different, it can display the card swiping interface 202 as shown in (c) in FIG. Afterwards, the user can manually select the correct virtual card to activate. For example, the mobile phone receives the user's selection operation on the public transportation card, and in response, the smart door lock card that is currently activated can be deactivated and the public transportation card can be activated. After that, when the mobile phone is close to the NFC card reader on the bus again, use the activated public transportation card to interact with the NFC card reader on the bus to perform operations such as deduction of the amount, and notify the NFC card reader on the bus to finish swiping the card. Generally, after swiping the card, the mobile phone can also deactivate the public transportation card and reactivate the default card (ie, the smart door lock card).

由此可知,在NFC读卡器与当前激活的虚拟卡,如默认卡不匹配时,即在面对不同的刷卡需求时,用户需要手动选择正确的虚拟卡激活,以便完成与NFC读卡器的数据交互。这样,导致刷卡过程的较为繁琐,时间较长。It can be seen from this that when the NFC card reader does not match the currently activated virtual card, such as the default card, that is, when faced with different card swiping requirements, the user needs to manually select the correct virtual card to activate in order to complete the activation with the NFC card reader. data interaction. Like this, cause comparatively loaded down with trivial details of the card swiping process, the time is longer.

相关技术中,利用无线保真(wireless fidelity,Wi-Fi)地理围栏实现用户刷卡前对应虚拟卡的自动激活。In related technologies, a wireless fidelity (Wi-Fi) geo-fence is used to realize automatic activation of a corresponding virtual card before a user swipes the card.

地理围栏,是指在用户到达某一地理位置附近时,用户的手机可以将监测到的手机的经纬度坐标、手机扫描到的小区基站的标识或者手机扫描到的Wi-Fi信息(如Wi-Fi 标识),与对该地理位置对应的位置信息、小区(Cell)基站的标识或者Wi-Fi信息进行匹配,匹配成功后手机可以确定用户进入该地理位置对应的地理围栏中。Geo-fence means that when the user arrives near a certain geographical location, the user's mobile phone can monitor the longitude and latitude coordinates of the mobile phone, the logo of the cell base station scanned by the mobile phone, or the Wi-Fi information (such as Wi-Fi ID), and match with the location information corresponding to the geographic location, the ID of the cell (Cell) base station or Wi-Fi information, and after the matching is successful, the mobile phone can determine that the user enters the geofence corresponding to the geographic location.

地理围栏根据其监测参数可以分为全球导航卫星系统(global navigationsatellite system,GNSS)地理围栏、小区(Cell)地理围栏以及Wi-Fi地理围栏。Geofences can be classified into global navigation satellite system (global navigation satellite system, GNSS) geofences, cell (Cell) geofences, and Wi-Fi geofences according to their monitoring parameters.

GNSS地理围栏监测参数可以是手机的经纬度坐标。GNSS地理围栏的监测区域可以是以某地理位置坐标点为中心,以一定长度为半径的圆形区域,也可以是以多个地理位置坐标点为顶点,各顶点连接起来的多边形区域。The GNSS geographic fence monitoring parameter may be the latitude and longitude coordinates of the mobile phone. The monitoring area of the GNSS geo-fence can be a circular area with a certain geographic location coordinate point as the center and a certain length as the radius, or a polygonal area with multiple geographic location coordinate points as vertices and connected vertices.

Cell地理围栏的监测参数可以是手机扫描到的小区基站的标识。Cell地理围栏的监测区域可以是一个或多个小区基站信号的覆盖范围。The monitoring parameter of the Geographical Fence of the Cell may be the identity of the base station of the cell scanned by the mobile phone. The monitoring area of the Cell geo-fence may be the coverage area of one or more cell base station signals.

Wi-Fi地理围栏的监测参数可以是手机扫描到的Wi-Fi信号。Wi-Fi地理围栏的监测区域可以是一个或多个Wi-Fi信号的覆盖范围。The monitoring parameter of the Wi-Fi geo-fence may be the Wi-Fi signal scanned by the mobile phone. The monitoring area of the Wi-Fi geo-fence may be the coverage area of one or more Wi-Fi signals.

在手机确定用户进入该地理位置对应的地理围栏中之后,可以触发该地理位置对应的围栏机制,从而执行与该地理位置对应围栏对应的操作,例如可以将该地理位置对应的卡片激活。After the mobile phone determines that the user enters the geographic fence corresponding to the geographic location, the fence mechanism corresponding to the geographic location can be triggered to perform operations corresponding to the fence corresponding to the geographic location, for example, the card corresponding to the geographic location can be activated.

具体的,上述相关技术的方案是:在用户使用某虚拟卡进行交易时,手机根据该虚拟卡的标识,以及用户刷卡位置对应的Wi-Fi标识,设置Wi-Fi地理围栏,并保存该 Wi-Fi地理围栏中的Wi-Fi标识与虚拟卡标识的对应关系。之后,手机可周期性的获取手机当前所处地理位置的Wi-Fi标识,并判断获取到的Wi-Fi标识与设置的Wi-Fi地理围栏中的Wi-Fi标识是否相同。当手机检测到获取到的Wi-Fi标识与Wi-Fi地理围栏中的Wi-Fi标识相同时,确定用户进入到该Wi-Fi地理围栏中。此时,手机可根据保存的对应关系,自动将该Wi-Fi地理围栏对应的虚拟卡激活,从而用户可以利用该激活的虚拟卡完成刷卡。即在用户刷卡前实现了对应虚拟卡的自动激活。Specifically, the solution of the above-mentioned related technology is: when a user uses a virtual card to conduct a transaction, the mobile phone sets a Wi-Fi geo-fence according to the identity of the virtual card and the Wi-Fi identity corresponding to the location where the user swipes the card, and saves the Wi-Fi - Correspondence between the Wi-Fi ID in the Fi geofence and the virtual card ID. Afterwards, the mobile phone can periodically obtain the Wi-Fi identification of the current geographical location of the mobile phone, and judge whether the obtained Wi-Fi identification is the same as the Wi-Fi identification in the set Wi-Fi geo-fence. When the mobile phone detects that the obtained Wi-Fi identifier is the same as the Wi-Fi identifier in the Wi-Fi geo-fence, it is determined that the user has entered the Wi-Fi geo-fence. At this time, the mobile phone can automatically activate the virtual card corresponding to the Wi-Fi geo-fence according to the saved correspondence, so that the user can use the activated virtual card to complete card swiping. That is, the automatic activation of the corresponding virtual card is realized before the user swipes the card.

然而,上述方案的实现需要手机具备Wi-Fi地理围栏能力,如需要手机中的传感集线器(sensorhub)具备低功耗Wi-Fi地理围栏能力。在手机不具备Wi-Fi地理围栏能力时,无法实现虚拟卡对应Wi-Fi地理围栏的设置,也就无法在用户刷卡前自动激活对应的虚拟卡。这样,还是需要用户手动选择正确的虚拟卡激活。However, the implementation of the above solution requires the mobile phone to have the capability of Wi-Fi geo-fencing, for example, the sensor hub (sensorhub) in the mobile phone is required to have the capability of low-power Wi-Fi geo-fencing. When the mobile phone does not have the Wi-Fi geo-fence capability, the setting of the virtual card corresponding to the Wi-Fi geo-fence cannot be realized, and the corresponding virtual card cannot be automatically activated before the user swipes the card. In this way, the user still needs to manually select the correct virtual card for activation.

针对上述问题,本申请实施例提供一种虚拟卡切换方法,应该于电子设备,该方法可以在用户在某个刷卡点首次使用某个虚拟卡完成交易时,根据电子设备当前的GNSS位置信息,建立该虚拟卡对应的GNSS地理围栏。之后当用户持电子设备再次进入到该GNSS 地理围栏时,电子设备可以自动将该GNSS地理围栏对应的虚拟卡激活,从而用户可以利用该虚拟卡完成交易。即,在用户刷卡前,电子设备能够利用GNSS地理围栏自动激活对应的虚拟卡。In view of the above problems, the embodiment of the present application provides a virtual card switching method, which should be applied to electronic devices. This method can be used according to the current GNSS position information of the electronic device when the user completes the transaction with a certain virtual card at a certain card swiping point for the first time. Establish the GNSS geofence corresponding to the virtual card. Later, when the user enters the GNSS geofence again with the electronic device, the electronic device can automatically activate the virtual card corresponding to the GNSS geofence, so that the user can use the virtual card to complete transactions. That is, before the user swipes the card, the electronic device can automatically activate the corresponding virtual card by using the GNSS geo-fence.

这样,在面对不同的刷卡需求时,能够避免用户需要手动选择虚拟卡,从而降低刷卡的时长,提升用户体验。且本申请的方案可以根据GNSS位置信息,建立对应的地理围栏,GNSS位置信息可利用电子设备的短距离芯片来获取。而短距离芯片是电子设备的标准配置,因此即使电子设备不具备Wi-Fi围栏能力,仍然可以在用户刷卡前实现对应虚拟卡的自动激活,进一步提高了用户的使用体验。In this way, when faced with different card swiping requirements, the user can avoid the need to manually select a virtual card, thereby reducing the time for swiping a card and improving user experience. Moreover, the solution of the present application can establish a corresponding geographic fence according to the GNSS position information, and the GNSS position information can be obtained by using the short-distance chip of the electronic device. The short-distance chip is a standard configuration of electronic equipment, so even if the electronic equipment does not have the Wi-Fi fence capability, it can still realize the automatic activation of the corresponding virtual card before the user swipes the card, further improving the user experience.

可以理解的是,GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenithsatellite system,QZSS)和 /或星基增强系统(satellite based augmentationsystems,SBAS)等。因此,本实施例中的 GNSS地理围栏可以为GPS地理围栏、GLONASS地理围栏、北斗地理围栏、QZSS地理围栏或者SBAS地理围栏等。It can be understood that GNSS may include global positioning system (global positioning system, GPS), global navigation satellite system (global navigation satellite system, GLONASS), Beidou satellite navigation system (beidou navigation satellite system, BDS), quasi-zenith satellite system (quasi-zenithsatellite system, QZSS) and/or satellite based augmentation system (satellite based augmentationsystems, SBAS), etc. Therefore, the GNSS geo-fence in this embodiment may be a GPS geo-fence, a GLONASS geo-fence, a Beidou geo-fence, a QZSS geo-fence, or an SBAS geo-fence.

本申请中对GNSS地理围栏的具体类型并不进行限定。为了便于理解,本申请以下实施例中以GNSS地理围栏为GPS地理围栏为例进行示意说明。即GPS围栏的监测参数可以是电子设备的经纬度坐标。GPS围栏的监测区域可以是以某地理位置坐标点为中心,以一定长度为半径的圆形区域,也可以是以多个地理位置坐标点为顶点,各顶点连接起来的多边形区域。The specific type of the GNSS geo-fence is not limited in this application. For ease of understanding, in the following embodiments of the present application, a GNSS geofence is taken as an example for schematic illustration. That is, the monitoring parameters of the GPS fence can be the latitude and longitude coordinates of the electronic equipment. The monitoring area of the GPS fence can be a circular area with a certain geographic location coordinate point as the center and a certain length as the radius, or a polygonal area with multiple geographic location coordinate points as vertices and connected vertices.

另外,在一些示例中,上述电子设备可以是手机、平板电脑、手持计算机,个人计算机(personal computer,PC),蜂窝电话,个人数字助理(personal digital assistant,PDA),可穿戴式设备等具有NFC功能的电子设备。本申请实施例在此对电子设备的具体形态不做限制。In addition, in some examples, the above-mentioned electronic devices may be mobile phones, tablet computers, handheld computers, personal computers (personal computers, PCs), cellular phones, personal digital assistants (personal digital assistants, PDAs), wearable devices, etc. functional electronic devices. The embodiment of the present application does not limit the specific form of the electronic device.

示例地,以电子设备为手机为例,图3示出了本申请实施例提供的一种电子设备的结构示意图。Exemplarily, taking the electronic device as a mobile phone as an example, FIG. 3 shows a schematic structural diagram of an electronic device provided by an embodiment of the present application.

如图3所示,电子设备可以包括处理器310,外部存储器接口320,内部存储器321,通用串行总线(universal serial bus,USB)接口330,充电管理模块340,电源管理模块341,电池342,天线1,天线2,移动通信模块350,无线通信模块360,音频模块370,扬声器370A,受话器370B,麦克风370C,耳机接口370D,传感器模块380,按键390,马达391,指示器392,摄像头393,显示屏394,以及用户标识模块(subscriber identification module,SIM)卡接口395等。其中,传感器模块380可以包括压力传感器380A,陀螺仪传感器380B,气压传感器380C,磁传感器380D,加速度传感器380E,距离传感器380F,接近光传感器 380G,指纹传感器380H,温度传感器380J,触摸传感器380K,环境光传感器380L,骨传导传感器380M等。As shown in FIG. 3 , the electronic device may include a processor 310, an external memory interface 320, an internal memory 321, a universal serial bus (universal serial bus, USB) interface 330, a charging management module 340, a power management module 341, a battery 342, Antenna 1, antenna 2, mobile communication module 350, wireless communication module 360, audio module 370, speaker 370A, receiver 370B, microphone 370C, earphone jack 370D, sensor module 380, button 390, motor 391, indicator 392, camera 393, A display screen 394, a subscriber identification module (subscriber identification module, SIM) card interface 395, and the like. Among them, the sensor module 380 may include a pressure sensor 380A, a gyroscope sensor 380B, an air pressure sensor 380C, a magnetic sensor 380D, an acceleration sensor 380E, a distance sensor 380F, a proximity light sensor 380G, a fingerprint sensor 380H, a temperature sensor 380J, a touch sensor 380K, an environment Light sensor 380L, bone conduction sensor 380M, etc.

可以理解的是,本实施例示意的结构并不构成对电子设备的具体限定。在另一些实施例中,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It should be understood that the structure shown in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than shown, or combine certain components, or separate certain components, or arrange different components. The illustrated components can be realized in hardware, software or a combination of software and hardware.

处理器310可以包括一个或多个处理单元,例如:处理器310可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 310 may include one or more processing units, for example: the processor 310 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor ( image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU), etc. . Wherein, different processing units may be independent devices, or may be integrated in one or more processors.

本申请实施例中,处理器310还可以包括传感集线器(sensorhub)、短距离处理器(也可以称为短距离芯片)。短距离芯片可以用于获取GPS定位信息以及Wi-Fi扫描信息。在一些实施例中,短距离芯片可以包括两个芯片,即GPS芯片和Wi-Fi芯片,GPS芯片用于用于获取GPS定位信息,Wi-Fi芯片用于获取Wi-Fi扫描信息。In the embodiment of the present application, the processor 310 may further include a sensor hub (sensorhub) and a short-distance processor (also referred to as a short-distance chip). The short-range chip can be used to obtain GPS positioning information and Wi-Fi scanning information. In some embodiments, the short-range chip may include two chips, namely a GPS chip and a Wi-Fi chip, the GPS chip is used to obtain GPS positioning information, and the Wi-Fi chip is used to obtain Wi-Fi scanning information.

控制器可以是电子设备的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。A controller can be the nerve center and command center of an electronic device. The controller can generate an operation control signal according to the instruction opcode and timing signal, and complete the control of fetching and executing the instruction.

处理器310中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器310 中的存储器为高速缓冲存储器。该存储器可以保存处理器310刚用过或循环使用的指令或数据。如果处理器310需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器310的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 310 for storing instructions and data. In some embodiments, the memory in processor 310 is a cache memory. The memory may hold instructions or data that the processor 310 has just used or recycled. If the processor 310 needs to use the instruction or data again, it can be called directly from the memory. Repeated access is avoided, and the waiting time of the processor 310 is reduced, thereby improving the efficiency of the system.

在一些实施例中,处理器310可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuitsound,I2S) 接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purposeinput/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus, USB)接口等。In some embodiments, processor 310 may include one or more interfaces. The interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuitsound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver (universal asynchronous receiver) /transmitter, UART) interface, mobile industry processor interface (mobile industry processor interface, MIPI), general-purpose input and output (general-purpose input/output, GPIO) interface, subscriber identity module (subscriber identity module, SIM) interface, and/or A universal serial bus (universal serial bus, USB) interface and the like.

电子设备的无线通信功能可以通过天线1,天线2,移动通信模块350,无线通信模块 360,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device can be realized by the antenna 1, the antenna 2, the mobile communication module 350, the wireless communication module 360, the modem processor and the baseband processor.

天线1和天线2用于发射和接收电磁波信号。电子设备中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in an electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.

移动通信模块350可以提供应用在电子设备上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块350可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块350可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块350还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块350的至少部分功能模块可以被设置于处理器310中。在一些实施例中,移动通信模块350的至少部分功能模块可以与处理器310的至少部分模块被设置在同一个器件中。The mobile communication module 350 can provide wireless communication solutions including 2G/3G/4G/5G applied to electronic devices. The mobile communication module 350 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA) and the like. The mobile communication module 350 can receive electromagnetic waves through the antenna 1, filter and amplify the received electromagnetic waves, and send them to the modem processor for demodulation. The mobile communication module 350 can also amplify the signal modulated by the modem processor, convert it into electromagnetic wave and radiate it through the antenna 1 . In some embodiments, at least part of the functional modules of the mobile communication module 350 may be set in the processor 310 . In some embodiments, at least part of the functional modules of the mobile communication module 350 and at least part of the modules of the processor 310 may be set in the same device.

无线通信模块360可以提供应用在电子设备上的包括无线局域网(wirelesslocal area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation, FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块360可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块360经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器310。无线通信模块360还可以从处理器310接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 360 can provide wireless local area networks (wireless local area networks, WLAN) (such as wireless fidelity (Wi-Fi) network), bluetooth (bluetooth, BT), global navigation satellite system ( Global navigation satellite system (GNSS), frequency modulation (frequency modulation, FM), near field communication (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions. The wireless communication module 360 may be one or more devices integrating at least one communication processing module. The wireless communication module 360 receives electromagnetic waves via the antenna 2 , frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 310 . The wireless communication module 360 can also receive the signal to be sent from the processor 310 , frequency-modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.

在一些实施例中,电子设备的天线1和移动通信模块350耦合,天线2和无线通信模块360耦合,使得电子设备可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code divisionmultiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。In some embodiments, the antenna 1 of the electronic device is coupled to the mobile communication module 350, and the antenna 2 is coupled to the wireless communication module 360, so that the electronic device can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and/or IR technology, etc.

电子设备通过GPU,显示屏394,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏394和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器310可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device realizes the display function through the GPU, the display screen 394 , and the application processor. The GPU is a microprocessor for image processing, connected to the display screen 394 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. Processor 310 may include one or more GPUs that execute program instructions to generate or alter display information.

显示屏394用于显示图像,视频等。显示屏394包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emittingdiode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrixorganic light emitting diode,AMOLED),柔性发光二极管(flex light-emittingdiode,FLED),Miniled,MicroLed, Micro-oLed,量子点发光二极管(quantum dot lightemitting diodes,QLED)等。在一些实施例中,电子设备可以包括1个或N个显示屏394,N为大于1的正整数。The display screen 394 is used to display images, videos and the like. Display 394 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light emitting diode). , AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diodes (quantum dot light emitting diodes, QLED), etc. In some embodiments, the electronic device may include 1 or N display screens 394, where N is a positive integer greater than 1.

本申请实施例中,显示屏394可用于显示电子设备的界面。In the embodiment of the present application, the display screen 394 may be used to display the interface of the electronic device.

电子设备可以通过ISP,摄像头393,视频编解码器,GPU,显示屏394以及应用处理器等实现拍摄功能。在一些实施例中,电子设备可以包括1个或N个摄像头393,N为大于 1的正整数。The electronic device can realize the shooting function through ISP, camera 393 , video codec, GPU, display screen 394 and application processor. In some embodiments, the electronic device may include 1 or N cameras 393, where N is a positive integer greater than 1.

内部存储器321可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器310通过运行存储在内部存储器321的指令,从而执行电子设备的各种功能应用以及数据处理。内部存储器321可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备使用过程中所建立的数据(比如音频数据,电话本等)等。此外,内部存储器321可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。The internal memory 321 may be used to store computer-executable program code, which includes instructions. The processor 310 executes various functional applications and data processing of the electronic device by executing instructions stored in the internal memory 321 . The internal memory 321 may include an area for storing programs and an area for storing data. Wherein, the stored program area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like. The storage data area can store data (such as audio data, phone book, etc.) created during the use of the electronic device. In addition, the internal memory 321 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like.

加速度传感器380E可按照一定频率,周期性地采集电子设备的加速度数据。比如,可采集电子设备在各个方向(一般为XYZ三轴方向)上的加速度大小。The acceleration sensor 380E can periodically collect acceleration data of the electronic device according to a certain frequency. For example, the acceleration of the electronic device in various directions (generally XYZ three-axis directions) can be collected.

当然,可以理解的,上述图3所示仅仅为电子设备的形态为手机时的示例性说明。若电子设备是平板电脑,手持计算机,PC,PDA,可穿戴式设备(如:智能手表、智能手环) 等其他设备形态时,电子设备的结构中可以包括比图3中所示更少的结构,也可以包括比图3中所示更多的结构,在此不作限制。Of course, it can be understood that what is shown in FIG. 3 above is only an exemplary description when the form of the electronic device is a mobile phone. If the electronic device is in the form of a tablet computer, a handheld computer, a PC, a PDA, a wearable device (such as a smart watch, a smart bracelet), etc., the structure of the electronic device may include fewer The structures may also include more structures than those shown in FIG. 3 , which is not limited here.

可以理解的是,一般而言,电子设备功能的实现除了需要硬件的支持外,还需要软件的配合。It can be understood that, generally speaking, the realization of the functions of electronic equipment requires not only the support of hardware, but also the cooperation of software.

例如,在本申请的一些示例中,如图4所示,实现电子设备虚拟卡的自动切换,至少需要处理器,如传感集线器(sensorhub)、短距离芯片以及基带处理器(也可以称为基带芯片)等硬件的支持,还需要使用围栏的应用,如NFC卡包应用(例如智闪卡应用)以及系统服务中的应用(如GPS应用、Wi-Fi应用)等软件的配合。软件和硬件之间可通过硬件连接层连接。For example, in some examples of the present application, as shown in FIG. 4, at least a processor is required to realize the automatic switching of the virtual card of the electronic device, such as a sensor hub (sensorhub), a short-distance chip, and a baseband processor (also called Baseband chip) and other hardware support, also need to use fence applications, such as NFC card package applications (such as smart flash card applications) and applications in system services (such as GPS applications, Wi-Fi applications) and other software. The software and hardware can be connected through the hardware connection layer.

其中,基于图4所示,以系统服务中的应用为GPS应用,以及电子设备建立的地理围栏为GPS围栏为例,电子设备实现虚拟卡自动切换的过程可以包括:在用户在某个刷卡点首次使用某个虚拟卡完成交易时,短距离芯片获取GPS定位信息。短距离芯片通过sensorhub、硬件连接层及GPS应用将GPS定位信息发送给智闪卡应用。智闪卡应用建立GPS围栏,并将建立的GPS围栏发送给GPS应用。GPS应用将智闪卡应用建立的围栏进行围栏存储和围栏管理。GPS应用将建立的GPS围栏经硬件连接层发送给sensorhub。之后,sensorhub 可以周期性的从短距离芯片获取电子设备的GPS定位信息。sensorhub可以包括围栏算法,如GPS围栏算法、小区Cell围栏算法以及Wi-Fi围栏算法。sensorhub从短距芯片获取GPS 位置信息,利用内置的围栏算法,如GPS围栏算法确定用户是否进入GPS围栏,sensorhub 工作时不需要唤醒电子设备的主处理器,从而实现低功耗的围栏能力。在sensorhub确定用户进入GPS围栏时,sensorhub将用户进入的GPS围栏通过硬件连接层和GPS应用发送给智闪卡应用,从而智闪卡根据用户进入的GPS围栏,将该GPS围栏对应的虚拟卡激活。Wherein, based on what is shown in Figure 4, taking the application in the system service as a GPS application and the geofence established by the electronic device as a GPS fence as an example, the process for the electronic device to automatically switch virtual cards may include: When a virtual card is used for the first time to complete a transaction, the short-range chip obtains GPS location information. The short-distance chip sends GPS positioning information to the smart flash card application through the sensorhub, hardware connection layer and GPS application. The smart flash card application builds a GPS fence and sends the built GPS fence to the GPS application. The GPS application stores and manages the fence established by the smart flash card application. The GPS application sends the established GPS fence to the sensorhub through the hardware connection layer. After that, sensorhub can periodically obtain the GPS positioning information of the electronic device from the short-range chip. The sensorhub can include fence algorithms, such as GPS fence algorithms, cell fence algorithms, and Wi-Fi fence algorithms. The sensorhub obtains the GPS location information from the short-distance chip, and uses the built-in fence algorithm, such as the GPS fence algorithm to determine whether the user enters the GPS fence. The sensorhub does not need to wake up the main processor of the electronic device when it is working, so as to realize the low-power fence capability. When sensorhub determines that the user enters the GPS fence, sensorhub sends the GPS fence that the user entered to the smart flash card application through the hardware connection layer and the GPS application, so that the smart flash card activates the virtual card corresponding to the GPS fence that the user enters .

上述示例是以电子设备的处理器包括sensorhub,且短距离芯片为一个芯片为例进行说明的,即短距离芯片可以用于获取GPS定位信息,也可以用来获取Wi-Fi扫描信息。在另一中实施例中,电子设备的处理器可以不包括sensorhub,短距离芯片可以包括两个芯片,即GPS芯片和Wi-Fi芯片,GPS芯片用于用于获取GPS定位信息,Wi-Fi芯片用于获取Wi-Fi扫描信息,则如图5所示,继续以系统服务中的应用为GPS应用,以及电子设备建立的围栏为GPS围栏为例,电子设备实现虚拟卡自动切换的过程可以包括:在用户在某个刷卡点首次使用某个虚拟卡完成交易时,GPS芯片获取GPS定位信息。GPS芯片通过硬件连接层及GPS应用将GPS定位信息发送给智闪卡应用。智闪卡应用建立GPS围栏,并将建立的 GPS围栏发送给GPS应用。GPS应用将智闪卡应用建立的围栏进行围栏存储和围栏管理。 GPS应用将建立的GPS围栏发送给GPS芯片。之后,GPS芯片可以周期性的获取GPS定位信息,并利用其包括的GPS围栏算法确定用户是否进入GPS围栏。在确定用户进入GPS 围栏时,GPS芯片将用户进入的GPS围栏通过GPS应用发送给智闪卡应用,GPS芯片可独立工作,不需要唤醒电子设备的主处理器,从而实现低功耗的围栏能力。智闪卡根据用户进入的GPS围栏,将该GPS围栏对应的虚拟卡激活。The above example is illustrated by taking the processor of the electronic device including a sensorhub and the short-range chip as an example, that is, the short-range chip can be used to obtain GPS positioning information, and can also be used to obtain Wi-Fi scanning information. In another embodiment, the processor of the electronic device may not include a sensorhub, and the short-distance chip may include two chips, namely a GPS chip and a Wi-Fi chip, the GPS chip is used to obtain GPS positioning information, and the Wi-Fi The chip is used to obtain Wi-Fi scanning information, as shown in Figure 5, continue to take the application in the system service as the GPS application, and the fence established by the electronic device as the GPS fence as an example, the process of the electronic device to realize the automatic switching of the virtual card can be Including: when a user completes a transaction with a virtual card at a certain card swiping point for the first time, the GPS chip obtains GPS positioning information. The GPS chip sends the GPS positioning information to the smart flash card application through the hardware connection layer and the GPS application. The smart flash card application builds a GPS fence and sends the built GPS fence to the GPS application. The GPS application stores and manages the fence established by the smart flash card application. The GPS application sends the established GPS fence to the GPS chip. Afterwards, the GPS chip can periodically obtain GPS positioning information, and use its included GPS fence algorithm to determine whether the user enters the GPS fence. When it is determined that the user enters the GPS fence, the GPS chip sends the GPS fence that the user entered to the smart flash card application through the GPS application. The GPS chip can work independently without waking up the main processor of the electronic device, thereby realizing low-power fence capability . According to the GPS fence that the user enters, the smart flash card activates the virtual card corresponding to the GPS fence.

以下结合附图4对本申请实施例提供的虚拟卡的切换方法进行详细说明。其中,在本申请实施例中,该方法可以包括:“围栏建立”流程和“虚拟卡切换”流程。The virtual card switching method provided by the embodiment of the present application will be described in detail below with reference to FIG. 4 . Wherein, in the embodiment of the present application, the method may include: a "fence establishment" process and a "virtual card switching" process.

如图6所示,“围栏建立”流程可以包括以下S601-S605。As shown in Fig. 6, the "fence establishment" process may include the following S601-S605.

S601、电子设备的智闪卡应用获取第一虚拟卡。S601. The smart flash card application of the electronic device acquires a first virtual card.

用户在需要使用电子设备上的虚拟卡时,可以在电子设备,如电子设备的智闪卡应用上开设虚拟卡。例如,用户可以点击电子设备的智闪卡应用中的立即开通选项。响应于用户的点击操作,电子设备显示可以开通的虚拟卡选项,例如公共交通卡选项。之后,用户可以选择公共交通卡,并选择对应的开通地区。响应于用户的选择操作,电子设备开设公共交通卡成功。When the user needs to use the virtual card on the electronic device, he can open a virtual card on the electronic device, such as the smart flash card application of the electronic device. For example, the user may click on the option to activate immediately in the smart flash card application of the electronic device. In response to the user's click operation, the electronic device displays virtual card options that can be activated, such as public transportation card options. After that, the user can select the public transportation card and select the corresponding activation area. In response to the user's selection operation, the electronic device successfully opens a public transportation card.

电子设备开设虚拟卡之后,电子设备,如电子设备的智闪卡应用可以获取第一虚拟卡,第一虚拟卡可以是电子设备开设的虚拟卡。After the virtual card is opened on the electronic device, the electronic device, such as the smart flash card application of the electronic device, can obtain the first virtual card, and the first virtual card can be the virtual card opened by the electronic device.

具有NFC功能的电子设备,可以包括多个虚拟卡,如小区门禁卡、公共交通卡、智能门锁卡以及箱包、车钥匙以及身份证等对应的虚拟卡,从而满足不同的刷卡需求。Electronic devices with NFC functions can include multiple virtual cards, such as community access cards, public transportation cards, smart door lock cards, and corresponding virtual cards for luggage, car keys, and ID cards, so as to meet different card swiping needs.

对于电子设备中的虚拟卡,在用户使用任一个虚拟卡进行交易时,电子设备可以建立对应的地理围栏。一个虚拟卡可以建立一个地理围栏,也可以建立多个地理围栏。例如,用户使用公共交通卡在公交车站A进行刷卡时,电子设备可以建立公共交通卡在公交车站 A对应的地理围栏。当用户使用公共交通卡在公交车站B进行刷卡时,电子设备可以建立公共交通卡在公交车站B对应的地理围栏。For the virtual cards in the electronic device, when the user uses any virtual card to conduct transactions, the electronic device can establish a corresponding geographic fence. A virtual card can establish one geo-fence or multiple geo-fences. For example, when the user uses a public transportation card to swipe the card at bus stop A, the electronic device may establish a geographic fence corresponding to the public transportation card at bus stop A. When the user uses the public transportation card to swipe the card at the bus station B, the electronic device may establish a geographic fence corresponding to the public transportation card at the bus station B.

上述虚拟卡中,有些虚拟卡的刷卡点固定,这种虚拟卡在本实施例中称为预定类型的第一虚拟卡,如,小区门禁卡、公共交通卡以及智能门锁卡等,其对应刷卡点一般都是固定的。而有些虚拟卡的刷卡点确是不固定的,如,车钥匙、箱包以及身份证等对应的虚拟卡,这些虚拟卡的刷卡点可能会随着使用地点的不同而发生变化。Among the above-mentioned virtual cards, some of the virtual cards have fixed card swiping points. This virtual card is called the first virtual card of a predetermined type in this embodiment, such as community access control cards, public transportation cards, and smart door lock cards. The card swiping points are generally fixed. However, the swiping points of some virtual cards are indeed not fixed, such as virtual cards corresponding to car keys, bags, and ID cards. The swiping points of these virtual cards may change with different places of use.

在一些实施例中,由于地理围栏需要在一个固定的位置建立,因此,对于刷卡点固定的虚拟卡,即预定类型的第一虚拟卡,可以建立对应的地理围栏。而对于刷卡点不固定的虚拟卡,由于刷卡地点不固定,因此电子设备无法建立虚拟卡对应的地理围栏。因此,电子设备在建立虚拟卡对应的地理围栏之前,电子设备,如电子设备的智闪卡应用可以根据虚拟卡的刷卡地点是否固定,先确定出刷卡点固定的虚拟卡,即预定类型的第一虚拟卡,从而电子设备在某个刷卡点首次使用某个预定类型的第一虚拟卡完成交易时,可以建立该预定类型的第一虚拟卡对应的地理围栏。In some embodiments, since the geo-fence needs to be established at a fixed location, a corresponding geo-fence may be established for a virtual card with a fixed swiping point, that is, the first virtual card of a predetermined type. As for the virtual card whose card swiping point is not fixed, the electronic device cannot establish a geographic fence corresponding to the virtual card because the card swiping point is not fixed. Therefore, before the electronic device establishes the geographic fence corresponding to the virtual card, the electronic device, such as the smart flash card application of the electronic device, can first determine the virtual card with a fixed swiping point according to whether the swiping point of the virtual card is fixed, that is, the first type of the predetermined type. A virtual card, so that when the electronic device first uses a predetermined type of first virtual card to complete a transaction at a certain card swiping point, it can establish a geo-fence corresponding to the predetermined type of first virtual card.

在一些示例中,电子设备可以根据虚拟卡的类型确定虚拟卡是否为预定类型的第一虚拟卡。例如,对于小区门禁卡的刷卡点为小区,该刷卡点位置是固定不变的,因此当虚拟卡的类型为小区门禁卡时,电子设备可以确定该虚拟卡的刷卡点固定,即小区门禁卡为预定类型的第一虚拟卡。In some examples, the electronic device may determine whether the virtual card is a first virtual card of a predetermined type according to the type of the virtual card. For example, if the swipe point of the community access control card is a community, the location of the swipe point is fixed, so when the type of the virtual card is a community access card, the electronic device can determine that the swipe point of the virtual card is fixed, that is, the community access card is a first virtual card of a predetermined type.

对于身份证对应的虚拟卡的刷卡点可以为银行,也可以为公司,还可以为家里,即身份证对应的虚拟卡的刷卡点位置并不固定,因此,当虚拟卡的类型为身份证对应的虚拟卡时,电子设备可以确定该虚拟卡不是预定类型的第一虚拟卡。The card swiping point of the virtual card corresponding to the ID card can be a bank, a company, or a home, that is, the position of the card swiping point of the virtual card corresponding to the ID card is not fixed. When the virtual card is selected, the electronic device may determine that the virtual card is not the first virtual card of the predetermined type.

在一些实施例中,电子设备在确定出预定类型的第一虚拟卡之后,电子设备,如电子设备中的智闪卡应用可以将预定类型的第一虚拟卡的标识(如AID或ID)保存在相应的列表中。In some embodiments, after the electronic device determines the first virtual card of the predetermined type, the electronic device, such as the smart flash card application in the electronic device, may save the identification (such as AID or ID) of the first virtual card of the predetermined type in the corresponding list.

例如,结合图4所示,电子设备的智闪卡应用可以确定出刷卡点固定的虚拟卡,即预定类型的第一虚拟卡,并将预定类型的第一虚拟卡对应的标识存储在智闪卡列表中。之后,电子设备,如电子设备的智闪卡应用可以根据该列表,确定后续是否建立对应的第一虚拟卡对应的地理围栏。例如,用户在某个刷卡点首次使用智闪卡列表中的某个预定类型的第一虚拟卡完成交易时,电子设备的智闪卡应用可以建立该第一虚拟卡对应的地理围栏。在用户使用非智闪卡列表中的虚拟卡完成交易时,电子设备的智闪卡应用可以不建立地理围栏。For example, as shown in FIG. 4 , the smart flash card application of the electronic device can determine the virtual card with a fixed swiping point, that is, the first virtual card of a predetermined type, and store the identifier corresponding to the first virtual card of the predetermined type in the smart flash card list. Afterwards, the electronic device, such as the smart flash card application of the electronic device, can determine whether to establish a corresponding geo-fence corresponding to the first virtual card according to the list. For example, when a user completes a transaction with a predetermined type of first virtual card in the smart card list at a certain card swiping point for the first time, the smart card application of the electronic device may establish a geo-fence corresponding to the first virtual card. When the user completes the transaction with a virtual card in the non-smart flash card list, the smart flash card application of the electronic device does not need to establish a geo-fence.

其中,电子设备的智闪卡应用建立地理围栏的过程可以包括以下S602-S605。Wherein, the process of establishing a geographic fence by the smart card application of the electronic device may include the following S602-S605.

S602、电子设备的智闪卡应用在某个刷卡点首次采用某个第一虚拟卡与NFC读卡器完成数据交互时,获取电子设备当前的地理位置信息以及地理位置精度。S602. The smart flash card application of the electronic device obtains the current geographic location information and geographic location accuracy of the electronic device when a certain first virtual card is used to complete data interaction with the NFC card reader at a certain card swiping point for the first time.

在用户使用上述第一虚拟卡(如上述预定类型的第一虚拟卡)首次在某个刷卡点完成交易,即采用该第一虚拟卡与某个刷卡点对应的NFC读卡器完成数据交互时,电子设备,如电子设备的智闪卡应用可以建立该第一虚拟卡对应的地理围栏。When the user uses the above-mentioned first virtual card (such as the first virtual card of the above-mentioned predetermined type) to complete the transaction at a certain card-swiping point for the first time, that is, when the first virtual card is used to complete the data interaction with the NFC card reader corresponding to a certain card-swiping point , the electronic device, such as the smart flash card application of the electronic device, may establish a geographic fence corresponding to the first virtual card.

第一虚拟卡对应的地理围栏可以是GNSS地理围栏、Cell地理围栏或者Wi-Fi地理围栏中的至少一种。GNSS地理围栏可以包括GPS地理围栏、GLONASS地理围栏、北斗地理围栏、QZSS地理围栏或者SBAS地理围栏等。本申请中对GNSS地理围栏的具体类型并不进行限定。The geo-fence corresponding to the first virtual card may be at least one of a GNSS geo-fence, a Cell geo-fence, or a Wi-Fi geo-fence. The GNSS geo-fence may include GPS geo-fence, GLONASS geo-fence, Beidou geo-fence, QZSS geo-fence or SBAS geo-fence, etc. The specific type of the GNSS geo-fence is not limited in this application.

为了便于理解,本申请以下实施例中以GNSS地理围栏为GPS地理围栏(以下简称GPS 围栏)为例进行示意说明,即第一虚拟卡对应的地理围栏为GPS围栏。相应的,电子设备获取电子设备当前的地理位置信息可以为获取电子设备当前的GPS位置信息,该电子设备当前的GPS位置信息可以为本申请实施例中的第一GNSS位置信息。电子设备获取电子设备当前的地理位置精度可以为获取电子设备当前的GPS精度,该电子设备当前的GPS精度可以为本申请实施例中的第一GNSS精度。For ease of understanding, in the following embodiments of the present application, a GNSS geo-fence is taken as a GPS geo-fence (hereinafter referred to as the GPS geo-fence) as an example for schematic illustration, that is, the geo-fence corresponding to the first virtual card is a GPS fence. Correspondingly, obtaining the current geographic position information of the electronic device by the electronic device may be obtaining the current GPS position information of the electronic device, and the current GPS position information of the electronic device may be the first GNSS position information in the embodiment of the present application. Acquiring the current geographic position accuracy of the electronic device by the electronic device may be obtaining the current GPS accuracy of the electronic device, and the current GPS accuracy of the electronic device may be the first GNSS accuracy in this embodiment of the present application.

在电子设备采用第一虚拟卡与某个刷卡点对应的NFC读卡器完成数据交互时,电子设备,如电子设备的智闪卡应用可以获取电子设备当前的GPS位置信息及GPS精度,从而可以根据电子设备当前的GPS位置信息及GPS精度建立该第一虚拟卡对应的GPS围栏。When the electronic device uses the first virtual card to complete the data interaction with the NFC card reader corresponding to a certain card swiping point, the electronic device, such as the smart flash card application of the electronic device, can obtain the current GPS location information and GPS accuracy of the electronic device, so that A GPS fence corresponding to the first virtual card is established according to the current GPS location information and GPS accuracy of the electronic device.

其中,电子设备,如电子设备的智闪卡应用可以通过确定在某个刷卡点用户是否手动从多个第一虚拟卡中选择某个第一虚拟卡完成交易,来确定在该刷卡点是否是首次采用该第一虚拟卡完成交易。Among them, the electronic device, such as the smart flash card application of the electronic device, can determine whether the user at a certain card swiping point manually selects a certain first virtual card from a plurality of first virtual cards to complete the transaction. The first virtual card is used to complete the transaction for the first time.

可以理解的,电子设备可以包括多个第一虚拟卡,用户在某个刷卡点首次刷卡时,用户可以手动从多个第一虚拟卡中选择出需要使用的第一虚拟卡,从而电子设备可以利用该用户选择的第一虚拟卡完成交易。即当用户手动从多个第一虚拟卡中选择需要使用的第一虚拟卡完成交易时,电子设备,如电子设备的智闪卡应用可以确定在该刷卡点是首次采用该第一虚拟卡完成交易。例如,结合图2中的(c)所示,手机中的第一虚拟卡包括智能门锁卡、小区门禁卡以及公共交通卡。用户首次在某个公交车站乘坐公交车时,用户可以在小区门禁卡、公共交通卡以及智能门锁卡中手动选择使用公共交通卡来完成交易,即手机可以确定用户在该公交车站首次采用该公共交通卡完成交易。It can be understood that the electronic device may include multiple first virtual cards. When the user swipes the card for the first time at a certain card swiping point, the user can manually select the first virtual card to be used from the multiple first virtual cards, so that the electronic device can The transaction is completed using the first virtual card selected by the user. That is, when the user manually selects the first virtual card that needs to be used from multiple first virtual cards to complete the transaction, the electronic device, such as the smart flash card application of the electronic device, can determine that the first virtual card is used for the first time at the card swiping point to complete the transaction. trade. For example, as shown in (c) in FIG. 2 , the first virtual card in the mobile phone includes a smart door lock card, a community access control card, and a public transportation card. When a user takes a bus at a bus station for the first time, the user can manually choose to use the public transportation card to complete the transaction among the community access control card, public transportation card and smart door lock card, that is, the mobile phone can determine that the user is at the bus station for the first time. Use this public transport card to complete the transaction.

在用户使用电子设备在某个刷卡点首次采用某个第一虚拟卡完成交易,即该第一虚拟卡与NFC读卡器完成数据交互时,电子设备,如电子设备中的智闪卡应用可以获取电子设备当前的GPS位置信息,如经纬度坐标,以及GPS精度(accuracy,acc)。当用户持电子设备移动时,电子设备的GPS位置信息,即为用户的GPS位置信息。When a user uses an electronic device to complete a transaction with a first virtual card at a certain card swiping point for the first time, that is, when the first virtual card completes data interaction with the NFC card reader, the electronic device, such as the smart flash card application in the electronic device, can Acquire current GPS location information of the electronic device, such as latitude and longitude coordinates, and GPS accuracy (accuracy, acc). When the user moves with the electronic device, the GPS location information of the electronic device is the GPS location information of the user.

GPS精度,定义为68%置信度的半径。也就是说,该置信度是指电子设备刷卡时的真实位置,位于以电子设备获取电子设备当前的经纬度坐标为中心,以x倍GPS精度为半径的圆形区域中的概率,其中,x为大于零的实数。该概率满足下述公式一。GPS accuracy, defined as the radius with 68% confidence. In other words, the confidence level refers to the probability that the real position of the electronic device when swiping the card is located in a circular area centered on the current latitude and longitude coordinates of the electronic device obtained by the electronic device and with x times the GPS accuracy as the radius, where x is A real number greater than zero. This probability satisfies Formula 1 below.

公式一:

Figure BDA0003207551810000141
Formula one:
Figure BDA0003207551810000141

其中,erf为高斯误差函数,erf(x)为置信度,x为GPS精度的倍数,t为积分变量,可以被视为0~x之间任意实数,用于计算积分结果,并不具备任何实际含义。Among them, erf is the Gaussian error function, erf(x) is the confidence level, x is the multiple of GPS accuracy, and t is the integral variable, which can be regarded as any real number between 0 and x, and is used to calculate the integral result without any actual meaning.

当x=1时,erf(1)=0.68,即以电子设备获取的经纬度坐标为中心,以GPS精度为半径的圆形区域,电子设备刷卡时的真实位置位于该圆形区域中的概率为68%。When x=1, erf(1)=0.68, that is, a circular area with the longitude and latitude coordinates obtained by the electronic device as the center and the GPS accuracy as the radius, and the probability that the real position of the electronic device is located in the circular area when swiping the card is 68%.

例如,结合图4中的示例,在某个刷卡点,智闪卡应用确定是用户手动从多个第一虚拟卡中选择某个第一虚拟卡完成交易时,智闪卡应用可以通过系统服务中的应用(如GPS应用)、硬件连接层以及sensorhub,从短距离芯片中获取GPS位置信息以及GPS精度。具体的,上述S602可以包括下述S6021-S6028。For example, in combination with the example in Figure 4, at a certain card swiping point, when the smart card application determines that the user manually selects a first virtual card from multiple first virtual cards to complete the transaction, the smart card application can use the system service The application (such as GPS application), hardware connection layer and sensorhub in the application (such as GPS application), obtain GPS location information and GPS accuracy from the short-range chip. Specifically, the above S602 may include the following S6021-S6028.

S6021、智闪卡应用确定在某个刷卡点首次采用某个第一虚拟卡与NFC读卡器完成数据交互。S6021. The smart flash card application determines that a certain first virtual card is used to complete data interaction with the NFC card reader at a certain card swiping point for the first time.

S6022、智闪卡应用向GPS应用发送获取通知。S6022. The smart flash card application sends an acquisition notification to the GPS application.

获取通知用于指示GPS应用获取电子设备当前的GPS位置信息以及GPS精度。The acquisition notification is used to instruct the GPS application to acquire the current GPS location information and GPS accuracy of the electronic device.

S6023、GPS应用向传感集线器发送获取通知。S6023. The GPS application sends an acquisition notification to the sensor hub.

GPS应用收到获取通知之后,可通过硬件连接层向sensorhub发送获取通知。After the GPS application receives the acquisition notification, it can send the acquisition notification to the sensorhub through the hardware connection layer.

S6024、传感集线器向短距离芯片发送获取通知。S6024. The sensor hub sends an acquisition notification to the short-distance chip.

sensorhub收到获取通知之后,可以向短距离芯片发送获取通知。After sensorhub receives the acquisition notification, it can send the acquisition notification to the short-distance chip.

S6025、短距离芯片向传感集线器发送电子设备当前的GPS位置信息以及GPS精度。S6025. The short-distance chip sends the current GPS position information and GPS accuracy of the electronic device to the sensor hub.

短距离芯片收到获取通知之后,可以向sensorhub发送电子设备当前的GPS位置信息以及GPS精度。After the short-distance chip receives the acquisition notification, it can send the current GPS location information and GPS accuracy of the electronic device to the sensorhub.

S6026、传感集线器向GPS应用发送电子设备当前的GPS位置信息以及GPS精度。S6026. The sensor hub sends the current GPS location information and GPS accuracy of the electronic device to the GPS application.

sensorhub收到电子设备当前的GPS位置信息以及GPS精度之后,可以通过硬件连接层向GPS应用发送电子设备当前的GPS位置信息以及GPS精度。After sensorhub receives the current GPS location information and GPS accuracy of the electronic device, it can send the current GPS location information and GPS accuracy of the electronic device to the GPS application through the hardware connection layer.

S6027、GPS应用向智闪卡应用发送电子设备当前的GPS位置信息以及GPS精度。S6027. The GPS application sends the current GPS location information and GPS accuracy of the electronic device to the smart flash card application.

S6028、智闪卡应用接收电子设备当前的GPS位置信息以及GPS精度。S6028. The smart flash card application receives current GPS location information and GPS accuracy of the electronic device.

S603、电子设备的智闪卡应用根据电子设备当前的地理位置信息以及地理位置精度,建立第一虚拟卡对应的第一地理围栏。S603. The smart flash card application of the electronic device establishes a first geo-fence corresponding to the first virtual card according to the current geographic location information and geographic location accuracy of the electronic device.

如前述实施例的描述,第一虚拟卡对应的第一地理围栏可以是GNSS地理围栏,也可以为Cell地理围栏,还可以为Wi-Fi地理围栏,还可以为其他类型的地理围栏,本申请实施例对此并不进行限定。GNSS地理围栏可以为GPS地理围栏、GLONASS地理围栏、北斗地理围栏、QZSS地理围栏或者SBAS地理围栏等。本申请中对GNSS地理围栏的具体类型并不进行限定。As described in the foregoing embodiment, the first geo-fence corresponding to the first virtual card may be a GNSS geo-fence, a Cell geo-fence, a Wi-Fi geo-fence, or other types of geo-fences. This application The embodiment does not limit this. The GNSS geo-fence can be GPS geo-fence, GLONASS geo-fence, Beidou geo-fence, QZSS geo-fence or SBAS geo-fence. The specific type of the GNSS geo-fence is not limited in this application.

为了便于理解,本申请中以第一虚拟卡对应的第一地理围栏为GPS围栏(即第一GPS 围栏)为例进行示意说明。相应的,在地理围栏为GPS围栏时,地理位置信息可以为GPS位置信息,地理位置精度可以为GPS精度。For ease of understanding, in this application, the first geographical fence corresponding to the first virtual card is a GPS fence (that is, the first GPS fence) as an example for schematic illustration. Correspondingly, when the geographic fence is a GPS fence, the geographic location information may be GPS location information, and the geographic location accuracy may be GPS accuracy.

第一虚拟卡对应的第一GPS围栏可以为以获取的GPS位置信息为中心,以预设长度为半径的圆形区域。例如,结合图4所示,在电子设备,如电子设备的智闪卡应用获取到GPS位置信息以及GPS精度之后,智闪卡应用可以建立以GPS位置信息为中心,以对应长度为半径的第一GPS围栏,该第一GPS围栏与第一虚拟卡对应。The first GPS fence corresponding to the first virtual card may be a circular area with the acquired GPS location information as the center and a preset length as the radius. For example, as shown in Figure 4, after the electronic device, such as the smart flash card application of the electronic device, obtains the GPS location information and GPS accuracy, the smart flash card application can establish the first GPS location information as the center and the corresponding length as the radius. A GPS fence, the first GPS fence corresponds to the first virtual card.

可以理解的,在GPS围栏的半径过大时,不同GPS围栏容易存在重叠的区域。而在用户持电子设备进入该重叠区域内时,电子设备并不能确定将哪个GPS围栏对应的虚拟卡激活。在GPS围栏的半径过小时,用户刷卡时的真实位置可能位于GPS围栏之外,导致在用户刷卡前,电子设备也不能自动选到正确的虚拟卡并激活。It can be understood that when the radius of the GPS fence is too large, overlapping areas tend to exist among different GPS fences. However, when the user enters the overlapping area with the electronic device, the electronic device cannot determine which virtual card corresponding to the GPS fence will be activated. When the radius of the GPS fence is too small, the real location of the user when swiping the card may be outside the GPS fence, so that the electronic device cannot automatically select the correct virtual card and activate it before the user swipes the card.

因此,在本申请实施例中,电子设备,如电子设备的智闪卡应用可以根据GPS位置信息以及GPS精度,动态确定建立的第一虚拟卡对应的GPS围栏的大小(即动态确定第一虚拟卡对应的GPS围栏的半径),从而使得建立的第一虚拟卡对应的GPS围栏与其他GPS 围栏之间均不存在重叠区域。具体的,如图7所示,上述S603可以包括下述S701-S710。Therefore, in the embodiment of the present application, the electronic device, such as the smart flash card application of the electronic device, can dynamically determine the size of the GPS fence corresponding to the established first virtual card according to the GPS position information and GPS accuracy (that is, dynamically determine the size of the first virtual The radius of the GPS fence corresponding to the card), so that there is no overlapping area between the established GPS fence corresponding to the first virtual card and other GPS fences. Specifically, as shown in FIG. 7, the above S603 may include the following S701-S710.

S701、电子设备的智闪卡应用根据电子设备当前的地理位置信息以及预设长度,建立第一虚拟卡对应的初始地理围栏。S701. The smart flash card application of the electronic device establishes an initial geo-fence corresponding to the first virtual card according to the current geographic location information of the electronic device and a preset length.

如前述实施例的描述,第一虚拟卡对应的初始地理围栏可以是GNSS地理围栏,也可以为Cell地理围栏,还可以为Wi-Fi地理围栏,还可以为其他类型的地理围栏,本申请实施例对此并不进行限定。GNSS地理围栏可以为GPS地理围栏、GLONASS地理围栏、北斗地理围栏、QZSS地理围栏或者SBAS地理围栏等。本申请中对GNSS地理围栏的具体类型并不进行限定。As described in the foregoing embodiment, the initial geo-fence corresponding to the first virtual card may be a GNSS geo-fence, a Cell geo-fence, a Wi-Fi geo-fence, or other types of geo-fences. The example does not limit this. The GNSS geo-fence can be GPS geo-fence, GLONASS geo-fence, Beidou geo-fence, QZSS geo-fence or SBAS geo-fence. The specific type of the GNSS geo-fence is not limited in this application.

为了便于理解,本申请以下实施例中以第一虚拟卡对应的初始地理围栏为GPS围栏(如称为初始GPS围栏)为例进行示意说明。For ease of understanding, in the following embodiments of the present application, the initial geographic fence corresponding to the first virtual card is taken as an example for schematic illustration.

由于电子设备建立的GPS围栏的半径越大,用户使用第一虚拟卡进行交易时的真实位置,位于该GPS围栏范围内的概率越高,能够避免偶发的GPS定位漂移导致电子设备使用第一虚拟卡进行交易时的真实位置位于建立的GPS围栏范围外,从而可以保证在用户刷卡前,电子设备能够自动激活对应虚拟卡。Since the radius of the GPS fence established by the electronic device is larger, the real position of the user when using the first virtual card for transactions is more likely to be within the range of the GPS fence, which can avoid the occasional GPS positioning drift that causes the electronic device to use the first virtual card. The real location of the card for transaction is outside the established GPS fence range, so as to ensure that the electronic device can automatically activate the corresponding virtual card before the user swipes the card.

因此,电子设备,如电子设备的智闪卡应用在建立第一虚拟卡对应的GPS围栏时,可以先以较大的半径建立第一虚拟卡对应的初始GPS围栏。Therefore, when the electronic device, such as the smart flash card application of the electronic device, establishes the GPS fence corresponding to the first virtual card, it can first establish the initial GPS fence corresponding to the first virtual card with a larger radius.

第一虚拟卡对应的初始GPS围栏的半径可以为预设长度。预设长度的大小可以根据实际情况设定,本申请实施例对此并不进行限定。例如,预设长度可以为2千米。即第一虚拟卡对应的初始GPS围栏为以电子设备获取的当前的GPS位置信息为中心,以2千米为半径的圆形区域。The radius of the initial GPS fence corresponding to the first virtual card may be a preset length. The size of the preset length can be set according to actual conditions, which is not limited in this embodiment of the present application. For example, the preset length may be 2 kilometers. That is, the initial GPS fence corresponding to the first virtual card is a circular area centered on the current GPS location information acquired by the electronic device and with a radius of 2 kilometers.

S702、电子设备的智闪卡应用确定初始地理围栏是否与第二地理围栏存在重叠区域。S702. The smart flash card application of the electronic device determines whether there is an overlapping area between the initial geo-fence and the second geo-fence.

电子设备在建立第一虚拟卡对应的初始地理围栏,如初始GPS围栏之后,电子设备,如电子设备的智闪卡应用可以确定该初始GPS围栏与电子设备中已建立并存储的地理围栏是否存在重叠区域。After the electronic device establishes the initial geographic fence corresponding to the first virtual card, such as the initial GPS fence, the electronic device, such as the smart flash card application of the electronic device, can determine whether the initial GPS fence and the geographic fence that has been established and stored in the electronic device exist overlapping area.

电子设备中已建立并存储的地理围栏(如称为第二地理围栏)可以是GNSS地理围栏,也可以为Cell地理围栏,还可以为Wi-Fi地理围栏,还可以为其他类型的地理围栏,本申请实施例对此并不进行限定。GNSS地理围栏可以为GPS地理围栏、GLONASS地理围栏、北斗地理围栏、QZSS地理围栏或者SBAS地理围栏等。本申请中对GNSS地理围栏的具体类型并不进行限定。The geofence established and stored in the electronic device (such as the second geofence) can be a GNSS geofence, a Cell geofence, a Wi-Fi geofence, or other types of geofences. This embodiment of the present application does not limit it. The GNSS geo-fence can be GPS geo-fence, GLONASS geo-fence, Beidou geo-fence, QZSS geo-fence or SBAS geo-fence. The specific type of the GNSS geo-fence is not limited in this application.

为了便于理解,本申请以下实施例中以电子设备中已建立并存储的地理围栏为GNSS 围栏为例进行示意说明,该已建立并存储GNSS围栏可以为本申请实施例中的第二GNSS 围栏,第二GNSS围栏中与初始GNSS围栏存在重叠区域的围栏可以为本申请实施例中的第三GNSS围栏。第三GNSS围栏可以为一个,也可以为多个。为了便于理解,本申请以下实施例中以电子设备中已建立并存储的地理围栏为GPS围栏(如称为第二GPS围栏)为例进行示意说明,相应的与初始GPS围栏存在重叠区域的第二GPS围栏可以为GPS围栏 (如称为第三GPS围栏)。In order to facilitate understanding, in the following embodiments of the present application, the geographical fence established and stored in the electronic device is taken as a GNSS fence as an example for schematic illustration. The established and stored GNSS fence can be the second GNSS fence in the embodiment of the present application. The fence in the second GNSS fence that overlaps with the initial GNSS fence may be the third GNSS fence in the embodiment of the present application. There can be one or more third GNSS fences. For ease of understanding, in the following embodiments of the present application, the geographical fence that has been established and stored in the electronic device is a GPS fence (for example, called the second GPS fence) as an example for schematic illustration. The second GPS fence can be a GPS fence (such as called a third GPS fence).

第二GPS围栏可以为以电子设备在第二GPS围栏对应的刷卡点完成交易时,电子设备获取的GPS位置信息为中心,以对应的长度为半径的圆形区域。该对应的长度可以为上述的预设长度,例如2千米,也可以为其他长度,例如根据获取到的GPS位置信息、GPS精度以及其他GPS围栏的GPS位置信息和GPS精度,动态确定的长度。The second GPS fence can be a circular area centered on the GPS location information obtained by the electronic device when the electronic device completes the transaction at the card swiping point corresponding to the second GPS fence, and taking the corresponding length as the radius. The corresponding length can be the above-mentioned preset length, such as 2 kilometers, or other lengths, such as a dynamically determined length based on the acquired GPS location information, GPS accuracy, and the GPS location information and GPS accuracy of other GPS fences .

电子设备,如电子设备的智闪卡应用可以根据初始GPS围栏的中心(即电子设备建立初始GPS围栏时使用的GPS位置信息,也即电子设备获取的当前GPS位置信息)、初始 GPS围栏的半径(即上述的预设长度)、第二GPS围栏的中心(即电子设备建立第二GPS 围栏时使用的GPS位置信息)以及第二GPS围栏的半径,确定初始GPS围栏与第二GPS 围栏是否存在重叠区域。Electronic devices, such as smart flash card applications for electronic devices, can be based on the center of the initial GPS fence (that is, the GPS location information used by the electronic device to establish the initial GPS fence, that is, the current GPS location information obtained by the electronic device), the radius of the initial GPS fence (i.e. the above-mentioned preset length), the center of the second GPS fence (that is, the GPS position information used by the electronic device to establish the second GPS fence) and the radius of the second GPS fence to determine whether the initial GPS fence and the second GPS fence exist overlapping area.

在一些实施例中,电子设备,如电子设备的智闪卡应用可以确定初始GPS围栏的中心与第二GPS围栏的中心之间的距离,是否大于初始GPS围栏的半径与第二GPS围栏的半径之和,从而确定初始GPS围栏与第二GPS围栏之间存在不重叠区域。在电子设备确定初始GPS围栏的中心与第二GPS围栏的中心之间的距离,小于或等于初始GPS围栏的半径与第二GPS围栏的半径之和的情况下,电子设备的智闪卡应用可以确定初始GPS围栏与第二GPS围栏之间存在重叠区域。在电子设备确定初始GPS围栏的中心与第二GPS围栏的中心之间的距离,大于初始GPS围栏的半径与第二GPS围栏的半径之和的情况下,电子设备的智闪卡应用确定初始GPS围栏与第二GPS围栏之间存在不重叠区域。In some embodiments, the electronic device, such as the smart flash card application of the electronic device, can determine whether the distance between the center of the initial GPS fence and the center of the second GPS fence is greater than the radius of the initial GPS fence and the radius of the second GPS fence , so as to determine that there is a non-overlapping area between the initial GPS fence and the second GPS fence. When the electronic device determines that the distance between the center of the initial GPS fence and the center of the second GPS fence is less than or equal to the sum of the radius of the initial GPS fence and the radius of the second GPS fence, the smart flash card application of the electronic device can It is determined that an overlapping area exists between the initial GPS fence and the second GPS fence. When the electronic device determines that the distance between the center of the initial GPS fence and the center of the second GPS fence is greater than the sum of the radius of the initial GPS fence and the radius of the second GPS fence, the smart flash card application of the electronic device determines the initial GPS There is a non-overlapping area between the fence and the second GPS fence.

例如,以初始GPS围栏的半径为2千米,第二GPS围栏的半径为2千米为例。电子设备的智闪卡应用可以确定初始GPS围栏的中心与第二GPS围栏的中心之间的距离。如,电子设备的智闪卡应用确定出初始GPS围栏的中心与第二GPS围栏的中心之间的距离为5千米,5千米大于4千米,即初始GPS围栏的中心与第二GPS围栏的中心之间的距离,大于初始GPS围栏的半径与第二GPS围栏的半径之和,则电子设备的智闪卡应用可以确定初始 GPS围栏与第二GPS围栏之间不存在重叠区域。又如,电子设备的智闪卡应用确定出初始 GPS围栏的中心与第二GPS围栏的中心之间的距离为3千米时,3千米小于4千米,即初始GPS围栏的中心与第二GPS围栏的中心之间的距离,小于初始GPS围栏的半径与第二 GPS围栏的半径之和,则电子设备的智闪卡应用可以确定初始GPS围栏与第二GPS围栏之间存在重叠区域。For example, it is assumed that the radius of the initial GPS fence is 2 kilometers, and the radius of the second GPS fence is 2 kilometers. The smart card application of the electronic device can determine the distance between the center of the initial GPS fence and the center of the second GPS fence. For example, the smart card application of the electronic device determines that the distance between the center of the initial GPS fence and the center of the second GPS fence is 5 kilometers, and 5 kilometers is greater than 4 kilometers, that is, the distance between the center of the initial GPS fence and the center of the second GPS fence is 5 kilometers. If the distance between the centers of the fences is greater than the sum of the radius of the initial GPS fence and the radius of the second GPS fence, the smart flash card application of the electronic device can determine that there is no overlapping area between the initial GPS fence and the second GPS fence. As another example, when the smart flash card application of the electronic device determines that the distance between the center of the initial GPS fence and the center of the second GPS fence is 3 kilometers, 3 kilometers is less than 4 kilometers, that is, the center of the initial GPS fence and the center of the second GPS fence If the distance between the centers of the two GPS fences is less than the sum of the radius of the initial GPS fence and the radius of the second GPS fence, the smart flash card application of the electronic device can determine that there is an overlapping area between the initial GPS fence and the second GPS fence.

在一些实施例中,在电子设备中可以包括多个第二GPS围栏,电子设备,如电子设备的智闪卡应用可以通过上述方式,确定初始GPS围栏是否与每一个第二GPS围栏存在重叠区域。In some embodiments, multiple second GPS fences may be included in the electronic device, and the electronic device, such as the smart flash card application of the electronic device, may determine whether there is an overlapping area between the initial GPS fence and each second GPS fence in the above manner .

在电子设备确定初始GPS围栏与上述多个第二GPS围栏均不存在重叠区域的情况下,电子设备可以执行下述S703。When the electronic device determines that there is no overlapping area between the initial GPS fence and the plurality of second GPS fences, the electronic device may execute the following S703.

在电子设备确定初始GPS围栏与上述多个第二GPS围栏中的一个或多个第二GPS围栏存在重叠区域的情况下,电子设备可以根据初始GPS围栏对应的GPS精度(即电子设备获取的当前的GPS精度)以及第二GPS围栏对应的GPS精度(即建立第二GPS围栏时电子设备获取到的GPS精度),动态确定第一虚拟卡对应的第一GPS围栏的半径,从而使得建立的第一虚拟卡对应的第一GPS围栏与第二GPS围栏之间均不存在重叠区域。为了便于描述,本申请中将多个第二GPS围栏中与初始GPS围栏存在重叠区域的第二GPS围栏称为第三GPS围栏。第三GPS围栏可以为一个,也可以为多个。具体的,电子设备可以执行下述S704-S710。When the electronic device determines that there is an overlapping area between the initial GPS fence and one or more second GPS fences among the above-mentioned plurality of second GPS fences, the electronic device may, according to the GPS accuracy corresponding to the initial GPS fence (that is, the current GPS accuracy) and the GPS accuracy corresponding to the second GPS fence (that is, the GPS accuracy obtained by the electronic device when the second GPS fence is established), dynamically determine the radius of the first GPS fence corresponding to the first virtual card, so that the established first There is no overlapping area between the first GPS fence and the second GPS fence corresponding to a virtual card. For ease of description, the second GPS fence that overlaps with the initial GPS fence among the plurality of second GPS fences is referred to as the third GPS fence in this application. There can be one or more third GPS fences. Specifically, the electronic device may execute the following S704-S710.

S703、电子设备的智闪卡应用将该初始地理围栏作为第一地理围栏。S703. The smart flash card application of the electronic device uses the initial geo-fence as the first geo-fence.

本申请实施例中以第一虚拟卡对应的初始地理围栏为GPS围栏为例进行示意说明。可以理解的,在初始地理围栏为GPS围栏时,第一地理围栏为GPS围栏,即第一GPS围栏。In the embodiment of the present application, the initial geographical fence corresponding to the first virtual card is a GPS fence as an example for schematic illustration. It can be understood that when the initial geographic fence is a GPS fence, the first geographic fence is a GPS fence, that is, the first GPS fence.

在电子设备确定初始GPS围栏与第二GPS围栏不存在重叠区域的情况下,电子设备,如电子设备的智闪卡应用可以将初始GPS围栏作为第一虚拟卡对应的第一GPS围栏,即电子设备将预设长度作为第一GPS围栏的半径。也就是说,第一GPS围栏是以电子设备获取到的电子设备当前的GPS位置信息为中心,以预设长度(如2千米)为半径的圆形区域。When the electronic device determines that there is no overlapping area between the initial GPS fence and the second GPS fence, the electronic device, such as the smart flash card application of the electronic device, can use the initial GPS fence as the first GPS fence corresponding to the first virtual card, that is, the electronic The device uses the preset length as the radius of the first GPS fence. That is to say, the first GPS fence is a circular area centered on the current GPS location information of the electronic device acquired by the electronic device and with a preset length (such as 2 kilometers) as the radius.

例如,结合图8中的(a)所示,以初始地理围栏为初始GPS围栏01,初始GPS围栏 01的半径为2千米为例。在电子设备确定初始GPS围栏01与电子设备中已建立的第二GPS 围栏均不存在重叠区域的情况下,电子设备可以电子设备当前的GPS位置信息为中心,以 2千米为半径建立第一虚拟卡对应的第一GPS围栏。For example, as shown in (a) in FIG. 8 , take the initial GPS fence 01 as an example, and the radius of the initial GPS fence 01 is 2 kilometers as an example. When the electronic device determines that there is no overlapping area between the initial GPS fence 01 and the second GPS fence already established in the electronic device, the electronic device can establish the first GPS fence with a radius of 2 kilometers around the current GPS location information of the electronic device. The virtual card corresponds to the first GPS fence.

S704、电子设备的智闪卡应用确定与初始地理围栏存在重叠区域的第三地理围栏是否为一个。S704. The smart flash card application of the electronic device determines whether there is one third geo-fence that overlaps with the initial geo-fence.

第三地理围栏可以为电子设备中已建立并存储的第二地理围栏中的一个或多个地理围栏。第三地理围栏可以是GNSS地理围栏,也可以为Cell地理围栏,还可以为Wi-Fi地理围栏,还可以为其他类型的地理围栏,本申请实施例对此并不进行限定。GNSS地理围栏可以为GPS地理围栏、GLONASS地理围栏、北斗地理围栏、QZSS地理围栏或者SBAS地理围栏等。本申请中对GNSS地理围栏的具体类型并不进行限定。The third geo-fence may be one or more geo-fences in the second geo-fence established and stored in the electronic device. The third geo-fence may be a GNSS geo-fence, may also be a Cell geo-fence, may also be a Wi-Fi geo-fence, or may be another type of geo-fence, which is not limited in this embodiment of the present application. The GNSS geo-fence can be GPS geo-fence, GLONASS geo-fence, Beidou geo-fence, QZSS geo-fence or SBAS geo-fence. The specific type of the GNSS geo-fence is not limited in this application.

为了便于理解,本申请实施例中以第一虚拟卡对应的初始地理围栏为GPS围栏、第三地理围栏为GPS围栏(即第三GPS围栏)为例进行示意说明。For ease of understanding, in the embodiment of the present application, the initial geographic fence corresponding to the first virtual card is a GPS fence, and the third geographic fence is a GPS fence (ie, the third GPS fence) as an example for schematic illustration.

由于电子设备中的第二GPS围栏可以为一个,也可以为多个。因此,电子设备,如电子设备的智闪卡应用确定出的与初始GPS围栏存在重叠区域的第二GPS围栏(即第三GPS 围栏)可以是一个,也可以多个。Because the second GPS fence in the electronic device can be one or multiple. Therefore, the electronic device, such as the smart flash card application of the electronic device, may have one or more second GPS fences (that is, third GPS fences) that overlap with the initial GPS fence.

在电子设备确定第三GPS围栏为一个的情况下,电子设备可以执行下述S705-S707。在电子设备确定第三GPS围栏为多个的情况下,电子设备可以执行下述S708-S710。In a case where the electronic device determines that the third GPS fence is one, the electronic device may execute the following S705-S707. In a case where the electronic device determines that there are multiple third GPS fences, the electronic device may execute the following S708-S710.

S705、电子设备的智闪卡应用获取该第三地理围栏的中心以及对应的地理位置精度。S705. The smart flash card application of the electronic device acquires the center of the third geo-fence and the corresponding geographic location accuracy.

本申请实施例中以第三地理围栏为GPS围栏(即第三GPS围栏)为例进行示意说明。相应的,第三地理围栏的中心可以为建立第三地理围栏时使用的GPS位置信息,该建立第三地理围栏时使用的GPS位置信息可以为本申请的第二GNSS位置信息(如第二GPS位置信息),第三地理围栏的地理位置精度可以为GPS精度,该建立第三地理围栏时使用的GPS 精度可以为本申请的第二GNSS精度(如第二GPS精度)。In the embodiment of the present application, the third geographical fence is a GPS fence (that is, the third GPS fence) as an example for schematic illustration. Correspondingly, the center of the third geo-fence can be the GPS position information used when setting up the third geo-fence, and the GPS position information used when the third geo-fence is established can be the second GNSS position information of the present application (such as the second GPS location information), the location accuracy of the third geo-fence may be GPS accuracy, and the GPS accuracy used when establishing the third geo-fence may be the second GNSS accuracy (such as the second GPS accuracy) of this application.

电子设备,如电子设备的智闪卡应用可以从电子设备的存储器中获取第三GPS围栏的中心以及对应的GPS精度。The electronic device, such as the smart flash card application of the electronic device, can acquire the center of the third GPS fence and the corresponding GPS accuracy from the memory of the electronic device.

第三GPS围栏对应的GPS精度可以为电子设备建立该第三GPS围栏时,电子设备获取的GPS精度。第三GPS围栏对应的GPS精度,也可以为电子设备根据采用第三GPS围栏对应的虚拟卡进行交易时获取的GPS精度,更新后的GPS精度。The GPS accuracy corresponding to the third GPS fence may be the GPS accuracy obtained by the electronic device when the electronic device establishes the third GPS fence. The GPS accuracy corresponding to the third GPS fence may also be the updated GPS accuracy acquired by the electronic device when using the virtual card corresponding to the third GPS fence for transactions.

S706、电子设备的智闪卡应用根据初始地理围栏的中心、初始地理围栏对应的地理位置精度、该第三地理围栏的中心以及该第三地理围栏对应的地理位置精度,确定初始地理围栏退让后的半径。S706. The smart flash card application of the electronic device determines after the initial geo-fence is withdrawn according to the center of the initial geo-fence, the location accuracy corresponding to the initial geo-fence, the center of the third geo-fence, and the location accuracy corresponding to the third geo-fence of the radius.

本申请实施例中以第一虚拟卡对应的初始地理围栏为GPS围栏、第三地理围栏为GPS 围栏为例进行示意说明。相应的,初始地理围栏的中心可以为电子设备获取的当前GPS位置精度,第三地理围栏的中心可以为建立第三地理围栏时使用的GPS位置信息,第三地理围栏的精度可以为GPS精度。In the embodiment of the present application, the initial geographic fence corresponding to the first virtual card is a GPS fence, and the third geographic fence is a GPS fence as an example for schematic illustration. Correspondingly, the center of the initial geo-fence may be the current GPS location accuracy obtained by the electronic device, the center of the third geo-fence may be the GPS location information used when establishing the third geo-fence, and the accuracy of the third geo-fence may be GPS accuracy.

当初始GPS围栏与第三GPS围栏存在重叠区域时,为了使两个GPS围栏不存在重叠区域,需要将该两个GPS围栏互相退让,即将该两个GPS围栏的半径相应的缩小。When there is an overlapping area between the initial GPS fence and the third GPS fence, in order to prevent the two GPS fences from overlapping, the two GPS fences need to retreat to each other, that is, the radii of the two GPS fences should be reduced accordingly.

由于GPS精度较高时,电子设备可以建立较小的GPS围栏,就能保证用户使用第一虚拟卡进行交易时的实际位置在建立的GPS围栏之内。GPS精度较低时,则电子设备需要建立较大的GPS围栏,才能使得用户使用第一虚拟卡进行交易时的实际位置在建立的GPS围栏之内。因此,对于GPS精度较高的GPS围栏,其半径可以缩小的较多,对于GPS精度较低的GPS围栏,其半径可以缩小的较多。When the GPS accuracy is high, the electronic device can build a smaller GPS fence, which can ensure that the actual location of the user when using the first virtual card for transactions is within the established GPS fence. When the GPS accuracy is low, the electronic device needs to build a larger GPS fence, so that the actual location of the user when using the first virtual card to conduct transactions is within the established GPS fence. Therefore, the radius of the GPS fence with higher GPS accuracy can be reduced more, and the radius of the GPS fence with lower GPS accuracy can be reduced more.

具体的,电子设备可以按如下过程计算初始GPS围栏退让后的半径以及第三GPS围栏退让后的半径。Specifically, the electronic device may calculate the radius of the initial GPS fence after retreat and the radius of the third GPS fence after retreat according to the following process.

首先,为了避免初始GPS围栏与第三GPS围栏之间存在重叠区域,该两个GPS围栏的中心之间的距离,应大于初始GPS围栏退让后的半径(该初始GPS围栏退让后的半径可以为本申请实施例中的第一半径)与第三GPS围栏的退让后的半径(该第三GPS围栏的退让后的半径可以为本申请实施例中的第二半径)之和。例如,初始GPS围栏退让后的半径与第三GPS围栏的退让后的半径可以满足下述公式二。First, in order to avoid overlapping areas between the initial GPS fence and the third GPS fence, the distance between the centers of the two GPS fences should be greater than the radius of the initial GPS fence retreat (the radius of the initial GPS fence retreat can be The sum of the first radius in the embodiment of the present application) and the radius after retreat of the third GPS fence (the radius after retreat of the third GPS fence may be the second radius in the embodiment of the present application). For example, the retreated radius of the initial GPS fence and the retreated radius of the third GPS fence may satisfy the following formula two.

公式二:l=lx+ly+d;Formula 2: l=l x +l y +d;

其中,l为初始GPS围栏的中心与第三GPS围栏的中心之间的距离,lx为初始GPS围栏退让后的半径,ly为第三GPS围栏退让后的半径,d为初始GPS围栏与第三GPS围栏边界之间的缓冲宽度。Among them, l is the distance between the center of the initial GPS fence and the center of the third GPS fence, l x is the radius of the initial GPS fence retreat, ly is the radius of the third GPS fence retreat, d is the distance between the initial GPS fence and Buffer width between third GPS fence boundaries.

缓冲宽度d的大小可以根据实际情况设定,且缓冲宽度d的大小不随初始GPS围栏的中心与第二GPS围栏的中心之间的距离的大小而改变。例如,缓冲宽度d可以为20米。The size of the buffer width d can be set according to the actual situation, and the size of the buffer width d does not change with the size of the distance between the center of the initial GPS fence and the center of the second GPS fence. For example, the buffer width d may be 20 meters.

同时,对于以初始GPS围栏退让后的半径建立的GPS围栏,以及以第三GPS围栏的退让后的半径建立的GPS围栏,用户使用初始GPS围栏对应的第一虚拟卡进行交易时,用户的真实位置位于以初始GPS围栏退让后的半径建立的GPS围栏中的概率,与用户使用第三GPS围栏对应的虚拟卡进行交易时,用户的真实位置位于以第三GPS围栏的退让后的半径建立的中的概率相等。例如,用户的真实位置位于以初始GPS围栏退让后的半径建立的 GPS围栏中的概率,与用户的真实位置位于以第三GPS围栏的退让后的半径建立的GPS围栏中的概率可以满足下述公式三。At the same time, for the GPS fence established with the radius of the initial GPS fence retreat, and the GPS fence established with the radius of the third GPS fence retreat, when the user uses the first virtual card corresponding to the initial GPS fence to conduct transactions, the user's real The probability that the location is located in the GPS fence established with the radius after the initial GPS fence retreat, and when the user uses the virtual card corresponding to the third GPS fence to conduct transactions, the user's real location is located in the radius established with the retreat of the third GPS fence The probabilities in are equal. For example, the probability that the user's real location is located in the GPS fence established with the radius of the initial GPS fence retreat, and the probability that the user's real location is located in the GPS fence established with the radius of the third GPS fence retreat can satisfy the following Formula three.

公式三:

Figure BDA0003207551810000191
Formula three:
Figure BDA0003207551810000191

其中,

Figure BDA0003207551810000192
为用户的真实位置位于以初始GPS围栏退让后的半径建立的GPS围栏中的概率,
Figure BDA0003207551810000193
为用户的真实位置位于以第三GPS围栏的退让后的半径建立的GPS围栏中的概率,lx为初始GPS围栏退让后的半径,ly为第三GPS围栏退让后的半径,cx为初始 GPS围栏对应的GPS精度,cy为第三GPS围栏对应的GPS精度。in,
Figure BDA0003207551810000192
is the probability that the user's real location is located in the GPS fence established with the radius after the initial GPS fence retreat,
Figure BDA0003207551810000193
is the probability that the user's real location is located in the GPS fence established by the radius of the third GPS fence, l x is the radius of the initial GPS fence after retreat, ly is the radius of the third GPS fence after retreat, c x is GPS accuracy corresponding to the initial GPS fence, cy is the GPS accuracy corresponding to the third GPS fence.

结合公式二以及公式三,可以计算得到初始GPS围栏退让后的半径lx,同时还可以计算得到第三GPS围栏退让后的半径ly。例如,初始GPS围栏退让后的半径lx可以满足下述公式四,第三GPS围栏退让后的半径ly可以满足下述公式五。Combining Formula 2 and Formula 3, the radius l x of the initial GPS fence retreat can be calculated, and the radius ly of the third GPS fence retreat can also be calculated. For example, the radius l x of the initial GPS fence retreat may satisfy the following formula 4, and the radius ly of the third GPS fence retreat may satisfy the following formula 5.

公式四:

Figure BDA0003207551810000194
Formula four:
Figure BDA0003207551810000194

其中,lx为初始GPS围栏退让后的半径,cx为初始GPS围栏对应的GPS精度,cy为第三GPS围栏对应的GPS精度,l为初始GPS围栏的中心与第三GPS围栏的中心之间的距离,d为初始GPS围栏与第三GPS围栏边界之间的缓冲宽度。Among them, l x is the radius after the initial GPS fence retreat, c x is the GPS accuracy corresponding to the initial GPS fence, cy is the GPS accuracy corresponding to the third GPS fence, l is the center of the initial GPS fence and the center of the third GPS fence The distance between, d is the buffer width between the initial GPS fence and the border of the third GPS fence.

公式五:

Figure BDA0003207551810000195
Formula five:
Figure BDA0003207551810000195

其中,lx为初始GPS围栏退让后的半径,cx为初始GPS围栏对应的GPS精度,cy为第三GPS围栏对应的GPS精度,l为初始GPS围栏的中心与第三GPS围栏的中心之间的距离,d为初始GPS围栏与第三GPS围栏边界之间的缓冲宽度。Among them, l x is the radius after the initial GPS fence retreat, c x is the GPS accuracy corresponding to the initial GPS fence, cy is the GPS accuracy corresponding to the third GPS fence, l is the center of the initial GPS fence and the center of the third GPS fence The distance between, d is the buffer width between the initial GPS fence and the border of the third GPS fence.

例如,结合图8中的(b)所示,以初始地理围栏为初始GPS围栏,初始GPS围栏01 的半径为2千米,与初始GPS围栏01在重叠区域的第三GPS围栏为一个为例,即第三GPS 围栏02为一个。电子设备的智闪卡应用根据初始GPS围栏01的中心、初始GPS围栏01 对应的GPS精度、第三GPS围栏02的中心以及第三GPS围栏02对应的精度,确定出初始GPS围栏01退让后的半径为600米,第三GPS围栏02的半径为200米。For example, shown in (b) in conjunction with Fig. 8, take initial geographic fence as initial GPS fence, the radius of initial GPS fence 01 is 2 kilometers, and the 3rd GPS fence in overlapping area with initial GPS fence 01 is an example , that is, the third GPS fence 02 is one. According to the center of the initial GPS fence 01, the GPS accuracy corresponding to the initial GPS fence 01, the center of the third GPS fence 02, and the accuracy corresponding to the third GPS fence 02, the smart flash card application of the electronic device determines the initial GPS fence 01. The radius is 600 meters and the third GPS fence 02 has a radius of 200 meters.

在一些实施例中,上述第一半径可以小于上述公式四得到的lx,上述第二半径可以小于上述公式五得到的lyIn some embodiments, the above-mentioned first radius may be smaller than l x obtained by the above-mentioned formula 4, and the above-mentioned second radius may be smaller than ly obtained by the above-mentioned formula 5.

S707、电子设备的智闪卡应用根据初始地理围栏的中心以及初始地理围栏退让后的半径,建立第一虚拟卡对应的第一地理围栏。S707. The smart flash card application of the electronic device establishes a first geo-fence corresponding to the first virtual card according to the center of the initial geo-fence and the radius after the initial geo-fence retreat.

本申请实施例中以初始地理围栏为GPS围栏为例进行示意说明。相应的,第一地理围栏可以为GPS围栏(即第一GPS围栏)。In the embodiment of the present application, the initial geographical fence is a GPS fence as an example for schematic illustration. Correspondingly, the first geographic fence may be a GPS fence (that is, the first GPS fence).

第一虚拟卡对应的第一GPS围栏,可以为以初始地理围栏的中心(即电子设备当前的 GPS位置信息)为中心,以初始GPS围栏退让后的半径为半径的圆形区域。The first GPS fence corresponding to the first virtual card may be a circular area centered on the center of the initial geographic fence (that is, the current GPS location information of the electronic device) and the radius after the initial GPS fence retreats.

在一些示例中,在电子设备,电子设备的智闪卡应用可以确定出第三GPS围栏退让后的半径,如根据上述公式五确定出第三GPS围栏退让后的半径。在确定出第三GPS围栏退让后的半径之后,电子设备可以根据第三GPS围栏退让后的半径,更新第三GPS围栏。即将第三GPS围栏更新为以第三GPS围栏的中心为中心,以第三GPS围栏退让后的半径为半径的圆形区域。In some examples, on the electronic device, the smart flash card application of the electronic device can determine the radius of the third GPS fence after retreat, for example, determine the radius of the third GPS fence after retreat according to the above formula 5. After determining the retreated radius of the third GPS fence, the electronic device may update the third GPS fence according to the retreated radius of the third GPS fence. That is, the third GPS fence is updated to be a circular area with the center of the third GPS fence as the center and the radius after the retreat of the third GPS fence as the radius.

S708、电子设备的智闪卡应用获取每个第三地理围栏的中心以及对应的地理位置精度。S708. The smart flash card application of the electronic device acquires the center of each third geo-fence and the corresponding geographic location accuracy.

本申请实施例中以第三地理围栏为GPS围栏(即第三GPS围栏)为例进行示意说明。相应的,第三地理围栏的中心可以为建立第三地理围栏时使用的GPS位置信息,第三地理围栏的精度可以为GPS精度。In the embodiment of the present application, the third geographical fence is a GPS fence (that is, the third GPS fence) as an example for schematic illustration. Correspondingly, the center of the third geo-fence may be GPS location information used when establishing the third geo-fence, and the accuracy of the third geo-fence may be GPS accuracy.

电子设备,如电子设备的智闪卡应用可以从电子设备的存储器中获取与初始GPS围栏存在重叠区域的每个第三GPS围栏的中心以及对应的GPS精度第三GPS围栏为多个。The electronic device, such as the smart flash card application of the electronic device, can obtain from the memory of the electronic device the center of each third GPS fence that overlaps with the initial GPS fence and the corresponding GPS accuracy of multiple third GPS fences.

S709、电子设备的智闪卡应用根据初始地理围栏的中心、初始地理围栏对应的地理位置精度、每个第三地理围栏的中心以及对应的地理位置精度,分别确定出初始地理围栏对应的多个第一半径。S709. The smart flash card application of the electronic device respectively determines a plurality of corresponding initial geo-fences according to the center of the initial geo-fence, the geographic location accuracy corresponding to the initial geo-fence, the center of each third geo-fence, and the corresponding geographic location accuracy first radius.

本申请实施例中以初始地理围栏为GPS围栏、第三地理围栏为GPS围栏为例进行示意说明。相应的,初始地理围栏的中心可以为电子设备获取的当前GPS位置精度,初始地理围栏对应的地理位置精度可以为GPS精度,第三地理围栏的中心可以为建立第三地理围栏时使用的GPS位置信息,第三地理围栏对应的地理位置精度可以为GPS精度。In the embodiment of the present application, the initial geo-fence is a GPS fence and the third geo-fence is a GPS fence as an example for schematic illustration. Correspondingly, the center of the initial geo-fence may be the current GPS location accuracy obtained by the electronic device, the geographic location accuracy corresponding to the initial geo-fence may be the GPS accuracy, and the center of the third geo-fence may be the GPS position used when establishing the third geo-fence information, the location accuracy corresponding to the third geo-fence may be GPS accuracy.

当初始GPS围栏与多个第三GPS围栏存在重叠区域时,为了使初始GPS围栏与每个第三GPS围栏均不存在重叠区域,需要将初始GPS围栏以及每个第三GPS围栏进行退让,即将初始GPS围栏与每个第三GPS围栏的半径相应的缩小。When there is an overlapping area between the initial GPS fence and multiple third GPS fences, in order to prevent the initial GPS fence from overlapping with each third GPS fence, it is necessary to retreat the initial GPS fence and each third GPS fence, that is, The radius of the initial GPS fence is reduced correspondingly with each third GPS fence.

对于初始GPS围栏与多个第三GPS围栏中的每一个第三GPS围栏,电子设备,如电子设备的智闪卡应用,可以根据初始GPS围栏的中心、初始GPS围栏对应的GPS精度、第三GPS围栏的中心以及第三GPS围栏对应的GPS精度,确定出初始GPS围栏退让后的半径,即第一半径。具体实现方式可以参考上述S706中的实现方式,本申请实施例在此不再赘述。For each third GPS fence in the initial GPS fence and a plurality of third GPS fences, the electronic device, such as the smart flash card application of the electronic device, can be based on the center of the initial GPS fence, the GPS accuracy corresponding to the initial GPS fence, the third The center of the GPS fence and the GPS accuracy corresponding to the third GPS fence determine the radius after the initial GPS fence retreats, that is, the first radius. For a specific implementation manner, reference may be made to the implementation manner in S706 above, which will not be repeated in this embodiment of the present application.

S710、电子设备的智闪卡应用根据多个第一半径,确定初始地理围栏退让后的半径。S710. The smart flash card application of the electronic device determines, according to the multiple first radii, a radius after the initial geo-fence retreat.

本申请实施例中以初始地理围栏为GPS围栏(即初始GPS围栏)为例进行示意说明。相应的,第一地理围栏为GPS围栏(即第一GPS围栏)。In the embodiment of the present application, the initial geographical fence is a GPS fence (that is, the initial GPS fence) as an example for schematic illustration. Correspondingly, the first geographic fence is a GPS fence (that is, the first GPS fence).

在确定出多个第一半径后,电子设备,如电子设备的智闪卡应用可以根据多个第一半径,确定初始GPS围栏的半径。After determining the multiple first radii, the electronic device, such as the smart flash card application of the electronic device, can determine the radius of the initial GPS fence according to the multiple first radii.

在一些示例中,电子设备,如电子设备的智闪卡应用可以将多个初始GPS围栏退让后的半径中最小的第一半径,作为初始GPS围栏退让后的半径。In some examples, the electronic device, such as the smart flash card application of the electronic device, may use the smallest first radius among the retracted radii of multiple initial GPS fences as the retracted radius of the initial GPS fence.

例如,与初始GPS围栏存在重叠区域的第三GPS围栏为两个,分别为第三GPS围栏01和第三GPS围栏02,电子设备根据初始GPS围栏的中心、初始GPS围栏的半径、第三 GPS围栏01的中心以及第三GPS围栏01对应的GPS精度,确定出初始GPS围栏退让后的半径(即第一半径)为600米。电子设备根据初始GPS围栏的中心、初始GPS围栏的半径、第三GPS围栏02的中心以及第三GPS围栏02对应的GPS精度,确定出初始GPS围栏退让后(即第一半径)的半径为400米。则电子设备,如电子设备的智闪卡应用将400 米作为初始GPS围栏退让后的半径。For example, there are two third GPS fences that overlap with the initial GPS fence, namely the third GPS fence 01 and the third GPS fence 02. The center of the fence 01 and the GPS accuracy corresponding to the third GPS fence 01 determine that the radius (ie, the first radius) of the initial GPS fence after retreat is 600 meters. According to the center of the initial GPS fence, the radius of the initial GPS fence, the center of the third GPS fence 02, and the GPS accuracy corresponding to the third GPS fence 02, the electronic device determines that the radius of the initial GPS fence after retreat (that is, the first radius) is 400 rice. Then the electronic device, such as the smart flash card application of the electronic device, uses 400 meters as the radius after the initial GPS fence retreat.

例如,结合图9中的(a)所示,以初始地理围栏为初始GPS围栏01,初始GPS围栏 01的半径为2千米为例。在电子设备确定初始GPS围栏01与电子设备中已建立的第二GPS 围栏均不存在重叠区域的情况下,电子设备可以电子设备当前的GPS位置信息为中心,以 2千米为半径建立第一虚拟卡对应的第一GPS围栏。又如,结合图9中的(b)所示,以初始地理围栏为GPS围栏,第三地理围栏为GPS围栏为例。在与初始GPS围栏01存在重叠区域的第三GPS围栏为两个时,即第三GPS围栏02和第三GPS围栏03,电子设备计算得到初始GPS围栏01退让后的半径为600,第三GPS围栏02退让后的半径为200米,第三 GPS围栏03退让后的半径为200米,即退让后的初始GPS围栏01与退让后的第三GPS围栏02以及退让后的第二GPS围栏03之间均不存在重叠区域。For example, as shown in (a) in FIG. 9 , take the initial GPS fence 01 as an example, and the radius of the initial GPS fence 01 is 2 kilometers as an example. When the electronic device determines that there is no overlapping area between the initial GPS fence 01 and the second GPS fence already established in the electronic device, the electronic device can establish the first GPS fence with a radius of 2 kilometers around the current GPS location information of the electronic device. The virtual card corresponds to the first GPS fence. As another example, as shown in (b) of FIG. 9 , it is assumed that the initial geographic fence is a GPS fence and the third geographic fence is a GPS fence. When there are two third GPS fences that overlap with the initial GPS fence 01, that is, the third GPS fence 02 and the third GPS fence 03, the electronic device calculates that the radius of the initial GPS fence 01 is 600, and the third GPS fence The radius of fence 02 after retreat is 200 meters, and the radius of third GPS fence 03 after retreat is 200 meters, that is, the distance between the initial GPS fence 01 after retreat, the third GPS fence 02 after retreat and the second GPS fence 03 after retreat There is no overlapping area between them.

在确定出第一GPS围栏的半径之后,电子设备,如电子设备的智闪卡应用可以根据电子设备当前的GPS位置信息以及第一GPS围栏的半径,建立第一虚拟卡对应的第一GPS 围栏,即电子设备可以执行上述S707。After determining the radius of the first GPS fence, the electronic device, such as the smart flash card application of the electronic device, can establish the first GPS fence corresponding to the first virtual card according to the current GPS position information of the electronic device and the radius of the first GPS fence , that is, the electronic device can execute the above S707.

在一些示例中,对于初始GPS围栏与多个第三GPS围栏中的每一个第三GPS围栏,电子设备,如电子设备的智闪卡应用,根据初始GPS围栏的中心、初始GPS围栏对应的 GPS精度、第三GPS围栏的中心以及第三GPS围栏对应的精度,确定出初始GPS围栏退让后的半径之后,电子设备,如电子设备的智闪卡应用可以根据初始GPS围栏的中心与该第三GPS围栏的中心之间的距离,该初始GPS围栏退让后的半径以及上述的缓冲宽度,确定出该第三GPS围栏退让之后的半径。例如,以缓冲宽度为20米,初始GPS围栏的中心与该第二GPS围栏的中心之间的距离为1千米为例,电子设备确定出初始GPS围栏退让后的半径为400米为例。第三GPS围栏退让之后的半径可以为1千米减去400米,再减去20 米,即第三GPS围栏退让之后的半径可以为580米。In some examples, for each third GPS fence in the initial GPS fence and multiple third GPS fences, the electronic device, such as the smart flash card application of the electronic device, according to the center of the initial GPS fence, the GPS corresponding to the initial GPS fence Accuracy, the center of the third GPS fence and the accuracy corresponding to the third GPS fence, after the radius of the initial GPS fence is determined, the electronic device, such as the smart flash card application of the electronic device, can be based on the center of the initial GPS fence and the third GPS fence. The distance between the centers of the GPS fences, the retracted radius of the initial GPS fence and the aforementioned buffer width determine the retracted radius of the third GPS fence. For example, taking the buffer width as 20 meters and the distance between the center of the initial GPS fence and the center of the second GPS fence as 1 kilometer as an example, the electronic device determines that the radius of the initial GPS fence is 400 meters as an example. The radius after the retreat of the third GPS fence can be 1 kilometer minus 400 meters, and then subtract 20 meters, that is, the radius after the retreat of the third GPS fence can be 580 meters.

在一些示例中,为了确保第一虚拟卡对应的第一GPS围栏与第三GPS围栏均不存在重叠区域,电子设备在确定出第三GPS围栏退让后的半径时,电子设备,如电子设备的智闪卡应用可以将确定出的第三GPS围栏退让后的半径与第三GPS围栏原来的半径中较小的半径作为第三GPS围栏退让后的半径。例如,继续以缓冲宽度为20米,初始GPS围栏的中心与该第三GPS围栏的中心之间的距离为1千米为例,电子设备确定出初始GPS围栏退让后的半径为400米为例。第三GPS围栏退让之后的半径可以为1千米减去400米,再减去 20米,即第三GPS围栏退让之后的半径可以为580米。若第三GPS围栏原来的半径为500 米,则第三GPS围栏退让后的半径仍为原来的半径,即500米。若若第三GPS围栏原来的半径为600米,则第三GPS围栏退让后的半径可以为580米。In some examples, in order to ensure that there is no overlapping area between the first GPS fence and the third GPS fence corresponding to the first virtual card, when the electronic device determines the retreated radius of the third GPS fence, the electronic device, such as the electronic device The smart flash card application may use the smaller radius between the determined radius of the third GPS fence after retreat and the original radius of the third GPS fence as the radius of the third GPS fence after retreat. For example, continue taking the example where the buffer width is 20 meters, the distance between the center of the initial GPS fence and the center of the third GPS fence is 1 kilometer, and the electronic device determines that the radius of the initial GPS fence is 400 meters as an example . The radius after the third GPS fence retreat can be 1 kilometer minus 400 meters, and then subtract 20 meters, that is, the radius after the third GPS fence retreat can be 580 meters. If the original radius of the third GPS fence is 500 meters, the radius of the third GPS fence after retreating is still the original radius, that is, 500 meters. If the original radius of the third GPS fence is 600 meters, then the radius of the third GPS fence can be 580 meters.

在一些示例中,在电子设备确定出每个第三GPS围栏退让后的半径之后,电子设备可以根据每个第三GPS围栏退让后的半径,分别更新对应的第三GPS围栏。即将原来的第三GPS围栏更新为以第三GPS围栏的中心为中心,以第三GPS围栏退让后的半径为半径的圆形区域。In some examples, after the electronic device determines the retreated radius of each third GPS fence, the electronic device may respectively update the corresponding third GPS fence according to the retreated radius of each third GPS fence. That is, the original third GPS fence is updated to a circular area with the center of the third GPS fence as the center and the radius after the retreat of the third GPS fence as the radius.

S604、电子设备的智闪卡应用保存第一地理围栏、电子设备当前的地理位置信息以及地理位置精度。S604. The smart flash card application of the electronic device saves the first geo-fence, the current geographic location information of the electronic device, and the geographic location accuracy.

本申请实施例中以第一地理围栏为GPS围栏为例进行示意说明。相应的,电子设备当前的地理位置信息可以为GPS位置信息,当前的地理位置精度可以为GPS精度。In the embodiment of the present application, the first geographical fence is a GPS fence as an example for schematic illustration. Correspondingly, the current geographic location information of the electronic device may be GPS location information, and the current geographic location accuracy may be GPS accuracy.

在电子设备确定出第一GPS围栏,即确定出第一GPS围栏的半径之后,电子设备,如电子设备中的智闪卡应用可以将电子设备当前的GPS位置信息、GPS精度以及第一虚拟卡与第一GPS围栏对应保存在电子设备的存储器中。如,电子设备的智闪卡应用可以将第一虚拟卡的标识与第一GPS围栏的标识之间的对应关系存储在电子设备的存储器中。第一虚拟卡的标识可以为第一虚拟卡的AID,也可以为第一虚拟卡的ID。第一GPS围栏的标识可以为第一GPS围栏的ID。在电子设备的存储器中存储的第一虚拟卡的标识与第一GPS围栏的标识之间的对应关系如表2所示。After the electronic device determines the first GPS fence, that is, after determining the radius of the first GPS fence, the electronic device, such as the smart flash card application in the electronic device, can use the current GPS position information, GPS accuracy and first virtual card of the electronic device Corresponding to the first GPS fence, it is stored in the memory of the electronic device. For example, the smart flash card application of the electronic device may store the correspondence between the identifier of the first virtual card and the identifier of the first GPS fence in the memory of the electronic device. The identifier of the first virtual card may be the AID of the first virtual card, or may be the ID of the first virtual card. The identifier of the first GPS fence may be the ID of the first GPS fence. Table 2 shows the correspondence between the identifier of the first virtual card stored in the memory of the electronic device and the identifier of the first GPS fence.

表2Table 2

Figure BDA0003207551810000221
Figure BDA0003207551810000221

如表2所示,以第一虚拟卡为小区门禁卡为例,标识为ID1的小区门禁卡与标识为ID2 的GPS围栏对应,标识为ID2的GPS围栏对应的GPS围栏的中心为电子设备当前的GPS 位置信息,标识为ID2的GPS围栏对应的GPS精度为电子设备当前的GPS精度。As shown in Table 2, taking the first virtual card as the community access control card as an example, the community access control card marked as ID1 corresponds to the GPS fence marked as ID2, and the center of the GPS fence corresponding to the GPS fence marked as ID2 is the electronic device current GPS location information, the GPS accuracy corresponding to the GPS fence identified as ID2 is the current GPS accuracy of the electronic device.

在一些实施例中,电子设备在后续建立的虚拟卡对应的地理围栏较多的情况下,电子设备可以根据实际情况,删除其中的一些地理围栏,如预设时长内没有使用过的地理围栏,或使用期限到达有效期的地理围栏,电子设备可以删除该地理围栏。其中,预设时长和有效期可以根据实际情况设定。例如,以删除地理围栏的判断依据为使用期限是否达到有效期为例。电子设备,如电子设备的智闪卡应用可以确定建立的地理围栏的使用期限是否达到对应的有效期。在地理围栏的使用期限到达对应的有效期的情况下,电子设备,如电子设备的智闪卡应用可以删除该地理围栏。例如,电子设备,如电子设备的智闪卡应用可以确定已存储的第一虚拟卡对应的GPS围栏是否达到对应的有效期,在该GPS围栏到达对应的有效期的情况下,电子设备,如电子设备的智闪卡应用可以删除该GPS围栏。又如,电子设备,如电子设备的智闪卡应用确定在电子设备存储的第一虚拟卡对应的GPS围栏较多时,电子设备可以根据实际情况,删除其中的一些GPS围栏,如预设时长内没有使用过的 GPS围栏,电子设备可以删除该GPS围栏。In some embodiments, when the electronic device has many geo-fences corresponding to the subsequently established virtual card, the electronic device can delete some of the geo-fences according to the actual situation, such as the geo-fences that have not been used within a preset period of time, Or the geo-fence whose usage period reaches the validity period, the electronic device can delete the geo-fence. Wherein, the preset duration and validity period may be set according to actual conditions. For example, take the judgment basis for deleting a geofence as whether the usage period reaches the validity period as an example. The electronic device, such as the smart flash card application of the electronic device, can determine whether the service period of the established geographic fence reaches the corresponding validity period. When the usage period of the geo-fence reaches the corresponding validity period, the electronic device, such as the smart flash card application of the electronic device, can delete the geo-fence. For example, an electronic device, such as the smart flash card application of the electronic device, can determine whether the GPS fence corresponding to the stored first virtual card has reached the corresponding validity period. When the GPS fence reaches the corresponding validity period, the electronic device, such as the electronic device The smart card application can remove the GPS fence. As another example, when the electronic device, such as the smart flash card application of the electronic device determines that there are many GPS fences corresponding to the first virtual card stored in the electronic device, the electronic device can delete some of the GPS fences according to the actual situation, such as within a preset period of time. There is no GPS fence used, the electronic device can remove the GPS fence.

可以理解的,由于天气、室内室外,用户移动等因素造成电子设备获取的当前GPS精度(即建立第一虚拟卡对应的第一地理围栏时使用的GPS精度)不够精准,导致电子设备建立的第一虚拟卡对应的第一地理围栏的精度不高。在一些实例中,为了避免由于天气、室内室外,用户移动等因素造成电子设备获取的当前GPS精度不够精准,在电子设备保存第一GPS围栏、电子设备当前的GPS位置信息以及GPS精度之后,当电子设备使用第一虚拟卡在第一GPS围栏的范围内进行刷卡时,电子设备,如电子设备的智闪卡应用可以获取刷卡时的GPS精度,利用该刷卡时的GPS精度,更新电子设备存储的当前的GPS精度。例如,更新后的GPS精度与刷卡时的GPS精度以及电子设备存储的当前的GPS精度满足下述公式六。Understandably, due to factors such as weather, indoors and outdoors, and user movement, the current GPS accuracy obtained by the electronic device (that is, the GPS accuracy used when establishing the first geofence corresponding to the first virtual card) is not accurate enough, resulting in the establishment of the electronic device. The accuracy of the first geographic fence corresponding to a virtual card is not high. In some instances, in order to prevent the current GPS accuracy obtained by the electronic device from being inaccurate due to factors such as weather, indoors and outdoors, and user movement, after the electronic device saves the first GPS fence, the current GPS location information of the electronic device, and the GPS accuracy, when When the electronic device uses the first virtual card to swipe the card within the range of the first GPS fence, the electronic device, such as the smart flash card application of the electronic device, can obtain the GPS accuracy when swiping the card, and use the GPS accuracy when swiping the card to update the storage of the electronic device. The current GPS accuracy. For example, the updated GPS accuracy, the GPS accuracy when swiping the card, and the current GPS accuracy stored in the electronic device satisfy the following formula six.

公式六:Sacc1=(a*Sacc)+((1-a)*acc);Formula 6: Sacc1=(a*Sacc)+((1-a)*acc);

其中,Sacc1为更新后的GPS精度,Sacc为电子设备存储的当前的GPS精度,a为预设参数,acc为刷卡时的GPS精度。参数a可以为0.9。Wherein, Sacc1 is the updated GPS accuracy, Sacc is the current GPS accuracy stored in the electronic device, a is a preset parameter, and acc is the GPS accuracy when swiping the card. The parameter a can be 0.9.

在一些实施例中,电子设备,如电子设备的智闪卡应用可以确定电子设备获取的当前 GPS精度(即建立第一虚拟卡对应的第一地理围栏时使用的GPS精度)是否小于精度阈值,在电子设备获取的当前GPS精度小于精度阈值的情况下,在后续(如下一次)电子设备使用第一虚拟卡在第一GPS围栏对应的刷卡点进行刷卡时,电子设备,如电子设备的智闪卡应用可以获取刷卡时的GPS精度,利用该刷卡时的GPS精度,更新电子设备存储的当前的 GPS精度,即第一GPS围栏对应的GPS精度。精度阈值的大小可以根据实际情况设定,本申请实施例对此并不进行限定。例如,电子设备,如电子设备的智闪卡应用可以根据上述公式六获取更新后的GPS精度。In some embodiments, the electronic device, such as the smart flash card application of the electronic device, can determine whether the current GPS accuracy acquired by the electronic device (that is, the GPS accuracy used when establishing the first geographic fence corresponding to the first virtual card) is less than the accuracy threshold, In the case that the current GPS accuracy obtained by the electronic device is less than the accuracy threshold, when the electronic device uses the first virtual card to swipe the card at the card swiping point corresponding to the first GPS fence in the subsequent (as follows) electronic device, such as the smart flash of the electronic device The card application can obtain the GPS accuracy when the card is swiped, and use the GPS accuracy when the card is swiped to update the current GPS accuracy stored in the electronic device, that is, the GPS accuracy corresponding to the first GPS fence. The accuracy threshold can be set according to actual conditions, which is not limited in this embodiment of the present application. For example, an electronic device, such as a smart flash card application of the electronic device, can obtain the updated GPS accuracy according to the above formula six.

在一些实施例中,电子设备,如电子设备的智闪卡应用可以周期性的更新电子设备存储的第一GPS围栏对应的GPS精度。例如,电子设备可以每隔预设时长(如1周,或者1 个月)获取用户在第一GPS围栏对应刷卡点刷卡时的GPS精度,根据该GPS精度更新电子设备存储的第一GPS围栏对应的当前的GPS精度。如,电子设备,如电子设备的智闪卡应用可以根据上述公式六获取更新后的GPS精度。In some embodiments, the electronic device, such as the smart flash card application of the electronic device, may periodically update the GPS accuracy corresponding to the first GPS fence stored in the electronic device. For example, the electronic device may obtain the GPS accuracy of the user's card swiping at the corresponding point of the first GPS fence every preset period of time (such as 1 week or 1 month), and update the first GPS fence corresponding to the first GPS fence stored in the electronic device according to the GPS accuracy. The current GPS accuracy. For example, the electronic device, such as the smart flash card application of the electronic device, can obtain the updated GPS accuracy according to the above formula six.

在一些实施例中,电子设备,如电子设备的智闪卡应用还可以在检测到达到触发条件后,更新电子设备存储的第一GPS围栏对应的GPS精度(即建立第一虚拟卡对应的第一地理围栏时使用的GPS精度)或者电子设备当前的GPS位置信息(即建立第一虚拟卡对应的第一地理围栏时使用的GPS位置信息)。触发条件可以包括第一GPS围栏对应的刷卡点的位置发生变化。例如,第一GPS围栏对应的刷卡点为公交车站,由于公交车站的位置由位置A变为位置B,且位置A与位置B的距离小于预设距离。在电子设备检测到在位置B使用公共交通卡进行刷卡时,电子设备可以确定第一GPS围栏对应的刷卡点的位置由位置A 变为位置B,即电子设备可以确定到达到触发条件,电子设备,如电子设备的智闪卡应用可以获取位置B对应的GPS位置信息以及GPS精度,并更新电子设备存储的第一GPS围栏对应的GPS位置信息以及GPS精度。In some embodiments, the electronic device, such as the smart flash card application of the electronic device, can also update the GPS accuracy corresponding to the first GPS fence stored in the electronic device after detecting that the trigger condition is reached (that is, establish the first virtual card corresponding to the first GPS precision used when a geofence is used) or current GPS location information of the electronic device (that is, the GPS location information used when establishing the first geofence corresponding to the first virtual card). The trigger condition may include that the position of the swiping point corresponding to the first GPS fence changes. For example, the card swiping point corresponding to the first GPS fence is a bus stop, because the position of the bus stop changes from position A to position B, and the distance between position A and position B is less than the preset distance. When the electronic device detects that the public transportation card is used to swipe the card at position B, the electronic device can determine that the position of the card swiping point corresponding to the first GPS fence changes from position A to position B, that is, the electronic device can determine that the trigger condition is reached, and the electronic device For example, the smart card application of the electronic device can obtain the GPS location information and GPS accuracy corresponding to location B, and update the GPS location information and GPS accuracy corresponding to the first GPS fence stored in the electronic device.

可以理解的,在电子设备更新了第一虚拟卡的第一GPS围栏对应的GPS精度或者GPS 位置信息之后,电子设备,如电子设备的智闪卡应用可以根据更新后的GPS精度或者GPS 位置信息,重新建立该第一虚拟卡对应的GPS围栏,并将电子设备存储的第一GPS围栏进行更新。电子设备重新建立第一虚拟卡对应的GPS围栏的过程,可以参考上述S601-S604的步骤,本申请实施例在此不再赘述。It can be understood that after the electronic device updates the GPS accuracy or GPS location information corresponding to the first GPS fence of the first virtual card, the electronic device, such as the smart flash card application of the electronic device, can , re-establish the GPS fence corresponding to the first virtual card, and update the first GPS fence stored in the electronic device. For the process of the electronic device re-establishing the GPS fence corresponding to the first virtual card, reference may be made to the above-mentioned steps S601-S604, which will not be repeated in this embodiment of the present application.

S605、电子设备的智闪卡应用向传感集线器发送第一虚拟卡对应的第一地理围栏。S605. The smart flash card application of the electronic device sends the first geo-fence corresponding to the first virtual card to the sensor hub.

本申请实施例中以第一地理围栏为GPS围栏为例进行示意说明。In the embodiment of the present application, the first geographical fence is a GPS fence as an example for schematic illustration.

例如,结合图4的示例,在电子设备中的智闪卡应用建立第一虚拟卡对应的第一GPS 围栏之后,智闪卡应用可以存储第一虚拟卡的标识与第一GPS围栏的标识之间的对应关系。电子设备的智闪卡应用也可以将已建立的GPS围栏发送给电子设备的sensorhub。For example, with reference to the example in FIG. 4, after the smart flash card application in the electronic device establishes the first GPS fence corresponding to the first virtual card, the smart flash card application can store the difference between the first virtual card identifier and the first GPS fence identifier. Correspondence between. The smart flash card application of the electronic device can also send the established GPS fence to the sensorhub of the electronic device.

具体的,上述S605可以包括下述S6051-S6053。Specifically, the above S605 may include the following S6051-S6053.

S6051、智闪卡应用向系统服务中的应用发送第一虚拟卡对应的第一地理围栏。S6051. The smart flash card application sends the first geo-fence corresponding to the first virtual card to the application in the system service.

本申请实施例中以第一地理围栏为GPS围栏、系统服务中的应用为GPS应用为例进行示意说明。In the embodiment of the present application, the first geographic fence is a GPS fence, and the application in the system service is a GPS application as an example for schematic illustration.

智闪卡应用将第一虚拟卡对应的第一GPS围栏(即对应的GPS位置信息为中心,以对应的长度为半径的圆形区域)以及GPS围栏的标识发送给GPS应用。GPS应用中存储已经建立的GPS围栏以及GPS围栏的标识。The smart flash card application sends the first GPS fence corresponding to the first virtual card (that is, a circular area centered on the corresponding GPS position information and taking the corresponding length as the radius) and the identification of the GPS fence to the GPS application. The established GPS fence and the identification of the GPS fence are stored in the GPS application.

S6052、系统服务中的应用向传感集线器发送第一虚拟卡对应的第一地理围栏。S6052. The application in the system service sends the first geo-fence corresponding to the first virtual card to the sensor hub.

本申请实施例中以第一地理围栏为GPS围栏、系统服务中的应用为GPS应用为例进行示意说明。In the embodiment of the present application, the first geographic fence is a GPS fence, and the application in the system service is a GPS application as an example for schematic illustration.

GPS应用接收到智闪卡应用发送的第一虚拟卡对应的GPS围栏之后,GPS应用可以将第一虚拟卡对应的第一GPS围栏(即已经建立GPS围栏以及GPS围栏的标识)通过硬件连接层发送给sensorhub。After the GPS application receives the GPS fence corresponding to the first virtual card sent by the smart card application, the GPS application can connect the first GPS fence corresponding to the first virtual card (that is, the GPS fence and the identification of the GPS fence have been established) through the hardware connection layer Send to sensorhub.

S6053、传感集线器接收第一虚拟卡对应的第一地理围栏。S6053. The sensor hub receives the first geo-fence corresponding to the first virtual card.

本申请实施例中以第一地理围栏为GPS围栏为例进行示意说明。In the embodiment of the present application, the first geographical fence is a GPS fence as an example for schematic illustration.

在一些示例中,电子设备,如电子设备的智闪卡应用也可以将需要删除的GPS围栏的标识通过发送给电子设备的sensorhub,sensorhub可以将接收到的GPS围栏标识对应的GPS 围栏删除,从而sensorhub不再监测用户是否进入该GPS围栏内。In some examples, the electronic device, such as the smart flash card application of the electronic device, can also send the identification of the GPS fence that needs to be deleted to the sensorhub of the electronic device, and the sensorhub can delete the GPS fence corresponding to the received GPS fence identification, thereby sensorhub no longer monitors whether the user enters the GPS fence.

电子设备在存储虚拟卡对应的GPS围栏之后,可以周期性的获取电子设备的GPS位置信息,并根据电子设备的GPS位置信息,以及存储的虚拟卡与GPS围栏的对应关系,确定需要激活的虚拟卡,即在用户刷卡前自动选到正确的虚拟卡并激活。具体的,该过程可以称为“虚拟卡切换”流程。如图10所示,该“虚拟卡切换”流程具体的可以包括以下 S1001-S1005。After storing the GPS fence corresponding to the virtual card, the electronic device can periodically obtain the GPS location information of the electronic device, and determine the virtual card to be activated according to the GPS location information of the electronic device and the corresponding relationship between the stored virtual card and the GPS fence Card, that is, the correct virtual card is automatically selected and activated before the user swipes the card. Specifically, this process may be called a "virtual card switching" process. As shown in Figure 10, the "virtual card switching" process may specifically include the following S1001-S1005.

S1001、电子设备的传感集线器获取电子设备当前的地理位置信息。S1001. The sensor hub of the electronic device acquires current geographic location information of the electronic device.

电子设备当前的地理位置信息可以为GNSS位置信息,也可以为对应的Cell信息,还可以为对应的Wi-Fi信息,还可以为其他类型的位置信息,本申请实施例对此并不进行限定。 GNSS位置信息可以为GPS位置信息、GLONASS位置信息、北斗位置信息、QZSS位置信息或者SBAS位置信息等。本申请中对GNSS位置信息的具体类型并不进行限定。The current geographic location information of the electronic device may be GNSS location information, corresponding Cell information, corresponding Wi-Fi information, or other types of location information, which is not limited in this embodiment of the present application. . The GNSS location information may be GPS location information, GLONASS location information, Beidou location information, QZSS location information, or SBAS location information. The specific type of GNSS location information is not limited in this application.

为了便于理解,本申请实施例中以电子设备当前的地理位置信息为GPS位置信息为例进行示意说明。For ease of understanding, in the embodiment of the present application, the current geographic location information of the electronic device is taken as GPS location information as an example for schematic illustration.

电子设备,如电子设备中的传感集线器(sensorhub)可以实时或者周期性获取电子设备当前的GPS位置信息。电子设备当前的GPS位置信息,可以为电子设备当前的经纬度坐标。An electronic device, such as a sensor hub (sensorhub) in the electronic device, may acquire current GPS location information of the electronic device in real time or periodically. The current GPS location information of the electronic device may be the current latitude and longitude coordinates of the electronic device.

例如,结合图4的示例,sensorhub可以实时或者周期性地从短距离芯片中获取用户的 GPS位置信息。具体的,上述S1001可以包括下述S10011-S10012。For example, with reference to the example in Figure 4, the sensorhub can obtain the user's GPS location information from the short-distance chip in real time or periodically. Specifically, the above S1001 may include the following S10011-S10012.

S10011、短距离芯片向传感集线器发送电子设备当前的地理位置信息。S10011. The short-distance chip sends the current geographic location information of the electronic device to the sensor hub.

本申请实施例中以电子设备当前的地理位置信息为GPS位置信息为例进行示意说明。In the embodiment of the present application, the current geographic location information of the electronic device is GPS location information as an example for schematic illustration.

短距离芯片可以实时或者周期性向sensorhub发送电子设备当前的GPS位置信息。The short-distance chip can send the current GPS location information of the electronic device to the sensorhub in real time or periodically.

S10012、传感集线器接收电子设备当前的地理位置信息。S10012. The sensor hub receives the current geographic location information of the electronic device.

本申请实施例中以电子设备当前的地理位置信息为GPS位置信息为例进行示意说明。In the embodiment of the present application, the current geographic location information of the electronic device is GPS location information as an example for schematic illustration.

S1002、电子设备的传感集线器根据电子设备当前的地理位置信息,确定用户是否进入地理围栏。S1002. The sensor hub of the electronic device determines whether the user enters the geo-fence according to the current geographic location information of the electronic device.

本申请实施例中以电子设备当前的地理位置信息为GPS位置信息为例进行示意说明。In the embodiment of the present application, the current geographic location information of the electronic device is GPS location information as an example for schematic illustration.

由于用户持电子设备移动时,电子设备的GPS位置信息,即用户的GPS位置信息。因此,根据电子设备当前的GPS位置信息,即用户当前的GPS位置信息,也就是说,根据电子设备当前的GPS位置信息,也可以确定用户是否进入GPS围栏。即电子设备监测电子设备的位置是否到达GPS围栏的范围内。When the user moves with the electronic device, the GPS position information of the electronic device is the GPS position information of the user. Therefore, according to the current GPS location information of the electronic device, that is, the current GPS location information of the user, that is, according to the current GPS location information of the electronic device, it can also be determined whether the user enters the GPS fence. That is, the electronic device monitors whether the position of the electronic device reaches the range of the GPS fence.

电子设备,如电子设备的sensorhub可以根据电子设备当前的GPS位置信息,确定用户是否进入GPS围栏。在电子设备确定电子设备当前的经纬度坐标位于某个GPS围栏的范围内的情况下,确定用户进入该GPS围栏,在用户的经纬度坐标没有位于GPS围栏的范围的情况下,确定用户没有进入GPS围栏。例如,电子设备的传感集线器可以根据电子设备当前的GPS位置信息,利用围栏算法,如GPS围栏算法,确定用户是否进入GPS围栏,在确定用户进入GPS围栏时,可以确定出用户进入的GPS围栏的标识。The electronic device, such as the sensorhub of the electronic device, can determine whether the user enters the GPS fence according to the current GPS position information of the electronic device. When the electronic device determines that the current latitude and longitude coordinates of the electronic device are within the range of a certain GPS fence, it is determined that the user has entered the GPS fence; when the user's latitude and longitude coordinates are not within the range of the GPS fence, it is determined that the user has not entered the GPS fence . For example, the sensor hub of an electronic device can use a fence algorithm, such as the GPS fence algorithm, to determine whether the user has entered the GPS fence according to the current GPS location information of the electronic device. When it is determined that the user has entered the GPS fence, it can determine the GPS fence that the user entered logo.

例如,结合图4所示,电子设备的sensorhub可以实时从短距离芯片中获取用户的GPS 位置信息。由于sensorhub中存储有已经建立GPS围栏(即对应的GPS位置信息为中心,以对应的长度为半径的圆)以及GPS围栏的标识,sensorhub中的GPS围栏算法根据电子设备当前的GPS位置信息,确定用户是否进入GPS围栏,以及用户进入的GPS的围栏的标识。For example, as shown in FIG. 4 , the sensorhub of the electronic device can obtain the GPS location information of the user from the short-distance chip in real time. Since the sensorhub stores the established GPS fence (that is, the corresponding GPS location information as the center, the circle with the corresponding length as the radius) and the logo of the GPS fence, the GPS fence algorithm in the sensorhub determines based on the current GPS location information of the electronic device. Whether the user enters the GPS fence, and the identifier of the GPS fence that the user enters.

在电子设备确定用户没有进入GPS围栏的情况下,电子设备可以继续获取电子设备当前的GPS位置信息,并根据电子设备当前的GPS位置信息,确定用户是否进入GPS围栏,即电子设备可以重新执行上述S1001-S1002。When the electronic device determines that the user has not entered the GPS fence, the electronic device can continue to obtain the current GPS location information of the electronic device, and determine whether the user has entered the GPS fence according to the current GPS location information of the electronic device, that is, the electronic device can re-execute the above-mentioned S1001-S1002.

可以理解的,在电子设备确定用户没有进入GPS围栏的范围内的情况下,电子设备,如电子设备的智闪卡应用可以保持默认卡激活,或者将默认卡激活。例如,电子设备保存的默认卡为智能门锁卡,电子设备根据用户的GPS位置信息确定用户进入公共交通卡对应的GPS围栏时,电子设备可以将公共交通卡激活。在电子设备根据用户的GPS位置信息确定用户离开公共交通卡对应的GPS围栏的情况下,即电子设备确定用户没有进入GPS围栏,电子设备可以将公共交通卡去激活,并重新将默认卡(如智能门锁卡)激活。又如,电子设备根据用户的GPS位置信息确定用户进入默认卡(即智能门锁卡)对应的GPS围栏时,电子设备可以保持默认卡激活。在用户离开默认卡对应的GPS围栏的情况下,即电子设备确定用户没有进入GPS围栏,电子设备可以仍然保持默认卡激活。It can be understood that when the electronic device determines that the user does not enter the range of the GPS fence, the electronic device, such as the smart flash card application of the electronic device, can keep the default card activated, or activate the default card. For example, the default card stored in the electronic device is a smart door lock card. When the electronic device determines that the user enters the GPS fence corresponding to the public transport card according to the user's GPS location information, the electronic device can activate the public transport card. When the electronic device determines that the user has left the GPS fence corresponding to the public transportation card according to the user's GPS location information, that is, the electronic device determines that the user has not entered the GPS fence, the electronic device can deactivate the public transportation card, and re-activate the default card (such as Smart door lock card) activation. For another example, when the electronic device determines according to the user's GPS location information that the user enters the GPS fence corresponding to the default card (that is, the smart door lock card), the electronic device may keep the default card activated. When the user leaves the GPS fence corresponding to the default card, that is, the electronic device determines that the user has not entered the GPS fence, the electronic device may still keep the default card activated.

在一些实施例中,电子设备,如电子设备的sensorhub可以根据电子设备当前的GPS 位置信息,利用围栏算法,如GPS围栏算法,可以确定用户是否离开GPS围栏,在确定用户离开GPS围栏的情况下,可以确定出用户离开的GPS围栏的标识。电子设备的sensorhub还可以根据电子设备当前的GPS位置信息,利用GPS围栏算法,可以确定用户进入某个 GPS围栏超过预设时长,在确定用户进入某个GPS围栏超过预设时长的情况下,可以确定用户进入的超过预设时长的GPS围栏的标识。In some embodiments, the electronic device, such as the sensorhub of the electronic device, can use a fence algorithm, such as the GPS fence algorithm, to determine whether the user has left the GPS fence according to the current GPS location information of the electronic device, and if it is determined that the user has left the GPS fence , the identification of the GPS fence that the user leaves can be determined. The sensorhub of the electronic device can also use the GPS fence algorithm based on the current GPS location information of the electronic device to determine that the user has entered a certain GPS fence for more than the preset time. Determine the identity of the GPS fence that the user has entered for more than a preset duration.

在电子设备确定用户进入GPS围栏的情况下,电子设备可以执行S1003-S1005。When the electronic device determines that the user enters the GPS fence, the electronic device may execute S1003-S1005.

S1003、在确定用户进入地理围栏时,电子设备的传感集线器将用户进入的地理围栏的标识发送给电子设备的智闪卡应用。S1003. When it is determined that the user enters the geo-fence, the sensor hub of the electronic device sends the identifier of the geo-fence entered by the user to the smart flash card application of the electronic device.

用户进入的地理围栏可以是GNSS地理围栏,也可以为Cell地理围栏,还可以为Wi-Fi 地理围栏,还可以为其他类型的地理围栏,本申请实施例对此并不进行限定。GNSS地理围栏可以为GPS地理围栏、GLONASS地理围栏、北斗地理围栏、QZSS地理围栏或者SBAS 地理围栏等。本申请中对GNSS地理围栏的具体类型并不进行限定。The geo-fence entered by the user may be a GNSS geo-fence, a Cell geo-fence, a Wi-Fi geo-fence, or other types of geo-fences, which are not limited in this embodiment of the present application. The GNSS geo-fence may be a GPS geo-fence, a GLONASS geo-fence, a Beidou geo-fence, a QZSS geo-fence, or an SBAS geo-fence. The specific type of the GNSS geo-fence is not limited in this application.

地理围栏的标识,可以为GNSS地理围栏对应的标识,也可以为Cell地理围栏对应的标识,还可以为Wi-Fi地理围栏对应的标识。The identifier of the geo-fence may be an identifier corresponding to the GNSS geo-fence, may also be an identifier corresponding to the Cell geo-fence, and may also be an identifier corresponding to the Wi-Fi geo-fence.

为了便于理解,本申请实施例中以用户进入地理围栏为GPS围栏为例进行示意说明。即用户进入的地理围栏的标识,为用户进入的GPS围栏的标识。For ease of understanding, in the embodiment of the present application, a GPS fence is taken as an example for a user to enter a geographic fence for schematic illustration. That is, the identifier of the geographical fence entered by the user is the identifier of the GPS fence entered by the user.

例如,结合图4的示例,电子设备的sensorhub可以利用GPS围栏算法,确定用户进入 GPS围栏时,电子设备的sensorhub可以将用户进入的一个或多个GPS围栏的标识通过GPS 应用发送给电子设备的智闪卡应用。具体的,上述S903可以包括下述S9031-S9032。For example, with reference to the example in Figure 4, the sensorhub of the electronic device can use the GPS fence algorithm to determine that when the user enters the GPS fence, the sensorhub of the electronic device can send the identification of one or more GPS fences that the user enters to the electronic device through the GPS application. Smart flash card application. Specifically, the above S903 may include the following S9031-S9032.

S10031、传感集线器在确定用户进入地理围栏时,向系统服务中的应用发送用户进入的地理围栏的标识。S10031. When the sensor hub determines that the user enters the geo-fence, it sends the identifier of the geo-fence entered by the user to the application in the system service.

本申请实施例中以用户进入地理围栏为GPS围栏为例进行示意说明。即用户进入的地理围栏的标识,为用户进入的GPS围栏的标识,系统服务中的应用为GPS应用。In the embodiment of the present application, a GPS fence is used as an example for a user to enter a geographic fence for schematic illustration. That is, the identifier of the geographical fence entered by the user is the identifier of the GPS fence entered by the user, and the application in the system service is a GPS application.

sensorhub可以通过硬件连接层向GPS应用发送用户进入的GPS围栏的标识。The sensorhub can send the identification of the GPS fence that the user enters to the GPS application through the hardware connection layer.

S10032、系统服务中的应用向智闪卡应用发送用户进入的地理围栏的标识。S10032. The application in the system service sends the identifier of the geographical fence entered by the user to the smart card application.

本申请实施例中以用户进入地理围栏为GPS围栏为例进行示意说明。即用户进入的地理围栏的标识,为用户进入的GPS围栏的标识,系统服务中的应用为GPS应用。In the embodiment of the present application, a GPS fence is used as an example for a user to enter a geographic fence for schematic illustration. That is, the identifier of the geographical fence entered by the user is the identifier of the GPS fence entered by the user, and the application in the system service is a GPS application.

GPS应用在接收到用户进入的GPS围栏的标识之后,可以向智闪卡应用发送用户进入的GPS围栏的标识。After receiving the identification of the GPS fence entered by the user, the GPS application may send the identification of the GPS fence entered by the user to the smart flash card application.

在一些实施例中,电子设备在确定用户是否离开某个GPS围栏时,电子设备,如电子设备的sensorhub可以将用户离开的GPS围栏的标识发送给电子设备,如电子设备的智闪卡应用。电子设备的sensorhub在确定用户进入某个GPS围栏超过预设时长时,电子设备,如电子设备的sensorhub将用户进入的GPS围栏的标识,以及进入该GPS围栏超过预设时长发送给电子设备,如电子设备的智闪卡应用。In some embodiments, when the electronic device determines whether the user leaves a certain GPS fence, the electronic device, such as the sensorhub of the electronic device, may send the identification of the GPS fence that the user leaves to the electronic device, such as the smart card application of the electronic device. When the sensorhub of the electronic device determines that the user enters a certain GPS fence for more than a preset time, the electronic device, such as the sensorhub of the electronic device, sends the identification of the GPS fence that the user enters and the time that the user enters the GPS fence for more than a preset time to the electronic device, such as Smart flash card application for electronic devices.

例如,结合图11所示,以电子设备建立的第一虚拟卡对应的地理围栏为GPS围栏为例,当用户01持电子设备到达位置A时,即用户持电子设备进入GPS围栏02,电子设备的sensorhub将用户进入的GPS围栏02的标识发送给电子设备的智闪卡应用。当用户01持电子设备从位置A到达位置C时,电子设备确定用户位于GPS围栏02的时间超过预设时长,电子设备可以将该GPS围栏的标识以及用户进入该GPS围栏02超过预设时长发送给电子设备的智闪卡应用。当用户01持电子设备到达位置B时,即用户持电子设备离开GPS围栏02,在GPS围栏02对应的第一虚拟卡不是默认卡时,电子设备可以将GPS围栏02对应的第一虚拟卡去激活,并重新激活默认卡。For example, as shown in FIG. 11 , taking the geographic fence corresponding to the first virtual card established by the electronic device as an example of a GPS fence, when the user 01 arrives at position A with the electronic device, that is, the user enters the GPS fence 02 with the electronic device, the electronic device The sensorhub sends the identification of the GPS fence 02 entered by the user to the smart flash card application of the electronic device. When the user 01 holds the electronic device from position A to position C, the electronic device determines that the user has been in the GPS fence 02 for more than the preset time, and the electronic device can send the identification of the GPS fence and the user entering the GPS fence 02 for more than the preset time. Smart flash card application for electronic devices. When the user 01 arrives at position B with the electronic device, that is, the user leaves the GPS fence 02 with the electronic device, and when the first virtual card corresponding to the GPS fence 02 is not the default card, the electronic device can remove the first virtual card corresponding to the GPS fence 02. Activate, and reactivate the default card.

S1004、电子设备的智闪卡应用接收用户进入的地理围栏的标识。S1004. The smart flash card application of the electronic device receives the identifier of the geographical fence entered by the user.

本申请实施例中以用户进入地理围栏为GPS围栏为例进行示意说明。即用户进入的地理围栏的标识,为用户进入的GPS围栏的标识。In the embodiment of the present application, a GPS fence is used as an example for a user to enter a geographic fence for schematic illustration. That is, the identifier of the geographical fence entered by the user is the identifier of the GPS fence entered by the user.

S1005、电子设备的智闪卡应用将该地理围栏对应的虚拟卡激活。S1005. The smart flash card application of the electronic device activates the virtual card corresponding to the geo-fence.

本申请实施例中以用户进入地理围栏为GPS围栏为例进行示意说明。即该地理围栏对应的虚拟卡,为GPS围栏对应的虚拟卡。In the embodiment of the present application, a GPS fence is used as an example for a user to enter a geographic fence for schematic illustration. That is, the virtual card corresponding to the geographic fence is the virtual card corresponding to the GPS fence.

在电子设备确定用户进入的GPS围栏的情况下,电子设备,如电子设备的智闪卡应用,可以根据电子设备的存储器中存储的虚拟卡的标识与GPS围栏的标识之间的对应关系,将该GPS围栏对应的虚拟卡激活。In the case where the electronic device determines the GPS fence that the user enters, the electronic device, such as the smart flash card application of the electronic device, may, according to the correspondence between the identification of the virtual card stored in the memory of the electronic device and the identification of the GPS fence, set the The virtual card corresponding to the GPS fence is activated.

采用本申请的方案,电子设备的智闪卡应用可以在用户在某个刷卡点首次使用某个虚拟卡进行交易时,通过系统服务中的应用、硬件连接层以及sensorhub从短距离芯片获取电子设备当前的地理位置位置信息和地理位置精度。智闪卡应用根据电子设备当前的地理位置位置信息和地理位置精度建立该虚拟卡对应的地理位置围栏。之后当sensorhub根据从短距离芯片获取的电子设备地理位置位置信息,确定用户进入到地理位置围栏时,sensorhub 将用户进入的地理位置围栏的标识发送给智闪卡应用。智闪卡应用可以将地理位置围栏对应的虚拟卡激活。即,在用户刷卡前,电子设备的智闪卡应用能够利用地理位置围栏自动激活对应虚拟卡。在面对不同的刷卡需求时,能够避免用户需要手动选择虚拟卡,从而降低刷卡的时长,提升用户体验。With the solution of this application, the smart flash card application of the electronic device can obtain the electronic device from the short-distance chip through the application in the system service, the hardware connection layer and the sensorhub when the user uses a certain virtual card for the first time to conduct transactions at a certain card swiping point. Current geographic location information and geographic accuracy. The smart flash card application establishes a geographic location fence corresponding to the virtual card according to the current geographic location information and geographic location accuracy of the electronic device. Afterwards, when sensorhub determines that the user has entered the geo-location fence according to the geo-location information of the electronic device obtained from the short-distance chip, sensorhub sends the identification of the geo-location fence that the user entered to the smart flash card application. The smart flash card application can activate the virtual card corresponding to the geo-location fence. That is, before the user swipes the card, the smart flash card application of the electronic device can use the geographic location fence to automatically activate the corresponding virtual card. When faced with different card swiping requirements, it can avoid the need for users to manually select a virtual card, thereby reducing the time for swiping cards and improving user experience.

且本申请的方案可以根据地理位置信息中的GPS位置信息和地理位置精度中的GPS精度,建立对应的地理围栏,GPS位置信息可以利用电子设备的短距离芯片来获取。而短距离芯片是电子设备的标准配置,因此即使电子设备不具备Wi-Fi围栏能力,即电子设备不具备sensorhub,或者电子设备的sensorhub不具备Wi-Fi围栏能力,如sensorhub中不包括Wi-Fi围栏算法时,智闪卡应用仍然可以在用户刷卡前实现对应虚拟卡的自动激活,进一步提高了用户的使用体验。Moreover, the solution of the present application can establish a corresponding geo-fence according to the GPS position information in the geographic location information and the GPS accuracy in the geographic location accuracy, and the GPS location information can be obtained by using the short-distance chip of the electronic device. The short-distance chip is the standard configuration of electronic equipment, so even if the electronic equipment does not have the Wi-Fi fence capability, that is, the electronic equipment does not have the sensorhub, or the sensorhub of the electronic equipment does not have the Wi-Fi fence capability, such as the sensorhub does not include Wi-Fi When using the Fi fence algorithm, the smart flash card application can still automatically activate the corresponding virtual card before the user swipes the card, which further improves the user experience.

此外,本申请的方案电子设备的智闪卡应用是根据GPS位置信息和GPS精度,动态确定建立的虚拟卡对应的GPS围栏的大小(即动态确定虚拟卡对应的GPS围栏的半径),使得建立的虚拟卡对应的GPS围栏与其他GPS围栏之间均不存在重叠区域,从而在用户持电子设备到达GPS围栏的范围内时,电子设备可以准确的激活对应的虚拟卡。In addition, the smart flash card application of the solution electronic device of the present application dynamically determines the size of the GPS fence corresponding to the established virtual card (that is, dynamically determines the radius of the GPS fence corresponding to the virtual card) according to the GPS position information and GPS accuracy, so that the establishment There is no overlapping area between the GPS fence corresponding to the virtual card and other GPS fences, so that when the user reaches the range of the GPS fence with the electronic device, the electronic device can accurately activate the corresponding virtual card.

为了便于理解,下面结合附图12对本申请实施例提供的虚拟卡的切换方法进行说明。如图12所示,该虚拟卡的切换方法可以包括以下S1201-S1206。For ease of understanding, the virtual card switching method provided by the embodiment of the present application will be described below with reference to FIG. 12 . As shown in FIG. 12, the virtual card switching method may include the following steps S1201-S1206.

S1201、电子设备获取第一虚拟卡。S1201. The electronic device acquires a first virtual card.

电子设备获取第一虚拟卡的具体实施方式,可以参考上述S601中的实施方式。本申请实施例在此不再赘述。For a specific implementation manner of obtaining the first virtual card by the electronic device, reference may be made to the implementation manner in S601 above. The embodiment of the present application will not be repeated here.

S1202、在电子设备在第一刷卡点首次采用第一虚拟卡完成数据交互的情况下,电子设备获取电子设备的地理位置信息以及地理位置精度。S1202. In a case where the electronic device uses the first virtual card to complete data interaction for the first time at the first card swiping point, the electronic device acquires geographic location information and geographic location accuracy of the electronic device.

电子设备的地理位置信息可以为GNSS位置信息,也可以为对应的Cell信息,还可以为对应的Wi-Fi信息,还可以为其他类型的位置信息,本申请实施例对此并不进行限定。GNSS位置信息可以为GPS位置信息、GLONASS位置信息、北斗位置信息、QZSS位置信息或者SBAS位置信息等。本申请中对GNSS位置信息的具体类型并不进行限定。The geographic location information of the electronic device may be GNSS location information, corresponding Cell information, corresponding Wi-Fi information, or other types of location information, which is not limited in this embodiment of the present application. The GNSS location information may be GPS location information, GLONASS location information, Beidou location information, QZSS location information, or SBAS location information. The specific type of GNSS location information is not limited in this application.

电子设备的地理位置精度可以为GNSS位置精度,也可以为对应的Cell精度,还可以为对应的Wi-Fi精度,还可以为其他类型的位置精度,本申请实施例对此并不进行限定。GNSS位置信息可以为GPS精度、GLONASS精度、北斗精度、QZSS精度或者SBAS精度等。The location accuracy of the electronic device may be GNSS location accuracy, corresponding Cell accuracy, corresponding Wi-Fi accuracy, or other types of location accuracy, which is not limited in this embodiment of the present application. The GNSS position information can be GPS accuracy, GLONASS accuracy, Beidou accuracy, QZSS accuracy or SBAS accuracy, etc.

为了便于理解,本申请实施例中以电子设备当前的地理位置信息为GPS位置信息,地理位置精度为GPS精度为例进行示意说明。For ease of understanding, in the embodiment of the present application, the current geographic location information of the electronic device is GPS location information, and the geographic location accuracy is GPS accuracy as an example for schematic illustration.

电子设备在某个刷卡点(如称为第一刷卡点)首次采用某个第一虚拟卡与NFC读卡器完成数据交互时,获取当前的GPS位置信息以及GPS精度的具体实施方式,可以参考上述S602中的实施方式。本申请实施例在此不再赘述。When an electronic device uses a first virtual card to interact with an NFC card reader for the first time at a certain card-swiping point (such as the first card-swiping point), it can obtain the current GPS location information and the specific implementation method of GPS accuracy, which can be referred to The above implementation in S602. The embodiment of the present application will not be repeated here.

S1203、电子设备根据地理位置信息以及地理位置精度,建立并保存第一虚拟卡对应的地理围栏。S1203. The electronic device establishes and saves a geo-fence corresponding to the first virtual card according to the geographic location information and the geographic location accuracy.

第一虚拟卡对应的地理围栏可以是GNSS地理围栏,也可以为Cell地理围栏,还可以为Wi-Fi地理围栏,还可以为其他类型的地理围栏,本申请实施例对此并不进行限定。GNSS 地理围栏可以为GPS地理围栏、GLONASS地理围栏、北斗地理围栏、QZSS地理围栏或者SBAS地理围栏等。本申请中对GNSS地理围栏的具体类型并不进行限定。The geo-fence corresponding to the first virtual card may be a GNSS geo-fence, a Cell geo-fence, a Wi-Fi geo-fence, or other types of geo-fences, which are not limited in this embodiment of the present application. The GNSS geofence can be GPS geofence, GLONASS geofence, Beidou geofence, QZSS geofence or SBAS geofence, etc. The specific type of the GNSS geo-fence is not limited in this application.

为了便于理解,本申请实施例中以第一虚拟卡对应的地理围栏为GPS围栏为例进行示意说明。For ease of understanding, in the embodiment of the present application, the geographic fence corresponding to the first virtual card is taken as an example for schematic illustration.

电子设备根据GPS位置信息和GPS精度,可以动态确定建立的第一虚拟卡对应的GPS 围栏的半径,使得建立的第一虚拟卡对应的GPS围栏与其他GPS围栏之间均不存在重叠区域。The electronic device can dynamically determine the radius of the established GPS fence corresponding to the first virtual card according to the GPS location information and GPS accuracy, so that there is no overlapping area between the established GPS fence corresponding to the first virtual card and other GPS fences.

电子设备根据GPS位置信息以及GPS精度,建立并保存第一虚拟卡对应的GPS围栏的具体实施方式,可以参考上述S603-S605中的实施方式。本申请实施例在此不再赘述。For a specific implementation manner in which the electronic device establishes and saves the GPS fence corresponding to the first virtual card according to the GPS location information and the GPS accuracy, reference may be made to the above implementation manners in S603-S605. The embodiment of the present application will not be repeated here.

S1204、电子设备获取电子设备的地理位置信息。S1204. The electronic device acquires geographic location information of the electronic device.

电子设备的地理位置信息可以为GNSS位置信息,也可以为对应的Cell信息,还可以为对应的Wi-Fi信息,还可以为其他类型的位置信息,本申请实施例对此并不进行限定。GNSS位置信息可以为GPS位置信息、GLONASS位置信息、北斗位置信息、QZSS位置信息或者SBAS位置信息等。本申请中对GNSS位置信息的具体类型并不进行限定。The geographic location information of the electronic device may be GNSS location information, corresponding Cell information, corresponding Wi-Fi information, or other types of location information, which is not limited in this embodiment of the present application. The GNSS location information may be GPS location information, GLONASS location information, Beidou location information, QZSS location information, or SBAS location information. The specific type of GNSS location information is not limited in this application.

为了便于理解,本申请实施例中以电子设备当前的地理位置信息为GPS位置信息为例进行示意说明。For ease of understanding, in the embodiment of the present application, the current geographic location information of the electronic device is taken as GPS location information as an example for schematic illustration.

电子设备获取电子设备的GPS位置信息的具体实施方式,可以参考上述S1001中的实施方式。本申请实施例在此不再赘述。For a specific implementation manner in which the electronic device acquires the GPS location information of the electronic device, reference may be made to the implementation manner in S1001 above. The embodiment of the present application will not be repeated here.

S1205、电子设备根据电子设备的地理位置信息,确定用户是否进入地理围栏。S1205. The electronic device determines whether the user enters the geo-fence according to the geographic location information of the electronic device.

本申请实施例中以用户进入地理围栏为GPS围栏为例进行示意说明。即电子设备根据电子设备的GPS位置信息,确定用户是否进入GPS围栏中。In the embodiment of the present application, a GPS fence is used as an example for a user to enter a geographic fence for schematic illustration. That is, the electronic device determines whether the user enters the GPS fence according to the GPS location information of the electronic device.

电子设备根据电子设备的GPS位置信息,确定用户是否进入第一虚拟卡对应的GPS围栏的具体实施方式,可以参考上述S1002中的实施方式。本申请实施例在此不再赘述。For a specific implementation manner in which the electronic device determines whether the user enters the GPS fence corresponding to the first virtual card according to the GPS location information of the electronic device, reference may be made to the implementation manner in S1002 above. The embodiment of the present application will not be repeated here.

在电子设备确定用户进入第一虚拟卡对应的GPS围栏的情况下,电子设备可以执行 S1206。在电子设备确定用户没有进入第一虚拟卡对应的GPS围栏的情况下,电子设备可以电子设备可以继续获取电子设备GPS位置信息,并根据电子设备GPS位置信息,确定用户是否进入GPS围栏,即电子设备可以重新执行上述S1204。When the electronic device determines that the user enters the GPS fence corresponding to the first virtual card, the electronic device may execute S1206. When the electronic device determines that the user has not entered the GPS fence corresponding to the first virtual card, the electronic device can continue to obtain the GPS location information of the electronic device, and determine whether the user has entered the GPS fence according to the GPS location information of the electronic device, that is, the electronic The device may re-execute the above S1204.

S1206、电子设备将地理围栏对应的第一虚拟卡激活。S1206. The electronic device activates the first virtual card corresponding to the geo-fence.

本申请实施例中以用户进入地理围栏为GPS围栏为例进行示意说明。即电子设备将 GPS围栏对应的第一虚拟卡激活。In the embodiment of the present application, a GPS fence is used as an example for a user to enter a geographic fence for schematic illustration. That is, the electronic device activates the first virtual card corresponding to the GPS fence.

具体的,电子设备将GPS围栏对应的第一虚拟卡激活的具体实施方式,可以参考上述 S1003-S1005中的实施方式。本申请实施例在此不再赘述。Specifically, for a specific implementation manner in which the electronic device activates the first virtual card corresponding to the GPS fence, reference may be made to the above implementation manners in S1003-S1005. The embodiment of the present application will not be repeated here.

采用本申请的方案,可以在用户在某个刷卡点首次使用某个虚拟卡进行交易时,根据电子设备当前的地理位置信息以及地理位置精度,建立该虚拟卡对应的地理围栏。之后当用户持电子设备再次进入到该地理围栏时,电子设备可以自动将该地理围栏对应的虚拟卡激活,从而用户可以利用该虚拟卡完成交易。即,在用户刷卡前,电子设备能够利用地理围栏自动激活对应虚拟卡。在面对不同的刷卡需求时,能够避免用户需要手动选择虚拟卡,从而降低刷卡的时长,提升用户体验。With the solution of the present application, when a user uses a certain virtual card for the first time to conduct a transaction at a certain card swiping point, a geo-fence corresponding to the virtual card can be established according to the current geographic location information and geographic location accuracy of the electronic device. Afterwards, when the user enters the geographic fence again with the electronic device, the electronic device can automatically activate the virtual card corresponding to the geographic fence, so that the user can use the virtual card to complete transactions. That is, before the user swipes the card, the electronic device can automatically activate the corresponding virtual card by using the geo-fence. When faced with different card swiping requirements, it can avoid the need for users to manually select a virtual card, thereby reducing the time for swiping cards and improving user experience.

且本申请的方案可以根据地理位置信息中的GPS位置信息和地理位置精度中的GPS精度,建立对应的地理围栏,GPS位置信息可以利用电子设备的短距离芯片来获取。而短距离芯片是电子设备的标准配置,因此即使电子设备不具备Wi-Fi围栏能力,仍然可以在用户刷卡前实现对应虚拟卡的自动激活,进一步提高了用户的使用体验。Moreover, the solution of the present application can establish a corresponding geo-fence according to the GPS position information in the geographic location information and the GPS accuracy in the geographic location accuracy, and the GPS location information can be obtained by using the short-distance chip of the electronic device. The short-distance chip is a standard configuration of electronic equipment, so even if the electronic equipment does not have the Wi-Fi fence capability, it can still realize the automatic activation of the corresponding virtual card before the user swipes the card, further improving the user experience.

此外,本申请的方案根据GPS位置信息和GPS精度,动态确定建立的虚拟卡对应的GPS围栏的大小(即动态确定虚拟卡对应的GPS围栏的半径),使得建立的虚拟卡对应的 GPS围栏与其他GPS围栏之间均不存在重叠区域,从而在用户持电子设备到达GPS围栏的范围内时,电子设备可以准确的激活对应的虚拟卡。In addition, the scheme of the present application dynamically determines the size of the GPS fence corresponding to the established virtual card (that is, dynamically determines the radius of the GPS fence corresponding to the virtual card) according to the GPS position information and GPS accuracy, so that the GPS fence corresponding to the established virtual card is the same as There is no overlapping area between other GPS fences, so that when the user reaches the range of the GPS fence with the electronic device, the electronic device can accurately activate the corresponding virtual card.

对应于前述实施例中的方法,本申请实施例还提供一种虚拟卡切换装置。该虚拟卡切换装置可以应用于电子设备,用于实现前述实施例中的方法。该装置的功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的模块。Corresponding to the methods in the preceding embodiments, the embodiments of the present application further provide a virtual card switching device. The device for switching virtual cards can be applied to electronic equipment to implement the methods in the foregoing embodiments. The functions of the device can be realized by hardware, and can also be realized by executing corresponding software by hardware. Hardware or software includes one or more modules corresponding to the above-mentioned functions.

例如,图13示出了一种虚拟卡切换装置1300的结构示意图,如图13所示,该虚拟卡切换装置1300可以包括:获取模块1301、建立模块1302、存储模块1303和激活模块1304 等。For example, FIG. 13 shows a schematic structural diagram of a virtual card switching device 1300. As shown in FIG. 13, the virtual card switching device 1300 may include: an acquisition module 1301, a creation module 1302, a storage module 1303, and an activation module 1304.

获取模块1301,可以用于在电子设备在第一刷卡点首次采用第一虚拟卡完成数据交互的情况下,获取电子设备的第一全球导航卫星系统GNSS位置信息以及第一GNSS精度;第一虚拟卡为多个虚拟卡中的虚拟卡The obtaining module 1301 can be used to obtain the first global navigation satellite system GNSS position information and the first GNSS accuracy of the electronic device when the electronic device uses the first virtual card to complete data interaction at the first card swiping point for the first time; the first virtual card The card is a virtual card among multiple virtual cards

建立模块1302,可以用于根据第一GNSS位置信息,第一GNSS精度,以及第二虚拟卡所对应的第二GNSS围栏,建立第一虚拟卡所对应的第一GNSS围栏;第二虚拟卡是多个虚拟卡中电子设备已建立并存储GNSS围栏的虚拟卡。The establishment module 1302 can be used to establish the first GNSS fence corresponding to the first virtual card according to the first GNSS position information, the first GNSS accuracy, and the second GNSS fence corresponding to the second virtual card; the second virtual card is Among the plurality of virtual cards, the electronic device has established and stored the virtual cards of the GNSS fence.

存储模块1303,可以用于存储第一虚拟卡所对应的第一GNSS围栏。The storage module 1303 may be configured to store the first GNSS fence corresponding to the first virtual card.

激活模块1304,可以用于在电子设备监测到电子设备的位置到达第一GNSS围栏的范围内的情况下,将第一虚拟卡激活。The activation module 1304 may be configured to activate the first virtual card when the electronic device detects that the position of the electronic device is within the range of the first GNSS fence.

在另一种可能的实现方式中,建立模块1302,具有用于建立第一虚拟卡对应的初始 GNSS围栏;初始GNSS围栏为以第一GNSS位置信息为圆心,以预设长度为半径的圆形区域。建立模块1302,还用于在确定初始GNSS围栏与第二GNSS围栏不存在重叠区域的情况下,将初始GNSS围栏作为第一GNSS围栏。In another possible implementation, the establishment module 1302 is configured to establish an initial GNSS fence corresponding to the first virtual card; the initial GNSS fence is a circle with the first GNSS position information as the center and a preset length as the radius area. The establishment module 1302 is further configured to use the initial GNSS fence as the first GNSS fence when it is determined that there is no overlapping area between the initial GNSS fence and the second GNSS fence.

在另一种可能的实现方式中,结合图13,该虚拟卡切换装置1300还可以包括:确定模块1305。确定模块1305,可以用于在确定初始GNSS围栏与第二GNSS围栏中的第三GNSS 围栏存在重叠区域的情况下,根据第一GNSS位置信息、第一GNSS精度、以及建立第三 GNSS围栏时的第二GNSS位置信息和第二GNSS精度,确定第一半径。建立模块1302,具体用于根据第一GNSS位置信息以及第一半径,建立第一GNSS围栏,第一GNSS围栏与第三GNSS围栏不存在重叠区域。In another possible implementation manner, referring to FIG. 13 , the virtual card switching apparatus 1300 may further include: a determining module 1305 . The determination module 1305 can be used to determine that there is an overlapping area between the initial GNSS fence and the third GNSS fence in the second GNSS fence, according to the first GNSS position information, the first GNSS accuracy, and the time when the third GNSS fence is established The second GNSS position information and the second GNSS accuracy determine the first radius. The establishment module 1302 is specifically configured to establish a first GNSS fence according to the first GNSS position information and the first radius, and there is no overlapping area between the first GNSS fence and the third GNSS fence.

在另一种可能的实现方式中,在第二GNSS围栏中与初始GNSS围栏存在重叠区域的第三GNSS围栏为一个的情况下,第一半径为通过如下公式获得:In another possible implementation, in the case where there is one third GNSS fence in the second GNSS fence that overlaps with the initial GNSS fence, the first radius is obtained by the following formula:

Figure BDA0003207551810000301
Figure BDA0003207551810000301

其中,lx为第一半径,cx为第一GNSS精度,cy为第二GNSS精度,l为第一GNSS位置信息与第二GNSS位置信息之间的距离,d为初始GNSS围栏与第三GNSS围栏边界之间的缓冲宽度。Among them, l x is the first radius, c x is the first GNSS accuracy, cy is the second GNSS accuracy, l is the distance between the first GNSS position information and the second GNSS position information, and d is the distance between the initial GNSS fence and the second GNSS position information. Buffer width between three GNSS fence boundaries.

在另一种可能的实现方式中,在第二GNSS围栏中与初始GNSS围栏存在重叠区域的第三GNSS围栏为多个的情况下,第一半径为与多个第三GNSS围栏一一对应的多个lx中最小的lx,lx通过如下公式获得:In another possible implementation, when there are multiple third GNSS fences in the second GNSS fence that overlap with the initial GNSS fence, the first radius corresponds to the multiple third GNSS fences one-to-one. The smallest l x among multiple l x , l x is obtained by the following formula:

Figure BDA0003207551810000302
Figure BDA0003207551810000302

其中,cx为第一GNSS精度,cy为第二GNSS精度,l为第一GNSS位置信息与第二 GNSS位置信息之间的距离,d为初始GNSS围栏与第三GNSS围栏边界之间的缓冲宽度。Among them, c x is the first GNSS accuracy, c y is the second GNSS accuracy, l is the distance between the first GNSS position information and the second GNSS position information, d is the distance between the initial GNSS fence and the third GNSS fence boundary buffer width.

在另一种可能的实现方式中,确定模块1305,还可以用于根据第一GNSS位置信息、第一GNSS精度、第二GNSS位置信息以及第二GNSS精度,确定第二半径;第二半径通过以下公式获得:In another possible implementation, the determination module 1305 can also be used to determine the second radius according to the first GNSS position information, the first GNSS accuracy, the second GNSS position information and the second GNSS accuracy; the second radius is passed The following formula is obtained:

Figure BDA0003207551810000303
Figure BDA0003207551810000303

其中,ly为第二半径,cx为第一GNSS精度,cy为第二GNSS精度,l为第一GNSS位置信息与第二GNSS位置信息之间的距离,d为初始GNSS围栏与第三GNSS围栏边界之间的缓冲宽度。结合图13,该虚拟卡切换装置1300还可以包括:更新模块1306。更新模块 1306,可以用于根据第二GNSS位置信息以及第二半径,更新第三GNSS围栏。Among them, ly is the second radius, c x is the first GNSS accuracy, cy is the second GNSS accuracy, l is the distance between the first GNSS position information and the second GNSS position information, d is the distance between the initial GNSS fence and the second GNSS position information. Buffer width between three GNSS fence boundaries. Referring to FIG. 13 , the device 1300 for switching virtual cards may further include: an updating module 1306 . The update module 1306 may be configured to update the third GNSS fence according to the second GNSS position information and the second radius.

在另一种可能的实现方式中,对于每个第三GNSS围栏,确定模块1305,还可以用于根据第一GNSS位置信息与第二GNSS位置信息之间的距离,第一半径以及初始GNSS围栏与第三GNSS围栏边界之间的缓冲宽度,确定第二半径。更新模块1306,具体用于在第二半径小于第三GNSS围栏原半径的情况下,根据第二GNSS位置信息以及第二半径更新第三GNSS围栏。In another possible implementation, for each third GNSS fence, the determining module 1305 can also be configured to: according to the distance between the first GNSS position information and the second GNSS position information, the first radius and the initial GNSS fence The width of the buffer from the third GNSS fence boundary, which determines the second radius. The update module 1306 is specifically configured to update the third GNSS fence according to the second GNSS position information and the second radius when the second radius is smaller than the original radius of the third GNSS fence.

在另一种可能的实现方式中,预设长度为2千米。In another possible implementation manner, the preset length is 2 kilometers.

在另一种可能的实现方式中,第一虚拟卡具体为多个虚拟卡中预定类型的虚拟卡。In another possible implementation manner, the first virtual card is specifically a virtual card of a predetermined type among the multiple virtual cards.

在另一种可能的实现方式中,GNSS包括全球卫星定位系统GPS、全球导航卫星系统GLONASS,北斗卫星导航系统BDS,准天顶卫星系统QZSS或星基增强系统SBAS。In another possible implementation manner, the GNSS includes the global satellite positioning system GPS, the global navigation satellite system GLONASS, the Beidou satellite navigation system BDS, the quasi-zenith satellite system QZSS or the satellite-based augmentation system SBAS.

应理解以上装置中单元或模块(以下均称为单元)的划分仅仅是一种逻辑功能的划分,实际实现时可以全部或部分集成到一个物理实体上,也可以物理上分开。且装置中的单元可以全部以软件通过处理元件调用的形式实现;也可以全部以硬件的形式实现;还可以部分单元以软件通过处理元件调用的形式实现,部分单元以硬件的形式实现。It should be understood that the division of units or modules (hereinafter referred to as units) in the above device is only a division of logical functions, and may be fully or partially integrated into a physical entity or physically separated during actual implementation. And the units in the device can all be implemented in the form of software called by the processing element; they can also be implemented in the form of hardware; some units can also be implemented in the form of software called by the processing element, and some units can be implemented in the form of hardware.

例如,各个单元可以为单独设立的处理元件,也可以集成在装置的某一个芯片中实现,此外,也可以以程序的形式存储于存储器中,由装置的某一个处理元件调用并执行该单元的功能。此外这些单元全部或部分可以集成在一起,也可以独立实现。这里所述的处理元件又可以称为处理器,可以是一种具有信号的处理能力的集成电路。在实现过程中,上述方法的各步骤或以上各个单元可以通过处理器元件中的硬件的集成逻辑电路实现或者以软件通过处理元件调用的形式实现。For example, each unit can be a separate processing element, or it can be integrated in a certain chip of the device. In addition, it can also be stored in the memory in the form of a program, which is called and executed by a certain processing element of the device. Features. In addition, all or part of these units can be integrated together, or implemented independently. The processing element described here may also be referred to as a processor, and may be an integrated circuit with a signal processing capability. In the process of implementation, each step of the above method or each unit above may be implemented by an integrated logic circuit of hardware in the processor element or implemented in the form of software called by the processing element.

在一个例子中,以上装置中的单元可以是被配置成实施以上方法的一个或多个集成电路,例如:一个或多个ASIC,或,一个或多个DSP,或,一个或者多个FPGA,或这些集成电路形式中至少两种的组合。In one example, the units in the above device may be one or more integrated circuits configured to implement the above method, for example: one or more ASICs, or, one or more DSPs, or, one or more FPGAs, Or a combination of at least two of these integrated circuit forms.

再如,当装置中的单元可以通过处理元件调度程序的形式实现时,该处理元件可以是通用处理器,例如CPU或其它可以调用程序的处理器。再如,这些单元可以集成在一起,以片上系统(system-on-a-chip,SOC)的形式实现。For another example, when the units in the device can be implemented in the form of a processing element scheduler, the processing element can be a general-purpose processor, such as a CPU or other processors that can call programs. For another example, these units can be integrated together and implemented in the form of a system-on-a-chip (SOC).

在一种实现中,以上装置实现以上方法中各个对应步骤的单元可以通过处理元件调度程序的形式实现。例如,该装置可以包括处理元件和存储元件,处理元件调用存储元件存储的程序,以执行以上方法实施例所述的方法。存储元件可以为与处理元件处于同一芯片上的存储元件,即片内存储元件。In one implementation, the units of the above apparatus for implementing each corresponding step in the above method may be implemented in the form of a processing element scheduler. For example, the apparatus may include a processing element and a storage element, and the processing element invokes a program stored in the storage element to execute the methods described in the above method embodiments. The storage element may be a storage element on the same chip as the processing element, that is, an on-chip storage element.

在另一种实现中,用于执行以上方法的程序可以在与处理元件处于不同芯片上的存储元件,即片外存储元件。此时,处理元件从片外存储元件调用或加载程序于片内存储元件上,以调用并执行以上方法实施例所述的方法。In another implementation, the program for executing the above method may be stored in a storage element on a different chip from the processing element, that is, an off-chip storage element. At this point, the processing element invokes or loads a program from the off-chip storage element to the on-chip storage element, so as to invoke and execute the methods described in the above method embodiments.

例如,本申请实施例还可以提供一种装置,如:电子设备,可以包括:处理器,用于存储该处理器可执行指令的存储器。该处理器被配置为执行上述指令时,使得该电子设备实现如前述实施例所述的虚拟卡切换方法。该存储器可以位于该电子设备之内,也可以位于该电子设备之外。且该处理器包括一个或多个。For example, an embodiment of the present application may also provide an apparatus, such as an electronic device, which may include a processor, and a memory configured to store instructions executable by the processor. When the processor is configured to execute the above instructions, the electronic device implements the virtual card switching method as described in the foregoing embodiments. The memory can be located inside the electronic device or outside the electronic device. And the processor includes one or more.

在又一种实现中,该装置实现以上方法中各个步骤的单元可以是被配置成一个或多个处理元件,这些处理元件可以设置于对应上述的电子设备上,这里的处理元件可以为集成电路,例如:一个或多个ASIC,或,一个或多个DSP,或,一个或者多个FPGA,或者这些类集成电路的组合。这些集成电路可以集成在一起,构成芯片。In yet another implementation, the unit of the apparatus that implements each step in the above method may be configured as one or more processing elements, and these processing elements may be set on the corresponding electronic equipment described above, where the processing elements may be integrated circuits , for example: one or more ASICs, or one or more DSPs, or one or more FPGAs, or a combination of these types of integrated circuits. These integrated circuits can be integrated together to form a chip.

例如,本申请实施例还提供一种芯片,该芯片可以应用于上述电子设备。芯片包括一个或多个接口电路和一个或多个处理器;接口电路和处理器通过线路互联;处理器通过接口电路从电子设备的存储器接收并执行计算机指令,以实现以上方法实施例中所述的方法。For example, an embodiment of the present application further provides a chip, and the chip can be applied to the above-mentioned electronic device. The chip includes one or more interface circuits and one or more processors; the interface circuits and processors are interconnected through lines; the processor receives and executes computer instructions from the memory of the electronic device through the interface circuits, so as to implement the method described in the above embodiment Methods.

本申请实施例还提供一种计算机程序产品,包括如上述电子设备运行的计算机指令。An embodiment of the present application further provides a computer program product, including computer instructions for running the above-mentioned electronic device.

通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of the description, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned functions can be allocated according to needs It is completed by different functional modules, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.

在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be Incorporation or may be integrated into another device, or some features may be omitted, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The unit described as a separate component may or may not be physically separated, and the component displayed as a unit may be one physical unit or multiple physical units, that is, it may be located in one place, or may be distributed to multiple different places . Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,如:程序。该软件产品存储在一个程序产品,如计算机可读存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on such an understanding, the essence of the technical solutions of the embodiments of the present application or the part that contributes to the prior art, or all or part of the technical solutions can be embodied in the form of software products, such as programs. The software product is stored in a program product, such as a computer-readable storage medium, and includes several instructions to make a device (which may be a single-chip microcomputer, a chip, etc.) or a processor (processor) execute all of the methods described in various embodiments of the present application. or partial steps. The aforementioned storage medium includes: various media capable of storing program codes such as U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk.

例如,本申请实施例还可以提供一种计算机可读存储介质,其上存储有计算机程序指令。当计算机程序指令被电子设备执行时,使得电子设备实现如前述方法实施例中所述的虚拟卡切换方法。For example, the embodiments of the present application may also provide a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by the electronic device, the electronic device is made to implement the virtual card switching method described in the foregoing method embodiments.

以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above is only a specific implementation of the application, but the protection scope of the application is not limited thereto, and any changes or replacements within the technical scope disclosed in the application should be covered within the protection scope of the application . Therefore, the protection scope of the present application should be determined by the protection scope of the claims.

Claims (10)

1.一种虚拟卡切换方法,其特征在于,应用于电子设备,所述电子设备具备近场通信NFC功能,所述电子设备包括多个虚拟卡,所述方法包括:1. A virtual card switching method, characterized in that it is applied to an electronic device, the electronic device has a near-field communication NFC function, and the electronic device includes a plurality of virtual cards, and the method comprises: 在所述电子设备在第一刷卡点首次采用第一虚拟卡完成数据交互的情况下,所述电子设备获取所述电子设备的第一全球导航卫星系统GNSS位置信息以及第一GNSS精度;所述第一虚拟卡为所述多个虚拟卡中的虚拟卡;When the electronic device uses the first virtual card to complete data interaction for the first time at the first card swiping point, the electronic device acquires the first GNSS position information and the first GNSS accuracy of the electronic device; The first virtual card is a virtual card in the plurality of virtual cards; 所述电子设备建立所述第一虚拟卡对应的初始GNSS围栏;所述初始GNSS围栏为以所述第一GNSS位置信息为圆心,以预设长度为半径的圆形区域;The electronic device establishes an initial GNSS fence corresponding to the first virtual card; the initial GNSS fence is a circular area with the first GNSS position information as the center and a preset length as the radius; 在所述电子设备确定所述初始GNSS围栏与第二虚拟卡所对应的第二GNSS围栏不存在重叠区域的情况下,所述电子设备将所述初始GNSS围栏作为所述第一GNSS围栏,所述第二虚拟卡是所述多个虚拟卡中所述电子设备已建立并存储GNSS围栏的虚拟卡;When the electronic device determines that there is no overlapping area between the initial GNSS fence and the second GNSS fence corresponding to the second virtual card, the electronic device uses the initial GNSS fence as the first GNSS fence, so The second virtual card is a virtual card for which the electronic device has established and stored a GNSS fence among the plurality of virtual cards; 在所述电子设备确定所述初始GNSS围栏与所述第二GNSS围栏中的第三GNSS围栏存在重叠区域的情况下,所述电子设备根据所述第一GNSS位置信息、所述第一GNSS精度、以及建立所述第三GNSS围栏时的第二GNSS位置信息和第二GNSS精度,确定第一半径;When the electronic device determines that there is an overlapping area between the initial GNSS fence and the third GNSS fence in the second GNSS fence, the electronic device according to the first GNSS position information, the first GNSS accuracy , and the second GNSS position information and the second GNSS accuracy when establishing the third GNSS fence, determine the first radius; 所述电子设备根据所述第一GNSS位置信息以及所述第一半径,建立所述第一GNSS围栏,所述第一GNSS围栏与所述第三GNSS围栏不存在重叠区域;The electronic device establishes the first GNSS fence according to the first GNSS position information and the first radius, and there is no overlapping area between the first GNSS fence and the third GNSS fence; 所述电子设备存储所述第一虚拟卡所对应的第一GNSS围栏;The electronic device stores a first GNSS fence corresponding to the first virtual card; 在所述电子设备监测到所述电子设备的位置到达所述第一GNSS围栏的范围内的情况下,所述电子设备将所述第一虚拟卡激活。When the electronic device monitors that the position of the electronic device reaches the range of the first GNSS fence, the electronic device activates the first virtual card. 2.根据权利要求1所述的方法,其特征在于,在所述第二GNSS围栏中与所述初始GNSS围栏存在重叠区域的所述第三GNSS围栏为一个的情况下,所述第一半径通过如下公式获得:2. The method according to claim 1, wherein, in the case where there is one third GNSS fence in the second GNSS fence that overlaps with the initial GNSS fence, the first radius Obtained by the following formula:
Figure 664276DEST_PATH_IMAGE001
Figure 664276DEST_PATH_IMAGE001
;
其中,
Figure 7533DEST_PATH_IMAGE002
为所述第一半径,
Figure 649867DEST_PATH_IMAGE003
为所述第一GNSS精度,
Figure 394969DEST_PATH_IMAGE004
为所述第二GNSS精度,l为所述 第一GNSS位置信息与所述第二GNSS位置信息之间的距离,d为所述初始GNSS围栏与所述第 三GNSS围栏边界之间的缓冲宽度。
in,
Figure 7533DEST_PATH_IMAGE002
is the first radius,
Figure 649867DEST_PATH_IMAGE003
is the first GNSS accuracy,
Figure 394969DEST_PATH_IMAGE004
is the second GNSS accuracy, l is the distance between the first GNSS position information and the second GNSS position information, and d is the buffer width between the initial GNSS fence and the third GNSS fence boundary .
3.根据权利要求2所述的方法,其特征在于,在所述第二GNSS围栏中与所述初始GNSS围栏存在重叠区域的所述第三GNSS围栏为多个的情况下,所述第一半径为与多个所述第三GNSS围栏一一对应的多个lx中最小的lx,lx通过如下公式获得:3. The method according to claim 2, wherein, in the case where there are multiple third GNSS fences that overlap with the initial GNSS fence in the second GNSS fence, the first The radius is the smallest lx among the plurality of lx corresponding to a plurality of the third GNSS fences one-to-one, and lx is obtained by the following formula:
Figure 346614DEST_PATH_IMAGE005
Figure 346614DEST_PATH_IMAGE005
;
其中,
Figure 177166DEST_PATH_IMAGE006
为所述第一GNSS精度,
Figure 623191DEST_PATH_IMAGE007
为所述第二GNSS精度,l为所述第一GNSS位置信息 与所述第二GNSS位置信息之间的距离,d为所述初始GNSS围栏与所述第三GNSS围栏边界之 间的缓冲宽度。
in,
Figure 177166DEST_PATH_IMAGE006
is the first GNSS accuracy,
Figure 623191DEST_PATH_IMAGE007
is the second GNSS accuracy, l is the distance between the first GNSS position information and the second GNSS position information, and d is the buffer width between the initial GNSS fence and the third GNSS fence boundary .
4.根据权利要求3所述的方法,其特征在于,所述方法还包括:4. method according to claim 3, is characterized in that, described method also comprises: 所述电子设备根据所述第一GNSS位置信息、所述第一GNSS精度、所述第二GNSS位置信息以及第二GNSS精度,确定第二半径;The electronic device determines a second radius according to the first GNSS position information, the first GNSS accuracy, the second GNSS position information, and the second GNSS accuracy; 所述电子设备根据所述第二GNSS位置信息以及所述第二半径,更新所述第三GNSS围栏;The electronic device updates the third GNSS fence according to the second GNSS position information and the second radius; 所述第二半径通过以下公式获得:The second radius is obtained by the following formula:
Figure 957220DEST_PATH_IMAGE008
Figure 957220DEST_PATH_IMAGE008
;
其中,
Figure 830499DEST_PATH_IMAGE009
为所述第二半径,
Figure 148347DEST_PATH_IMAGE010
为所述第一GNSS精度,
Figure 132484DEST_PATH_IMAGE011
为所述第二GNSS精度,l为所述 第一GNSS位置信息与所述第二GNSS位置信息之间的距离,d为所述初始GNSS围栏与所述第 三GNSS围栏边界之间的缓冲宽度。
in,
Figure 830499DEST_PATH_IMAGE009
is the second radius,
Figure 148347DEST_PATH_IMAGE010
is the first GNSS accuracy,
Figure 132484DEST_PATH_IMAGE011
is the second GNSS accuracy, l is the distance between the first GNSS position information and the second GNSS position information, and d is the buffer width between the initial GNSS fence and the third GNSS fence boundary .
5.根据权利要求4所述的方法,其特征在于,对于每个所述第三GNSS围栏,所述方法还包括:5. The method according to claim 4, wherein, for each of the third GNSS fences, the method further comprises: 所述电子设备根据所述第一GNSS位置信息与所述第二GNSS位置信息之间的距离,所述第一半径以及所述初始GNSS围栏与所述第三GNSS围栏边界之间的缓冲宽度,确定第二半径;The electronic device according to the distance between the first GNSS position information and the second GNSS position information, the first radius and the buffer width between the initial GNSS fence and the third GNSS fence boundary, Determine the second radius; 在所述第二半径小于所述第三GNSS围栏原半径的情况下,所述电子设备根据所述第二GNSS位置信息以及所述第二半径更新所述第三GNSS围栏。When the second radius is smaller than the original radius of the third GNSS fence, the electronic device updates the third GNSS fence according to the second GNSS position information and the second radius. 6.根据权利要求1所述的方法,其特征在于,所述预设长度为2千米。6. The method according to claim 1, wherein the preset length is 2 kilometers. 7.根据权利要求1-6中任一项所述的方法,其特征在于,所述第一虚拟卡具体为所述多个虚拟卡中预定类型的虚拟卡。7. The method according to any one of claims 1-6, wherein the first virtual card is specifically a virtual card of a predetermined type among the plurality of virtual cards. 8.根据权利要求1-6中任一项所述的方法,其特征在于,所述GNSS包括全球卫星定位系统GPS、全球导航卫星系统GLONASS,北斗卫星导航系统BDS,准天顶卫星系统QZSS或星基增强系统SBAS。8. according to the method described in any one in claim 1-6, it is characterized in that, described GNSS comprises global satellite positioning system GPS, global navigation satellite system GLONASS, Beidou satellite navigation system BDS, quasi-zenith satellite system QZSS or Satellite Based Augmentation System SBAS. 9.一种电子设备,其特征在于,所述电子设备包括处理器,用于存储所述处理器可执行指令的存储器;所述处理器被配置为执行所述指令时,使得所述电子设备实现如权利要求1至8中任一项所述的方法。9. An electronic device, characterized in that the electronic device comprises a processor, a memory for storing instructions executable by the processor; when the processor is configured to execute the instructions, the electronic device Implementing the method according to any one of claims 1 to 8. 10.一种计算机可读存储介质,其上存储有计算机程序指令;其特征在于,10. A computer-readable storage medium on which computer program instructions are stored; it is characterized in that, 当所述计算机程序指令被电子设备执行时,使得电子设备实现如权利要求1至8中任一项所述的方法。When the computer program instructions are executed by the electronic device, the electronic device is made to implement the method according to any one of claims 1-8.
CN202110921394.4A 2021-08-11 2021-08-11 A virtual card switching method and electronic equipment Active CN114449446B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110921394.4A CN114449446B (en) 2021-08-11 2021-08-11 A virtual card switching method and electronic equipment
PCT/CN2022/089662 WO2023015962A1 (en) 2021-08-11 2022-04-27 Virtual card switching method and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110921394.4A CN114449446B (en) 2021-08-11 2021-08-11 A virtual card switching method and electronic equipment

Publications (2)

Publication Number Publication Date
CN114449446A CN114449446A (en) 2022-05-06
CN114449446B true CN114449446B (en) 2023-01-10

Family

ID=81362587

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110921394.4A Active CN114449446B (en) 2021-08-11 2021-08-11 A virtual card switching method and electronic equipment

Country Status (2)

Country Link
CN (1) CN114449446B (en)
WO (1) WO2023015962A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116703391B (en) * 2022-09-23 2024-04-26 荣耀终端有限公司 Electronic card activation method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110381443A (en) * 2019-09-05 2019-10-25 北京小米移动软件有限公司 Near-field communication card Activiation method and device
WO2020121063A1 (en) * 2018-12-11 2020-06-18 Orange Method for operating a device for selecting a virtual card in a digital wallet
CN111447557A (en) * 2020-04-07 2020-07-24 广东小天才科技有限公司 Method, server, mobile terminal and system for controlling switching of NFC analog card
CN113163326A (en) * 2021-04-09 2021-07-23 Oppo广东移动通信有限公司 Multi-NFC card selection method and device, electronic equipment and storage medium

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8768565B2 (en) * 2012-05-23 2014-07-01 Enterprise Holdings, Inc. Rental/car-share vehicle access and management system and method
US10237232B2 (en) * 2014-07-29 2019-03-19 GeoFrenzy, Inc. Geocoding with geofences
WO2016054169A1 (en) * 2014-09-30 2016-04-07 Apple Inc. Recommendation of payment credential to be used based on merchant information
CN106162542B (en) * 2015-04-14 2020-08-14 阿里巴巴集团控股有限公司 Electronic certificate prompting method and server
US11363412B2 (en) * 2016-02-02 2022-06-14 Huawei Technologies, Co. Ltd. Movement track recording method and apparatus
US10410232B1 (en) * 2016-07-08 2019-09-10 Harold Lueken Systems and methods for prioritizing default payment options in virtual wallets
KR102663615B1 (en) * 2016-12-09 2024-05-08 삼성전자 주식회사 Am unmanned aerial vehicle and Method for re-setting Geofence region of the same using an electronic appatatus
CN109859514B (en) * 2018-12-28 2021-09-03 北方信息控制研究院集团有限公司 Bus entrance and exit judgment method based on bus stop electronic fence
WO2020148658A2 (en) * 2019-01-18 2020-07-23 Rathod Yogesh Methods and systems for displaying on map current or nearest and nearby or searched and selected location(s), geo-fence(s), place(s) and user(s) and identifying associated payments and account information for enabling to make and receive payments
CN111194006B (en) * 2020-01-02 2021-06-29 西安广和通无线软件有限公司 Dynamic geo-fence generation method and device, computer equipment and storage medium
CN111432339A (en) * 2020-03-19 2020-07-17 RealMe重庆移动通信有限公司 Near field communication card switching method and device, storage medium and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020121063A1 (en) * 2018-12-11 2020-06-18 Orange Method for operating a device for selecting a virtual card in a digital wallet
CN110381443A (en) * 2019-09-05 2019-10-25 北京小米移动软件有限公司 Near-field communication card Activiation method and device
CN111447557A (en) * 2020-04-07 2020-07-24 广东小天才科技有限公司 Method, server, mobile terminal and system for controlling switching of NFC analog card
CN113163326A (en) * 2021-04-09 2021-07-23 Oppo广东移动通信有限公司 Multi-NFC card selection method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
WO2023015962A1 (en) 2023-02-16
CN114449446A (en) 2022-05-06

Similar Documents

Publication Publication Date Title
EP3996358B1 (en) Display method for foldable electronic device, and electronic device
CN113596810B (en) Network system switching method based on double cards and terminal equipment
WO2022247571A1 (en) Method for switching virtual card, and electronic device
US10299210B2 (en) Method and apparatus for reducing power consumption of electronic device
WO2022083551A1 (en) Emulation card switching method, electronic device, and communication system
CN111124503B (en) Automatic activation method of NFC application and terminal
CN113794801A (en) Method and device for processing geo-fence
US10548178B2 (en) Method and device for establishing communication connection
CN113242349B (en) Data transmission method, electronic equipment and storage medium
CN113766468B (en) Smart card sharing method, electronic device and computer readable storage medium
CN113573239B (en) Virtual card switching method, electronic equipment and wearable equipment
CN118872298A (en) A message transmission method and corresponding terminal
CN119906715A (en) Method, device, equipment and storage medium for synchronizing navigation tasks across devices
WO2023015962A1 (en) Virtual card switching method and electronic device
CN115623118A (en) A near-field communication control method and electronic equipment
CN116346976A (en) A multi-screen unlocking method and electronic device
CN115134453B (en) A method for displaying riding information and electronic equipment
CN114501316B (en) A virtual card switching method and electronic equipment
CN113766050B (en) Fingerprint input method and electronic equipment
WO2023179751A9 (en) Object searching method, system and electronic device
CN106125985B (en) A kind of control method and terminal
CN114338642B (en) File transmission method and electronic equipment
CN114860820A (en) Optimization method and device for technical business of data warehouse and electronic equipment
CN116437293B (en) Geofence establishment method, server and communication system
CN117979263A (en) Near field communication service management method and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040

Patentee after: Honor Terminal Co.,Ltd.

Country or region after: China

Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong

Patentee before: Honor Device Co.,Ltd.

Country or region before: China