CN106997443B - Magnetic stripe card coding/decoding method and device - Google Patents

Magnetic stripe card coding/decoding method and device Download PDF

Info

Publication number
CN106997443B
CN106997443B CN201710012550.9A CN201710012550A CN106997443B CN 106997443 B CN106997443 B CN 106997443B CN 201710012550 A CN201710012550 A CN 201710012550A CN 106997443 B CN106997443 B CN 106997443B
Authority
CN
China
Prior art keywords
point
peak
positive
negative
interval
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
CN201710012550.9A
Other languages
Chinese (zh)
Other versions
CN106997443A (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.)
BEIJING INFORMATION TECHNOLOGY COLLEGE
Original Assignee
BEIJING INFORMATION TECHNOLOGY COLLEGE
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 BEIJING INFORMATION TECHNOLOGY COLLEGE filed Critical BEIJING INFORMATION TECHNOLOGY COLLEGE
Priority to CN201710012550.9A priority Critical patent/CN106997443B/en
Publication of CN106997443A publication Critical patent/CN106997443A/en
Application granted granted Critical
Publication of CN106997443B publication Critical patent/CN106997443B/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/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
    • G06K7/083Methods 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 inductive
    • G06K7/084Methods 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 inductive sensing magnetic material by relative movement detecting flux changes without altering its magnetised state

Abstract

The embodiment of the invention discloses a kind of magnetic stripe card coding/decoding method and devices.Method includes: step S1, the signal for obtaining the magnetic stripe card that magnetic head is read;Step S2, the signal waveform of the signal is analyzed, obtains the amplitude and waveform interval of two neighboring zero extreme point;Step S3, according to two neighboring zero extreme point amplitude and waveform interval obtain position window;Step S4, the signal is decoded according to the position window of acquisition.By analyzing signal waveform, the position window adaptively to estimate a window, and based on estimation is decoded the embodiment of the present invention, compared with the scheme for using identical bits window in the prior art, can effectively propose the estimated accuracy of high-window, and then improve and be decoded into power.

Description

Magnetic stripe card coding/decoding method and device
Technical field
The present embodiments relate to signal processing technology fields, and in particular to a kind of magnetic stripe card coding/decoding method and device.
Background technique
The application field of magnetic stripe card is very extensive, can make as bank card, member card, highway paying card etc..It A kind of actually manufactured tag card using magnetic material.So-called tag card is exactly that holder and publisher's letter is marked The card of breath.The front of magnetic stripe card by polyvinyl chloride, gather cruel film or extrusion coating paper is made, its reverse side is then one with magnetic stripe It is indicative to be generally printed on issuing bank's title, holder name, term of validity etc. by the front that magnetic card is made in magnetic material for face Information, reverse side be generally printed with issuing bank's Service Phone, cardholder signature item, ard issuers statement etc. information.
In general, the magnetic card used in banking system, the magnetic stripe of reverse side have 3 independent magnetic tracks, are respectively Magnetic track 1 (Track1), magnetic track 2 (Track2) and magnetic track 3 (Track3), the distribution of 3 magnetic tracks are as shown in Figure 1.According to different Application demand, some magnetic cards have only used two of them magnetic track, and current most of magnetic stripe cards have all only used 2,3 magnetic tracks.
Wherein, three magnetic tracks is of same size, is 2.80 millimeters or so, for recording the various data informations of user, About 0.05 millimeter of gap between two adjacent magnetic tracks, for distinguishing two adjacent magnetic tracks, therefore, magnetic stripe it is total Width is 10.29 millimeters or so (on condition that magnetic cards that 3 magnetic tracks all use) or is 6.35 millimeters or so (on condition that using 2 The magnetic card of a magnetic track).In real life, the width of magnetic stripe can all increase by 1~2 millimeter on bank magnetic stripe card used in us Left and right, the overall width of magnetic stripe is at 12~13 millimeters.
It in general, in the beginning and end of magnetic stripe card is made of several bits " 0 ", the number of bit " 0 " is big Mostly at more than ten or tens, these bits " 0 " are to be designed specifically to assist the decoded of magnetic stripe card, we play these The bit " 0 " of beginning amplifies, and such as Fig. 2 illustrates 8 bits " 0 " most started, and (person of swiping the card is at the uniform velocity preferably swiping the card under state Swipe the card, this is impossible in practice), each bit " 0 " duration of beginning and end be it is identical, Namely Fig. 2 indicate duration be T, also referred to as position window T, due to sample rate be it is fixed, each bit " 0 " The points that waveform is sampled are consistent, usually we in decoding algorithm, with each bit pattern by sampling number come table Show the duration T of each bit.In magnetic stripe card decoding algorithm, generally using these bit " 0 " Lai Jinhang for starting of swiping the card Position window T (duration of a bit, i.e., each bit pattern by sampling number) estimation, we are this process It is referred to as synchronous, only after synchronizing, the position window T of estimation is obtained, just can determine that the search for searching peak point in decoding process Window (search halt), also only accurately determines a window T, can accurately decode, therefore the synchronous solution for magnetic stripe card It is most important for code.
During realizing the embodiment of the present invention, inventor's discovery due at the beginning of magnetic stripe card is swiped the card, speed compared with Low, amplitude is smaller, and is easy to be interfered, therefore noise is relatively low, in addition, rate of swiping the card can change with gesture, leads The position window T of these bits " 0 " of the initial segment is caused constantly to change, these factor collective effects together, will lead to estimating When counting position window T, accuracy is affected, and directly influences decoded success rate.
Summary of the invention
One purpose of the embodiment of the present invention is to solve the prior art to carry out the decoded side of magnetic stripe card using identical bits window Case causes a window estimated accuracy low, and then causes to be decoded into the low problem of power.
The embodiment of the present invention proposes a kind of magnetic stripe card coding/decoding method, comprising:
Step S1, the signal for the magnetic stripe card that magnetic head is read is obtained;
Step S2, the signal waveform of the signal is analyzed, obtains the amplitude and wave of two neighboring zero extreme point Shape interval;
Step S3, according to two neighboring zero extreme point amplitude and waveform interval obtain position window;
Step S4, the signal is corresponded to according to the position window of acquisition to be decoded.
Optionally, the step S2 is specifically included:
The data origination that analysis obtains the signal is carried out to the signal waveform of the signal;
The first positive peak point, the first negative peak point, the second positive peak point, the are obtained according to the data origination of the signal The range value of 2 negative peak points, third positive peak point ..., N positive peak point, N negative peak point;
According to the first positive peak point, the first negative peak point, the second positive peak point, the second negative peak point, third posivtive spike The range value of value point ..., N positive peak point, N negative peak point, obtains the absolute value of each range value.
Optionally, the step S2 is specifically included:
According to the first positive peak point, the first negative peak point, the second positive peak point, the second negative peak point, third posivtive spike The position of value point ..., N positive peak point, N negative peak point obtains peak-to-valley value interval and paddy peak intervals;
The first positive peak mesial point corresponding with the first positive peak point is obtained according to the amplitude of the first positive peak point Position and the first negative peak mesial point position;
According to the first positive peak point amplitude and the amplitude of the first negative peak point obtain the second negative peak mesial point position and Second positive peak mesial point position;
The is obtained according to the first positive peak point amplitude, the amplitude of the first negative peak point and the second positive peak point amplitude Three positive peak mesial point positions and the negative peak mesial point position of third;And so on, obtain each positive peak mesial point position and minus half peak value The position of point;
Positive half value point interval is obtained according to the positive peak mesial point position;It is born according to the negative peak mesial point position Half value point interval.
Optionally, the step S2 is specifically included:
According to the first positive peak point, the first negative peak point, the second positive peak point, the second negative peak point, third posivtive spike The position of value point ..., N positive peak point, N negative peak point obtains peak-to-valley value interval and paddy peak intervals;
The first negative peak mesial point corresponding with the first negative peak point is obtained according to the amplitude of the first negative peak point Position and the first positive peak mesial point position;
According to the first negative peak point amplitude and the amplitude of the first positive peak point obtain the second negative peak mesial point position and Second positive peak mesial point position;According to the first negative peak point amplitude, the amplitude and the second negative peak point of the first positive peak point Amplitude obtain the positive peak mesial point position of third and the negative peak mesial point position of third ..., obtain the positive peak mesial point position N and The negative peak mesial point position N;
Positive half value point interval is obtained according to each positive peak mesial point position;Negative half value is obtained according to each negative peak mesial point position Point interval.
Optionally, before step S3, the method also includes:
Judge whether meet the first preset requirement criterion between the absolute value of positive and negative peak point amplitude obtained;
If so, judging the peak-to-valley value interval, the paddy peak intervals, the positive half value point interval and described negative half Whether value point interval meets the second preset requirement criterion;
If so, executing the step S3.
Optionally, the step S3 is specifically included:
The positive half value point interval according to the positive half value point interval and the negative half value point interval acquiring and described negative half The mean value at value point interval;
It obtains between the peak-to-valley value interval, the paddy peak intervals and the positive half value point interval and the negative half value point Every mean of mean;
The peak-to-valley value interval, the paddy peak intervals and the positive half value point interval and described negative half are obtained by described The mean of mean at value point interval is used as position window after being rounded.
The embodiment of the present invention provides a kind of magnetic stripe card decoding apparatus, comprising:
Module is obtained, the signal of the magnetic stripe card for obtaining magnetic head reading;
Analysis module is analyzed for the signal waveform to the signal, obtains the width of two neighboring zero extreme point Degree and waveform interval;
Processing module, for according to two neighboring zero extreme point amplitude and waveform interval obtain position window;
Decoder module corresponds to the signal for the position window according to acquisition and is decoded.
Optionally, the analysis module carries out analysis specifically for the signal waveform to the signal and obtains the signal Data origination;According to the data origination of the signal obtain the first positive peak point, the first negative peak point, the second positive peak point, Second negative peak point, third positive peak point ..., the range value for waiting N positive peak point, N negative peak point;According to described first Positive peak point, the first negative peak point, the second positive peak point, the second negative peak point, third positive peak point ..., N positive peak The range value of point, N negative peak point, obtains the absolute value of each range value.
Optionally, described device further include: judgment module;
Whether the judgment module meets first between the absolute value for judging positive and negative peak point amplitude obtained Preset requirement criterion;If so, judging the peak-to-valley value interval, the paddy peak intervals, the positive half value point interval and described Whether negative half value point interval meets the second preset requirement criterion;If so, the processing module is allowed to bring into operation.
Optionally, the processing module, specifically for being obtained according to the positive half value point interval and the negative half value point interval Take the mean value at the positive half value point interval and the negative half value point interval;Obtain the peak-to-valley value interval, the paddy peak intervals With the mean of mean at the positive half value point interval and the negative half value point interval;By it is described obtain the peak-to-valley value interval, Conduct after the paddy peak intervals and the mean of mean at the positive half value point interval and the negative half value point interval are rounded Position window.
As shown from the above technical solution, a kind of magnetic stripe card coding/decoding method and device that the embodiment of the present invention proposes by pair Signal waveform is analyzed, and the position window adaptively to estimate a window, and based on estimation is decoded, and is adopted in the prior art It is compared with the scheme of identical bits window, can effectively propose the estimated accuracy of high-window, and then improve and be decoded into power.
Detailed description of the invention
The features and advantages of the present invention will be more clearly understood by referring to the accompanying drawings, and attached drawing is schematically without answering It is interpreted as carrying out any restrictions to the present invention, in the accompanying drawings:
Fig. 1 shows the track profile figure of magnetic stripe card in the prior art;
Fig. 2 shows the position window T that the prior art is used when being decoded;
Fig. 3 shows a kind of flow diagram of magnetic stripe card coding/decoding method of one embodiment of the invention offer;
Fig. 4 is shown in a kind of magnetic stripe card coding/decoding method of one embodiment of the invention offer with positive value as the same of starting point Walk schematic diagram;
Fig. 5 shows a kind of structural schematic diagram of magnetic stripe card decoding apparatus of one embodiment of the invention offer;
Fig. 6 show another embodiment of the present invention provides a kind of magnetic stripe card decoding apparatus structural schematic diagram.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is A part of the embodiments of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill Personnel's every other embodiment obtained without making creative work belongs to the model that the present invention protects It encloses.
Fig. 3 shows a kind of flow diagram of magnetic stripe card coding/decoding method of one embodiment of the invention offer, referring to Fig. 3, This method can be completed by the processor in decoder, be specifically comprised the following steps:
Step S1, the signal for the magnetic stripe card that magnetic head is read is obtained;
Step S2, the signal waveform of the signal is analyzed, obtains the amplitude and wave of two neighboring zero extreme point Shape interval;
Understandable to be, positive peak point or negative peak point in signal waveform can be used as zero extreme point, wherein The amplitude of extreme point can be regarded as the peak value of peak point;
Step S3, according to two neighboring zero extreme point amplitude and waveform interval obtain position window;
Step S4, the signal is corresponded to according to the position window of acquisition to be decoded.
As it can be seen that the present embodiment is by analyzing signal waveform, adaptively to estimate a window, and based on estimation Position window is decoded, and compared with the scheme for using identical bits window in the prior art, can effectively propose the estimated accuracy of high-window, And then it improves and is decoded into power.
Referring to Fig. 3, the step S2 in the present embodiment is described in detail:
The data origination that analysis obtains the signal is carried out to the signal waveform of the signal;
The first positive peak point, the first negative peak point, the second positive peak point, the are obtained according to the data origination of the signal The range value of 2 negative peak points, third positive peak point ..., N positive peak point, N negative peak point;
According to the first positive peak point, the first negative peak point, the second positive peak point, the second negative peak point, third posivtive spike The range value of value point ..., N positive peak point, N negative peak point, obtains the absolute value of each range value.
Subsequent there are two types of processing methods, are illustrated respectively to two kinds of processing methods below:
First method includes: according to the first positive peak point, the first negative peak point, the second positive peak point, second negative Peak point, third positive peak point ..., N positive peak point, the position acquisition peak-to-valley value interval of N negative peak point and paddy peak value Interval;
The first positive peak mesial point corresponding with the first positive peak point is obtained according to the amplitude of the first positive peak point Position and the first negative peak mesial point position;
According to the first positive peak point amplitude and the amplitude of the first negative peak point obtain the second negative peak mesial point position and Second positive peak mesial point position;
The is obtained according to the first positive peak point amplitude, the amplitude of the first negative peak point and the second positive peak point amplitude Three positive peak mesial point positions and the negative peak mesial point position of third;And so on, obtain each positive peak mesial point position and minus half peak value The position of point;
Positive half value point interval is obtained according to the positive peak mesial point position;It is born according to the negative peak mesial point position Half value point interval.
Second method includes: according to the first positive peak point, the first negative peak point, the second positive peak point, second negative Peak point, third positive peak point ..., N positive peak point, the position acquisition peak-to-valley value interval of N negative peak point and paddy peak value Interval;
The first negative peak mesial point corresponding with the first negative peak point is obtained according to the amplitude of the first negative peak point Position and the first positive peak mesial point position;
According to the first negative peak point amplitude and the amplitude of the first positive peak point obtain the second negative peak mesial point position and Second positive peak mesial point position;According to the first negative peak point amplitude, the amplitude and the second negative peak point of the first positive peak point Amplitude obtain the positive peak mesial point position of third and the negative peak mesial point position of third ..., obtain the positive peak mesial point position N and The negative peak mesial point position N;
Positive half value point interval is obtained according to each positive peak mesial point position;Negative half value is obtained according to each negative peak mesial point position Point interval.
In the present embodiment, before step S3, the method also includes:
Judge whether meet the first preset requirement criterion between the absolute value of positive and negative peak point amplitude obtained;
If so, judging the peak-to-valley value interval, the paddy peak intervals, the positive half value point interval and described negative half Whether value point interval meets the second preset requirement criterion;
If so, executing the step S3, specific execution is as follows:
The positive half value point interval according to the positive half value point interval and the negative half value point interval acquiring and described negative half The mean value at value point interval;
It obtains between the peak-to-valley value interval, the paddy peak intervals and the positive half value point interval and the negative half value point Every mean of mean;
The peak-to-valley value interval, the paddy peak intervals and the positive half value point interval and described negative half are obtained by described The mean of mean at value point interval is used as position window after being rounded.
Fig. 4 is shown in a kind of magnetic stripe card coding/decoding method of one embodiment of the invention offer with positive value as the same of starting point Schematic diagram is walked, is described in detail referring to principle of the Fig. 4 to the above method:
Mentality of designing includes: to find out peak valley point and half-peak valley point position, and using between peak valley point by analyzing signal Every with the data such as half-peak valley point interval, identified according to multiple bits " 0 " signal of multiple constraint condition to starting point, Remove waveform means of chaotic signals and interference signal, find out effectively continuous bit " 0 " waveform, and calculate a window T (bit0's Sampling number), obtained position window T accuracy is high, so that synchronous success rate is substantially improved.
It should be noted that following assume that the signal that detects is positive value, if it is negative value, then signal waveform and Fig. 4 institute Reverse phase is shown in the signal waveform drawn in Fig. 4, by taking the signal detected is positive value as an example to illustrate to the signal waveform shown up and down This synchronous method.In synchronizing process, half peak value is defined as the half of peak value.
The estimation of position window is completed by following steps:
(1) from the signal location point being detected, (the S point position) in Fig. 4 starts to search for the 1st posivtive spike first (maximum value and maximum value position searched using variable record, is recorded value point if the current amplitude value of search drops to Maximum value half when, that is, the B1 point in Fig. 4 confirms that recorded maximum value is exactly positive peak point, this maximum value Position is exactly first positive peak point position), while recording peak mesial point position, i.e. B1 point position, continuation is searched for forward, when When reaching first negative peak mesial point (B1 point range value is taken negative value, is judged using the value, to search C1 point position), The position is recorded, continuation is searched for forward, and find the 1st negative peak point position D1 (can be carried out by the method for similar search maximum value Search), and the peak value and position are recorded, continuation is searched for forward, and the 2nd negative peak mesial point (range value and C1 amplitude is found It is worth identical) the positive peak mesial point of position E1 and the 2nd (range value is identical as B1 range value) position F1, continues to search for the 2nd forward Positive peak point (determine the position when by judging that signal amplitude drops to current maximum half, current maximum mean by Negative value becomes positive value later to the maximum value of the sampled point between current search point) position A2, and record the position and amplitude Value.
It searches here, it may be determined that whether signal waveform can satisfy the requirement it needs to be determined that position window T, this passes through inspection The symmetry of waveform is realized.It is specific as follows:
These bit " 0 " further progresss of the initial segment of swiping the card are distinguished, by A1 point, be F2F through B1, C1 to D1 One positive zero of waveform;By D1 point, through one anti-zero that E1, F1 to A2 are F2F waveform.This algorithm is adjacent to the two Positive zero and anti-zero symmetry checked, if the two is all satisfied certain condition, then it is assumed that synchronize and pass through, and calculate Position window T out.
In order to confirm this two neighboring opposite polarity zero symmetry, algorithm is carried out using following condition 1 and condition 2 It checks:
Whether the amplitude of the extreme point of condition 1, two neighboring zero meets the specified requirement (width of two neighboring zero extreme point The absolute value of the difference of degree is less than 0.4 times of amplitude the greater in the two);
Whether the waveform interval of condition 2, two neighboring zero meets specified requirement (the peak-to-valley value interval of calculatingPaddy peak intervals Positive half value point intervalWith negative half value point intervalMean value, San Zhezhong The difference of maxima and minima be less than 0.15 times of whole average values).
If meeting conditions above, signal waveform can satisfy the requirement of true location window T, by peak-to-valley value intervalPaddy peak intervals Positive half value point intervalWith negative half value point intervalMean value, three makes even Simultaneously round numbers must window T, this value be actually in place sampling number to mean value, jump to (4) step.1) and 2) if be unsatisfactory for Condition, carry out (2) step.
(2) continue to search for, search for the length of bit " 0 " waveform, obtain positive peak mesial point, negative peak mesial point (positive peak mesial point B2, negative peak mesial point C2 and the 2nd negative peak point D2, negative peak point in such as Fig. 4 can lead to negative peak point Cross and determine the position when judgement signal amplitude rises to current minimum value half, current minimum value be from positive value become negative value it The minimum value of the sampling point value between current search point is arrived afterwards), then using following condition 3) and condition 4) come to adjacent two A opposite polarity zero symmetry is checked:
Whether the amplitude of two neighboring zero extreme point meets the specified requirement (difference of the amplitude of two neighboring zero extreme point Absolute value be less than in the two 0.4 times of amplitude the greater);
Whether two neighboring zero waveform interval meets specified requirement (the paddy peak intervals of calculatingPeak-to-valley value intervalPositive half value point intervalWith negative half value point interval Mean value, positive half value point intervalWith positive half value point intervalBetween mean value, negative half value point Every With negative half value point intervalMean value, in five most The difference of big value and minimum value is less than 0.15 times of whole average values).
If meeting conditions above, signal waveform can satisfy the requirement we determined that position window T, by paddy peak intervalsPeak-to-valley value interval Positive half value point intervalWith negative half value point intervalBetween mean value, positive half value point Every (With positive half value point intervalBetween mean value, negative half value point EveryWith negative half value point intervalMean value, five make even Mean value and round numbers must window T in place, jump to (4) step.If being unsatisfactory for 3) carrying out (3) step with condition 4).
(3) continue to search for, search for the length of bit " 0 " waveform, obtain negative peak mesial point, positive peak mesial point With the 3rd positive peak point (as shown in negative peak mesial point E2, the positive peak mesial point F2 and the 3rd positive peak point A3 in Fig. 4), it is searched for It carries out condition judgement 3) and 4) again afterwards, if passed through, a window T is calculated, jumps to (4) step, if do not passed through, repeat Step (2).
(4) synchronized algorithm terminates, output bit window T, i.e., the sampling number of one bit " 0 " waveform.
The synchronized algorithm realized by above four steps realizes the estimation of position window T, and by result and present sample point Confidence breath output is to next functional module.Timing mechanism is additionally added in certain synchronization module, is exited if time-out The corresponding synchronization module of method, and reporting system synchronization failure are stated, in order to avoid condition 3) and 4) be unsatisfactory for always causing to crash.
In synchronizing process, half peak value can with previous peaks or valley be changed, can also be always maintained at solid Which kind of scheme is definite value take actually, can carry out compromise consideration according to performance and complexity, and be adjusted to respective algorithms.
Fig. 5 shows a kind of structural schematic diagram of magnetic stripe card decoding apparatus of one embodiment of the invention offer, referring to Fig. 5, The device include: obtain module 510, analysis module 520, processing module 530 and decoder module 540, wherein;
Module 510 is obtained, the signal of the magnetic stripe card for obtaining magnetic head reading;
Analysis module 520 is analyzed for the signal waveform to the signal, obtains two neighboring zero extreme point Amplitude and waveform interval;
Processing module 530, for according to two neighboring zero extreme point amplitude and waveform interval obtain position window;
Decoder module 540 corresponds to the signal for the position window according to acquisition and is decoded.
It should be noted that obtaining module 510 when user applies magnetic stripe card and passing through the letter on head read magnetic stripe card Number, and analysis module 520 is transmitted the signal to, it is analyzed, is obtained by signal waveform of the analysis module 520 to the signal The amplitude and waveform interval of two neighboring zero extreme point, and the amplitude and waveform interval that will acquire are sent to processing module 530, by processing module 530 according to two neighboring zero extreme point amplitude and waveform interval obtain position window, processing module 530 The position window obtained will be calculated and be sent to decoder module 540, so by decoder module according to the position window of acquisition correspond to the signal into Row decoding.
As it can be seen that the present embodiment is by analyzing signal waveform, adaptively to estimate a window, and based on estimation Position window is decoded, and compared with the scheme for using identical bits window in the prior art, can effectively propose the estimated accuracy of high-window, And then it improves and is decoded into power.
The corresponding module in the present embodiment is described in detail below:
Analysis module 520 carries out the data that analysis obtains the signal specifically for the signal waveform to the signal Point;The first positive peak point, the first negative peak point, the second positive peak point, the second negative peak are obtained according to the data origination of the signal It is worth the range value of point, third positive peak point ..., N positive peak point, N negative peak point;According to the first positive peak point, First negative peak point, the second positive peak point, the second negative peak point, third positive peak point ..., N positive peak point, N negative peak It is worth the range value of point, obtains the absolute value of each range value.
The processing module 530, specifically for being taken absolute value according to the range value of the positive peak point and negative peak point; The positive half value point interval and the negative half value point interval are obtained according to the positive half value point interval and the negative half value point interval Mean value;Obtain peak-to-valley value point interval, paddy peak point interval and the positive half value point interval and the negative half value point The average value at interval;The peak-to-valley value interval, the paddy peak intervals and the positive half value point interval and institute are obtained by described Position window is used as after stating the mean of mean rounding at negative half value point interval.
Fig. 6 show another embodiment of the present invention provides a kind of magnetic stripe card decoding apparatus structural schematic diagram, referring to figure 6, on the basis of Fig. 5 corresponding embodiment included feature, the present embodiment further include: judgment module 640;
The judgment module 640, for judging it is pre- whether the absolute value of amplitude of the positive and negative peak point meets first If it is required that criterion;If so, judging the peak-to-valley value interval, the paddy peak intervals, the positive half value point interval and described negative Whether half value point interval meets the second preset requirement criterion;If so, the processing module 650 is allowed to bring into operation;If it is not, Processing module 650 is not allowed then to carry out relevant treatment.
For above-described embodiment, for method implementation, for simple description, therefore, it is stated as a series of Combination of actions, but those skilled in the art should understand that, embodiment of the present invention is not by the limit of described sequence of movement System, because of embodiment according to the present invention, some steps may be performed in other sequences or simultaneously.Secondly, this field skill Art personnel also should be aware of, and embodiment described in this description belongs to preferred embodiment, and related movement is simultaneously It is not necessarily necessary to embodiment of the present invention.
For device embodiments, since it is substantially similar to method implementation, so the comparison of description is simple Single, related place illustrates referring to the part of method implementation.
It should be noted that in all parts of the device of the invention, according to the function that it to be realized to therein Component has carried out logical partitioning, and still, the present invention is not only restricted to this, can according to need and repartitions to all parts Or combination.
All parts embodiment of the invention can be implemented in hardware, or on one or more processors The software module of operation is realized, or is implemented in a combination thereof.In the present apparatus, PC by realize internet to equipment or The step of device remotely controls, and accurately controls equipment or device each operation.The present invention is also implemented as executing Some or all device or device programs of method as described herein are (for example, computer program and computer Program product).Program of the invention, which is achieved, can store on a computer-readable medium, and the file that program generates Or document has statistics available property, generates data report and cpk report etc., and batch testing can be carried out to function and is counted.It should infuse Meaning is that illustrate the present invention rather than limit it for above embodiment, and those skilled in the art It can be designed replacement embodiment without departing from the scope of the appended claims.In the claims, it should not incite somebody to action Any reference symbol between parentheses is configured to limitations on claims.Word "comprising", which does not exclude the presence of, not to be listed in Element or step in claim.Word "a" or "an" located in front of the element does not exclude the presence of multiple such members Part.The present invention can be by means of including the hardware of several different elements and being come by means of properly programmed computer real It is existing.In the unit claims listing several devices, several in these devices can be through the same hardware branch To embody.The use of word first, second, and third does not indicate any sequence.These words can be explained and be run after fame Claim.
Although the embodiments of the invention are described in conjunction with the attached drawings, but those skilled in the art can not depart from this Various modifications and variations are made in the case where the spirit and scope of invention, such modifications and variations are each fallen within by appended right It is required that within limited range.

Claims (8)

1. a kind of magnetic stripe card coding/decoding method characterized by comprising
Step S1, the signal for the magnetic stripe card that magnetic head is read is obtained;
Step S2, the signal waveform of the signal is analyzed, between the amplitude and waveform that obtain two neighboring zero extreme point Every;
Step S3, according to two neighboring zero extreme point amplitude and waveform interval obtain position window;
Step S4, the signal is decoded according to the position window of acquisition;
The step S2 is specifically included:
The data origination that analysis obtains the signal is carried out to the signal waveform of the signal;
The first positive peak point, the first negative peak point, the second positive peak point, the second negative peak are obtained according to the data origination of the signal It is worth the range value of point, third positive peak point ..., N positive peak point, N negative peak point;
According to the first positive peak point, the first negative peak point, the second positive peak point, the second negative peak point, third positive peak The range value of point ..., N positive peak point, N negative peak point, obtains the absolute value of each range value;
According to the first positive peak point, the first negative peak point, the second positive peak point, the second negative peak point, third positive peak The position of point ..., N positive peak point, N negative peak point obtains peak-to-valley value interval and paddy peak intervals;
The first positive peak mesial point position corresponding with the first positive peak point is obtained according to the amplitude of the first positive peak point With the first negative peak mesial point position;
The second negative peak mesial point position and second is obtained according to the first positive peak point amplitude and the amplitude of the first negative peak point Positive peak mesial point position;According to the first positive peak point amplitude, the amplitude of the first negative peak point and the second positive peak point amplitude Obtain the positive peak mesial point position of third and the negative peak mesial point position of third;And so on, it obtains each positive peak mesial point position and bears Peak mesial point position;
Positive half value point interval is obtained according to the positive peak mesial point position;Negative half value point is obtained according to the negative peak mesial point position Interval.
2. the method according to claim 1, wherein the step S2 is specifically included:
According to the first positive peak point, the first negative peak point, the second positive peak point, the second negative peak point, third positive peak The position of point ..., N positive peak point, N negative peak point obtains peak-to-valley value interval and paddy peak intervals;
The first negative peak mesial point position corresponding with the first negative peak point is obtained according to the amplitude of the first negative peak point With the first positive peak mesial point position;
The second negative peak mesial point position and second is obtained according to the first negative peak point amplitude and the amplitude of the first positive peak point Positive peak mesial point position;According to the first negative peak point amplitude, the amplitude of the first positive peak point and the width of the second negative peak point Degree obtains the positive peak mesial point position of third and the negative peak mesial point position of third ..., the positive peak mesial point position acquisition N and N is negative Peak mesial point position;
Positive half value point interval is obtained according to each positive peak mesial point position;According between the negative half value point of each negative peak mesial point position acquisition Every.
3. method according to claim 1 or 2, which is characterized in that before step S3, the method also includes:
Judge whether meet the first preset requirement criterion between the absolute value of positive and negative peak point amplitude obtained;
If so, judging between the peak-to-valley value interval, the paddy peak intervals, the positive half value point interval and the negative half value point Every whether meeting the second preset requirement criterion;
If so, the step S3 is executed,
The first preset requirement criterion refers to: the absolute value of the difference of the amplitude of two neighboring zero extreme point is less than amplitude in the two 0.4 times of the greater, the second preset requirement criterion refer to: calculating peak-to-valley value interval, paddy peak intervals, positive half value point interval With the mean value at negative half value point interval, the difference of the maxima and minima in three is less than 0.15 times of three's average value.
4. according to the method described in claim 3, it is characterized in that, the step S3 is specifically included:
Positive half value point interval and the negative half value point according to the positive half value point interval and the negative half value point interval acquiring The mean value at interval;
Obtain the equal of the peak-to-valley value interval, the paddy peak intervals and the positive half value point interval and the negative half value point interval The average value of value;
It will be between the acquisition peak-to-valley value interval, the paddy peak intervals and the positive half value point interval and the negative half value point Every mean of mean be rounded after be used as position window.
5. a kind of magnetic stripe card decoding apparatus characterized by comprising
Module is obtained, the signal of the magnetic stripe card for obtaining magnetic head reading;
Analysis module is analyzed for the signal waveform to the signal, obtain two neighboring zero extreme point amplitude and Waveform interval;
Processing module, for according to two neighboring zero extreme point amplitude and waveform interval obtain position window;
Decoder module corresponds to the signal for the position window according to acquisition and is decoded;
The analysis module carries out the data origination that analysis obtains the signal specifically for the signal waveform to the signal; The first positive peak point, the first negative peak point, the second positive peak point, the second negative peak are obtained according to the data origination of the signal The range value of point, third positive peak point ..., N positive peak point, N negative peak point;According to the first positive peak point, first Negative peak point, the second positive peak point, the second negative peak point, third positive peak point ..., N positive peak point, N negative peak point Range value obtains the absolute value of each range value;According to the first positive peak point, the first negative peak point, the second positive peak point, Second negative peak point, third positive peak point ..., N positive peak point, the position acquisition peak-to-valley value interval of N negative peak point and paddy Peak intervals;
The first positive peak mesial point position corresponding with the first positive peak point is obtained according to the amplitude of the first positive peak point With the first negative peak mesial point position;
The second negative peak mesial point position and second is obtained according to the first positive peak point amplitude and the amplitude of the first negative peak point Positive peak mesial point position;According to the first positive peak point amplitude, the amplitude of the first negative peak point and the second positive peak point amplitude Obtain the positive peak mesial point position of third and the negative peak mesial point position of third;And so on, it obtains each positive peak mesial point position and bears Peak mesial point position;
Positive half value point interval is obtained according to the positive peak mesial point position;Negative half value point is obtained according to the negative peak mesial point position Interval.
6. device according to claim 5, the analysis module according to the first positive peak point, the first negative peak point, The position acquisition of second positive peak point, the second negative peak point, third positive peak point ..., N positive peak point, N negative peak point Peak-to-valley value interval and paddy peak intervals;It is obtained according to the amplitude of the first negative peak point corresponding with the first negative peak point First negative peak mesial point position and the first positive peak mesial point position;
The second negative peak mesial point position and second is obtained according to the first negative peak point amplitude and the amplitude of the first positive peak point Positive peak mesial point position;According to the first negative peak point amplitude, the amplitude of the first positive peak point and the width of the second negative peak point Degree obtains the positive peak mesial point position of third and the negative peak mesial point position of third ..., the positive peak mesial point position acquisition N and N is negative Peak mesial point position;
Positive half value point interval is obtained according to each positive peak mesial point position;According between the negative half value point of each negative peak mesial point position acquisition Every.
7. device according to claim 6, which is characterized in that described device further include: judgment module;
Whether the judgment module it is default meet first between the absolute value for judging positive and negative peak point amplitude obtained It is required that criterion;If so, judging the peak-to-valley value interval, the paddy peak intervals, the positive half value point interval and described negative half Whether value point interval meets the second preset requirement criterion;If so, the processing module is allowed to bring into operation,
Wherein, the first preset requirement criterion refers to: both the absolute value of the difference of the amplitude of two neighboring zero extreme point is less than 0.4 times of middle amplitude the greater, the second preset requirement criterion refer to;Calculate peak-to-valley value interval, paddy peak intervals, positive half value Point is spaced the mean value with negative half value point interval, and the difference of the maxima and minima in three is less than 0.15 times of three's average value.
8. device according to claim 7, which is characterized in that the processing module is specifically used for according to the positive half value The mean value at positive half value point interval and the negative half value point interval described in point interval and the negative half value point interval acquiring;Described in acquisition Peak-to-valley value interval, the paddy peak intervals and the positive half value point interval and the negative half value point interval mean of mean; By the peak-to-valley value interval, the paddy peak intervals and the positive half value point interval and the negative half value point interval of obtaining Mean of mean is used as position window after being rounded.
CN201710012550.9A 2017-01-09 2017-01-09 Magnetic stripe card coding/decoding method and device Active CN106997443B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710012550.9A CN106997443B (en) 2017-01-09 2017-01-09 Magnetic stripe card coding/decoding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710012550.9A CN106997443B (en) 2017-01-09 2017-01-09 Magnetic stripe card coding/decoding method and device

Publications (2)

Publication Number Publication Date
CN106997443A CN106997443A (en) 2017-08-01
CN106997443B true CN106997443B (en) 2019-08-23

Family

ID=59431257

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710012550.9A Active CN106997443B (en) 2017-01-09 2017-01-09 Magnetic stripe card coding/decoding method and device

Country Status (1)

Country Link
CN (1) CN106997443B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108734036B (en) * 2018-05-18 2021-05-11 深圳昂瑞微电子技术有限公司 Decoding method and device for magnetic stripe card
CN110688867B (en) * 2019-09-12 2022-11-22 兆讯恒达科技股份有限公司 Method for synchronizing information of magnetic stripe card reader
CN117214675B (en) * 2023-11-08 2024-01-30 无锡力芯微电子股份有限公司 Test method and test circuit for magnetic stripe card information reading integrated circuit

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1041556B1 (en) * 1999-03-30 2008-01-09 Nidec Sankyo Corporation Data demodulating method and apparatus for magnetic cards.
CN102324012B (en) * 2011-08-26 2014-03-12 深圳盒子支付信息技术有限公司 Magnetic card data reading method, apparatus thereof and mobile POS machine
CN102722686B (en) * 2012-05-25 2014-10-08 福建联迪商用设备有限公司 Magnetic card decoding method
US8985449B2 (en) * 2012-09-11 2015-03-24 Maxim Integrated Products, Inc. Magnetic stripe reader

Also Published As

Publication number Publication date
CN106997443A (en) 2017-08-01

Similar Documents

Publication Publication Date Title
CN106997443B (en) Magnetic stripe card coding/decoding method and device
Ji et al. Full-duplex strategy for video object segmentation
US6476743B1 (en) Magnetic stripe reader
CN103679104B (en) Magnetic strip reader
Yang et al. Background-click supervision for temporal action localization
CN107095669B (en) A kind of processing method and system of epileptic's EEG signals
US20210267551A1 (en) Noise detection method and apparatus
EP2833325A1 (en) Apparatus and method for resource-adaptive object detection and tracking
CN105844612A (en) Device and method for analyzing biophysiological periodic data
EP1887520A1 (en) Image processing device and object region tracking program
CN104932011B (en) A kind of method and device for picking up seismic first breaks
US10454728B2 (en) Baud rate modulating magnetic stripe data transmitter, system, and method
CN108512552A (en) A kind of the decoding system and coding/decoding method of Manchester code
CN102368076B (en) Card feeding speed testing method and device
CN109032352A (en) Hand signal treating method and apparatus
CN107066906B (en) Magnetic stripe card decoding method and device
CN108460322A (en) A kind of stroke recognition methods and application
KR100954581B1 (en) Method and apparatus for filtering tag data in RFID system, and RFID system and recording medium using thereof
Raut et al. Video summarization approaches in wireless capsule endoscopy: a review
CN108965903A (en) A kind of method and device in the optional network specific digit region for identifying live video
US6049478A (en) Digital magnetic read channel and method
CN114299676B (en) Method for improving correct identification and swiping of POS terminal magnetic card
CN115661919B (en) Repeated action period statistics method and device, body-building equipment and storage medium
CN108304739B (en) POS terminal mobile machine detection method and POS terminal mobile machine detection system
CN109344743B (en) Method for realizing monitoring video data processing

Legal Events

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