WO2022252561A1 - 刷卡方法、卡控制器、电子设备及存储介质 - Google Patents

刷卡方法、卡控制器、电子设备及存储介质 Download PDF

Info

Publication number
WO2022252561A1
WO2022252561A1 PCT/CN2021/137915 CN2021137915W WO2022252561A1 WO 2022252561 A1 WO2022252561 A1 WO 2022252561A1 CN 2021137915 W CN2021137915 W CN 2021137915W WO 2022252561 A1 WO2022252561 A1 WO 2022252561A1
Authority
WO
WIPO (PCT)
Prior art keywords
card
card application
application programs
swiping
applications
Prior art date
Application number
PCT/CN2021/137915
Other languages
English (en)
French (fr)
Inventor
王大耀
Original Assignee
深圳市汇顶科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市汇顶科技股份有限公司 filed Critical 深圳市汇顶科技股份有限公司
Publication of WO2022252561A1 publication Critical patent/WO2022252561A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/10009Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation sensing by radiation using wavelengths larger than 0.1 mm, e.g. radio-waves or microwaves
    • G06K7/10297Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation sensing by radiation using wavelengths larger than 0.1 mm, e.g. radio-waves or microwaves arrangements for handling protocols designed for non-contact record carriers such as RFIDs NFCs, e.g. ISO/IEC 14443 and 18092

Definitions

  • the embodiment of the present application relates to the technical field of near field communication, and in particular to a method for swiping a card, a card controller, an electronic device, and a storage medium.
  • the user is required to switch the card on the display interface of the device carrying the card application program, and it is inconvenient for the user to use the simulated smart card to swipe the card, and the convenience of swiping the card is low.
  • the purpose of the embodiment of the present application is to provide a card swiping method, card controller, electronic equipment and storage medium, which can realize self-adaptive card swiping, without the need to reconfigure the card reader and reduce costs;
  • the device interface of the program performs manual switching operations to improve the convenience of swiping cards.
  • the embodiment of the present application provides a card swiping method, which is applied to the card controller, including: when the radio frequency field entering the card reader is detected, enter the card selection step, and the card selection step includes: According to the priority order of the built-in N card applications, select a card application with the highest priority from the card applications that have not been selected in this card selection step, as Target card application program, the N is an integer greater than or equal to 2; call the target card application program, and utilize the target card application program to interact with the card reader; during the interaction process, when the card When the controller detects that the radio frequency field of the card reader is reset, the target card application program is deactivated, and the card selection step is repeated until any card application program in the N card application programs is compatible with the reader. The card device interaction is successful, or, the N card application programs have all been selected in this card selection step and none of them have interacted successfully.
  • the embodiment of the present application also provides another card swiping method, including: when the radio frequency field entering the card reader is detected, enter the protocol confirmation step of this card swiping process, and the protocol confirmation step includes: from the built-in M group In the card application program, a group of card application programs that have not been selected in this card swiping process are selected as the target group, wherein the communication protocol types used by any two card application programs in the M group of card application programs are different, And the communication protocol types of all card applications in each group of card applications are the same, and the M is an integer greater than or equal to 2; any card application in the target group is called, and the called in the target group
  • the communication protocol label of the card application program is sent to the card reader for the card reader to perform protocol confirmation; if the protocol confirmation fails, the called card application program in the target group is deactivated, and the described procedure is repeated.
  • Agreement confirmation step until any card application agreement confirmation in any group of card application programs is successful, or the M group card application programs have been selected in this card swiping process but all agreement confirmation fails; if the agreement confirmation is successful, Then use the card application program called in the target group to perform key value authentication with the card reader; if the key value authentication is successful, then use the card application program called in the target group to perform key value authentication with the card reader Data interaction; if it is detected that the radio frequency field of the card reader is reset, and the target group contains N card applications, and when N is an integer greater than or equal to 2, enter the card selection step of this card swiping process , the card selection step includes: according to the priority order of the N card applications in the target group, select the card application with the highest priority from the card applications that have not been selected in this card swiping process , as the target card application program, the N is an integer greater than or equal to 2; call the target card application program, and use the target card application program to perform key value authentication with the card reader; if
  • Embodiments of the present application also provide a card controller, including: at least one processing module; and a storage module communicatively connected to the at least one processing module; wherein the storage module stores information that can be used by the at least one An instruction executed by the processing module, the instruction is executed by the at least one processing module, so that the at least one processing module can execute the above-mentioned first card swiping method.
  • the embodiment of the present application also provides an electronic device, including at least N card application programs and the above-mentioned card controller, where N is an integer greater than or equal to 2.
  • Embodiments of the present application also provide a card controller, including: at least one processing module; and a storage module communicatively connected to the at least one processing module; wherein the storage module stores information that can be used by the at least one An instruction executed by the processing module, the instruction is executed by the at least one processing module, so that the at least one processing module can execute the above-mentioned second card swiping method.
  • the embodiment of the present application also provides an electronic device, including at least M groups of card application programs, and the card controller as claimed in claim 17, wherein, the M is an integer greater than or equal to 2, and the M
  • the communication protocol types used by any two groups of card applications in the group card application programs are different, and the communication protocol types of all card application programs in each group of card application programs are the same, and at least one group of card application programs in the M group of card application programs It includes N card application programs, where N is an integer greater than or equal to 2.
  • Embodiments of the present application also provide a computer-readable storage medium storing a computer program, wherein, when the computer program is executed by the processing module, the above-mentioned first card swiping method or the second card swiping method is realized.
  • the first card swiping method provided by this application utilizes the characteristic that the RF field of the card reader is reset after the interaction between the card reader and the card application program fails, as a switching condition for the card application program.
  • the card selection step includes: according to the priority order of the built-in N card application programs, the cards that have not been selected in the current card selection step Select the card application with the highest priority in the card application as the target card application; call the target card application, and use the target card application to interact with the card reader, if the radio frequency of the card reader is detected during the interaction Field reset, according to the characteristic that the card reader’s RF field resets after the interaction fails, it can be known that the currently called card application fails to interact with the card reader.
  • the selected card application program interacts with the card reader using another card application program that has not been selected in this card selection step until any card application program in the N card application programs interacts with the card reader.
  • the interaction is successful, or, N card applications have been selected in this card selection step and none of them have interacted successfully, so as to realize automatic switching of card applications and adaptive card swiping, without the need to set the device interface of the card application Manual card cutting operation improves the convenience of card swiping.
  • the improvement of the card end in this application can be applied to the existing card reader end, there is no need to restructure the card reader end, and the cost can be reduced.
  • Fig. 1 is a schematic flow diagram of a method for swiping a card according to the present application
  • Fig. 2 is a schematic flow chart according to another card swiping method in the present application.
  • Fig. 3 is a schematic structural diagram of a card controller according to the present application.
  • Fig. 4 is a schematic structural diagram of another card controller according to the present application.
  • Fig. 5 is a schematic structural diagram of an electronic device according to the present application.
  • Fig. 6 is a schematic structural diagram of another electronic device according to the present application.
  • Various traditional smart cards such as bus cards, bank cards, medical insurance cards, etc.
  • chips used for smart cards, one is contact card swiping, such as the common card insertion POS machine.
  • the other type is non-contact card swiping, which contains a non-contact data transmission control chip (including supporting antenna) similar to NFC, such as a common bus card that is swiped near a card reader.
  • these common physical card functions are simulated by electronic devices (such as mobile phones).
  • a smart card so that the same electronic device can realize the simulation of multiple cards and multiple cards through the cooperation of the NFC chip (the chip is integrated with the card controller) and the security element, which is equivalent to installing multiple smart cards on the mobile phone.
  • the same electronic device can be used on different occasions to achieve different behaviors such as card swiping authentication and card swiping consumption.
  • the application scenario of the card swiping method in this application is in the non-contact card swiping scenario.
  • the mentioned card application program can be understood as the application program of multiple smart cards integrated in the electronic device, such as: bus card application program, access control card apps, bank card apps, etc.
  • the present application relates to a card swiping method, which is applied to a card controller, including: when the radio frequency field entering the card reader is detected, enter the card selection step, and the card selection step includes: according to the priority sequence of the built-in N card applications , select the card application with the highest priority from the card applications that have not been selected in this card selection step, as the target card application, N is an integer greater than or equal to 2; call the target card application, and use the target
  • the card application program interacts with the card reader; during the interaction process, when the RF field reset of the card reader is detected, the target card application program is deactivated, and the card selection step is repeated until any card in the N card application programs
  • the application program interacts successfully with the card reader, or, N card application programs have all been selected in this card selection step and none of them have interacted successfully.
  • the RF field of the card reader is reset.
  • the RF field reset refers to the process of the RF field from opening-closing-opening.
  • the card reader and the card can be used.
  • the card reader RF field resets this feature as a switching condition for the card application.
  • the card selection step includes: according to the priority order of the built-in N card application programs, the cards that have not been selected in the current card selection step Select the card application with the highest priority in the card application as the target card application; call the target card application, and use the target card application to interact with the card reader, if the radio frequency of the card reader is detected during the interaction Field reset, that is, it is detected that the RF field of the card reader has gone through the process from being turned on to off and then turned on again. According to the characteristic of the card reader’s RF field reset after the interaction fails, the currently called card application and the reader Card interaction failed.
  • the card application that has been selected interacts with the card reader using another card application that has not been selected in this card selection step until any card application in the N card applications interacts with the card reader successfully , or, N card applications have been selected in this card selection step and none of them have interacted successfully, so that the card controller can automatically switch card applications to realize adaptive card swiping.
  • the device interface can be used to manually switch the card, which improves the convenience of swiping the card.
  • the card controller at the card end performs the card selection step to realize automatic switching of the card application program, so it can be applied to the existing card reader end, and there is no need to modify the card reader end
  • the card application program to be recognized can be selected from multiple card application programs, and the cost can be reduced.
  • Step 101 According to the priority order of the built-in N card applications, select the card application with the highest priority from the card applications that have not been selected in this card selection step as the target card application, where N is greater than or an integer equal to 2.
  • a target card application program is selected from the built-in N card application programs, and after the target card application program enters the radio frequency field of the card reader, it will This swipe step has not been selected, that is, the target card application has not attempted to interact with the reader during this swipe step after entering the reader's RF field.
  • five card applications Shenzhen Tong bus card application, Wuhan Tong bus card application, access control card application, China Merchants Bank card application and medical insurance card application, are built in an electronic device. After entering the radio frequency field of the card reader, none of them have been selected and tried to interact with the card reader during this card swiping step.
  • one card application can be selected from these five card applications as the target card application .
  • the Shenzhen Tong bus card application and the access control card application have been selected in this card selection step among the five card applications, it is necessary to choose from the China Merchants Bank card application, Wuhan Tong bus card application, and medical insurance card application.
  • Card application program Select one card application program from the three card application programs as the target card application program.
  • the target card application when selecting the target card application, according to the priority order of the built-in N card applications, select the card application with the highest priority from the card applications that have not been selected in this card selection step as the target card application.
  • the priority order can be set randomly.
  • the second method is to set the priority order of the N card applications according to the historical interaction success times of each card application in the N card applications, wherein the higher the history interaction success times of the card application, the higher the card application The higher the priority.
  • the priority order of the N card application programs is automatically set by the card controller according to the historical interaction success times of each of the N card application programs.
  • the user can also set it on the display interface of the electronic device equipped with the card controller, so as to meet the personalized needs of different users.
  • the third method is to set the priority order of the N card application programs according to the priority of the radio frequency communication parameters corresponding to each card application program in the N card application programs; wherein, the higher the priority of the radio frequency communication parameters, the higher the priority of the radio frequency communication parameters.
  • the card application corresponding to the parameter has higher priority.
  • the card controller pre-obtains radio frequency communication parameters corresponding to each of the N card application programs to obtain N sets of radio frequency communication parameters.
  • This scheme provides another way to determine the N
  • the priority order of radio frequency communication parameters can be automatically generated by the controller, so that the priority order of N card application programs can be automatically generated without user setting or statistical historical data.
  • radio frequency communication parameters can be understood as: the communication parameters required to establish an air interface connection between the card application program and the card reader, that is to say, the radio frequency communication parameters of the card application program are used to establish a communication connection with the card reader parameter.
  • radio frequency communication parameters may include, but are not limited to: user identification (User Identification, UID), request response (Answer to Request, ATQ), selection confirmation command (Select Acknowledge, SAK), selection response (Answer To Select , ATS), key KEY, etc.
  • the priority sequence of the group of radio frequency communication parameters may be determined according to the priority sequence of any one of the above radio frequency communication parameters.
  • Step 102 call the target card application program, and use the target card application program to interact with the card reader.
  • the target card application is invoked to interact with the card reader through the target card application.
  • the calling of the target card application mentioned here can be understood as running the target card application in the electronic device.
  • the five card applications of Shenzhen Tong bus card application, Wuhan Tong bus card application, access control card application, China Merchants Bank card application and medical insurance card application were not selected in this card swiping step and were not connected with the reader.
  • the card reader has tried to interact with one card application from the five card applications of Shenzhen Tong bus card application, Wuhan Tong bus card application, access control card application, China Merchants Bank card application and medical insurance card application, for example
  • Shenzhen Tong bus card application as the target card application, invokes the Shenzhen Tong bus card application, and uses the Shenzhen Tong bus card application to interact with the card reader.
  • the target card application program when the target card application program interacts with the card reader in this solution, it includes: using the target card application program to perform protocol confirmation with the card reader, and using the target card application program to perform key verification with the card reader after the protocol confirmation is successful. There are three steps: value authentication and key value authentication, which use the target card application program to perform data interaction with the card reader after successful key value authentication.
  • the protocol confirmation fails, the key value authentication fails, or the data interaction fails, the RF field of the card reader is reset.
  • the target card application and the card reader will be repeatedly used for data interaction, so as to avoid data interaction failure due to network reasons.
  • Step 103 During the interaction process, judge whether the reset of the radio frequency field of the card reader is detected, and if it is judged to be yes, go to step 104; if it is judged to be no, then end the process.
  • the card application In the card selection step, when any card application fails to interact with the card reader, the card application will send a 4-bit NACK message to the card reader, and the card reader will execute when receiving the 4-bit NACK message RF field reset operation.
  • the RF field reset In the process of using the target card application program to interact with the card reader, by judging whether the RF field reset of the card reader is detected, it can be confirmed whether the interaction between the target card application program and the card reader is successful, and the RF field reset can be understood as The state of the radio frequency field changes from on to off, and then to on. If it is detected that the state of the radio frequency field has undergone the change process of "on-off-on", it can be determined that the radio frequency field of the card reader is reset.
  • step 104 deactivate the target card application program, and judge whether N card application programs have been selected in this card selection step
  • the RF field of the card reader is not reset, it can be determined that the interaction between the card application program and the card reader is successful, and the process can be ended at this time.
  • the radio frequency field of the card reader needs to last for a certain length of time when it is reset, and this length of time can ensure that the entire interaction process between the card application program and the card reader ends, so that the detected results are more accurate.
  • the length of time may be set according to actual needs, and is not specifically limited in this embodiment.
  • Step 104 Deactivate the target card application program, and determine whether all N card application programs have been selected in this card selection step. When the determination is yes, the process ends; when the determination is no, return to step 101 for execution.
  • the target card application is deactivated, so as to avoid affecting the subsequent communication between another card application and the card reader. interaction.
  • the target card application is deactivated, so as to avoid affecting the subsequent communication between another card application and the card reader. interaction.
  • the card swiping process can end at this point.
  • the method further includes: outputting information of interaction failure.
  • the specific form of outputting the information of interaction failure may be to display the words "interaction failure" on the display interface of the electronic device including the card controller, or to prompt the user for the information of interaction failure through vibration, thereby prompting Failed user interaction to avoid multiple swipes from the user.
  • the display form of the above-mentioned interaction failure information is only an example and should not be limited thereto.
  • the N A card application is reset as not yet selected, so that when the card application is used to try to interact with another card reader, the card application will not be missed, so that the accuracy of the card swiping result can be guaranteed.
  • N card application programs all use the same communication protocol, and in this solution, adaptive card swiping for multiple card applications of the same protocol can be realized.
  • the N card application programs in this embodiment all use the yula protocol.
  • the N card application programs in this embodiment may also include card applications that use different communication protocols. .
  • step division of the above various methods is only for the sake of clarity of description. During implementation, it can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent. ; Adding insignificant modifications or introducing insignificant designs to the algorithm or process, but not changing the core design of the algorithm and process are all within the scope of protection of this patent.
  • the present application also provides another card swiping method, including: when the radio frequency field entering the card reader is detected, enter the protocol confirmation step of this card swiping process, and the protocol confirmation step includes: from the built-in M group card application program Select a group of card applications that have not been selected in this card swiping process as the target group, wherein the communication protocol types used by any two groups of card applications in the M group of card applications are different, and each group The communication protocol types of all card applications in the card application are the same, and the M is an integer greater than or equal to 2; any card application in the target group is called, and the called card application in the target group The communication protocol label is sent to the card reader for the card reader to confirm the protocol; if the protocol confirmation fails, the called card application program in the target group is deactivated, and the protocol confirmation step is repeated until Any one card application program agreement confirmation in any group of card application programs is successful, or the M group card application programs have been selected in this card swiping process but all agreement confirmation failures; if
  • the protocol confirmation step of this card swiping process is first performed to confirm from the M group of card applications the communication protocol of which group of card applications the card reader is suitable for , when the target group applicable to the card reader is confirmed, first continue to use the card application program called in the protocol confirmation step to perform key value authentication and data interaction with the card reader. If any step fails, it indicates that the target group is The invoked card application program is not suitable for the card reader, and a card selection step is required at this time. In the card selection step, according to the priority order of the N card applications in the target group, select the card application with the highest priority from the card applications that have not been selected in the current card swiping process as the target card application program.
  • the communication protocols in all card applications in the target group are the same, after the protocol confirmation is successful, there is no need to use the target card application program and the reader for the protocol authentication step, only need to use the target card application program and the reader for key value authentication , data interaction steps.
  • the card applications that have not been selected they perform key value authentication and data interaction with the card reader until any card application in the N card applications successfully interacts with the card reader data, or the N card applications are in this In the process of swiping the card for the first time, all have been selected and no data interaction has been successful, so that the card controller can automatically switch card applications of various protocol types and multiple card applications of the same protocol type to realize self-adaptive swiping of cards.
  • the card controller at the card end performs the card selection step to realize automatic switching of the card application program, so it can be applied to the existing card reader end, and there is no need to modify the card reader end
  • the card application program to be identified can be selected from the card application programs of multiple protocol types and multiple card application programs of the same protocol type, which can reduce the cost.
  • Step 201 Select a group of card applications that have not been selected in the current card swiping process from the built-in M group of card applications as the target group, wherein any two groups of card applications in the M group of card applications use
  • the types of communication protocols are different, and the communication protocol types of all card applications in each group of card applications are the same, and M is an integer greater than or equal to 2.
  • the card applications using different protocol types are classified into a group of card applications, so that the communication protocol types of all card applications in each group of card applications are the same, and the communication protocol used by any two groups of card applications The protocol types are different, so as to confirm the protocol types according to different groups in the subsequent steps.
  • card applications with the same protocol may all be card applications with the same function, such as transportation card applications, or may be card applications with multiple functions.
  • the target group card application program when selecting the target group card application program, according to the priority order of the built-in M group card application programs, select the group with the highest priority from the multi-group card application programs that have not been selected in this card selection step Card application, as target group.
  • the priority order can be set randomly.
  • the second method is to set the priority sequence of the M group of card applications according to the historical interaction success times of each group of card applications in the M group of card applications, wherein the higher the historical interaction success times of the group card applications, the group The card application has higher priority.
  • the card controller automatically sets the priority order of the M groups of card applications according to the sum of the historical interaction success times of each card application of each group of card applications in the M groups of card applications.
  • the user can also set it on the display interface of the electronic device equipped with the card controller, so as to meet the personalized needs of different users.
  • Step 202 call any card application in the target group, and send the communication protocol label of the called card application in the target group to the card reader for the card reader to confirm the protocol.
  • any card application program in the target group call any card application program in the target group, and use the communication protocol label of the called card application program in the target group to perform protocol confirmation with the card reader. For example, when the protocol type used by the called card application program in the target group is the yula protocol, then send the yula tag to the card reader for protocol confirmation.
  • Step 203 Judging whether the protocol confirmation is successful, if the judgment fails, go to step 204; if the judging is successful, go to step 205.
  • the protocol confirmation indicates that the protocol used by the called card application program is compatible with the card reader.
  • other steps such as key value authentication need to be performed using the current target group card application program and the card reader , that is, enter step 205 (determine whether the key value authentication is successful using the called card application program in the target group and the card reader). If the protocol confirmation fails, it indicates that the protocol used by the called card application program is not compatible with the card reader. At this time, it is necessary to switch the card application programs of other groups to try, that is, to enter step 204 (deactivate the card application program in the target group) Called card application, and determine whether the M group card application has been selected during the current card swiping process)
  • Step 204 Deactivate the called card applications in the target group, and determine whether the M group of card applications have been selected during the current card swiping process. If the determination is yes, the process ends; if the determination is no, then Return to step 201 for execution.
  • the called card application program in the target group is deactivated, so as to avoid affecting the subsequent protocol confirmation between another card application program and the card reader.
  • the called card application program in the target group is deactivated, so as to avoid affecting the subsequent protocol confirmation between another card application program and the card reader.
  • the card swiping process can end at this time.
  • Step 205 Determine whether the key value authentication is successful using the called card application program in the target group and the card reader. If it is determined to be successful, proceed to step 206; if the determination fails, proceed to step 207.
  • the protocol confirmation is successful, it indicates that the protocol used by the called card application program is compatible with the card reader.
  • the called card application program and the card reader can continue to be used for key value authentication.
  • it indicates that the card application program can be used to perform data interaction with the card reader that is, enter step 206 (determine whether the card application program in the target group is used to perform data interaction with the card reader successfully). If the judgment fails, it shows that the called card application program can not be read by the card reader. If there are other card application programs in the current target group at this time, you need to switch other card application programs for further confirmation, that is, enter step 207 ( It is judged whether the number of card applications in the target group is greater than or equal to 2).
  • Step 206 Determine whether data interaction with the card reader using the called card application program in the target group is successful, if it is determined to be successful, then the process ends; if the determination fails, then go to step 207.
  • Step 207 Determine whether the number of card applications in the target group is greater than or equal to 2. If it is determined to be yes, enter step 208; if it is determined to be no, the process ends.
  • Step 208 According to the priority order of the N card applications in the target group, select the card application with the highest priority from the card applications that have not been selected in the current card swiping process as the target card application, N is an integer greater than or equal to 2.
  • a target card application program is selected from N card application programs in the target group, and the target card application program has not been selected after entering the radio frequency field of the card reader, that is, the target card application program The program has not tried to interact with the card reader during this interaction.
  • the target card application when selecting the target card application, according to the priority order of the built-in N card applications, select the card application with the highest priority from the card applications that have not been selected in this card selection step as the target card application.
  • the priority order can be set randomly.
  • the second method is to set the priority order of the N card applications according to the historical interaction success times of each card application in the N card applications, wherein the higher the history interaction success times of the card application, the higher the card application The higher the priority.
  • the priority order of the N card application programs is automatically set by the card controller according to the historical interaction success times of each of the N card application programs.
  • the user can also set it on the display interface of the electronic device equipped with the card controller, so as to meet the personalized needs of different users.
  • the third method is to set the priority sequence of the N card application programs according to the priority of the radio frequency communication parameters corresponding to each card application program in the N card application programs; among them, the higher the priority of the radio frequency communication parameters, the higher the priority of the radio frequency communication parameters.
  • the card application corresponding to the parameter has higher priority.
  • the card controller pre-obtains radio frequency communication parameters corresponding to each of the N card application programs to obtain N sets of radio frequency communication parameters.
  • This scheme provides another way to determine the N
  • the priority order of radio frequency communication parameters can be automatically generated by the controller, so that the priority order of N card application programs can be automatically generated without user setting or statistical historical data.
  • radio frequency communication parameters can be understood as: the communication parameters required to establish an air interface connection between the card application program and the card reader, that is to say, the radio frequency communication parameters of the card application program are used to establish a communication connection with the card reader parameter.
  • radio frequency communication parameters may include, but are not limited to: user identification (User Identification, UID), request response (Answer to Request, ATQ), selection confirmation command (Select Acknowledge, SAK), selection response (Answer To Select , ATS), key KEY, etc.
  • the priority sequence of the group of radio frequency communication parameters may be determined according to the priority sequence of any one of the above radio frequency communication parameters.
  • Step 209 call the target card application program, and use the target card application program and the card reader to authenticate the key value.
  • the target card application is invoked to use the target card application to perform key value authentication with the card reader.
  • the target card application program and card reader that have not been selected in the process of swiping the card in the switching of the target group
  • Step 210 Determine whether the key value authentication using the target card application program and the card reader is successful, if it is determined to be successful, go to step 211; if the judgment fails, go to step 212.
  • step 211 determines whether the target card application program is used to perform data interaction with the card reader successfully. If the judgment fails, it indicates that the target card application program cannot be read by the card reader. At this time, if there are other card application programs in the current target group that have not been selected during the current card swiping process, you need to switch to this card application program. Other card applications that have not been selected during the second card swiping process are further confirmed, that is, enter step 212 (deactivate the target card application program, and determine whether the N card applications have all been selected during this card swiping process).
  • Step 211 Determine whether the data interaction between the target card application program and the card reader is successful. If the determination is successful, the process ends; if the determination fails, enter step 212.
  • the target card application program can continue to be used for data interaction with the card reader. If the data interaction is successful, it indicates that the target card application program and the card reader The entire interaction process is complete, at which point the process can be ended. If the data interaction fails, you need to switch to other card applications that have not been selected during this card swiping process for further confirmation, that is, enter step 212 (deactivate the target card application program, and determine whether the N card applications are in this card swiping process) were selected during the process).
  • Step 212 Deactivate the target card application program, and determine whether all N card application programs have been selected during this card swiping process. If the determination is yes, the process ends; if the determination is no, return to step 208 for execution.
  • the radio frequency field of the card reader is reset after the key value authentication or data interaction between the card application program and the card reader fails. Therefore, when the RF field reset of the card reader is detected, it can be confirmed that the key value authentication or data interaction between the card application and the card reader fails. It can be determined that there is no card application program that can be read by the card reader among the N card application programs, and at this time, the card swiping process can end.
  • the failure also includes: outputting information about the interaction failure.
  • the specific form of outputting the information of interaction failure may be to display the words "interaction failure" on the display interface of the electronic device including the card controller, or to prompt the user for the information of interaction failure through vibration, thereby prompting the user to interact Fail to avoid user swiping multiple times.
  • the display form of the above-mentioned interaction failure information is only an example and should not be limited thereto.
  • any of the N card applications successfully interacts with the card reader, or after all N card applications have been selected during this card swiping process and none of them have successfully interacted, it also includes : Reset all N card applications to not selected yet.
  • the N card application is reset as not yet selected, so that when the card application is used to try to interact with another card reader, the card application will not be missed, so that the accuracy of the card swiping result can be guaranteed.
  • the agreement confirmation of any card application program in any group of card application programs is successful, or after the M group card application programs have been selected in this card swiping process but all agreement confirmations fail, it also includes: Card applications are reset to not being selected. In this way, when using the M group of card application programs to try to interact with another card reader, any one of the M group of card application programs will not be missed, which can ensure the accuracy of card swiping results. Specifically, the method of distinguishing whether any group of card application programs in the M groups of card application programs is selected can also be realized by setting or removing flags, which will not be repeated here.
  • step division of the above various methods is only for the sake of clarity of description. During implementation, it can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent. ; Adding insignificant modifications or introducing insignificant designs to the algorithm or process, but not changing the core design of the algorithm and process are all within the scope of protection of this patent.
  • the present application also relates to a card controller, as shown in FIG. 3 , including at least one processing module 301; and a storage module 302 communicatively connected to at least one processing module 301; wherein, the storage module 302 stores information that can be processed by at least one
  • the instructions executed by the module 301 are executed by at least one processing module 301, so that at least one processing module 301 can execute the above-mentioned first card swiping method.
  • the storage module 302 and the processing module 301 are connected by a bus, and the bus may include any number of interconnected buses and bridges, and the bus connects one or more processing modules 301 and various circuits of the storage module 302 together.
  • the bus may also connect together various other circuits such as peripherals, voltage regulators, and power management circuits, all of which are well known in the art and therefore will not be further described herein.
  • the bus interface provides an interface between the bus and the transceivers.
  • a transceiver may be a single element or multiple elements, such as multiple receivers and transmitters, providing means for communicating with various other devices over a transmission medium.
  • the data processed by the processing module 301 is transmitted on the wireless medium through the antenna, and further, the antenna also receives the data and transmits the data to the processing module 301 .
  • the processing module 301 is responsible for managing the bus and general processing, and may also provide various functions including timing, peripheral interface, voltage regulation, power management, and other control functions.
  • the storage module 302 can be used to store data used by the processing module 301 when performing operations.
  • the present application also relates to an electronic device.
  • the electronic device 3 includes at least N card application programs and the above-mentioned card controller as shown in FIG. 3 , where N is an integer greater than or equal to 2.
  • the card controller can be set in the electronic device 3, and the electronic device 3 can be a smart phone, a smart bracelet, a smart watch, and the like.
  • the electronic device 3 when the electronic device 3 is a mobile phone, the user takes a bus and picks up the mobile phone close to the card reader configured on the bus, the mobile phone can detect the NFC radio frequency field of the card reader, thereby determining the mobile phone into the card reader RF range.
  • the card controller in the mobile phone detects the NFC radio frequency field of the card reader, thereby determining that the mobile phone enters the radio frequency range of the card reader.
  • the card controller can also be set in devices such as NFC universal integrated circuit card (Universal Integrated Circuit Card, UICC), Micro SD card, NFC embedded secure element (Embedded Secure Element, eSE).
  • NFC universal integrated circuit card Universal Integrated Circuit Card, UICC
  • Micro SD card Micro SD card
  • NFC embedded secure element Embedded Secure Element, eSE
  • the card application program can be understood as an application program of multiple smart cards integrated in the electronic device 3, for example: a bus card application program, an access control card application program, a bank card application program, and the like.
  • the present application also relates to another card controller, as shown in FIG. 5 , including at least one processing module 401; and a storage module 402 communicatively connected to at least one processing module 401;
  • the instructions executed by the processing module 401 are executed by at least one processing module 401, so that the at least one processing module 401 can execute the above-mentioned second card swiping method.
  • the storage module 402 and the processing module 401 are connected by a bus, and the bus may include any number of interconnected buses and bridges, and the bus connects one or more processing modules 401 and various circuits of the storage module 402 together.
  • the bus may also connect together various other circuits such as peripherals, voltage regulators, and power management circuits, all of which are well known in the art and therefore will not be further described herein.
  • the bus interface provides an interface between the bus and the transceivers.
  • a transceiver may be a single element or multiple elements, such as multiple receivers and transmitters, providing means for communicating with various other devices over a transmission medium.
  • the data processed by the processing module 401 is transmitted on the wireless medium through the antenna, and further, the antenna also receives the data and transmits the data to the processing module 401 .
  • the processing module 401 is responsible for managing the bus and general processing, and may also provide various functions including timing, peripheral interface, voltage regulation, power management, and other control functions.
  • the storage module 402 can be used to store data used by the processing module 401 when performing operations.
  • the present application also relates to an electronic device.
  • the electronic device 4 includes at least M groups of card application programs and a card controller as shown in FIG. 5, wherein M is an integer greater than or equal to 2, and M groups
  • M is an integer greater than or equal to 2
  • M groups The types of communication protocols used by any two groups of card applications in the card applications are different, and the communication protocol types of all card applications in each group of card applications are the same, and at least one group of card applications in the M group of card applications includes N Card application program, N is an integer greater than or equal to 2.
  • the card controller can be set in the electronic device 4, and the electronic device 4 can be a smart phone, a smart bracelet, a smart watch, and the like.
  • the electronic device 4 when the electronic device 4 is a mobile phone, the user takes a bus and picks up the mobile phone close to the card reader configured on the bus.
  • the mobile phone can detect the NFC radio frequency field of the card reader, thereby determining whether the mobile phone enters the card reader.
  • RF range In a specific implementation, the card controller in the mobile phone may detect the NFC radio frequency field of the card reader, thereby determining that the mobile phone enters the radio frequency range of the card reader.
  • the card controller can also be set in devices such as NFC universal integrated circuit card (Universal Integrated Circuit Card, UICC), Micro SD card, NFC embedded secure element (Embedded Secure Element, eSE).
  • NFC universal integrated circuit card Universal Integrated Circuit Card, UICC
  • Micro SD card Micro SD card
  • NFC embedded secure element Embedded Secure Element, eSE
  • the card application program can be understood as an application program of multiple smart cards integrated in the electronic device 4, for example: a bus card application program, an access control card application program, a bank card application program, and the like.
  • the present application also relates to a computer-readable storage medium storing a computer program, and when the computer program is executed by the processing module, the above-mentioned first or second card swiping method is realized.
  • a storage medium includes several instructions to make a device ( It may be a single-chip microcomputer, a chip, etc.) or a processing module (processor) to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory module (ROM, Read-Only Memory), random access memory module (RAM, Random Access Memory), magnetic disk or optical disc, etc., which can store program codes. medium.

Landscapes

  • Engineering & Computer Science (AREA)
  • Toxicology (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Electromagnetism (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • General Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Stored Programmes (AREA)

Abstract

一种刷卡方法、卡控制器、电子设备及存储介质,涉及近场通信技术领域。该种刷卡方法在检测到进入读卡器的射频场时,进入选卡步骤,选卡步骤包括:从内置的N个卡应用程序选取目标卡应用程序;调用目标卡应用程序,并利用目标卡应用程序与读卡器进行交互;在交互过程中,当检测到读卡器的射频场复位时,停用目标卡应用程序,并重复选卡步骤,直至N个卡应用程序中任一卡应用程序与读卡器交互成功,或者,N个卡应用程序在本次选卡步骤中均被选取过且均未交互成功。上述方法能够实现自适应刷卡,无需对读卡器端进行改造重构,降低成本;同时也无需在设置卡应用程序的设备界面进行手动切卡操作,提高刷卡的便捷性。

Description

刷卡方法、卡控制器、电子设备及存储介质
交叉引用
本申请基于申请号为“2021106144069”、申请日为2021年06月02日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此以引入方式并入本申请。
技术领域
本申请实施例涉及近场通信技术领域,特别涉及一种刷卡方法、卡控制器、电子设备及存储介质。
背景技术
为实现对集成多种通信协议的多张卡应用程序的电子设备的刷卡识别,现有一种方式为:对读卡器端进行硬件和软件升级改造,从而使得读卡器端能够根据协议类型不同从多种通信协议的多张卡应用程序中识别出对应协议的卡应用程序。此技术关注于读卡器端实现,需要全部替换当前的读卡器端,成本较大;而且当存在支持同一通信协议的多张卡应用程序时,由于读卡器端无法区分根据协议标签区分出是哪个卡应用程序发出的,因此,读卡器端无法从多个支持同一通信协议的卡应用程序中选取相应的卡应用程序。
为实现对集成多个支持同一通信协议的卡应用程序的电子设备的刷卡识别,现有另一种方式为:使用手持终端(比如手机)模拟智能卡的刷卡业务过程中,需要使用者在刷卡之前进行一系列操作,这些操作如下:首先,点亮手机屏幕,并进入选卡程序;然后,选择一张卡进行接下来的刷卡;最后,将手机靠近刷卡设备,利用选择的卡进行刷卡。也就是说,此种方式中需要用户在承载有卡应用程序的设备显示界面进行切卡操作,给用户使用模拟的智能卡进行刷卡产生了一些不便利,刷卡的便捷性较低。
发明内容
本申请实施方式的目的在于提供一种刷卡方法、卡控制器、电子设备及存储介质,能够 实现自适应刷卡,无需对读卡器端进行改造重构,降低成本;同时也无需在设置卡应用程序的设备界面进行手动切卡操作,提高刷卡的便捷性。
为解决上述技术问题,本申请的实施方式提供了一种刷卡方法,应用于卡控制器,包括:当检测到进入读卡器的射频场时,进入选卡步骤,所述选卡步骤包括:根据内置的N个卡应用程序的优先级顺序,从本次选卡步骤中尚未被选取过的卡应用程序中选取优先级最高的卡应用程序中选取一个尚未被选取过的卡应用程序,作为目标卡应用程序,所述N为大于或等于2的整数;调用所述目标卡应用程序,并利用所述目标卡应用程序与所述读卡器进行交互;在交互过程中,当所述卡控制器检测到所述读卡器的射频场复位时,停用所述目标卡应用程序,并重复所述选卡步骤,直至所述N个卡应用程序中任一卡应用程序与所述读卡器交互成功,或者,所述N个卡应用程序在本次选卡步骤中均被选取过且均未交互成功。
本申请的实施方式还提供了另一种刷卡方法,包括:当检测到进入读卡器的射频场时,进入本次刷卡过程的协议确认步骤,所述协议确认步骤包括:从内置的M组卡应用程序中选取在本次刷卡过程中尚未被选取过的一组卡应用程序,作为目标组,其中,所述M组卡应用程序中任意两组卡应用程序所使用的通信协议类型不同,且每组卡应用程序中所有卡应用程序的通信协议类型相同,所述M为大于或等于2的整数;调用所述目标组中任意一个卡应用程序,并将所述目标组中被调用的卡应用程序的通信协议标签发送至所述读卡器,以供所述读卡器进行协议确认;若协议确认失败,则停用所述目标组中被调用的卡应用程序,并重复所述协议确认步骤,直至任一组卡应用程序中任意一个卡应用程序协议确认成功,或者所述M组卡应用程序在本次刷卡过程中均被选取过但均协议确认失败;若协议确认成功,则利用所述目标组中被调用的卡应用程序与所述读卡器进行key值认证;若key值认证成功,则利用所述目标组中被调用的卡应用程序与所述读卡器进行数据交互;若检测到所述读卡器的射频场复位,且所述目标组中包含N个卡应用程序,所述N为大于或等于2的整数时,进入本次刷卡过程的选卡步骤,所述选卡步骤包括:根据所述目标组中的N个卡应用程序的优先级顺序,从在本次刷卡过程中均未被选取过的卡应用程序中选取优先级最高的卡应用程序,作为目标卡应用程序,所述N为大于或等于2的整数;调用所述目标卡应用程序,并利用所述目标卡应用程序与所述读卡器进行key值认证;若key值认证成功,则利用所述目标卡应用程序与所述读卡器进行数据交互;在交互过程中,当检测到所述读卡器的射频场复位时,停用所述目标卡应用程序,并重复所述选卡步骤,直至所述N个卡应用程序中任一卡应用程序与所述读卡器数据交互成功,或者,所述N个卡应用程序在本次刷卡过程中均被选取过且均未数据交互成功。
本申请的实施方式还提供了一种卡控制器,包括:至少一个处理模块;以及,与所述至 少一个处理模块通信连接的存储模块;其中,所述存储模块存储有可被所述至少一个处理模块执行的指令,所述指令被所述至少一个处理模块执行,以使所述至少一个处理模块能够执行上述第一种刷卡方法。
本申请的实施方式还提供了一种电子设备,包括至少N个卡应用程序、以及上述卡控制器,所述N为大于或等于2的整数。
本申请的实施方式还提供了一种卡控制器,包括:至少一个处理模块;以及,与所述至少一个处理模块通信连接的存储模块;其中,所述存储模块存储有可被所述至少一个处理模块执行的指令,所述指令被所述至少一个处理模块执行,以使所述至少一个处理模块能够执行上述第二种刷卡方法。
本申请的实施方式还提供了一种电子设备,包括至少M组卡应用程序、以及如权利要求17中所述的卡控制器,其中,所述M为大于或等于2的整数,所述M组卡应用程序中任意两组卡应用程序所使用的通信协议类型不同,且每组卡应用程序中所有卡应用程序的通信协议类型相同,所述M组卡应用程序中至少一组卡应用程序包括N个卡应用程序,所述N为大于或等于2的整数。
本申请的实施方式还提供了一种计算机可读存储介质,存储有计算机程序,其中,所述计算机程序被处理模块执行时实现上述第一种刷卡方法或第二种刷卡方法。
本申请提供的第一种刷卡方法利用读卡器与卡应用程序交互失败后,读卡器射频场复位这一特性,作为卡应用程序的切换条件。具体的,当检测到进入读卡器的射频场时,进入选卡步骤,选卡步骤包括:根据内置的N个卡应用程序的优先级顺序,从本次选卡步骤中尚未被选取过的卡应用程序中选取优先级最高的卡应用程序,作为目标卡应用程序;调用目标卡应用程序,并利用目标卡应用程序与读卡器进行交互,若在交互过程中检测到读卡器的射频场复位,则根据交互失败后读卡器射频场复位这一特性可知,当前被调用的卡应用程序与读卡器交互失败。因此,停用该被调用的目标卡应用程序,避免影响后续另一卡应用程序与读卡器之间的交互,重复选卡步骤,也就是说,调用另一个在本次选卡步骤中尚未被选取过的卡应用程序,并利用另一个在本次选卡步骤中尚未被选取过的卡应用程序与读卡器进行交互,直至N个卡应用程序中任一卡应用程序与读卡器交互成功,或者,N个卡应用程序在本次选卡步骤中均被选取过且均未交互成功,从而实现自动切换卡应用程序,能够实现自适应刷卡,无需在设置卡应用程序的设备界面进行手动切卡操作,提高了刷卡的便捷性。且由于本申请中在卡端进行改进后即可适用于现有的读卡器端,无需对读卡器端进行改造重构,能够降低成本。
附图说明
一个或多个实施例通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施例的限定,附图中具有相同参考数字标号的元件表示为类似的元件,除非有特别申明,附图中的图不构成比例限制。
图1是根据本申请中一种刷卡方法的流程示意图;
图2是根据本申请中另一种刷卡方法的流程示意图;
图3是根据本申请中一种卡控制器的结构示意图;
图4是根据本申请中另一种卡控制器的结构示意图;
图5是根据本申请中一种电子设备的结构示意图;
图6是根据本申请中另一种电子设备的结构示意图。
具体实施方式
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合附图对本申请的各实施方式进行详细的阐述。然而,本领域的普通技术人员可以理解,在本申请各实施方式中,为了使读者更好地理解本申请而提出了许多技术细节。但是,即使没有这些技术细节和基于以下各实施方式的种种变化和修改,也可以实现本申请所要求保护的技术方案。
传统的各种智能卡,比如公交卡、银行卡、医保卡等,因为卡内含有芯片(芯片集成有卡控制器)而能被各种读卡器读取数据进行刷卡。常见的用于智能卡的芯片有两大类,一类是接触式刷卡,比如常见的插卡POS机。另一类是非接触式刷卡,其内含有类似NFC一类的非接触式数据传输控制芯片(含配套天线),比如常见的靠近读卡机刷卡的公交卡。非接触式刷卡场景中,将这些常见的实体卡片功能,通过电子设备(例如手机)来模拟,这时候并没有实实在在的卡片存在,只是通过在电子设备内添加卡片的应用程序以“模拟”一张智能卡,这样同一个电子设备内可以通过NFC芯片(芯片集成有卡控制器)和安全元件的配合实现多种卡、多张卡的模拟,相当于在手机上安装了多张智能卡,可以在不同场合使用同一个电子设备以实现不同的刷卡认证、刷卡消费等行为。
本申请中刷卡方法所应用的场景是在非接触式刷卡场景下,所提及的卡应用程序可理解为集成在电子设备内的多张智能卡的应用程序,例如:公交卡应用程序、门禁卡应用程序、银行卡应用程序等。在理解了本申请刷卡方法所应用的场景以及卡应用程序的基本概念后,以下对本申请的刷卡方法进行具体说明:
本申请涉及一种刷卡方法,应用于卡控制器,包括:当检测到进入读卡器的射频场时, 进入选卡步骤,选卡步骤包括:根据内置的N个卡应用程序的优先级顺序,从本次选卡步骤中尚未被选取过的卡应用程序中选取优先级最高的卡应用程序,作为目标卡应用程序,N为大于或等于2的整数;调用目标卡应用程序,并利用目标卡应用程序与读卡器进行交互;在交互过程中,当检测到读卡器的射频场复位时,停用目标卡应用程序,并重复选卡步骤,直至N个卡应用程序中任一卡应用程序与读卡器交互成功,或者,N个卡应用程序在本次选卡步骤中均被选取过且均未交互成功。
当读卡器与卡应用程序交互失败后,读卡器的射频场复位,所述射频场复位是指射频场从开启—关闭—开启的这一过程,本申请中可利用读卡器与卡应用程序交互失败后,读卡器射频场复位这一特性,作为卡应用程序的切换条件。
具体的,当检测到进入读卡器的射频场时,进入选卡步骤,选卡步骤包括:根据内置的N个卡应用程序的优先级顺序,从本次选卡步骤中尚未被选取过的卡应用程序中选取优先级最高的卡应用程序,作为目标卡应用程序;调用目标卡应用程序,并利用目标卡应用程序与读卡器进行交互,若在交互过程中检测到读卡器的射频场复位,即检测到读卡器的射频场经历了从开启到关闭再到开启这一过程,则根据交互失败后读卡器射频场复位这一特性可知,当前被调用的卡应用程序与读卡器交互失败。因此,停用该被调用的目标卡应用程序,避免影响后续另一卡应用程序与读卡器之间的交互,重复选卡步骤,也就是说,调用另一个本次选卡步骤中尚未被选取过的卡应用程序,并利用另一个本次选卡步骤中尚未被选取过的卡应用程序与读卡器进行交互,直至N个卡应用程序中任一卡应用程序与读卡器交互成功,或者,N个卡应用程序在本次选卡步骤中均被选取过且均未交互成功,从而实现卡控制器自动切换卡应用程序以实现自适应刷卡,如此,既无需在设置卡应用程序的设备界面进行手动切卡操作,提高了刷卡的便捷性。且由于本申请中是在卡端进行改进,由卡端的卡控制器执行选卡步骤以实现自动切换卡应用程序,因此可适用于现有的读卡器端,无需对读卡器端进行改造便可从多张卡应用程序中选取出需识别的卡应用程序,能够降低成本。
下面对本实施方式的刷卡方法的实现细节进行具体的说明,以下内容仅为方便理解提供的实现细节,并非实施本方案的必须。
本申请刷卡方法的流程示意图如图1所示:
步骤101:根据内置的N个卡应用程序的优先级顺序,从本次选卡步骤中尚未被选取过的卡应用程序中选取优先级最高的卡应用程序,作为目标卡应用程序,N为大于或等于2的整数。
具体地说,在检测到进入读卡器的射频场时,从内置的N个卡应用程序中选取一个目标卡应用程序,该目标卡应用程序在进入该读卡器的射频场之后,在本次刷卡步骤中尚未被选 取过,也就是说,在进入该读卡器的射频场之后、在本次刷卡步骤中,该目标卡应用程序并未与读卡器尝试交互过。例如:一个电子设备中内置有深圳通公交卡应用程序、武汉通公交卡应用程序、门禁卡应用程序、招商银行卡应用程序和医保卡应用程序这5个卡应用程序,这5个卡应用程序在进入读卡器的射频场后、在本次刷卡步骤中,均未被选取并与读卡器尝试交互过,因此,可从这5个卡应用程序选取一个卡应用程序作为目标卡应用程序。而假使这5个卡应用程序中深圳通公交卡应用程序和门禁卡应用程序在本次选卡步骤中均被选取过,则需从招商银行卡应用程序、武汉通公交卡应用程序、和医保卡应用程序这3个卡应用程序中选取一个卡应用程序作为目标卡应用程序。
具体的在选取目标卡应用程序时,根据内置的N个卡应用程序的优先级顺序,从本次选卡步骤中尚未被选取过的卡应用程序中选取优先级最高的卡应用程序,作为目标卡应用程序。
本实施例中给出了以下三种优先级顺序的设置方式:
第一种,优先级顺序可随机设置。
第二种,根据N个卡应用程序中每个卡应用程序的历史交互成功次数,设置N个卡应用程序的优先级顺序,其中,卡应用程序的历史交互成功次数越高,卡应用程序的优先级越高。
具体地说,记录N个卡应用程序中每个卡应用程序的历史交互成功次数,一个卡应用程序的历史交互成功次数越多,表明该卡应用程序被使用的频率越高,那么该卡应用程序被用户使用的概率也就越大。该方案中卡应用程序的历史交互成功次数越高,卡应用程序的优先级越高,也就是说,在刷卡时,优先利用被用户使用的概率较大的卡应用程序作为目标卡应用程序与读卡器进行交互,可大大提升刷卡效率。
上述实现方式中,由卡控制器根据N个卡应用程序中每个卡应用程序的历史交互成功次数,来自动设置N个卡应用程序的优先级顺序。在实际应用中,也可由用户在具备卡控制器的电子设备的显示界面自行设置,以满足不同用户的个性化需求。
第三种,根据N个卡应用程序中每个卡应用程序对应的射频通信参数的优先级,设置N个卡应用程序的优先级顺序;其中,射频通信参数的优先级越高,与射频通信参数对应的卡应用程序的优先级越高。
具体地说,卡控制器预先获取根据N个卡应用程序中每个卡应用程序对应的射频通信参数,以得到N组射频通信参数。为N组射频通信参数设定优先级顺序,该方案中射频通信参数的优先级越高,与射频通信参数对应的卡应用程序的优先级越高,该方案中给出了另外一种确定N个卡应用程序的优先级顺序的实现方式,射频通信参数的优先级顺序可由控制器自主生成,如此,可自动生成N个卡应用程序的优先级顺序,无需用户设置或统计历史数据。
上述射频通信参数可以理解为:卡应用程序与读卡器之间建立空中接口连接所需使用的 通信参数,也就是说,卡应用程序的射频通信参数为用于与读卡器建立通信连接的参数。在具体实现中,射频通信参数可以包括但不限于:用户身份证明(User Identification,UID)、请求应答(Answer to Request,ATQ)、选择确认指令(Select Acknowledge,SAK)、选择应答(Answer To Select,ATS)、密钥KEY等。在为N组射频通信参数设定优先级顺序时,可根据上述射频通信参数中的任意一个参数的优先级顺序来确定该组射频通信参数的优先级顺序。
步骤102:调用目标卡应用程序,并利用目标卡应用程序与读卡器进行交互。
具体地说,在选取目标卡应用程序之后,调用该目标卡应用程序以利用该目标卡应用程序与读卡器进行交互。这里所说的调用目标卡应用程序可理解为是将目标卡应用程序运行在电子设备中。例如,深圳通公交卡应用程序、武汉通公交卡应用程序、门禁卡应用程序、招商银行卡应用程序和医保卡应用程序这5个卡应用程序在本次刷卡步骤中均未被选取并与读卡器尝试交互过,从深圳通公交卡应用程序、武汉通公交卡应用程序、门禁卡应用程序、招商银行卡应用程序和医保卡应用程序这5个卡应用程序中选取一个卡应用程序,例如深圳通公交卡应用程序作为目标卡应用程序,则调用深圳通公交卡应用程序,利用深圳通公交卡应用程序与读卡器进行交互。
需说明的是,本方案中目标卡应用程序与读卡器进行交互时,包括:利用目标卡应用程序与读卡器进行协议确认、协议确认成功后利用目标卡应用程序与读卡器进行key值认证、以及key值认证成功后利用目标卡应用程序与读卡器进行数据交互这三个步骤。当协议确认失败、key值认证失败或者数据交互失败时,读卡器的射频场复位。其中,当key值认证成功后利用目标卡应用程序与读卡器进行数据交互失败时,会多次重复利用目标卡应用程序与读卡器进行数据交互,从而避免由于网络原因导致数据交互失败。
步骤103:在交互过程中,判断是否检测到读卡器的射频场复位,当判定为是时,进入步骤104;当判定为否时,则结束该流程。
在选卡步骤中,当任意一个卡应用程序与读卡器交互失败,该卡应用程序会发送4bit的NACK信息至所述读卡器,读卡器在接收到该4bit的NACK信息时会执行射频场复位操作。在利用该目标卡应用程序与读卡器交互的过程中,通过判断是否检测到读卡器的射频场复位,便可确认目标卡应用程序与读卡器是否交互成功,射频场复位可理解为射频场的状态从开启到关闭,然后再到开启这一过程,若检测到射频场的状态经历了“开启—关闭—开启”这一变化过程,则可以确定读卡器的射频场复位。
若读卡器的射频场复位,则可以确定读卡器与卡应用程序交互失败,此时存在两种情况,一种为N个卡应用程序均已被选取过,另一种为N个卡应用程序还有在本次选卡步骤中尚未 被选取过的卡应用程序。因此,当检测到读卡器的射频场复位时,执行步骤104(停用目标卡应用程序,并判断N个卡应用程序是否在本次选卡步骤中均被选取过)以区分上述两种情况。
若读卡器的射频场并未复位,则可以确定卡应用程序与读卡器交互成功,此时可结束该流程。
在一个例子中,为了避免在未检测到读卡器的射频场复位时,立即结束刷卡流程而导致卡应用程序与读卡器之间未交互完成,那么在实际应用中,在执行一次检测读卡器的射频场复位时需持续一定的时间长度,该时间长度能够确保卡应用程序与读卡器之间的整个交互流程结束,如此,所探测到的结果才更加准确。该时间长度可根据实际需要进行设置,本实施例中不做具体限定。
步骤104:停用目标卡应用程序,并判断N个卡应用程序是否在本次选卡步骤中均被选取过。当判定为是时,该流程结束;当判定为否时,返回步骤101执行。
具体地说,在读卡器的射频场复位,也就是说,确定读卡器与卡应用程序交互失败后,停用目标卡应用程序,从而避免影响后续另一卡应用程序与读卡器之间的交互。此时,通过判断N个卡应用程序是否在本次选卡步骤中均被选取过,来确定N个卡应用程序是否在本次选卡步骤中均与读卡器尝试交互过。
在确定读卡器与卡应用程序交互失败后,且当N个卡应用程序在本次选卡步骤中均被选取过时,可以确定这N个卡应用程序中不存在可以与读卡器交互的卡应用程序,此时该刷卡流程可以结束。
当N个卡应用程序中存在在本次选卡步骤中尚未被选取过的卡应用程序,也就是说,N个卡应用程序中存在在本次选卡步骤中尚未与读卡器尝试交互过的卡应用程序,此时,需返回步骤101执行,继续从该N个卡应用程序中在本次选卡步骤中其他尚未被选取过的卡应用程序中选取一个卡应用程序作为目标卡应用程序。
在一个例子中,在N个卡应用程序在本次选卡步骤中均被选取过且均未交互成功之后,还包括:输出交互失败的信息。其中,所述输出交互失败的信息的具体形式可以是在包含卡控制器的电子设备的显示界面显示类似“交互失败”字样,也可以是,将交互失败的信息通过振动提示给用户,从而提示用户交互失败以避免用户多次刷卡。上述交互失败的信息的展示形式仅作举例,不应以此为限。
在一个例子中,在N个卡应用程序中任一卡应用程序与读卡器交互成功,或者,N个卡应用程序在本次选卡步骤中均被选取过且均未交互成功之后,还包括:将N个卡应用程序均重置为尚未被选取。
具体地说,在N个卡应用程序中任一卡应用程序与读卡器交互成功,或者,N个卡应用程序在本次选卡步骤中均被选取过且均未交互成功之后,将N个卡应用程序重置为尚未被选取,如此,在利用卡应用程序与另一读卡器尝试交互时,不会遗漏卡应用程序,如此能够保证刷卡结果的准确性。
可实现地,上述将N个卡应用程序重置为尚未被选取时,可通过去除标记的方式来实现。例如:在一次刷卡过程中,将N个卡应用程序中被选取过的卡应用程序标记为“已选取”,当N个卡应用程序均标记为“已选取”但均交互失败,或者N个卡应用程序中任一卡应用程序与读卡器交互成功时,去除N个卡应用程序中每个卡应用程序上的标记。上述区分卡应用程序在一次刷卡过程中是否被选取过的方式仅为举例说明,不以此为限。
在一个例子中,N个卡应用程序均使用同一通信协议,本方案中可实现对同一协议多卡应用的自适应刷卡。例如,本实施例中该N个卡应用程序均使用yula协议。当然,若支持其他协议的读卡器也具备在卡应用程序与读卡器交互时射频场复位这一特性,则本实施例中N个卡应用程序也可包含使用不用通信协议的卡应用程序。
上面各种方法的步骤划分,只是为了描述清楚,实现时可以合并为一个步骤或者对某些步骤进行拆分,分解为多个步骤,只要包括相同的逻辑关系,都在本专利的保护范围内;对算法中或者流程中添加无关紧要的修改或者引入无关紧要的设计,但不改变其算法和流程的核心设计都在该专利的保护范围内。
本申请还提供了另一种刷卡方法,包括:当检测到进入读卡器的射频场时,进入本次刷卡过程的协议确认步骤,所述协议确认步骤包括:从内置的M组卡应用程序中选取在本次刷卡过程中尚未被选取过的一组卡应用程序,作为目标组,其中,所述M组卡应用程序中任意两组卡应用程序所使用的通信协议类型不同,且每组卡应用程序中所有卡应用程序的通信协议类型相同,所述M为大于或等于2的整数;调用所述目标组中任意一个卡应用程序,并将所述目标组中被调用的卡应用程序的通信协议标签发送至读卡器,以供所述读卡器进行协议确认;若协议确认失败,则停用所述目标组中被调用的卡应用程序,并重复所述协议确认步骤,直至任一组卡应用程序中任意一个卡应用程序协议确认成功,或者所述M组卡应用程序在本次刷卡过程中均被选取过但均协议确认失败;若协议确认成功,则利用所述目标组中被调用的卡应用程序与所述读卡器进行key值认证;若key值认证成功,则利用所述目标组中被调用的卡应用程序与所述读卡器进行数据交互;若检测到所述读卡器的射频场复位,且所述目标组中包含N个卡应用程序,所述N为大于或等于2的整数时,进入本次刷卡过程的选卡步骤,所述选卡步骤包括:根据所述目标组中的N个卡应用程序的优先级顺序,从在本次刷卡过程中均未被选取过的卡应用程序中选取优先级最高的卡应用程序,作为目标卡应用程 序,所述N为大于或等于2的整数;调用所述目标卡应用程序,并利用所述目标卡应用程序与所述读卡器进行key值认证;若key值认证成功,则利用所述目标卡应用程序与所述读卡器进行数据交互;在交互过程中,当检测到所述读卡器的射频场复位时,停用所述目标卡应用程序,并重复所述选卡步骤,直至所述N个卡应用程序中任一卡应用程序与所述读卡器数据交互成功,或者,所述N个卡应用程序在本次刷卡过程中均被选取过且均未数据交互成功。
本方案中当检测到进入读卡器的射频场时,先进行本次刷卡过程的协议确认步骤,以从M组卡应用程序中确认出读卡器适用于哪一组卡应用程序的通信协议,当确认出读卡器适用的目标组后,先继续利用协议确认步骤中被调用的卡应用程序与读卡器进行key值认证、数据交互,若任意一个步骤失败,则表明目标组中被调用的卡应用程序与读卡器不适配,此时需进行选卡步骤。选卡步骤中,根据目标组中的N个卡应用程序的优先级顺序、从在本次刷卡过程中均未被选取过的卡应用程序中选取优先级最高的卡应用程序,作为目标卡应用程序。由于目标组中所有卡应用程序中的通信协议相同,因此,在协议确认成功后,无需利用目标卡应用程序与读器进行协议认证步骤,只需利用目标卡应用程序与读器进行key值认证、数据交互步骤即可。从目标组中N个卡应用程序中在本次刷卡过程中尚未被选取过的卡应用程序选取目标卡应用程序,利用目标卡应用程序与读卡器进行key值认证、数据交互,若在交互过程中检测到读卡器的射频场复位,则根据key值认证失败或数据交互失败后,读卡器射频场复位这一特性可知,当前目标卡应用程序与读卡器交互失败。因此,停用当前目标卡应用程序,并重复选卡步骤,也就是说,调用目标组中另一个在本次刷卡过程中尚未被选取过的卡应用程序,并利用另一个在本次刷卡过程中尚未被选取过的卡应用程序与读卡器进行key值认证、数据交互,直至N个卡应用程序中任一卡应用程序与读卡器数据交互成功,或者,N个卡应用程序在本次刷卡过程中均被选取过且均未数据交互成功,从而实现卡控制器自动切多种协议类型的卡应用程序、以及同一协议类型的多张卡应用程序以实现自适应刷卡,如此,既无需在设置卡应用程序的设备界面进行手动切卡操作,提高了刷卡的便捷性。且由于本申请中是在卡端进行改进,由卡端的卡控制器执行选卡步骤以实现自动切换卡应用程序,因此可适用于现有的读卡器端,无需对读卡器端进行改造便可从多种协议类型的卡应用程序、以及同一协议类型的多张卡应用程序中选取出需识别的卡应用程序,能够降低成本。
下面对本实施方式的刷卡方法的实现细节进行具体的说明,以下内容仅为方便理解提供的实现细节,并非实施本方案的必须。
本申请刷卡方法的流程示意图如图2所示:
步骤201:从内置的M组卡应用程序中选取在本次刷卡过程中尚未被选取过的一组卡应用程序,作为目标组,其中,M组卡应用程序中任意两组卡应用程序所使用的通信协议类型 不同,且每组卡应用程序中所有卡应用程序的通信协议类型相同,M为大于或等于2的整数。
具体地说,将使用不同协议类型的卡应用程序分类到一组卡应用程序中,使得每组卡应用程序中所有卡应用程序的通信协议类型相同,而任意两组卡应用程序所使用的通信协议类型不同,以便于后续步骤中根据不同组对协议类型进行确认。从M组卡应用程序中选取在本次刷卡过程中尚未被选取过的一组卡应用程序,如果一组卡应用程序中任意一个卡应用程序被选取过,则该组卡应用程序确定为被选取过。也就是说,在本次刷卡过程中尚未被选取过的一组卡应用程序中任意一个卡应用程序在本次刷卡过程中均被选取过。
值得说明的是,同一组卡应用程序指的是相同协议的卡应用程序,可能都是相同功能的卡应用程序比如交通卡应用程序,也可能是多种功能的卡应用程序。
具体的,在选取目标组卡应用程序时,根据内置的M组卡应用程序的优先级顺序,从本次选卡步骤中尚未被选取过的多组卡应用程序中选取优先级最高的一组卡应用程序,作为目标组。
本实施例中给出了以下两种优先级顺序的设置方式:
第一种,优先级顺序可随机设置。
第二种,根据M组卡应用程序中每组卡应用程序的历史交互成功次数,设置M组卡应用程序的优先级顺序,其中,该组卡应用程序的历史交互成功次数越高,该组卡应用程序的优先级越高。
具体地说,记录M组卡应用程序中每组卡应用程序的历史交互成功次数,一组卡应用程序的历史交互成功次数越多,表明该组卡应用程序被使用的频率越高,那么该组卡应用程序被用户使用的概率也就越大。该方案中一组卡应用程序的历史交互成功次数越高,表明该组卡应用程序的优先级越高,也就是说,在刷卡时,优先利用被用户使用的概率较大的一组卡应用程序作为目标组,可大大提升刷卡效率。
上述实现方式中,由卡控制器根据M组卡应用程序中每组卡应用程序的每个卡应用程序的历史交互成功次数之和,来自动设置M组卡应用程序的优先级顺序。在实际应用中,也可由用户在具备卡控制器的电子设备的显示界面自行设置,以满足不同用户的个性化需求。
步骤202:调用目标组中任意一个卡应用程序,并将目标组中被调用的卡应用程序的通信协议标签发送至读卡器,以供读卡器进行协议确认。
具体地说,调用目标组中任意一个卡应用程序,并利用目标组中被调用的卡应用程序的通信协议标签与读卡器进行协议确认。例如,当目标组中被调用的卡应用程序所使用的协议类型为yula协议时,则发送yula标签至读卡器以进行协议确认。
步骤203:判断协议确认是否成功,若判定失败,则进入步骤204;若判定成功,则进入 步骤205。
具体地说,若协议确认成功,则表明被调用的卡应用程序所使用的协议与读卡器适配,此时,需利用当前目标组卡应用程序与读卡器进行key值认证等其他步骤,即进入步骤205(判定利用目标组中被调用的卡应用程序与读卡器进行key值认证是否成功)。若协议确认失败,则表明被调用的卡应用程序所使用的协议与读卡器不适配,此时,需切换其他组的卡应用程序进行尝试,即进入步骤204(停用目标组中被调用的卡应用程序,并判断M组卡应用程序是否在本次刷卡过程中均被选取过)
步骤204:停用目标组中被调用的卡应用程序,并判断M组卡应用程序是否在本次刷卡过程中均被选取过,若判定为是,则该流程结束;若判定为否,则返回步骤201执行。
具体地说,协议确认失败后,停用目标组中被调用的卡应用程序,从而避免影响后续另一卡应用程序与读卡器之间的协议确认。此时,通过判断M组卡应用程序是否在本次刷卡过程中均被选取过,来确定M组卡应用程序是否均与读卡器尝试进行协议确认过。
若M组卡应用程序均与读卡器尝试进行协议确认过,则可以确定这M组卡应用程序中不存在与读卡器的通信协议相同的卡应用程序,此时该刷卡流程可以结束。
当M组卡应用程序中存在在本次刷卡过程中尚未被选取过的一组或多组卡应用程序,此时,需返回步骤201执行,继续从内置的M组卡应用程序中选取在本次刷卡过程中尚未被选取过的一组卡应用程序,作为目标组。
步骤205:判定利用目标组中被调用的卡应用程序与读卡器进行key值认证是否成功,若判定为成功,则进入步骤206;若判定失败,则进入步骤207。
具体地说,协议确认成功,则表明被调用的卡应用程序所使用的协议与读卡器适配,此时可继续利用被调用的卡应用程序与读卡器进行key值认证,若判定成功,则表明可利用该卡应用程序与读卡器进行数据交互,即进入步骤206(判定利用目标组中被调用的卡应用程序与读卡器进行数据交互是否成功)。若判定失败,则表明被调用的卡应用程序不能被读卡器所读取,此时如果当前目标组中还有其他卡应用程序,则需要切换其他卡应用程序进一步确认,即进入步骤207(判断目标组中的卡应用程序数目是否大于或等于2)。
步骤206:判定利用目标组中被调用的卡应用程序与读卡器进行数据交互是否成功,若判定为成功,则该流程结束;若判定失败,则进入步骤207。
具体地说,利用被调用的卡应用程序与读卡器进行key值认证成功后,可继续利用目标组中被调用的卡应用程序与读卡器进行数据交互,若数据交互成功,则表明被调用的卡应用程序与读卡器完成整个交互流程,此时可结束该流程。若数据交互失败,则需要切换其他卡应用程序进一步确认,即进入步骤207(判断目标组中的卡应用程序数目是否大于或等于2)。
步骤207:判断目标组中的卡应用程序数目是否大于或等于2。若确定为是,则进入步骤208;若确定为否,则该流程结束。
具体地说,目标组中被调用的卡应用程序与读卡器进行key值认证失败后,或者,目标组中被调用的卡应用程序与读卡器进行数据交互失败后,需进一步确认目标组中除该被调用的卡应用程序之外是否还有其他卡应用程序,即判断目标组中的卡应用程序数目是否大于或等于2。如果目标组中的卡应用程序数目大于或等于2,则需切换目标组中其他卡应用程序进一步确认,此时需进入步骤208(从目标组中的N个卡应用程序中选取一个在本次刷卡过程中尚未被选取过的卡应用程序,作为目标卡应用程序,N为大于或等于2的整数)。如果目标组中的卡应用程序数目仅为一个,由于该被调用的卡应用程序已经与读卡器整个交互流程失败,则表明目标组中不存在可被读卡器读取的卡应用程序,此时可结束该流程。
步骤208:根据目标组中的N个卡应用程序的优先级顺序,从在本次刷卡过程中均未被选取过的卡应用程序中选取优先级最高的卡应用程序,作为目标卡应用程序,N为大于或等于2的整数。
具体地说,从目标组中的N个卡应用程序中选取一个目标卡应用程序,该目标卡应用程序在进入该读卡器的射频场之后尚未被选取过,也就是说,该目标卡应用程序在本次交互过程中并未与读卡器尝试交互过。
具体的在选取目标卡应用程序时,根据内置的N个卡应用程序的优先级顺序,从本次选卡步骤中尚未被选取过的卡应用程序中选取优先级最高的卡应用程序,作为目标卡应用程序。
本实施例中给出了以下三种优先级顺序的设置方式:
第一种,优先级顺序可随机设置。
第二种,根据N个卡应用程序中每个卡应用程序的历史交互成功次数,设置N个卡应用程序的优先级顺序,其中,卡应用程序的历史交互成功次数越高,卡应用程序的优先级越高。
具体地说,记录N个卡应用程序中每个卡应用程序的历史交互成功次数,一个卡应用程序的历史交互成功次数越多,表明该卡应用程序被使用的频率越高,那么该卡应用程序被用户使用的概率也就越大。该方案中卡应用程序的历史交互成功次数越高,卡应用程序的优先级越高,也就是说,在刷卡时,优先利用被用户使用的概率较大的卡应用程序作为目标卡应用程序与读卡器进行交互,可大大提升刷卡效率。
上述实现方式中,由卡控制器根据N个卡应用程序中每个卡应用程序的历史交互成功次数,来自动设置N个卡应用程序的优先级顺序。在实际应用中,也可由用户在具备卡控制器的电子设备的显示界面自行设置,以满足不同用户的个性化需求。
第三种,根据N个卡应用程序中每个卡应用程序对应的射频通信参数的优先级,设置N 个卡应用程序的优先级顺序;其中,射频通信参数的优先级越高,与射频通信参数对应的卡应用程序的优先级越高。
具体地说,卡控制器预先获取根据N个卡应用程序中每个卡应用程序对应的射频通信参数,以得到N组射频通信参数。为N组射频通信参数设定优先级顺序,该方案中射频通信参数的优先级越高,与射频通信参数对应的卡应用程序的优先级越高,该方案中给出了另外一种确定N个卡应用程序的优先级顺序的实现方式,射频通信参数的优先级顺序可由控制器自主生成,如此,可自动生成N个卡应用程序的优先级顺序,无需用户设置或统计历史数据。
上述射频通信参数可以理解为:卡应用程序与读卡器之间建立空中接口连接所需使用的通信参数,也就是说,卡应用程序的射频通信参数为用于与读卡器建立通信连接的参数。在具体实现中,射频通信参数可以包括但不限于:用户身份证明(User Identification,UID)、请求应答(Answer to Request,ATQ)、选择确认指令(Select Acknowledge,SAK)、选择应答(Answer To Select,ATS)、密钥KEY等。在为N组射频通信参数设定优先级顺序时,可根据上述射频通信参数中的任意一个参数的优先级顺序来确定该组射频通信参数的优先级顺序。
步骤209:调用目标卡应用程序,并利用目标卡应用程序与读卡器进行key值认证。
具体地说,在选取目标卡应用程序之后,调用该目标卡应用程序以利用该目标卡应用程序与读卡器进行key值认证。需要说明的是,由于上述步骤中可以确定该目标组的通信协议与读卡器适配,则在切换该目标组中在本次刷卡过程中尚未被选取过的目标卡应用程序与读卡器尝试交互时,无需发送协议标签至读卡器,可直接跳过协议确认这一过程,直接利用目标卡应用程序与读卡器进行key值认证即可。
步骤210:判定利用目标卡应用程序与读卡器进行key值认证是否成功,若判定为成功,则进入步骤211;若判定失败,则进入步骤212。
具体地说,若判定成功,则表明可利用该目标卡应用程序与读卡器进行数据交互,即进入步骤211(判定利用目标卡应用程序与读卡器进行数据交互是否成功)。若判定失败,则表明该目标卡应用程序不能被读卡器所读取,此时如果当前目标组中还有在本次刷卡过程中其他尚未被选取过的卡应用程序,则需要切换在本次刷卡过程中其他尚未被选取过的卡应用程序进一步确认,即进入步骤212(停用目标卡应用程序,并判断N个卡应用程序是否在本次刷卡过程中均被选取过)。
步骤211:判定利用目标卡应用程序与读卡器进行数据交互是否成功,若判定为成功,则该流程结束;若判定失败,则进入步骤212。
具体地说,利用目标卡应用程序与读卡器进行key值认证成功后,可继续利用目标卡应 用程序与读卡器进行数据交互,若数据交互成功,则表明目标卡应用程序与读卡器完成整个交互流程,此时可结束该流程。若数据交互失败,则需要切换在本次刷卡过程中其他尚未被选取过的卡应用程序进一步确认,即进入步骤212(停用目标卡应用程序,并判断N个卡应用程序是否在本次刷卡过程中均被选取过)。
步骤212:停用目标卡应用程序,并判断N个卡应用程序是否在本次刷卡过程中均被选取过。若判定为是时,该流程结束;若判定为否,返回步骤208执行。
具体地说,由于在卡应用程序与读卡器的key值认证失败或数据交互失败后,读卡器的射频场复位。因此,当探测到读卡器的射频场复位,则可以确认卡应用程序与读卡器的key值认证失败或数据交互失败,当N个卡应用程序在本次刷卡过程中均被选取过时,可以确定这N个卡应用程序中不存在可以被读卡器读取的卡应用程序,此时该刷卡流程可以结束。
当N个卡应用程序中存在在本次刷卡过程中尚未被选取过的卡应用程序,也就是说,N个卡应用程序中存在尚未与读卡器尝试交互过的卡应用程序,此时,需返回步骤208执行,继续从该N个卡应用程序中在本次刷卡过程中其他尚未被选取过的卡应用程序中选取一个卡应用程序作为目标卡应用程序。
在一个例子中,在N个卡应用程序在本次刷卡过程中均被选取过且均未交互成功之后,或者,M组卡应用程序中在本次刷卡过程中均被选取过但均协议确认失败之后还包括:输出交互失败的信息。其中,输出交互失败的信息的具体形式可以是在包含卡控制器的电子设备的显示界面显示类似“交互失败”字样,也可以是,将交互失败的信息通过振动提示给用户,从而提示用户交互失败以避免用户多次刷卡。上述交互失败的信息的展示形式仅作举例,不应以此为限。
在一个例子中,在N个卡应用程序中任一卡应用程序与读卡器交互成功,或者,N个卡应用程序在本次刷卡过程中均被选取过且均未交互成功之后,还包括:将N个卡应用程序均重置为尚未被选取。
具体地说,在N个卡应用程序中任一卡应用程序与读卡器交互成功,或者,N个卡应用程序在本次刷卡过程中均被选取过且均未交互成功之后,将N个卡应用程序重置为尚未被选取,如此,在利用卡应用程序与另一读卡器尝试交互时,不会遗漏卡应用程序,如此能够保证刷卡结果的准确性。
可实现地,上述将N个卡应用程序重置为尚未被选取时,可通过去除标记的方式来实现。例如:在一次刷卡过程中,将N个卡应用程序中被选取过的卡应用程序标记为“已选取”,当N个卡应用程序均标记为“已选取”但均交互失败,或者N个卡应用程序中任一卡应用程序与读卡器交互成功时,去除N个卡应用程序中每个卡应用程序上的标记。上述区分卡应用 程序在一次刷卡过程中是否被选取过的方式仅为举例说明,不以此为限。
在一个例子中,在任一组卡应用程序中任意一个卡应用程序协议确认成功,或者M组卡应用程序在本次刷卡过程中均被选取过但均协议确认失败之后,还包括:将M组卡应用程序均重置为尚未被选取。如此,在利用该M组卡应用程序与另一读卡器尝试交互时,不会遗漏M组卡应用程序中的任意一组,能够保证刷卡结果的准确性。具体的,区分M组卡应用程序中任意一组卡应用程序是否被选取的方式也可通过设置或去除标记的方式实现,在此不再赘述。
上面各种方法的步骤划分,只是为了描述清楚,实现时可以合并为一个步骤或者对某些步骤进行拆分,分解为多个步骤,只要包括相同的逻辑关系,都在本专利的保护范围内;对算法中或者流程中添加无关紧要的修改或者引入无关紧要的设计,但不改变其算法和流程的核心设计都在该专利的保护范围内。
本申请还涉及一种卡控制器,如图3所示,包括至少一个处理模块301;以及,与至少一个处理模块301通信连接的存储模块302;其中,存储模块302存储有可被至少一个处理模块301执行的指令,指令被至少一个处理模块301执行,以使至少一个处理模块301能够执行上述第一种刷卡方法。
其中,存储模块302和处理模块301采用总线方式连接,总线可以包括任意数量的互联的总线和桥,总线将一个或多个处理模块301和存储模块302的各种电路连接在一起。总线还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路连接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口在总线和收发机之间提供接口。收发机可以是一个元件,也可以是多个元件,比如多个接收器和发送器,提供用于在传输介质上与各种其他装置通信的单元。经处理模块301处理的数据通过天线在无线介质上进行传输,进一步,天线还接收数据并将数据传送给处理模块301。
处理模块301负责管理总线和通常的处理,还可以提供各种功能,包括定时、外围接口、电压调节、电源管理以及其他控制功能。而存储模块302可以被用于存储处理模块301在执行操作时所使用的数据。
本申请还涉及一种电子设备,如图4所示,电子设备3包括至少N个卡应用程序、以及上述如图3所示的卡控制器,N为大于或等于2的整数。
在一个例子中,卡控制器可以设置在电子设备3内,电子设备3可以为智能手机、智能手环、智能手表等。例如:当电子设备3为手机时,用户乘坐公交车,拿起手机靠近配置在公交车上的读卡器,手机可以检测到该读卡器的NFC射频场,从而确定手机进入读卡器的射频范围。在具体实现中,可以是手机中的卡控制器检测到该读卡器的NFC射频场,从而确定 手机进入读卡器的射频范围。
在另一些例子中,卡控制器也可以设置在NFC通用集成电路卡(Universal Integrated Circuit Card,UICC)、Micro SD卡、NFC嵌入式安全元件(Embedded Secure Element,eSE)等设备中。
在具体实现中,卡应用程序可理解为集成在电子设备3内的多张智能卡的应用程序,例如:公交卡应用程序、门禁卡应用程序、银行卡应用程序等。
本申请还涉及另一种卡控制器,如图5所示,包括至少一个处理模块401;以及,与至少一个处理模块401通信连接的存储模块402;其中,存储模块302存储有可被至少一个处理模块401执行的指令,指令被至少一个处理模块401执行,以使至少一个处理模块401能够执行上述第二种刷卡方法。
其中,存储模块402和处理模块401采用总线方式连接,总线可以包括任意数量的互联的总线和桥,总线将一个或多个处理模块401和存储模块402的各种电路连接在一起。总线还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路连接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口在总线和收发机之间提供接口。收发机可以是一个元件,也可以是多个元件,比如多个接收器和发送器,提供用于在传输介质上与各种其他装置通信的单元。经处理模块401处理的数据通过天线在无线介质上进行传输,进一步,天线还接收数据并将数据传送给处理模块401。
处理模块401负责管理总线和通常的处理,还可以提供各种功能,包括定时、外围接口、电压调节、电源管理以及其他控制功能。而存储模块402可以被用于存储处理模块401在执行操作时所使用的数据。
本申请还涉及一种电子设备,如图6所示,电子设备4包括至少M组卡应用程序、以及如图5所示的卡控制器,其中,M为大于或等于2的整数,M组卡应用程序中任意两组卡应用程序所使用的通信协议类型不同,且每组卡应用程序中所有卡应用程序的通信协议类型相同,M组卡应用程序中至少一组卡应用程序包括N个卡应用程序,N为大于或等于2的整数。
在一个例子中,卡控制器可以设置在电子设备4内,电子设备4可以为智能手机、智能手环、智能手表等。例如:当电子设备4为手机时,用户乘坐公交车,拿起手机靠近配置在公交车上的读卡器,手机可以检测到该读卡器的NFC射频场,从而确定手机进入读卡器的射频范围。在具体实现中,可以是手机中的卡控制器检测到该读卡器的NFC射频场,从而确定手机进入读卡器的射频范围。
在另一些例子中,卡控制器也可以设置在NFC通用集成电路卡(Universal Integrated Circuit Card,UICC)、Micro SD卡、NFC嵌入式安全元件(Embedded Secure Element,eSE) 等设备中。
在具体实现中,卡应用程序可理解为集成在电子设备4内的多张智能卡的应用程序,例如:公交卡应用程序、门禁卡应用程序、银行卡应用程序等。
本申请还涉及一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理模块执行时实现上述第一种或第二种刷卡方法。
即,本领域技术人员可以理解,实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理模块(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储模块(ROM,Read-Only Memory)、随机存取存储模块(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
本领域的普通技术人员可以理解,上述各实施方式是实现本申请的具体实施例,而在实际应用中,可以在形式上和细节上对其作各种改变,而不偏离本申请的精神和范围。

Claims (17)

  1. 一种刷卡方法,其中,应用于卡控制器,包括:
    当检测到进入读卡器的射频场时,进入选卡步骤,所述选卡步骤包括:
    根据内置的N个卡应用程序的优先级顺序,从本次选卡步骤中尚未被选取过的卡应用程序中选取优先级最高的卡应用程序,作为目标卡应用程序,所述N为大于或等于2的整数;
    调用所述目标卡应用程序,并利用所述目标卡应用程序与所述读卡器进行交互;
    在交互过程中,当所述卡控制器检测到所述读卡器的射频场复位时,停用所述目标卡应用程序,并重复所述选卡步骤,直至所述N个卡应用程序中任一卡应用程序与所述读卡器交互成功,或者,所述N个卡应用程序在本次选卡步骤中均被选取过且均未交互成功。
  2. 根据权利要求1所述的刷卡方法,其中,所述N个卡应用程序的优先级顺序通过以下方式预先设置:
    根据所述N个卡应用程序中每个所述卡应用程序的历史交互成功次数,设置所述N个卡应用程序的优先级顺序,其中,所述卡应用程序的历史交互成功次数越高,所述卡应用程序的优先级越高。
  3. 根据权利要求1所述的刷卡方法,其中,所述N个卡应用程序的优先级顺序通过以下方式预先设置:
    根据所述N个卡应用程序中每个所述卡应用程序对应的射频通信参数的优先级,设置所述N个卡应用程序的优先级顺序;其中,所述射频通信参数的优先级越高,与所述射频通信参数对应的卡应用程序的优先级越高。
  4. 根据权利要求1至3中任一项所述的刷卡方法,其中,所述N个卡应用程序均使用同一通信协议。
  5. 根据权利要求1至4中任一项所述的刷卡方法,其中,在所述N个卡应用程序中任一卡应用程序与所述读卡器交互成功,或者,所述N个卡应用程序在本次选卡步骤中均被选取过且均未交互成功之后,还包括:
    将所述N个卡应用程序均重置为尚未被选取。
  6. 根据权利要求1至5中任一项所述的刷卡方法,其中,在所述N个卡应用程序在本次选卡步骤中均被选取过且均未交互成功之后,还包括:
    输出交互失败的信息。
  7. 一种刷卡方法,其中,包括:
    当检测到进入读卡器的射频场时,进入本次刷卡过程的协议确认步骤,所述协议确认步骤包括:
    从内置的M组卡应用程序中选取在本次刷卡过程中尚未被选取过的一组卡应用程序,作为目标组,其中,所述M组卡应用程序中任意两组卡应用程序所使用的通信协议类型不同,且每组卡应用程序中所有卡应用程序的通信协议类型相同,所述M为大于或等于2的整数;
    调用所述目标组中任意一个卡应用程序,并将所述目标组中被调用的卡应用程序的通信协议标签发送至所述读卡器,以供所述读卡器进行协议确认;
    若协议确认失败,则停用所述目标组中被调用的卡应用程序,并重复所述协议确认步骤,直至任一组卡应用程序中任意一个卡应用程序协议确认成功,或者所述M组卡应用程序在本次选卡步骤中均被选取过但均协议确认失败;
    若协议确认成功,则利用所述目标组中被调用的卡应用程序与所述读卡器进行key值认证;
    若key值认证成功,则利用所述目标组中被调用的卡应用程序与所述读卡器进行数据交互;
    若检测到所述读卡器的射频场复位,且所述目标组中包含N个卡应用程序,所述N为大于或等于2的整数时,进入本次刷卡过程的选卡步骤,所述选卡步骤包括:
    根据所述目标组中的N个卡应用程序的优先级顺序,从在本次刷卡过程中均未被选取过的卡应用程序中选取优先级最高的卡应用程序,作为目标卡应用程序,所述N为大于或等于2的整数;
    调用所述目标卡应用程序,并利用所述目标卡应用程序与所述读卡器进行key值认证;
    若key值认证成功,则利用所述目标卡应用程序与所述读卡器进行数据交互;
    在交互过程中,当检测到所述读卡器的射频场复位时,停用所述目标卡应用程序,并重复所述选卡步骤,直至所述N个卡应用程序中任一卡应用程序与所述读卡器数据交互成功,或者,所述N个卡应用程序在本次刷卡过程中均被选取过且均未数据交互成功。
  8. 根据权利要求7所述的刷卡方法,其中,所述N个卡应用程序的优先级顺序通过以下方式预先设置:
    根据所述N个卡应用程序中每个所述卡应用程序的历史交互成功次数,设置所述N个卡应用程序的优先级顺序,其中,所述卡应用程序的历史交互成功次数越高,所述卡应用程序的优先级越高。
  9. 根据权利要求7所述的刷卡方法,其中,所述N个卡应用程序的优先级顺序通过以下方式预先设置:
    根据所述N个卡应用程序中每个所述卡应用程序对应的射频通信参数的优先级,设置所述N个卡应用程序的优先级顺序;其中,所述射频通信参数的优先级越高,与所述射频通信参数对应的卡应用程序的优先级越高。
  10. 根据权利要求7至9中任一项所述的刷卡方法,其中,在所述N个卡应用程序中任一卡应用程序与所述读卡器交互成功,或者,所述N个卡应用程序在本次刷卡过程中均被选取过且均未交互成功之后,还包括:
    将所述N个卡应用程序均重置为尚未被选取。
  11. 根据权利要求7至10中任一项所述的刷卡方法,其中,在所述任一组卡应用程序中任意一个卡应用程序协议确认成功,或者所述M组卡应用程序在本次刷卡过程中均被选取过但均协议确认失败之后,还包括:
    将所述M组卡应用程序均重置为尚未被选取。
  12. 根据权利要求7至11中任一项所述的刷卡方法,其中,在所述N个卡应用程序在本次刷卡过程中均被选取过且均未交互成功之后,或者,所述M组卡应用程序中在本次刷卡过程中均被选取过但均协议确认失败之后,还包括:
    输出交互失败的信息。
  13. 一种卡控制器,其中,包括:
    至少一个处理模块;以及,
    与所述至少一个处理模块通信连接的存储模块;其中,
    所述存储模块存储有可被所述至少一个处理模块执行的指令,所述指令被所述至少一个处理模块执行,以使所述至少一个处理模块能够执行如权利要求1至6中任一所述的刷卡方法。
  14. 一种电子设备,其中,包括至少N个卡应用程序、以及如权利要求13中所述的卡控制器,所述N为大于或等于2的整数。
  15. 一种卡控制器,其中,包括:
    至少一个处理模块;以及,
    与所述至少一个处理模块通信连接的存储模块;其中,
    所述存储模块存储有可被所述至少一个处理模块执行的指令,所述指令被所述至少一个处理模块执行,以使所述至少一个处理模块能够执行如权利要求7至12中任一所述的刷卡方法。
  16. 一种电子设备,其中,包括至少M组卡应用程序、以及如权利要求15中所述的卡控制器,其中,所述M为大于或等于2的整数,所述M组卡应用程序中任意两组卡应用程 序所使用的通信协议类型不同,且每组卡应用程序中所有卡应用程序的通信协议类型相同,所述M组卡应用程序中至少一组卡应用程序包括N个卡应用程序,所述N为大于或等于2的整数。
  17. 一种计算机可读存储介质,存储有计算机程序,其中,所述计算机程序被处理模块执行时实现如权利要求1至6中任一所述的刷卡方法,或者,如权利要求7至12中任一所述的刷卡方法。
PCT/CN2021/137915 2021-06-02 2021-12-14 刷卡方法、卡控制器、电子设备及存储介质 WO2022252561A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110614406.9 2021-06-02
CN202110614406.9A CN113361293A (zh) 2021-06-02 2021-06-02 刷卡方法、卡控制器、电子设备及存储介质

Publications (1)

Publication Number Publication Date
WO2022252561A1 true WO2022252561A1 (zh) 2022-12-08

Family

ID=77531308

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/137915 WO2022252561A1 (zh) 2021-06-02 2021-12-14 刷卡方法、卡控制器、电子设备及存储介质

Country Status (2)

Country Link
CN (1) CN113361293A (zh)
WO (1) WO2022252561A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113361293A (zh) * 2021-06-02 2021-09-07 深圳市汇顶科技股份有限公司 刷卡方法、卡控制器、电子设备及存储介质
CN115130485A (zh) * 2022-07-05 2022-09-30 深圳市汇顶科技股份有限公司 读卡器、卡端设备、刷卡方法及控制单元
CN117176205B (zh) * 2023-10-30 2024-02-27 北京紫光青藤微系统有限公司 用于nfc设备的控制方法、nfc设备、存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140058860A1 (en) * 2012-08-24 2014-02-27 Samsung Electronics Co., Ltd. Method and apparatus for determining item based on interaction environment
CN109146472A (zh) * 2017-06-16 2019-01-04 北京橙鑫数据科技有限公司 卡片的推荐方法、装置以及移动终端
WO2020182064A1 (zh) * 2019-03-11 2020-09-17 华为技术有限公司 自动选择nfc模拟卡的方法、电子设备及通信系统
CN112069848A (zh) * 2020-11-12 2020-12-11 深圳市汇顶科技股份有限公司 用于nfc卡模拟模式的选卡方法、芯片、终端和存储介质
CN112347802A (zh) * 2020-11-03 2021-02-09 歌尔科技有限公司 一种刷卡方法、系统及装置
CN113361293A (zh) * 2021-06-02 2021-09-07 深圳市汇顶科技股份有限公司 刷卡方法、卡控制器、电子设备及存储介质

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110795949A (zh) * 2019-09-25 2020-02-14 维沃移动通信(杭州)有限公司 一种刷卡方法、装置、电子设备及介质
CN110781699B (zh) * 2019-10-31 2023-09-26 天星数科科技有限公司 Nfc卡片的切换方法及装置
CN111464692B (zh) * 2020-03-30 2021-09-07 RealMe重庆移动通信有限公司 近场通信卡片确定方法、装置、存储介质及电子设备
CN112418368A (zh) * 2020-11-25 2021-02-26 Oppo(重庆)智能科技有限公司 Nfc卡片的处理方法及装置、设备、存储介质
CN112492518B (zh) * 2020-12-09 2023-08-15 深圳市欢太数字科技有限公司 卡片确定方法、装置、电子设备及存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140058860A1 (en) * 2012-08-24 2014-02-27 Samsung Electronics Co., Ltd. Method and apparatus for determining item based on interaction environment
CN109146472A (zh) * 2017-06-16 2019-01-04 北京橙鑫数据科技有限公司 卡片的推荐方法、装置以及移动终端
WO2020182064A1 (zh) * 2019-03-11 2020-09-17 华为技术有限公司 自动选择nfc模拟卡的方法、电子设备及通信系统
CN112347802A (zh) * 2020-11-03 2021-02-09 歌尔科技有限公司 一种刷卡方法、系统及装置
CN112069848A (zh) * 2020-11-12 2020-12-11 深圳市汇顶科技股份有限公司 用于nfc卡模拟模式的选卡方法、芯片、终端和存储介质
CN113361293A (zh) * 2021-06-02 2021-09-07 深圳市汇顶科技股份有限公司 刷卡方法、卡控制器、电子设备及存储介质

Also Published As

Publication number Publication date
CN113361293A (zh) 2021-09-07

Similar Documents

Publication Publication Date Title
WO2022252561A1 (zh) 刷卡方法、卡控制器、电子设备及存储介质
US8519822B2 (en) Apparatus for selecting a virtual card application
US11334862B2 (en) Terminal transaction method, and terminal
US8606943B2 (en) Method for processing application commands from physical channels using a portable electronic device and corresponding device and system
EP2106107B1 (en) Method and apparatus for automatic near field communication application selection in an electronic device
CN103095678A (zh) 管理涉及在无线设备内的无接触式应用的传入命令的方法
US10243619B2 (en) NFC “split stack” architecture
US9351101B2 (en) Communication method and apparatus for NFC device and NFC device
CN106415591A (zh) 用于nfc的电子设备、系统及方法
EP3016342B1 (en) Mobile device, method for facilitating a transaction, computer program, article of manufacture
CN101853351A (zh) 自动选择能够由设备实现的应用的方法和设备
CN109151777B (zh) 一种非接通信方法以及通信装置
WO2022099563A1 (zh) 用于nfc卡模拟模式的选卡方法、芯片、终端和存储介质
US9824246B2 (en) Radio frequency identification tag having input device
KR20200002807A (ko) 통신 장치 및 방법
EP1675418B1 (en) Method and apparatus for control of data synchronization between a user equipment and a user authentication card
EP2717193B1 (en) IC card, portable electronic device, and reader/ writer
CN107145913B (zh) 移动终端中的应用选择
CN104853356A (zh) 一种nfc系统智能识别方法
CN107147986B (zh) 用于非接触通信的方法、集成电路及通信系统
US20170206520A1 (en) Control of applications in a mobile terminal
CN111352529B (zh) 触摸事件的上报方法、装置、终端及存储介质
KR100959562B1 (ko) 알에프아이디의 리더기와 태그 간의 통신방법
KR102566967B1 (ko) 무선태그 기반의 사물인터넷 서비스 시스템
CN113837752B (zh) 自动切换虚拟卡的方法、装置和设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21943913

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21943913

Country of ref document: EP

Kind code of ref document: A1