CN106446739A - Method and apparatus for self-adaptive gain adjustment - Google Patents

Method and apparatus for self-adaptive gain adjustment Download PDF

Info

Publication number
CN106446739A
CN106446739A CN201610842682.XA CN201610842682A CN106446739A CN 106446739 A CN106446739 A CN 106446739A CN 201610842682 A CN201610842682 A CN 201610842682A CN 106446739 A CN106446739 A CN 106446739A
Authority
CN
China
Prior art keywords
field intensity
gain
card
module
intensity 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.)
Granted
Application number
CN201610842682.XA
Other languages
Chinese (zh)
Other versions
CN106446739B (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 CN201610842682.XA priority Critical patent/CN106446739B/en
Publication of CN106446739A publication Critical patent/CN106446739A/en
Application granted granted Critical
Publication of CN106446739B publication Critical patent/CN106446739B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/10009Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation sensing by radiation using wavelengths larger than 0.1 mm, e.g. radio-waves or microwaves
    • G06K7/10198Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation sensing by radiation using wavelengths larger than 0.1 mm, e.g. radio-waves or microwaves setting parameters for the interrogator, e.g. programming parameters and operating modes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/10009Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation sensing by radiation using wavelengths larger than 0.1 mm, e.g. radio-waves or microwaves
    • G06K7/10297Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation sensing by radiation using wavelengths larger than 0.1 mm, e.g. radio-waves or microwaves arrangements for handling protocols designed for non-contact record carriers such as RFIDs NFCs, e.g. ISO/IEC 14443 and 18092
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/10544Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum
    • G06K7/10792Special measures in relation to the object to be scanned
    • G06K7/10801Multidistance reading

Landscapes

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

Abstract

The invention discloses a method and apparatus for self-adaptive gain adjustment which belong to the intelligent card field. The method comprises the following steps. When a terminal detects the entrance of a card into a non-field, the terminal repeatedly detects the external field strength and records it; according to the recorded external field strength value, the change of the external field strength is determined whether to be within a preset range; if the answer is yes, card inquiry instructions are sent to the non-field at a preset gain in succession so as to obtain card inquiry results; the card inquiry result corresponding to the preset gain is recorded; and according to the recorded card inquiring result corresponding to the preset gain, the final gain is determined so as to realize the data communication of the final gain with the card. If the answer is no, the terminal continues to detect whether the card has entered the non-field or not. According to the technical schemes of the invention, after a non-contact card enters a non-field, for the non-contact card in motion state, when its position change leads to the change of an external field within a preset range, the terminal can constantly adjust its gains to adapt to the external field strength so as to ensure the smooth communications and shorten the communication time.

Description

A kind of method and device of adaptive gain regulating
Technical field
The present invention relates to field of intelligent cards, more particularly to a kind of method and device of adaptive gain regulating.
Background technology
In prior art, non-contact card enter non-connect field after, (such as non-contact card when being kept in motion middle often To terminal close during) have begun to be communicated with terminal;Although terminal has adaptive ability, can be according to outside The change of field intensity is adjusting the size of own gain, but once have selected gain when terminal askes card, then subsequent non-contact card The change of position can cause selected gain to be not applied for outside field intensity, therefore there is a problem of needing to ask again card, extend Communication time of the terminal with card.
Content of the invention
The invention aims to overcoming the deficiencies in the prior art, a kind of method of adaptive gain regulating and dress is provided Put.
On the one hand, the invention provides a kind of method of adaptive gain regulating, including:
Step S1:Terminal detection card whether enter non-connect field, be then execution step S2, otherwise continue executing with step S1;
Step S2:The outside field intensity of the terminal repeated detection is simultaneously recorded, and the field intensity value according to record judges the external field Whether strong change, in preset range, is then execution step S3, otherwise return to step S1;
Step S3:The terminal successively with preset gain to described non-connect in field send ask card instruction obtain ask card result, Record preset gain and corresponding inquiry card result, and the preset gain according to record and corresponding inquiry card result determine final increasing Benefit;
Step S4:The terminal carries out data communication with the final gain with card.
On the other hand, the invention provides a kind of device of adaptive gain regulating, including:
First detection module, non-connects field for detecting whether card enters;It is additionally operable to be introduced into non-connecing when detecting card When, continue detection card and whether enter non-to connect field;
First detection logging modle, for when the first detection module detects card and enters non-connect, repeatedly examining Survey outside field intensity and record;
First judge module, for judging the outside field intensity according to the field intensity value of the described first detection logging modle record Change whether in preset range;
Adjusting module, for judging the change of the outside field intensity in preset range when first judge module When, gain is sequentially adjusted in for preset gain;
Sending module, for successively with the adjusting module adjustment preset gain to described non-connect in field send ask card refer to So that to inquiry card result;
Logging modle, for recording the inquiry card result that preset gain and the corresponding sending module are obtained;
Computing module, the preset gain and corresponding inquiry card result for being recorded according to the logging modle determines final increasing Benefit;
Communication module, the final gain and card for being determined with the computing module carries out data communication.
The present invention compared with prior art, with advantages below:
Non-contact card enter non-connect field after, for the non-contact card in kinestate, when the change of its position causes When the change of outside field intensity is in preset range, terminal can constantly be adjusted own gain and is adapted with outside field intensity, protect Being smoothed out for card communication, shortens communication time.
Description of the drawings
For the clearer explanation embodiment of the present invention or technical scheme of the prior art, the present invention will be implemented below Example or accompanying drawing to be used needed for description of the prior art do simple introduction, it should be apparent that, drawings in the following description are only It is only some embodiments of the present invention, on the premise of not paying creative work for those of ordinary skill in the art, Other accompanying drawings can also be obtained according to these accompanying drawings.
Fig. 1 is a kind of method flow diagram of adaptive gain regulating of the offer of the embodiment of the present invention one;
Fig. 2 is a kind of method flow diagram of adaptive gain regulating of the offer of the embodiment of the present invention two;
Fig. 3 is a kind of method flow diagram of adaptive gain regulating of the offer of the embodiment of the present invention three;
Fig. 4 is a kind of device block diagram of adaptive gain regulating of the offer of the embodiment of the present invention four.
Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Whole description, it is clear that described embodiment is only a part of embodiment of the present invention, rather than whole embodiments.It is based on Embodiment in the present invention, the every other reality obtained on the premise of creative work is not made by those skilled in the art Example is applied, belongs to the scope of protection of the invention.
Embodiment one
The embodiment of the present invention one provides a kind of method of adaptive gain regulating, as shown in figure 1, including:
Step 101:Terminal detection card whether enter non-connect field, be then execution step 102, otherwise continue executing with step 101;
Specifically, whether the outside field intensity of terminal detection, and the field intensity value for judging to detect is more than predetermined threshold value, is then true Recognize without card enter non-connect field, otherwise confirm that having card to enter non-connects field;
In the present embodiment, when predetermined threshold value is specially card and enters non-connect, the marginal value of outside field intensity, preferably Ground, predetermined threshold value is 7.0v, and is stored in the depositor of terminal.
Step 102:The outside field intensity of terminal repeated detection is simultaneously recorded, and the field intensity value according to record judges the change of outside field intensity Whether in preset range, it is then execution step 103, otherwise return to step 101;
In the present embodiment, step 102 is specifically included:
Step A1:Terminal detects outside field intensity every prefixed time interval, and the field intensity value for detecting recorded first One group of field intensity value is obtained in array;
Preferably, in the present embodiment, prefixed time interval is 80ms.
Step A2:Terminal judges the change of outside field intensity whether in preset range according to the field intensity value in the first array, It is then execution step 103, otherwise return to step 101;
In the present embodiment, step 102 can also be specifically included:
Step B1:The outside field intensity of terminal detection, the field intensity value for detecting is recorded in the first array, and judges the first number In group, whether the quantity of field intensity value reaches predetermined number, is then execution step B2, otherwise continues executing with step B1;
Preferably, in the present embodiment, predetermined number is 5.
Step B2:Terminal judges the change of outside field intensity whether in preset range according to the field intensity value in the first array, It is then execution step 103, otherwise execution step B3;
Step B3:The outside field intensity of terminal detection, and the first array, return to step B2 are updated according to the field intensity value for detecting.
In the present embodiment, the first array is updated according to the field intensity value for detecting, specially:Terminal by the first array when Front first record is updated to current second record, current second record is updated to current 3rd record, successively more The newly record after current second record, and the field intensity value that last record current is updated to detect;
Further, in the present embodiment, in step 102, the field intensity value according to record judges that the change of outside field intensity is No in preset range, specifically include:
Step C1:Whether the field intensity value of terminal judges record is dull, is then execution step C2, otherwise return to step 101;
Specifically, whether the field intensity value of terminal judges record all according to same Long-term change trend is, confirms the field for recording Intensity values dullness, otherwise confirms that the field intensity value for recording is not dull.
Step C2:Terminal calculates the difference of the last time field intensity value for detecting and the field intensity value for detecting at first, and judges Whether the absolute value of the difference of the field intensity value of calculating is more than preset value, be the change for then confirming outside field intensity not in preset range, Otherwise confirm the change of outside field intensity in preset range.
In the present embodiment, in step 102, whether the field intensity value according to record judges the change of outside field intensity in default model In enclosing, can also be specially:
Terminal calculates the weighted mean of the field intensity value of record, and whether the weighted mean for judging to calculate is more than pre- gating Limit value, is that the change for then confirming outside field intensity confirms the change of outside field intensity not in preset range, otherwise in preset range.
Wherein, terminal calculates the weighted mean of the field intensity value of record, specially:In the field intensity value that terminal will be recorded, mutually Different field intensity value seeks product with from a frequency for occurring respectively, and the product addition that tries to achieve is obtained the first operation result, will The frequency is added and obtains the second operation result, the field intensity value that the first operation result is obtained recording divided by the second operation result Weighted mean.
In the present embodiment, in step 102, whether the field intensity value according to record judges the change of outside field intensity in default model In enclosing, can also be specially:
In the field intensity value of terminal judges record, maximum field intensity values and field minimum intensity values whether no more than predetermined threshold value, It is that the change for then confirming outside field intensity confirms the change of outside field intensity in preset range, otherwise not in preset range.
Further, in the present embodiment, before step 102, also include:Terminal adjust gain is least gain to non- Connect in field to send and card instruction is ask, judge whether to receive the reply data of card return, be then execution step 103, otherwise execute Step 102;
In the present embodiment, least gain presets and is stored in the depositor of terminal, it is preferable that least gain For -13.5dB;
Further, in the present embodiment, according to the difference of card, the inquiry card instruction that terminal sends is different, it is preferable that In the present embodiment, card is Felica card, and correspondingly, terminal is " 00 FF FF 01 to the non-inquiry card instruction for connecing transmission in field 00 ", as reply data " 01 01 14 B5 1A, 28 13 5B 36 03 32 42 82 82 47 for receiving card return During 04 D1 of AA FF ", confirm to ask and block successfully, otherwise, confirm to ask card crash.
Step 103:Terminal successively with preset gain to non-connect in field to send ask card instruction and obtain asking card result, record is default Gain and corresponding inquiry card result, and the preset gain according to record and corresponding inquiry card result determine final gain;
In the present embodiment, step 103 is specifically included:
Step E1:Terminal adjust gain is least gain, and as current gain, execution step E2;
Step E2:Terminal with current gain to non-connect in field to send ask card instruction and obtain asking card result, and by current gain Recorded in the second array with card result is ask;
Step E3:Whether terminal judges current gain is more than maximum gain, is then execution step E4, otherwise by current gain As current gain, return to step E2 after increase present count magnitude;
Step E4:Terminal according to the current gain in the second array and askes card result calculating final gain.
In the present embodiment, step 103 can also be specifically included:
Step H1:Terminal adjust gain is maximum gain, and as current gain, execution step H2;
Step H2:Terminal with current gain to non-connect in field to send ask card instruction and obtain asking card result, by current gain and Ask card result to recorded in the second array;
Step H3:Whether terminal judges current gain is less than least gain, is then execution step H4, otherwise by current gain As current gain, return to step H2 after reduction present count magnitude;
Step H4:Terminal according to the current gain in second array and askes card result calculating final gain.
In the present embodiment, above-mentioned least gain and maximum gain preset and are stored in the depositor of terminal, excellent Selection of land, it is -4.5dB that least gain is -13.5dB, maximum gain, and present count magnitude is 3dB.
Further, in the present embodiment, in step 103, true according to the preset gain for recording and corresponding inquiry card result Determine final gain, specially:
Terminal read ask card result be ask card success corresponding to preset gain, calculate read preset gain average Value, according to the difference of card, using the absolute value of the meansigma methodss for obtaining as final gain, or the meansigma methodss for obtaining is increased pre- If the absolute value after the order of magnitude is used as final gain, or the meansigma methodss for obtaining are reduced the absolute value after present count magnitude As final gain.
Step 104:Terminal carries out data communication with final gain with card.
In the present embodiment, before step 104, also include:
Terminal sends inquiry card instruction with final gain to non-connecing in field, judges whether to receive the response of card return, is Then execution step 104, otherwise return to step 101;
Further, in the present embodiment, before step 101, also include:Terminal is opened and non-connects field;
Correspondingly, in step 101 neutralization procedure 102, also include:When whether terminal judges waiting time is preset more than first Long, be, close non-connect field, terminate;
Wherein, the first preset duration specially self terminal opens the non-field that connects carries out the wait of data communication to terminal and card Duration.
Or,
In step 101, also include:Whether terminal judges waiting time, more than the second preset duration, be, close non-connect field, Terminate;
In step 102, also include:Whether terminal judges waiting time, more than the 3rd preset duration, be, close non-connect field, Terminate.
Wherein, the second preset duration is opened the non-field that connects for self terminal and enters the non-waiting time for connecing field to card;3rd is pre- If when a length of Autonomous test enter the non-field that connects to judging waiting time of the change of outside field intensity in preset range to card.
Further, in the present embodiment, step 101 and step 102 can also be:
Step W1:The outside field intensity of terminal detection is simultaneously recorded, and the field intensity value according to record determines whether that card enters non-connecing , it is then execution step W2, otherwise continues executing with step W1;
Specifically, terminal judges are judged in the field intensity value of record, if be no more than the field intensity value of predetermined threshold value, be Then confirm to have card enter non-connect field, otherwise confirm that not having card to enter non-connects field.
Step W2:According to the field intensity value of record, terminal judges that the change of outside field intensity, whether in preset range, is to hold Row step 102, otherwise return to step W1.
Embodiment two
The embodiment of the present invention two provides a kind of method of adaptive gain regulating, as shown in Fig. 2 including:
Step 201:Terminal is initialized, and is opened and non-connect field;
Specifically, the amplitude of terminal initialization output field intensity is standard value, and is opened according to initialized standard value non- Connect field;
Need explanatorily, according to the difference of card, to export the standard value difference of field intensity;
Preferably, in the present embodiment, card is Felica card, and the amplitude of terminal initialization output field intensity is 8.2v;
Step 202:Terminal judges whether have card enter non-connect field, be then execution step 204, otherwise execution step 203;
Specifically, whether the outside field intensity of terminal detection, and the field intensity value for judging to detect is more than predetermined threshold value, is then true Recognize without card enter non-connect field, otherwise confirm that having card to enter non-connects field;
In the present embodiment, when predetermined threshold value is specially card and enters non-connect, the marginal value of outside field intensity, preferably Ground, predetermined threshold value is 7.0v, and is stored in the depositor of terminal.
Step 203:Whether terminal judges waiting time, more than the first preset duration, be, close non-connect field, terminate;Otherwise Return to step 202;
In the present embodiment, the first preset duration be specially self terminal open non-connect field to terminal and card carry out data lead to The waiting time of news;
When further, in the present embodiment, by step 202 execution step 203, step 203 can also be:
Whether terminal judges waiting time, more than the second preset duration, be, close non-connect field, terminate;Otherwise return to step 202;
In the present embodiment, the second preset duration is specially self terminal and opens the non-field that connects to the non-wait for connecing field of card entrance Duration;
Further, in the present embodiment, when by step 206 and step 208 execution step 203, step 203 may be used also Think:
Whether terminal judges waiting time, more than the 3rd preset duration, be, close non-connect field, terminate;Otherwise return to step 202;
In the present embodiment, the 3rd preset duration is specially self-inspection and measures the non-field that connects of card entrance to the outside field intensity of judgement Waiting time of the change in preset range.
Step 204:Terminal adjust gain is least gain and sends inquiry card instruction to non-connecing in field, judges whether to receive The reply data that card is returned, is then execution step 208, otherwise execution step 205;
In the present embodiment, least gain presets and is stored in the depositor of terminal, it is preferable that least gain For -13.5dB;
Further, in the present embodiment, according to the difference of card, the inquiry card instruction that terminal sends is different, it is preferable that In the present embodiment, card is Felica card, and correspondingly, terminal is " 00 FF FF 01 to the non-inquiry card instruction for connecing transmission in field 00 ", as reply data " 01 01 14 B5 1A, 28 13 5B 36 03 32 42 82 82 47 for receiving card return During 04 D1 of AA FF ", confirm to ask and block successfully, return successfully, execution step 208;
Need explanatorily, the gain of terminal is less, then terminal can normally receive card returned data distance less, I.e. card is nearer apart from terminal;When the gain of terminal is least gain, and when terminal can normally receive the data that card is returned, Then reader is close apart from terminal, if now ask blocked successfully, causes to ask card crash because card is moved without the need for consideration Situation.
Step 205:Terminal detects outside field intensity every prefixed time interval, and the field intensity value for detecting recorded first One group of field intensity value is obtained in array;
Preferably, in the present embodiment, prefixed time interval is that 80ms, the first array is:
Time Field intensity
80ms 6.0V
160ms 5.8V
240ms 5.8V
320ms 5.6V
400ms 5.5V
Need explanatorily, in the present embodiment, as card is close to terminal, card absorbs the non-energy for connecing in field and increasing Plus, the outside field intensity of terminal reduces therewith;Conversely, with card with terminal away from card absorbs the non-energy for connecing in field and subtracting Few, the outside field intensity of terminal increases therewith;
Alternatively, in the present embodiment, the order of step 205 and step 204 can be exchanged.
Step 206:Whether the field intensity value in the first array of terminal judges is dull, is then execution step 207, otherwise returns step Rapid 203;
Specifically, whether the data in the first array of terminal judges, all according to same Long-term change trend, are then to confirm first Field intensity value dullness in array, otherwise confirms that the field intensity value in the first array is not dull;
For example, the data in the first array change according to increasing trend, or keep constant after changing according to increasing trend, Then confirm the field intensity value dullness in the first array.
Step 207:Terminal judges the change of outside field intensity whether in preset range according to the field intensity value in the first array, It is then execution step 208, otherwise return to step 203;
Specifically, terminal calculates the difference of the last time field intensity value for detecting and the field intensity value for detecting at first, and judges Whether the absolute value of the difference of the field intensity value is more than preset value, be the change for then confirming outside field intensity not in preset range, no Then confirm the change of outside field intensity in preset range;Preferably, it is 0.6v in preset value;
For example, in the present embodiment, the last time field intensity value for detecting and the field intensity for detecting for the first time are calculated The absolute value of the difference of value is 0.5v, then confirm the change of outside field intensity in preset range.
Further, in the present embodiment, can also be by the direct execution step 207 of step 205, correspondingly, step 207 has Body is:
Terminal calculates the weighted mean of the field intensity value of record, and whether the weighted mean for judging to calculate is more than pre- gating Limit value, is that the change for then confirming outside field intensity confirms the change of outside field intensity not in preset range, otherwise in preset range;
Or,
In the field intensity value of terminal judges record, maximum field intensity values and field minimum intensity values whether no more than predetermined threshold value, It is that the change for then confirming outside field intensity confirms the change of outside field intensity in preset range, otherwise not in preset range.
Further, in the present embodiment, the weighted mean of the field intensity value of record is calculated, specially:(X1*f1+ X2*f2+ ...+Xn*fn)/(f1+f2+ ...+fn), wherein, it is field intensity value that X1, X2 ... Xn is field intensity value, corresponding f1, f2 ... fn The frequency of appearance.
For example, according to the data in above-mentioned first array, the weighted mean for calculating field intensity value is:(6.0*1+5.8*2+ 5.6*1+5.5*1)/(1+2+1+1)=5.74v, less than predetermined threshold value 7.0v, then confirms the change of outside field intensity in default model In enclosing.
Step 208:Terminal adjust gain is least gain, and as current gain, execution step 209;
Specifically, terminal initialization gain is -13.5dB, and as current gain, execution step 209.
Step 209:Terminal sends inquiry card instruction to non-connecing in field, and current gain recorded the second number with card result is ask In group;
Specifically, terminal sends inquiry card instruction to non-connecing in field, and judges whether to receive the inquiry card response of card return, It is then to confirm to ask to block successfully, records current gain and card successful result is ask, otherwise confirm card crash is ask, record current gain and inquiry Card crash result.
Step 210:Whether terminal judges current gain is more than maximum gain, is then execution step 211, otherwise currently will increase As current gain, return to step 209 after benefit increase present count magnitude;
In the present embodiment, maximum gain presets and is stored in the depositor of terminal, it is preferable that maximum gain for- 4.5dB, present count magnitude is that 3dB, the second array is:
Current gain Ask card result
-13.5dB Success
-10.5dB Success
-7.5dB Failure
-4.5dB Success
Step 211:Terminal determines final gain according to the current gain in the second array and inquiry card result;
Specifically, it is to ask the current gain corresponding to card success that terminal reads and askes card result, calculates the current increasing for reading The meansigma methodss of benefit, according to the difference of card, using the absolute value of calculated meansigma methodss as final gain, or will calculate Absolute value after the meansigma methodss for arriving increase present count magnitude is reduced in advance as final gain, or by calculated meansigma methodss If the absolute value after the order of magnitude is used as final gain;
Preferably, in the present embodiment, it is current corresponding to inquiry card success that terminal reads and askes card result in the second array Gain, calculates the meansigma methodss of the current gain for reading, using the absolute value of calculated meansigma methodss as final gain;
For example, in above-mentioned record data, being calculated final gain is:[(-13.5dB)+(-10.5dB)+(- 4.5dB)]/3=-9.5dB, using 9.5dB as final gain.
Step 212:Terminal adjustment current gain is final gain;
Step 213:Terminal sends inquiry card instruction to non-connecing in field, judges whether to receive the reply data of card return, It is that data communication, otherwise return to step 203 are carried out with final gain and card.
Further, in the present embodiment, step 202 to step 205 can also be:
Step M1:Terminal adjust gain is least gain and sends inquiry card instruction to non-connecing in field, judges whether to receive The response that card is returned, is then execution step 208, otherwise execution step M2;
Step M2:Terminal detects outside field intensity every prefixed time interval and records;
Step M3:Terminal according to the field intensity value of record determine whether card enter non-connect field, be then execution step 206, Otherwise execution step M4;
Specifically, in the field intensity value for recording described in terminal judges, if be no more than the field intensity value of predetermined threshold value, be Then confirm to have card enter non-connect field, otherwise confirm that not having card to enter non-connects field.
Step M4:Whether the duration to be transacted such as terminal judges more than the first preset duration be, close non-connect field, terminate, Otherwise return to step M1.
In the present embodiment, step 208 to step 210 can also be:
Step 208 ':Terminal initialization gain is maximum gain, and as current gain, execution step 209 ';
Step 209 ':Terminal to non-connect in field to send ask card instruction, and card result and current gain will be ask recorded second In array;
Step 210 ':Whether terminal judges current gain is less than least gain, is then execution step 211, otherwise will be current As current gain, return to step 209 ' after gain reduction present count magnitude.
Embodiment three
The embodiment of the present invention three provides a kind of method of adaptive gain regulating, as shown in figure 3, including:
Step 301:Terminal is initialized, and is opened and non-connect field;
Specifically, the amplitude of terminal initialization output field intensity is standard value, and is opened according to initialized standard value non- Connect field;
Need explanatorily, according to the difference of card, to export the standard value difference of field intensity;
Preferably, in the present embodiment, card is Felica card, and the amplitude of terminal initialization output field intensity is 8.2v.
Step 302:Terminal detected whether card enter non-connect field, be then execution step 304, otherwise execution step 303;
Specifically, whether the outside field intensity of terminal detection, and the field intensity value for judging to detect is more than predetermined threshold value, is then true Recognize without card enter non-connect field, otherwise confirm that having card to enter non-connects field;
In the present embodiment, when predetermined threshold value is specially card and enters non-connect, the marginal value of outside field intensity, preferably Ground, predetermined threshold value is 7.0v, and is stored in the depositor of terminal.
Step 303:Whether terminal judges waiting time, more than the first preset duration, be, close non-connect field, terminate;Otherwise Return to step 302;
In the present embodiment, the first preset duration be specially self terminal open non-connect field to terminal and card carry out data lead to The waiting time of news;
When further, in the present embodiment, by step 302 execution step 303, step 303 can also be:
Whether terminal judges waiting time, more than the second preset duration, be, close non-connect field, terminate;Otherwise return to step 302;
In the present embodiment, the second preset duration is specially self terminal and opens the non-field that connects to the non-wait for connecing field of card entrance Duration.
Step 304:Terminal adjust gain is least gain and sends inquiry card instruction to non-connecing in field, judges whether to receive The reply data that card is returned, is then execution step 311, otherwise execution step 305;
In the present embodiment, least gain presets and is stored in the depositor of terminal, it is preferable that least gain For -13.5dB;
Further, in the present embodiment, according to the difference of card, the inquiry card instruction that terminal sends is different, it is preferable that In the present embodiment, card is Felica card, and correspondingly, terminal is " 00 FF FF 01 to the non-inquiry card instruction for connecing transmission in field 00 ", as reply data " 01 01 14 B5 1A, 28 13 5B 36 03 32 42 82 82 47 for receiving card return During 04 D1 of AA FF ", confirm to ask and block successfully, otherwise, confirm to ask card crash;
Need explanatorily, the gain of terminal is less, then terminal can normally receive card returned data distance less, I.e. card is nearer apart from terminal;When the gain of terminal is least gain, and when terminal can normally receive the data that card is returned, Then reader is close apart from terminal, if now ask blocked successfully, causes to ask card crash because card is moved without the need for consideration Situation.
Step 305:The outside field intensity of terminal detection, and the field intensity value for detecting is recorded in the first array;
Step 306:In the first array of terminal judges, whether the quantity of field intensity value reaches predetermined number, is then execution step 307, after otherwise stopping prefixed time interval, return to step 305;
Preferably, in the present embodiment, predetermined number is 5, and prefixed time interval is 80ms;
Need explanatorily, in the present embodiment, when the quantity of the field intensity value for detecting is less than predetermined number, to be not enough to The mobile trend of bright card, therefore when the quantity of the field intensity value for measuring to be checked reaches predetermined number, execution step 307;
For example, in the present embodiment, the first array is:
Time Field intensity
80ms 6.0V
160ms 5.8V
240ms 5.8V
320ms 5.6V
400ms 5.5V
Step 307:Whether the field intensity value of terminal judges record is dull, is then execution step 310, otherwise execution step 308;
Specifically, whether the data in the first array of terminal judges, all according to same Long-term change trend, are then to confirm first Field intensity value dullness in array, otherwise confirms that the field intensity value in the first array is not dull;
For example, the data in the first array change according to increasing trend, or keep constant after changing according to increasing trend, Then confirm the field intensity value dullness in the first array.
Step 308:Whether terminal judges waiting time, more than the first preset duration, be, close non-connect field, terminate;Otherwise Stop prefixed time interval, execution step 309;
In the present embodiment, when by step 307 and step 311 execution step 308, step 308 can also be:
Whether terminal judges waiting time, more than the 3rd preset duration, be, close non-connect field, terminate;Otherwise stop default Time interval, execution step 309;
In the present embodiment, the 3rd preset duration is specially self-inspection and measures the non-field that connects of card entrance to the outside field intensity of judgement Waiting time of the change in preset range.
Step 309:The outside field intensity of terminal detection, and the first array, return to step are updated according to the field intensity value for detecting 307.
In the present embodiment, the first array is updated according to the field intensity value for detecting, specially:Terminal by the first array when Front first record is updated to current second record, current second record is updated to current 3rd record, successively more The newly record after current second record, and the field intensity value that last record current is updated to detect;
For example, the field intensity value for detecting is 5.4v, then the first array after updating is:
Time Field intensity
160ms 5.8V
240ms 5.8V
320ms 5.6V
400ms 5.5V
480ms 5.4V
Step 310:Terminal judges the change of outside field intensity whether in preset range according to the field intensity value in the first array, It is then execution step 311, otherwise return to step 308;
Specifically, terminal calculates the difference of the last time field intensity value for detecting and the field intensity value for detecting at first, and judges Whether the absolute value of the difference of the field intensity value is more than preset value, be the change for then confirming outside field intensity not in preset range, no Then confirm the change of outside field intensity in preset range;Preferably, it is 0.6v in preset value;
For example, in the present embodiment, the last time field intensity value for detecting and the field intensity for detecting for the first time are calculated The absolute value of the difference of value is 0.5v, then confirm the change of outside field intensity in preset range.
Further, in the present embodiment, when step 306 is judged as YES, acceptable directly execution step 310, correspondingly, Step 310 is specially:
Terminal calculates the weighted mean of the field intensity value of record, and whether the weighted mean for judging to calculate is more than pre- gating Limit value, is that the change for then confirming outside field intensity confirms the change of outside field intensity not in preset range, otherwise in preset range;
Or,
In the field intensity value of terminal judges record, maximum field intensity values and field minimum intensity values whether no more than predetermined threshold value, It is that the change for then confirming outside field intensity confirms the change of outside field intensity in preset range, otherwise not in preset range.
Further, in the present embodiment, the weighted mean of field intensity value is calculated, specially:(X1*f1+X2*f2+… + Xn*fn)/(f1+f2+ ...+fn), wherein, X1, X2 ... Xn is field intensity value, the frequency that corresponding f1, f2 ... fn occurs for field intensity value Secondary.
For example, according to the data in above-mentioned first array, the weighted mean for calculating field intensity value is:(6.0*1+5.8*2+ 5.6*1+5.5*1)/(1+2+1+1)=5.74v, less than predetermined threshold value 7.0v, then confirms the change of outside field intensity in default model In enclosing.
Step 311:Terminal adjust gain is least gain, and as current gain, execution step 312;
Specifically, terminal adjust gain is -13.5dB, and as current gain, execution step 312.
Step 312:Terminal sends inquiry card instruction to non-connecing in field, and current gain recorded the second number with card result is ask In group;
Specifically, terminal sends inquiry card instruction to non-connecing in field, and judges whether to receive the inquiry card response of card return, It is then to confirm to ask to block successfully, records current gain and card successful result is ask, otherwise confirm card crash is ask, record current gain and inquiry Card crash result.
Step 313:Whether terminal judges current gain is more than maximum gain, is then execution step 314, otherwise currently will increase As current gain, return to step 312 after benefit increase present count magnitude;
In the present embodiment, maximum gain presets and is stored in the depositor of terminal, it is preferable that maximum gain For -4.5dB, present count magnitude is that 3dB, the second array is:
Current gain Ask card result
-13.5dB Success
-10.5dB Success
-7.5dB Failure
-4.5dB Success
Step 314:Terminal determines final gain according to the current gain in the second array and inquiry card result;
Specifically, it is to ask the current gain corresponding to card success that terminal reads and askes card result, calculates the current increasing for reading The meansigma methodss of benefit, according to the difference of card, using the absolute value of calculated meansigma methodss as final gain, or will calculate Absolute value after the meansigma methodss for arriving increase present count magnitude is reduced in advance as final gain, or by calculated meansigma methodss If the absolute value after the order of magnitude is used as final gain;
Preferably, in the present embodiment, it is current corresponding to inquiry card success that terminal reads and askes card result in the second array Gain, calculates the meansigma methodss of the current gain for reading, using the absolute value of calculated meansigma methodss as final gain;
For example, in above-mentioned record data, being calculated final gain is:[(-13.5dB)+(-10.5dB)+(- 4.5dB)]/3=-9.5dB, using 9.5dB as final gain.
Step 315:Terminal adjustment current gain is final gain;
Step 316:Terminal sends inquiry card instruction to non-connecing in field, judges whether to receive the reply data of card return, It is that data communication, otherwise return to step 308 are carried out with final gain and card.
In the present embodiment, step 311 to step 313 can also be:
Step 311 ':Terminal initialization gain is maximum gain, and as current gain, execution step 312 ';
Step 312 ':Terminal to non-connect in field to send ask card instruction, and card result and current gain will be ask recorded second In array;
Step 313 ':Whether terminal judges current gain is less than least gain, is then execution step 314, otherwise will be current As current gain, return to step 312 ' after gain reduction present count magnitude.
Example IV
The embodiment of the present invention four provides a kind of device of adaptive gain regulating, as shown in figure 4, including:
First detection module 401, non-connects field for detecting whether card enters;Be additionally operable to when detect card be introduced into non- When connecing, continue detection card and whether enter non-to connect field;
First detection logging modle 402, for when first detection module 401 detects card and enters non-connect, repeatedly The outside field intensity of detection is simultaneously recorded;
First judge module 403, for judging outside field intensity according to the field intensity value of the first detection record of logging modle 402 Whether change is in preset range;
Adjusting module 404, during for judging that when the first judge module 403 change of outside field intensity is in preset range, Gain is sequentially adjusted in for preset gain;
Sending module 405, for sending inquiry card instruction with the preset gain that adjusting module 404 is adjusted to non-connecing in field successively Obtain asking card result;
Logging modle 406, the preset gain and corresponding sending module 405 for recording the adjustment of adjusting module 404 is obtained Inquiry card result;
Computing module 407, the preset gain and corresponding inquiry card result for being recorded according to logging modle 406 determines finally Gain;
Communication module 408, the final gain and card for being determined with computing module 407 carries out data communication.
In the present embodiment, first detection module 401, specifically for:The outside field intensity of detection, and judge the field intensity for detecting Whether value is more than predetermined threshold value, is, confirm not have card enter non-connect field, otherwise confirm to have card to enter and non-connect field.
In the present embodiment, the first detection logging modle 402, specifically for:External field is detected every prefixed time interval By force, and the field intensity value for detecting recorded and in the first array, obtains one group of field intensity value;
Correspondingly, the first judge module 403, specifically for:External field is judged according to the field intensity value in first array Whether strong change is in preset range.
Device in the present embodiment, also includes:Second judge module, the second detection module and update module;
Correspondingly, the first detection logging modle 402, specifically for:The outside field intensity of detection, and the field intensity value for detecting is remembered Record in the first array;
Second judge module, whether the quantity for judging field intensity value in the first array reaches predetermined number;
First detection logging modle 402, be additionally operable to when the second judge module judge in the first array field intensity value number When amount is not up to predetermined number, the outside field intensity of detection, and the field intensity value for detecting is recorded in the first array;
First judge module 403, specifically for:When the quantity that the second judge module judges field intensity value in the first array reaches During to predetermined number, according to field intensity value in the first array judge the change of outside field intensity whether in preset range;
Second detection module, for judging the change of outside field intensity not in preset range when the first judge module 403 When, the outside field intensity of detection;
Update module, the field intensity value for being detected according to the second detection module updates the first array;
First judge module 403, is additionally operable to after update module updates the first array, according to the field intensity value in the first array Judge the change of outside field intensity whether in preset range.
In the present embodiment, above-mentioned update module, specifically for:
Current first record in first array is updated to current second record, current second record is updated to Current 3rd record, updates the record after current second record successively, and last record current is updated to the The field intensity value that two detection modules are detected.
In the present embodiment, the first judge module 403, including:First judging submodule, the first calculating sub module and second Judging submodule;
Wherein, whether the first judging submodule is dull for judging the field intensity value for recording;
First calculating sub module, for when the first judging submodule judges the field intensity value for recording dullness, calculating last One-time detection to field intensity value and the difference of field intensity value for detecting at first;
Second judging submodule, whether the absolute value for judging the difference of the field intensity value of the first calculating sub module calculating is more than Preset value, is that the change for then confirming outside field intensity confirms the change of outside field intensity in preset range not in preset range, otherwise Interior.
In the present embodiment, above-mentioned first judging submodule, specifically for:
Judge that the field intensity value for recording, whether all according to same Long-term change trend, is, confirm the field intensity value dullness for recording, no Then confirm that the field intensity value for recording is not dull.
In the present embodiment, the first judge module 403, can also specifically include:Second calculating sub module and the 3rd judges Submodule;
Wherein, the second calculating sub module, for calculating the weighted mean of the field intensity value of record;
3rd judging submodule, for judging whether the weighted mean that the second calculating sub module is calculated is more than pre-determined threshold Value, is that the change for then confirming outside field intensity confirms the change of outside field intensity not in preset range, otherwise in preset range.
In the present embodiment, above-mentioned second calculating sub module, specifically for:In the field intensity value that will record, mutually different Field intensity value seeks product with from a frequency for occurring respectively, the product addition that tries to achieve is obtained the first operation result, by the frequency Addition obtains the second operation result, the weighted average of the field intensity value that the first operation result is obtained recording divided by the second operation result Number.
In the present embodiment, the first judge module 403, can also be specifically for:
Judge in the field intensity value of record, maximum field intensity values and field minimum intensity values whether no more than predetermined threshold value, be then Confirm that the change of outside field intensity confirms the change of outside field intensity in preset range, otherwise not in preset range.
In the present embodiment, adjusting module 404, specifically include:First adjustment submodule and the first judging submodule;
Wherein, the first adjustment submodule, is least gain for adjust gain, and as current gain;
Sending module 405, specifically for:Inquiry card is sent to non-connecing in field with the current gain of the first adjustment submodule adjustment Instruction obtains asking card result;
Logging modle 406, specifically for recorded current gain and inquiry card result in the second array;
Whether the first judging submodule, for judging the current gain of the first adjustment submodule adjustment more than maximum gain;
Computing module 407, specifically for:When the first judging submodule judges the current increasing of the first adjustment submodule adjustment When benefit is more than maximum gain, final gain is calculated according to the current gain in the second array and inquiry card result;
First adjustment submodule, is additionally operable to judge the current increasing of the first adjustment submodule adjustment when the first judging submodule When benefit is not more than maximum gain, current gain is increased after present count magnitude as current gain.
In the present embodiment, adjusting module 404, can also specifically include:Second adjustment submodule and second judges submodule Block;
Wherein, the second adjustment submodule, is maximum gain for adjust gain, and as current gain;
Sending module 405, specifically for:Inquiry card is sent to non-connecing in field with the current gain of the second adjustment submodule adjustment Instruction obtains asking card result;
Logging modle 406, specifically for:Current gain and inquiry card result are recorded in the second array;
Whether the second judging submodule, for judging the current gain of the second adjustment submodule adjustment less than least gain;
Computing module 407, specifically for:When the second judging submodule judges the current increasing of the second adjustment submodule adjustment When benefit is less than least gain, final gain is calculated according to the current gain in the second array and inquiry card result;
Second adjustment submodule, is additionally operable to judge the current increasing of the second adjustment submodule adjustment when the second judging submodule When benefit is not less than least gain, current gain is reduced after present count magnitude as current gain.
In the present embodiment, computing module 407, specifically for:It is to ask presetting corresponding to card success to read and ask card result Gain, calculates the meansigma methodss of the preset gain for reading, and according to the difference of card, the absolute value of calculated meansigma methodss is made For final gain, or the absolute value after calculated meansigma methodss are increased present count magnitude is used as final gain, or Absolute value after calculated meansigma methodss are reduced present count magnitude is used as final gain.
Device in the present embodiment, also includes:First opens module, the first closedown module and the 3rd judge module;
Wherein first opens module, for first detection module 401 detect card whether enter non-connect field before, open non- Connect field;
For first detection module 401,3rd judge module, when detecting whether card enters non-connect, the first detection record The outside field intensity of 402 repeated detection of module and when recording, the first judge module 403 is according to the first detection record of logging modle 402 When field intensity value judges that the change of outside field intensity is whether in preset range, judge waiting time whether more than the first preset duration;
First closedown module, for when the 3rd judge module judges that waiting time is more than the first preset duration, closing Non- connect field, terminate.
Device in the present embodiment, can also include:Second open module, the second closedown module, the 4th judge module and 5th judge module;
Wherein, second open module, for first detection module 401 detect card whether enter non-connect field before, open Non- connect field;
4th judge module, when detecting that card is introduced into non-connect for first detection module 401, judges that waiting time is No more than the second preset duration;
5th judge module, for the outside field intensity of the first detection logging modle 402 repeated detection and when recording, first judges Whether module 403 judges the change of outside field intensity in preset range according to the field intensity value of the first detection record of logging modle 402 When, judge waiting time whether more than the 3rd preset duration;
Closedown module, for when the 4th judge module judges that waiting time is more than the second preset duration, closing non-connecing , terminate;It is additionally operable to when the 5th judge module judges that waiting time is more than three preset duration, closing is non-to connect field, terminates.
Device in the present embodiment, also includes:6th judge module;
Correspondingly, adjusting module 404, be additionally operable to the first detection logging modle 402 and detect outside field intensity, and will detect Before field intensity value is recorded in the first array, adjust gain is least gain;
Sending module 405, is additionally operable to send inquiry card instruction with the least gain that adjusting module 404 is adjusted to non-connecing in field;
6th judge module, for judging whether to receive the response of card return;
Adjusting module 404, is additionally operable to, when the 6th judge module judges the response for receiving card return, be sequentially adjusted in Gain is preset gain;
The first detection logging modle 402, is additionally operable to the 6th judge module and judges not receiving answering for card return When answering, the outside field intensity of repeated detection is simultaneously recorded.
Device in the present embodiment, also includes:7th judge module;
Correspondingly, sending module 405, are additionally operable to final gain and card that communication module 408 is determined with computing module 407 Before carrying out data communication, inquiry card instruction is sent to non-connecing in field with final gain;
7th judge module, for judging whether to receive the response of card return;
Communication module 408, specifically for:When the 7th judge module judges the response for receiving card return, with most Whole gain carries out data communication with card;
First detection module 401, is additionally operable to when the 7th judge module judges the response for not receiving card return, inspection Survey card and whether enter and non-connect field.
Alternatively, in the present embodiment, first detection module 401, first detects logging modle 402 and the first judge module 403 can also be:8th judge module, the second detection logging modle and the 9th judge module;
Wherein, the second detection logging modle, for detecting outside field intensity and recording;
8th judge module, non-for determining whether that card is entered according to the field intensity value of the second detection logging modle record Connect field;
9th judge module, for when the 8th judge module judges to have card to enter non-connect, according to the second detection Whether the field intensity value of logging modle record judges the change of outside field intensity in preset range;
Second detection logging modle, is additionally operable to when the 8th judge module is judged to enter non-connect without card, detection Outside field intensity is simultaneously recorded;It is additionally operable to when the 9th judge module judges that the change of outside field intensity is not in preset range, detection Outside field intensity is simultaneously recorded;
Adjusting module 404, specifically for:When the 9th judge module judges the change of outside field intensity in preset range When, gain is sequentially adjusted in for preset gain.
In the present embodiment, above-mentioned 8th judge module, specifically for:
Judge in the field intensity value of the second detection logging modle record, if be no more than the field intensity value of predetermined threshold value, Be, confirm to have card enter non-connect field, otherwise confirm that not having card to enter non-connects field.
Technical scheme in the present invention, when non-contact card enter non-connect field after, for the non-contact card in kinestate, When the change of its position causes the change of outside field intensity in preset range, terminal can constantly adjust its gain and come with outward Portion's field intensity is adapted, it is ensured that being smoothed out of transaction.
The above, the only present invention preferably specific embodiment, but protection scope of the present invention is not limited thereto, Any those familiar with the art the invention discloses technical scope in, change or replacement can be readily occurred in, all Should be included within the scope of the present invention.Therefore, protection scope of the present invention should be defined by scope of the claims.

Claims (38)

1. a kind of method of adaptive gain regulating, it is characterised in that include:
Step S1:Terminal detection card whether enter non-connect field, be then execution step S2, otherwise continue executing with step S1;
Step S2:The outside field intensity of the terminal repeated detection is simultaneously recorded, and the field intensity value according to record judges the outside field intensity Whether change, in preset range, is then execution step S3, otherwise return to step S1;
Step S3:The terminal successively with preset gain to described non-connect in field send ask card instruction obtain ask card result, record Preset gain and corresponding inquiry card result, and the preset gain according to record and corresponding inquiry card result determine final gain;
Step S4:The terminal carries out data communication with the final gain with card.
2. method according to claim 1, it is characterised in that step S1, specially:The terminal detects external field By force, and whether the field intensity value that judges to detect more than predetermined threshold value, be, confirm not have card enter non-connect field, otherwise confirm There is card to enter and non-connect field.
3. method according to claim 1, it is characterised in that step S2 is specifically included:
Step A1:The terminal detects outside field intensity every prefixed time interval, and the field intensity value for detecting recorded first One group of field intensity value is obtained in array;
Step A2:Whether the terminal judges the change of outside field intensity in preset range according to the field intensity value in first array Interior, it is then execution step S3, otherwise return to step S1.
4. method according to claim 1, it is characterised in that step S2, specifically includes:
Step B1:The outside field intensity of terminal detection, the field intensity value for detecting is recorded in the first array, and judges described the In one array, whether the quantity of field intensity value reaches predetermined number, is then execution step B2, otherwise continues executing with step B1;
Step B2:Whether the terminal judges the change of outside field intensity in preset range according to the field intensity value in first array Interior, it is then execution step S3, otherwise execution step B3;
Step B3:The terminal detection outside field intensity, and first array, return to step are updated according to the field intensity value for detecting B2.
5. method according to claim 4, it is characterised in that in step B4, the field intensity value that the basis is detected First array is updated, specially:
Current first record in first array is updated to current second record by the terminal, by described current second Individual record is updated to current 3rd record, updates the record after current second record successively, and will be currently last One record is updated to the field intensity value for detecting.
6. method according to claim 1, it is characterised in that in step S2, the field intensity value according to record is sentenced Whether the change of the disconnected outside field intensity is specifically included in preset range:
Step C1:Whether the field intensity value of terminal judges record is dull, is then execution step C2, otherwise return to step S1;
Step C2:The terminal calculates the difference of the last time field intensity value for detecting and the field intensity value for detecting at first, and judges Whether the absolute value of the difference of the field intensity value is more than preset value, be the change for then confirming outside field intensity not in preset range, no Then confirm the change of outside field intensity in preset range.
7. method according to claim 6, it is characterised in that in step C1, the field intensity of the terminal judges record Whether value is dull, specially:
Whether the field intensity value of the terminal judges record is to confirm the field intensity value list for recording all according to same Long-term change trend Adjust, otherwise confirm that the field intensity value for recording is not dull.
8. method according to claim 1, it is characterised in that in step S2, the field intensity value according to record is sentenced The change of the disconnected outside field intensity whether in preset range, specially:
Whether the terminal calculates the weighted mean of the field intensity value of record, and judge the weighted mean more than pre-determined threshold Value, is that the change for then confirming outside field intensity confirms the change of outside field intensity not in preset range, otherwise in preset range.
9. method according to claim 8, it is characterised in that the terminal calculates the weighted average of the field intensity value of record Value, specially:In the field intensity value that the terminal will be recorded, mutually different field intensity value is taken advantage of with asking from a frequency for occurring respectively Product, the product addition that tries to achieve is obtained the first operation result, the frequency is added and obtains the second operation result, by described first The weighted mean of the field intensity value that operation result is obtained recording divided by second operation result.
10. method according to claim 1, it is characterised in that in step S2, the field intensity value according to record is sentenced The change of the disconnected outside field intensity whether in preset range, specially:
In the field intensity value of terminal judges record, maximum field intensity values and field minimum intensity values whether no more than predetermined threshold value, It is that the change for then confirming outside field intensity confirms the change of outside field intensity in preset range, otherwise not in preset range.
11. methods according to claim 1, it is characterised in that step S3 is specifically included:
Step E1:The terminal adjust gain is least gain, and as current gain, execution step E2;
Step E2:The terminal with current gain to described non-connect in field send ask card instruction obtain ask card result, currently will increase Benefit and inquiry card result are recorded in the second array;
Step E3:Whether the terminal judges current gain is more than maximum gain, is then execution step E4, otherwise by current gain As current gain, return to step E2 after increase present count magnitude;
Step E4:The terminal according to the current gain in second array and askes card result calculating final gain.
12. methods according to claim 1, it is characterised in that step S3 is specifically included:
Step H1:The terminal adjust gain is maximum gain, and as current gain, execution step H2;
Step H2:The terminal with current gain to described non-connect in field send ask card instruction obtain ask card result, currently will increase Benefit and inquiry card result are recorded in the second array;
Step H3:Whether the terminal judges current gain is less than least gain, is then execution step H4, otherwise by current gain As current gain, return to step H2 after reduction present count magnitude;
Step H4:The terminal according to the current gain in second array and askes card result calculating final gain.
13. methods according to claim 1, it is characterised in that in step S3, the preset gain according to record Final gain is determined with corresponding inquiry card result, specially:
It is to ask the preset gain corresponding to card success that the terminal reads the card result of asking, the preset gain that calculating reads Meansigma methodss, according to the difference of card, using the absolute value of the meansigma methodss as final gain, or the meansigma methodss are increased pre- If the absolute value after the order of magnitude is used as final gain, or the absolute value after the meansigma methodss are reduced present count magnitude is made For final gain.
14. methods according to claim 1, it is characterised in that
Before step S1, also include:Terminal is opened and non-connects field;
Step S1 and step S2, also include:Whether the terminal judges waiting time, more than the first preset duration, be Then close non-connect field, terminate.
15. methods according to claim 1, it is characterised in that
Before step S1, also include:Terminal is opened and non-connects field;
Step S1, also includes:Whether the terminal judges waiting time more than the second preset duration, is to close non-connecing , terminate;
Step S2, also includes:Whether the terminal judges waiting time more than the 3rd preset duration, is to close non-connecing , terminate.
16. methods according to claim 1, it is characterised in that before step S2, also include:
The terminal adjust gain is least gain and sends inquiry card instruction to non-the connecing in field, judges whether to receive card The response of return, is then execution step S3, otherwise execution step S2.
17. methods according to claim 1, it is characterised in that before step S4, also include:
The terminal sends inquiry card instruction with the final gain to non-the connecing in field, judges whether to receive card return Response, is then execution step S4, otherwise return to step S1.
18. methods according to claim 1, it is characterised in that step S1 and step S2 can be replaced:
Step W1:The outside field intensity of terminal detection is simultaneously recorded, and the field intensity value according to record determines whether that card entrance is non-and connects field, is Then execution step W2, otherwise continues executing with step W1;
Step W2:According to the field intensity value of the record, the terminal judges that the change of outside field intensity, whether in preset range, is Then execution step S3, otherwise return to step W1.
19. methods according to claim 18, it is characterised in that in step W1, the field intensity value according to record Determine whether that card entrance is non-and field is connect, specially:
In the field intensity value for recording described in the terminal judges, if be no more than the field intensity value of predetermined threshold value, be, confirm Have card enter non-connect field, otherwise confirm that not having card to enter non-connects field.
20. a kind of devices of adaptive gain regulating, it is characterised in that include:
First detection module, non-connects field for detecting whether card enters;It is additionally operable to when detecting card and being introduced into non-connect, Continue detection card and whether enter non-to connect field;
First detection logging modle, for when the first detection module detects card and enters non-connect, outside repeated detection Portion's field intensity is simultaneously recorded;
First judge module, for judging the change of the outside field intensity according to the field intensity value of the described first detection logging modle record Change whether in preset range;
Adjusting module, during for judging that when first judge module change of the outside field intensity is in preset range, according to Secondary adjust gain is preset gain;
Sending module, for successively with the adjusting module adjustment preset gain to described non-connect in field send ask card instruct To inquiry card result;
Logging modle, for recording the inquiry card result that preset gain and the corresponding sending module are obtained;
Computing module, the preset gain and corresponding inquiry card result for being recorded according to the logging modle determines final gain;
Communication module, the final gain and card for being determined with the computing module carries out data communication.
21. devices according to claim 20, it is characterised in that the first detection module, specifically for:Detection is outside Field intensity, the and whether field intensity value for judging to detect is more than predetermined threshold value, is, confirm not have card enter non-connect field, otherwise really Recognizing has card to enter non-to connect field.
22. devices according to claim 20, it is characterised in that:
The first detection logging modle, specifically for:Outside field intensity is detected every prefixed time interval, and by the field for detecting Intensity values recorded and obtain one group of field intensity value in the first array;
First judge module, specifically for:According to the change that the field intensity value in first array judges outside field intensity it is No in preset range.
23. devices according to claim 20, it is characterised in that also include:Second judge module, the second detection module and Update module;
The first detection logging modle, specifically for:The outside field intensity of detection, and the field intensity value for detecting recorded the first number In group;
Second judge module, whether the quantity for judging field intensity value in first array reaches predetermined number;
The first detection logging modle, is additionally operable to judge field intensity value in first array when second judge module When quantity is not up to predetermined number, the outside field intensity of detection, and the field intensity value for detecting is recorded in the first array;
First judge module, specifically for:When second judge module judges field intensity value in first array When quantity reaches predetermined number, judge the change of outside field intensity whether in preset range according to the field intensity value in first array Interior;
Second detection module, for judging the change of outside field intensity not in preset range when first judge module When, the outside field intensity of detection;
The update module, the field intensity value for being detected according to second detection module updates first array;
First judge module, is additionally operable to after the update module updates first array, according to first array In field intensity value judge the change of outside field intensity whether in preset range.
24. devices according to claim 23, it is characterised in that the update module, specifically for:
Current first record in first array is updated to current second record, by current second record more It is newly current 3rd record, updates the record after current second record successively, and will last record current It is updated to the field intensity value that second detection module is detected.
25. devices according to claim 20, it is characterised in that first judge module, including:First judges submodule Block, the first calculating sub module and the second judging submodule;
Whether first judging submodule is dull for judging the field intensity value for recording;
First calculating sub module, for when first judging submodule judges the field intensity value for recording dullness, calculating Field intensity value and the difference of the field intensity value for detecting at first that last time is detected;
Second judging submodule, for judge the difference of field intensity value that first calculating sub module is calculated absolute value whether More than preset value, it is that the change for then confirming outside field intensity confirms the change of outside field intensity default not in preset range, otherwise In the range of.
26. devices according to claim 25, it is characterised in that first judging submodule, specifically for:
Judge that the field intensity value for recording, whether all according to same Long-term change trend, is, confirm the field intensity value dullness for recording, otherwise really The field intensity value for recognizing record is not dull.
27. devices according to claim 20, it is characterised in that first judge module, specifically include:Second calculates Submodule and the 3rd judging submodule;
Second calculating sub module, for calculating the weighted mean of the field intensity value of record;
Whether the 3rd judging submodule, for judging the weighted mean of second calculating sub module calculating more than default Threshold value, is that the change for then confirming outside field intensity confirms the change of outside field intensity in preset range not in preset range, otherwise Interior.
28. devices according to claim 27, it is characterised in that second calculating sub module, specifically for:Will record Field intensity value in, mutually different field intensity value seeks product with from a frequency for occurring respectively, and the product addition that tries to achieve is obtained the One operation result, the frequency is added and obtains the second operation result, by first operation result divided by second computing As a result the weighted mean of the field intensity value of record are obtained.
29. devices according to claim 20, it is characterised in that first judge module, specifically for:
Judge that, in the field intensity value of record, maximum field intensity values and field minimum intensity values, whether no more than predetermined threshold value, are to confirm The change of outside field intensity confirms the change of outside field intensity in preset range, otherwise not in preset range.
30. devices according to claim 20, it is characterised in that the adjusting module, specifically include:First adjustment submodule Block and the first judging submodule;
The first adjustment submodule, is least gain for adjust gain, and as current gain;
The sending module, specifically for:Sent out to non-the connecing in field with the current gain of the described first adjustment submodule adjustment Inquiry card instruction is sent to obtain asking card result;
The logging modle, specifically for recorded current gain and inquiry card result in the second array;
First judging submodule, whether the current gain for judging the described first adjustment submodule adjustment is more than most increases Benefit;
The computing module, specifically for:When first judging submodule judges the described first adjustment submodule adjustment When current gain is more than maximum gain, final gain is calculated according to the current gain in second array and inquiry card result;
The first adjustment submodule, is additionally operable to judge the described first adjustment submodule adjustment when first judging submodule Current gain be not more than maximum gain when, using current gain increase present count magnitude after as current gain.
31. devices according to claim 20, it is characterised in that the adjusting module, including:Second adjustment submodule and Second judging submodule;
The second adjustment submodule, is maximum gain for adjust gain, and as current gain;
The sending module, specifically for:Sent out to non-the connecing in field with the current gain of the described second adjustment submodule adjustment Inquiry card instruction is sent to obtain asking card result;
The logging modle, specifically for:Current gain and inquiry card result are recorded in the second array;
Second judging submodule, whether the current gain for judging the described second adjustment submodule adjustment increases less than minimum Benefit;
The computing module, specifically for:When second judging submodule judges the described second adjustment submodule adjustment When current gain is less than least gain, final gain is calculated according to the current gain in second array and inquiry card result;
The second adjustment submodule, is additionally operable to judge the described second adjustment submodule adjustment when second judging submodule Current gain not less than least gain when, using current gain reduce present count magnitude after as current gain.
32. devices according to claim 20, it is characterised in that the computing module, specifically for:Read described inquiry to block As a result for asking the preset gain corresponding to card success, the meansigma methodss of the preset gain for reading are calculated, according to the difference of card, will The absolute value of the meansigma methodss as final gain, or the absolute value after the meansigma methodss are increased present count magnitude as Final gain, or the absolute value after the meansigma methodss are reduced present count magnitude is used as final gain.
33. devices according to claim 20, it is characterised in that also include:First open module, the first closedown module and 3rd judge module;
Described first opens module, for the first detection module detection card whether enter non-connect field before, open non-connecing ?;
Whether the 3rd judge module, when entering non-connect for first detection module detection card, first inspection When surveying the outside field intensity of logging modle repeated detection and recording, first judge module is according to the described first detection logging modle note When the field intensity value of record judges that the change of outside field intensity is whether in preset range, when judging whether waiting time is preset more than first Long;
First closedown module, for when the 3rd judge module judges that waiting time is more than the first preset duration, Closing is non-to connect field, terminates.
34. devices according to claim 20, it is characterised in that also include:Second open module, the second closedown module, 4th judge module and the 5th judge module;
Described second opens module, for the first detection module detection card whether enter non-connect field before, open non-connecing ?;
4th judge module, when being introduced into non-connect for first detection module detection card, judges waiting time Whether more than the second preset duration;
5th judge module, for the outside field intensity of the first detection logging modle repeated detection and when recording, described first sentences Whether disconnected module judges the change of outside field intensity in preset range according to the field intensity value of the described first detection logging modle record When, judge waiting time whether more than the 3rd preset duration;
The closedown module, for when the 4th judge module judges that waiting time is more than the second preset duration, closing Non- connect field, terminate;It is additionally operable to, when the 5th judge module judges that waiting time is more than three preset duration, close non-connecing , terminate.
35. devices according to claim 20, it is characterised in that also include:6th judge module;
The adjusting module, is additionally operable to the outside field intensity of the described first detection logging modle detection, and the field intensity value for detecting is remembered Before recording in the first array, adjust gain is least gain;
The sending module, be additionally operable to the adjusting module adjustment least gain to described non-connect in field send ask card refer to Order;
6th judge module, for judging whether to receive the response of card return;
The adjusting module, is additionally operable to, when the 6th judge module judges the response for receiving card return, adjust successively Whole gain is preset gain;
The first detection logging modle, is additionally operable to judge not receiving the response of card return when the 6th judge module When, the outside field intensity of repeated detection is simultaneously recorded.
36. devices according to claim 20, it is characterised in that also include:7th judge module;
The sending module, being additionally operable to the communication module carries out data with the final gain that the computing module determines with card Before communication, inquiry card instruction is sent to non-the connecing in field with the final gain;
7th judge module, for judging whether to receive the response of card return;
The communication module, specifically for:When the 7th judge module judges the response for receiving card return, with institute Stating final gain carries out data communication with card;
The first detection module, is additionally operable to when the 7th judge module judges the response for not receiving card return, Whether detection card enters and non-connects field.
37. devices according to claim 20, it is characterised in that the first detection module, the first detection record Module and first judge module can be replaced:8th judge module, the second detection logging modle and the 9th judge module;
The second detection logging modle, for detecting outside field intensity and recording;
According to the field intensity value of the described second detection logging modle record, 8th judge module, for determining whether that card enters Enter non-to connect field;
9th judge module, for when the 8th judge module judges to have card to enter non-connect, according to described Whether the field intensity value of the second detection logging modle record judges the change of outside field intensity in preset range;
The second detection logging modle, is additionally operable to when the 8th judge module is judged to enter non-connect without card, The outside field intensity of detection is simultaneously recorded;It is additionally operable to judge the change of outside field intensity not in preset range when the 9th judge module When, the outside field intensity of detection is simultaneously recorded;
The adjusting module, specifically for:When the 9th judge module judges the change of outside field intensity in preset range When, gain is sequentially adjusted in for preset gain.
38. devices according to claim 37, it is characterised in that the 8th judge module, specifically for:
Judge in the field intensity value of the described second detection logging modle record, if be no more than the field intensity value of predetermined threshold value, Be, confirm to have card enter non-connect field, otherwise confirm that not having card to enter non-connects field.
CN201610842682.XA 2016-09-22 2016-09-22 A kind of method and device of adaptive gain regulating Active CN106446739B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610842682.XA CN106446739B (en) 2016-09-22 2016-09-22 A kind of method and device of adaptive gain regulating

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610842682.XA CN106446739B (en) 2016-09-22 2016-09-22 A kind of method and device of adaptive gain regulating

Publications (2)

Publication Number Publication Date
CN106446739A true CN106446739A (en) 2017-02-22
CN106446739B CN106446739B (en) 2019-03-05

Family

ID=58167070

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610842682.XA Active CN106446739B (en) 2016-09-22 2016-09-22 A kind of method and device of adaptive gain regulating

Country Status (1)

Country Link
CN (1) CN106446739B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114548129A (en) * 2020-11-25 2022-05-27 上海复旦微电子集团股份有限公司 NFC accurate alignment method, terminal, tag, device and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100237943A1 (en) * 2009-03-23 2010-09-23 Samsung Electronics Co., Ltd. Auto gain controllers, and communication terminals having the same
CN103065182A (en) * 2011-10-19 2013-04-24 国民技术股份有限公司 Module and method for field intensity self-adaption and non-contact integrated circuit (IC) card
CN103117720A (en) * 2013-01-16 2013-05-22 东南大学 Self-adaptation control gain method in magnetic card decoding chip
JP2015012587A (en) * 2013-07-02 2015-01-19 トヨタ自動車株式会社 Communication control device, mobile device, and communication control method
CN104636696A (en) * 2015-02-27 2015-05-20 飞天诚信科技股份有限公司 Device and method for detecting card-in-field
CN105095812A (en) * 2015-08-28 2015-11-25 飞天诚信科技股份有限公司 Self-adaptive resonant frequency method and self-adaptive resonant frequency device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100237943A1 (en) * 2009-03-23 2010-09-23 Samsung Electronics Co., Ltd. Auto gain controllers, and communication terminals having the same
CN103065182A (en) * 2011-10-19 2013-04-24 国民技术股份有限公司 Module and method for field intensity self-adaption and non-contact integrated circuit (IC) card
CN103117720A (en) * 2013-01-16 2013-05-22 东南大学 Self-adaptation control gain method in magnetic card decoding chip
JP2015012587A (en) * 2013-07-02 2015-01-19 トヨタ自動車株式会社 Communication control device, mobile device, and communication control method
CN104636696A (en) * 2015-02-27 2015-05-20 飞天诚信科技股份有限公司 Device and method for detecting card-in-field
CN105095812A (en) * 2015-08-28 2015-11-25 飞天诚信科技股份有限公司 Self-adaptive resonant frequency method and self-adaptive resonant frequency device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114548129A (en) * 2020-11-25 2022-05-27 上海复旦微电子集团股份有限公司 NFC accurate alignment method, terminal, tag, device and storage medium

Also Published As

Publication number Publication date
CN106446739B (en) 2019-03-05

Similar Documents

Publication Publication Date Title
CN106655415B (en) Intelligent universal charging identification and control device based on USB interface
CN104604149B (en) Circuits and methods for field-based communication
CN103049158B (en) A kind of touch detecting method of capacitive touch screen and system
CN102386876B (en) Impedance matching methods and the impedance matching equipment for the method
CN106686185B (en) Improve the method, apparatus and hands-free talking device of hands-free talking device speech quality
CN103778420A (en) Fingerprint detection system having automatic gain control function and automatic gain control method thereof
CN109238225B (en) Mobile vehicle platform real-time height monitoring platform
CN107004426A (en) The method and mobile terminal of the sound of admission video recording object
CN106446739A (en) Method and apparatus for self-adaptive gain adjustment
CN103378934A (en) 1090MHz ES ADS-B frame signal demodulation method
CN105355197A (en) Gain processing method and device for speech recognition system
US20190131948A1 (en) Audio loudness control method and system based on signal analysis and deep learning
CN102938051B (en) A kind of interaction processing method, device and electronic equipment
CN109286455A (en) A kind of means of communication and communication system preventing multimachine interference
CN111586657B (en) Near field communication method, device, storage medium and mobile terminal
CN105824597A (en) Terminal audio processing method and terminal
CN109637540A (en) Bluetooth evaluating method, device, equipment and the medium of intelligent sound equipment
CN105656574A (en) Detection device for sensitivity of NFC card reader
CN104679217A (en) Terminal
CN112740739B (en) Interference processing method and device, storage medium and electronic equipment
CN107743038A (en) A kind of method and its system of the adjustment of communication apparatus network
WO2019184982A1 (en) Method and circuit for transmitting signal
CN115223548B (en) Voice interaction method, voice interaction device and storage medium
CN104167787B (en) A kind of mobile terminal precharge method of flow control, system and mobile terminal
KR101843080B1 (en) Fingerprint sensing system for improving recognition ability with effectively reducing common voltage

Legal Events

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