Near field communication-based card swiping method and device, electronic equipment and storage medium

文档序号:1687618 发布日期:2020-01-03 浏览:17次 中文

阅读说明:本技术 基于近场通信的刷卡方法、装置、电子设备以及存储介质 (Near field communication-based card swiping method and device, electronic equipment and storage medium ) 是由 方攀 陈岩 于 2019-08-27 设计创作,主要内容包括:本申请公开了一种基于近场通信的刷卡方法、装置、电子设备以及存储介质。该方法应用于电子设备中的NFC控制器,电子设备还包括多个SIM卡,多个SIM卡均预置有支付程序。NFC控制器接收刷卡交易请求,响应刷卡交易请求检测多个SIM卡的状态信息,状态信息包括空闲状态和使用状态,从多个SIM卡中选取一个处于空闲状态的SIM卡作为目标SIM卡,发送刷卡交易请求至目标SIM卡中的支付程序,该刷卡交易请求用于指示目标SIM卡中的支付程序执行与刷卡交易请求对应的流程,将目标SIM卡的状态信息从空闲状态更新为使用状态。本申请通过提供NFC控制器控制多个SIM卡支持刷卡交易,满足多个用户复用的需求,提高用户体验。(The application discloses a card swiping method and device based on near field communication, electronic equipment and a storage medium. The method is applied to an NFC controller in electronic equipment, the electronic equipment further comprises a plurality of SIM cards, and payment programs are preset in the SIM cards. The NFC controller receives a card swiping transaction request, responds to the card swiping transaction request, detects state information of a plurality of SIM cards, wherein the state information comprises an idle state and a use state, selects one SIM card in the idle state from the plurality of SIM cards as a target SIM card, and sends the card swiping transaction request to a payment program in the target SIM card, and the card swiping transaction request is used for indicating the payment program in the target SIM card to execute a flow corresponding to the card swiping transaction request and updating the state information of the target SIM card from the idle state to the use state. According to the application, the NFC controller is provided to control the plurality of SIM cards to support card swiping transaction, the multiplexing requirements of a plurality of users are met, and the user experience is improved.)

1. A card swiping method based on near field communication is applied to a Near Field Communication (NFC) controller in electronic equipment, the electronic equipment further comprises a plurality of Subscriber Identity Module (SIM) cards, and payment programs are preset in the SIM cards, and the method comprises the following steps:

the NFC controller receives a card swiping transaction request, responds to the card swiping transaction request, and detects state information of the plurality of SIM cards, wherein the state information comprises an idle state and a use state;

selecting one SIM card in an idle state from the plurality of SIM cards as a target SIM card;

sending the card swiping transaction request to a payment program in the target SIM card, wherein the card swiping transaction request is used for indicating the payment program in the target SIM card to execute a process corresponding to the card swiping transaction request;

and updating the state information of the target SIM card from an idle state to a use state.

2. The method according to claim 1, wherein the selecting one SIM card in an idle state from the plurality of SIM cards as a target SIM card comprises:

respectively judging whether the state information of the plurality of SIM cards is in an idle state;

when more than one SIM card in an idle state in the plurality of SIM cards exists, selecting one SIM card from the SIM cards in the idle state as the target SIM card;

and when one SIM card in an idle state in the plurality of SIM cards is used, taking the SIM card in the idle state as the target SIM card.

3. The method of claim 2, wherein selecting one SIM card from the SIM cards in the idle state as the target SIM card when there is more than one SIM card in the idle state in the plurality of SIM cards comprises:

when more than one SIM card in an idle state in the plurality of SIM cards exists, respectively acquiring the priority of the SIM cards in the idle state;

and acquiring the SIM card with the highest priority based on the priority of the SIM card in the idle state, and taking the SIM card with the highest priority as the target SIM card.

4. The method of claim 2, wherein selecting one SIM card from the SIM cards in the idle state as the target SIM card when there is more than one SIM card in the idle state in the plurality of SIM cards comprises:

when more than one SIM card in an idle state in the plurality of SIM cards exists, respectively acquiring account balances corresponding to the SIM cards in the idle state;

and acquiring the SIM card with the most corresponding account balance based on the account balance corresponding to the SIM card in the idle state, and taking the SIM card with the most corresponding account balance as the target SIM card.

5. The method of claim 2, wherein selecting one SIM card from the SIM cards in the idle state as the target SIM card when there is more than one SIM card in the idle state in the plurality of SIM cards comprises:

when more than one SIM card in the idle state in the plurality of SIM cards exists, respectively acquiring the time when the state information of the SIM card in the idle state is updated from the use state to the idle state at the last time;

and acquiring the SIM card with the earliest state information updating time from the use state to the idle state at the latest time based on the state information of the SIM card in the idle state updating time from the use state to the idle state at the latest time, and taking the SIM card with the earliest time as the target SIM card.

6. The method according to any one of claims 2-5, further comprising:

and when the plurality of SIM cards are all in the use state, rejecting the card swiping transaction request.

7. The method according to any of claims 1-5, wherein after the updating the state information of the target SIM card from the idle state to the use state, further comprising:

when the NFC controller receives a card swiping and deducting request, deducting the amount corresponding to the deducting request from the account balance corresponding to the target SIM card;

and updating the state information of the target SIM card from a use state to an idle state.

8. The utility model provides a device of punching card based on near field communication, its characterized in that is applied to the near field communication NFC controller in the electronic equipment, the electronic equipment still includes a plurality of subscriber identity identification SIM cards, and a plurality of SIM cards all have preset payment procedure, the device includes:

the state information detection module is used for receiving a card swiping transaction request by the NFC controller and responding the card swiping transaction request to detect state information of the plurality of SIM cards, wherein the state information comprises an idle state and a use state;

the SIM card selecting module is used for selecting one SIM card in an idle state from the plurality of SIM cards as a target SIM card;

a request sending module, configured to send the card swiping transaction request to a payment program in the target SIM card, where the card swiping transaction request is used to instruct the payment program in the target SIM card to execute a process corresponding to the card swiping transaction request;

and the state updating module is used for updating the state information of the target SIM card from an idle state to a use state.

9. An electronic device comprising an NFC controller, a plurality of SIM cards, a memory, and a processor, the NFC controller, the plurality of SIM cards, and the memory coupled to the processor, the memory storing instructions that, when executed by the processor, the processor performs the method of any of claims 1-7.

10. A computer-readable storage medium, having stored thereon program code that can be invoked by a processor to perform the method according to any one of claims 1 to 7.

Technical Field

The present application relates to the field of electronic device technologies, and in particular, to a card swiping method and apparatus based on near field communication, an electronic device, and a storage medium.

Background

With the development of science and technology, electronic equipment is more and more widely used and has more and more functions, and the electronic equipment becomes one of the necessary things in daily life of people. At present, electronic equipment can be used as a simulated bus card or a simulated subway card, but the limitation of use is too large, and the practicability is poor.

Disclosure of Invention

In view of the above problems, the present application provides a card swiping method and apparatus based on near field communication, an electronic device, and a storage medium to solve the above problems.

In a first aspect, an embodiment of the present application provides a card swiping method based on near field communication, which is applied to a near field communication NFC controller in an electronic device, where the electronic device further includes a plurality of Subscriber Identity Module (SIM) cards, and each of the plurality of SIM cards has a preset payment program, and the method includes: the NFC controller receives a card swiping transaction request, responds to the card swiping transaction request, and detects state information of the plurality of SIM cards, wherein the state information comprises an idle state and a use state; selecting one SIM card in an idle state from the plurality of SIM cards as a target SIM card; sending the card swiping transaction request to a payment program in the target SIM card, wherein the card swiping transaction request is used for indicating the payment program in the target SIM card to execute a process corresponding to the card swiping transaction request; and updating the state information of the target SIM card from an idle state to a use state.

In a second aspect, an embodiment of the present application provides a card swiping device based on near field communication, which is applied to a near field communication NFC controller in an electronic device, where the electronic device further includes a plurality of Subscriber Identity Module (SIM) cards, and each of the plurality of SIM cards has a preset payment program, and the device includes: the state information detection module is used for receiving a card swiping transaction request by the NFC controller and responding the card swiping transaction request to detect state information of the plurality of SIM cards, wherein the state information comprises an idle state and a use state; the SIM card selecting module is used for selecting one SIM card in an idle state from the plurality of SIM cards as a target SIM card; a request sending module, configured to send the card swiping transaction request to a payment program in the target SIM card, where the card swiping transaction request is used to instruct the payment program in the target SIM card to execute a process corresponding to the card swiping transaction request; and the state updating module is used for updating the state information of the target SIM card from an idle state to a use state.

In a third aspect, an embodiment of the present application provides an electronic device, including an NFC controller, a plurality of SIM cards, a memory, and a processor, where the NFC controller, the plurality of SIM cards, and the memory are coupled to the processor, and the memory stores instructions that, when executed by the processor, the processor performs the above-mentioned method.

In a fourth aspect, the present application provides a computer-readable storage medium, in which a program code is stored, and the program code can be called by a processor to execute the above method.

The card swiping method and device based on near field communication, the electronic equipment and the storage medium are applied to an NFC controller in the electronic equipment, the electronic equipment further comprises a plurality of SIM cards, and payment programs are preset in the SIM cards. The NFC controller receives a card swiping transaction request, responds to the card swiping transaction request to detect state information of a plurality of SIM cards, wherein the state information comprises an idle state and a use state, one SIM card in the idle state is selected from the SIM cards to serve as a target SIM card, the card swiping transaction request is sent to a payment program in the target SIM card, the card swiping transaction request is used for indicating the payment program in the target SIM card to execute a process corresponding to the card swiping transaction request, and the state information of the target SIM card is updated from the idle state to the use state, so that the NFC controller is provided to control the SIM cards to support card swiping transactions, the multiplexing requirement of a plurality of users is met, and the user experience is improved.

Drawings

In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.

Fig. 1 is a schematic flowchart illustrating a card swiping method based on near field communication according to an embodiment of the present application;

FIG. 2 is a flowchart illustrating a card swiping method based on near field communication according to another embodiment of the present application;

FIG. 3 is a flowchart illustrating an embodiment of step S230 of the card swiping method based on near field communication illustrated in FIG. 2 of the present application;

FIG. 4 is a flowchart illustrating a further embodiment of step S230 of the card swiping method based on near field communication illustrated in FIG. 2 of the present application;

FIG. 5 is a flowchart illustrating a further embodiment of step S230 of the card swiping method based on near field communication illustrated in FIG. 2 of the present application;

fig. 6 shows a block diagram of a near field communication-based card swiping device provided by an embodiment of the present application;

fig. 7 is a block diagram of an electronic device for executing a near field communication-based card swiping method according to an embodiment of the application;

fig. 8 illustrates a storage unit for storing or carrying program codes for implementing a card swiping method based on near field communication according to an embodiment of the present application.

Detailed Description

In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.

At present, in order to facilitate a user to go out without carrying a physical subway card, the electronic device is designed to simulate the subway card to realize the same function as the physical subway card, and the user can conveniently realize the same function as swiping the subway card by swiping the electronic device. The current common electronic equipment combines Near Field Communication (NFC) technology with Subscriber Identity Module (SIM) to realize that the electronic equipment is used as a simulated subway card, wherein the NFC adopts a 13.56MHZ working frequency band, and realizes payment related to user behavior by swiping a SIM card in the electronic equipment.

However, the inventor of the present invention has found that, at present, the simulated subway card based on the NFC technology can only be used by one person in a complete payment process, like the physical subway card, specifically, the payment program of the simulated subway card generated based on the NFC technology is preset in one SIM card, but the payment program of the same simulated subway card cannot be preset in the same SIM card, and the operating environment of the SIM card does not support complex multi-thread operations, so that one payment process can only be used by one user using the simulated subway card based on the NFC technology. However, in some cases, for example, when a friend does not carry a physical subway card or there is no balance in the physical subway card, it may be necessary to purchase a physical subway card or download a local subway-related Application (APP), but in the case of current congestion of a large city, it takes a lot of time cost to purchase a physical subway card, and to download a local subway-related APP requires a series of tedious operations such as registering and binding, and it also takes a lot of time cost.

In view of the above problems, the inventor finds and provides a card swiping method, a device, an electronic device and a storage medium based on near field communication according to embodiments of the present application, and provides an NFC controller to control a plurality of SIM cards to support card swiping transactions, so as to meet the multiplexing requirements of a plurality of users and improve user experience. The specific card swiping method based on near field communication is described in detail in the following embodiments.

Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a card swiping method based on near field communication according to an embodiment of the present application. The near field communication-based card swiping method is used for controlling a plurality of SIM cards to support card swiping transactions by providing the NFC controller, meets the multiplexing requirements of a plurality of users, and improves user experience. In a specific embodiment, the card swiping method based on near field communication is applied to the card swiping device 200 based on near field communication shown in fig. 6 and the NFC controller 130 in the electronic device 100 (fig. 7) configured with the card swiping device 200 based on near field communication. The specific process of the present embodiment will be described below by taking an electronic device as an example, and it is understood that the electronic device applied in the present embodiment may be a smart phone, a tablet computer, a wearable electronic device, and the like, which is not limited herein. In this embodiment, the electronic device may include a near field communication NFC controller and a plurality of subscriber identity module SIM cards, and each of the plurality of SIM cards is preset with a payment program, which will be described in detail with reference to a flow shown in fig. 1, where the card swiping method based on near field communication specifically includes the following steps:

step S110: the NFC controller receives a card swiping transaction request, responds to the card swiping transaction request, and detects state information of the plurality of SIM cards, wherein the state information comprises an idle state and a use state.

In this embodiment, the electronic device includes an NFC controller and a plurality of SIM cards, where a memory space is opened up in the NFC controller to maintain state information of the plurality of SIM cards.

In some embodiments, when a user swipes a card to enter a station, the electronic device is operated to be close to the card swiping device, for example, the electronic device is operated to be close to a subway card reader, and accordingly, the subway card reader reads the electronic device and then sends a card swiping transaction request to an NFC controller in the electronic device, for example, the subway card reader reads information carried by an NFC chip built in the electronic device or reads information carried by the NFC controller and then sends a card swiping transaction request to an NFC controller in the electronic device. In this embodiment, after receiving the card swiping transaction request, the NFC controller detects the state information of the multiple SIM cards in response to the card swiping transaction request, that is, detects whether the multiple SIM cards are in an idle state or in a use state in response to the card swiping transaction request. The SIM card is in an idle state, namely the SIM card is not occupied by card swiping, namely the SIM card can be used for card swiping, and the SIM card is in a use state, namely the SIM card is occupied by card swiping, namely the SIM card can not be used by card swiping any more.

As an embodiment, a state value may be set for the plurality of SIM cards, for example, setting 00 indicates that the SIM card is in an idle state (idle state), and setting 01 indicates that the SIM card is in a use state (using state), so that when the NFC controller receives a card swiping transaction request, the state values of the plurality of SIM cards may be detected in response to the card swiping transaction request, wherein when the state value of the SIM card is detected to be 00, it may be determined that the SIM card is in the idle state, and when the state value of the SIM card is detected to be 01, it may be determined that the SIM card is in the use state.

Of course, in this embodiment, other more ways of detecting the status information of the multiple SIM cards may also be included, which are not described herein again.

Step S120: and selecting one SIM card in an idle state from the plurality of SIM cards as a target SIM card.

In this embodiment, one SIM card in an idle state is selected from the plurality of SIM cards as a target SIM card based on the detection result of the state information of the plurality of SIM cards. As one way, a SIM card in an idle state may be first determined from the plurality of SIM cards based on a detection result of the state information of the plurality of SIM cards, and then one SIM card may be selected from the SIM cards in the idle state as a target SIM. For example, the SIM card with the status value of 00 may be determined from the multiple SIM cards based on the detection result of the status values of the multiple SIM cards, and then one SIM card may be selected from the SIM cards with the status value of 00 as the target SIM card.

In some embodiments, one SIM card in an idle state may be randomly selected from a plurality of SIM cards as a target SIM card; selecting one SIM card in an idle state from a plurality of SIM cards as a target SIM card according to a preset sequence; selecting one SIM card in an idle state from a plurality of SIM cards as a target SIM card according to user selection; selecting one SIM card in an idle state from a plurality of SIM cards as a target SIM card according to priority; selecting one SIM card in an idle state from a plurality of SIM cards as a target SIM card according to the account balance corresponding to the SIM card; the SIM card in the idle state may be selected from the multiple SIM cards as a target SIM card according to the time sequence of updating the SIM card from the use state to the idle state, and the like, which is not limited herein.

In some other embodiments, the state information of the plurality of SIM cards may be sequentially detected, and when it is detected that the state information of any SIM card is in an idle state, the SIM card with the state information in the idle state is taken as a target SIM card, and the detection of the state information of other SIM cards is stopped. For example, if the state information of the plurality of SIM cards is detected in a predetermined order, when it is detected that the first SIM card is in the use state, the state information of the second SIM card is continuously detected, when it is detected that the second SIM card is in the use state, the state information of the third SIM card is continuously detected, and when it is detected that the third SIM card is in the idle state, the third SIM card is taken as the target SIM card, and the detection of the state information of the fourth SIM card is stopped.

Step S130: and sending the card swiping transaction request to a payment program in the target SIM card, wherein the card swiping transaction request is used for indicating the payment program in the target SIM card to execute a flow corresponding to the card swiping transaction request.

In some embodiments, the NFC controller sends the received card swiping request to the payment program in the selected target SIM card to instruct the payment program in the target SIM card to execute a process corresponding to the card swiping transaction request. Specifically, the NFC controller may send the card swiping transaction request to a payment program in the target SIM card through a swap interface of the NFC controller, and correspondingly, the payment program in the target SIM card records a station entry point corresponding to the card swiping transaction request and returns information of success of the transaction request to the card swiping device (subway card swiping device). As a mode, the payment program in the target SIM card records the entry point corresponding to the card swiping transaction request, and returns the information of successful transaction to the NFC controller, and then the NFC controller sends the information of successful transaction to the card swiping device.

Step S140: and updating the state information of the target SIM card from an idle state to a use state.

In this embodiment, after sending the information that the transaction is successful to the card swiping device, the NFC controller characterizes that the target SIM card is being occupied by the card swiping device, that is, the target SIM card cannot be used by the card swiping device any more, and therefore, the state information of the target SIM card may be updated from the idle state to the use state, for example, the state value of the target SIM card may be updated from 00 to 01.

As an embodiment, it is assumed that the plurality of SIM cards includes a first SIM card and a second SIM card, when the NFC controller receives a first card swiping transaction request sent by the card swiping device, the NFC controller responds to the first card swiping transaction request to detect the state information of the first SIM card, and when the state information of the first SIM card is in a use state, detecting the state information of the second SIM card, and when the state information of the first SIM card is in an idle state, the first SIM card is taken as a first target SIM card, a first card swiping transaction request is sent to a payment program in the first target SIM card, the first card-swiping transaction request is used for instructing a payment program in the first target SIM card to execute a flow corresponding to the first card-swiping transaction request, and after receiving the information that the payment program in the first target SIM card returns the successful transaction to the card swiping device, updating the state information of the first target SIM card from the idle state to the use state. When the NFC controller receives a second card swiping transaction request sent by the card swiping device, the NFC controller responds to the second card swiping transaction request to detect state information of a second SIM card, when the state information of the second SIM card is in a use state, the second card swiping transaction request is rejected, when the state information of the second SIM card is in an idle state, the second SIM card is used as a second target SIM card, the second card swiping transaction request is sent to a payment program in the second target SIM card, the second card swiping transaction request is used for indicating the payment program in the second target SIM card to execute a flow corresponding to the second card swiping transaction request, and after the payment program in the second target SIM card returns successful transaction information to the card swiping device, the state information of the second target SIM card is updated to the use state from the idle state.

As another embodiment, it is assumed that the plurality of SIM cards include a first SIM card and a second SIM card, when the NFC controller receives a card swiping transaction request sent by a card swiping device, the state information of the first SIM card and the second SIM card is detected in response to the card swiping transaction request, if both the first SIM card and the second SIM card are in an idle state, the first SIM card is taken as a target SIM card by default, and the card swiping transaction request is sent to a payment program in the first SIM card, where the card swiping transaction request is used to instruct the payment program in the first SIM card to execute a flow corresponding to the card swiping transaction request, and after receiving information that the payment program in the first SIM card returns a transaction success to the card swiping device, the state information of the first SIM card is updated from the idle state to a use state. And if only one of the first SIM card and the second SIM card is in an idle state, directly taking the SIM card in the idle state as a target SIM card, and sending a card swiping transaction request to a payment program in the target SIM card, wherein the card swiping transaction request is used for indicating the payment program in the target SIM card to execute a flow corresponding to the card swiping transaction request, and after receiving information that the payment program in the target SIM card returns the successful transaction to a card swiping device, updating the state information of the target SIM card from the idle state to a use state. And if the first SIM card and the second SIM card are both in the use state, the NFC controller directly refuses the card swiping transaction request.

According to the near field communication-based card swiping method provided by one embodiment of the application, an NFC controller receives a card swiping transaction request, the state information of a plurality of SIM cards is detected in response to the card swiping transaction request, the state information comprises an idle state and a use state, one SIM card in the idle state is selected from the plurality of SIM cards to serve as a target SIM card, the card swiping transaction request is sent to a payment program in the target SIM card, the card swiping transaction request is used for indicating the payment program in the target SIM card to execute a process corresponding to the card swiping transaction request, and the state information of the target SIM card is updated from the idle state to the use state, so that the plurality of SIM cards are controlled to support card swiping transactions through the NFC controller, the multiplexing requirement of a plurality of users is met, and the user experience is improved.

Referring to fig. 2, fig. 2 is a schematic flowchart illustrating a card swiping method based on near field communication according to another embodiment of the present application. The method is applied to an NFC controller in electronic equipment, where the electronic equipment further includes a plurality of SIM cards, each of which is preset with a payment program, and the following will describe in detail with respect to a flow shown in fig. 2, where the card swiping method based on near field communication may specifically include the following steps:

step S210: the NFC controller receives a card swiping transaction request, responds to the card swiping transaction request, and detects state information of the plurality of SIM cards, wherein the state information comprises an idle state and a use state.

For detailed description of step S210, please refer to step S110, which is not described herein again.

Step S220: and respectively judging whether the state information of the plurality of SIM cards is in an idle state.

In some embodiments, after the state information of the plurality of SIM cards is detected, the state information of the plurality of SIM cards may be respectively determined to respectively determine whether the state information of the plurality of SIM cards is in an idle state. For example, each of the plurality of SIM cards is provided with a state value, that is, the SIM card in the use state is set to have a state value of 01, and the SIM card in the idle state is set to have a state value of 00, it may be determined whether the state values of the plurality of SIM cards are 00, respectively, it may be understood that when the state value of the SIM card is determined to be 00, the state information of the SIM card may be determined to be in the idle state, and when the state value of the SIM card is determined to be 01, the state information of the SIM card may be determined to be in the use state.

Step S230: and when more than one SIM card in the idle state in the plurality of SIM cards exists, selecting one SIM card from the SIM cards in the idle state as the target SIM card.

In this embodiment, when the determination result indicates that more than one SIM card in the idle state among the multiple SIM cards is available, the determination result indicates that more than one SIM card can be occupied by swiping a card, and then one SIM card can be selected from the SIM cards in the idle state as the target SIM card according to the set screening rule.

Referring to fig. 3, fig. 3 is a flowchart illustrating an embodiment of step S230 of the card swiping method based on near field communication shown in fig. 2 of the present application. As will be explained in detail with respect to the flow shown in fig. 3, the method may specifically include the following steps:

step S231A: and when more than one SIM card in the idle state in the plurality of SIM cards exists, respectively acquiring the priority of the SIM card in the idle state.

In some embodiments, when the determination result indicates that more than one SIM card in the idle state among the plurality of SIM cards is available for card swiping, one SIM card may be selected from the SIM cards in the idle state as the target SIM card according to the priority of the SIM card. Specifically, the priorities of the SIM cards in the idle state may be obtained respectively, where the priorities of the SIM cards may be preset by a user, for example, the user preset that the priority of the first SIM card is higher than the priority of the second SIM card, and the priorities of the SIM cards may also be default by the system, for example, the priority of the first SIM card is higher than the priority of the second SIM card by default by the system.

As a mode, each SIM card in the multiple SIM cards may carry first tag information, where the first tag information carried by each SIM card is used to identify the priority of the SIM card, for example, the priority of the first SIM card identified by the first tag information carried by the first SIM card is first, and the priority of the second SIM card identified by the first tag information carried by the second SIM card is second. Therefore, in this embodiment, when more than one SIM card in the idle state is included in the plurality of SIM cards, the SIM cards in the idle state may be acquired, the first tag information carried by the SIM cards in the idle state is acquired, and the priority of the SIM cards in the idle state is acquired based on the first tag information carried by the SIM cards in the idle state.

As another mode, the electronic device creates a first file in advance, where the first file is used to record priorities of multiple SIM cards or priority ranks of the multiple SIM cards included in the electronic device, for example, the first file records that "the priority of the first SIM card is first, the priority of the second SIM card is second" or "the priority ranks of the multiple SIM cards are, in order from high to low: the first SIM card and the second SIM card. Therefore, in this embodiment, when there is more than one SIM card in the idle state among the plurality of SIM cards, the first file stored in the electronic device may be read, the SIM card in the idle state may be identified from the first file, and the priority of the SIM card in the idle state may be respectively obtained based on the identification result.

Of course, in this embodiment, other methods for obtaining the priority of the SIM card in the idle state may also be included, and details are not described herein.

Step S232A: and acquiring the SIM card with the highest priority based on the priority of the SIM card in the idle state, and taking the SIM card with the highest priority as the target SIM card.

In some embodiments, after the priority of the SIM card in the idle state is acquired, the SIM card with the highest priority may be acquired based on the priority of the SIM card in the idle state, and the SIM card with the highest priority may be used as the target SIM card, so that when a plurality of SIM cards are all in the idle state, the SIM card with the higher priority is preferentially used to follow the usage set by the user or the default usage of the system.

Referring to fig. 4, fig. 4 is a flowchart illustrating a step S230 of the nfc-based card swiping method according to another embodiment of the present application, shown in fig. 2. As will be explained in detail with respect to the flow shown in fig. 3, the method may specifically include the following steps:

step S231B: and when more than one SIM card in the idle state in the plurality of SIM cards exists, respectively acquiring account balances corresponding to the SIM cards in the idle state.

In some embodiments, when the determination result indicates that more than one SIM card in the idle state among the multiple SIM cards can be occupied by swiping the card, one SIM card may be selected from the SIM cards in the idle state as the target SIM card according to the account balance corresponding to the SIM card, where the account corresponding to the SIM card may be understood as an account corresponding to the NFC-SIM card, the account corresponding to the NFC-SIM card may be an account corresponding to an application program dedicated to an operator of the NFC-SIM card, and the account balance corresponding to the SIM card may be a remaining amount in the account corresponding to the application program dedicated to the operator. Specifically, account balances corresponding to the SIM cards in the idle state may be respectively obtained, where the account balance corresponding to the SIM card may represent an amount of money that the account corresponding to the SIM card may also be deducted, for example, if the account balance corresponding to the SIM card is 50, the amount of money that the account corresponding to the SIM card may also be deducted is 50.

As a mode, each SIM card in the multiple SIM cards may carry second tag information, where the second tag information carried by each SIM card is used to identify an account balance corresponding to the SIM card, for example, the second tag information carried by the first SIM card identifies that the account balance corresponding to the first SIM card is 50, and the second tag information carried by the second SIM card identifies that the account balance corresponding to the second SIM card is 20. Therefore, in this embodiment, when more than one SIM card in the idle state is included in the plurality of SIM cards, the SIM cards in the idle state may be acquired, the second tag information carried by the SIM cards in the idle state is acquired, and the account balance corresponding to the SIM cards in the idle state is acquired based on the second tag information carried by the SIM cards in the idle state.

As another mode, the electronic device creates a second file in advance, where the second file is used to record account balances corresponding to multiple SIM cards included in the electronic device or a sequence of account balances corresponding to the multiple SIM cards, for example, the second file records that "the account balance corresponding to the first SIM card is 50, the account balance corresponding to the second SIM card is 20" or "the sequence of account balances corresponding to the multiple SIM cards is, in order from the most to the least: the first SIM card and the second SIM card. Therefore, in this embodiment, when there is more than one SIM card in the idle state among the multiple SIM cards, the second file stored in the electronic device may be read, the SIM card in the idle state may be identified from the second file, and account balances corresponding to the SIM cards in the idle state may be respectively obtained based on the identification result.

Of course, in this embodiment, other methods for acquiring the account balance corresponding to the SIM card in the idle state may also be included, and details are not described herein again.

Step S232B: and acquiring the SIM card with the most corresponding account balance based on the account balance corresponding to the SIM card in the idle state, and taking the SIM card with the most corresponding account balance as the target SIM card.

In some embodiments, after the account balance corresponding to the SIM card in the idle state is obtained, the SIM card with the highest account balance may be obtained based on the account balance corresponding to the SIM card in the idle state, and the SIM card with the highest account balance may be used as the target SIM card, so that when the plurality of SIM cards are in the idle state, the SIM card with the highest account balance may be preferentially used to ensure balance of the account balances in the plurality of SIM cards, so that in a later use process, each of the plurality of SIM cards has a sufficient account balance to support card swiping occupation.

Referring to fig. 5, fig. 5 is a flowchart illustrating a step S230 of the nfc-based card swiping method shown in fig. 2 of the present application according to yet another embodiment. As will be explained in detail with respect to the flow shown in fig. 5, the method may specifically include the following steps:

step S231C: and when more than one SIM card in the idle state in the plurality of SIM cards exists, respectively acquiring the time when the state information of the SIM card in the idle state is updated from the use state to the idle state at the last time.

In some embodiments, when the determination result indicates that more than one SIM card in the idle state among the plurality of SIM cards can be occupied by swiping the card, one SIM card can be selected from the SIM cards in the idle state as the target SIM card according to the time when the state information of the SIM card is updated from the use state to the idle state last time. Specifically, the time when the state information of the SIM card in the idle state is updated from the use state to the idle state last time may be obtained, where the time when the state information of the SIM card is updated from the use state to the idle state last time may represent the time when the SIM card is available for card swiping recently.

As one mode, each of the multiple SIM cards may carry third tag information, where the third tag information carried by each SIM card is used to identify a time when the state information of the SIM card is updated from the use state to the idle state last time, for example, the third tag information carried by the first SIM card identifies that the time when the state information of the first SIM card is updated from the use state to the idle state last time is 8.8.5.8.5.8.morning in 2019 at 50, and the third tag information carried by the second SIM card identifies that the time when the state information of the second SIM card is updated from the use state to the idle state last time is 8.8.5.8.5.8.8.51. Therefore, in this embodiment, when more than one SIM card in the idle state is included in the plurality of SIM cards, the SIM cards in the idle state may be acquired, the third tag information carried by the SIM cards in the idle state is acquired, and the time when the state information of the SIM cards in the idle state is updated from the use state to the idle state at the latest time is acquired based on the third tag information carried by the SIM cards in the idle state.

As another mode, the electronic device creates in advance a third file for recording a ranking of the time when the state information of the plurality of SIM cards included in the electronic device was last updated from the used state to the idle state or the time when the state information of the plurality of SIM cards was last updated from the used state to the idle state, for example, the third file records that "the time when the state information of the first SIM card was last updated from the used state to the idle state is 8.8.8.5.8.8.3.8.8.3.8.8.3.8.5.5.8.51.m.the time when the state information of the second SIM card was last updated from the used state to the idle state or" the ranking of the state information of the plurality of SIM cards at the time when the state information of the plurality of SIM cards was last updated from the used state to the idle state is sequentially from the morning to the evening: the first SIM card and the second SIM card. Therefore, in this embodiment, when there is more than one SIM card in the idle state among the plurality of SIM cards, the third file stored in the electronic device may be read, the SIM card in the idle state may be identified from the third file, and the time when the state information of the SIM card in the idle state is updated from the use state to the idle state at the last time may be respectively obtained based on the identification result.

Of course, in this embodiment, other methods for obtaining the time when the state information of the SIM card in the idle state is updated from the use state to the idle state last time may also be included, and details are not described herein again.

Step S232C: and acquiring the SIM card with the earliest state information updating time from the use state to the idle state at the latest time based on the state information of the SIM card in the idle state updating time from the use state to the idle state at the latest time, and taking the SIM card with the earliest time as the target SIM card.

In some embodiments, after the last time the state information of the SIM card in the idle state is acquired and updated from the use state to the idle state, the SIM card whose state information acquired at the time of the last update from the use state to the idle state based on the state information of the SIM card in the idle state is the earliest at the time of the last update from the use state to the idle state, and the SIM card with the earliest time when the state information is updated from the use state to the idle state at the last time is taken as the target SIM card, thereby satisfying the condition that when a plurality of SIM cards are in an idle state, the SIM card with the earliest time of updating the prior use state information from the use state to the idle state is used preferentially, to facilitate balancing of account balances among the plurality of SIM cards such that during subsequent use, each of the plurality of SIM cards has a sufficient account balance to support card swipes.

Step S240: and when one SIM card in an idle state in the plurality of SIM cards is used, taking the SIM card in the idle state as the target SIM card.

In this embodiment, when the determination result indicates that one SIM card in the idle state is one of the multiple SIM cards, it indicates that only one SIM card can be occupied by swiping the card, and the SIM card in the idle state is directly used as the target SIM card.

Step S250: and when the plurality of SIM cards are all in the use state, rejecting the card swiping transaction request.

In this embodiment, when the determination result indicates that the plurality of SIM cards are all in the use state, and indicates that no SIM card can be occupied by card swiping, the card swiping transaction request can be directly rejected.

Step S260: and sending the card swiping transaction request to a payment program in the target SIM card, wherein the card swiping transaction request is used for indicating the payment program in the target SIM card to execute a flow corresponding to the card swiping transaction request.

Step S270: and updating the state information of the target SIM card from an idle state to a use state.

For the detailed description of steps S260 to S270, refer to steps S130 to S140, which are not described herein again.

Step S280: and when the NFC controller receives a card swiping and deducting request, deducting the amount corresponding to the deducting request from the account balance corresponding to the target SIM card.

In some embodiments, when a user swipes a card to exit from a station, the electronic device is operated to be close to the card swiping device, for example, the electronic device is operated to be close to a subway card reader, and accordingly, the subway card reader reads the electronic device and then sends a card swiping and deducting request to an NFC controller in the electronic device, for example, the subway card reader reads information carried by an NFC chip built in the electronic device or reads information carried by the NFC controller and then sends a card swiping and deducting request to an NFC controller in the electronic device. In this embodiment, after receiving the card swiping deduction request, the NFC controller deducts an amount corresponding to the card swiping deduction request from an account balance corresponding to the target SIM card in response to the card swiping deduction request.

Step S290: and updating the state information of the target SIM card from a use state to an idle state.

In this embodiment, after determining that the amount of money corresponding to the card swiping and deducting request is deducted from the account balance corresponding to the target SIM card, the NFC characterizes that the target SIM card has completed card swiping, that is, the target SIM card is no longer occupied by card swiping at this time, and may update the state information of the target SIM card from the use state to the idle state, for example, may update the state value of the target SIM card from 01 to 00, so that when the electronic device is used as a virtual subway card again, the target SIM card may be used again.

In another embodiment of the present application, in a card swiping method based on near field communication, an NFC controller receives a card swiping transaction request, detects status information of a plurality of SIM cards in response to the card swiping transaction request, where the status information includes an idle status and a use status, respectively determines whether the status information of the plurality of SIM cards is in the idle status, selects one SIM card from the SIM cards in the idle status as a target SIM card when more than one SIM card in the plurality of SIM cards is in the idle status, and uses the SIM card in the idle status as the target SIM card when one SIM card in the plurality of SIM cards is in the use status, rejects the card swiping transaction request, and sends the card swiping transaction request to a payment program in the target SIM card, where the card swiping transaction request is used to instruct the payment program in the target SIM card to perform a process corresponding to the card swiping transaction request, and updates the status information of the target SIM card from the idle status to the use status, and when the NFC controller receives the card swiping and deducting request, deducting the amount corresponding to the deducting request from the account balance corresponding to the target SIM card, and updating the state information of the target SIM card from the use state to the idle state. Compared with the card swiping method based on the near field communication shown in fig. 1, in the embodiment, after receiving the card swiping and deducting request and deducting the corresponding amount, the state information of the target SIM card is updated from the use state to the idle state, so as to ensure the recycling of the SIM card.

Referring to fig. 6, fig. 6 is a block diagram illustrating a near field communication-based card swiping device 200 according to an embodiment of the present application. The card swiping device 200 based on near field communication is applied to the NFC controller of the electronic device 100, and the electronic device further includes a plurality of SIM cards, and each of the plurality of SIM cards is preset with a payment program. As will be explained below with respect to the block diagram shown in fig. 6, the near field communication-based card swiping device 200 comprises: a status information detecting module 210, a SIM card selecting module 220, a request sending module 230, and a status updating module 240, wherein:

a state information detection module 210, configured to receive a card swiping transaction request by the NFC controller, and detect state information of the multiple SIM cards in response to the card swiping transaction request, where the state information includes an idle state and a use state.

A SIM card selecting module 220, configured to select one SIM card in an idle state from the multiple SIM cards as a target SIM card. Further, the SIM card selecting module 220 includes: the system comprises a state judgment sub-module, a target SIM card selection sub-module, a target SIM card determination sub-module and a transaction request rejection sub-module, wherein:

and the state judgment submodule is used for respectively judging whether the state information of the plurality of SIM cards is in an idle state.

And the target SIM card selecting submodule is used for selecting one SIM card from the SIM cards in the idle state as the target SIM card when more than one SIM card in the idle state exists in the plurality of SIM cards. Further, the target SIM card selecting sub-module includes: a priority acquisition unit and a highest priority acquisition unit, wherein:

a priority obtaining unit, configured to obtain priorities of SIM cards in an idle state when more than one SIM card in the plurality of SIM cards is in the idle state.

And the highest priority acquisition unit is used for acquiring the SIM card with the highest priority based on the priority of the SIM card in the idle state, and taking the SIM card with the highest priority as the target SIM card.

Further, the target SIM card selecting sub-module includes: an account balance acquisition unit and a maximum account balance acquisition unit, wherein:

and the account balance acquisition unit is used for respectively acquiring the account balance corresponding to the SIM card in the idle state when more than one SIM card in the idle state is available in the plurality of SIM cards.

A maximum account balance obtaining unit, configured to obtain, based on an account balance corresponding to the SIM card in the idle state, the SIM card with the maximum corresponding account balance, and use the SIM card with the maximum corresponding account balance as the target SIM card.

Further, the target SIM card selecting sub-module includes: a time acquisition unit and an earliest time acquisition unit, wherein:

and the time acquisition unit is used for respectively acquiring the time when the state information of the SIM card in the idle state is updated from the use state to the idle state at the latest time when more than one SIM card in the idle state exists in the plurality of SIM cards.

And the earliest time acquisition unit is used for acquiring the SIM card with the earliest state information updated from the use state to the idle state at the latest time based on the state information of the SIM card in the idle state, and taking the SIM card with the earliest state information updated from the use state to the idle state at the latest time as the target SIM card.

And the target SIM card determining submodule is used for taking the SIM card in the idle state as the target SIM card when one SIM card in the idle state is selected from the plurality of SIM cards.

And the transaction request rejection submodule is used for rejecting the card swiping transaction request when the plurality of SIM cards are in the use state.

A request sending module 230, configured to send the card swiping transaction request to a payment program in the target SIM card, where the card swiping transaction request is used to instruct the payment program in the target SIM card to execute a process corresponding to the card swiping transaction request.

A status updating module 240, configured to update the status information of the target SIM card from an idle status to a use status.

Further, the near field communication-based card swiping device 200 further comprises: the money deduction module and the state information updating module, wherein:

and the amount deduction module is used for deducting the amount corresponding to the deduction request from the account balance corresponding to the target SIM card when the NFC controller receives the card swiping and deduction request.

And the state information updating module is used for updating the state information of the target SIM card from a use state to an idle state.

It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and modules may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.

In the several embodiments provided in the present application, the coupling between the modules may be electrical, mechanical or other type of coupling.

In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.

Referring to fig. 7, a block diagram of an electronic device 100 according to an embodiment of the present disclosure is shown. The electronic device 100 may be a smart phone, a tablet computer, an electronic book, or other electronic devices capable of running an application. The electronic device 100 in the present application may include one or more of the following components: processor 110, memory 120, NFC controller 130, a plurality of SIM cards 140, and one or more applications, wherein the one or more applications may be stored in memory 120 and configured to be executed by the one or more processors 110, the one or more programs configured to perform the method as described in the aforementioned method embodiments.

Processor 110 may include one or more processing cores, among other things. The processor 110 connects various parts within the overall electronic device 100 using various interfaces and lines, and performs various functions of the electronic device 100 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 120 and calling data stored in the memory 120. Alternatively, the processor 110 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 110 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 110, but may be implemented by a communication chip.

The Memory 120 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 120 may be used to store instructions, programs, code sets, or instruction sets. The memory 120 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like. The storage data area may also store data created by the terminal 100 in use, such as a phonebook, audio-video data, chat log data, and the like.

Referring to fig. 8, a block diagram of a computer-readable storage medium according to an embodiment of the present application is shown. The computer-readable medium 300 has stored therein a program code that can be called by a processor to execute the method described in the above-described method embodiments.

The computer-readable storage medium 300 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium 300 includes a non-volatile computer-readable storage medium. The computer readable storage medium 300 has storage space for program code 310 for performing any of the method steps of the method described above. The program code can be read from or written to one or more computer program products. The program code 310 may be compressed, for example, in a suitable form.

To sum up, according to the log information capture method, the log information capture device, the electronic device and the storage medium provided by the embodiment of the application, when the screen of the device to be tested cannot respond to the user operation, the test device establishes connection with the device to be tested through the debug bridge ADB, sends the test instruction to the device to be tested based on the ADB, monitors the response of the device to be tested based on the test instruction, determines the factor causing the screen of the device to be tested to fail to respond to the user operation based on the response, and captures the log information corresponding to the factor in the device to be tested, so that the screen fixing problem of the device to be tested is subdivided, the capture of effective test information is performed, the problem recurrence rate and the capture of invalid logs are reduced, and the test efficiency is improved.

Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not necessarily depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

20页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:信息处理方法及装置、计算机可读存储介质、电子设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!