Card selection method, device, terminal equipment and storage medium
By collecting and comparing card reader feature information and combining it with a time period feature matching algorithm, the problem of low card selection success rate under multi-card binding of terminal devices is solved, achieving more efficient intelligent card selection and faster card swiping speed.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
- Filing Date
- 2022-07-21
- Publication Date
- 2026-06-30
AI Technical Summary
In existing technologies, when a terminal device is bound to multiple cards, the card selection success rate is low, especially when facing different types of card readers, the intelligent card selection algorithm cannot effectively match them, resulting in card swiping failure.
The system collects feature information from the card reader within the first time period and compares it with the feature information set in the database. The target card information is determined by the correspondence between the feature information set and the card information set. The feature information includes feature information from multiple time periods, and there is overlap between adjacent time periods. The system shortens the data collection time to improve the matching success rate.
It improves the success rate of card selection, shortens the card swiping time, enhances the user experience, adapts to the characteristics of different card readers, and improves the efficiency of intelligent card selection.
Smart Images

Figure CN115310463B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of streaming media technology, specifically to a card selection method, apparatus, terminal device, and storage medium. Background Technology
[0002] Near Field Communication (NFC) is a short-range wireless communication technology. Currently, this technology is widely used in people's daily lives, such as in subways, buses, UnionPay QuickPass, and access control systems. Furthermore, an increasing number of terminal manufacturers are incorporating NFC technology into their devices (such as mobile phones). By activating / binding public transport cards, bank cards, and access control cards on these devices, users can achieve functions such as swiping public transport cards, swiping UnionPay point-of-sale (POS) terminals, and access control.
[0003] When more than one card is linked to a terminal device, the question of which card to use for swiping arises. Currently, card selection solutions include smart card selection, which automatically selects a specific card based on the current conditions. However, the market offers a wide variety of card readers, and the success rate of card selection is relatively low. Summary of the Invention
[0004] This application provides a card selection method, apparatus, terminal device, and storage medium, which can improve the success rate of card selection.
[0005] The first aspect of this application provides a card selection method, including:
[0006] Collect feature information from the card reader within the first time period;
[0007] The feature information within the first time period is compared with the feature information set in the database, wherein the database contains the correspondence between the feature information set and the card information set; the feature information set includes at least two feature information sets, and the card information set includes at least two card information sets.
[0008] If there is a first feature information in the feature information set that matches the feature information within the first duration, the first card information corresponding to the first feature information is determined according to the correspondence between the feature information set and the card information set; the first feature information includes feature information of at least two time periods, any two adjacent time periods overlap, one of the feature information of the at least two time periods matches the feature information within the first duration, and the length of each time period is less than or equal to the first duration;
[0009] Select the first card corresponding to the first card information and swipe it on the card reader.
[0010] A second aspect of this application provides a card selection method, including:
[0011] Get the number of commands sent by the card reader within the third time period;
[0012] The number of commands sent within the third time period is compared with the set of command counts in the database, which contains the correspondence between the set of command counts and the set of card information; the set of command counts includes at least two command counts, and the set of card information includes at least two card information items.
[0013] If there exists a first command quantity in the command quantity set that matches the number of commands sent within the third time period, the first card information corresponding to the first command quantity is determined according to the correspondence between the command quantity set and the card information set.
[0014] Select the first card corresponding to the first card information and swipe it on the card reader.
[0015] A third aspect of this application provides a card selection device, comprising:
[0016] The acquisition unit is used to acquire feature information of the card reader within the first time period;
[0017] The comparison unit is used to compare the feature information within the first time period with the feature information set in the database. The database contains the correspondence between the feature information set and the card information set. The feature information set includes at least two feature information sets, and the card information set includes at least two card information sets.
[0018] The determining unit is configured to, when there is first feature information in the feature information set that matches the feature information within the first duration, determine the first card information corresponding to the first feature information according to the correspondence between the feature information set and the card information set; the first feature information includes feature information of at least two time periods, any two adjacent time periods overlap, one of the feature information of the at least two time periods matches the feature information within the first duration, and the length of each time period is less than or equal to the first duration;
[0019] The card selection unit is used to select the first card corresponding to the first card information and swipe it on the card reader.
[0020] A fourth aspect of this application provides a card selection device, comprising:
[0021] The acquisition unit is used to obtain the number of commands sent by the card reader within the third time period;
[0022] The comparison unit is used to compare the number of commands sent within the third time period with the set of command counts in the database. The database contains the correspondence between the set of command counts and the set of card information. The set of command counts includes at least two command counts, and the set of card information includes at least two card information items.
[0023] The determining unit is configured to, when there is a first command quantity in the command quantity set that matches the number of commands sent within the third time period, determine the first card information corresponding to the first command quantity according to the correspondence between the command quantity set and the card information set;
[0024] The card selection unit is used to select the first card corresponding to the first card information and swipe it on the card reader.
[0025] A fifth aspect of this application provides a terminal device including a processor and a memory, the memory being used to store a computer program, the computer program including program instructions, and the processor being configured to invoke the program instructions to execute the step instructions as described in the first or second aspect of this application.
[0026] A sixth aspect of this application provides a computer-readable storage medium storing a computer program for electronic data interchange, the computer program including program instructions that, when executed by a processor, cause the processor to perform the steps described in the first or second aspect of this application.
[0027] A seventh aspect of this application provides a computer program product, wherein the computer program product includes a computer program, the computer program including program instructions, and the program instructions, when executed by a processor, cause the processor to perform the step instructions as described in the first or second aspect of this application.
[0028] In this embodiment, feature information within a first time period is collected from the card reader; the feature information within the first time period is compared with a feature information set in a database, the database containing the correspondence between the feature information set and the card information set; the feature information set includes at least two feature information pieces, and the card information set includes at least two card information pieces; if a first feature information matching the feature information within the first time period exists in the feature information set, the first card information corresponding to the first feature information is determined according to the correspondence between the feature information set and the card information set; the first feature information includes feature information from at least two time periods, any two adjacent time periods overlap, one of the feature information from the at least two time periods matches the feature information within the first time period, and the length of each time period is less than or equal to the first time period; the first card corresponding to the first card information is selected and swiped on the card reader. In this embodiment, the feature information within the first time period can be compared with the feature information from at least two overlapping time periods. Since the length of each time period is less than or equal to the first time period, and adjacent time periods overlap, the matching success rate can be improved, thereby improving the card selection success rate. Attached Figure Description
[0029] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0030] Figure 1 This is a schematic diagram of a card reader feature provided in an embodiment of this application;
[0031] Figure 2 This is a schematic diagram of another card reader feature provided in an embodiment of this application;
[0032] Figure 3 This is a schematic diagram of a system architecture provided in an embodiment of this application;
[0033] Figure 4 This is a flowchart illustrating a card selection method provided in an embodiment of this application;
[0034] Figure 5 This is a flowchart illustrating another card selection method provided in an embodiment of this application;
[0035] Figure 6 This is a schematic diagram illustrating how feature information of one period is divided into feature information of N time periods, as provided in an embodiment of this application.
[0036] Figure 7 This is a flowchart illustrating another card selection method provided in an embodiment of this application;
[0037] Figure 8 This is a schematic diagram of the structure of a card selection device provided in an embodiment of this application;
[0038] Figure 9 This is a schematic diagram of another card selection device provided in an embodiment of this application;
[0039] Figure 10 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Detailed Implementation
[0040] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0041] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.
[0042] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this application can be combined with other embodiments.
[0043] The terminal devices involved in the embodiments of this application are terminals with display functions. They can be mobile phones, tablets, laptops, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), on-board units (OBUs), wearable devices (e.g., watches, bracelets, smart helmets, etc.), smart home devices (rice cookers, speakers, home management devices, etc.), augmented reality (AR) / virtual reality (VR) devices, etc.
[0044] Near Field Communication (NFC) is a short-range (within 10cm) wireless communication technology standard initiated by Philips (later spun off from NXP) and jointly promoted by well-known manufacturers such as Nokia and Sony. It operates at a frequency of 13.56 MHz and is currently widely used in daily life, such as in subways, buses, UnionPay QuickPass, and access control systems. Furthermore, more and more mobile phone manufacturers are incorporating NFC technology into their devices, allowing users to activate / bind public transport cards, bank cards, and access control cards on their phones, enabling functions such as mobile phone payment for public transport, UnionPay POS transactions, and access control.
[0045] The terminal device can be bound to at least two cards. When more than one card is bound to the terminal device, the question of which card to swipe arises. Currently, card selection solutions include manual card selection and intelligent card selection via mobile phone. Manual card selection involves displaying all cards on the user interface (UI) during the swipe process, allowing the user to manually select one card. Intelligent card selection involves the terminal device automatically selecting a specific card based on the current conditions.
[0046] One technology in smart card selection solutions is based on the characteristics of the card reader, such as the order, type, and time interval of commands issued by the reader. The identification algorithm pre-sets a fixed delay time (e.g., 200 milliseconds). When the terminal device approaches the card reader, relevant feature information of the card reader is collected within this delay period. This collected feature information is compared with a feature database stored in the terminal device. (It should be noted that if it is the first time the card reader is used, the database does not contain the feature information of that card reader; in this case, no comparison is performed, only storage is performed.) The comparison algorithm generally focuses on similarity matching, setting a similarity threshold, such as greater than or equal to a certain threshold (e.g., 70%), if the similarity is considered successful.
[0047] Current feature information collection and comparison algorithms and thresholds are fixed and the same for all users. However, while this fixed method may be suitable for some users, it may not be suitable for others, or it may not be the best solution. Since there are various types of card readers on the market, especially access control card readers, the same algorithm may not achieve good matching results, resulting in a low card selection success rate.
[0048] For example, please see Figure 1 , Figure 1 This is a schematic diagram illustrating a card reader feature provided in an embodiment of this application. For example... Figure 1 As shown, the characteristics of card reader A are as follows: the cycle of card reader A is 100ms, and each cycle contains a request command type A (REQA), a request command type B (REQB), and a request command type F (SENSF). If the characteristics collected over 200ms are used for comparison, the comparison can be completed.
[0049] For example, please see Figure 2 , Figure 2 This is a schematic diagram of another card reader feature provided in an embodiment of this application. For example... Figure 2As shown, the characteristics of card reader B are as follows: the cycle of card reader B is 1000 milliseconds (ms). Each cycle contains request command type A (REQA), request command type B (REQB), and request command type F (SENSF) commands. If we still use the features collected over 200ms for comparison, since the features captured within 200ms are only local features of card reader B, for example, the REQA command might be captured, but the database for comparison stores the REQB command. This could easily lead to comparison errors.
[0050] Please see Figure 3 , Figure 3 This is a schematic diagram of a system architecture provided in an embodiment of this application. For example... Figure 3 As shown, the system architecture can include a terminal device and a card reader. The terminal device can communicate with the card reader via near field communication (NFC). The card reader can be one used in subway, bus, UnionPay QuickPass, or access control systems. NFC communication can employ the NFC communication interface (NCI) protocol. The terminal device can support low-power card detection, a low-power card detection technology within NFC.
[0051] When a terminal device approaches a card reader, the terminal device can use NFC to collect feature information from the card reader within a first time period (e.g., 300ms), and compare this feature information with a feature information set in a database. The database contains a correspondence between the feature information set and the card information set; the feature information set includes at least two feature information items, and the card information set includes at least two card information items; if a first feature information matching the feature information within the first time period exists in the feature information set, the first card information corresponding to the first feature information is determined based on the correspondence between the feature information set and the card information set.
[0052] Select the first card that corresponds to the first card information and swipe it on the card reader.
[0053] The first feature information includes feature information of at least two time periods, where any two adjacent time periods overlap, and one of the feature information of the at least two time periods matches the feature information within the first duration. The length of each of the at least two time periods is less than or equal to the first duration.
[0054] In this embodiment of the application, the feature information within the first time period can be compared with the feature information of at least two overlapping time periods. Since the length of each time period in the at least two time periods is less than or equal to the first time period, and the two adjacent time periods overlap, the matching success rate can be improved, thereby improving the card selection success rate.
[0055] When the card reader's cycle is longer than the first duration, it is not necessary to collect the feature information of the entire card reader cycle, which can shorten the data collection time during card swiping and speed up the card swiping process.
[0056] Please see Figure 4 , Figure 4 This is a flowchart illustrating a card selection method provided in an embodiment of this application. Figure 4 As shown, the card selection method may include the following steps.
[0057] 401, The terminal device collects the feature information of the card reader within the first time period.
[0058] In this embodiment, the first duration can be a pre-set fixed duration. For example, the first duration can be set to 300ms. Setting the first duration to a fixed duration allows the time for each card swipe to be as close as possible, improving the user's card swiping experience. For card readers with longer cycles, the data acquisition time during card swiping can be shortened, speeding up the card swiping process.
[0059] Optionally, the initial duration can be set based on the user's card-swiping habits. For example, it can be set based on the duration of the user's card-swiping session. For instance, the initial duration can be set by statistically analyzing the average duration of the user's card-swiping session over a period of time. Generally, the longer the average duration of the card-swiping session, the longer the initial duration can be set.
[0060] Because there are various types of card readers on the market, their time intervals can differ significantly. For example, card reader A might have a time interval of 100ms, while card reader B might have a time interval of 1100ms. If the matching algorithm is full-cycle matching (matching data across the entire cycle), then to improve the matching success rate between card reader A and card reader B, the initial time interval needs to be set to at least 1100ms, which will result in a slower card-swiping speed.
[0061] The feature information may include at least one of the following: command type, number of commands, command time interval, field strength on-time, and field strength off-time.
[0062] Optionally, the feature information may include at least one of the following: command type, command time interval, field strength on duration, and field strength off duration.
[0063] Command types can include request command type A (REQA), request command type B (REQB), request command type F (SENSF), answer to request (type A), anti-collision command, anti-collision response, select command, select acknowledge (type A), request for answer to select, answer to select, data block command and response (I-Block), etc. The select command is used to select a specific user ID card.
[0064] The command time interval can be the time interval between two commands, for example, ... Figure 1 As shown, the time interval between adjacent REQA and REQB commands is 30ms, and the time interval between adjacent REQB and SENSF commands is 30ms. Figure 2 As shown, the time interval between two adjacent REQA commands is 100ms, the time interval between two adjacent REQB commands is 100ms, and the time interval between two adjacent SENSF commands is 100ms. The time interval between adjacent REQA and REQB commands is 200ms, and the time interval between adjacent REQB and SENSF commands is 200ms.
[0065] When a card reader is working, it cycles through turning the signal strength on and off. During the signal strength activation period, the reader can issue different types of commands; during the signal strength deactivation period, the reader does not issue any commands. The signal strength activation duration refers to the continuous duration the signal strength is on, and the signal strength deactivation duration refers to the continuous duration the signal strength is off. Generally speaking, the reader's cycle = signal strength activation duration + signal strength deactivation duration. For example, ... Figure 1 As shown, reader A has a cycle of 100ms, a field strength on-time of 80ms, and a field strength off-time of 20ms. Figure 2 As shown, the period of card reader B is 1100ms, the field strength on time is 900ms, and the field strength off time is 200ms.
[0066] 402. The terminal device compares the feature information within the first time period with the feature information set in the database. The database contains the correspondence between the feature information set and the card information set.
[0067] The feature information set includes at least two feature information pieces, and the card information set includes at least two card information pieces. Any two feature information pieces among the at least two feature information pieces are distinct. Any two card information pieces among the at least two card information pieces are distinct. Each feature information piece among the at least two feature information pieces can correspond to one card information piece in the card information set, and one card information piece in the card information set can correspond to at least one feature information piece among the at least two feature information pieces.
[0068] In this embodiment, the database is a database in the terminal device used to store feature information. The database can store feature information sets, card information sets, and the correspondence between feature information sets and card information sets.
[0069] Each feature in the feature information set may include feature information for at least one time period. Each feature in the feature information set originates from a card reader. For example, the feature information set includes: first feature information, second feature information, and third feature information. The first feature information originates from a first card reader, the second feature information originates from a second card reader, and the third feature information originates from a third card reader.
[0070] The terminal device compares the feature information within a first time period with the feature information set in the database. It can compare the feature information within the first time period with each feature information in the feature information set to obtain the similarity. When there is a feature information in the feature information set whose similarity with the feature information within the first time period is greater than a first threshold, it can be determined that the first feature information matches the feature information within the first time period.
[0071] Optionally, in step 402, the terminal device compares the feature information within the first time period with the feature information set in the database, which may include the following steps:
[0072] (11) The terminal device compares the feature information within the first time period with the feature information of any one of the at least two time periods;
[0073] (12) If the terminal device determines that the first feature information matches the feature information within the first time period when the feature information of one of the at least two time periods has a similarity greater than a first threshold with the feature information within the first time period.
[0074] In this embodiment, a comparison algorithm can be used to calculate whether the feature information within a first time period matches the feature information of any one of the feature information in at least two time periods. If the similarity between the feature information in one of the at least two time periods and the feature information within the first time period is greater than a first threshold, then the feature information within the first time period is considered to match the first feature information.
[0075] The comparison algorithm may include command alignment and deviation tolerance calculation. Command alignment can be performed on a single command basis, and deviation tolerance calculation can be performed based on the deviation tolerance calculated according to the time interval between adjacent commands, provided that the deviation tolerance is less than a set threshold.
[0076] The first threshold can be preset and stored in the terminal device's memory (e.g., non-volatile memory). For example, the first threshold can be set to 70%.
[0077] Since the length of each time period in at least two time periods is less than or equal to the first duration, it is more likely that the amount of feature information (e.g., the number of commands) within the first duration is greater than or equal to the amount of feature information contained in each time period. The feature information contained in each time period is more likely to be included in the feature information within the first duration, thereby improving the success rate of the comparison.
[0078] 403. If there is a first feature information in the feature information set that matches the feature information within the first time period, the terminal device determines the first card information corresponding to the first feature information based on the correspondence between the feature information set and the card information set.
[0079] The first feature information includes feature information of at least two time periods, where any two adjacent time periods overlap, and one of the feature information of the at least two time periods matches the feature information within the first duration. The length of each of the at least two time periods is less than or equal to the first duration.
[0080] At least two time periods can fall within one cycle of the card reader. For example, if there are 5 at least two time periods and the card reader's cycle is 1100ms, then the at least two time periods can include 0-300ms, 200-500ms, 400-700ms, 600-900ms, and 800-1100ms.
[0081] In this embodiment of the application, when comparing the feature information within the first time period with the first feature information, a comparison algorithm can be used to calculate whether the two match. The comparison algorithm may include command alignment and deviation tolerance calculation. Command alignment may be performed using single command alignment, and deviation tolerance calculation may be performed based on single command alignment, and the deviation tolerance may be calculated according to the time interval between adjacent commands. If the deviation tolerance is less than a set threshold, the feature information within the first time period is considered to match the first feature information.
[0082] Since the length of each time period in at least two time periods is less than or equal to the first duration, it is more likely that the amount of feature information (e.g., the number of commands) within the first duration is greater than or equal to the amount of feature information contained in each time period. The feature information contained in each time period is more likely to be included in the feature information within the first duration, thus improving the success rate of the comparison. For example, if a time period contains 300ms of feature information, and the feature information within the first duration contains 500ms of feature information, when comparing the two, it is only necessary for the 300ms feature information to match one 300ms segment of the 500ms feature information. If a time period contains 500ms of feature information, and the feature information within the first duration only contains 300ms of feature information, when comparing the two, if some feature information exists in the 500ms feature information but not in the 300ms feature information, then the two will not match.
[0083] Having overlap between any two adjacent time periods within at least two time intervals can improve the accuracy of the comparison. For example, if the card reader's cycle is 1100ms, and no two adjacent time periods overlap (e.g., at least two = four), these at least two time intervals could be 0-300ms, 300-600ms, 600-900ms, or 900-1100ms. If the first time interval is any one of 0-300ms, 300-600ms, 600-900ms, or 900-1200ms (this probability is very low), a successful match is likely. However, if the first time interval is 150-450ms (this random probability is higher), the accuracy of comparing 150-450ms with 0-300ms or 300-600ms is relatively low, and a match failure is more likely.
[0084] If any two adjacent time periods overlap (for example, at least two = 5), these two time periods can include 0–300ms, 200–500ms, 400–700ms, 600–900ms, and 800–1100ms. If the first duration is any one of these, a match is likely to be successful. If the first duration is 150–450ms, a match between 150–450ms and 200–500ms is more accurate and easier to achieve than a match between 150–450ms and 0–300ms or 300–600ms.
[0085] 404, The terminal device selects the first card corresponding to the first card information and swipes it on the card reader.
[0086] If the feature information within the first time period is confirmed to match the first feature information, since the first feature information corresponds to the first card information, the first card corresponding to the first card information can be selected to be swiped on the card reader, thereby realizing intelligent card selection.
[0087] In this embodiment of the application, the feature information within the first time period can be compared with the feature information of at least two overlapping time periods. Since the length of each time period in the at least two time periods is less than or equal to the first time period, and the two adjacent time periods overlap, the matching success rate can be improved, thereby improving the card selection success rate.
[0088] Please see Figure 5 , Figure 5 This is a flowchart illustrating another card selection method provided in an embodiment of this application. For example... Figure 5 As shown, the card selection method may include the following steps.
[0089] 501, when the first card is swiped on the card reader for the first time, the terminal device collects the feature information of the card reader within a second time period, the second time period being greater than or equal to the card reader's cycle.
[0090] The second duration is greater than or equal to the reader's cycle, which ensures that the feature information within the second duration can include the feature information of the reader within one cycle.
[0091] The second duration can be a pre-set fixed duration. For example, the second duration can be set to 2000ms. Setting the second duration to a fixed duration ensures that the time for each user's first card swipe is as close as possible, improving the user's first-time swipe experience. Since different card readers have significantly different cycles, generally less than 2000ms, setting the second duration to 2000ms ensures that each card reader can collect its feature information within one cycle during the first swipe. When a user swipes a card reader for the first time, data for a longer period (the second duration) is collected and temporarily stored.
[0092] 502. If the first card is successfully swiped, the terminal device extracts the first feature information from the feature information within the second time period, writes the first feature information into the database, and establishes a correspondence between the first feature information and the first card information in the database.
[0093] In this embodiment, a successful card swipe indicates that the first card selected by the terminal device can be swiped on the card reader, and a correspondence can be established between the card reader's feature information (first feature information) and the first card information. The feature information of the card reader can be bound to the first card information.
[0094] The first feature information may include the feature information of the card reader in one cycle.
[0095] Optionally, in step 502, the terminal device extracts the first feature information from the feature information within the second time period, which may include the following steps:
[0096] (21) The terminal device selects a period of feature information from the feature information within the second time period;
[0097] (22) When the period or field strength of the card reader is longer than the first duration, the terminal device divides the feature information of the one period into the feature information of N time periods; any adjacent time periods in the N time periods overlap, the length of each time period in the N time periods is less than or equal to the first duration, and the first feature information includes the feature information of the N time periods, where N is an integer greater than or equal to 2.
[0098] (23) If the period or field strength activation duration of the card reader is less than the first duration, the terminal device shall use the feature information of the one period as the first feature information.
[0099] In this embodiment, the feature information of a period can be the feature information of the card reader within the field strength on-time. For example, if the card reader's period is 1100ms and the field strength on-time is 900ms, and the field strength on-time of the card reader is longer than the first duration, the feature information within the field strength on-time can be divided into N time periods. The feature information of the N time periods can be written into a database. Any two adjacent time periods within the N time periods overlap, which can improve the accuracy of comparison.
[0100] If the reader's field strength activation duration is less than the first duration, then it is not necessary to segment the feature information of one cycle; instead, the feature information of one cycle can be written to the database as the first feature information. This can improve the data writing speed.
[0101] Please see Figure 6 , Figure 6 This is a schematic diagram illustrating how feature information from one period is divided into N time periods, as provided in an embodiment of this application. For example... Figure 6 As shown, the card reader's cycle is 1100ms, the field strength activation time is 900ms, and the characteristic information of one cycle is 900ms of characteristic information. This 900ms of characteristic information can be divided into 5 time periods (e.g., ...). Figure 6 The feature information of time periods 1, 2, 3, 4, and 5 is shown. Any two adjacent time periods overlap: time period 1 and time period 2 overlap, time period 2 and time period 3 overlap, time period 3 and time period 4 overlap, and time period 4 and time period 5 overlap.
[0102] Since the length of each time period in at least two time periods is less than or equal to the first duration, it is more likely that the amount of feature information (e.g., the number of commands) within the first duration is greater than or equal to the amount of feature information contained in each time period. The feature information contained in each time period is more likely to be included in the feature information within the first duration, thereby improving the success rate of the comparison.
[0103] 503, The terminal device collects the feature information of the card reader within the first time period.
[0104] The first duration is less than the card reader's cycle, and the first duration is less than the second duration.
[0105] 504. The terminal device compares the feature information within the first time period with the feature information set in the database. The database contains the correspondence between the feature information set and the card information set.
[0106] 505, if there is a first feature information in the feature information set that matches the feature information within the first time period, the terminal device determines the first card information corresponding to the first feature information based on the correspondence between the feature information set and the card information set.
[0107] 506, The terminal device selects the first card corresponding to the first card information and swipes it on the card reader.
[0108] The specific implementation of steps 503 to 506 can be found in the detailed description of steps 401 to 404, and will not be repeated here.
[0109] In this embodiment of the application, when the first card is successfully swiped on the card reader for the first time, a correspondence between the feature information (first feature information) of the card reader and the information of the first card can be established in the database. When swiping the card on the card reader in the future, if the feature information of the card reader collected within a first time period matches the first feature information, the corresponding first card can be found and swiped through the correspondence between the first feature information and the first card information.
[0110] This application provides an adaptive comparison algorithm that sets different algorithms based on the user's card reader characteristics. Specific solutions include the following:
[0111] 1) When a user swipes a card reader for the first time, collect data for a relatively long period of time (e.g., 2 seconds) and temporarily store the data;
[0112] 2) If the card swipe is successful, perform periodic analysis on the temporarily stored data, extract the periodic value and the feature value within a period, and write the feature value into the feature database; the feature database includes the command and timing features within this period, and names the feature (e.g., Reader_01), and maps the feature to the card used when swiping the card;
[0113] 3) If the period value is short (e.g., within 100ms), then set the data capture time for subsequent card swipes to twice that period.
[0114] 4) If the period value is long, the data within the period is divided. For example, if the period of the card reader B is 1 second, the period is divided into 5 segments. Each segment is about 300 ms. There is overlap between two adjacent time segments. The features of each time segment are stored in the feature database.
[0115] 5) When swiping the card later, set a data collection time of 300ms, capture the feature information of the card reader during this time, and compare the collected data with each time segment in the feature database. If the data of a certain time segment can be matched, it is determined that the card reader is matched with the card reader in the feature database.
[0116] The advantage of segmenting time is that for card readers with longer cycles, users do not need to place their mobile phones on the card reader for a long time to capture the data of the entire cycle, thus saving card swiping time.
[0117] This application's embodiments are designed for users with smart card selection, and can accommodate card readers with different behavioral characteristics encountered by different users. Different feature comparison methods and different data acquisition times are used to maximize both the comparison success rate and the card swiping speed. Different data acquisition times are applied to different users, rather than a one-size-fits-all approach. For card readers with long time cycles, a data segmentation method is used to shorten the data acquisition time during card swiping and accelerate the swiping speed.
[0118] Please see Figure 7 , Figure 7 This is a flowchart illustrating another card selection method provided in an embodiment of this application. For example... Figure 7 As shown, the card selection method may include the following steps.
[0119] 701, The terminal device obtains the number of commands sent by the card reader within the third time period.
[0120] In this embodiment, the terminal device can collect feature information sent by the card reader within a third time period, analyze the feature information sent by the card reader within the third time period to determine the number of commands sent within the third time period, thereby obtaining the number of commands sent by the card reader within the third time period. The number of commands may include the number of different types of commands such as REQA commands, REQB commands, SENSF commands, commands to turn off field strength, and commands to turn on field strength.
[0121] The third duration can be a pre-set fixed duration. For example, the third duration can be set to 200ms. The third duration can be equal to or different from the first duration.
[0122] Setting the third duration to a fixed duration allows users to swipe their cards at similar times, improving the user experience. For card readers with longer cycles, it can shorten the data acquisition time during swiping, thus speeding up the swiping process.
[0123] 702. The terminal device compares the number of commands sent within the third time period with the set of command counts in the database. The database contains the correspondence between the set of command counts and the set of card information. The set of command counts includes at least two command counts, and the set of card information includes at least two card information items.
[0124] At least two command quantities must be distinct. At least two card information quantities must be distinct. Each command quantity in the at least two command quantities can correspond to one card information in the card information set, and one card information in the card information set can correspond to at least one command quantity in the command quantity set.
[0125] Each command in the command set originates from a card reader. For example, the command set includes: a first command, a second command, and a third command. The first command originates from the first card reader, the second command originates from the second card reader, and the third command originates from the third card reader.
[0126] The terminal device compares the number of commands sent within the third time period with the set of command counts in the database. It can compare the number of commands sent within the third time period with the number of commands in the command count set to obtain a similarity score. If the similarity score between the number of first commands in the command count set and the number of commands sent within the third time period is greater than a second threshold, it can be determined that the number of first commands matches the number of commands sent within the third time period.
[0127] This application's embodiments can be applied to scenarios where the number of commands sent by different card readers differs significantly within a unit of time. For example, consider two access control systems: one sends approximately 40 commands within 200ms, while the other sends very few, such as around 10, commands within the same 200ms. The system can then identify which card reader is sending the commands within 200ms by collecting this data, and thus select the card corresponding to that reader.
[0128] In scenarios where the number of commands differs significantly, a rough comparison can be made using the number of commands, rather than a detailed comparison of specific command types, command time intervals, and other characteristic information. This allows for faster comparison and improves card selection speed.
[0129] Optionally, in step 702, the terminal device compares the number of commands sent within the third time period with the set of command counts in the database, including:
[0130] (31) The terminal device compares the number of commands sent within the third time period with the number of commands in the command quantity set;
[0131] (32) If the absolute value of the difference between the first command quantity and the number of commands sent within the third time period in the set of command quantities is less than the second threshold, the terminal device determines that the first command quantity matches the number of commands sent within the third time period.
[0132] In this embodiment, the second threshold can be preset and stored in the memory of the terminal device (e.g., non-volatile memory). For example, the second threshold can be set to 5. For instance, if the number of commands sent in the third time period is 42 and the number of commands sent in the first time period is 40, the absolute value of the difference between the two is less than the second threshold, and it can be determined that the number of commands sent in the first time period matches the number of commands sent in the third time period.
[0133] Before performing step 701, the following steps may also be performed:
[0134] (41) When the terminal device uses the first card to swipe the card for the first time on the card reader, the number of commands sent by the card reader within a third time period is collected.
[0135] (42) If the first card is successfully swiped, the number of commands sent within the third time period is written into the database as the first command number, and a correspondence between the first command number and the first card information is established in the database.
[0136] 703, if there is a first command quantity in the command quantity set that matches the number of commands sent within the third time period, the terminal device determines the first card information corresponding to the first command quantity based on the correspondence between the command quantity set and the card information set.
[0137] 704, The terminal device selects the first card corresponding to the first card information and swipes it on the card reader.
[0138] The embodiments of this application can be applied to scenarios where the number of commands differs greatly. A rough comparison can be made using the number of commands, without the need for a detailed comparison of the specific command types and command time intervals. This allows for faster comparison and improves the speed of card selection.
[0139] For example, reader A's cycle is as follows: turn on the signal strength, send REQA command, REQB command, turn off the signal strength; after turning on the signal strength, send REQA 2ms later, then send REQB 3ms later, turn off the signal strength 2ms later, and then turn on the signal strength again 2ms later. Thus, within 200ms, the terminal device can detect that the total number of times the signal strength is turned on / off and the total number of REQA / REQB commands exceeds 40. Reader B's cycle is as follows: turn on the signal strength, send REQA command, turn off the signal strength; after turning on the signal strength, send REQA 30ms later, then turn off the signal strength 30ms later, and then turn on the signal strength again 30ms later. Thus, within 200ms, the terminal device can detect that the total number of times the signal strength is turned on / off and the total number of REQA commands is less than 10. For these two types of readers, since the number of commands differs significantly, the number of commands can be used for differentiation, resulting in a faster identification algorithm.
[0140] The above primarily describes the solutions of the embodiments of this application from the perspective of the method execution process. It is understood that, in order to achieve the above functions, the terminal device includes the corresponding hardware structure and / or software modules for executing each function. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the various examples described in the embodiments provided herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0141] This application embodiment can divide the terminal device into functional units according to the above method example. For example, each function can be divided into a separate functional unit, or two or more functions can be integrated into one processing unit. The integrated unit can be implemented in hardware or as a software functional unit. It should be noted that the unit division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0142] Please see Figure 8 , Figure 8 This is a schematic diagram of a card selection device provided in an embodiment of this application. The card selection device 800 is applied to a terminal device and may include a data acquisition unit 801, a comparison unit 802, a determination unit 803, and a card selection unit 804, wherein:
[0143] The acquisition unit 801 is used to acquire feature information of the card reader within a first time period;
[0144] The comparison unit 802 is used to compare the feature information within the first time period with the feature information set in the database. The database contains the correspondence between the feature information set and the card information set. The feature information set includes at least two feature information sets, and the card information set includes at least two card information sets.
[0145] The determining unit 803 is configured to, when there is first feature information in the feature information set that matches the feature information within the first duration, determine the first card information corresponding to the first feature information according to the correspondence between the feature information set and the card information set; the first feature information includes feature information of at least two time periods, any two adjacent time periods overlap, one of the feature information of the at least two time periods matches the feature information within the first duration, and the length of each time period is less than or equal to the first duration;
[0146] The card selection unit 804 is used to select the first card corresponding to the first card information and swipe it on the card reader.
[0147] Optionally, the card selection device 800 may also include an extraction unit 805, a writing unit 806, and a creation unit 807;
[0148] The acquisition unit 801 is further configured to acquire feature information of the card reader within a second time period before acquiring feature information of the card reader within a first time period, when the first card is used to make the first card swipe on the card reader; the second time period is greater than or equal to the period of the card reader.
[0149] The extraction unit 805 is used to extract the first feature information from the feature information within the second time period when the first card is successfully swiped.
[0150] The writing unit 806 is used to write the first feature information into the database;
[0151] Establishment unit 807 is used to establish a correspondence between the first feature information and the first card information in the database.
[0152] Optionally, the extraction unit 805 extracts the first feature information from the feature information within the second duration, including: selecting feature information of a period from the feature information within the second duration; if the period of the card reader is greater than the first duration, dividing the feature information of the one period into feature information of N time periods; any adjacent time periods in the N time periods overlap, the length of each time period in the N time periods is less than or equal to the first duration, and the first feature information includes the feature information of the N time periods, where N is an integer greater than or equal to 2.
[0153] Optionally, the comparison unit 802 compares the feature information within the first time period with the feature information set in the database, including: comparing the feature information within the first time period with the feature information of any one of the feature information of the at least two time periods; and determining that the first feature information matches the feature information within the first time period if the similarity between the feature information of one of the feature information of the at least two time periods and the feature information of the first time period is greater than a first threshold.
[0154] Optionally, the feature information includes at least one of the following: command type, command time interval, field strength on duration, and field strength off duration.
[0155] In this embodiment, the comparison unit 802, the determination unit 803, the card selection unit 804, the extraction unit 805, the writing unit 806, and the establishment unit 807 can be processors in the terminal device. The acquisition unit 801 can be a communication module in the terminal device.
[0156] Figure 8 For a detailed implementation of the card selection device 800 shown, please refer to [link to relevant documentation]. Figure 4 or Figure 5 The method embodiments shown are not described in detail here.
[0157] In this embodiment of the application, the feature information within the first time period can be compared with the feature information of at least two overlapping time periods. Since the length of each time period in the at least two time periods is less than or equal to the first time period, and the two adjacent time periods overlap, the matching success rate can be improved, thereby improving the card selection success rate.
[0158] Please see Figure 9 , Figure 9 This is a schematic diagram of another card selection device provided in an embodiment of this application. The card selection device 900 is applied to a terminal device and may include an obtaining unit 901, a comparison unit 902, a determining unit 903, and a card selection unit 904, wherein:
[0159] The acquisition unit 901 is used to acquire the number of commands sent by the card reader within the third time period;
[0160] The comparison unit 902 is used to compare the number of commands sent within the third time period with the set of command counts in the database. The database contains the correspondence between the set of command counts and the set of card information. The set of command counts includes at least two command counts, and the set of card information includes at least two card information items.
[0161] The determining unit 903 is used to determine the first card information corresponding to the first command quantity based on the correspondence between the command quantity set and the card information set when there is a first command quantity in the command quantity set that matches the number of commands sent within the third time period.
[0162] The card selection unit 904 is used to select the first card corresponding to the first card information and swipe it on the card reader.
[0163] Optionally, the comparison unit 902 compares the number of commands sent within the third time period with the set of command numbers in the database, including: comparing the number of commands sent within the third time period with any command number in the set of command numbers; and determining that the first command number matches the number of commands sent within the third time period if the absolute value of the difference between the first command number and the number of commands sent within the third time period is less than a second threshold.
[0164] In this embodiment, the comparison unit 902, the determination unit 903, and the card selection unit 904 can be processors in the terminal device. The obtaining unit 901 can be a communication module in the terminal device.
[0165] Figure 9 For a detailed implementation of the card selection device 900 shown, please refer to [link to relevant documentation]. Figure 7 The method embodiments shown are not described in detail here.
[0166] In this embodiment, the number of commands can be used for a rough comparison, rather than a detailed comparison of specific command types, command time intervals, and other characteristic information. This allows for faster comparison and improves the speed of card selection.
[0167] Please see Figure 10 , Figure 10 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application, such as... Figure 10 As shown, the terminal device 1000 includes a processor 1001 and a memory 1002, which are interconnected via a communication bus 1003. The communication bus 1003 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The communication bus 1003 can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, Figure 10The bus is represented by a single thick line, but this does not indicate that there is only one bus or one type of bus. Memory 1002 stores computer programs, which include program instructions. Processor 1001 is configured to invoke these program instructions, which include instructions for execution. Figure 4 or Figure 5 or Figure 7 Some or all of the steps in the method shown.
[0168] The processor 1001 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the above-mentioned program.
[0169] The memory 1002 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital versatile optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. The memory may exist independently and be connected to the processor via a bus. The memory may also be integrated with the processor.
[0170] The terminal device 1000 may also include a communication module 1004, which may be an NFC-enabled communication module. The terminal device 1000 may also include general components such as a communication interface and an antenna, which will not be described in detail here.
[0171] In addition, the terminal device 1000 may include a display module.
[0172] In this embodiment of the application, the feature information within the first time period can be compared with the feature information of at least two overlapping time periods. Since the length of each time period in the at least two time periods is less than or equal to the first time period, and the two adjacent time periods overlap, the matching success rate can be improved, thereby improving the card selection success rate.
[0173] This application also provides a computer-readable storage medium storing a computer program for electronic data interchange, which causes a computer to perform some or all of the steps of any of the card selection methods described in the above method embodiments.
[0174] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0175] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0176] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical or other forms.
[0177] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0178] Furthermore, the functional units in the various embodiments of the application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software program module.
[0179] If the integrated unit is implemented as a software program module and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0180] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage device, which may include: a flash drive, a read-only memory, a random access memory, a magnetic disk, or an optical disk, etc.
[0181] The embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A card selection method, characterized in that, include: Collect feature information of the card reader within a first time period, the feature information including at least one of: command type, command time interval, field strength on duration, and field strength off duration; The feature information within the first time period is compared with the feature information of any one of the feature information of at least two time periods, wherein the feature information of the at least two time periods belongs to the feature information set of the database. If, among the feature information of at least two time periods, the similarity between the feature information of one time period and the feature information within the first time period is greater than a first threshold, it is determined that the first feature information matches the feature information within the first time period. The database contains the correspondence between a feature information set and a card information set; the feature information set includes at least two feature information items, and the card information set includes at least two card information items. If there is first feature information in the feature information set that matches the feature information within the first duration, the first card information corresponding to the first feature information is determined according to the correspondence between the feature information set and the card information set; the first feature information includes feature information of the at least two time periods, any two adjacent time periods overlap, one of the feature information of the at least two time periods matches the feature information within the first duration, and the length of each time period in the at least two time periods is less than or equal to the first duration; Select the first card corresponding to the first card information and swipe it on the card reader.
2. The method according to claim 1, characterized in that, Before collecting feature information from the card reader within a first time period, the method further includes: When the first card is swiped for the first time on the card reader, feature information of the card reader is collected within a second time period; the second time period is greater than or equal to the period of the card reader. If the first card is successfully swiped, the first feature information is extracted from the feature information within the second time period, the first feature information is written into the database, and a correspondence between the first feature information and the first card information is established in the database.
3. The method according to claim 2, characterized in that, Extracting the first feature information from the feature information within the second time period includes: Select feature information from one period of feature information within the second time period; If the period of the card reader is greater than the first duration, the feature information of the one period is divided into feature information of N time periods; any adjacent time periods in the N time periods overlap, the length of each time period in the N time periods is less than or equal to the first duration, and the first feature information includes the feature information of the N time periods, where N is an integer greater than or equal to 2.
4. A card selection method, characterized in that, include: Get the number of commands sent by the card reader within the third time period; The number of commands sent within the third time period is compared with the number of commands in the command count set in the database; If the absolute value of the difference between the first command quantity and the number of commands sent within the third time period is less than a second threshold in the command quantity set, it is determined that the first command quantity matches the number of commands sent within the third time period. The database contains the correspondence between the command quantity set and the card information set. The command quantity set includes at least two command quantities, and the card information set includes at least two card information items. If there exists a first command quantity in the command quantity set that matches the number of commands sent within the third time period, the first card information corresponding to the first command quantity is determined according to the correspondence between the command quantity set and the card information set. Select the first card corresponding to the first card information and swipe it on the card reader.
5. A card selection device, characterized in that, include: The acquisition unit is used to acquire feature information of the card reader within a first time period. The feature information includes at least one of the following: command type, command time interval, field strength on duration, and field strength off duration. The comparison unit is configured to compare the feature information within the first time period with the feature information of any one of the feature information of at least two time periods, and to determine that the first feature information matches the feature information within the first time period if the similarity between the feature information of one of the feature information of the at least two time periods and the feature information of the first time period is greater than a first threshold. The feature information of the at least two time periods belongs to the feature information set of a database, and the database contains the correspondence between the feature information set and the card information set. The feature information set includes at least two feature information items, and the card information set includes at least two card information items. The determining unit is configured to, when there is first feature information in the feature information set that matches the feature information within the first duration, determine the first card information corresponding to the first feature information according to the correspondence between the feature information set and the card information set; the first feature information includes feature information of the at least two time periods, any two adjacent time periods overlap, one of the feature information of the at least two time periods matches the feature information within the first duration, and the length of each time period is less than or equal to the first duration; The card selection unit is used to select the first card corresponding to the first card information and swipe it on the card reader.
6. A card selection device, characterized in that, include: The acquisition unit is used to obtain the number of commands sent by the card reader within the third time period; The comparison unit is configured to compare the number of commands sent within the third time period with any command number in the command number set in the database, and to determine that the first command number matches the command number sent within the third time period if the absolute value of the difference between the first command number and the command number sent within the third time period is less than a second threshold. The database contains a correspondence between the command number set and the card information set; the command number set includes at least two command numbers, and the card information set includes at least two card information sets. The determining unit is configured to, when there is a first command quantity in the command quantity set that matches the number of commands sent within the third time period, determine the first card information corresponding to the first command quantity according to the correspondence between the command quantity set and the card information set; The card selection unit is used to select the first card corresponding to the first card information and swipe it on the card reader.
7. A terminal device, characterized in that, The method includes a processor and a memory, the memory being used to store a computer program, the computer program including program instructions, and the processor being configured to invoke the program instructions to perform the method as described in any one of claims 1 to 4.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the method as described in any one of claims 1 to 4.