Card searching identification method and device, medium, equipment and program product
By dynamically adjusting the anti-collision response target time and multiple time slot mechanisms, the long card search time and low efficiency problems when multiple cards exist at the same time are solved, and fast and effective card recognition and energy consumption savings are achieved.
Patent Information
- Application Number
- CN202510722949.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-08-12
AI Technical Summary
When multiple cards exist at the same time, the card search time of traditional card reading devices is long and inefficient, and frequent initialization and restarting makes it difficult to solve the problem of multiple card collisions.
By generating a dynamically adjusted anti-collision response target time, the target time is calculated using multiple slot counts, time margins and transmission times, the card response is received, and a second anti-collision command packet is sent to identify the card when the card conflicts again, avoiding infinite restart of the initialization process.
It realizes the rapid and effective identification of multiple cards, reduces card search time and energy consumption, and improves the recognition efficiency of card reading equipment.
Smart Images

Figure CN120475360A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a card search and identification method, device, medium, equipment and program product. Background Art
[0002] Near field communication (NFC) is becoming increasingly popular in our daily lives. For example, NFC (Near Field Communication) enables electronic devices to exchange data with each other in a contactless manner, bringing great convenience to people's daily lives.
[0003] With the widespread use of near-field communication (NFC), users may have multiple cards simultaneously. These cards include, but are not limited to, bank cards, bus passes, access cards, and meal cards. When swiping a card, if multiple cards are within range of the reader's antenna, they will respond simultaneously, inevitably leading to collisions. Therefore, multi-card collisions have become a significant factor affecting the recognition efficiency and accuracy of card reading systems.
[0004] During the implementation of this application, the inventors discovered that in related art, when multiple cards collide simultaneously in the field during multi-card identification, the card reader sends an anti-collision command and specifies that the multiple cards return conflict responses according to a specified number of time slots. The card reader waits a fixed amount of time for the multiple cards to return conflict responses for each time slot. In other words, regardless of the number of time slots specified, the card reader must wait for the multiple cards to return conflict responses for a fixed amount of time after sending the anti-collision command. This significantly increases card identification time when the number of specified time slots is small. Furthermore, this method requires restarting the card reader program when a card conflict is detected. If multiple conflicts occur for each card, the card reader must restart the initialization program, resulting in low anti-collision efficiency. Furthermore, multiple card conflicts may occur again after each restart. Summary of the Invention
[0005] In view of this, the present invention provides a card search and identification method, device, equipment, medium and program product to solve the problem of long card search time and low card search efficiency when performing multiple card search in traditional methods.
[0006] In a first aspect, an embodiment of the present invention provides a card search and identification method, the method comprising:
[0007] When a collision occurs for the first time among multiple cards, a first anti-collision instruction packet is sent to the multiple cards for the first time, where the first anti-collision instruction packet carries the number of multiple time slots of anti-collision response supported by the card reading device;
[0008] generating a target time for the anti-collision response based on the number of the plurality of time slots, a time margin for the anti-collision response, and a transmission time for the anti-collision response;
[0009] According to the target time of anti-collision response, receiving the first anti-collision response packet returned by multiple cards;
[0010] According to the first anti-collision response packet, identifying whether multiple cards collide again;
[0011] When multiple cards collide again, a second anti-collision instruction packet is sent to the multiple cards, and the multiple cards are identified based on the second anti-collision response packets returned by the multiple cards. The second anti-collision instruction packet is loaded with the number of multiple time slots of anti-collision response supported by the card reading device and the identifier of the target time slot where the conflict occurs again.
[0012] Through the above-described implementation, this embodiment generates a target anti-collision response time based on the number of time slots, the anti-collision response time margin, and the anti-collision response transmission time. The first anti-collision response packets returned by multiple cards are then received according to the target anti-collision response time. Because the target anti-collision response time dynamically changes with the number of time slots, it is adjustable regardless of the number of time slots, ultimately reducing the card reader's card identification time. When multiple cards collide again, the card reader does not need to restart the initialization process by shutting down and reopening the card reader. Instead, it sends a second anti-collision instruction packet to the multiple cards and accurately identifies the cards based on the second anti-collision response packets returned by the multiple cards. Ultimately, this embodiment of the present invention enables the card reader to accurately identify all multiple cards in the fastest and most efficient manner.
[0013] In some optional implementations, when multiple cards collide again, a second anti-collision instruction packet is sent to the multiple cards, and the multiple cards are identified based on the second anti-collision response packets returned by the multiple cards, including:
[0014] When multiple cards collide again, the second anti-collision instruction packet is repeatedly sent to the multiple cards until all the multiple cards are correctly identified based on the second anti-collision response packet returned by each of the multiple cards each time. The second anti-collision instruction packet is loaded with the number of multiple time slots of anti-collision response supported by the card reading device and the identifier of the target time slot where the most recent collision occurred.
[0015] Through the above-described implementation, this embodiment generates a target anti-collision response time based on the number of time slots, the anti-collision response time margin, and the anti-collision response transmission time. The first anti-collision response packets returned by multiple cards are then received according to this target anti-collision response time. Because the target anti-collision response time dynamically changes with the number of time slots, it remains adjustable regardless of the number of time slots, ultimately reducing the card reader's card search and identification time. When multiple cards collide again, the card reader does not need to restart the initialization process, but instead attempts to send a second anti-collision instruction packet to the multiple cards multiple times, thereby ensuring that the multiple cards accurately return the second anti-collision response packets. Ultimately, this embodiment of the present invention enables the card reader to accurately identify all multiple cards in the fastest and most efficient manner.
[0016] In some optional implementations, the card search and identification method in this embodiment further includes: when multiple cards collide again, sending a second anti-collision instruction packet to the multiple cards, and identifying the multiple cards based on the second anti-collision response packets returned by the multiple cards, including:
[0017] When multiple cards collide again, a second anti-collision instruction packet is repeatedly sent to the multiple cards until the number of times the second anti-collision instruction packet is repeatedly sent to the multiple cards reaches a first preset number, and then the sending of the second anti-collision instruction packet is stopped. The second anti-collision instruction packet is loaded with the number of multiple time slots of anti-collision response supported by the card reading device and the identifier of the target time slot where the most recent collision occurred.
[0018] This embodiment avoids infinite retransmission of the data of the second anti-collision instruction packet through the above-mentioned method, thereby achieving the purpose of saving energy consumption.
[0019] In some optional implementations, before the step of sending anti-collision instructions to the target card where the collision occurs for the first time in multiple time slots, the step includes:
[0020] Send card search instructions to multiple cards;
[0021] Receive card search responses returned by multiple cards;
[0022] Based on the card search response, identify whether multiple cards conflict for the first time.
[0023] In this embodiment, through the above implementation, the card reading device sends a card search instruction to multiple cards in order to quickly find the card to be traded and then quickly realize the card reading transaction.
[0024] In some optional implementations, when sending an anti-collision instruction to a target card where a collision occurs for the first time, the number of time slots is increased.
[0025] In this embodiment, the number of multiple time slots is increased through the above implementation method in order to reduce the probability of card collision when multiple cards randomly select time slots.
[0026] In some optional implementations, a target time for the anti-collision response is generated based on the number of time slots, the time margin for the anti-collision response, and the transmission time of the anti-collision response, and is calculated using the following formula:
[0027] T m =n(t1+t2)
[0028] Among them, T m is the target time of the anti-collision response, t1 is the time margin of the anti-collision response, n is the number of multiple time slots, and t2 is the transmission time of the anti-collision response.
[0029] Through the above implementation, this embodiment can flexibly adjust the target time for receiving the anti-collision response returned by the target card, thereby achieving the purpose of saving card search and identification time.
[0030] In a second aspect, an embodiment of the present invention provides a card search and identification method for each of a plurality of cards, the method comprising:
[0031] Receive the card search instruction sent by the card reader;
[0032] receiving a first anti-collision instruction packet sent for the first time by the card reader device, where the first anti-collision instruction packet carries the number of multiple time slots of anti-collision responses supported by the card reader device;
[0033] Return the first anti-collision response packet to the card reader and record the identifier of the selected time slot;
[0034] receiving a second anti-collision instruction packet sent by the card reader;
[0035] A second anti-collision response packet is sent to multiple cards to enable the card reader to identify multiple cards. The second anti-collision instruction packet is loaded with the number of multiple time slots of anti-collision response supported by the card reader and the identifier of the target time slot where the collision occurs again.
[0036] In this embodiment, when a conflict occurs again while identifying multiple cards, the card reader device does not need to shut down and reopen to restart the initialization process. Instead, it attempts to send a second anti-collision command packet to the multiple cards, which then responds with a second anti-collision response packet. Based on this second anti-collision response packet, the multiple cards are identified. Ultimately, the card reader device accurately identifies all the multiple cards in the fastest and most efficient manner. The card search and identification method of this embodiment not only improves card search efficiency but also reduces the target anti-collision response time.
[0037] In some optional implementations, sending a second anti-collision response packet to multiple cards so that the card reader device can identify the multiple cards includes:
[0038] Repeatedly receiving the second anti-collision instruction packet sent by the card reader until the card reader correctly identifies all the multiple cards based on the second anti-collision response packet returned to the card reader each time, wherein the second anti-collision instruction packet carries the identifier of the target time slot where the most recent collision occurred;
[0039] During each reception of the second anti-collision instruction packet sent by the card reader, confirming whether the identifier of the selected time slot is consistent with the identifier of the target time slot where the most recent collision occurred;
[0040] If yes, randomly select any time slot from the multiple time slots according to the number of the multiple time slots, and return a second anti-collision response packet to the card reader.
[0041] If not, ignore the second anti-collision instruction packet.
[0042] In this embodiment, when a conflict occurs again while identifying multiple cards, the card reader device does not need to shut down and reopen to restart the initialization process. Instead, it attempts to send the second anti-collision command packet to the multiple cards multiple times, thereby ensuring that the multiple cards accurately return the second anti-collision response packet. Ultimately, the card reader device accurately identifies all the multiple cards in the fastest and most efficient manner. The card search and identification method in this embodiment not only improves card search efficiency but also reduces the target anti-collision response time.
[0043] In a third aspect, an embodiment of the present invention provides a card search and identification method for a card reader device, the method comprising:
[0044] Send card search instructions to multiple cards;
[0045] Receive card search responses returned by multiple cards;
[0046] According to the card search response, identify whether multiple cards conflict for the first time;
[0047] When a collision occurs for the first time among multiple cards, a first anti-collision instruction packet is sent to the multiple cards for the first time, where the first anti-collision instruction packet carries the number of multiple time slots of anti-collision response supported by the card reading device;
[0048] generating a target time for the anti-collision response based on the number of the plurality of time slots, a time margin for the anti-collision response, and a transmission time for the anti-collision response;
[0049] According to the target time of anti-collision response, receiving the first anti-collision response packet returned by multiple cards;
[0050] According to the first anti-collision response packet, identifying whether multiple cards collide again;
[0051] When the multiple cards collide again, the process returns to the step of sending the first anti-collision instruction packet to the multiple cards for the first time when the multiple cards collide for the first time, until the preset condition is met.
[0052] In this embodiment, when a conflict occurs again while identifying multiple cards, the card reader device does not need to shut down and reopen to restart the initialization process. Instead, it attempts to send the first anti-collision instruction packet to the multiple cards multiple times until all the multiple cards are correctly identified. Ultimately, the present invention enables the card reader device to accurately identify all the multiple cards in the fastest and most efficient manner. The card search and identification method of this embodiment not only improves card search efficiency but also reduces the target anti-collision response time.
[0053] In some optional implementations, when a conflict occurs again among multiple cards, returning to the step of identifying the first conflict among multiple cards and sending the first anti-collision instruction packet to the multiple cards for the first time until a preset condition is met includes:
[0054] When the multiple cards collide again, the process returns to the step of sending the first anti-collision instruction packet to the multiple cards for the first time when the multiple cards collide for the first time, and the process continues until the second preset number of times is reached.
[0055] This embodiment still avoids infinite retransmission of the data of the first anti-collision instruction packet through the above-mentioned method, thereby achieving the purpose of saving energy consumption.
[0056] In some optional implementations, when a conflict occurs again among multiple cards, the process returns to the step of sending the first anti-collision instruction packet to the multiple cards for the first time when the conflict occurs for the first time, until a preset condition is met, including:
[0057] When the multiple cards collide again, the process returns to the step of sending the first anti-collision instruction packet to the multiple cards for the first time when the multiple cards collide for the first time, until all the multiple cards are correctly identified.
[0058] Through the above implementation, this embodiment still avoids infinite retransmission of the data of the first anti-collision instruction packet, thereby achieving the purpose of saving energy consumption.
[0059] In a fourth aspect, an embodiment of the present invention provides a card search and identification method for each of a plurality of cards, the method comprising:
[0060] Receive the card search instruction sent by the card reader;
[0061] Send a card search response to the card reader;
[0062] receiving a first anti-collision instruction packet sent for the first time by the card reader device, where the first anti-collision instruction packet carries the number of multiple time slots of anti-collision responses supported by the card reader device;
[0063] A first anti-collision response packet is sent to the card reader device to enable the card reader device to identify whether multiple cards collide again. When multiple cards collide again, the card reader device repeatedly executes the card search and identification method until a preset condition is met.
[0064] The card search and identification method in this embodiment can not only improve the card search efficiency, but also reduce the target time of the anti-collision response.
[0065] In a fifth aspect, an embodiment of the present invention provides a card identification device for a card reader, the device comprising:
[0066] A first sending module is used to send a first anti-collision instruction packet to the multiple cards for the first time when a collision occurs for the first time among the multiple cards. The first anti-collision instruction packet is loaded with the number of multiple time slots of anti-collision response supported by the card reading device;
[0067] A first generating module, configured to generate a target time for the anti-collision response according to the number of the plurality of time slots, a time margin for the anti-collision response, and a transmission time for the anti-collision response;
[0068] A first receiving module is used to receive first anti-collision response packets returned by multiple cards according to the target time of the anti-collision response;
[0069] A first identification module is used to identify whether a conflict occurs again among the multiple cards according to the first anti-collision response packet;
[0070] The second identification module sends a second anti-collision instruction packet to the multiple cards when the multiple cards collide again, and identifies the multiple cards based on the second anti-collision response packets returned by the multiple cards. The second anti-collision instruction packet is loaded with the number of multiple time slots of anti-collision response supported by the card reading device and the identifier of the target time slot where the conflict occurs again.
[0071] In a sixth aspect, an embodiment of the present invention provides a computer device, including:
[0072] The memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the card search and identification method in the above-mentioned first aspect or any embodiment of the first aspect by executing the computer instructions.
[0073] In a seventh aspect, an embodiment of the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the card-searching and identification method in the above-mentioned first aspect or any one of the embodiments of the first aspect.
[0074] In an eighth aspect, an embodiment of the present invention provides a computer program product, comprising computer instructions, where the computer instructions are used to enable a computer to execute the card search and identification method in the above-mentioned first aspect or any embodiment of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0076] Figure 1 is a schematic diagram of the interaction between a card reading device and multiple cards according to an embodiment of the present invention;
[0077] Figure 2 1 is a flow chart of a card search and identification method according to an embodiment of the present invention;
[0078] Figure 3 is a schematic diagram of different time slots according to an embodiment of the present invention;
[0079] Figure 4 is a schematic diagram of interaction between another card reading device and multiple cards according to an embodiment of the present invention;
[0080] Figure 5 is a flow chart of another card search and identification method according to an embodiment of the present invention;
[0081] Figure 6 1 is a flow chart of another card search and identification method according to an embodiment of the present invention;
[0082] Figure 7 1 is a flow chart of another card search and identification method according to an embodiment of the present invention;
[0083] Figure 8 1 is a flow chart of another card search and identification method according to an embodiment of the present invention;
[0084] Figure 9 is a structural block diagram of a card-finding and identification device according to an embodiment of the present invention;
[0085] Figure 10 Schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0086] To make the purpose, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of the present invention.
[0087] According to an embodiment of the present invention, an embodiment of a card search and identification method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0088] like Figure 1 The figure shows the interaction between the card reader and multiple cards. Figure 1 In the card reader, the card reader continuously sends card search commands. If a card enters the card reader's magnetic field and receives the card search command, it will reply with a card search response. When multiple cards reply with card search responses in multiple time slots, card search conflicts may occur.
[0089] Traditionally, when performing multiple card search and recognition, each card randomly selects a time slot. This can lead to multiple cards selecting the same time slot, indicating a card search conflict. Traditionally, this conflict is addressed by simply restarting the entire initialization and anti-collision process. This restart significantly reduces card reading efficiency.
[0090] In the traditional method, the number of time slots usually specified is 8. The card reader waits for multiple cards to return conflict responses according to a fixed time for each time slot. That is to say, no matter how many time slots are specified, the card reader must wait for multiple cards to return conflict responses according to the fixed time after sending the anti-collision command. When the number of specified time slots is small, the card search and recognition time is significantly increased.
[0091] When the card reader identifies a card conflict, the traditional method requires restarting the card reader program. If each card conflicts multiple times, the card reader device needs to restart the initialization program, resulting in low anti-collision efficiency. Moreover, multiple cards will still conflict again after each restart.
[0092] In view of this, a card search and identification method is provided in this embodiment, which can be used for a card reading device, which can be a mobile terminal such as a mobile phone, a tablet computer, etc. Figure 2 : is a flow chart of a card search and identification method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0093] Step S201: When a collision occurs for the first time among multiple cards, a first anti-collision instruction packet is sent to the multiple cards for the first time. The first anti-collision instruction packet carries the number of multiple time slots of anti-collision response supported by the card reader.
[0094] When the card reader recognizes that multiple cards have selected the same time slot, it means that multiple cards have collided. That is, when the card reader recognizes that multiple cards collide in the field at the same time, it sends the first anti-collision instruction packet and specifies the number of time slots in which the cards can return anti-collision responses in the first anti-collision instruction packet. Usually, the number of time slots does not exceed 8. Figure 4 The figure below illustrates the card reader mechanism using four time slots as an example. The card reader sends an anti-collision command, typically supporting four time slots. The card randomly selects a time slot and returns a response within the time slot. If the four cards select different time slots, the card reader can receive four correct responses in sequence, thereby correctly identifying the four cards present simultaneously in the field. Furthermore, the card reader can select a card to initiate subsequent transactions based on pre-defined card selection criteria. If multiple cards select the same time slot, the card reader will not be able to recognize the anti-collision responses returned by these cards, indicating a card search conflict.
[0095] Multiple time slots are different time segments for the card reader to perform the card search task. Figure 3 As shown, it is a schematic diagram of different time slots.
[0096] In a specific example, the number of the multiple time slots is flexibly pre-configured according to user needs.
[0097] For example, the number of the multiple time slots includes but is not limited to 4, 5, 6, etc.
[0098] Step S202 : generating a target time for the anti-collision response according to the number of the multiple time slots, the time margin for the anti-collision response, and the transmission time of the anti-collision response.
[0099] The target time of anti-collision response is the total time it takes for the card reader to receive anti-collision response packets from multiple cards. The target time of anti-collision response is not a fixed time. It is related to the number of multiple time slots, the time margin of anti-collision response and the transmission time of anti-collision response. That is to say, the target time of anti-collision response changes with the number of multiple time slots.
[0100] The time margin of the anti-collision response represents the time width reserved for each anti-collision response, and the transmission time of the anti-collision response represents the time consumed in the transmission process of each anti-collision response.
[0101] In a specific example, the target time of the anti-collision response is generated according to the number of the multiple time slots, the time margin of the anti-collision response, and the transmission time of the anti-collision response, and is calculated by the following formula:
[0102] T m =n(t1+t2)
[0103] Among them, T m is the target time of the anti-collision response, t1 is the time margin of the anti-collision response, n is the number of multiple time slots, and t2 is the transmission time of the anti-collision response.
[0104] For example, the number of multiple time slots is 4, the time margin of anti-collision response is 0.5ms, and the transmission time of anti-collision response is 1.25ms. The target time T of anti-collision response is calculated according to the above method. m =n(t1+t2)=4×(0.5+1.25)=7ms.
[0105] According to the traditional method, no matter how many time slots there are, a collision response is returned for each time slot at a fixed time. The fixed time is usually 8 time slots. The transmission time of the anti-collision response is 1.25ms. The fixed time for returning the anti-collision response in the traditional method is 10ms.
[0106] By comparison, it is found that this embodiment targets 4 time slots, which can reduce the card search and recognition time of the card reader device compared with the traditional method.
[0107] Step S203: receiving first anti-collision response packets returned by multiple cards according to the target time of anti-collision response.
[0108] The traditional method stipulates that the card reader device must wait for an anti-collision response for a fixed period of time after sending an anti-collision command packet. That is to say, no matter how many time slots are specified, the card reader device must wait for an anti-collision response after sending the anti-collision command. When the number of supported time slots is small, the card search and recognition time is significantly increased.
[0109] The anti-collision response target time in this embodiment changes dynamically with the number of time slots. Therefore, after sending an anti-collision instruction packet, the card reader must receive the first anti-collision response packet returned by multiple cards according to the anti-collision response target time, thereby reducing card search and recognition time.
[0110] Step S204: Identify whether multiple cards collide again based on the first anti-collision response packet.
[0111] When the card reader recognizes that multiple cards have selected the same time slot again, it means that multiple cards have collided, that is, the card reader recognizes that multiple cards collided again at the same time in the field.
[0112] In step S205, when multiple cards collide again, a second anti-collision instruction packet is sent to the multiple cards, and multiple cards are identified based on the second anti-collision response packets returned by the multiple cards. The second anti-collision instruction packet is loaded with the number of multiple time slots of anti-collision response supported by the card reading device and the identifier of the target time slot where the conflict occurs again.
[0113] For example, when a collision occurs again among multiple cards, a second anti-collision instruction packet is sent to the multiple cards, and the multiple cards are identified by combining the second anti-collision response packets returned by the multiple cards.
[0114] Since multiple cards may conflict more than once, in order to solve the problem of repeated conflicts and inability to accurately identify multiple cards, this embodiment proposes the following optional implementation method.
[0115] In some optional embodiments, in step S205, when a conflict occurs again among the multiple cards, a second anti-collision instruction packet is sent to the multiple cards, and the multiple cards are identified based on the second anti-collision response packets returned by the multiple cards, including:
[0116] When multiple cards collide again, the second anti-collision instruction packet is repeatedly sent to the multiple cards until all the multiple cards are correctly identified based on the second anti-collision response packet returned by each of the multiple cards each time. The second anti-collision instruction packet is loaded with the number of multiple time slots of anti-collision response supported by the card reading device and the identifier of the target time slot where the most recent collision occurred.
[0117] In the above step S205, when a conflict occurs again among the multiple cards, a second anti-collision instruction packet is sent to the multiple cards, and the multiple cards are identified based on the second anti-collision response packets returned by the multiple cards, including:
[0118] The second anti-collision instruction packet is different from the first anti-collision instruction packet. The second anti-collision instruction packet not only carries the number of multiple time slots of anti-collision response supported by the card reader, but also carries the identifier of the target time slot where the most recent anti-collision occurred.
[0119] The time slot identifier of the target time slot includes but is not limited to a digital identifier, an alphabetic identifier, a text identifier, etc. of the target time slot. For example, the time slot identifier of the target time slot is Figure 3 The numerical identifier in . The most recent conflict mentioned above can be considered as the last conflict after the conflict occurs again. For example, when there are multiple conflicts, including: the first conflict, the second conflict, and the third conflict, the third conflict can be considered as the most recent conflict after the second conflict.
[0120] In some optional embodiments, in step S205, when a conflict occurs again among the multiple cards, a second anti-collision instruction packet is sent to the multiple cards, and the multiple cards are identified based on the second anti-collision response packets returned by the multiple cards, including:
[0121] When multiple cards collide again, a second anti-collision instruction packet is repeatedly sent to the multiple cards until the number of times the second anti-collision instruction packet is repeatedly sent to the multiple cards reaches a first preset number, and then the sending of the second anti-collision instruction packet is stopped. The second anti-collision instruction packet is loaded with the number of multiple time slots of anti-collision response supported by the card reading device and the identifier of the target time slot where the most recent collision occurred.
[0122] Due to the traditional method, when multiple cards collide during the card search and identification process, if the anti-collision command is not resent infinitely without shutting down the field, it will lead to increased energy consumption.
[0123] Therefore, in order to avoid sending the second anti-collision instruction packet repeatedly for an unlimited number of times, this embodiment sets the number of retries, that is, sets the upper limit value of the number of times the second anti-collision instruction packet is sent. The upper limit value is the first preset number mentioned above. For example, the first preset number is n1, and the first preset number can be set flexibly.
[0124] Due to the traditional method, when the card reader is searching for multiple cards, once a card search conflict occurs, the card reader will shut down and then restart the initialization process. If multiple conflicts occur, the restart action needs to be performed multiple times, resulting in reduced card search efficiency.
[0125] Therefore, in this embodiment, when a conflict occurs again while identifying multiple cards, the card reader device does not need to shut down and reopen to restart the initialization process. Instead, it attempts to send the second anti-collision instruction packet to the multiple cards multiple times, thereby ensuring that the multiple cards accurately return the second anti-collision response packet. Ultimately, the present invention enables the card reader device to accurately identify all multiple cards in the fastest and most efficient manner. The card search and identification method in this embodiment not only improves card search efficiency but also reduces the target anti-collision response time.
[0126] In some specific embodiments, such as Figure 5 As shown, before step S201 of sending anti-collision instructions to the target card where the collision occurs for the first time in multiple time slots, the following steps are included:
[0127] Step S198: Send card search instructions to multiple cards.
[0128] Specifically, the card search instruction is a request instruction for the card reading device to search for data information on multiple cards.
[0129] Step S199: receiving card search responses returned by multiple cards.
[0130] Specifically, the card-seeking instruction is a response instruction from multiple cards to the card reading device.
[0131] Step S200: Identify whether a conflict occurs for the first time among multiple cards based on the card search response.
[0132] exist Figure 1 In the example, the card reader sends a card search command to multiple cards. Cards 1, 3, and 4 all return correct card search responses, but the card search response returned by Card 2 is unrecognizable, indicating that a card search conflict has occurred for Card 2. When a conflict occurs for Card 2, the above steps S201 to S205 are executed.
[0133] According to the card search response, multiple cards were identified without conflict, indicating that multiple cards did not return card search responses in the same time slot.
[0134] The card reading device of this embodiment sends a card search instruction to multiple cards in order to quickly find the card to be traded and then quickly complete the card reading transaction.
[0135] The traditional method usually limits the number of time slots to 8. When there are multiple cards on the scene, there is a high probability that multiple cards will randomly select the same time slot.
[0136] Moreover, if the traditional method always performs the card search task according to 8 time slots, when there are multiple cards, there is a high probability that multiple cards will randomly select the same time slot, that is, the probability of conflict is high. However, the number of time slots in this embodiment can be flexibly set.
[0137] Therefore, in some optional implementations, when sending an anti-collision instruction to a target card where a collision occurs for the first time, the number of time slots is increased.
[0138] For example, when the original number of the multiple time slots is 4, when an anti-collision instruction is sent to a target card where a collision occurs for the first time, the number of the multiple time slots is increased to 5.
[0139] For example, when the original number of the multiple time slots is 8, when an anti-collision instruction is sent to a target card where a collision occurs for the first time, the number of the multiple time slots is increased to 5.
[0140] In this embodiment, the number of multiple time slots is increased in order to reduce the probability of card collision when multiple cards randomly select time slots.
[0141] In this embodiment, a card search and identification method is provided, which can be used for each of multiple cards. The card can be deployed on a mobile terminal, such as a mobile phone or a tablet computer. Figure 6 : is a flow chart of a card search and identification method according to an embodiment of the present invention. Figure 6 As shown, the process includes the following steps:
[0142] Step S600: receiving a card search instruction sent by a card reader.
[0143] Step S601: receiving a first anti-collision instruction packet sent for the first time by a card reader device, wherein the first anti-collision instruction packet carries the number of multiple time slots of anti-collision responses supported by the card reader device.
[0144] In a specific example, the number of the multiple time slots is flexibly pre-configured according to user needs.
[0145] For example, the number of the multiple time slots includes but is not limited to 4, 5, 6, etc.
[0146] In this embodiment, the receiving process corresponds to the sending process.
[0147] Step S602: Return a first anti-collision response packet to the card reader and record the identifier of the selected time slot.
[0148] Since the card reader sends the first anti-collision instruction packet, each of the multiple cards needs to return the first anti-collision response packet accordingly. When each card returns the first anti-collision response packet to the card reader, it records the identifier of the time slot it has selected. The time slot identifier includes but is not limited to the digital identifier, letter identifier, text identifier, etc. of the target time slot. For example, the time slot identifier that the card has selected is Figure 3 The digital identifier in .
[0149] Step S603: receiving a second anti-collision instruction packet sent by the card reader;
[0150] Step S604: Send a second anti-collision response packet to multiple cards to enable the card reader to identify multiple cards. The second anti-collision instruction packet carries the number of multiple time slots supported by the card reader for anti-collision response and the identifier of the target time slot where the collision occurs again.
[0151] For example, when a collision occurs again among multiple cards, a second anti-collision response packet is sent to the multiple cards, so that the card reading device combines the second anti-collision response packets returned by the multiple cards to identify the multiple cards.
[0152] Since multiple cards may conflict more than once, in order to solve the problem of repeated conflicts and inability to accurately identify multiple cards, this embodiment proposes the following optional implementation method.
[0153] In some optional implementations, the above step S604, sending the second anti-collision response packet to multiple cards so that the card reader device can identify the multiple cards, includes:
[0154] Step S6040: repeatedly receive the second anti-collision instruction packet sent by the card reader device until the card reader device correctly identifies multiple cards based on the second anti-collision response packet returned to the card reader device each time. The second anti-collision instruction packet is loaded with the identifier of the target time slot where the most recent collision occurred.
[0155] Since the card reading device repeatedly sends the second anti-collision instruction packet multiple times, the card correspondingly repeatedly receives the second anti-collision instruction packet sent by the card reading device.
[0156] Step S6041: During each reception of the second anti-collision instruction packet sent by the card reader, it is confirmed whether the identifier of the selected time slot is consistent with the identifier of the target time slot where the most recent collision occurred.
[0157] Step S6042: If yes, randomly select any time slot from the multiple time slots according to the number of the multiple time slots, and return a second anti-collision response packet to the card reader device.
[0158] Step S6043: If not, ignore the second anti-collision instruction packet.
[0159] If each card confirms that the identifier of the target time slot that conflicts again is not the time slot corresponding to the identifier of the target time slot that it has selected before, the anti-collision instruction is ignored, indicating that the time slot selected by the card before did not conflict.
[0160] Due to the traditional method, when the card reader is searching for multiple cards, once a card search conflict occurs, the card reader will shut down and then restart the initialization process. If multiple conflicts occur, the restart action needs to be performed multiple times, resulting in reduced card reading efficiency.
[0161] In this embodiment, when a conflict occurs again while identifying multiple cards, the card reader device does not need to shut down and reopen to restart the initialization process. Instead, it attempts to send the second anti-collision command packet to the multiple cards multiple times, thereby ensuring that the multiple cards accurately return the second anti-collision response packet. This allows the card reader device to accurately identify all the multiple cards in the fastest and most efficient manner. The card search and identification method in this embodiment not only improves card search efficiency but also reduces the target anti-collision response time.
[0162] In this embodiment, a card search and identification method is provided, which can be used for a card reading device, which can be a mobile terminal such as a mobile phone, a tablet computer, etc. Figure 7 : is a flow chart of a card search and identification method according to an embodiment of the present invention. Figure 7 As shown, the process includes the following steps:
[0163] Step 701: Send a card search instruction to multiple cards.
[0164] Specifically, the card search instruction is a request instruction for the card reading device to search for data information on multiple cards.
[0165] Step 702: Receive card search responses returned by multiple cards.
[0166] Specifically, the card-seeking instruction is a response instruction from multiple cards to the card reading device.
[0167] Step 703: Identify whether a conflict occurs for the first time among multiple cards based on the card search response.
[0168] exist Figure 1 In the example, the card reader sends a card search command to multiple cards. Cards 1, 3, and 4 all return correct card search responses, but the card search response returned by Card 2 is unrecognizable, indicating that a card search conflict has occurred for Card 2. When a conflict occurs for Card 2, the above steps S701 to S203 are executed.
[0169] According to the card search response, multiple cards were identified without conflict, indicating that multiple cards did not return card search responses in the same time slot.
[0170] Step 704: When it is identified that a collision occurs for the first time among multiple cards, a first anti-collision instruction packet is sent to the multiple cards for the first time. The first anti-collision instruction packet carries the number of multiple time slots of anti-collision response supported by the card reader.
[0171] When the card reader recognizes that multiple cards have selected the same time slot, it means that multiple cards have collided. That is, when the card reader recognizes that multiple cards collide in the field at the same time, it sends the first anti-collision instruction packet and specifies the number of time slots in which the cards can return anti-collision responses in the first anti-collision instruction packet. Usually, the number of time slots does not exceed 8. Figure 4 The figure below illustrates the card reader mechanism using four time slots as an example. The card reader sends an anti-collision command, typically supporting four time slots. The card randomly selects a time slot and returns a response within the time slot. If the four cards select different time slots, the card reader can receive four correct responses in sequence, thereby correctly identifying the four cards present simultaneously in the field. Furthermore, the card reader can select a card to initiate subsequent transactions based on pre-defined card selection criteria. If multiple cards select the same time slot, the card reader will not be able to recognize the anti-collision responses returned by these cards, indicating a card search conflict.
[0172] Multiple time slots are different time segments for the card reader to perform the card search task. Figure 3 As shown, it is a schematic diagram of different time slots.
[0173] In a specific example, the number of the multiple time slots is flexibly pre-configured according to user needs.
[0174] For example, the number of the multiple time slots includes but is not limited to 4, 5, 6, etc.
[0175] Step 705 : generating a target time for the anti-collision response according to the number of the multiple time slots, the time margin for the anti-collision response, and the transmission time of the anti-collision response.
[0176] The target time of anti-collision response is the total time it takes for the card reader to receive anti-collision response packets from multiple cards. The target time of anti-collision response is not a fixed time. It is related to the number of multiple time slots, the time margin of anti-collision response and the transmission time of anti-collision response. That is to say, the target time of anti-collision response changes with the number of multiple time slots.
[0177] The time margin of the anti-collision response represents the time width reserved for each anti-collision response, and the transmission time of the anti-collision response represents the time consumed in the transmission process of each anti-collision response.
[0178] In a specific example, the target time of the anti-collision response is generated according to the number of the multiple time slots, the time margin of the anti-collision response, and the transmission time of the anti-collision response, and is calculated by the following formula:
[0179] T m =n(t1+t2)
[0180] Among them, T m is the target time of the anti-collision response, t1 is the time margin of the anti-collision response, n is the number of multiple time slots, and t2 is the transmission time of the anti-collision response.
[0181] For example, the number of multiple time slots is 4, the time margin of anti-collision response is 0.5ms, and the transmission time of anti-collision response is 1.25ms. The target time T of anti-collision response is calculated according to the above method. m =n(t1+t2)=4×(0.5+1.25)=7ms.
[0182] According to the traditional method, no matter how many time slots there are, a collision response is returned for each time slot at a fixed time. The fixed time is usually 8 time slots. The transmission time of the anti-collision response is 1.25ms. The fixed time for returning the anti-collision response in the traditional method is 10ms.
[0183] By comparison, it is found that this embodiment targets 4 time slots, which can reduce the card search and recognition time of the card reader device compared with the traditional method.
[0184] Step 706: Receive first anti-collision response packets returned by multiple cards according to the target time of anti-collision response.
[0185] The traditional method stipulates that the card reader device must wait for an anti-collision response for a fixed period of time after sending an anti-collision command packet. That is to say, no matter how many time slots are specified, the card reader device must wait for an anti-collision response after sending the anti-collision command. When the number of supported time slots is small, the card search and recognition time is significantly increased.
[0186] The anti-collision response target time in this embodiment changes dynamically with the number of time slots. Therefore, after sending an anti-collision instruction packet, the card reader must receive the first anti-collision response packet returned by multiple cards according to the anti-collision response target time, thereby reducing card search and recognition time.
[0187] Step 707: Identify whether multiple cards collide again based on the first anti-collision response packet.
[0188] When the card reader recognizes that multiple cards have selected the same time slot again, it means that multiple cards have collided, that is, the card reader recognizes that multiple cards collided again at the same time in the field.
[0189] Step 708, when the multiple cards collide again, return to the step of sending the first anti-collision instruction packet to the multiple cards for the first time when identifying the first collision of the multiple cards, until the preset condition is met.
[0190] In some optional embodiments, in step S708, when the multiple cards collide again, returning to the step of sending the first anti-collision instruction packet to the multiple cards for the first time when the multiple cards collide for the first time, until a preset condition is met, includes:
[0191] When the plurality of cards collide again, the process returns to step S704 in which the first anti-collision instruction packet is sent to the plurality of cards for the first time when the plurality of cards collide for the first time, until the second preset number of times is reached.
[0192] Due to the traditional method, when multiple cards collide during the card search and identification process, if the anti-collision command is not resent infinitely without shutting down the field, it will lead to increased energy consumption.
[0193] Therefore, in order to avoid sending the first anti-collision instruction packet repeatedly for an unlimited number of times, this embodiment sets the number of retries, that is, sets the upper limit value of the number of times the second anti-collision instruction packet is sent. The upper limit value is the second preset number mentioned above. For example, the second preset number is n2, and the first preset number can be set flexibly.
[0194] This embodiment still avoids infinite retransmission of the data of the first anti-collision instruction packet through the above-mentioned method, thereby achieving the purpose of saving energy consumption.
[0195] In some optional embodiments, in step S708, when the multiple cards collide again, returning to the step of sending the first anti-collision instruction packet to the multiple cards for the first time when the multiple cards collide for the first time, until a preset condition is met, includes:
[0196] When the plurality of cards collide again, the process returns to step S704 in which the first anti-collision instruction packet is sent to the plurality of cards for the first time when the plurality of cards collide for the first time, until all the plurality of cards are correctly identified.
[0197] Due to the traditional method, when the card reader is searching for multiple cards, once a card search conflict occurs, the card reader will shut down and then restart the initialization process. If multiple conflicts occur, the restart action needs to be performed multiple times, resulting in reduced card search efficiency.
[0198] Therefore, in this embodiment, when a conflict occurs again while identifying multiple cards, the card reader device does not need to shut down and reopen to restart the initialization process. Instead, it attempts to send the first anti-collision instruction packet to multiple cards multiple times until all multiple cards are correctly identified. Ultimately, the present invention enables the card reader device to accurately identify all multiple cards in the fastest and most efficient manner. The card search and identification method in this embodiment not only improves card search efficiency but also reduces the target anti-collision response time.
[0199] In this embodiment, a card search and identification method is provided, which can be used for each of multiple cards. The card can be deployed on a mobile terminal, such as a mobile phone or a tablet computer. Figure 8 : is a flow chart of a card search and identification method according to an embodiment of the present invention. Figure 8 As shown, the process includes the following steps:
[0200] Step S801: receiving a card search instruction sent by a card reader.
[0201] Step S802: Send a card search response to the card reader.
[0202] Step S803: receiving a first anti-collision instruction packet sent for the first time by the card reader device, where the first anti-collision instruction packet carries the number of multiple time slots of anti-collision responses supported by the card reader device.
[0203] Step S804: Send a first anti-collision response packet to the card reader device to enable the card reader device to identify whether multiple cards collide again. When multiple cards collide again, the card reader device repeats the card search and identification method until a preset condition is met.
[0204] This embodiment is the reverse process of the above steps S701 to S708, which will not be described in detail here.
[0205] The card search and identification method in this embodiment can not only improve the card search efficiency, but also reduce the target time of the anti-collision response.
[0206] This embodiment also provides a card search and identification device for implementing the above-mentioned embodiments and preferred implementations. Details already described will not be repeated. As used below, the term "module" may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.
[0207] This embodiment provides a card identification device, such as Figure 9 Shown, including:
[0208] The first sending module 901 is used to send a first anti-collision instruction packet to the multiple cards for the first time when it is identified that a collision occurs for the first time among multiple cards. The first anti-collision instruction packet carries the number of multiple time slots of anti-collision response supported by the card reader.
[0209] The first generating module 902 is configured to generate a target time for the anti-collision response according to the number of the multiple time slots, the time margin for the anti-collision response, and the transmission time of the anti-collision response.
[0210] The first receiving module 903 is configured to receive first anti-collision response packets returned by multiple cards according to the target time of the anti-collision response.
[0211] The first identification module 904 is configured to identify whether a conflict occurs again among the multiple cards according to the first anti-collision response packet.
[0212] The second identification module 905 sends a second anti-collision instruction packet to the multiple cards when the multiple cards collide again, and identifies the multiple cards based on the second anti-collision response packets returned by the multiple cards. The second anti-collision instruction packet is loaded with the number of multiple time slots of anti-collision response supported by the card reading device and the identifier of the target time slot where the conflict occurs again.
[0213] In some optional implementations, the second identification module 905 includes:
[0214] The first identification submodule is used to repeatedly send a second anti-collision instruction packet to multiple cards when a collision occurs again until all the cards are correctly identified. The second anti-collision instruction packet is loaded with the number of multiple time slots of anti-collision response supported by the card reading device and the identifier of the target time slot where the most recent collision occurred.
[0215] In some optional implementations, the second identification module 905 includes:
[0216] The second identification submodule is used to repeatedly send a second anti-collision instruction packet to the multiple cards when a collision occurs again, until the number of times the second anti-collision instruction packet is repeatedly sent to the multiple cards reaches a first preset number, and then stop sending the second anti-collision instruction packet. The second anti-collision instruction packet is loaded with the number of multiple time slots of anti-collision response supported by the card reading device and the identifier of the target time slot where the most recent collision occurred.
[0217] In some optional implementations, before the first sending module 901, the following steps are included:
[0218] The second sending module is used to send a card search instruction to multiple cards;
[0219] The second receiving module is used to receive card search responses returned by multiple cards;
[0220] The third identification module is used to identify whether a conflict occurs for the first time among multiple cards according to the card search response.
[0221] In some optional implementations, when sending the anti-collision instruction to the target card where the collision occurs for the first time over multiple time slots, the number of the multiple time slots is increased.
[0222] In some optional implementations, a target time for the anti-collision response is generated based on the number of time slots, the time margin for the anti-collision response, and the transmission time of the anti-collision response, and is calculated using the following formula:
[0223] T m =n(t1+t2)
[0224] Among them, T m is the target time of the anti-collision response, t1 is the time margin of the anti-collision response, n is the number of multiple time slots, and t2 is the transmission time of the anti-collision response.
[0225] This embodiment further provides a card search and identification device for each of a plurality of cards, the method comprising:
[0226] A third receiving module is used to receive a card search instruction sent by a card reader;
[0227] A third sending module is used to return the first anti-collision response packet to the card reading device and record the identifier of the selected time slot;
[0228] a fourth sending module, configured to return the first anti-collision response packet to the card reader and record an identifier of the selected time slot;
[0229] A fourth receiving module, configured to receive a second anti-collision instruction packet sent by the card reading device;
[0230] The fifth sending module is used to send a second anti-collision response packet to multiple cards so that the card reading device can identify multiple cards. The second anti-collision instruction packet is loaded with the number of multiple time slots for anti-collision response supported by the card reading device and the identifier of the target time slot where the conflict occurs again.
[0231] In some optional implementations, the fifth sending module includes:
[0232] a first sending submodule, configured to repeatedly receive a second anti-collision instruction packet sent by the card reader device until the card reader device correctly identifies all of the multiple cards based on the second anti-collision response packet returned to the card reader device each time, wherein the second anti-collision instruction packet carries an identifier of a target time slot where a most recent collision occurred;
[0233] A first confirmation submodule, during each reception of a second anti-collision instruction packet sent by the card reader, confirms whether the identifier of the selected time slot is consistent with the identifier of the target time slot where the most recent collision occurred;
[0234] The second sending submodule is configured to randomly select any time slot from the multiple time slots according to the number of the multiple time slots, and return a second anti-collision response packet to the card reading device.
[0235] The conflict ignoring submodule is used to ignore the second anti-collision instruction packet if no.
[0236] This embodiment also provides a card search and identification device for a card reader, the device comprising:
[0237] a sixth sending module, configured to send a card search instruction to multiple cards;
[0238] The fifth receiving module is used to receive card search responses returned by multiple cards;
[0239] a fourth identification module, configured to identify whether a conflict occurs for the first time among multiple cards based on the card search response;
[0240] a seventh sending module, configured to send a first anti-collision instruction packet to the multiple cards for the first time when a collision occurs for the first time among the multiple cards, wherein the first anti-collision instruction packet carries the number of multiple time slots of anti-collision response supported by the card reading device;
[0241] a second generating module, configured to generate a target time for the anti-collision response according to the number of the plurality of time slots, the time margin for the anti-collision response, and the transmission time of the anti-collision response;
[0242] An eighth sending module, configured to receive first anti-collision response packets returned by multiple cards according to the target time of the anti-collision response;
[0243] a fifth identification module, configured to identify whether a conflict occurs again among the multiple cards based on the first anti-collision response packet;
[0244] The action return module is used to return to the fourth sending module when multiple cards conflict again until the preset conditions are met.
[0245] In some optional implementations, the action return module includes:
[0246] The first return submodule is used to return to the step of sending the first anti-collision instruction packet to the multiple cards for the first time when the multiple cards collide again, and the step is repeated until the second preset number of times is reached.
[0247] In some optional implementations, the action return module includes:
[0248] The second returning submodule is used for returning to the step of sending the first anti-collision instruction packet to the multiple cards for the first time when the multiple cards collide again, until all the multiple cards are correctly identified.
[0249] The present invention provides a card search and identification device for each of a plurality of cards, the device comprising:
[0250] A sixth receiving module, configured to receive a card search instruction sent by a card reader;
[0251] A ninth sending module, configured to send a card search response to the card reader;
[0252] A seventh receiving module is configured to receive a first anti-collision instruction packet sent for the first time by the card reading device, where the first anti-collision instruction packet carries the number of multiple time slots of anti-collision responses supported by the card reading device;
[0253] The tenth sending module is used to send a first anti-collision response packet to the card reading device to enable the card reading device to identify whether multiple cards collide again. When multiple cards collide again, the card reading device repeats the card search and identification method until the preset conditions are met.
[0254] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0255] The card search and identification device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0256] An embodiment of the present invention further provides a computer device having the above-mentioned card-finding and identification device.
[0257] See also Figure 10 , Figure 10 is a structural diagram of a computer device provided by an optional embodiment of the present invention, such as Figure 10 As shown, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components utilize different buses to communicate with each other and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in the memory or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Equally, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 10 A processor 10 is taken as an example.
[0258] The processor 10 may be a central processing unit, a network processor, or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic, or any combination thereof.
[0259] The memory 20 stores instructions that can be executed by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0260] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created based on the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0261] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0262] The computer device further includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 10 The bus connection is taken as an example.
[0263] The input device 30 can receive input digital or character information and generate key signal input related to user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a trackpad, a touch pad, an indicator stick, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 can include a display device, an auxiliary lighting device (e.g., an LED), and a tactile feedback device (e.g., a vibration motor). The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display, and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0264] The embodiment of the present invention also provides a computer-readable storage medium. The above-mentioned method according to the embodiment of the present invention can be implemented in hardware, firmware, or implemented as a computer code that can be recorded in a storage medium, or implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor or hardware, the method shown in the above embodiment is implemented.
[0265] A portion of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the form in which the computer program instruction exists in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc. Accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium that can be accessed by the computer.
[0266] A portion of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the form in which the computer program instruction exists in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc. Accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium that can be accessed by the computer.
[0267] Although the embodiments of the present invention have been described with reference to the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention. Such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A card search and identification method, characterized in that: For a card reader device, the method includes: When a collision occurs for the first time among multiple cards, a first anti-collision instruction packet is sent to the multiple cards for the first time, wherein the first anti-collision instruction packet carries the number of multiple time slots of anti-collision response supported by the card reading device; generating a target time for the anti-collision response based on the number of the plurality of time slots, a time margin for the anti-collision response, and a transmission time for the anti-collision response; receiving first anti-collision response packets returned by the plurality of cards according to the target time of the anti-collision response; identifying, according to the first anti-collision response packet, whether the plurality of cards collide again; When the multiple cards collide again, a second anti-collision instruction packet is sent to the multiple cards, and the multiple cards are identified based on the second anti-collision response packets returned by the multiple cards. The second anti-collision instruction packet is loaded with the number of multiple time slots of anti-collision response supported by the card reading device and the identifier of the target time slot where the conflict occurs again.
2. The card search and identification method according to claim 1, characterized in that: When the multiple cards collide again, a second anti-collision instruction packet is sent to the multiple cards, and the multiple cards are identified according to the second anti-collision response packets returned by the multiple cards, including: When the multiple cards collide again, a second anti-collision instruction packet is repeatedly sent to the multiple cards until all the multiple cards are correctly identified based on the second anti-collision response packet returned by each of the multiple cards each time. The second anti-collision instruction packet is loaded with the number of multiple time slots of anti-collision response supported by the card reading device and the identifier of the target time slot where the most recent collision occurred.
3. The method according to claim 1, characterized in that When the multiple cards collide again, a second anti-collision instruction packet is sent to the multiple cards, and the multiple cards are identified according to the second anti-collision response packets returned by the multiple cards, including When the multiple cards collide again, a second anti-collision instruction packet is repeatedly sent to the multiple cards until the number of times the second anti-collision instruction packet is repeatedly sent to the multiple cards reaches a first preset number, and then the sending of the second anti-collision instruction packet is stopped. The second anti-collision instruction packet is loaded with the number of multiple time slots of anti-collision response supported by the card reading device and the identifier of the target time slot where the most recent collision occurred.
4. The card search and identification method according to claim 1, wherein: Before the step of sending the first anti-collision instruction packet to the plurality of cards for the first time, the method includes: Sending a card search instruction to the multiple cards; receiving card search responses returned by the plurality of cards; According to the card search response, it is identified whether the multiple cards conflict for the first time.
5. The method according to claim 1, wherein When sending an anti-collision instruction to a target card where a collision occurs for the first time, the number of the multiple time slots is increased.
6. The method according to any one of claims 1 to 5, characterized in that A target time for the anti-collision response is generated according to the number of the multiple time slots, the time margin for the anti-collision response, and the transmission time of the anti-collision response, and is calculated using the following formula: T m =n(t1+t2) Among them, T m is the target time of the anti-collision response, t1 is the time margin of the anti-collision response, n is the number of the multiple time slots, and t2 is the transmission time of the anti-collision response.
7. A card identification method, characterized in that: For each card of the plurality of cards, the method comprises: Receive the card search instruction sent by the card reader; receiving a first anti-collision instruction packet sent for the first time by the card reading device, where the first anti-collision instruction packet carries the number of multiple time slots of anti-collision responses supported by the card reading device; Returning a first anti-collision response packet to the card reader device and recording an identifier of the selected time slot; receiving a second anti-collision instruction packet sent by the card reading device; A second anti-collision response packet is sent to the multiple cards so that the card reader device can identify the multiple cards. The second anti-collision instruction packet is loaded with the number of multiple time slots of anti-collision response supported by the card reader device and the identifier of the target time slot where the collision occurs again.
8. The method according to claim 7, characterized in that Sending a second anti-collision response packet to the multiple cards so that the card reading device can identify the multiple cards includes: Repeatedly sending a second anti-collision response packet to the multiple cards until the card reader correctly identifies all the multiple cards based on the second anti-collision response packet returned to the card reader each time, wherein the second anti-collision instruction packet carries an identifier of the target time slot where the most recent collision occurred; During each reception of the second anti-collision instruction packet sent by the card reader, confirming whether the identifier of the selected time slot is consistent with the identifier of the target time slot where the most recent collision occurred; If so, randomly selecting any time slot from the multiple time slots according to the number of the multiple time slots, and returning a second anti-collision response packet to the card reading device; If not, ignore the second anti-collision response packet.
9. A card identification method, characterized in that: For a card reader device, the method includes: Send card search instructions to multiple cards; receiving card search responses returned by the plurality of cards; identifying, based on the card search response, whether a conflict occurs for the first time among the multiple cards; When a collision occurs for the first time among multiple cards, a first anti-collision instruction packet is sent to the multiple cards for the first time, wherein the first anti-collision instruction packet carries the number of multiple time slots of anti-collision response supported by the card reading device; generating a target time for the anti-collision response based on the number of the plurality of time slots, a time margin for the anti-collision response, and a transmission time for the anti-collision response; receiving first anti-collision response packets returned by the plurality of cards according to the target time of the anti-collision response; identifying, according to the first anti-collision response packet, whether the plurality of cards collide again; When the plurality of cards collide again, the process returns to the step of sending the first anti-collision instruction packet to the plurality of cards for the first time when the plurality of cards collide for the first time, until the preset condition is met.
10. The card search and identification method according to claim 9, characterized in that: When the plurality of cards conflict again, returning to the step of identifying the first conflict between the plurality of cards and sending the first anti-collision instruction packet to the plurality of cards for the first time until a preset condition is met, includes: When the plurality of cards collide again, the process returns to the step of sending the first anti-collision instruction packet to the plurality of cards for the first time when the plurality of cards collide for the first time, and the process continues until the second preset number of times is reached.
11. The card search and identification method according to claim 9, characterized in that: When the plurality of cards conflict again, returning to the step of identifying the first conflict between the plurality of cards and sending the first anti-collision instruction packet to the plurality of cards for the first time until a preset condition is met, the step includes: When the plurality of cards collide again, the process returns to the step of sending the first anti-collision instruction packet to the plurality of cards for the first time when the plurality of cards collide for the first time, until all the plurality of cards are correctly identified.
12. A card search and identification method, characterized in that: For each card of the plurality of cards, the method comprises: Receive the card search instruction sent by the card reader; Sending a card search response to the card reading device; receiving a first anti-collision instruction packet sent for the first time by the card reading device, where the first anti-collision instruction packet carries the number of multiple time slots of anti-collision responses supported by the card reading device; A first anti-collision response packet is sent to the card reader device to enable the card reader device to identify whether multiple cards collide again. When the multiple cards collide again, the card reader device repeatedly executes the card search and identification method until a preset condition is met.
13. A card identification device, characterized in that: For a card reading device, the device comprises: A first sending module is configured to send a first anti-collision instruction packet to the multiple cards for the first time when a collision occurs for the first time among the multiple cards, wherein the first anti-collision instruction packet is loaded with the number of multiple time slots of anti-collision response supported by the card reading device; A first generating module, configured to generate a target time for the anti-collision response according to the number of the plurality of time slots, a time margin for the anti-collision response, and a transmission time for the anti-collision response; A first receiving module is configured to receive first anti-collision response packets returned by the plurality of cards according to the target time of the anti-collision response; a first identification module, configured to identify whether a conflict occurs again among the plurality of cards according to the first anti-collision response packet; The second identification module sends a second anti-collision instruction packet to the multiple cards when the multiple cards collide again, and identifies the multiple cards based on the second anti-collision response packets returned by the multiple cards. The second anti-collision instruction packet is loaded with the number of multiple time slots of anti-collision response supported by the card reading device and the identifier of the target time slot where the conflict occurs again.
14. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the card search and identification method according to any one of claims 1 to 12 by executing the computer instructions.
15. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the card-searching and identification method according to any one of claims 1 to 12.
16. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the card-searching and identifying method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Conflict solution method for recognizing multiple radio frequency labels
CN101436243A
Method for resisting car reading conflict by automatic frequency hopping
CN101739539A
RFID tag identification method, reader, target tag and computer medium
CN113688641A
Non-contact communication anti-collision method, radio frequency identification card and card reader
CN114742084A