CN108664822B - Method for optimizing power consumption of card reader and card reader - Google Patents

Method for optimizing power consumption of card reader and card reader Download PDF

Info

Publication number
CN108664822B
CN108664822B CN201810417637.9A CN201810417637A CN108664822B CN 108664822 B CN108664822 B CN 108664822B CN 201810417637 A CN201810417637 A CN 201810417637A CN 108664822 B CN108664822 B CN 108664822B
Authority
CN
China
Prior art keywords
module
card
card reader
register
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810417637.9A
Other languages
Chinese (zh)
Other versions
CN108664822A (en
Inventor
陆舟
于华章
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Feitian Technologies Co Ltd
Original Assignee
Feitian Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Feitian Technologies Co Ltd filed Critical Feitian Technologies Co Ltd
Priority to CN201810417637.9A priority Critical patent/CN108664822B/en
Publication of CN108664822A publication Critical patent/CN108664822A/en
Application granted granted Critical
Publication of CN108664822B publication Critical patent/CN108664822B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/0008General problems related to the reading of electronic memory record carriers, independent of its reading method, e.g. power transfer

Abstract

The invention discloses a method for optimizing power consumption of a card reader and the card reader. The method comprises the following steps: the card reader activates the card, sends a power request instruction to the card and receives a power instruction returned by the card, and judges whether the integrity function power is sufficient according to the power instruction to obtain a first judgment result; judging whether a judgment reference is stored or not, if so, comparing whether a first judgment result is matched with the judgment reference or not, if so, storing the first judgment result as the judgment reference, adjusting the current field intensity according to the value of a preset rule adjusting register, sending a power request instruction to the card and receiving a power instruction returned by the card; and if the judgment base criterion is not stored, storing the first judgment result as the judgment base criterion, adjusting the current field intensity according to the value of the preset rule adjusting register, sending a power request instruction to the card and receiving a power instruction returned by the card. The invention improves the performance of the card reader and improves the user experience.

Description

Method for optimizing power consumption of card reader and card reader
Technical Field
The invention relates to the field of communication, in particular to a method for optimizing power consumption of a card reader and the card reader.
Background
Near Field Communication (NFC), also called near Field communication, is a short-range high-frequency wireless communication technology, which allows data exchange between electronic devices in a non-contact manner.
At present, high-frequency non-contact cards are already used in the payment fields of public transport, finance and the like, and the application of the non-contact cards is closely related to the field intensity generated by a card reader. If the field intensity of the card reader is too high, excessive power consumption is easy to generate, and if the field intensity of the card reader is too low, certain functions of the non-contact card cannot work normally.
Therefore, the card reader in the prior art has the problems that although the processing efficiency is high, the processing efficiency is greatly higher than the power consumption of the normal operation of the functions of the non-contact card, or because the power consumption of the card reader is too low, a part of functions of the non-contact card cannot be normally used when the card reader is in communication with the non-contact card.
Disclosure of Invention
In order to solve the technical problem, the invention provides a method for optimizing the power consumption of a card reader, which comprises the following steps:
step 1, activating a card by a card reader;
step 2, the card reader sends a power request instruction to the card and receives a power instruction returned by the card;
step 3, the card reader judges whether the integrity function power is sufficient according to the power indication to obtain a first judgment result;
step 4, the card reader judges whether a judgment reference is stored, if so, step 5 is executed, and if not, step 6 is executed;
step 5, the card reader compares whether the first judgment result is matched with the judgment reference, if so, the step 6 is executed, and if not, the current field intensity is recorded according to the value of the register, and the card reader continues to communicate with the card;
and 6, the card reader stores the first judgment result as a judgment reference, adjusts the current field intensity according to the value of the preset rule adjustment register, and returns to execute the step 2.
The present invention also provides a card reader comprising:
the activation module is used for activating the card;
the sending module is used for sending a power request instruction to the card after the card is activated by the activation module; the power module is also used for sending a power request instruction to the card after the adjusting module adjusts the current field intensity according to the value of the preset rule adjusting register;
the receiving module is used for receiving the power indication returned by the card;
the first judgment module is used for judging whether the integrity function power is sufficient according to the power indication received by the receiving module to obtain a first judgment result;
the second judgment module is used for judging whether the storage module stores a judgment reference or not;
the comparison module is used for comparing whether the first judgment result is matched with the judgment reference or not when the second judgment module judges that the storage module stores the judgment reference;
the storage module is used for storing the first judgment result as the judgment reference when the second judgment module judges that the storage module does not store the judgment reference; when the second judging module judges that the storage module stores the judging reference, and the comparing module compares the first judging result with the judging reference to be matched, the first judging result is stored as the judging reference;
the adjusting module is used for adjusting the value of the register according to a preset rule to adjust the current field intensity after the storage module stores the first judgment result as a judgment reference;
and the recording communication module is used for recording the current field intensity according to the value of the register and continuing to communicate with the card when the comparison module compares that the first judgment result is not matched with the judgment reference.
The invention has the beneficial effects that: the invention provides a method for optimizing the power consumption of a card reader and the card reader, which adjust the field intensity through the card reader, realize the normal function of a non-contact card during the communication with the non-contact card, reduce the power consumption of the card reader, reduce the failure rate of card reading, improve the performance of the card reader and improve the user experience.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a flowchart of a method for optimizing power consumption of a card reader according to embodiment 1 of the present invention;
FIG. 2 is a flowchart of a method for optimizing power consumption of a card reader according to embodiment 2 of the present invention;
FIG. 3 is a flowchart of a method for optimizing power consumption of a card reader according to embodiment 3 of the present invention;
FIG. 4 is a flowchart of another method for optimizing power consumption of a card reader according to embodiment 3 of the present invention;
fig. 5 is a structural diagram of a card reader according to embodiment 4 of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example 1
The embodiment provides a method for optimizing power consumption of a card reader, as shown in fig. 1, specifically including the following steps:
step 1, activating a card by a card reader;
step 2, the card reader sends a power request instruction to the card and receives a power instruction returned by the card;
step 3, the card reader judges whether the integrity function power is sufficient according to the power indication to obtain a first judgment result;
step 4, the card reader judges whether a judgment reference is stored, if so, step 5 is executed, and if not, step 6 is executed;
step 5, the card reader compares whether the first judgment result is matched with the judgment reference, if so, the step 6 is executed, and if not, the current field intensity is recorded according to the value of the register, and the card reader continues to communicate with the card;
and 6, the card reader stores the first judgment result as a judgment reference, adjusts the current field intensity according to the value of the preset rule adjustment register, and returns to execute the step 2.
Optionally, if the first determination result obtained in step 3 is yes, recording the current field strength according to the value of the register in step 5 specifically, recording the current value of the register as the current field strength, and adjusting the value of the register according to the preset rule in step 6 specifically: the card reader saves the current value of the register, and the value of the register is set in an increasing mode to adjust the current field intensity;
if the first judgment result obtained in the step 3 is negative, recording the current field strength according to the value of the register in the step 5, specifically, recording the stored value of the register as the current field strength, and adjusting the value of the register according to the preset rule in the step 6, specifically: the card reader adjusts the value of the register in a decreasing mode to adjust the current field intensity.
Optionally, after step 1, the card reader sets the current field strength to be maximum;
step 4-step 6 are replaced by:
step 41, the card reader judges whether a judgment reference is stored, if so, step 51 is executed;
otherwise, when the first judgment result is yes, executing step 61;
when the first judgment result is negative, the card reader reports an error, and the operation is finished;
step 51, the card reader compares the first judgment result with the judgment reference to judge whether the first judgment result is matched with the judgment reference, if so, the step 61 is executed, and if not, the step 71 is executed;
step 61, the card reader saves the current value of the register, sets the value of the register according to an increasing mode to adjust the current field intensity, and returns to the step 2;
and step 71, the card reader records the value of the stored register as the current field intensity and continues to communicate with the card. Optionally, after step 1, the card reader sets the current field strength to be minimum;
step 4-step 6 are replaced by:
step 42, the card reader judges whether a judgment reference is stored, if so, step 52 is executed;
otherwise, when the first judgment result is yes, the card reader reports an error, and the operation is finished;
when the first judgment result is negative, executing step 62;
step 52, the card reader compares the first judgment result with the judgment reference to judge whether the first judgment result is matched with the judgment reference, if so, the step 62 is executed, and if not, the step 72 is executed;
step 62, the card reader sets the value of the register according to a decreasing mode to adjust the current field intensity, and returns to the step 2;
and step 72, recording the current value of the register as the current field intensity by the card reader, and continuing to communicate with the card.
Optionally, in step 1, activating the card by the card reader specifically includes:
step 1-1, starting a card reader and initializing a radio frequency chip of the card reader;
step 1-2, the card reader starts the non-contact field intensity,
step 1-3, the card reader sends a card searching instruction;
step 1-4, the card reader receives activation response data of the card.
Optionally, when the first determination result obtained in step 3 is negative, after step 6 is executed, the step 2 is executed instead of:
step 2-1, the card reader sends a power request instruction to the card and judges whether a power instruction returned by the card is received within a preset time, if so, step 3 is executed, and if not, step 2-2 is executed;
step 2-2, the card reader judges whether the number of times of sending the power request exceeds the preset number of times, if so, the step 1-3 is executed; if not, step 2-1 is performed.
Optionally, when the first determination result obtained in step 3 is yes, after step 6 is executed, the step 2 is executed instead of:
step 6-1, the card reader sends a power request instruction to the card and judges whether a power instruction returned by the card is received within a preset time, if so, step 3 is executed, and if not, step 6-2 is executed;
step 6-2, the card reader judges whether the number of times of sending the power request exceeds the preset number of times, if so, the step 6-3 is executed; if not, executing step 6-1;
6-3, the card reader adjusts the field intensity to the value of the stored register, and executes the step 6-4 after sending a power request instruction to the card;
6-4, judging whether a power indication returned by the card is received by the card reader within a preset time, if so, recording the current value of the register as the current field intensity by the card reader, and continuing to communicate with the card; if not, returning to the step 1-3.
Example 2
The embodiment provides a method for optimizing power consumption of a card reader, as shown in fig. 2, specifically including the following steps:
step 201, starting up a card reader and initializing a radio frequency chip of the card reader;
specifically, the steps may be: and powering on the card reader, setting the card reading mode of the card reader to be the non-contact card reading mode, and setting a register value, namely setting the value of the register to be a default register value 0XA 0.
Step 202, the card reader starts the non-contact field strength and sends a card searching Command REQA (Request Command);
specifically, the card reader turns on the non-contact field strength, and the sent card seeking instruction REQA is 0x 26.
Step 203, the card reader judges whether an ATQA instruction (Answer To Request, Request response instruction) returned by the card is received, if yes, step 204 is executed, and if not, step 202 is returned;
step 204, the card reader sends a first SEL instruction (Select code) for selecting a card;
specifically, the first SEL instruction is 0X 930X 20.
Step 205, the card reader judges whether UID data returned by the card is received, if yes, step 206 is executed, and if not, step 202 is returned;
step 206, the card reader sends a second SEL instruction for selecting the card;
specifically, the second SEL instruction is 0X 930X 70+ UID data (Unique Identifier data) returned by the card.
Step 207, the card reader judges whether a SAK instruction (Select AcKnowledge instruction) returned by the card is received, if so, step 208 is executed, and if not, step 202 is returned;
specifically, the SAK command is 40, if the card reader receives 40 data returned by the card, step 208 is executed, and if not, step 202 is returned.
Step 208, the card reader sends an RATS instruction (Request for Answer To Select, Select response Request instruction) for activating the card;
specifically, the reader sends a RATS command to activate the card as 0XE 00X 00.
Step 209, the card reader judges whether an ATS command (Answer To Select command) returned by the card is received, if yes, step 210 is executed, and if not, step 202 is returned;
step 210, the card reader sends a power request instruction;
specifically, the reader transmission power request command is 0xF 20 x 000 x 00.
Step 211, the card reader judges whether a power indication returned by the card is received within a preset time, if so, step 213 is executed, and if not, step 212 is executed;
specifically, the predetermined time is: 10 milliseconds.
The power returned by the card is indicated as: 0xF 20X 800X 80 or 0xF 20X 400X 40.
Step 212, the card reader judges whether the number of times of sending the power request exceeds the preset number of times, if so, the step 202 is returned, and if not, the step 208 is returned;
specifically, the preset number of times may be 3 times.
Step 213, the card reader judges whether the power of the integrity function is sufficient according to the power indication returned by the card, if so, the current value of the register is saved, step 214 is executed, and if not, step 222 is executed;
in this step, if the power indication data returned by the card is 0xF 20X 800X 80, indicating that the integrity function power is sufficient, the card reader saves the register value 0XA0, step 214 is executed, and if the power indication data returned by the card is 0xF 20X 400X 40, indicating that the integrity function power is not sufficient, step 222 is executed.
Step 214, adjusting the field intensity of the card reader by the incremental value of the setting register of the card reader;
specifically, in this step, the card reader sets the value of the register in increments of 8 numbers as a unit according to the current value of the register, so that the current field strength of the card reader is decreased progressively.
In this embodiment, specifically, when the card reader determines that the power of the integrity function is sufficient in step 213, the card reader stores the register value and executes step 214; step 214 is specifically that the card reader sets the value of the register to 0XA8 according to the current value of the register, that is, the default register value 0XA0 in step 201, plus 8 numbers;
step 215, the card reader sends a power request command;
specifically, the reader transmission power request command is 0xF 20 x 000 x 00.
Step 216, the card reader judges whether a power indication returned by the card is received within a preset time, if so, step 220 is executed, and if not, step 217 is executed;
specifically, the predetermined time may be 10 milliseconds (ms).
Step 217, the card reader judges whether the number of times of sending the power request exceeds a preset number, if so, step 218 is executed, and if not, the step 215 is returned;
specifically, the preset number of times is 3.
Step 218, the card reader adjusts the field strength to the field strength when the value of the register is saved, and sends a power request instruction;
specifically, in this embodiment, the card reader sends the power request command to be 0xF 20 × 000 × 00.
Specifically, when the card reader adjusts the field strength of the card reader in a decreasing manner in step 214, that is, the card reader sets the value of the register to 0XA8, the stored value of the register is 0XA0 when the step is executed, and specifically, the card reader adjusts the value of the register OXA8 to 0XA0 and sends a power request command 0xF 20 x 000 x 00.
Step 219, the card reader judges whether a power indication returned by the card is received within a preset time, if so, step 227 is executed, and if not, step 202 is returned;
step 220, the card reader judges whether the power of the integrity function is sufficient according to the power indication returned by the card, if so, the current value of the register is saved, step 214 is executed, and if not, step 221 is executed;
in this step, if the power indication data returned by the card is 0xF 20X 800X 80, it indicates that the integrity function power is abundant, and if the power indication data returned by the card is 0xF 20X 400X 40, it indicates that the integrity function power is not abundant.
In this embodiment, specifically, in this step, when the card reader determines that the integrity power is sufficient according to the power indication returned by the card, the value 0XA8 of the register is saved and the step 214 is returned, where the step 214 specifically is that the card reader adds 8 numbers to the saved value 0XA8 of the register, and sets the value of the register to 0XB 0;
step 221, the card reader records the saved value of the register as the current field strength, and uses the value in the subsequent process.
Specifically, the subsequent process includes the card reader continuing to communicate with the card.
In this embodiment, when the card reader determines that the integrity function power is not sufficient according to the power indication returned by the card in step 220, specifically in this step, the card reader records the value of the register stored when the card reader determines that the integrity function power is sufficient according to the power indication returned by the card in step 220 as the current field strength, that is, the value of the register stored is 0XA8 as the current field strength, and the register is used in the subsequent process.
Specifically, the subsequent process includes the card reader continuing to communicate with the card.
Step 222, adjusting the field intensity of the card reader by the descending value of the setting register of the card reader;
specifically, in this step, the card reader sets the register value in a descending manner in units of 8 numbers according to the current register value, so that the current field strength of the card reader is increased progressively.
Specifically, when the card reader determines that the integrity function power is not sufficient in step 213, in this step, the card reader subtracts 8 from the default register value 0XA0 in step 201, that is, the value of the register is set to 0X 98.
Step 223, the card reader sends a power request command;
specifically, the reader transmission power request command is 0xF 20 x 000 x 00.
Step 224, the card reader judges whether the power indication returned by the card is received within the preset time, if yes, step 226 is executed, and if not, step 225 is executed;
specifically, the predetermined time is 10 milliseconds (ms).
Step 225, the card reader judges whether the number of times of sending the power request exceeds the preset number of times, if so, the step 202 is returned, and if not, the step 223 is executed;
specifically, the preset number of times is 3.
Step 226, the card reader judges whether the power of the integrity function is sufficient according to the power indication returned by the card, if so, step 227 is executed, and if not, step 222 is executed;
in this step, if the power indication data returned by the card is 0xF 20X 800X 80, it means that the integrity function power is abundant, and if the power indication data returned by the card is 0xF 20X 400X 40, it means that the integrity function power is not abundant.
Step 227, the card reader records the current value of the register as the current field strength, and uses it in the subsequent flow.
Specifically, the subsequent process includes the card reader continuing to communicate with the card.
Example 3
The embodiment provides a method for optimizing power consumption of a card reader, as shown in fig. 3, specifically including the following steps:
step 301, starting up a card reader and initializing a radio frequency chip of the card reader;
specifically, the steps may be: and powering on the card reader, setting the card reading mode of the card reader to be the non-contact card reading mode, and setting a register value, namely setting the value of the register to be a default register value 0XA 0.
Step 302, the card reader starts the non-contact field intensity and sends a card searching instruction REQA;
specifically, the card reader turns on the non-contact field strength, and the sent card seeking instruction REQA is 0x 26.
Step 303, the card reader judges whether an ATQA instruction returned by the card is received, if so, step 304 is executed, and if not, step 302 is returned;
step 304, the card reader sends a first SEL instruction for selecting a card;
specifically, the first SEL instruction is 0X 930X 20.
Step 305, the card reader judges whether UID data returned by the card is received, if so, step 306 is executed, and if not, step 302 is returned;
step 306, the card reader sends a second SEL instruction for selecting the card;
specifically, the second SEL instruction is the UID data returned by 0X 930X 70+ card.
Step 307, the card reader judges whether a SAK instruction returned by the card is received, if so, step 308 is executed, and if not, step 302 is returned;
specifically, the SAK command is 40, if the card reader receives 40 data returned by the card, step 308 is executed, and if not, step 302 is returned.
Step 308, the card reader sends an RATS command for activating the card;
specifically, the reader sends a RATS command to activate the card as 0XE 00X 00.
Step 309, the card reader judges whether an ATS instruction returned by the card is received, if yes, step 310 is executed, and if not, step 202 is returned;
step 310, setting the field intensity of the card reader to be maximum;
specifically, the reader sets the field strength to the maximum, specifically, the reader sets the register value to 0X 00.
Step 311, the card reader sends a power request command;
specifically, the reader transmission power request command is 0xF 20 x 000 x 00.
Step 312, the card reader judges whether a power indication returned by the card is received within a preset time, if so, step 314 is executed, and if not, step 313 is executed;
specifically, the predetermined time is: 10 milliseconds.
The power returned by the card is indicated as: 0xF 20X 800X 80 or 0xF 20X 400X 40.
Step 313, the card reader judges whether the number of times of sending the power request exceeds the preset number of times, if so, the step 302 is returned, and if not, the step 311 is returned;
specifically, the preset number of times may be 3 times.
Step 314, the card reader judges whether the power of the integrity function is sufficient according to the power indication returned by the card, if so, the current value of the register is saved, and step 315 is executed, and if not, an error is reported;
specifically, in this step, when the card reader determines that the integrity function power is sufficient according to the power indication returned by the card, the register value 0X00 is recorded.
315, adjusting the field intensity of the card reader by the incremental value of the setting register of the card reader;
specifically, in this step, the card reader sets the value of the register in increments of 8 numbers as a unit according to the current value of the register, so that the current field strength of the card reader is decreased progressively.
In this embodiment, specifically, in this step, the card reader adds 8 to the maximum register value 0X00 in step 310, and sets the register value to 0X 08;
step 316, the card reader sends a power request command;
specifically, the reader transmission power request command is 0xF 20 x 000 x 00.
Step 317, the card reader judges whether a power indication returned by the card is received within a preset time, if so, step 319 is executed; if not, go to step 318;
step 318, the card reader judges whether the number of times of sending the power request exceeds the preset number of times, if so, the step 302 is returned, and if not, the step 316 is returned;
specifically, the preset number of times may be 3 times.
319, the card reader judges whether the power of the integrity function is sufficient according to the power indication returned by the card, if so, the current value of the register is saved, 315 is executed, and if not, 320 is executed;
in this step, if the power indication data returned by the card is 0xF 20X 800X 80, it indicates that the integrity function power is abundant, and if the power indication data returned by the card is 0xF 20X 400X 40, it indicates that the integrity function power is not abundant.
Specifically, if the power indication data returned by the card is 0xF 20X 800X 80, which indicates that the integrity function is power-rich, the card reader records the register value 0X08, and step 315 is executed.
In step 320, the card reader records the saved value of the register as the current field strength, and uses the value in the subsequent process.
In this embodiment, as shown in fig. 4, step 310 may also be replaced with step 310': the card reader sets the field intensity to be minimum;
specifically, the setting of the field intensity to the minimum value by the card reader is specifically that the value of the card reader passing through the setting register is 0 XFF.
Then steps 314-319 can also be replaced by:
step 314 ', the card reader judges whether the power of the integrity function is sufficient according to the power indication returned by the card, if so, an error is reported, and if not, step 315' is executed;
315', adjusting the field intensity of the card reader by the descending value of the setting register of the card reader;
in this step, specifically, the card reader sets the value of the register in a descending manner by taking 8 numbers as units according to the current value of the register, so that the current field strength of the card reader is increased progressively.
In this embodiment, specifically, in this step, the card reader subtracts 8 registers from the value 0XFF of the register in step 301, and sets the value of the register to 0XF 7;
step 316', the card reader sends a power request command;
specifically, the reader transmission power request command is 0xF 20 x 000 x 00.
Step 317 ', the card reader judges whether a power indication returned by the card is received within a preset time, if so, the step 319' is executed; if not, go to step 318';
step 318 ', the card reader judges whether the number of times of sending the power request exceeds the preset number of times, if so, the step 302 is returned, and if not, the step 316' is returned;
specifically, the preset number of times may be 3 times.
319 ', the card reader judges whether the power of the integrity function is sufficient according to the power indication returned by the card, if so, step 320 ' is executed, and if not, step 315 ' is executed;
in this step, if the power indication data returned by the card is 0xF 20X 800X 80, it indicates that the integrity function power is abundant, and if the power indication data returned by the card is 0xF 20X 400X 40, it indicates that the integrity function power is not abundant.
At step 320', the card reader records the current value of the register as the current field strength and uses it in the post-process.
Example 4
As shown in fig. 5, the present embodiment provides a card reader 400, including:
an activation module 401 for activating a card;
a sending module 402, configured to send a power request instruction to the card after the activation module 401 activates the card; the adjusting module 408 is further configured to send a power request instruction to the card after adjusting the current field strength according to the value of the preset rule adjusting register;
a receiving module 403, configured to receive a power indication returned by the card;
a first determining module 404, configured to determine whether the integrity function power is sufficient according to the power indication received by the receiving module 403, so as to obtain a first determination result;
a second judging module 405, configured to judge whether the storage module 407 stores a judgment reference;
a comparing module 406, configured to compare whether the first determination result matches the determination criterion when the second determining module 405 determines that the storage module 407 stores the determination criterion;
a storage module 407, configured to store the first determination result as a determination criterion when the second determination module 405 determines that the storage module 407 does not store the determination criterion; when the second judging module 405 judges that the storage module 407 stores the judgment reference and the comparing module 406 compares the first judgment result with the judgment reference, storing the first judgment result as the judgment reference;
the adjusting module 408 is configured to adjust the current field strength according to a preset rule by adjusting the value of the register after the storage module 407 stores the first determination result as the determination reference;
and the recording communication module 409 is used for recording the current field intensity according to the value of the register and continuing to communicate with the card when the comparison module 406 compares that the first judgment result is not matched with the judgment reference.
Optionally, the record communication module 409 is specifically configured to, when the first determination result obtained by the first determining module 404 is yes, and the comparing module 406 compares the first determination result with the determination criterion, record the current value of the register as the current field strength, and continue to communicate with the card; when the first judgment result obtained by the first judgment module 404 is negative, the value of the stored register is recorded as the current field intensity, and communication with the card is continued;
the adjusting module 408 is specifically configured to, when the first determination result obtained by the first determining module 404 is yes, store the first determination result as a determination reference by the storage module 407, store the current value of the register, and set the value of the register in an incremental manner to adjust the current field strength; when the first judgment result obtained by the first judgment module 404 is negative, the storage module 407 stores the first judgment result as a judgment reference, and then sets the value of the register in a decreasing manner to adjust the current field strength.
Optionally, the card reader further includes:
the setting module is used for setting the current field intensity to be maximum after the card is activated by the activation module 401;
an error reporting module, configured to report an error when the second determining module 405 determines that the storage module 407 does not store the determination criterion, and the first determining module 404 obtains a first determination result that is no, and then end;
the adjusting module 408 is specifically configured to, when the second determining module 405 determines that the storage module 407 stores the determination criterion, and the comparing module 406 compares that the first determination result matches the determination criterion, store the current value of the register when the first determination result obtained by the first determining module 404 is yes, and set the value of the register in an incremental manner to adjust the current field strength;
when the second judging module 405 judges that the judging reference is not stored, the first judging module 404 saves the current value of the register when the first judging result obtained by judging is yes, and sets the value of the register in an increasing mode to adjust the current field strength;
the record communication module 409 is specifically configured to, when the second determination module 405 determines that the storage module 407 stores the determination criterion, and the comparison module 406 compares that the first determination result does not match the determination criterion, record the stored value of the register as the current field strength, and continue to communicate with the card.
Optionally, the card reader further includes:
the setting module is used for setting the current field intensity to be minimum after the card is activated by the activation module 401;
an error reporting module, configured to report an error and end when the second determining module 405 determines that the storage module 407 does not store the determination criterion and the first determining module 404 obtains the first determining result of yes;
the adjusting module 408 is specifically configured to set a value of the register in a decreasing manner to adjust the current field strength when the second determining module 405 determines that the storage module 407 stores the determination criterion, and the comparing module 406 compares the first determination result and the determination criterion to match;
when the second judging module 405 judges that the storage module 407 does not store the judgment reference and the first judging module 404 obtains a first judgment result of no, the card reader sets the value of the register in a decreasing manner to adjust the current field strength;
the record communication module 409 is specifically configured to record the current value of the register as the current field strength when the second determination module 405 determines that the storage module 407 stores the determination criterion, and the comparison module 406 compares that the first determination result does not match the determination criterion, and continues to communicate with the card.
Optionally, the activation module 401 specifically includes:
the starting initialization unit is used for starting and initializing a radio frequency chip of the card reader;
a turn-on unit for turning on the non-contact field strength;
the sending module 402 is further configured to send a card searching instruction;
the receiving module 403 is further configured to receive activation response data of the card.
Optionally, the card reader further includes:
a third determining module, configured to, when the first determining result obtained by the first determining module 404 is negative, adjust the current field strength according to the value of the preset rule adjustment register by the adjusting module 408, and after the sending module 402 sends the power request instruction to the card, determine whether the receiving module 403 receives the power indication returned by the card within a preset time; when the receiving module 403 does not receive the power indication returned by the card within the preset time, determining whether the number of times of sending the power request exceeds the preset number of times;
the first determining module 404 is further configured to, when the third determining module determines that the receiving module 403 receives the power indication returned by the card within the preset time, determine whether the integrity function power is sufficient according to the function indication, and obtain a first determining result;
the sending module 402 is further configured to send a power request instruction to the card when the third determining module determines that the number of times of sending the power request does not exceed the predetermined number of times; and when the third judging module judges that the frequency of sending the power request exceeds the preset frequency, sending a card searching instruction to the card.
Optionally, the card reader further includes:
a fourth determining module, configured to, when the first determining result obtained by the first determining module 404 is yes, adjust the current field strength according to the value of the preset rule adjustment register by the adjusting module 408, and after the sending module 402 sends the power request instruction to the card, determine whether the receiving module 403 receives a power indication returned by the card within a preset time; when the receiving module 403 does not receive the power indication returned by the card within the preset time, determining whether the number of times of sending the power request exceeds the preset number of times;
the first determining module 404 is further configured to, when the fourth determining module receives a power indication returned by the card within a preset time, determine whether the integrity function power is sufficient according to the power indication received by the receiving module 403, so as to obtain a first determination result;
the adjusting module is further configured to adjust the field strength to a value of the stored register when the fourth determining module determines that the number of times the sending module 402 sends the power request exceeds the preset number of times;
the sending module 402 is further configured to send a power request instruction when the fourth determining module determines that the number of times that the sending module 402 sends the power request does not exceed the preset number of times; when the adjusting module 408 adjusts the field strength to the field strength corresponding to the value of the stored register, a power request instruction is sent;
the fifth judging module is configured to, when the sending module 402 adjusts the field strength to the value of the stored register in the adjusting module 408, judge whether the receiving module 403 receives a power indication returned by the card within a preset time after the sending module 402 sends a power request instruction;
the recording communication module 409 is further configured to record the current value of the register as the current field strength and continue to communicate with the card after the fifth determining module determines that the receiving module 403 receives the power indication returned by the card within the preset time;
the sending module 402 is further configured to send a card searching instruction to the card when the fifth determining module determines that the receiving module does not receive the power indication returned by the card within the preset time.
The above description is only a preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (12)

1. A method of optimizing power consumption of a card reader, the method comprising:
step 1, activating a card by a card reader;
step 2, the card reader sends a power request instruction to the card and receives a power instruction returned by the card;
step 3, the card reader judges whether the integrity function power is sufficient according to the power indication to obtain a first judgment result;
step 4, the card reader judges whether a judgment reference is stored, if so, step 5 is executed, and if not, step 6 is executed;
step 5, the card reader compares whether the first judgment result is matched with the judgment reference, if so, the step 6 is executed, and if not, the current field intensity is recorded according to the value of the register, and the card reader continues to communicate with the card;
step 6, the card reader stores the first judgment result as the judgment reference, adjusts the current field intensity according to the value of a preset rule adjustment register, and returns to execute the step 2;
when the first determination result obtained in the step 3 is yes, the recording of the current field strength according to the value of the register in the step 5 is specifically to record the current value of the register as the current field strength, and the adjusting of the current field strength according to the value of the register in the step 6 is specifically to: the card reader stores the current value of the register, and the value of the register is set in an increasing mode to adjust the current field intensity, so that the current field intensity of the card reader is decreased progressively;
when the first determination result obtained in the step 3 is negative, the recording of the current field strength according to the value of the register in the step 5 is specifically to record the stored value of the register as the current field strength, and the adjusting of the current field strength according to the value of the register according to the preset rule in the step 6 is specifically to: and the card reader adjusts the current field intensity according to the value of the register in a decreasing mode, so that the current field intensity of the card reader is increased progressively.
2. The method of claim 1, wherein step 1 is further followed by the reader setting the current field strength to a maximum;
the steps 4-6 are replaced by:
step 41, the card reader judges whether a judgment reference is stored, if so, step 51 is executed;
otherwise, when the first judgment result is yes, executing step 61;
when the first judgment result is negative, the card reader reports an error, and the operation is finished;
step 51, the card reader compares whether the first judgment result is matched with the judgment reference, if so, step 61 is executed, and if not, step 71 is executed;
step 61, the card reader stores the current value of the register, sets the value of the register according to an increasing mode to adjust the current field intensity, and returns to the step 2;
and step 71, the card reader records the stored value of the register as the current field intensity and continues to communicate with the card.
3. The method of claim 1, wherein step 1 is further followed by the reader setting a current field strength to a minimum;
the steps 4-6 are replaced by:
step 42, the card reader judges whether a judgment reference is stored, if so, step 52 is executed;
otherwise, when the first judgment result is yes, the card reader reports an error, and the operation is finished;
when the first judgment result is negative, executing step 62;
step 52, the card reader compares whether the first judgment result and the judgment reference are matched, if so, step 62 is executed, and if not, step 72 is executed;
step 62, the card reader sets the value of the register according to a decreasing mode to adjust the current field intensity, and returns to the step 2;
and 72, recording the current value of the register as the current field intensity by the card reader, and continuing to communicate with the card.
4. The method of claim 1, wherein in step 1, the activating the card by the card reader specifically comprises:
step 1-1, the card reader is started and a radio frequency chip of the card reader is initialized;
step 1-2, the card reader starts the non-contact field intensity,
step 1-3, the card reader sends a card searching instruction;
and 1-4, the card reader receives the activation response data of the card.
5. The method according to claim 4, wherein when the first determination result obtained in the step 3 is negative, after the step 6 is executed, the step 2 is executed instead of:
step 2-1, the card reader sends a power request instruction to the card and judges whether a power instruction returned by the card is received within a preset time, if so, step 3 is executed, and if not, step 2-2 is executed;
step 2-2, the card reader judges whether the number of times of sending the power request exceeds a preset number of times, if so, the step 1-3 is executed; if not, step 2-1 is performed.
6. The method according to claim 4, wherein when the first determination result obtained in the step 3 is yes, after the step 6 is executed, the step 2 is executed instead of:
step 6-1, the card reader sends a power request instruction to the card and judges whether a power instruction returned by the card is received within a preset time, if so, step 3 is executed, and if not, step 6-2 is executed;
step 6-2, the card reader judges whether the number of times of sending the power request exceeds the preset number of times, if so, the step 6-3 is executed; if not, executing step 6-1;
6-3, the card reader adjusts the field intensity to the value of the stored register, and executes the step 6-4 after sending a power request instruction to the card;
6-4, judging whether a power indication returned by the card is received by the card reader within a preset time, if so, recording the current value of the register as the current field intensity by the card reader, and continuing to communicate with the card; if not, returning to the step 1-3.
7. A card reader, characterized in that the card reader comprises:
the activation module is used for activating the card;
the sending module is used for sending a power request instruction to the card after the activation module activates the card; the power control module is also used for sending a power request instruction to the card after the adjusting module adjusts the current field intensity according to the value of the preset rule adjusting register;
the receiving module is used for receiving the power indication returned by the card;
the first judgment module is used for judging whether the integrity function power is sufficient according to the power indication received by the receiving module to obtain a first judgment result;
the second judgment module is used for judging whether the storage module stores a judgment reference or not;
the comparison module is used for comparing whether the first judgment result is matched with the judgment reference or not when the second judgment module judges that the storage module stores the judgment reference;
the storage module is configured to store the first determination result as the determination criterion when the second determination module determines that the determination criterion is not stored in the storage module; when the second judging module judges that the storage module stores the judging reference and the comparison module compares the first judging result with the judging reference, the first judging result is stored as the judging reference;
the adjusting module is used for adjusting the current field intensity according to the value of a register according to a preset rule after the storage module stores the first judgment result as the judgment reference;
the recording communication module is used for recording the current field intensity according to the value of the register and continuing to communicate with the card when the comparison module compares that the first judgment result is not matched with the judgment reference;
the recording communication module is specifically configured to, when the first determination result obtained by the first determination module is yes and the comparison module compares that the first determination result is not matched with the determination criterion, record a current value of a register as a current field strength and continue to communicate with the card; when the first judgment result obtained by the first judgment module is negative, recording the value of the stored register as the current field intensity, and continuing to communicate with the card;
the adjusting module is specifically configured to, when the first determination result obtained by the first determining module is yes, store the first determination result as the determination reference by the storage module, store the current value of the register, set a value of the register in an incremental manner, and adjust the current field strength to decrease the current field strength of the card reader; and when the first judgment result obtained by the first judgment module is negative, the storage module stores the first judgment result as the judgment reference, and then sets the value of the register according to a decreasing mode to adjust the current field intensity so as to increase the current field intensity of the card reader.
8. The card reader of claim 7, wherein the card reader further comprises:
the setting module is used for setting the current field intensity to be maximum after the activation module activates the card;
an error reporting module, configured to report an error when the second determining module determines that the storage module does not store the determination criterion, and the first determining module obtains the first determination result that is no, and then end;
the adjusting module is specifically configured to, when the second determining module determines that the storage module stores the determination criterion, and the comparing module compares that the first determination result matches the determination criterion, store the current value of the register when the first determination result obtained by the first determining module is yes, and set the value of the register in an incremental manner to adjust the current field strength;
when the second judging module judges that the judging reference is not stored, the first judging module stores the current value of the register when the first judging result obtained by judging is yes, and sets the value of the register in an increasing mode to adjust the current field intensity;
the recording communication module is specifically configured to, when the second determination module determines that the storage module stores the determination criterion, and the comparison module compares that the first determination result does not match the determination criterion, record the stored value of the register as the current field strength, and continue to communicate with the card.
9. The card reader of claim 7, wherein the card reader further comprises:
the setting module is used for setting the current field intensity to be minimum after the activation module activates the card;
an error reporting module, configured to report an error and end when the second determining module determines that the storage module does not store the determination criterion and the first determining module obtains the first determining result of yes;
the adjusting module is specifically configured to set the value of the register in a decreasing manner to adjust the current field strength when the second determining module determines that the storage module stores the determination criterion, and the comparing module compares the first determination result and the determination criterion to match;
when the second judging module judges that the storage module does not store the judging reference and the first judging module obtains the first judging result of no, the card reader sets the value of the register in a decreasing mode to adjust the current field intensity;
the recording communication module is specifically configured to record the current value of the register as the current field strength when the second determination module determines that the storage module stores the determination criterion, and the comparison module compares that the first determination result does not match the determination criterion, and continues to communicate with the card.
10. The card reader according to claim 7, wherein the activation module specifically comprises:
the starting initialization unit is used for starting and initializing the radio frequency chip of the card reader;
a turn-on unit for turning on the non-contact field strength;
the sending module is also used for sending a card searching instruction;
the receiving module is also used for receiving the activation response data of the card.
11. The card reader of claim 10, wherein the card reader further comprises:
a third judging module, configured to, when the first judging result obtained by the first judging module is negative, adjust the current field strength according to a value of a preset rule adjustment register by the adjusting module, and after the sending module sends a power request instruction to the card, judge whether the receiving module receives the power indication returned by the card within a preset time; when the receiving module does not receive the power indication returned by the card within a preset time, judging whether the frequency of sending the power request exceeds a preset frequency;
the first judging module is further configured to, when the third judging module judges that the receiving module receives the power indication returned by the card within the preset time, judge whether the integrity function power is sufficient according to the function indication, and obtain the first judging result;
the sending module is further configured to send the power request instruction to the card when the third determining module determines that the number of times of sending the power request does not exceed the preset number of times; and when the third judging module judges that the frequency of sending the power request exceeds the preset frequency, sending a card searching instruction to the card.
12. The card reader of claim 10, wherein the card reader further comprises:
a fourth judging module, configured to, when the first judging result obtained by the first judging module is yes, adjust the current field strength according to a value of a preset rule adjustment register by the adjusting module, and after the sending module sends a power request instruction to the card, judge whether the receiving module receives the power indication returned by the card within a preset time; when the power indication returned by the card is not received within the preset time of the receiving module, judging whether the frequency of sending the power request exceeds the preset frequency or not;
the first judging module is further configured to, when the fourth judging module receives the power indication returned by the card within a preset time, judge whether the integrity function power is sufficient according to the power indication received by the receiving module, and obtain the first judging result;
the adjusting module is further configured to adjust the field strength to a value of the stored register when the fourth determining module determines that the number of times the sending module sends the power request exceeds a preset number of times;
the sending module is further configured to send the power request instruction when the fourth determining module determines that the number of times that the sending module sends the power request does not exceed a preset number of times; when the adjusting module adjusts the field intensity to the field intensity corresponding to the value of the saved register, the power request instruction is sent;
the fifth judging module is used for judging whether the receiving module receives a power instruction returned by the card within a preset time after the transmitting module adjusts the field intensity to the value of the stored register in the adjusting module and the transmitting module transmits the power request instruction;
the recording communication module is further configured to record a current value of the register as a current field strength after the fifth judgment module judges that the receiving module receives the power indication returned by the card within a preset time, and continue to communicate with the card;
the sending module is further configured to send a card searching instruction to the card when the fifth determining module determines that the receiving module does not receive the power indication returned by the card within a preset time.
CN201810417637.9A 2018-05-04 2018-05-04 Method for optimizing power consumption of card reader and card reader Active CN108664822B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810417637.9A CN108664822B (en) 2018-05-04 2018-05-04 Method for optimizing power consumption of card reader and card reader

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810417637.9A CN108664822B (en) 2018-05-04 2018-05-04 Method for optimizing power consumption of card reader and card reader

Publications (2)

Publication Number Publication Date
CN108664822A CN108664822A (en) 2018-10-16
CN108664822B true CN108664822B (en) 2021-07-02

Family

ID=63780539

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810417637.9A Active CN108664822B (en) 2018-05-04 2018-05-04 Method for optimizing power consumption of card reader and card reader

Country Status (1)

Country Link
CN (1) CN108664822B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113392661A (en) * 2021-07-01 2021-09-14 Oppo广东移动通信有限公司 Card copying method and device, electronic equipment and readable storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102103680A (en) * 2010-08-17 2011-06-22 中兴通讯股份有限公司 Method for positioning and identifying electronic tag, reader and positioning system
CN103988238A (en) * 2011-10-11 2014-08-13 传感技术股份有限公司 Electrodynamic field strength triggering system
CN203799395U (en) * 2014-03-06 2014-08-27 太仓欧卡网络服务有限公司 Ultrahigh frequency RFID reader-writer
CN106231545A (en) * 2016-09-21 2016-12-14 广东欧珀移动通信有限公司 Reduce the method and device of near-field communication module power consumption
CN106682554A (en) * 2016-11-29 2017-05-17 大唐微电子技术有限公司 Non-contact IC card reader and implementation method thereof
CN107015623A (en) * 2015-12-07 2017-08-04 联发科技股份有限公司 System power dissipation ameliorative way and its system for implementing improvement power consumption
CN107748909A (en) * 2017-11-07 2018-03-02 北京中电华大电子设计有限责任公司 The adaptive method of power consumption and circuit in a kind of contact type intelligent card chip
CN107908991A (en) * 2017-10-27 2018-04-13 中国农业大学 A kind of read method and device of ultrahigh frequency RFID electronic tag

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9054749B2 (en) * 2011-06-29 2015-06-09 Broadcom Corporation Optimizing power consumption in a near field communications (NFC) environment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102103680A (en) * 2010-08-17 2011-06-22 中兴通讯股份有限公司 Method for positioning and identifying electronic tag, reader and positioning system
CN103988238A (en) * 2011-10-11 2014-08-13 传感技术股份有限公司 Electrodynamic field strength triggering system
CN203799395U (en) * 2014-03-06 2014-08-27 太仓欧卡网络服务有限公司 Ultrahigh frequency RFID reader-writer
CN107015623A (en) * 2015-12-07 2017-08-04 联发科技股份有限公司 System power dissipation ameliorative way and its system for implementing improvement power consumption
CN106231545A (en) * 2016-09-21 2016-12-14 广东欧珀移动通信有限公司 Reduce the method and device of near-field communication module power consumption
CN106682554A (en) * 2016-11-29 2017-05-17 大唐微电子技术有限公司 Non-contact IC card reader and implementation method thereof
CN107908991A (en) * 2017-10-27 2018-04-13 中国农业大学 A kind of read method and device of ultrahigh frequency RFID electronic tag
CN107748909A (en) * 2017-11-07 2018-03-02 北京中电华大电子设计有限责任公司 The adaptive method of power consumption and circuit in a kind of contact type intelligent card chip

Also Published As

Publication number Publication date
CN108664822A (en) 2018-10-16

Similar Documents

Publication Publication Date Title
US11357072B2 (en) Method and apparatus for selecting reception antenna set of user terminal
CN101263732B (en) Method, module, terminal and system for scheduling operation of RFID subsystem and wireless communication subsystem
EP2369524B1 (en) Radio frequency sim card and magnetic induction control method for radio frequency communication
JP5758120B2 (en) Method for processing application commands from physical channels using portable electronic devices and corresponding devices and systems
CN101902267A (en) Communication device, communication method, program and communication system
CN101330334B (en) Apparatus and method for calibrating communication distance of radio frequency SIM card
EP2101287A1 (en) Active RFID tag
CA2593657A1 (en) Method and mobile terminal device including smartcard module and near field communications means
US8583035B2 (en) Multiple input multiple output user equipment radio frequency assistant system
WO2009058496A1 (en) Detection apparatus and method for near field communication
CN101226651A (en) Mobile terminal with check on work attendance function, check on work attendance system as well as method thereof
WO2022252561A1 (en) Card swiping method, card controller, electronic device and storage medium
CN101593383B (en) Electronic purse control method, system and SIM card
CN108664822B (en) Method for optimizing power consumption of card reader and card reader
JP4973414B2 (en) Mobile communication terminal and its program, and IC card and its program
US9824246B2 (en) Radio frequency identification tag having input device
EP3931974B1 (en) Techniques to reduce power consumption in near field communication systems
EP2717193B1 (en) IC card, portable electronic device, and reader/ writer
KR101216567B1 (en) Wireless communication device, operating method thereof and wireless communication system
US20140084062A1 (en) Ic card, portable electronic device, and reader/writer
CN107393106B (en) Access control data writing method, NFC source device, access control method and system
CN105677354B (en) Mobile terminal matching device, mobile terminal and mobile terminal control method
JPWO2011002030A1 (en) Portable electronic device and method for controlling portable electronic device
US9070065B2 (en) IC card, portable electronic apparatus, and controlling method of IC card
JP6863032B2 (en) Electronic information storage medium, IC card, activation control method, and program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant