Summary of the invention
Goal of the invention: the objective of the invention is to deficiency to prior art; A kind of method and device that transmits consumption certificate realization mobile phone as seen through sound signal is provided; The consumer holds mobile phone to the transaction service system request, obtains unique consumption certificate number, sends sound signal by mobile phone through loudspeaker; The recording of the office terminal of trade company also parses consumption certificate number, accomplishes as seen then; On the basis of the physique that does not change mobile phone, office terminal, utilize loudspeaker and microphone on mobile phone, the office terminal to realize that sound signal transmits consumption certificate number, realize convenient and reliable as seen.Specifically pass through.
Technical scheme: the method through sound signal transmission consumption certificate number realization as seen of the present invention comprises the steps:
(1) consumer's client unit is sent the request of obtaining consumption certificate number through network to the transactional services unit of transactional services side;
(2) the transactional services unit generation of transactional services side, the storage unique consumption certificate corresponding with the consumer number replies to consumer's client unit;
(3) consumer's client unit is encrypted the consumption certificate of replying the transactional services unit number; And according to the consumption certificate information generation sound signal and the broadcast of encrypting;
(4) trade company imports trade company's client unit with Transaction Information, and sound signal is also resolved in the recording of trade company client unit, if resolve failure, then records again and resolves sound signal; Resolve and successfully then get into next step;
(5) trade company's client unit obtains consumption certificate number to the sound signal deciphering of resolving, and sends the transaction data that comprises Transaction Information, trade company's number of the account and consumption certificate number, request beginning transaction processing through network to the transactional services unit;
(6) transaction data of the transactional services unit of transactional services side storage consumption certificate correspondence, and through the consumer client unit transmission transaction data of network to the consumption certificate correspondence;
(7) after consumer's client unit receives transaction data, stop the broadcast of sound signal, and the transaction data content is shown to the consumer, require the consumer to confirm transaction data;
(8) after the consumer confirmed transaction data, consumer's client unit was accomplished transaction processing through network to the transactional services unit requests;
(9) the transactional services unit carries out transaction processing, and the transaction processing result is replied to consumer's client unit; If the transaction processing success, consumer's client unit is pointed out Transaction Success to the consumer;
(10) trade company's client unit is inquired about the transaction processing state through network to the transactional services unit; If it is successful for that trade company's client unit inquires the transaction processing state, then to trade company's client unit prompting Transaction Success.
In order further to guarantee the reliability of signal transmission; In the inventive method; Consumer's client unit is according to trade company's client unit recording and parsing sound signal in the consumption certificate information generation sound signal of encrypting and broadcast and the step (4) in the step (3), and the audio signal transmission method that relates to has the method for two kinds of comparative optimizations.
Wherein first kind of audio signal transmission method comprises the steps:
(11) at first need the proof test value of transmission data, after need transmission data, add proof test value and end mark, the composition partial data through digital coding unit calculatings in consumer's client unit;
(12) again through the partial data of the digital coding unit in consumer's client unit to obtaining in the step (11), the contrast coding rule is transformed on the corresponding frequency of sound wave, forms continuous multifrequency information of acoustic wave according to the sending duration of single frequency;
(13) the multifrequency sound wave transmitting element control sound-producing device through consumer's client unit sends acoustic signals continuously according to the multifrequency information of acoustic wave, and constantly circulation, receives transaction data or arrives time-out time until consumer's client unit;
(14) through the multifrequency sound wave receiving element of trade company's client unit, the acoustic signals that control listening device short distance reception sound-producing device sends reaches length requirement until the audio-frequency information that receives, and preserves the complete audio-frequency information that receives, and sets period
iInitial value be 0;
(15) the data decode unit through trade company's client unit calculates parsing to the complete audio-frequency information of preserving; Contrast and the identical coding rule of step (12); The time slice that complete audio-frequency information is divided into respective number by single frequency duration length; Calculate the range value of each frequency in each time slice line ordering of going forward side by side; Wherein the maximum frequency of range value is the first choice frequency in this time slice, and other frequencies are the alternative frequency in this time slice, all frequency of sound wave are transformed on the relevant numerical again;
(16) first choice frequency value corresponding in each time slice is formed one group of partial data, carry out verification, judge whether success of verification, if judged result is for being then to accomplish the data transmission of multifrequency sound wave;
(17) if the judged result in the step (16) is not; Then replace the first choice frequency value corresponding with alternative frequency value corresponding in each time slice according to the descending order of range value; Form one group of partial data, carry out verification, judge whether verification is successful; If judged result is for being then to accomplish the data transmission of multifrequency sound wave;
(18) if the judged result in the step (17) for not, is then judged period
i=
nWhether set up, if judged result is for being, the data transmission fails of multifrequency sound wave then, wherein,
nFor greater than 1 natural number;
(19) if the judged result in the step (18) for not, then squints the reference position of the complete audio-frequency information that receives in the step (14) backward and preserves after the shift time length again,
i=
i+ 1; Return step (15), said shift time length is 1/ of single frequency duration length
n
Second kind of audio signal transmission method comprises the steps:
(21) at first calculate the proof test value that needs the transmission data through the data generating unit in consumer's client unit, giving needs the transmission data to add verification beginning flag and proof test value, forms partial data;
(22) again through the partial data of dual-tone multifrequency information coding unit in consumer's client unit to obtaining in the step (21); The contrast coding rule; Be transformed on the corresponding dual-tone multifrequency superposed signal, form continuous dual-tone multifrequency superposed signal information based on sending duration;
(23) send acoustic signals through the control of the dual-tone multifrequency sound wave transmitting element in consumer's client unit sound-producing device continuously according to dual-tone multifrequency superposed signal information, and constantly circulation, until receiving transaction data or arriving time-out time;
(24) the dual-tone multifrequency sound wave receiving element through trade company's client unit; The acoustic signals that control listening device short distance reception sound-producing device sends; Audio-frequency information until receiving reaches length requirement, preserves the complete audio-frequency information that receives, and sets period
iInitial value be 0;
(25) the dual-tone multifrequency information decoding unit through trade company's client unit calculates parsing to the complete audio-frequency information of preserving; Contrast and the identical coding rule of step (22); The time slice that complete audio-frequency information is divided into respective number by sending duration length; According to the amplitude size sequence, choosing two frequencies in each time slice and resolving by its dual-tone multifrequency superposed signal that constitutes is respective value, forms one group of partial data; Data verification units through trade company's client unit is carried out verification to this partial data, judges whether success of verification, if judged result is for being then to accomplish the data transmission of dual-tone multifrequency sound wave;
(26) if the judged result in the step (25) for not, is then judged period
i=
nWhether set up, if judged result is for being, the data transmission fails of multifrequency sound wave then, wherein,
nFor greater than 1 natural number;
(27) if the judged result in the step (26) for not, then squints the reference position of the complete audio-frequency information that receives in the step (24) backward and preserves after the shift time length again,
i=
i+ 1; Return step (25), said shift time length is 1/ of sending duration length
n
Preferably, the Transaction Information in this method comprises trade name, dealing money, discount rate, commodity amount and other explanations; In the said step (3), the method for encrypting consumption certificate number is symmetric cryptography method or asymmetric encryption method.
Device of the present invention comprises consumer's client unit, transactional services unit and trade company's client unit.Said consumer's client unit is installed on the mobile phone that the consumer holds, and is used for: at first, send the request of obtaining consumption certificate number to the transactional services unit through network; Secondly, encrypt the consumption certificate of replying the transactional services unit number, generate sound signal and play according to the consumption certificate information of encrypting; Once more, receive that the transactional services unit sends with number corresponding transaction data of consumption certificate after, stop the broadcast of sound signal, the transaction data content is shown to the consumer, require the consumer to confirm transaction data; At last, after the consumer confirms, carry out transaction processing to the transactional services unit requests, and receive the transaction processing result that the transactional services unit sends through network.Said transactional services unit is installed in the transaction service system of transactional services side, is used for: at first, for consumer's client unit generates the unique consumption certificate corresponding with the consumer number, reply to consumer's client unit; Secondly, the transaction data that comprises Transaction Information, trade company's number of the account and consumption certificate number that receives that trade company's client sends, and send transaction data to consumer's client unit of consumption certificate correspondence through network; Once more, carry out transaction processing, and return the transaction processing result and give consumer's client unit and trade company's client unit according to the request of consumer's client unit.Said trade company client unit is installed on the office terminal of trade company, is used for: at first, let trade company import Transaction Information; Secondly, sound signal is also resolved in recording, and the sound signal deciphering of resolving is obtained consumption certificate number; Once more, send the transaction data comprise Transaction Information, trade company's number of the account and consumption certificate number through network to the transactional services unit, request begins transaction; At last, inquire about stateful transaction through network to the transactional services unit.
In order to realize above-mentioned first kind of audio signal transmission method, said consumer's client unit further comprises digital coding unit and multifrequency sound wave transmitting element, and said trade company client unit comprises data decode unit and multifrequency sound wave receiving element.
Said digital coding unit; At first calculate the proof test value that needs the transmission data; After need transmission data, add proof test value and end mark, form partial data, each numerical value with partial data is transformed on the corresponding frequency of sound wave again; Sending duration according to single frequency is formed continuous multifrequency information of acoustic wave, realizes the corresponding conversion of data and multifrequency acoustic signals.Said multifrequency sound wave transmitting element, the control sound-producing device sends acoustic signals continuously by the multifrequency information of acoustic wave that the digital coding cell translation obtains.Said multifrequency sound wave receiving element, the control listening device receives the acoustic signals that sound-producing device sends, and preserves data.Code check is separated with the data that multifrequency sound wave receiving element is preserved in said data decode unit.
In order to realize above-mentioned second kind of audio signal transmission method; Said consumer's client unit further comprises data generating unit, dual-tone multifrequency information coding unit and dual-tone multifrequency sound wave transmitting element, and said trade company client unit comprises dual-tone multifrequency sound wave receiving element, dual-tone multifrequency information decoding unit and data verification units.
Said data generating unit is calculated the proof test value that needs the transmission data, and giving needs the transmission data to add verification beginning flag and proof test value, forms partial data.Said dual-tone multifrequency information coding unit; Each numerical value of the partial data that data generating unit is generated is transformed on the corresponding dual-tone multifrequency superposed signal; Form continuous dual-tone multifrequency superposed signal information according to sending duration, realize the corresponding conversion of data and dual-tone multifrequency acoustic signals.Said dual-tone multifrequency sound wave transmitting element, the control sound-producing device sends acoustic signals continuously by the dual-tone multifrequency superposed signal information that dual-tone multifrequency information coding unit is converted to.Said dual-tone multifrequency sound wave receiving element, the control listening device receives the acoustic signals that sound-producing device sends, and preservation information.Said dual-tone multifrequency information decoding unit calculates the information that dual-tone multifrequency sound wave receiving element is preserved, decode.Said data verification units is carried out verification to decoded data.
Beneficial effect: 1, the present invention is applied in and carries out the as seen aspect between mobile phone and the office terminal, uses the loudspeaker and the microphone of mobile phone, office terminal, and the support of mobile phone and office terminal is in extensive range, and is with low cost; 2, the present invention is not changing under the physique situation of mobile phone, office terminal, transmits consumption certificate number through sound signal, and it is intuitively convenient to use, and realizes convenient and reliable as seen, has satisfied convenient and reliable requirement; 3, consumption certificate number is by transactional services square tube reason, and the transaction data content is difficult to forged by the storage administration of transactional services side; Can not be cracked through means guarantee information data such as the encryption of Network Transmission passage, consumption certificate number encryptions, effectively guarantee the safety of as seen.
Embodiment
Be elaborated in the face of technical scheme of the present invention down, but protection scope of the present invention is not limited to said embodiment.
Embodiment 1:Device through sound signal transmission consumption certificate realization mobile phone as seen according to the invention, as shown in Figure 2, comprise consumer's client unit, transactional services unit and trade company's client unit.
Said consumer's client unit is installed on the mobile phone that the consumer holds, and is used for: at first, send the request of obtaining consumption certificate number to the transactional services unit through network; Secondly, encrypt the consumption certificate of replying the transactional services unit number, generate sound signal and play according to the consumption certificate information of encrypting; Once more, receive that the transactional services unit sends with number corresponding transaction data of consumption certificate after, stop the broadcast of sound signal, the transaction data content is shown to the consumer, require the consumer to confirm transaction data; At last, after the consumer confirms, carry out transaction processing to the transactional services unit requests, and receive the transaction processing result that the transactional services unit sends through network.
Said transactional services unit is installed in the transaction service system of transactional services side, is used for: at first, for consumer's client unit generates the unique consumption certificate corresponding with the consumer number, reply to consumer's client unit; Secondly, the transaction data that comprises Transaction Information, trade company's number of the account and consumption certificate number that receives that trade company's client sends, and send transaction data to consumer's client unit of consumption certificate correspondence through network; Once more, carry out transaction processing, and return the transaction processing result and give consumer's client unit and trade company's client unit according to the request of consumer's client unit.
Said trade company client unit is installed on the office terminal of trade company, is used for: at first, let trade company import Transaction Information; Secondly, sound signal is also resolved in recording, and the sound signal deciphering of resolving is obtained consumption certificate number; Once more, send the transaction data comprise Transaction Information, trade company's number of the account and consumption certificate number through network to the transactional services unit, request begins transaction; At last, inquire about stateful transaction through network to the transactional services unit.
Consumer's mobile phone is connected with transactional services side through internet or mobile Internet, during the transmission data, guarantees channel security through asymmet-ric encryption method.The office terminal of trade company is connected with transactional services side through internet or mobile Internet, during the transmission data, guarantees channel security through asymmet-ric encryption method.Consumer's mobile phone sends sound signal through loudspeaker, transmits the office terminal that consumption certificate number is given trade company, and the frequency range of sound signal is 16K-22K, and people's ear is difficult to discover, and the loudspeaker of mobile phone and office terminal, microphone can be handled.
As shown in Figure 3, said consumer's client unit comprises digital coding unit and multifrequency sound wave transmitting element, and said trade company client unit comprises data decode unit and multifrequency sound wave receiving element.Said digital coding unit; At first calculate the proof test value that needs the transmission data; After need transmission data, add proof test value and end mark, form partial data, each numerical value with partial data is transformed on the corresponding frequency of sound wave again; Sending duration according to single frequency is formed continuous multifrequency information of acoustic wave, realizes the corresponding conversion of data and multifrequency acoustic signals.Said multifrequency sound wave transmitting element, the control sound-producing device sends acoustic signals continuously by the multifrequency information of acoustic wave that the digital coding cell translation obtains.Said multifrequency sound wave receiving element, the control listening device receives the acoustic signals that sound-producing device sends, and preserves data.Code check is separated with the data that multifrequency sound wave receiving element is preserved in said data decode unit.
As shown in Figure 1, the method through sound signal transmission consumption certificate realization mobile phone as seen according to the invention comprises the steps:
(1) consumer's client unit is sent the request of obtaining consumption certificate number through network to the transactional services unit of transactional services side;
(2) the transactional services unit generation of transactional services side, the storage unique consumption certificate corresponding with the consumer number replies to consumer's client unit;
(3) consumer's client unit is encrypted the consumption certificate of replying the transactional services unit number; And according to the consumption certificate information generation sound signal and the broadcast of encrypting;
(4) trade company imports trade company's client unit with Transaction Information, and sound signal is also resolved in the recording of trade company client unit, if resolve failure, then records again and resolves sound signal; Resolve and successfully then get into next step;
(5) trade company's client unit obtains consumption certificate number to the sound signal deciphering of resolving, and sends the transaction data that comprises Transaction Information, trade company's number of the account and consumption certificate number, request beginning transaction processing through network to the transactional services unit;
(6) transaction data of the transactional services unit of transactional services side storage consumption certificate correspondence, and through the consumer client unit transmission transaction data of network to the consumption certificate correspondence;
(7) after consumer's client unit receives transaction data, stop the broadcast of sound signal, and the transaction data content is shown to the consumer, require the consumer to confirm transaction data;
(8) after the consumer confirmed transaction data, consumer's client unit was accomplished transaction processing through network to the transactional services unit requests;
(9) the transactional services unit carries out transaction processing, and the transaction processing result is replied to consumer's client unit; If the transaction processing success, consumer's client unit is pointed out Transaction Success to the consumer;
(10) trade company's client unit is inquired about the transaction processing state through network to the transactional services unit; If it is successful for that trade company's client unit inquires the transaction processing state, then to trade company's client unit prompting Transaction Success.
Wherein, Consumer's client unit is according to trade company's client unit recording and parsing sound signal in the consumption certificate information generation sound signal of encrypting and broadcast and the step (4) in the said step (3); The audio signal transmission method that relates to does; The sending duration of definition single frequency is 40 milliseconds, keeps acting in agreement of consumer's client unit and trade company's client unit, and the digital coding unit adopts identical coding rule with the data decode unit; Specifically as shown in Figure 4, comprise the steps:
(11) at first calculate the proof test value that needs the transmission data, after need transmission data, add proof test value and end mark, form partial data through the digital coding unit in consumer's client unit; Adopt 10 system modes to define partial data; 0,1,2,3,4,5,6,7,8,90 numerical value; Corresponding one by one with ten different frequency of sound wave respectively; Use " # " as end mark, amount to 11 frequencies like this and form the multitone ripple, as shown in table 1 is the corresponding relation of frequency of sound wave in this example, 10 system value corresponding and sending duration.
The corresponding relation of table 1 frequency of sound wave, 10 system value corresponding and sending duration
Frequency of sound wave (HZ)
|
Numerical value
|
Duration (millisecond)
|
17500 |
0 |
40 |
17800 |
1 |
40 |
18100 |
2 |
40 |
18400 |
3 |
40 |
18700 |
4 |
40 |
19000 |
5 |
40 |
19300 |
6 |
40 |
19600 |
7 |
40 |
19900 |
8 |
40 |
20200 |
9 |
40 |
20500 |
# |
40 |
The partial data length that each multifrequency sound wave sends is 16, and wherein preceding 10 5 is proof test value in order to need the transmission data, and 1 is end mark; As shown in table 2 is the partial data simple examples table of a multifrequency sound wave.
The partial data simple examples table of a multifrequency sound wave of table 2
(12) again through the partial data of the digital coding unit in consumer's client unit to obtaining in the step (11), the contrast coding rule is transformed on the corresponding frequency of sound wave, forms continuous multifrequency information of acoustic wave according to the sending duration of single frequency; This corresponding frequency of sound wave scope is in 16KHz ~ 22KHz scope.
(13) the multifrequency sound wave transmitting element control loudspeaker through consumer's client unit send acoustic signals continuously according to the multifrequency information of acoustic wave; And constantly circulation, until receiving transaction data such as Transaction Information, trade company's number of the account and consumption certificate that the transactional services unit sends number or arriving time-out time.
(14) through the multifrequency sound wave receiving element of trade company's client unit, the acoustic signals that control microphone short distance reception loudspeaker send reaches length requirement until the audio-frequency information that receives, and preserves the complete audio-frequency information that receives, and sets period
iInitial value be 0.
(15) the data decode unit through trade company's client unit calculates parsing to the complete audio-frequency information of preserving; Contrast and the identical coding rule of step (12); The time slice that complete audio-frequency information is divided into respective number by single frequency duration length; Calculate the range value of each frequency in each time slice line ordering of going forward side by side; Wherein the maximum frequency of range value is the first choice frequency in this time slice, and other frequencies are the alternative frequency in this time slice, all frequency of sound wave are transformed on the relevant numerical again.
(16) first choice frequency value corresponding in each time slice is formed one group of partial data, carry out verification, judge whether success of verification, if judged result is for being then to accomplish the data transmission of multifrequency sound wave.
(17) if the judged result in the step (16) is not; Then replace the first choice frequency value corresponding with alternative frequency value corresponding in each time slice according to the descending order of range value; Form one group of partial data, carry out verification, judge whether verification is successful; If judged result is for being then to accomplish the data transmission of multifrequency sound wave.
(18) if the judged result in the step (17) for not, is then judged period
i=
nWhether set up, if judged result is for being, the data transmission fails of multifrequency sound wave then, wherein,
nFor greater than 1 natural number.
(19) if the judged result in the step (18) for not, then squints the reference position of the complete audio-frequency information that receives in the step (14) backward and preserves after the shift time length again,
i=
i+ 1; Return step (15), said shift time length is 1/ of single frequency duration length
n
The coding rule that adopts in this example is the pcm audio coding; In step (12), pass through the pcm audio coding and accomplish the conversion of partial data; In step (14), preserve the audio-frequency information that receives, combine multiple compaction algorithms method simultaneously, to reduce data volume and transmission quantity through the pcm audio coding.
Acoustic signals sends with sine waveform in the said step (13), and is as shown in Figure 5, is that a sinusoidal waveform voice data is quantified as the pcm audio encoded radio by sample circuit.The sinusoidal waveform voice data is got one time sample, the i.e. scale of x axle in every period set time; Each sample is selected its position on the y axle then according to algorithm; So just produce the substitute of discrete fully input signal, coding becomes digital data, to do preservation or to handle.Generate sine wave and depend on three parameters: sine wave freuqency, SF, bit depth, as generating the sine wave of 18100HZ, 44.1K SF, 16 bit depth.Use
SinFunction can generate sine wave output shape voice data,
SinThe sine value of a radian of function calculation (2 π radians equal 360 degree), the scope of rreturn value is from-1 to 1.The stepping radian value computing formula of each sampled point is: (2* π)/(SF/sine wave freuqency).The maximum intensity value of 16 bit depth voice datas and minimal intensity value are respectively 32767 and-32768.Calculate the stepping radian sine value of each sampled point and the product of intensity level, be filled in the data field of pcm audio coded format, just accomplished the modulation of audio volume control.Trade company's client unit adopts said method can generate the Wave data of each frequency in the multifrequency sound wave.The signal drop causes producing the noise that people's ear can be heard when avoiding between the frequency conversion; In each frequency period; The intermediate intensity value is the highest, the intensity value of left end successively by minimum be increased to the highest, the intensity value of right-hand member successively by the highest be reduced to minimum; Realize the smooth transformation between the frequency, avoid producing noise.Consumer's client unit is sent acoustic signals continuously by the multifrequency information of acoustic wave, and loop play is until the transaction data that comprises Transaction Information, trade company's number of the account and consumption certificate number of receiving that the transactional services unit sends or arrive time-out time.
Trade company's client unit detects the multifrequency information of acoustic wave of enrolling, and promptly calculates the frequency of resolving the sound signal in the single frequency duration section, and the contrast coding rule is confirmed relevant numerical.According to nyquist sampling theorem, " if signal is a band limit, and SF is higher than one times of signal bandwidth, and so, continuous signal originally can rebuild from sample fully." the recording SF that adopts of this example is 44.1K or higher frequency, makes the ultrasonic signal of 16K-22K HZ from sample, to rebuild fully.
Frequency spectrum analysis to signal can be judged frequency information; In this example; Trade company's client unit adopts for the Frequency and Amplitude value of sound signal the analysis of signal spectrum and calculates not only effectively but also Goertzel algorithm fast, and the example software program code of Goertzel algorithm is following:
double?goertzel?(int?samples[],?double?freq,?int?N,int?samplerate)?{
double?s_prev?=?0.0;
double?s_prev2?=?0.0;
double?coeff?,power,s;
int?i;
coeff?=?2*cos(2*M_PI*?freq?/?samplerate);
for?(i=0;?i<N;?i++)?{
s?=?samples[i]?+?coeff?*?s_prev?-?s_prev2;
s_prev2?=?s_prev;
s_prev?=?s;
}
power?=?s_prev2*s_prev2+s_prev*s_prev-coeff*s_prev*s_prev2;
return?power;
}
Through above-mentioned Goertzel algorithm computation one section audio information, can return the amplitude energy value of certain frequency, input parameter is explained as follows:
Samples: the array of audio-frequency information value, corresponding to the value sequence in the pcm encoder;
Freq: need the frequency of detection, as 18100;
N: participate in the audio-frequency information number of computing, during like 882 expression 44100HZ SFs, 20 milliseconds audio-frequency information number;
Samplerate: SF, as 44100.
In this example, during decoded data, be that per 40 milliseconds audio-frequency information is 1 frame with the single frequency duration, during 16 partial data transmission, totally 680 milliseconds of one whole recording represent that promptly the information of 16 frame partial datas adds that 1 vertical shift keeps information; Per 1 frame information to 16 frame informations calculates parsing, and the range value of 11 frequencies in this frame in the coding rule causes erroneous judgement for avoiding a frame across two frequency periods, when calculating range value, only the preceding 20 milliseconds audio-frequency information of every frame participated in computing; The frequency of ordering amplitude value maximum is as first choice frequency, and other frequencies are successively as alternative frequency.The Frequency and Amplitude value of 16 frames with the first choice frequency value corresponding of each frame, is formed 16 complete data and is carried out verification after calculating and accomplishing.If verification failure, then more successively preface form 16 complete data and carry out verification with the alternative frequency value corresponding replacement first choice frequency value corresponding of each frame.If the start bit of complete audio-frequency information is improper; If one frame possibly will cause the erroneous judgement of Frequency and Amplitude value across two frequency periods, so still verification failure; Then the reference position with complete audio-frequency information squints 10 milliseconds backward; Again carry out this step, multiple 4 times of gross weight all executes up to verification succeeds or skew number of times.Because of reasons such as environmental noise influence, sensitivity of microphone restrictions, first choice frequency possibly not be the actual frequency of sending, and alternative frequency is participated in computing, can effectively improve the hit rate of frequency.For avoiding erroneous judgement and reduce operand, the range of choice of alternative frequency can be dwindled, as 3 alternative frequency before the selecting range value rank carry out numerical value corresponding with form data.For the calculation step of 4 different start bits, can gather maximum frequency range value summation respectively, the data of a step that the verification summation is preceding 2 are ignored after the summation data of 2 step.
For 16 partial datas of each group, the method for calibration of every group of data is following: press the position rearrangement reaction data that end mark occurs, end mark data are backward moved to the data forefront.At this moment, preceding 10 data for needing to transmit, the 11st to the 15th is proof test value.Whether the proof test value that calculates preceding 10 bit data equals back 5 bit check values; If equate, then drawing this 10 bit data is the data that correct need transmit, and data transmission completes successfully; If unequal, then continue other proof test values of respectively organizing data of cycle calculations and whether equate.Through the verification of 5 bit check values, guaranteed the accuracy of data.
Embodiment 2:The difference of present embodiment device and method and embodiment 1 is (the same embodiment 1 that does not relate to):
As shown in Figure 6; Present embodiment consumer client unit comprises data generating unit, dual-tone multifrequency information coding unit and dual-tone multifrequency sound wave transmitting element, and trade company's client unit comprises dual-tone multifrequency sound wave receiving element, dual-tone multifrequency information decoding unit and data verification units.
Said data generating unit is calculated the proof test value that needs the transmission data, and giving needs the transmission data to add verification beginning flag and proof test value, forms partial data; Said dual-tone multifrequency information coding unit; Each numerical value of the partial data that data generating unit is generated is transformed on the corresponding dual-tone multifrequency superposed signal; Form continuous dual-tone multifrequency superposed signal information according to sending duration, realize the corresponding conversion of data and dual-tone multifrequency acoustic signals; Said dual-tone multifrequency sound wave transmitting element, the control sound-producing device sends acoustic signals continuously by the dual-tone multifrequency superposed signal information that dual-tone multifrequency information coding unit is converted to; Said dual-tone multifrequency sound wave receiving element, the control listening device receives the acoustic signals that sound-producing device sends, and preservation information; Said dual-tone multifrequency information decoding unit calculates the information that dual-tone multifrequency sound wave receiving element is preserved, decode; Said data verification units is carried out verification to decoded data.
As shown in Figure 7; Consumer's client unit is according to trade company's client unit recording and parsing sound signal in the consumption certificate information generation sound signal of encrypting and broadcast and the step (4) in the said step (3); The audio signal transmission method that relates to is that the definition sending duration is 40 milliseconds, keeps acting in agreement of consumer's client unit and trade company's client unit; And the digital coding unit adopts identical coding rule with the data decode unit, and concrete transmitting step is following:
(21) adopting the CRC check method to give through data generating unit needs the transmission data to add verification beginning flag and proof test value, forms partial data.Adopt 16 system modes to define partial data; 0,1,2,3,4,5,6,7,8,9, A, B, C, D, E and 16 numerical value of F; Corresponding one by one with 16 groups of double-tone frequencies respectively, dual-tone multifrequency superposed signal corresponding codes table is as shown in table 3 in this example.
Table 3 dual-tone multifrequency superposed signal corresponding codes table
Low frequency/high frequency |
18100 |
18400 |
18700 |
19000 |
16100 |
0
|
1
|
2
|
3
|
16400 |
4
|
5
|
6
|
7
|
16700 |
8
|
9
|
A
|
B
|
17000 |
C
|
D
|
E
|
F
|
Can learn superposed signal according to table 3 corresponding to the dual-tone multifrequency superposed signal of each numerical value, as shown in table 4.
Table 4 is corresponding to the superposed signal of the dual-tone multifrequency superposed signal of each numerical value
The partial data length that each multifrequency sound wave sends is 14, and wherein preceding 82 is the verification beginning flag of predefined in order to need the transmission data, and 4 is proof test value, and the verification beginning flag in this example is " 0F "; As shown in table 5 is the partial data simple examples table of a dual-tone multifrequency.
The partial data simple examples table of a dual-tone multifrequency of table 5
(22) partial data to obtaining in the step (21); Coding rule through the dual-tone multifrequency information coding unit table of comparisons 3; Be transformed on the corresponding dual-tone multifrequency superposed signal; Form continuous dual-tone multifrequency superposed signal information according to sending duration, this corresponding frequency of sound wave scope is in 16KHz ~ 22KHz scope.
(23) send acoustic signals through dual-tone multifrequency sound wave transmitting element control loudspeaker continuously according to dual-tone multifrequency superposed signal information; And constantly circulation, until receiving transaction data such as Transaction Information, trade company's number of the account and consumption certificate that the transactional services unit sends number or arriving time-out time.
(24) acoustic signals that sends of the microphone short distance reception consumer mobile phone loudspeaker through the trade company office terminal reaches length requirement until the audio-frequency information that receives, and preserves the complete audio-frequency information that receives, and sets period
iInitial value be 0.
(25) through dual-tone multifrequency information decoding unit the complete audio-frequency information of preserving is calculated parsing; Contrast and the identical coding rule of step (22); The time slice that complete audio-frequency information is divided into respective number by sending duration length; According to the amplitude size sequence, choosing two frequencies in each time slice and resolving by its dual-tone multifrequency superposed signal that constitutes is respective value, forms one group of partial data; Through data verification units this partial data is carried out verification, judge whether success of verification, if judged result is for being then to accomplish the data transmission of dual-tone multifrequency sound wave.
(26) if the judged result in the step (25) for not, is then judged period
i=
nWhether set up, if judged result is for being, the data transmission fails of multifrequency sound wave then, wherein,
nFor greater than 1 natural number.
(27) if the judged result in the step (26) for not, then squints the reference position of the complete audio-frequency information that receives in the step (24) backward and preserves after the shift time length again,
i=
i+ 1; Return step (25), said shift time length is 1/ of sending duration length
n
The coding rule that adopts in this example is the pcm audio coding; In step (22), pass through the pcm audio coding and accomplish the conversion of partial data; In step (24), preserve the audio-frequency information that receives, combine multiple compaction algorithms method simultaneously, to reduce data volume and transmission quantity through the pcm audio coding.
Acoustic signals sends with sine waveform in the said step (23), and the sine wave that generates the dual-tone multifrequency stack depends on parameter: two sine wave freuqencies, SF, bit depth, and like 16100HZ+18100HZ, 44.1K SF, 16 bit depth.Use
SinFunction can generate the sine wave output voice data,
SinThe sine value of a radian of function calculation.The stepping radian value computing formula of each sampled point is: (2* π)/(SF/sine wave freuqency).In two frequencies, the maximum intensity value and the minimal intensity value of 16 bit depth voice datas of each frequency are respectively 16383 and-16384.Calculate the stepping radian sine value of the sampled point of each frequency in two frequencies and the product of intensity level,, will be filled in the data field of PCM form, just accomplished the modulation of the audio volume control of stack with value with two product value additions.This example adopts said method to generate the Wave data of dual-tone multifrequency stack.
The signal drop causes producing the noise that people's ear can be heard when avoiding between the frequency conversion; The touch-tone signal of each transmission is in the cycle; The intermediate intensity value is the highest, and the intensity value of left end is increased to the highest successively by zero, the intensity value of right-hand member successively by the highest be reduced to minimum; Realize smooth transformation, avoid producing noise.
Consumer's client unit is sent acoustic signals continuously by dual-tone multifrequency superposed signal information, and loop play is until receiving transaction data such as Transaction Information, trade company's number of the account and consumption certificate that the transactional services unit sends number or arriving time-out time.
Trade company's client unit detects the dual-tone multifrequency superposed signal information that recording obtains, and promptly calculates the double-tone frequency of the sound signal in each duration section, and the contrast coding rule is confirmed relevant numerical.According to nyquist sampling theorem, " if signal is a band limit, and SF is higher than one times of signal bandwidth, and so, continuous signal originally can rebuild from sample fully." the recording SF that adopts of this example is 44.1K or higher frequency, makes the ultrasonic signal of 16K-22K HZ from sample, to rebuild fully.
Frequency spectrum analysis to signal can be judged frequency information, and in this example, receiving end adopts for the Frequency and Amplitude value of sound signal the analysis of signal spectrum and calculates not only effectively but also Goertzel algorithm fast.
In this example, during decoded data, be that per 40 milliseconds audio-frequency information is 1 frame with the single frequency duration, during 14 partial data transmission, totally 600 milliseconds of one whole recording represent that promptly the information of 14 frame partial datas adds that 1 vertical shift keeps information; Per 1 frame information to 14 frame informations calculates parsing, and the range value of 8 frequencies in this frame in the coding rule causes erroneous judgement for avoiding a frame across two signal periods, when calculating range value, only the preceding 20 milliseconds audio-frequency information of every frame participated in computing; The frequency that ordering amplitude value preceding 3 is big is designated as frequency 1, frequency 2, the frequency 3 of this frame.
After the Frequency and Amplitude value of 14 frames is calculated and accomplished,, form 14 complete data and carry out verification frequency 1, the frequency 2 combination value corresponding of each frame.If verification failure, then more successively preface form 14 complete data and carry out verification with frequency 1, frequency 3 combinations and frequency 2, frequency 3 combination value corresponding replacement frequencies 1, the frequency 2 combination value corresponding of each frame.
If the start bit of complete audio-frequency information is improper; If one frame possibly will cause the erroneous judgement of Frequency and Amplitude value across two signal periods, so still verification failure; Then the reference position with complete audio-frequency information squints 10 milliseconds backward; Again carry out this step, multiple 4 times of gross weight all executes up to verification succeeds or skew number of times.Alternative combination of frequency is participated in computing, can effectively improve the data parsing success ratio, eliminates the influence of environmental noise, sensitivity of microphone.For avoiding erroneous judgement and reducing operand, for the calculation step of 4 different start bits, can gather maximum frequency range value summation respectively, the data of a step that the verification summation is preceding 2 are ignored after the summation data of 2 step.
For 14 partial datas of each group, the method for calibration of every group of data is following: circulation searching verification beginning flag, the position rearrangement reaction data by the verification beginning flag occurs move to the data forefront with verification beginning flag data backward.At this moment, preceding 4 is proof test value, the 5th to the 12nd 8 bit data for needing to transmit, and whether the proof test value that calculates 8 bit data equals preceding 4 bit check values; If equate, then drawing this 8 bit data is the data that correct need transmit, and data transmission completes successfully; If unequal, then continue other proof test values of respectively organizing data of cycle calculations and whether equate.Through the verification of 4 bit check values, guaranteed the accuracy of data.
As stated, although represented and explained the present invention that with reference to specific preferred embodiment it shall not be construed as the restriction to the present invention self.Under the spirit and scope of the present invention prerequisite that does not break away from the accompanying claims definition, can make various variations in form with on the details to it.