An NFC card switching method, apparatus, device and medium
By establishing a mapping relationship between NFC cards and usage locations, and combining wireless network and Bluetooth beacon signals for multi-source fusion positioning decisions, the accuracy and cumbersome operation issues of NFC card switching in indoor and outdoor scenarios are solved, achieving high-precision and reliable automated card switching.
Patent Information
- Application Number
- CN202611221020.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-12
- Publication Date
- 2026-11-17
AI Technical Summary
Existing NFC card switching technology has low accuracy in indoor and outdoor scenarios and is cumbersome to operate, failing to meet the automated interaction needs of modern smart devices.
By establishing a mapping relationship between NFC cards and usage locations, configuring geofence areas, and combining the wireless network signals and Bluetooth beacon signals of mobile terminals to perform multi-source fusion positioning decisions, the system automatically switches to the target NFC card and implements retry and backup strategies when the switching fails.
It significantly improves the accuracy of target location recognition in indoor and outdoor scenarios and the accuracy and reliability of NFC card switching, ensuring automated and convenient operation in different scenarios.
Smart Images

Figure CN123123864A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to an NFC card switching method, apparatus, device, and medium. Background Technology
[0002] With the widespread application of Near Field Communication (NFC) technology on mobile terminals, users often need to manage multiple virtual cards (such as access cards, public transport cards, etc.) to meet the card-swiping needs of different locations. Currently, when users switch between using NFC cards in different locations, they mainly rely on manual operation to select the corresponding card on the mobile terminal. This method is inefficient and cumbersome in scenarios with frequent switching, and cannot meet the needs of modern smart devices for automated interaction.
[0003] In existing technologies, some solutions attempt to use a single sensing method (such as relying solely on the Global Positioning System (GPS)) for location identification to assist in card switching. However, GPS signals weaken or become unavailable in indoor environments, resulting in insufficient positioning accuracy. Other solutions use wireless networks (Wi-Fi) or Bluetooth beacons for location identification, but lack a multi-source fusion positioning decision mechanism based on multimodal data. This makes them prone to misjudgments due to signal interference or environmental changes. Furthermore, they lack effective retry and degradation strategies, and the system cannot automatically recover when switching fails. Overall identification accuracy and operational reliability are limited, resulting in lower accuracy during NFC smart switching. Summary of the Invention
[0004] This invention provides an NFC card switching method, apparatus, device, and medium to solve the technical problem of low accuracy during NFC card switching.
[0005] Firstly, an NFC card switching method is provided, including: Identify the locations where target users use NFC cards, construct a mapping relationship between the locations and the NFC cards, and configure the geofence area corresponding to the locations. Identify the real-time geographic coordinates of the target user's mobile terminal; when the real-time geographic coordinates are within the geofence area, scan the wireless network signal of the mobile terminal. The real-time area information of the target user is determined based on the wireless network signal. When the real-time area information is within any target sub-area of the geofence area, the Bluetooth beacon signal of the mobile terminal is scanned. The geofence area is pre-divided into multiple target sub-areas according to different NFC cards. Multi-source fusion positioning decision is performed on the geofence area, the wireless network signal and the Bluetooth beacon signal to obtain the target location of the target user; The target NFC card corresponding to the target location is identified using the mapping relationship, and the preset default card is switched to the target NFC card.
[0006] Secondly, an NFC card switching device is provided, comprising: The mapping relationship construction module is used to identify the location where the target user uses the NFC card, construct the mapping relationship between the location and the NFC card, and configure the geofence area corresponding to the location. A wireless network signal scanning module is used to identify the real-time geographic coordinates of a target user's mobile terminal. When the real-time geographic coordinates are within the geofence area, the module scans the wireless network signal of the mobile terminal. The Bluetooth beacon signal scanning module is used to determine the real-time area information of the target user based on the wireless network signal. When the real-time area information is within any target sub-area of the geofence area, the module scans the Bluetooth beacon signal of the mobile terminal. The geofence area is pre-divided into multiple target sub-areas based on different NFC cards. The target location determination module is used to perform multi-source fusion positioning decision on the geofence area, the wireless network signal and the Bluetooth beacon signal to obtain the target location of the target user. The card switching module is used to identify the target NFC card corresponding to the target location using the mapping relationship, and switch the preset default card to the target NFC card.
[0007] Thirdly, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described NFC card switching method.
[0008] Fourthly, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the steps of the above-described NFC card switching method.
[0009] In the aforementioned NFC card switching method, apparatus, device, and medium, the location of the mobile terminal can be obtained by constructing a mapping relationship between the NFC card and the usage location and configuring a geofence. Within the geofence, wireless network signals are scanned to initially confirm the area, and then Bluetooth beacon signals are scanned for precise positioning. Finally, the target location is determined through multi-source fusion positioning decision-making, and the corresponding NFC card is automatically switched. If the switching fails, a retry is performed. After multiple failures, a backup strategy is triggered to force a switch. In this invention, multi-level positioning fusion (geofence, Wi-Fi, Bluetooth) significantly improves the accuracy of target location identification in indoor and outdoor scenarios, ensuring the accuracy and scenario adaptability of NFC card switching. At the same time, the introduction of retry and backup mechanisms effectively ensures the reliability of switching and further improves the accuracy of NFC smart switching. Attached Figure Description
[0010] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 This is a schematic diagram of an application environment for an NFC card switching method according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating an NFC card switching method according to an embodiment of the present invention; Figure 3 yes Figure 2 A flowchart illustrating the real-time geographic coordinate identification process in step S2. Figure 4 yes Figure 2 A flowchart illustrating the card switching process in step S5. Figure 5 This is a schematic diagram of the structure of an NFC card switching device in one embodiment of the present invention; Figure 6 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention; Figure 7 This is another structural schematic diagram of a computer device according to one embodiment of the present invention. Detailed Implementation
[0012] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0013] The NFC card switching method provided in this embodiment of the invention can be applied to, for example... Figure 1 In this application environment, the client communicates with the server via a network. The server can construct a mapping relationship between the NFC card and the usage location through the client and configure a geofence to obtain the mobile terminal's location. Within the geofence, it scans wireless network signals to initially confirm the area, and then further scans Bluetooth beacon signals for precise positioning. Finally, it determines the target location through multi-source fusion positioning decision-making and automatically switches to the corresponding NFC card. If the switch fails, it retryes. After multiple failures, a backup strategy is triggered to force a switch. In this invention, multi-level positioning fusion (geofence, Wi-Fi, Bluetooth) significantly improves the accuracy of target location identification in indoor and outdoor scenarios, ensuring the accuracy and scenario adaptability of NFC card switching. At the same time, the introduction of retry and backup mechanisms effectively guarantees the reliability of switching and further improves the accuracy of NFC smart switching. The client can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster composed of multiple servers. The invention will be described in detail below through specific embodiments.
[0014] Please see Figure 2 As shown, Figure 2 A flowchart illustrating the NFC card switching method provided in this embodiment of the invention includes the following steps: S1. Identify the location where the target user uses the NFC card, construct a mapping relationship between the location and the NFC card, and configure the geofence area corresponding to the location.
[0015] In this embodiment of the invention, the usage location is the specific physical location where the target user actually uses the NFC card to complete operations such as identity verification, access control, or payment. The usage location of the target user for the NFC card can be obtained from the storage area that stores the usage location in advance through computer statements with data capture capabilities (such as Java statements, Python statements, etc.).
[0016] In this embodiment of the invention, the mapping relationship is a stable association established between the location of use and the corresponding NFC card.
[0017] In this embodiment of the invention, constructing the mapping relationship between the usage location and the NFC card includes: Determine whether the location of use is the same as the previously obtained historical locations of use; When the location of use is the same as the historical location of use, a first location identifier corresponding to the location of use is identified, and a hash index is constructed for the location identifier; The first location identifier for constructing the hash index, the location of use, and the NFC card are mapped to obtain a mapping relationship; When the location of use is different from the historical location of use, obtain the union of the geographical locations of the location of use and the historical location of use, identify the second location identifier corresponding to the union of the geographical locations, and construct a hash index for the location identifier; The second location identifier for constructing the hash index, the union of the geographical locations, and the NFC card are mapped to obtain the mapping relationship.
[0018] In detail, historical usage locations are data collected by the system in the early stages or configured and stored by the user, containing multimodal feature information corresponding to that location. A comprehensive comparison is performed between the multimodal features of the current usage location and those of historical usage locations. These multimodal features include core information such as GPS coordinates, Wi-Fi SSID and BSSID, and Bluetooth beacon UUID. For example, if the user's current usage location has GPS coordinates of 39.98, 116.32 and Wi-Fi SSID of Corp-WiFi-5G, and a historical usage location record exists with GPS coordinates of 39.98, 116.31 and Wi-Fi SSID of Corp-WiFi-5G, feature comparison determines whether the two are identical, thus avoiding duplicate location configurations and reducing redundant data in the mapping relationship.
[0019] Specifically, since usage locations may have slight positional discrepancies but still belong to the same area, judging solely by similarity cannot cover such scenarios; therefore, feature similarity calculation is necessary. The cosine similarity algorithm is used to calculate feature similarity, quantifying features such as GPS coordinate deviation, Wi-Fi SSID matching degree, and Bluetooth beacon UUID consistency into feature vectors. Similarity is calculated by the angle between these vectors. For example, if the current usage location has a GPS coordinate deviation of 10 meters from a historical usage location, a perfect match in Wi-Fi SSID, and the same Bluetooth beacon UUID, the calculated feature similarity is 0.85. This allows for the identification and classification of similar usage locations, ensuring the simplicity and accuracy of the mapping relationship.
[0020] In this embodiment of the invention, when the feature similarity is greater than a threshold (e.g., 0.8), it is determined that the two locations belong to the same usage scenario. A classification operation is then performed to generate a geographic location union region, such as taking the arithmetic mean of GPS coordinates; deduplicating Wi-Fi SSID and Bluetooth UUID by taking the geographic location union region; and using a preset rule (e.g., taking the common prefix) for the location name corresponding to the geographic location union region. For example, classifying "Company Lobby" (GPS: 39.98, 116.32) and "Company Tea Room" (GPS: 39.97, 116.31) yields the target location "Company" (GPS: 39.975, 116.315).
[0021] The geographic location union area is the area where the target usage location and the historical usage location are geographically merged, thereby ensuring the uniqueness of location information in the mapping relationship.
[0022] In this embodiment of the invention, the location identifier is a name or code used to uniquely identify the location of use. It is user-defined or automatically generated by the system based on location characteristics, such as "company" or "residential community entrance". A hash index is constructed using the MD5 hash algorithm to convert the location identifier into a fixed-length hash value, and an association mapping table is established between the hash value, the location identifier, and the corresponding NFC card. For example, the hash value corresponding to the location identifier "company" is hash-001, associated with the NFC card card_001. The association data table binds and stores the location identifier corresponding to the hash index, the multimodal feature data of the location of use, and the NFC card information, forming a complete mapping relationship. For example, the hash value hash-001 corresponds to the location identifier "company", the location features (GPS 39.98, 116.32, Wi-Fi Corp-WiFi-5G, Beacon UUID-001), and the NFC card card_001.
[0023] Furthermore, a geofence is a virtual geographical boundary defined around the location of use. After establishing the mapping relationship, the geofence needs to be configured because only by clearly defining the geographical extent of the location can subsequent identification operations be triggered when a user enters that area. The geofence is set via Android LocationManager, creating a circular area with a radius of 100 meters based on the GPS coordinates of the location. This radius setting takes into account both outdoor positioning accuracy and the needs of actual usage scenarios, ensuring accurate detection when the user approaches the location.
[0024] S2. Identify the real-time geographic coordinates of the target user's mobile terminal. When the real-time geographic coordinates are within the geographic fence area, scan the wireless network signal of the mobile terminal.
[0025] In this embodiment of the invention, the real-time geographic coordinates are the current latitude and longitude coordinates obtained by the mobile terminal through the positioning module.
[0026] In the embodiments of the present invention, see Figure 3 As shown, the real-time geographic coordinates of the mobile terminal used to identify the target user include: S31. Generate an activity pattern profile of the target user based on the target user's historical location patterns at different time periods, and determine the scanning strategy of the target user based on the activity pattern profile; S32. Obtain the motion state of the target user, and adjust the scanning frequency in the scanning strategy based on the motion state; S33. Scan the target user's mobile terminal according to the adjusted scanning frequency to obtain the real-time geographical coordinates of the mobile terminal.
[0027] In detail, historical location patterns are the location distribution data of target users recorded by the system over a period of time over a past period. By statistically analyzing the stability of users' locations in each time period, an activity pattern profile is generated. For example, it is found that users are at the company from 9:00 to 18:00 on weekdays, with their locations concentrated around 39.98 and 116.32, which belongs to a fixed location period; from 19:00 to 7:00 the next day, they are at home, and at other times they are commuting or going out, which is a continuously changing state, belonging to a mobile location period.
[0028] In this embodiment of the invention, differentiated scanning strategies are formulated based on activity pattern profiles. For example, during fixed location periods (such as at home or in the office): low-frequency scanning (e.g., scanning once every 5 minutes via Wi-Fi / BLE) is used because the user's location is relatively stable; during mobile location periods (such as commuting or going out): high-frequency scanning (e.g., once every 30 seconds) is used to cope with rapid changes in location; during late-night sleep periods: ultra-low power mode is entered, only GPS geofence monitoring is retained, and Wi-Fi and BLE scanning are completely suspended to avoid power waste or positioning lag caused by fixed frequencies.
[0029] Specifically, the phone's built-in activity recognition coprocessor (such as Android's Activity Recognition API) is used to determine motion status in real time, categorizing it into stationary and moving states. When the motion state is STILL, the scanning frequency of all sensors is significantly reduced. When the motion state changes to WALKING or IN_VEHICLE (walking or inside a vehicle), the sensors are immediately activated, the scanning frequency is increased, and preparation for location recognition is made. Geofence triggering: When GPS detects that a user has entered or left a large geofence (e.g., from home to the office), a high-intensity multimodal environmental awareness scan is immediately triggered for accurate positioning. For example, when a user is stationary at a fixed location for a period of time, the scanning frequency is maintained at 5 minutes per scan; if user movement is detected, the scanning frequency is immediately adjusted to an update scan frequency of 1 minute per scan. If a user is stationary in the office at 10:00 AM on a weekday, a scan is performed every 5 minutes; if the user gets up and moves at 11:30 AM, the scanning frequency automatically adjusts to 1 minute per scan, thereby maximizing power saving while ensuring positioning accuracy.
[0030] Furthermore, the mobile terminal acquires real-time geographic coordinates via its GPS module at an adjusted frequency: GPS coordinates are collected every 5 minutes during fixed location periods and every minute during mobile location periods. For example, coordinates are collected once each at 10:00, 10:05, and 10:10 during fixed location periods, and once each at 18:00, 18:01, and 18:02 during mobile location periods. The collected coordinate data is transmitted to the system in real time for subsequent analysis.
[0031] Furthermore, after identifying real-time geographic coordinates, it's necessary to determine if the device is within a geofence. If the real-time geographic coordinates are outside the geofence, the system maintains the current NFC card configuration and does not trigger subsequent wireless network signal scanning. At this point, the system enters a low-power monitoring mode, continuously monitoring device location changes through the mobile terminal's location services, but suspending high-frequency environmental awareness scanning operations. This effectively avoids unnecessary signal scanning and data processing in irrelevant areas, significantly reducing system power consumption while ensuring system stability and resource utilization efficiency when the user does not enter the preset key area. Since the corresponding NFC card may only be needed when the user enters the geofence corresponding to the usage location, scanning the wireless network signal at this time can further refine the positioning, providing a basis for subsequent area determination and avoiding unnecessary scanning outside the geofence that consumes power. The wireless network signal refers to the SSID and BSSID information of the detectable Wi-Fi networks around the mobile terminal.
[0032] S3. Determine the real-time area information of the target user based on the wireless network signal. When the real-time area information is within any target sub-area of the geofence area, scan the Bluetooth beacon signal of the mobile terminal. The geofence area is pre-divided into multiple target sub-areas according to different NFC cards.
[0033] In this embodiment of the invention, the real-time area information is the specific area range where the user is currently located (such as "the east area of the 3rd floor of a shopping mall" or "the lobby of Building B of an office building") determined based on the wireless network signal. Within the geofence area, specific functional areas are further identified to support fine-grained switching of NFC cards. The target sub-area is the wireless network coverage area range associated with the location of use.
[0034] In detail, the SSID and BSSID of the scanned Wi-Fi are extracted and matched with the Wi-Fi information corresponding to the location in the mapping relationship. For example, if the scanned Wi-Fi SSID is Corp-WiFi-5G and the BSSID is AA:BB:CC:DD:EE:FF, which matches the Wi-Fi information corresponding to the "company" location, the real-time area information is determined to be the company area. The target sub-area is the effective coverage area of the Wi-Fi signal, typically an office building floor or a specific area.
[0035] Specifically, when the real-time area information is not within any target sub-region, the system will terminate the further execution of the current environmental perception process and will not initiate the scanning operation of Bluetooth beacon signals. At this time, the system retains the preliminary location judgment result obtained based on wireless network signal identification, but will not use it as the final decision-making basis. This prevents resource consumption caused by high-precision Bluetooth scanning in non-target sub-regions, while maintaining geofence-level monitoring to ensure basic location perception capabilities and retaining the flexibility to re-trigger the complete perception process for possible subsequent location changes. When the real-time area information is within any target sub-region of the geofence, the Bluetooth scanning module is activated to scan for Bluetooth beacon signals. Bluetooth beacon signals are wireless signals sent by Bluetooth beacon devices that contain UUID and RSSI information. Bluetooth beacon signals offer higher positioning accuracy, achieving precise positioning within 1-10 meters indoors, supplementing the insufficient accuracy of Wi-Fi positioning. Using Wi-Fi signals for medium-precision area judgment provides the triggering condition for Bluetooth beacon scanning, improving indoor positioning accuracy.
[0036] Specifically, the system collects the target user's geographic location through layered data collection. The first layer (permanent): GPS GeoFence, serving as the most basic fallback solution. While consuming significant power, it has a wide range and continuously monitors whether the device enters a large geofenced area (e.g., a 1km radius around a company campus). Once inside, the second layer of sensing is activated. The second layer (on-demand): Wi-Fi scanning. When GPS determines the device has entered a large area, it initiates periodic Wi-Fi scans (e.g., every 30 seconds) for medium-precision positioning to determine if the user has entered a more specific area (e.g., an office building). The third layer (precise): BLE Beacon scanning. When Wi-Fi identifies the user as being inside a specific building, or based on user habits at a specific time / location, it initiates a high-precision BLE scan to ultimately confirm the specific location (e.g., the company reception area, office entrance).
[0037] Furthermore, Wi-Fi signal positioning provides medium-precision identification, which cannot meet the requirements for precise indoor positioning. Bluetooth beacon signals, on the other hand, have higher positioning accuracy. Therefore, after determining that the user is in any target sub-region within the geofence area, scanning Bluetooth beacon signals can further narrow down the positioning range, providing high-precision data support for subsequent multi-source fusion positioning decisions and ensuring the accuracy of the target location.
[0038] S4. Perform multi-source fusion positioning decision on the geofence area, the wireless network signal and the Bluetooth beacon signal to obtain the target location of the target user.
[0039] In this embodiment of the invention, the target location is the user's current location, which is determined after adjustments.
[0040] In this embodiment of the invention, the step of performing multi-source fusion positioning decision-making on the geofence area, the wireless network signal, and the Bluetooth beacon signal to obtain the target user's target location includes: The geofence area, the wireless network signal, and the Bluetooth beacon signal are each used as an independent location data source, and the priority and confidence weight of each location data source are determined based on the real-time geographic coordinates. The geofence area, the wireless network signal, and the Bluetooth beacon signal are sorted in descending order of priority to obtain the location source sequence of the location data source. The first location data source in the location source sequence that meets the availability status is selected as the basic location source, and the geographical location corresponding to the basic location source is determined as the initial location of the target user. The location data source with the highest confidence in the location source sequence is selected as the corrected location source. The initial location is adjusted based on the corrected location source to obtain the target location of the target user.
[0041] In detail, priority settings are based on the positioning accuracy of each positioning method. Bluetooth beacon signals have the highest positioning accuracy (1-10 meters), and are assigned the highest priority level 3; wireless network signals have the next highest accuracy (for semi-enclosed locations such as office buildings), and are assigned the middle priority level 2; geofenced areas have the lowest positioning accuracy (radius of 100 meters), and are assigned the lowest priority level 1. Confidence weights are set according to the signal stability and environmental adaptability of each positioning method. The confidence weight for Bluetooth beacon signals is 0.6, for wireless network signals it is 0.3, and for geofenced areas it is 0.1, for a total weight of 1. This weight allocation is based on extensive testing in real-world scenarios and accurately reflects the reliability of each positioning method, clearly defining its importance and providing a basis for multi-source fusion positioning decisions. The target identification method sequence, ordered from highest to lowest priority, is Bluetooth beacon signals → wireless network signals → geofenced areas. This sorting method ensures that high-accuracy and highly reliable positioning data is prioritized.
[0042] In this embodiment of the invention, the location source sequence refers to the set of location data sources sorted by priority, the basic location source refers to the first location data source that meets the availability status selected from the location source sequence, and the modified location source refers to the location data source with the highest confidence weight in the location source sequence.
[0043] Specifically, the availability of each location data source is determined by checking whether it can acquire valid data. For Bluetooth beacon signals, availability means the configured Beacon UUID can be detected and the RSSI signal strength is greater than -80dBm; for wireless network signals, availability means the matching SSID or BSSID can be detected; and for geofenced areas, availability means the real-time geographic coordinates are within the designated fence range. Data is verified sequentially from highest to lowest priority. If all location data sources are available, the first source, the Bluetooth beacon signal, is selected as the base location source. If only some sources are available, the highest priority source is selected. If two sources are available, the one with the higher priority is chosen. For example, if both Bluetooth and wireless network signals are available, the Bluetooth beacon signal is selected as the base location source. Based on its detected UUID-001 and RSSI strength, the initial location is determined to be the company's access control area, prioritizing high-precision location data to ensure accuracy.
[0044] In this embodiment of the invention, the location data source with the highest confidence weight is the Bluetooth beacon signal (weight 0.6). If the basic location source and the modified location source are the same data source (i.e., the basic location source is the Bluetooth beacon signal), then the geographical location corresponding to the basic location source is consistent with the geographical location corresponding to the modified location source, and the initial location does not need to be adjusted and is directly used as the target location. If the basic location source and the modified location source are different (for example, the basic location source is a wireless network signal, while the Bluetooth beacon signal is not selected as the basic location source due to momentary unavailability), then the initial location is finely adjusted based on the historical geographical location data of the Bluetooth beacon signal (if available) or the accurate location data of the wireless network signal. For example, if the initial location is a company floor area, it is further determined to be the company's 3rd floor office area based on the BSSID of the wireless network signal, thus obtaining the target location. Therefore, by adjusting the confidence weight, the accuracy of the target location is further improved.
[0045] Furthermore, the mobile terminal system has a unified decision engine that receives results from all sensing modules. The engine performs weighted decision-making based on preset priorities (Beacon > Wi-Fi > GPS) and real-time calculated confidence weights, ultimately outputting the most reliable "current location" result. For example, inside an office building, where the Beacon signal is stable and has high confidence, it is used; in an outdoor plaza, GPS is the primary source.
[0046] In this embodiment of the invention, a single positioning method has limitations in environmental adaptability. Geofencing areas are suitable for outdoor coverage, wireless network signals are suitable for semi-enclosed places, and Bluetooth beacon signals are suitable for high-precision indoor positioning. By integrating the advantages of the three positioning methods through multi-source fusion positioning decision-making, the positioning deviation problem of a single positioning method in different scenarios is solved, ensuring the accuracy of the target location and providing a reliable basis for subsequent NFC card switching.
[0047] S5. Use the mapping relationship to identify the target NFC card corresponding to the target location, and switch the preset default card to the target NFC card.
[0048] In this embodiment of the invention, the target NFC card is an NFC card associated with a target location through a mapping relationship. That is, based on the target location, the mapping relationship is queried to obtain the corresponding target NFC card, and the preset default card is switched to the target NFC card. The default card is the card currently set by the mobile terminal for NFC interaction.
[0049] In the embodiments of the present invention, see Figure 4 As shown, switching the preset default card to the target NFC card includes: S41. Call the application programming interface (API) of the wallet software in the mobile terminal, and obtain the target default card in the mobile terminal based on the API; S42. When the target default card is different from the target NFC card, switch to the target NFC card through the application programming interface; S43. When the target default card is the same as the target NFC card, the target default card remains unchanged.
[0050] In detail, wallet software refers to mainstream NFC wallet applications, which provide a public application programming interface (API) for card management. By calling this API, the default NFC card information set on the current mobile terminal can be obtained, such as the default card being card_002 (a community access card). This enables interaction with the wallet software and prepares for subsequent switching by obtaining the default card information.
[0051] Specifically, by querying the target location "Company" through the mapping relationship, the target NFC card corresponding to the target location is found to be card_001. If the current default card is card_002, and the two are different, a card switching command is sent through the wallet application interface to switch the default card to card_001. For example, the Mi Wallet's cardSwitch interface is called, passing in the card identifier of card_001 to complete the switching operation, thus achieving automatic card switching and solving the tedious problem of manual switching. If the target NFC card found is the same as the current default card, for example, if the target location is "Company" and the default card is already card_001, then no switching operation is performed, and the current default card remains unchanged, thus avoiding invalid switching operations and saving system resources and power.
[0052] Furthermore, to ensure the intelligence of card switching and give the user ultimate control, the method also includes: Learn the card usage patterns of target users at different time periods based on preset historical card-switching behavior; Based on the card usage pattern analysis, the target user's NFC card to be switched during the target time period is analyzed; When the target NFC card is the same as the NFC card to be switched, the default card is switched to the target NFC card; When the target NFC card is different from the NFC card to be switched, a card switching confirmation prompt signal is triggered; Extract feedback data from the target user in response to the card switching confirmation signal, and perform an NFC card switching operation based on the feedback data.
[0053] In detail, based on the preset historical card-switching behavior, the system learns the card usage patterns of target users. Historical card-switching behavior includes records of card-switching operations at different times and locations. A lightweight machine learning model (based on time and location features) analyzes user habits; for example, a user might use card_001 at work from 8:30-9:00 on weekdays and card_002 at their residential area from 18:30-19:00. Based on this card usage pattern, the system analyzes the NFC cards to be switched during the target time period. If the target NFC card at the target location matches the card to be switched, the switch is automatic. If they don't match, for example, the target location is the workplace, but the card to be switched is card_003 (public transport card), a card switching confirmation signal is triggered and displayed to the user via a pop-up window. User feedback data is extracted; if the user confirms the switch, the switch operation is executed; if the user cancels, the original default card is maintained. This improves switching accuracy through behavioral learning while giving users control and reducing the inconvenience caused by erroneous switching.
[0054] Specifically, the system maintains two parallel processes: Process A (based on the current environment): The multimodal environment perception module identifies the current physical location X in real time. Process B (based on historical behavior): The user behavior learning model predicts the target card Y that the user is most likely to need at this moment based on features such as the current time, day of the week, and historical patterns. When Process A identifies location X, its associated card is Card_A. At the same time, Process B predicts the target card as Card_B. If Card_A == Card_B, the system automatically switches to that card, achieving a seamless experience. If Card_A != Card_B, it indicates a conflict or anomaly (such as unusual user behavior today). In this case, the system does not switch automatically but triggers a semi-automatic confirmation: a lightweight prompt bar is displayed on the screen with the content "Detected you are at [location X], predicted you may want to use [Card_B], switch? (Current: Card_A)", and the user can confirm the switch or ignore it with one click. This ensures intelligence while giving the user ultimate control.
[0055] In this embodiment of the invention, in order to still provide the core card switching capability in the event of a signal blind spot or a device sensing module failure, the method further includes: The motion data of the terminal device is monitored by the accelerometer of the mobile terminal, and a motion trajectory sequence corresponding to the mobile terminal is generated based on the motion data. The motion trajectory sequence is matched with preset emergency gesture features to obtain the matching degree; When the matching degree exceeds a preset matching threshold, an emergency trigger signal is generated; The emergency interaction mode of the mobile terminal is activated based on the emergency trigger signal, and a floating window of the NFC card list is generated according to the emergency interaction mode. In response to the target user's selection operation in the floating window, the preset default NFC card is switched to the target NFC card based on the feedback data corresponding to the selection operation.
[0056] In detail, in signal dead zones or when the device's sensing module malfunctions, users can trigger emergency mode using preset emergency gestures (such as shaking the phone quickly twice in succession). The phone's accelerometer will detect the sequence of actions in this specific mode. Once a match is successful, the system will pop up an "Emergency Card Wallet" window at the top of the screen, displaying the user's three most recently successfully used NFC cards, allowing the user to switch between them with a single click.
[0057] Specifically, motion data is monitored through the mobile terminal's accelerometer, including changes in the terminal's acceleration and motion trajectory. A motion trajectory sequence is generated based on this data. Emergency gesture features include pressing the power button three times consecutively or shaking in a specific direction. The motion trajectory sequence is matched with these emergency gesture features to calculate the matching degree. When the matching degree exceeds a preset matching threshold of 0.9, an emergency trigger signal is generated, activating the emergency interaction mode. A floating window displaying a list of NFC cards is generated on the mobile terminal screen, containing all NFC cards configured by the user. After the user selects a target card in the floating window, the system switches the default card to the target NFC card based on the feedback data from this selection, thus providing an emergency switching solution. This ensures that users can still use NFC cards normally in special circumstances, improving system reliability.
[0058] Furthermore, the target location has been determined through multi-source fusion positioning decision-making. The corresponding target NFC card can be quickly found using the mapping relationship. Switching the default card to the target NFC card is the core step to achieve a seamless "swipe wherever you go" experience, solving the cumbersome problem of manually switching cards and improving user convenience.
[0059] In this embodiment of the invention, switching the preset default card to the target NFC card further includes: When the switching result of the target NFC card is a switching failure, the switching operation is retried for the target NFC card a preset number of times; If all attempts to switch the card fail within a preset number of attempts, a switch operation is performed on the target NFC card according to a preset non-automatic card switching strategy.
[0060] In this embodiment of the invention, when the target NFC card is successfully switched, the successful switching operation is recorded, including key information such as switching time, usage location, and card identifier. The recorded data is synchronously updated to the user behavior learning model to optimize subsequent card prediction accuracy. Simultaneously, the system maintains the switched NFC card as the current default card until the next environmental change triggers a new identification switching process. Successful switching operations not only achieve seamless smart card switching but also provide valuable data support for the system's self-learning and adaptive optimization, continuously improving the system's intelligence level and user experience.
[0061] In this embodiment of the invention, a switching failure refers to the inability to successfully switch the default card to the target NFC card after calling the wallet application interface. A retry switching operation refers to attempting to call the interface again to switch the card.
[0062] In this embodiment of the invention, the retry switching operation on the target NFC card a preset number of times includes: When the switching result of the target NFC card is a switching failure, a retry trigger signal for the target NFC card is generated; Initialize the retry counter and waiting time parameters based on the retry trigger signal; A waiting operation is performed according to the waiting time parameter. After the waiting operation is completed, a retry switching operation is performed, and the retry counter is updated.
[0063] In detail, the switching result is determined by the return value of the wallet application interface. If the return value is "switching failed" or a timeout occurs without a success message, the switching is considered a failure, and the system generates a retry trigger signal to initiate the retry mechanism. The retry counter is a variable that records the number of retries, the waiting time parameter is the interval between two retry operations, and the preset number of retries is the maximum number of retries pre-set by the system. Setting the initial value of the retry counter to 0 and the waiting time parameter to 1 second ensures both timely retries and avoids system congestion caused by frequent retries. For example, after a switching failure, the retry counter is initialized to 0, and the waiting time is set to 1 second, thus providing initial parameters for the retry operation and ensuring that the retry process proceeds in an orderly manner.
[0064] Specifically, the system executes a waiting operation according to the waiting time parameter. After waiting for 1 second, it calls the wallet application interface again to perform the switching operation, which is consistent with the initial switching process. After the switch, the retry counter value is incremented by 1. For example, the counter is updated to 1 after the first retry and to 2 after the second retry. By retrying at intervals, the success rate of card switching is improved, avoiding switching failures caused by momentary network or system problems. The preset number of attempts is set to 3. This number setting is based on actual testing. If the switch still fails after more than 3 retries, it indicates that there is a non-momentary problem. When the retry counter reaches 3, the retry operation is terminated, and a retry failure indication is generated through a pop-up window or notification to inform the user that the switching has failed, avoiding infinite retries that consume system resources and providing timely feedback to the user.
[0065] Furthermore, card switching may experience momentary failures due to interface call failures, system compatibility issues, etc. Retrying the switching operation can resolve such issues through multiple attempts, improve the switching success rate, and ensure that users can use the target NFC card normally in most cases, avoiding the impact on user experience due to a single switching failure.
[0066] In this embodiment of the invention, the non-automatic card switching strategy is a preset alternative switching scheme to be used when both automatic switching and retry switching fail. It no longer relies on the automatic switching mechanism, but provides a manual switching path that can be intervened by the user.
[0067] Specifically, when all retries to switch cards within a preset number of attempts fail, a preset non-automatic card switching strategy is triggered. This strategy includes one or more of the following methods: directly redirecting to the wallet software's card selection page, allowing the user to manually select the target NFC card; displaying a card switching option in the system notification bar, which the user can click to enter the card selection interface; or popping up a half-screen card selector, displaying a list of available NFC cards for the user to choose from. For example, if all three retries fail, the system automatically redirects to the wallet's NFC card list page, where the user can manually select the target NFC card to complete the switch. This card switching strategy provides a fallback solution for card switching, ensuring that even if automatic switching completely fails, the user can still complete the switch manually, thus guaranteeing the availability of core functions.
[0068] In this embodiment of the invention, in order to enhance the system's adaptive learning capability in unfamiliar environments and reduce repetitive manual configuration by users, after performing a switching operation on the target NFC card using the card backup switching strategy, the method further includes: When the target NFC card performs a successful switching operation, it is detected whether the usage location of the target NFC card is the usage location in the mapping relationship. If not, the location of use is identified as a temporary location, and a recording prompt signal for the temporary location is generated; Extract the target user's confirmation operation information in response to the recorded prompt signal, and collect the multimodal environmental characteristics of the usage location based on the confirmation operation information; The multimodal environment features are associated with the target NFC card, a temporary location record is generated based on the association, and the lifecycle of the temporary location record is configured.
[0069] In detail, after a successful switch, the system records the multimodal characteristics of the current location where the NFC card is being used, and compares these characteristics with those stored in the mapping relationship to determine if it is a known location. For example, if a user uses an NFC card in a new office building, after a successful switch, the system detects that the Wi-Fi SSID for that location is New-Office-5G, which does not exist in the mapping relationship, thus determining it as an unknown location. This process identifies the new location and provides a trigger condition for adaptive learning.
[0070] Specifically, unknown locations are designated as temporary locations, generating a recording prompt signal. A pop-up window asks the user whether to record the location, offering "Confirm Record" and "Cancel" options to request permission and prevent redundant data from unauthorized recording. If the user clicks "Confirm Record," the system automatically collects multimodal environmental features of the temporary location, including GPS coordinates, Wi-Fi SSID and BSSID, and Bluetooth beacon UUID (if applicable). If the user clicks "Cancel," no feature collection occurs. For example, after the user confirms the record, GPS coordinates 39.97, 116.33, Wi-Fi SSID "New-Office-5G," and BSSID "FF:EE:DD:CC:BB:AA" are collected, thus gathering feature data for the new location and preparing for establishing a new mapping relationship.
[0071] Furthermore, the collected multimodal environmental features are associated with the currently used target NFC card to generate a temporary location record, which is stored in the system. The lifecycle is configured to 7 days. If the user uses the NFC card again at that location within 7 days, the temporary location record is automatically converted into a formal usage location and added to the mapping relationship; if it is not used again within 7 days, the temporary location record is automatically deleted. This enables adaptive learning in unfamiliar environments, reduces the need for users to manually configure new locations, and improves the system's intelligence.
[0072] As can be seen, the above solution achieves intelligent scene perception and automatic switching of NFC cards through multi-source fusion positioning using geofencing, Wi-Fi and Bluetooth beacons. It can accurately match target cards without manual operation by the user. At the same time, it sets up a multi-level fault tolerance mechanism (retry switching and backup strategy) to effectively ensure the success rate of switching in complex environments and significantly improve the accuracy of NFC intelligent switching.
[0073] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0074] In one embodiment, an NFC card switching device is provided, which corresponds one-to-one with the NFC card switching method described in the above embodiments. For example... Figure 5 As shown, the NFC card switching device 100 includes a mapping relationship construction module 101, a wireless network signal scanning module 102, a Bluetooth beacon signal scanning module 103, a target location determination module 104, and a card switching module 105. Detailed descriptions of each functional module are as follows: The mapping relationship construction module 101 is used to identify the location where the target user uses the NFC card, construct the mapping relationship between the location and the NFC card, and configure the geofence area corresponding to the location. The wireless network signal scanning module 102 is used to identify the real-time geographic coordinates of the target user's mobile terminal, and scan the wireless network signal of the mobile terminal when the real-time geographic coordinates are within the geographic fence area. The Bluetooth beacon signal scanning module 103 is used to determine the real-time area information of the target user based on the wireless network signal. When the real-time area information is within any target sub-area of the geofence area, the module scans the Bluetooth beacon signal of the mobile terminal. The geofence area is pre-divided into multiple target sub-areas according to different NFC cards. The target location determination module 104 is used to perform multi-source fusion positioning decision on the geofence area, the wireless network signal and the Bluetooth beacon signal to obtain the target location of the target user. The card switching module 105 is used to identify the target NFC card corresponding to the target location using the mapping relationship, and switch the preset default card to the target NFC card.
[0075] In one embodiment, the mapping relationship construction module 101, when performing the construction of the mapping relationship between the usage location and the NFC card, is used to: Determine whether the location of use is the same as the previously obtained historical locations of use; When the location of use is the same as the historical location of use, a first location identifier corresponding to the location of use is identified, and a hash index is constructed for the location identifier; The first location identifier for constructing the hash index, the location of use, and the NFC card are mapped to obtain a mapping relationship; When the location of use is different from the historical location of use, obtain the union of the geographical locations of the location of use and the historical location of use, identify the second location identifier corresponding to the union of the geographical locations, and construct a hash index for the location identifier; The second location identifier for constructing the hash index, the union of the geographical locations, and the NFC card are mapped to obtain the mapping relationship.
[0076] In one embodiment, the wireless network signal scanning module 102, when performing the task of identifying the real-time geographic coordinates of a target user's mobile terminal, is used to: Based on the target user's historical location patterns at different time periods, an activity pattern profile of the target user is generated, and a scanning strategy for the target user is determined based on the activity pattern profile; Acquire the motion state of the target user, and adjust the scanning frequency in the scanning strategy based on the motion state; The target user's mobile terminal is scanned according to the adjusted scanning frequency to obtain the real-time geographic coordinates of the mobile terminal.
[0077] In one embodiment, the target location determination module 104, when performing multi-source fusion positioning decision-making on the geofence area, the wireless network signal, and the Bluetooth beacon signal to obtain the target user's target location, is configured to: The geofence area, the wireless network signal, and the Bluetooth beacon signal are each used as an independent location data source, and the priority and confidence weight of each location data source are determined based on the real-time geographic coordinates. The geofence area, the wireless network signal, and the Bluetooth beacon signal are sorted in descending order of priority to obtain the location source sequence of the location data source. The first location data source in the location source sequence that meets the availability status is selected as the basic location source, and the geographical location corresponding to the basic location source is determined as the initial location of the target user. The location data source with the highest confidence in the location source sequence is selected as the corrected location source. The initial location is adjusted based on the corrected location source to obtain the target location of the target user.
[0078] In one embodiment, the card switching module 105, when performing the switching of a preset default card to the target NFC card, is used to: Call the application programming interface (API) of the wallet software in the mobile terminal, and obtain the target default card in the mobile terminal based on the API; When the target default card is different from the target NFC card, the application interface is used to switch to the target NFC card. When the target default card is the same as the target NFC card, the target default card remains unchanged.
[0079] In one embodiment, the card switching module 105, when switching the preset default card to the target NFC card, is further configured to: When the switching result of the target NFC card is a switching failure, the switching operation is retried for the target NFC card a preset number of times; If all attempts to switch the card fail within a preset number of attempts, a switch operation is performed on the target NFC card according to a preset non-automatic card switching strategy.
[0080] In one embodiment, the card switching module 105, when performing a preset number of retry switching operations on the target NFC card, is used to: When the switching result of the target NFC card is a switching failure, a retry trigger signal for the target NFC card is generated; Initialize the retry counter and waiting time parameters based on the retry trigger signal; A waiting operation is performed according to the waiting time parameter. After the waiting operation is completed, a retry switching operation is performed, and the retry counter is updated.
[0081] This invention provides an NFC card switching device that achieves intelligent scene perception and automatic switching of NFC cards through multi-source fusion positioning using geofencing, Wi-Fi, and Bluetooth beacons. It can accurately match target cards without manual operation by the user. At the same time, it sets up a multi-level fault tolerance mechanism (retry switching and backup strategy) to effectively ensure the success rate of switching in complex environments and significantly improve the accuracy of NFC intelligent switching.
[0082] For specific limitations regarding the NFC card switching device, please refer to the limitations of the NFC card switching method above, which will not be repeated here. Each module in the aforementioned NFC card switching device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of the computer device in hardware form or independently of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0083] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When the computer program is executed by the processor, it implements the functions or steps of an NFC card switching method on the server side.
[0084] In one embodiment, a computer device is provided, which may be a client, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with an external server via a network connection. When executed by the processor, the computer program implements the functions or steps of an NFC card switching method on the client side.
[0085] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps: Identify the locations where target users use NFC cards, construct a mapping relationship between the locations and the NFC cards, and configure the geofence area corresponding to the locations. Identify the real-time geographic coordinates of the target user's mobile terminal; when the real-time geographic coordinates are within the geofence area, scan the wireless network signal of the mobile terminal. The real-time area information of the target user is determined based on the wireless network signal. When the real-time area information is within any target sub-area of the geofence area, the Bluetooth beacon signal of the mobile terminal is scanned. The geofence area is pre-divided into multiple target sub-areas according to different NFC cards. Multi-source fusion positioning decision is performed on the geofence area, the wireless network signal and the Bluetooth beacon signal to obtain the target location of the target user; The target NFC card corresponding to the target location is identified using the mapping relationship, and the preset default card is switched to the target NFC card.
[0086] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor: The mapping relationship construction module is used to identify the location where the target user uses the NFC card, construct the mapping relationship between the location and the NFC card, and configure the geofence area corresponding to the location. A wireless network signal scanning module is used to identify the real-time geographic coordinates of a target user's mobile terminal. When the real-time geographic coordinates are within the geofence area, the module scans the wireless network signal of the mobile terminal. The Bluetooth beacon signal scanning module is used to determine the real-time area information of the target user based on the wireless network signal. When the real-time area information is within any target sub-area of the geofence area, the module scans the Bluetooth beacon signal of the mobile terminal. The geofence area is pre-divided into multiple target sub-areas based on different NFC cards. The target location determination module is used to perform multi-source fusion positioning decision on the geofence area, the wireless network signal and the Bluetooth beacon signal to obtain the target location of the target user. The card switching module is used to identify the target NFC card corresponding to the target location using the mapping relationship, and switch the preset default card to the target NFC card.
[0087] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.
[0088] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0089] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0090] It should be noted that if any software tools or components not belonging to our company appear in the embodiments of this application, they are merely for illustrative purposes and do not represent actual use.
[0091] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A method for NFC card switching, characterized by, include: Identify the locations where target users use NFC cards, construct a mapping relationship between the locations and the NFC cards, and configure the geofence area corresponding to the locations. Identify the real-time geographic coordinates of the target user's mobile terminal; when the real-time geographic coordinates are within the geofence area, scan the wireless network signal of the mobile terminal. The real-time area information of the target user is determined based on the wireless network signal. When the real-time area information is within any target sub-area of the geofence area, the Bluetooth beacon signal of the mobile terminal is scanned. The geofence area is pre-divided into multiple target sub-areas according to different NFC cards. Multi-source fusion positioning decision is performed on the geofenced area, the wireless network signal, and the Bluetooth beacon signal to obtain the target location of the target user. The target NFC card corresponding to the target location is identified using the mapping relationship, and the preset default card is switched to the target NFC card.
2. The NFC card switching method of claim 1, wherein, The process of establishing the mapping relationship between the usage location and the NFC card includes: Determine whether the location of use is the same as the previously obtained historical locations of use; When the location of use is the same as the historical location of use, a first location identifier corresponding to the location of use is identified, and a hash index is constructed for the location identifier; The first location identifier for constructing the hash index, the location of use, and the NFC card are mapped to obtain a mapping relationship; When the location of use is different from the historical location of use, obtain the union of the geographical locations of the location of use and the historical location of use, identify the second location identifier corresponding to the union of the geographical locations, and construct a hash index for the location identifier; The second location identifier for constructing the hash index, the union of the geographical locations, and the NFC card are mapped to obtain the mapping relationship.
3. The NFC card switching method of claim 1, wherein, The real-time geographic coordinates of the target user's mobile terminal include: Based on the target user's historical location patterns at different time periods, an activity pattern profile of the target user is generated, and the scanning strategy for the target user is determined based on the activity pattern profile; Acquire the motion state of the target user, and adjust the scanning frequency in the scanning strategy based on the motion state; The target user's mobile terminal is scanned according to the adjusted scanning frequency to obtain the real-time geographic coordinates of the mobile terminal.
4. The NFC card switching method of claim 1, wherein, The step of performing multi-source fusion positioning decision-making on the geofence area, the wireless network signal, and the Bluetooth beacon signal to obtain the target user's target location includes: The geofence area, the wireless network signal, and the Bluetooth beacon signal are each used as an independent location data source, and the priority and confidence weight of each location data source are determined based on the real-time geographic coordinates. The geofence area, the wireless network signal, and the Bluetooth beacon signal are sorted in descending order of priority to obtain the location source sequence of the location data source; The first location data source in the location source sequence that meets the availability status is selected as the basic location source, and the geographical location corresponding to the basic location source is determined as the initial location of the target user. The location data source with the highest confidence in the location source sequence is selected as the corrected location source. The initial location is adjusted based on the corrected location source to obtain the target location of the target user.
5. The NFC card switching method of claim 1, wherein, The step of switching the preset default card to the target NFC card includes: Call the application programming interface (API) of the wallet software in the mobile terminal, and obtain the target default card in the mobile terminal based on the API; When the target default card is different from the target NFC card, the application interface is used to switch to the target NFC card. When the target default card is the same as the target NFC card, the target default card remains unchanged.
6. The NFC card switching method of claim 1, wherein, The step of switching the preset default card to the target NFC card further includes: When the switching result of the target NFC card is a switching failure, the switching operation is retried for the target NFC card a preset number of times; If all attempts to switch the card fail within a preset number of attempts, a switch operation is performed on the target NFC card according to a preset non-automatic card switching strategy.
7. The NFC card switching method of claim 6, wherein, The retry switching operation on the target NFC card a preset number of times includes: When the switching result of the target NFC card is a switching failure, a retry trigger signal for the target NFC card is generated; Initialize the retry counter and waiting time parameters based on the retry trigger signal; A waiting operation is performed according to the waiting time parameter. After the waiting operation is completed, a retry switching operation is performed, and the retry counter is updated.
8. An NFC card switching apparatus characterized by comprising: include: The mapping relationship construction module is used to identify the location where the target user uses the NFC card, construct the mapping relationship between the location and the NFC card, and configure the geofence area corresponding to the location. A wireless network signal scanning module is used to identify the real-time geographic coordinates of a target user's mobile terminal. When the real-time geographic coordinates are within the geofence area, the module scans the wireless network signal of the mobile terminal. The Bluetooth beacon signal scanning module is used to determine the real-time area information of the target user based on the wireless network signal. When the real-time area information is within any target sub-area of the geofence area, the module scans the Bluetooth beacon signal of the mobile terminal. The geofence area is pre-divided into multiple target sub-areas based on different NFC cards. The target location determination module is used to perform multi-source fusion positioning decision on the geofence area, the wireless network signal and the Bluetooth beacon signal to obtain the target location of the target user. The card switching module is used to identify the target NFC card corresponding to the target location using the mapping relationship, and switch the preset default card to the target NFC card.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the NFC card switching method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 9. When the computer program is executed by the processor, it implements the steps of the NFC card switching method as described in any one of claims 1 to 7.
