Summary of the invention
Goal of the invention: the object of the invention is to for the deficiencies in the prior art, there is provided a kind of and transmit by sound signal method and the device that consumption certificate number realizes mobile phone as seen, consumer holds mobile phone to transaction service system request, obtain unique consumption certificate number, sound signal is sent by loudspeaker by mobile phone, recording and parse consumption certificate number in the office terminal of trade company, then completes as seen; Do not change mobile phone, office terminal physique basis on, utilize the loudspeaker on mobile phone, office terminal and microphone realize sound signal transmit consumption certificate number, realize convenient and reliable as seen.Especially by.
Technical scheme: the method being realized as seen by sound signal transmission consumption certificate number of the present invention, is comprised the steps:
(1) consumer client's unit is by the request of network to the transactional services unit transmission acquisition consumption certificate number of transactional services side;
(2) the transactional services unit of transactional services side generates, stores the unique consumption certificate number corresponding with consumer, replies to consumer client's unit;
(3) consumption certificate number of consumer client's unit encryption transactional services unit reply; And generate sound signal according to the consumption certificate number information of encryption and play;
(4) Transaction Information is inputted vendor end unit by trade company, and vendor end unit is recorded and resolved sound signal, if resolve unsuccessfully, then again records and resolves sound signal; Successfully resolved then enters next step;
(5) vendor end unit obtains consumption certificate number to the sound signal deciphering of resolving, and sent the transaction data comprising Transaction Information, trade company's account and consumption certificate number to transactional services unit by network, request starts transaction processing;
(6) the transactional services unit of transactional services side stores transaction data corresponding to consumption certificate number, and sends transaction data by network to consumer client's unit that consumption certificate number is corresponding;
(7), after consumer client's unit receives transaction data, stop the broadcasting of sound signal, and transaction data content is shown to consumer, require that consumer confirms transaction data;
(8), after consumer confirms transaction data, consumer client's unit completes transaction processing by network to transactional services unit requests;
(9) transactional services unit carries out transaction processing, and transaction processing result is replied to consumer client's unit; If transaction processing success, consumer client's unit points out Transaction Success to consumer;
(10) vendor end unit inquires about transaction processing state by network to transactional services unit; If it is successfully that vendor end unit inquires transaction processing state, then to vendor end unit prompting Transaction Success.
In order to ensure the reliability of Signal transmissions further, in the inventive method, the middle consumer client's unit of step (3) generates sound signal according to the consumption certificate number information of encryption and broadcasting and the middle vendor end unit of step (4) are recorded and resolve sound signal, and the audio signal transmission method related to has two kinds of ratios more preferably method.
Wherein the first audio signal transmission method comprises the steps:
(11) first calculate by the data encoding unit in consumer client's unit the proof test value needing to transmit data, after need transmitting data, add proof test value and end mark, composition partial data;
(12) again by the data encoding unit in consumer client's unit to the partial data obtained in step (11), contrast coding rule, is transformed on corresponding frequency of sound wave, according to the sending duration composition continuous print multifrequency information of acoustic wave of single frequency;
(13) control sound-producing device by the multifrequency sound wave transmitting element of consumer client's unit and send acoustic signals continuously according to multifrequency information of acoustic wave, and constantly circulate, until consumer client's unit receives transaction data or arrives time-out time;
(14) by the multifrequency sound wave receiving element of vendor end unit, control the acoustic signals that listening device short distance reception sound-producing device sends, until the audio-frequency information received reaches length requirement, preserve the complete audio information received, and set period
iinitial value be 0;
(15) carry out calculating by the data decoding unit of vendor end unit to the complete audio information of preserving to resolve, contrast the coding rule identical with step (12), complete audio information is divided into the time slice of respective number by single frequency time duration, calculate the range value of each frequency in each time slice to go forward side by side line ordering, the frequency that wherein range value is maximum is the first choice frequency in this time slice, other frequencies are the alternative frequency in this time slice, then are transformed into by all frequency of sound wave accordingly numerically;
(16) numerical value corresponding for first choice frequency in each time slice is formed one group of partial data, verify, judge that whether verification is successful, if the determination result is YES, then complete the data transmission of multifrequency sound wave;
(17) if the judged result in step (16) is no, then replace numerical value corresponding to first choice frequency according to the order that range value is descending with the numerical value that frequency alternative in each time slice is corresponding, form one group of partial data, verify, judge that whether verification is successful, if the determination result is YES, then the data transmission of multifrequency sound wave is completed;
(18) if the judged result in step (17) is no, then period is judged
i=
nwhether set up, if the determination result is YES, then the data transmission fails of multifrequency sound wave, wherein,
nfor being greater than the natural number of 1;
(19) if the judged result in step (18) is no, then preserve again after the reference position of the complete audio information received in step (14) being offset a shift time length backward,
i=
i+ 1; Return step (15), described shift time length is 1/ of single frequency time duration
n.
The second audio signal transmission method comprises the steps:
(21) first calculate the proof test value that need transmit data by the data generating unit in consumer client's unit, add verification beginning flag and proof test value to data need be transmitted, composition partial data;
(22) again by the dual-tone multifrequency information coding unit in consumer client's unit to the partial data obtained in step (21), contrast coding rule, be transformed in corresponding dual-tone multifrequency superposed signal, according to sending duration composition continuous print dual-tone multifrequency superposed signal information;
(23) control sound-producing device by the dual tone multiple frequency sound wave transmitting element in consumer client's unit and send acoustic signals continuously according to dual-tone multifrequency superposed signal information, and constantly circulate, until receive transaction data or arrive time-out time;
(24) by the dual tone multiple frequency sound wave receiving element of vendor end unit, control the acoustic signals that listening device short distance reception sound-producing device sends, until the audio-frequency information received reaches length requirement, preserve the complete audio information received, and set period
iinitial value be 0;
(25) carry out calculating by the dual-tone multifrequency information decoding unit of vendor end unit to the complete audio information of preserving to resolve, contrast the coding rule identical with step (22), complete audio information is divided into the time slice of respective number by sending duration length, according to amplitude size sequence, it is respective value that two frequencies chosen in each time slice also resolve the dual-tone multifrequency superposed signal be made up of it, forms one group of partial data; By the data verification units of vendor end unit, this partial data is verified, judge that whether verification is successful, if the determination result is YES, then complete the data transmission of dual tone multiple frequency sound wave;
(26) if the judged result in step (25) is no, then period is judged
i=
nwhether set up, if the determination result is YES, then the data transmission fails of multifrequency sound wave, wherein,
nfor being greater than the natural number of 1;
(27) if the judged result in step (26) is no, then preserve again after the reference position of the complete audio information received in step (24) being offset a shift time length backward,
i=
i+ 1; Return step (25), described shift time length is 1/ of sending duration length
n.
Preferably, the Transaction Information in the method comprises trade name, dealing money, discount rate, commodity amount and other explanations; In described step (3), the method for encryption consumption certificate number is symmetric cipher or asymmetric encryption method.
Device of the present invention, comprises consumer client's unit, transactional services unit and vendor end unit.On the mobile phone that described consumer client's cellular installation is held consumer, for: first, sent the request obtaining consumption certificate number to transactional services unit by network; Secondly, the consumption certificate number that encryption transactional services unit is replied, the consumption certificate number information according to encryption generates sound signal and plays; Again, after receiving the transaction data corresponding with consumption certificate number of transactional services unit transmission, stop the broadcasting of sound signal, transaction data content is shown to consumer, requires that consumer confirms transaction data; Finally, after consumer confirms, carry out transaction processing by network to transactional services unit requests, and receive the transaction processing result of transactional services unit transmission.Described transactional services cellular installation in the transaction service system of transactional services side, for: first, be that consumer client's unit generates the unique consumption certificate number corresponding with consumer, reply to consumer client's unit; Secondly, receive the transaction data comprising Transaction Information, trade company's account and consumption certificate number that vendor end sends, and send transaction data by network to consumer client's unit that consumption certificate number is corresponding; Again, transaction processing is carried out in the request according to consumer client's unit, and returns transaction processing result to consumer client's unit and vendor end unit.Described vendor end unit is arranged on the office terminal of trade company, for: first, allow trade company input Transaction Information; Secondly, record and resolve sound signal, consumption certificate number is obtained to the sound signal deciphering of resolving; Again, sent the transaction data comprising Transaction Information, trade company's account and consumption certificate number by network to transactional services unit, request starts transaction; Finally, stateful transaction is inquired about by network to transactional services unit.
In order to realize the first audio signal transmission method above-mentioned, described consumer client's unit comprises data encoding unit and multifrequency sound wave transmitting element further, and described vendor end unit comprises data decoding unit and multifrequency sound wave receiving element.
Described data encoding unit, first the proof test value that need transmit data is calculated, proof test value and end mark is added after data need be transmitted, composition partial data, again each numerical value of partial data is transformed on corresponding frequency of sound wave, according to the sending duration composition continuous print multifrequency information of acoustic wave of single frequency, realize the corresponding conversion of data and multifrequency acoustic signals.Described multifrequency sound wave transmitting element, the multifrequency information of acoustic wave that control sound-producing device is converted to by data encoding unit sends acoustic signals continuously.Described multifrequency sound wave receiving element, controls the acoustic signals that listening device reception sound-producing device sends, and preserves data.Described data decoding unit, the decoding data verification that multifrequency sound wave receiving element is preserved.
In order to realize above-mentioned the second audio signal transmission method, described consumer client's unit comprises data generating unit, dual-tone multifrequency information coding unit and dual tone multiple frequency sound wave transmitting element further, and described vendor end unit comprises dual tone multiple frequency sound wave receiving element, dual-tone multifrequency information decoding unit and data verification units.
Described data generating unit, calculates the proof test value that need transmit data, adds verification beginning flag and proof test value, composition partial data to transmitting data.Described dual-tone multifrequency information coding unit, each numerical value of partial data data generating unit generated is transformed in corresponding dual-tone multifrequency superposed signal, according to sending duration composition continuous print dual-tone multifrequency superposed signal information, realize the corresponding conversion of data and dual tone multiple frequency sound wave signal.Described dual tone multiple frequency sound wave transmitting element, the dual-tone multifrequency superposed signal information that control sound-producing device is converted to by dual-tone multifrequency information coding unit sends acoustic signals continuously.Described dual tone multiple frequency sound wave receiving element, controls the acoustic signals that listening device reception sound-producing device sends, and preserves information.Described dual-tone multifrequency information decoding unit, is undertaken calculating, decoding by the information that dual tone multiple frequency sound wave receiving element is preserved.Described data verification units, verifies decoded data.
Beneficial effect: 1, the present invention is applied between mobile phone and office terminal and carries out as seen aspect, the loudspeaker of use mobile phone, office terminal and microphone, the support of mobile phone and office terminal is in extensive range, with low cost; 2, the present invention is in the physique situation not changing mobile phone, office terminal, transmits consumption certificate number by sound signal, and it is intuitively convenient to use, and realizes convenient and reliable as seen, meets convenient and reliable requirement; 3, consumption certificate number is managed by transactional services square tube, and transaction data content, by the storage administration of transactional services side, is difficult to be forged; Can not be cracked by means guarantee information data such as network transmission channels encryption, consumption certificate number encryptions, effectively ensure that the safety of as seen.
Embodiment
Below technical solution of the present invention is described in detail, but protection scope of the present invention is not limited to described embodiment.
embodiment 1:the device being realized mobile phone as seen by sound signal transmission consumption certificate number of the present invention, as shown in Figure 2, comprises consumer client's unit, transactional services unit and vendor end unit.
On the mobile phone that described consumer client's cellular installation is held consumer, for: first, sent the request obtaining consumption certificate number to transactional services unit by network; Secondly, the consumption certificate number that encryption transactional services unit is replied, the consumption certificate number information according to encryption generates sound signal and plays; Again, after receiving the transaction data corresponding with consumption certificate number of transactional services unit transmission, stop the broadcasting of sound signal, transaction data content is shown to consumer, requires that consumer confirms transaction data; Finally, after consumer confirms, carry out transaction processing by network to transactional services unit requests, and receive the transaction processing result of transactional services unit transmission.
Described transactional services cellular installation in the transaction service system of transactional services side, for: first, be that consumer client's unit generates the unique consumption certificate number corresponding with consumer, reply to consumer client's unit; Secondly, receive the transaction data comprising Transaction Information, trade company's account and consumption certificate number that vendor end sends, and send transaction data by network to consumer client's unit that consumption certificate number is corresponding; Again, transaction processing is carried out in the request according to consumer client's unit, and returns transaction processing result to consumer client's unit and vendor end unit.
Described vendor end unit is arranged on the office terminal of trade company, for: first, allow trade company input Transaction Information; Secondly, record and resolve sound signal, consumption certificate number is obtained to the sound signal deciphering of resolving; Again, sent the transaction data comprising Transaction Information, trade company's account and consumption certificate number by network to transactional services unit, request starts transaction; Finally, stateful transaction is inquired about by network to transactional services unit.
The mobile phone of consumer is connected with transactional services side by internet or mobile Internet, during transmission data, ensures channel security by asymmet-ric encryption method.The office terminal of trade company is connected with transactional services side by internet or mobile Internet, during transmission data, ensures channel security by asymmet-ric encryption method.The mobile phone of consumer sends sound signal by loudspeaker, and transmit consumption certificate number to the office terminal of trade company, 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 process.
As shown in Figure 3, described consumer client's unit comprises data encoding unit and multifrequency sound wave transmitting element, and described vendor end unit comprises data decoding unit and multifrequency sound wave receiving element.Described data encoding unit, first the proof test value that need transmit data is calculated, proof test value and end mark is added after data need be transmitted, composition partial data, again each numerical value of partial data is transformed on corresponding frequency of sound wave, according to the sending duration composition continuous print multifrequency information of acoustic wave of single frequency, realize the corresponding conversion of data and multifrequency acoustic signals.Described multifrequency sound wave transmitting element, the multifrequency information of acoustic wave that control sound-producing device is converted to by data encoding unit sends acoustic signals continuously.Described multifrequency sound wave receiving element, controls the acoustic signals that listening device reception sound-producing device sends, and preserves data.Described data decoding unit, the decoding data verification that multifrequency sound wave receiving element is preserved.
As shown in Figure 1, the method being realized mobile phone as seen by sound signal transmission consumption certificate number of the present invention, is comprised the steps:
(1) consumer client's unit is by the request of network to the transactional services unit transmission acquisition consumption certificate number of transactional services side;
(2) the transactional services unit of transactional services side generates, stores the unique consumption certificate number corresponding with consumer, replies to consumer client's unit;
(3) consumption certificate number of consumer client's unit encryption transactional services unit reply; And generate sound signal according to the consumption certificate number information of encryption and play;
(4) Transaction Information is inputted vendor end unit by trade company, and vendor end unit is recorded and resolved sound signal, if resolve unsuccessfully, then again records and resolves sound signal; Successfully resolved then enters next step;
(5) vendor end unit obtains consumption certificate number to the sound signal deciphering of resolving, and sent the transaction data comprising Transaction Information, trade company's account and consumption certificate number to transactional services unit by network, request starts transaction processing;
(6) the transactional services unit of transactional services side stores transaction data corresponding to consumption certificate number, and sends transaction data by network to consumer client's unit that consumption certificate number is corresponding;
(7), after consumer client's unit receives transaction data, stop the broadcasting of sound signal, and transaction data content is shown to consumer, require that consumer confirms transaction data;
(8), after consumer confirms transaction data, consumer client's unit completes transaction processing by network to transactional services unit requests;
(9) transactional services unit carries out transaction processing, and transaction processing result is replied to consumer client's unit; If transaction processing success, consumer client's unit points out Transaction Success to consumer;
(10) vendor end unit inquires about transaction processing state by network to transactional services unit; If it is successfully that vendor end unit inquires transaction processing state, then to vendor end unit prompting Transaction Success.
Wherein, the middle consumer client's unit of described step (3) generates sound signal according to the consumption certificate number information of encryption and broadcasting and the middle vendor end unit of step (4) are recorded and resolve sound signal, the audio signal transmission method related to is, the sending duration of definition single frequency is 40 milliseconds, keep acting in agreement of consumer client's unit and vendor end unit, and data encoding unit and data decoding unit adopt identical coding rule, specifically as shown in Figure 4, comprise the steps:
(11) first calculate the proof test value that need transmit data by the data encoding unit in consumer client's unit, after need transmitting data, add proof test value and end mark, composition partial data; 10 system modes are adopted by partial data to define, 0,1,2,3,4,5,6,7,8,90 numerical value, frequency of sound wave one_to_one corresponding different from ten respectively, use " # " as end mark, amount to 11 frequencies composition multitone ripples like this, as shown in table 1 is the corresponding relation of numerical value that frequency of sound wave in this example, 10 systems are corresponding and sending duration.
The corresponding relation of the numerical value that table 1 frequency of sound wave, 10 systems are 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, wherein first 10 in order need transmit data, 5 is proof test value, 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 table 2 multifrequency sound wave
(12) again by the data encoding unit in consumer client's unit to the partial data obtained in step (11), contrast coding rule, is transformed on corresponding frequency of sound wave, according to the sending duration composition continuous print multifrequency information of acoustic wave of single frequency; The frequency of sound wave scope of this correspondence is within the scope of 16KHz ~ 22KHz.
(13) control loudspeaker by the multifrequency sound wave transmitting element of consumer client's unit and send acoustic signals continuously according to multifrequency information of acoustic wave, and constantly circulate, until receive the transaction data such as Transaction Information, trade company's account and consumption certificate number that transactional services unit sends or arrive time-out time.
(14) by the multifrequency sound wave receiving element of vendor end unit, control the acoustic signals that microphone short distance reception loudspeaker send, until the audio-frequency information received reaches length requirement, preserve the complete audio information received, and set period
iinitial value be 0.
(15) carry out calculating by the data decoding unit of vendor end unit to the complete audio information of preserving to resolve, contrast the coding rule identical with step (12), complete audio information is divided into the time slice of respective number by single frequency time duration, calculate the range value of each frequency in each time slice to go forward side by side line ordering, the frequency that wherein range value is maximum is the first choice frequency in this time slice, other frequencies are the alternative frequency in this time slice, then are transformed into by all frequency of sound wave accordingly numerically.
(16) numerical value corresponding for first choice frequency in each time slice is formed one group of partial data, verify, judge that whether verification is successful, if the determination result is YES, then complete the data transmission of multifrequency sound wave.
(17) if the judged result in step (16) is no, then replace numerical value corresponding to first choice frequency according to the order that range value is descending with the numerical value that frequency alternative in each time slice is corresponding, form one group of partial data, verify, judge that whether verification is successful, if the determination result is YES, then the data transmission of multifrequency sound wave is completed.
(18) if the judged result in step (17) is no, then period is judged
i=
nwhether set up, if the determination result is YES, then the data transmission fails of multifrequency sound wave, wherein,
nfor being greater than the natural number of 1.
(19) if the judged result in step (18) is no, then preserve again after the reference position of the complete audio information received in step (14) being offset a shift time length backward,
i=
i+ 1; Return step (15), described shift time length is 1/ of single frequency time duration
n.
The coding rule adopted in this example is pcm audio coding, to be encoded by pcm audio in step (12) conversion of partial data, the audio-frequency information received is preserved, simultaneously in conjunction with multiple compaction algorithms method, to reduce data volume and transmission quantity by pcm audio coding in step (14).
Acoustic signals sends with sine waveform in described step (13), as shown in Figure 5, is that sinusoidal waveform voice data is sampled and be quantified as pcm audio encoded radio.Sinusoidal waveform voice data is got a sample within every period of set time, i.e. the scale of x-axis; Each sample then according to algorithm, its position in y-axis selected; So just, produce the substitute of completely discrete input signal, coding becomes digital data, to preserve or to process.Generate sine wave and depend on three parameters: sine wave freuqency, sample frequency, bit depth, as generated the sine wave of 18100HZ, 44.1K sample frequency, 16 bit depth.Use
sinfunction can generate sine wave output shape voice data,
sinfunction calculates the sine value (2 π radians equal 360 degree) of a radian, and the scope of rreturn value is from-1 to 1.The stepping radian value computing formula of each sampled point is: (2* π)/(sample frequency/sine wave freuqency).Maximum intensity value and the minimal intensity value of 16 bit depth voice datas 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 complete the modulation of audio volume control.Vendor end unit adopts said method can generate the Wave data of each frequency in multifrequency sound wave.For the noise that signal drop when avoiding converting between frequency causes generation people ear to hear, in each frequency cycle, 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 frequency, avoid producing noise.Consumer client's unit sends acoustic signals continuously by multifrequency information of acoustic wave, loop play, until receive the transaction data comprising Transaction Information, trade company's account and consumption certificate number of transactional services unit transmission or arrive time-out time.
Vendor end unit detects the multifrequency information of acoustic wave of enrolling, and namely calculates the frequency of the sound signal of resolving in single frequency duration section, and contrast coding rule determines corresponding numerical value.According to nyquist sampling theorem, " if signal is band limit, and sample frequency is higher than one times of signal bandwidth, and so, continuous signal originally can completely rebuild out from sample." this example adopt recording sample frequency be 44.1K or higher frequency, make the ultrasonic signal of 16K-22KHZ completely to rebuild out from sample.
Analysis is carried out to the frequency spectrum of signal and can judge frequency information, in this example, vendor end unit adopts the Frequency and Amplitude value for sound signal to calculate not only effectively but also fast Goertzel algorithm to the analysis of signal spectrum, and the example software program code of Goertzel algorithm is as follows:
doublegoertzel(intsamples[],doublefreq,intN,intsamplerate){
doubles_prev=0.0;
doubles_prev2=0.0;
doublecoeff,power,s;
inti;
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;
returnpower;
}
Calculate a section audio information by above-mentioned Goertzel algorithm, can return the amplitude energy value of certain frequency, input parameter is described as follows:
Samples: the array of audio information values, corresponding to the value sequence in pcm encoder;
Freq: need the frequency detected, as 18100;
N: the audio-frequency information number participating in computing, during as 882 expression 44100HZ sample frequency, the audio-frequency information number of 20 milliseconds;
Samplerate: sample frequency, as 44100.
In this example, during decoded data, be 1 frame with the audio-frequency information of single frequency duration and every 40 milliseconds, during 16 partial data transmission, once complete recording totally 680 milliseconds, namely represents that the information of 16 frame partial datas adds that 1 vertical shift retains information; Every 1 frame information of 16 frame informations being calculated and resolves, the range value of 11 frequencies in this frame in coding rule, for avoiding a frame to cause erroneous judgement across two frequency cycle, when calculating range value, only the audio-frequency information of first 20 milliseconds of every frame being participated in computing; The maximum frequency of sequence amplitude value is as first choice frequency, and other frequencies are successively as alternative frequency.After the Frequency and Amplitude value of 16 frames has calculated, by numerical value corresponding for the first choice frequency of each frame, form 16 complete data and verify.If verify unsuccessfully, then sequentially replace numerical value corresponding to first choice frequency with numerical value corresponding to the alternative frequency of each frame again, form 16 complete data and verify.If the start bit of complete audio information is improper, one frame may across two frequency cycle, Frequency and Amplitude value will be caused to judge by accident, if so still verify failure, then the reference position of complete audio information is offset 10 milliseconds backward, re-execute this step, repeat 4 times altogether, until verification succeeds or skew number of times all execute.Because of reasons such as environmental noise impact, sensitivity of microphone restrictions, first choice frequency may not be the actual frequency sent, and alternative frequency participates in computing, can effectively put forward high-frequency hit rate.For avoiding erroneous judgement and reducing operand, the range of choice of alternative frequency can reduce, as before only selecting range value rank 3 alternative frequency carry out the corresponding and composition data of numerical value.For the calculation step of 4 different start bits, maximum frequency range value summation can be gathered respectively, only the data of the step of verification first 2 of summation, ignore the data of the step of after summation 2.
For each group of 16 partial datas, the method for calibration often organizing data is as follows: end mark data are backward moved to data forefront by the position rearrangement reaction data occurred by end mark.At this moment, first 10 is the data that need transmit, and the 11st is proof test value to the 15th.Whether the proof test value calculating front 10 bit data equals rear 5 bit check values; If equal, then show that this 10 bit data is the data of correct need transmission, data transmission success completes; If unequal, then whether equally continue other proof test values respectively organizing data of cycle calculations.By the verification of 5 bit check values, ensure that the accuracy of data.
embodiment 2:the difference of the present embodiment device and method and embodiment 1 is (the same embodiment 1 do not related to):
As shown in Figure 6, the present embodiment consumer client unit comprises data generating unit, dual-tone multifrequency information coding unit and dual tone multiple frequency sound wave transmitting element, and vendor end unit comprises dual tone multiple frequency sound wave receiving element, dual-tone multifrequency information decoding unit and data verification units.
Described data generating unit, calculates the proof test value that need transmit data, adds verification beginning flag and proof test value, composition partial data to transmitting data; Described dual-tone multifrequency information coding unit, each numerical value of partial data data generating unit generated is transformed in corresponding dual-tone multifrequency superposed signal, according to sending duration composition continuous print dual-tone multifrequency superposed signal information, realize the corresponding conversion of data and dual tone multiple frequency sound wave signal; Described dual tone multiple frequency sound wave transmitting element, the dual-tone multifrequency superposed signal information that control sound-producing device is converted to by dual-tone multifrequency information coding unit sends acoustic signals continuously; Described dual tone multiple frequency sound wave receiving element, controls the acoustic signals that listening device reception sound-producing device sends, and preserves information; Described dual-tone multifrequency information decoding unit, is undertaken calculating, decoding by the information that dual tone multiple frequency sound wave receiving element is preserved; Described data verification units, verifies decoded data.
As shown in Figure 7, the middle consumer client's unit of described step (3) generates sound signal according to the consumption certificate number information of encryption and broadcasting and the middle vendor end unit of step (4) are recorded and resolve sound signal, the audio signal transmission method related to is, definition sending duration is 40 milliseconds, keep acting in agreement of consumer client's unit and vendor end unit, and data encoding unit and data decoding unit adopt identical coding rule, concrete transmitting step is as follows:
(21) CRC check method is adopted to add verification beginning flag and proof test value to data need be transmitted, composition partial data by data generating unit.16 system modes are adopted by partial data to define, 0,1,2,3,4,5,6,7,8,9, A, B, C, D, E and F 16 numerical value, respectively with 16 groups of double-tone frequency one_to_one corresponding, the coding schedule that in this example, dual-tone multifrequency superposed signal is corresponding is as shown in table 3.
The coding schedule that table 3 dual-tone multifrequency superposed signal is corresponding
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
|
The superposed signal of the dual-tone multifrequency superposed signal corresponding to each numerical value can be learnt according to table 3, as shown in table 4.
Table 4 corresponds 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, wherein front 8 for data need be transmitted, 2 is the verification beginning flag of predefined, 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 table 5 dual-tone multifrequency
(22) to the partial data obtained in step (21), by the coding rule of the dual-tone multifrequency information coding unit table of comparisons 3, be transformed in corresponding dual-tone multifrequency superposed signal, according to sending duration composition continuous print dual-tone multifrequency superposed signal information, the frequency of sound wave scope of this correspondence is within the scope of 16KHz ~ 22KHz.
(23) control loudspeaker by dual tone multiple frequency sound wave transmitting element and send acoustic signals continuously according to dual-tone multifrequency superposed signal information, and constantly circulate, until receive the transaction data such as Transaction Information, trade company's account and consumption certificate number that transactional services unit sends or arrive time-out time.
(24) by the acoustic signals that the microphone short distance reception consumer Mobile phone horn of trade company office terminal sends, until the audio-frequency information received reaches length requirement, preserve the complete audio information received, and set period
iinitial value be 0.
(25) carry out calculating by dual-tone multifrequency information decoding unit to the complete audio information of preserving to resolve, contrast the coding rule identical with step (22), complete audio information is divided into the time slice of respective number by sending duration length, according to amplitude size sequence, it is respective value that two frequencies chosen in each time slice also resolve the dual-tone multifrequency superposed signal be made up of it, forms one group of partial data; By data verification units, this partial data is verified, judge that whether verification is successful, if the determination result is YES, then complete the data transmission of dual tone multiple frequency sound wave.
(26) if the judged result in step (25) is no, then period is judged
i=
nwhether set up, if the determination result is YES, then the data transmission fails of multifrequency sound wave, wherein,
nfor being greater than the natural number of 1.
(27) if the judged result in step (26) is no, then preserve again after the reference position of the complete audio information received in step (24) being offset a shift time length backward,
i=
i+ 1; Return step (25), described shift time length is 1/ of sending duration length
n.
The coding rule adopted in this example is pcm audio coding, to be encoded by pcm audio in step (22) conversion of partial data, the audio-frequency information received is preserved, simultaneously in conjunction with multiple compaction algorithms method, to reduce data volume and transmission quantity by pcm audio coding in step (24).
In described step (23), acoustic signals sends with sine waveform, and the sine wave generating dual-tone multifrequency superposition depends on parameter: two sine wave freuqencies, sample frequency, bit depth, as 16100HZ+18100HZ, 44.1K sample frequency, and 16 bit depth.Use
sinfunction can generate sine wave output voice data,
sinfunction calculates the sine value of a radian.The stepping radian value computing formula of each sampled point is: (2* π)/(sample frequency/sine wave freuqency).In two frequencies, 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, two product values being added, by being filled in the data field of PCM form with value, just completing the modulation of the audio volume control of superposition.This example adopts said method to generate the Wave data of dual-tone multifrequency superposition.
For the noise that signal drop when avoiding converting between frequency causes generation people ear to hear, in the touch-tone signal cycle of each transmission, intermediate intensity value is the highest, 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 client's unit sends acoustic signals, loop play continuously by dual-tone multifrequency superposed signal information, until receive the transaction data such as Transaction Information, trade company's account and consumption certificate number that transactional services unit sends or arrive time-out time.
Vendor end unit detects the dual-tone multifrequency superposed signal information obtained of recording, and namely calculates the double-tone frequency of the sound signal in each duration section, and contrast coding rule determines corresponding numerical value.According to nyquist sampling theorem, " if signal is band limit, and sample frequency is higher than one times of signal bandwidth, and so, continuous signal originally can completely rebuild out from sample." this example adopt recording sample frequency be 44.1K or higher frequency, make the ultrasonic signal of 16K-22KHZ completely to rebuild out from sample.
Carry out analysis to the frequency spectrum of signal and can judge frequency information, in this example, receiving end adopts the Frequency and Amplitude value for sound signal to calculate not only effectively but also fast Goertzel algorithm to the analysis of signal spectrum.
In this example, during decoded data, be 1 frame with the audio-frequency information of single frequency duration and every 40 milliseconds, during 14 partial data transmission, once complete recording totally 600 milliseconds, namely represents that the information of 14 frame partial datas adds that 1 vertical shift retains information; Every 1 frame information of 14 frame informations being calculated and resolves, the range value of 8 frequencies in this frame in coding rule, for avoiding a frame to cause erroneous judgement across two signal periods, when calculating range value, only the audio-frequency information of first 20 milliseconds of every frame being participated in computing; 3 large frequencies before sequence amplitude value, are designated as the frequency 1 of this frame, frequency 2, frequency 3.
After the Frequency and Amplitude value of 14 frames has calculated, the frequency 1 of each frame, frequency 2 are combined corresponding numerical value, form 14 complete data and verify.If verify unsuccessfully, then more sequentially by the frequency 1 of each frame, frequency 3 combines and frequency 2, frequency 3 combine that corresponding numerical value replaces frequency 1, frequency 2 combines corresponding numerical value, form 14 complete data and verify.
If the start bit of complete audio information is improper, one frame may across two signal periods, Frequency and Amplitude value will be caused to judge by accident, if so still verify failure, then the reference position of complete audio information is offset 10 milliseconds backward, re-execute this step, repeat 4 times altogether, until verification succeeds or skew number of times all execute.Alternative combination of frequency participates in computing, can effectively improve Data Analysis success ratio, eliminates the impact of environmental noise, sensitivity of microphone.For avoiding erroneous judgement and reducing operand, for the calculation step of 4 different start bits, maximum frequency range value summation can be gathered respectively, only the data of the step of verification first 2 of summation, ignore the data of the step of after summation 2.
For each group of 14 partial datas, the method for calibration often organizing data is as follows: circulation searching verification beginning flag, and verification beginning flag data are backward moved to data forefront by the position rearrangement reaction data occurred by verification beginning flag.At this moment, first 4 is proof test value, and the 5th is 8 bit data that need transmit to the 12nd, and whether the proof test value calculating 8 bit data equals front 4 bit check values; If equal, then show that this 8 bit data is the data of correct need transmission, data transmission success completes; If unequal, then whether equally continue other proof test values respectively organizing data of cycle calculations.By the verification of 4 bit check values, ensure that the accuracy of data.
As mentioned above, although represented with reference to specific preferred embodiment and described the present invention, it shall not be construed as the restriction to the present invention self.Under the spirit and scope of the present invention prerequisite not departing from claims definition, various change can be made in the form and details to it.