Nothing Special   »   [go: up one dir, main page]

CN108734036B - Decoding method and device for magnetic stripe card - Google Patents

Decoding method and device for magnetic stripe card Download PDF

Info

Publication number
CN108734036B
CN108734036B CN201810478216.7A CN201810478216A CN108734036B CN 108734036 B CN108734036 B CN 108734036B CN 201810478216 A CN201810478216 A CN 201810478216A CN 108734036 B CN108734036 B CN 108734036B
Authority
CN
China
Prior art keywords
magnetic stripe
stripe card
signal
time length
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810478216.7A
Other languages
Chinese (zh)
Other versions
CN108734036A (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.)
Shenzhen Angrui Microelectronics Technology Co ltd
Original Assignee
Shenzhen Angrui Microelectronics Technology 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 Shenzhen Angrui Microelectronics Technology Co ltd filed Critical Shenzhen Angrui Microelectronics Technology Co ltd
Priority to CN201810478216.7A priority Critical patent/CN108734036B/en
Publication of CN108734036A publication Critical patent/CN108734036A/en
Application granted granted Critical
Publication of CN108734036B publication Critical patent/CN108734036B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/08Methods or arrangements for sensing record carriers, e.g. for reading patterns by means detecting the change of an electrostatic or magnetic field, e.g. by detecting change of capacitance between electrodes
    • G06K7/082Methods or arrangements for sensing record carriers, e.g. for reading patterns by means detecting the change of an electrostatic or magnetic field, e.g. by detecting change of capacitance between electrodes using inductive or magnetic sensors

Landscapes

  • Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)
  • Digital Magnetic Recording (AREA)

Abstract

The application provides a decoding method and a device of a magnetic stripe card, wherein the method comprises the following steps: detecting a magnetic stripe card signal to be decoded; acquiring the time length between the peak point and the valley point of the magnetic stripe card signal; comparing the time length with a reference time length, and detecting information bits; and according to the result of the information bit detection, obtaining and outputting a bit data value. The decoding method provided by the application is based on the time axis position estimation of the peak value and the valley value, is insensitive to the amplitude change of the magnetic track signal, and can effectively remove the influence of the amplitude on the algorithm without special treatment. The decoding method has clear structure and low complexity, can process in real time, has higher signal identification rate, is a more flexible digital decoding algorithm, and can solve various complex magnetic stripe card signal problems.

Description

Decoding method and device for magnetic stripe card
Technical Field
The present application relates to the field of decoding technologies, and in particular, to a method and an apparatus for decoding a magnetic stripe card.
Background
Magnetic stripe cards are a type of recording medium that uses a magnetic carrier to record information, which may be used to identify identity information or for other purposes. The magnetic strip card has low manufacturing cost, easy use, convenient management and certain safety characteristic. Magnetic stripe cards are not only commonly used in bank cards in financial systems, but also inexpensive magnetic stripe cards can be used as membership cards, ticket cards, game cards, etc., and in these applications, magnetic stripe cards have a huge market.
The magnetic stripe card records information in a magnetic medium, generates weak current through the relative motion of a magnetic head and a magnetic stripe track, and obtains corresponding recorded information after amplification and decoding. Because the magnetic stripe card is not a digital recording mode, the corresponding information flow needs to be restored through an analog circuit, and the magnetic stripe card can encounter various problems of damaging information restoration such as scratch, demagnetization and the like in the storage process, and the magnetic stripe card readers designed on the market mostly decode through the analog circuit, and because the capacity of analog quantity processing various special-shaped signals is limited, most magnetic stripe card readers on the market have the problems of low recognition rate, complex equipment, high cost and the like.
Disclosure of Invention
In view of the above, the present application provides a decoding method and apparatus for a magnetic stripe card, which has low computation complexity, can process various non-ideal magnetic card signals, and finally output information bits recorded in a channel.
In order to achieve the purpose, the application provides the following technical scheme:
a method of decoding a magnetic stripe card, the method comprising:
detecting a magnetic stripe card signal to be decoded;
acquiring the time length between the peak point and the valley point of the magnetic stripe card signal;
comparing the time length with a reference time length, and detecting information bits;
and according to the result of the information bit detection, obtaining and outputting a bit data value.
Preferably, before the detecting the magnetic stripe card signal to be decoded, the method further includes:
monitoring background noise, and taking the energy of the initial background noise as reference energy;
and when the energy of the background noise is monitored to be increased to a preset multiple of the energy of the initial background noise, determining that the magnetic stripe card signal comes.
Preferably, before the detecting the magnetic stripe card signal to be decoded, the method further includes:
converting a current signal generated by the magnetic stripe card through a magnetic track into a voltage signal;
performing analog amplification on the voltage signal, and then performing AD sampling to obtain a magnetic track input signal;
and performing direct current removal processing on the magnetic track input signal to obtain the magnetic stripe card signal.
Preferably, the acquiring a time length between a peak point and a valley point of the magnetic stripe card signal includes:
when the value of the magnetic stripe card signal of the current bit information is a non-negative number and the valley absolute value corresponding to the current bit information is greater than beta times of the peak value, acquiring the time length from the peak value point to the valley value point of the previous bit information;
and when the value of the magnetic stripe card signal of the current bit information is a negative number and the peak value corresponding to the current bit information is more than beta times of the valley absolute value, acquiring the time length from the valley point to the peak point of the previous bit information.
Preferably, the reference time length includes: the reference time length of information bit 0 and the reference time length of information bit 1.
An apparatus for decoding a magnetic stripe card, the apparatus comprising:
the detection unit is used for detecting a magnetic stripe card signal to be decoded;
the acquisition unit is used for acquiring the time length between the peak value point and the valley value point of the magnetic stripe card signal;
a comparison unit for comparing the time length with a reference time length to perform information bit detection;
and the output unit is used for obtaining and outputting a bit data value according to the result of the information bit detection.
Preferably, the apparatus further comprises:
the monitoring unit is used for monitoring background noise and taking the energy of the initial background noise as reference energy;
and the starting monitoring unit is used for determining that the magnetic stripe card signal comes when the energy of the background noise is increased to a preset multiple of the energy of the initial background noise.
Preferably, the apparatus further comprises:
the conversion unit is used for converting a current signal generated by the magnetic stripe card passing through the magnetic track into a voltage signal;
the sampling unit is used for carrying out analog amplification on the voltage signal and then carrying out AD sampling to obtain a magnetic track input signal;
and the direct current removing unit is used for performing direct current removing processing on the magnetic track input signal to obtain the magnetic stripe card signal.
Preferably, the acquiring unit includes:
the judging unit is used for judging whether the value of the magnetic stripe card signal of the current bit information is a non-negative number;
the first comparison unit is used for comparing whether the valley absolute value corresponding to the current bit information is larger than beta times of the peak value or not when the judgment unit determines that the value of the magnetic stripe card signal of the current bit information is a non-negative number;
a first sub-obtaining unit configured to obtain a time length from a peak point to a bottom point of previous bit information when a result of the first comparing unit is yes;
the second comparison unit is used for comparing whether the peak value corresponding to the current bit information is greater than beta times of the valley absolute value or not when the judgment unit determines that the value of the magnetic stripe card signal of the current bit information is a negative number;
and a second sub-obtaining unit, configured to obtain a time length from a valley point to a peak point of previous bit information when the result of the second comparing unit is yes.
Preferably, the dc removing unit may be a first-order IIR digital filter.
According to the technical scheme, the application provides a decoding method and a device of a magnetic stripe card, and the method comprises the following steps: detecting a magnetic stripe card signal to be decoded; acquiring the time length between the peak point and the valley point of the magnetic stripe card signal; comparing the time length with a reference time length, and detecting information bits; and according to the result of the information bit detection, obtaining and outputting a bit data value. The decoding method provided by the application is based on the time axis position estimation of the peak value and the valley value, is insensitive to the amplitude change of the magnetic track signal, and can effectively remove the influence of the amplitude on the algorithm without special treatment. The decoding method has clear structure and low complexity, can process in real time, has higher signal identification rate, is a more flexible digital decoding algorithm, and can solve various complex magnetic stripe card signal problems.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a decoding method for a magnetic stripe card according to an embodiment of the present disclosure;
fig. 2 is a flowchart of a decoding method for a magnetic stripe card according to a second embodiment of the present application;
fig. 3 is a signal diagram of a magnetic stripe card according to a second embodiment of the present application;
fig. 4 is a flowchart of another decoding method for a magnetic stripe card according to the second embodiment of the present application;
fig. 5 is a schematic structural diagram of a decoding apparatus for a magnetic stripe card according to a third embodiment of the present application;
fig. 6 is a schematic structural diagram of a decoding apparatus for a magnetic stripe card according to a fourth embodiment of the present application;
fig. 7 is a schematic structural diagram of an obtaining unit according to a fourth embodiment of the present application;
fig. 8 is a schematic structural diagram of another decoding apparatus for a magnetic stripe card according to a fourth embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The application provides a decoding method and a device of a magnetic stripe card, which have low operation complexity, can process various nonideal magnetic card signals and finally output information bits recorded in a channel, and the specific scheme is as follows:
example one
In an embodiment of the present application, a method for decoding a magnetic stripe card is provided, as shown in fig. 1, the method includes:
s101, detecting a magnetic stripe card signal to be decoded;
s102, acquiring the time length between a peak value point and a valley value point of a magnetic stripe card signal;
s103, comparing the time length with a reference time length, and detecting information bits;
and S104, obtaining and outputting a bit data value according to the information bit detection result.
After the magnetic card signal is detected to arrive, the core module for magnetic card decoding is entered: and an F2F signal generating module, wherein the F2F signal represents the distance from the peak to the trough of the track signal on the whole time axis. In a digital system, if we count the number of peak-to-valley sampling points, the method can directly form linkage with a subsequent F2F signal decoding module, thereby solving information bits in a track.
The decoding method provided by the embodiment of the application is based on the time axis position estimation of the peak value and the valley value, is insensitive to the amplitude change of the magnetic track signal, and can effectively remove the influence of the amplitude on the algorithm without special treatment. The decoding method has clear structure and low complexity, can process in real time, has higher signal identification rate, is a more flexible digital decoding algorithm, and can solve various complex magnetic stripe card signal problems.
Example two
On the basis of the first embodiment, the second embodiment of the present application provides a more specific decoding method, as shown in fig. 2, the method includes:
s201, monitoring background noise, and taking the energy of the initial background noise as reference energy;
after the magnetic stripe card reader is powered on, the card reader waits for the card reader to swipe the card; it is also possible that the card swiping operation is not performed for a long time, so that whether a magnetic stripe card signal is input or not needs to be detected, so as to trigger the execution of the subsequent decoding operation, and meanwhile, the power consumption of the whole system can be reduced. Before the magnetic stripe card signal is input, the energy of background noise can be detected, and the energy is used as a reference value to determine the starting position of the magnetic stripe card signal. The magnetic stripe card background noise energy is subjected to moving average by using an FIR filter structure or is subjected to averaging by using a first-order IIR filter structure. If an FIR structure is used, its mathematical expression is:
Figure BDA0001665050970000051
Ebnrepresenting the background noise energy at sample points numbered n. k denotes the number of taps of the FIR filter, EnRepresenting a sample point XnEnergy of (E)n=Xn 2Conveniently, k is typically a power of 2, so that the multiplication operation can be converted to a shift operation of the data.
If an IIR filter structure is used, the mathematical expression is: ebn=(1-α)Ebn-1+αEnWhere the variable α is an adjustable small-valued parameter that can be operated at a power of 2.
S202, when the monitored energy of the background noise is increased to a preset multiple of the energy of the initial background noise, determining that a magnetic stripe card signal comes;
the background noise Eb monitored in the period after the start-up and before the card swiping is usednFor reference energy, when the subsequently monitored background noise energy is increased to a certain multiple of the initial background noise energy, it indicates that the magnetic card signal comes, and a subsequently related decoding module can be triggered. The multiple size can be adjusted according to the actual system. The specific times are related to the specific card reader board-level noise and the amplification factor of the front end of the card reader, namely the relative sizes of the magnetic track signal and the background noise. Typically 10 times, the track signal can be easily detected.
S203, detecting a magnetic stripe card signal to be decoded;
s204, acquiring the time length between the peak value point and the valley value point of the magnetic stripe card signal;
specifically, the method comprises the following steps:
when the value of the magnetic stripe card signal of the current bit information is a non-negative number and the valley absolute value corresponding to the current bit information is greater than beta times of the peak value, acquiring the time length from the peak value point to the valley value point of the previous bit information;
and when the value of the magnetic stripe card signal of the current bit information is a negative number and the peak value corresponding to the current bit information is more than beta times of the valley absolute value, acquiring the time length from the valley point to the peak point of the previous bit information.
As shown in fig. 3, fig. 3 is a schematic signal diagram of a magnetic stripe card according to a second embodiment of the present application. xMin represents the estimated trough value, xMax represents the estimated peak value, and x represents the data input to the F2F signal generation module. After data input, corresponding different operations are carried out according to whether the input data is a non-negative number:
if the data is non-negative, then the relative magnitude of the wave trough absolute value and the wave peak value beta times is compared at the moment, the moment corresponds to the point D in fig. 3, and the point D is the decision point of the descending curve. The parameter beta is adjustable and is generally set to 0.5. The decision point D decides the time length from the point A to the point C of the previous bit signal. If the decision result is negative, returning to the decision whether the input signal x is a non-negative number; if the judgment result is yes, acquiring the time length from the peak value point to the valley value point of the corresponding previous bit information, namely recording the time length cnt _ xMax from the peak value to the valley value; then clearing the xMax; setting up _ dw _ flag to 1; finally, cnt _ xMax is cleared.
If the data is negative, then the relative magnitude of the wave peak value and the wave trough absolute value beta is compared at this time, the time corresponds to the point F in fig. 3, and the point F is the decision point of the ascending curve. The parameter beta is adjustable and is generally set to 0.5. The decision point F decides the time length from the point C to the point E of the previous bit signal. If the decision result is negative, returning to the decision whether the input signal x is a non-negative number; if the judgment result is yes, acquiring the time length from the valley point to the peak point of the corresponding previous bit information, namely recording the time length cnt _ xMin from the valley point to the peak value; then resetting xMin; setting up _ dw _ flag to 0; finally, cnt _ xMin is cleared.
In fig. 3, up _ dw _ flag is a flag bit, and is 1 between the decision point of the descending curve and the decision point of the ascending curve; and 0 is between the decision point of the rising curve and the decision point of the falling curve. cnt _ xMax represents the duration of the droop curve; cnt _ xMin represents the duration of the rising curve. The two decision conditions of whether (-xMin) is greater than β x xMax, and whether xMax is greater than β x (-xMin) are performed on the rising curve segment and the falling curve segment and only once.
Specifically, the following codes can be referred to for obtaining the key parameters cnt _ xMax and cnt _ xMin representing the information bit duration:
Figure BDA0001665050970000071
the code can effectively remove the signal jitter and burr problems in the track signal.
S205, comparing the time length with the reference time length, and detecting the information bit;
comparing the obtained time length with the reference time length of the information bits '0' and '1', the bit value of the information can be judged.
The reference time lengths of the information baud '0' and '1' can be obtained by:
in the initial phase, we can determine the initial reference time length of the information bits according to the following fact: each track of the magnetic stripe card starts with a certain number of information bits '0' and likewise ends with a certain number of information bits '0'. Therefore, we obtain the current initial reference time length by tracking the time length of the initial bit information '0'. The tracking function can adopt a first-order IIR filter structure, and the mathematical expression is as follows:
Tref=(1-γ)Tref+γTcurr0
the parameter γ is an adjustable parameter, and can be implemented by using a power of 2 for simple implementation, so that the corresponding multiplication operation can be converted into a shift operation of data. For example, the value of γ may take 0.25. In the above formula, TrefReference time length representing bit' 0The reference time length of the bit '1' is half of the reference time length of the bit '0', where the time reference length of the bit '1' refers to half of the time length of the track signal representing the bit '1', i.e., the time length from one of the peaks to the valley.
In a non-initial stage, a decision feedback loop form is adopted to continuously update the reference time length, and after we obtain a decision result of a previous information bit, we normalize the corresponding time length to a time length representing '0' according to the decision result of the information bit, no matter '0' or '1', specifically: the peak-to-valley distance of bit '0' directly represents T in the above formulacurr0And 2 times the peak-to-valley pitch of bit '1' represents T in the above formulacurr0
Thus, we can obtain the information bit reference time length of the whole track. The updating mechanism of the reference time length can perfectly solve the problem that the signal frequency changes continuously.
And S206, obtaining and outputting a bit data value according to the information bit detection result.
In the second embodiment of the present application, another decoding method is provided, and the method may further include the following steps S401-S403 as compared with that shown in fig. 1 or fig. 2, and for simplicity of description, fig. 4 shows the addition of steps performed on the basis of fig. 1, as shown in fig. 4:
s401, converting a current signal generated by the magnetic stripe card passing through a magnetic track into a voltage signal;
s402, performing analog amplification on the voltage signal and then performing AD sampling to obtain a magnetic track input signal;
s403, performing direct current removing processing on the magnetic track input signal to obtain a magnetic stripe card signal;
in this application, a first order IIR digital filter may be employed for DC removal processing, yn=(1-α)yn-1+αxnWherein, ynRepresenting the value of the sampled output signal, x, of the de-DC modulenRepresenting the sampled value of the input signal to the dc-dc block, the variable α being a small adjustable parameter, which can be operated at power of 2, so that it is electrically inactiveA shift operation in a way or software that can be translated into a variable. The direct current component obtained by subtracting the input signal is input to the next operation module.
The present application uses first order IIR digital filters rather than higher order ones for simplicity and first order ones are sufficient. IIR is also used instead of FIR (finite impulse response filter) for simplicity of implementation. Since the higher the order, the more memory units and operation units are needed by the filter to achieve the same filtering effect, and if the group delay band is not required to be consistent, the order required by using the IIR is far smaller than that of the FIR, so that the first-order IIR filter can be used.
It should be noted that the dc removal module is not necessary, and can be omitted if the dc amount of the signal is small compared to the amplitude of the input signal.
S404, detecting a magnetic stripe card signal to be decoded;
s405, acquiring the time length between a peak value point and a valley value point of a magnetic stripe card signal;
s406, comparing the time length with the reference time length, and detecting information bits;
and S407, obtaining and outputting a bit data value according to the information bit detection result.
According to the technical scheme, the decoding method provided by the second embodiment of the application is based on the time axis position estimation of the peak value and the valley value, is insensitive to the amplitude change of the magnetic track signal, and can effectively remove the influence of the amplitude on the algorithm without special processing. The decoding method has clear structure and low complexity, can process in real time, has higher signal identification rate, is a more flexible digital decoding algorithm, and can solve various complex magnetic stripe card signal problems.
EXAMPLE III
On the basis of the first embodiment, a third embodiment of the present application provides a decoding apparatus for a magnetic stripe card, as shown in fig. 5, fig. 5 is a schematic structural diagram of the decoding apparatus for a magnetic stripe card provided in the third embodiment of the present application, and the apparatus includes:
a detection unit 501, configured to detect a magnetic stripe card signal to be decoded;
an obtaining unit 502, configured to obtain a time length between a peak point and a valley point of a magnetic stripe card signal;
a comparing unit 503, configured to compare the time length with a reference time length, and perform information bit detection;
and an output unit 504, configured to obtain and output a bit data value according to a result of the information bit detection.
After the magnetic card signal is detected to arrive, the core module for magnetic card decoding is entered: the F2F signal generating module (i.e., the module included in the acquisition unit) is the F2F signal indicating the distance from the peak to the trough of the track signal on the entire time axis. In a digital system, if we count the number of peak-to-valley sampling points, the method can directly form linkage with a subsequent F2F signal decoding module, thereby solving information bits in a track.
The decoding device provided by the third embodiment of the application is insensitive to amplitude change of the magnetic track signal based on time axis position estimation of the peak value and the valley value, and can effectively remove the influence of the amplitude on the algorithm without special treatment. The decoding device has clear structure and low complexity, can process in real time, has higher signal identification rate, is a more flexible digital decoding algorithm, and can solve various complex magnetic stripe card signal problems.
Example four
As shown in fig. 6, fig. 6 is a schematic structural diagram of a decoding apparatus for a magnetic stripe card according to a fourth embodiment of the present application. The device includes:
a monitoring unit 601, configured to monitor background noise, and use energy of initial background noise as reference energy;
the starting monitoring unit 602 is configured to determine that a magnetic stripe card signal arrives when it is monitored that the energy of the background noise is increased to a preset multiple of the energy of the initial background noise;
a detection unit 603 for detecting a magnetic stripe card signal to be decoded;
an obtaining unit 604, configured to obtain a time length between a peak point and a valley point of the magnetic stripe card signal;
specifically, as shown in fig. 7, fig. 7 is a schematic structural diagram of an obtaining unit provided in the fourth embodiment of the present application, where the obtaining unit includes:
a judgment unit 6041 configured to judge whether a value of a magnetic stripe card signal of current bit information is a non-negative number;
a first comparing unit 6042 configured to, when the determining unit determines that the value of the magnetic stripe card signal of the current bit information is a non-negative number, compare whether a valley absolute value corresponding to the current bit information is greater than β times of a peak value;
a first sub-acquisition unit 6043 configured to acquire a time length from a peak point to a bottom point of previous bit information when the result of the first comparison unit is yes;
a second comparing unit 6044, configured to compare whether a peak value corresponding to the current bit information is greater than β times of an absolute value of the valley value when the determining unit determines that the value of the magnetic stripe card signal of the current bit information is a negative number;
a second sub-acquisition unit 6045 configured to acquire a time length from a bottom point to a top point of previous bit information when the result of the second comparison unit is yes.
A comparing unit 605, configured to compare the time length with a reference time length, and perform information bit detection;
specifically, the reference time length includes: the reference time length of information bit 0 and the reference time length of information bit 1.
And an output unit 606, configured to obtain and output a bit data value according to a result of the information bit detection.
In the fourth embodiment of the present application, another decoding apparatus is provided, which further includes the following 801-803 structures compared to that shown in fig. 5 or fig. 6, and for simplicity of description, fig. 8 is an additional structure based on the structure shown in fig. 6, as shown in fig. 8, and fig. 8 is a schematic structural diagram of another decoding apparatus for a magnetic stripe card provided in the fourth embodiment of the present application, and the apparatus includes:
a conversion unit 801 for converting a current signal generated by the magnetic stripe card passing through a magnetic track into a voltage signal;
the sampling unit 802 is configured to perform analog amplification on the voltage signal and then perform AD sampling to obtain a track input signal;
a dc removal unit 803, configured to perform dc removal processing on the track input signal to obtain a magnetic stripe card signal;
specifically, the dc removal unit may be a first-order IIR digital filter.
A detection unit 804 for detecting a magnetic stripe card signal to be decoded;
an obtaining unit 805 configured to obtain a time length between a peak point and a valley point of the magnetic stripe card signal;
a comparing unit 806, configured to compare the time length with a reference time length, and perform information bit detection;
an output unit 807 for obtaining and outputting a bit data value according to the result of the information bit detection.
The decoding device provided by the fourth embodiment of the application is insensitive to amplitude variation of the track signal based on time axis position estimation of the peak value and the valley value, and can effectively remove the influence of the amplitude on the algorithm without special treatment. The decoding device has clear structure and low complexity, can process in real time, has higher signal identification rate, is a more flexible digital decoding algorithm, and can solve various complex magnetic stripe card signal problems.
It should be noted that the same or similar parts in the embodiments of the present application may be mutually referred, and are not described in detail in the present application.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (8)

1. A method of decoding a magnetic stripe card, the method comprising:
detecting a magnetic stripe card signal to be decoded;
acquiring the time length between the peak point and the valley point of the magnetic stripe card signal;
comparing the time length with a reference time length, and detecting information bits;
according to the result of the information bit detection, obtaining a bit data value and outputting the bit data value;
wherein the obtaining a time length between a peak point and a valley point of the magnetic stripe card signal comprises:
when the value of the magnetic stripe card signal of the current bit information is a non-negative number and the valley absolute value corresponding to the current bit information is greater than beta times of the peak value, acquiring the time length from the peak value point to the valley value point of the previous bit information;
and when the value of the magnetic stripe card signal of the current bit information is a negative number and the peak value corresponding to the current bit information is more than beta times of the valley absolute value, acquiring the time length from the valley point to the peak point of the previous bit information.
2. The decoding method according to claim 1, further comprising, before said detecting a magnetic stripe card signal to be decoded:
monitoring background noise, and taking the energy of the initial background noise as reference energy;
and when the energy of the background noise is monitored to be increased to a preset multiple of the energy of the initial background noise, determining that the magnetic stripe card signal comes.
3. The decoding method according to claim 1 or 2, further comprising, before the detecting a magnetic stripe card signal to be decoded:
converting a current signal generated by the magnetic stripe card through a magnetic track into a voltage signal;
performing analog amplification on the voltage signal, and then performing AD sampling to obtain a magnetic track input signal;
and performing direct current removal processing on the magnetic track input signal to obtain the magnetic stripe card signal.
4. The decoding method according to claim 1, wherein the reference time length comprises: the reference time length of information bit 0 and the reference time length of information bit 1.
5. An apparatus for decoding a magnetic stripe card, the apparatus comprising:
the detection unit is used for detecting a magnetic stripe card signal to be decoded;
the acquisition unit is used for acquiring the time length between the peak value point and the valley value point of the magnetic stripe card signal;
a comparison unit for comparing the time length with a reference time length to perform information bit detection;
the output unit is used for obtaining and outputting a bit data value according to the result of the information bit detection;
wherein the acquisition unit includes:
the judging unit is used for judging whether the value of the magnetic stripe card signal of the current bit information is a non-negative number;
the first comparison unit is used for comparing whether the valley absolute value corresponding to the current bit information is larger than beta times of the peak value or not when the judgment unit determines that the value of the magnetic stripe card signal of the current bit information is a non-negative number;
a first sub-obtaining unit configured to obtain a time length from a peak point to a bottom point of previous bit information when a result of the first comparing unit is yes;
the second comparison unit is used for comparing whether the peak value corresponding to the current bit information is greater than beta times of the valley absolute value or not when the judgment unit determines that the value of the magnetic stripe card signal of the current bit information is a negative number;
and a second sub-obtaining unit, configured to obtain a time length from a valley point to a peak point of previous bit information when the result of the second comparing unit is yes.
6. The apparatus of claim 5, further comprising:
the monitoring unit is used for monitoring background noise and taking the energy of the initial background noise as reference energy;
and the starting monitoring unit is used for determining that the magnetic stripe card signal comes when the energy of the background noise is increased to a preset multiple of the energy of the initial background noise.
7. The apparatus of claim 5 or 6, further comprising:
the conversion unit is used for converting a current signal generated by the magnetic stripe card passing through the magnetic track into a voltage signal;
the sampling unit is used for carrying out analog amplification on the voltage signal and then carrying out AD sampling to obtain a magnetic track input signal;
and the direct current removing unit is used for performing direct current removing processing on the magnetic track input signal to obtain the magnetic stripe card signal.
8. The apparatus of claim 7, wherein the de-DC unit comprises a first order IIR digital filter.
CN201810478216.7A 2018-05-18 2018-05-18 Decoding method and device for magnetic stripe card Active CN108734036B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810478216.7A CN108734036B (en) 2018-05-18 2018-05-18 Decoding method and device for magnetic stripe card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810478216.7A CN108734036B (en) 2018-05-18 2018-05-18 Decoding method and device for magnetic stripe card

Publications (2)

Publication Number Publication Date
CN108734036A CN108734036A (en) 2018-11-02
CN108734036B true CN108734036B (en) 2021-05-11

Family

ID=63937639

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810478216.7A Active CN108734036B (en) 2018-05-18 2018-05-18 Decoding method and device for magnetic stripe card

Country Status (1)

Country Link
CN (1) CN108734036B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109902519B (en) * 2019-02-28 2023-01-17 苏州国芯科技股份有限公司 Magnetic stripe decoding method, system and related device
CN110633588B (en) * 2019-09-12 2022-11-22 兆讯恒达科技股份有限公司 Noise identification method for magnetic stripe card reader
CN110659528B (en) * 2019-09-12 2022-12-13 兆讯恒达科技股份有限公司 Anti-interference decoding method for magnetic stripe card reader
CN110647776B (en) * 2019-09-12 2023-03-14 兆讯恒达科技股份有限公司 Magnetic stripe card decoding method
CN110619247B (en) * 2019-09-12 2022-11-22 兆讯恒达科技股份有限公司 Method for improving decoding compatibility of magnetic stripe card reader
CN110688867B (en) * 2019-09-12 2022-11-22 兆讯恒达科技股份有限公司 Method for synchronizing information of magnetic stripe card reader

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202351956U (en) * 2011-11-02 2012-07-25 深圳市九思泰达技术有限公司 Magnetic strip card reader for mobile payment
CN105631380A (en) * 2015-12-22 2016-06-01 上海爱信诺航芯电子科技有限公司 Magnetic stripe card data decoding circuit and decoding method thereof
CN106682553A (en) * 2016-12-21 2017-05-17 福建升腾资讯有限公司 Strip-card software decoding method
CN106997443A (en) * 2017-01-09 2017-08-01 北京信息职业技术学院 Magnetic stripe card coding/decoding method and device
CN107066906A (en) * 2017-01-09 2017-08-18 北京信息职业技术学院 Magnetic stripe card coding/decoding method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202351956U (en) * 2011-11-02 2012-07-25 深圳市九思泰达技术有限公司 Magnetic strip card reader for mobile payment
CN105631380A (en) * 2015-12-22 2016-06-01 上海爱信诺航芯电子科技有限公司 Magnetic stripe card data decoding circuit and decoding method thereof
CN106682553A (en) * 2016-12-21 2017-05-17 福建升腾资讯有限公司 Strip-card software decoding method
CN106997443A (en) * 2017-01-09 2017-08-01 北京信息职业技术学院 Magnetic stripe card coding/decoding method and device
CN107066906A (en) * 2017-01-09 2017-08-18 北京信息职业技术学院 Magnetic stripe card coding/decoding method and device

Also Published As

Publication number Publication date
CN108734036A (en) 2018-11-02

Similar Documents

Publication Publication Date Title
CN108734036B (en) Decoding method and device for magnetic stripe card
US8744842B2 (en) Method and apparatus for detecting voice activity by using signal and noise power prediction values
US9977489B2 (en) Compressed sampling and memory
EP2531818B1 (en) Method and apparatus for noise reduction in measured data
US20150372805A1 (en) Asynchronous pulse modulation for threshold-based signal coding
CN106294331A (en) Audio information retrieval method and device
WO2012160062A1 (en) Transition detection method for automatic-setup non-intrusive appliance load monitoring
CN105046882A (en) Fall detection method and device
CN111291328B (en) Transient event identification method, system and equipment based on fine slope
EP3458973B1 (en) Apparatus for determining a similarity information, method for determining a similarity information, apparatus for determining an autocorrelation information, apparatus for determining a cross-correlation information and computer program
CN104054127A (en) Information Reproduction Device And Information Reproduction Method
CN112116927A (en) Real-time detection of speech activity in an audio signal
US9992045B2 (en) On-line signal event detection and identification method and apparatus
CN110688846B (en) Periodic word mining method, system, electronic equipment and readable storage medium
CN114499560A (en) Signal demodulation method, device, equipment and storage medium for radio communication
CN103617408A (en) Magnetic stripe card decoding circuit based on AD sampling
CN109597721B (en) Audio data acquisition method, device, equipment and storage medium
CN109938696A (en) Electroneurographic signal compressed sensing processing method and circuit
US6049478A (en) Digital magnetic read channel and method
JP2018109739A (en) Device and method for audio frame processing
JP4627650B2 (en) Radiation measuring instrument
JP5631170B2 (en) Rotational speed measuring device
Ye et al. An efficient FIR filtering technique for processing non-uniformly sampled signal
US8737627B2 (en) Electronic device and decoding method of audio data thereof
CN110554791A (en) Touch panel signal detection method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 518000 407-408, West building, Skyworth semiconductor design building, No. 18, gaoxinnan 4th Road, high tech Zone, Yuehai street, Nanshan District, Shenzhen City, Guangdong Province

Applicant after: Shenzhen Angrui Microelectronics Technology Co., Ltd

Address before: 303, tower a, Skyworth building, Science Park, Nanshan District, Shenzhen City, Guangdong Province

Applicant before: SHENZHEN ZHONGKE HANTIANXIA ELECTRONICS CO., LTD.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant