CN104202312A - Rapid and stable data transmission method based on mobile phone audio channels - Google Patents

Rapid and stable data transmission method based on mobile phone audio channels Download PDF

Info

Publication number
CN104202312A
CN104202312A CN201410417978.8A CN201410417978A CN104202312A CN 104202312 A CN104202312 A CN 104202312A CN 201410417978 A CN201410417978 A CN 201410417978A CN 104202312 A CN104202312 A CN 104202312A
Authority
CN
China
Prior art keywords
data
transmission method
mobile phone
method based
data transmission
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201410417978.8A
Other languages
Chinese (zh)
Inventor
王翔平
沈勇坚
胡永刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dynamicode Co Ltd
Original Assignee
Dynamicode Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Dynamicode Co Ltd filed Critical Dynamicode Co Ltd
Priority to CN201410417978.8A priority Critical patent/CN104202312A/en
Publication of CN104202312A publication Critical patent/CN104202312A/en
Pending legal-status Critical Current

Links

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a rapid and stable data transmission method based on mobile phone audio channels. The rapid and stable data transmission method based on the mobile phone audio channels comprises encoding data to be transmitted through differential Manchester encoding, and within a fixed cycle, if voltage jump exists, showing 0, and if no voltage jump exists, showing 1. Therefore, when matched with relevant hardware technology, the rapid and stable data transmission method based on the mobile phone audio channels can well solve the problems of data transmission velocity and relevant compatibility.

Description

A kind of fast and stable data transmission method based on handset audio passage
Technical field
The present invention relates to mobile communication technology, be specifically related to the audio data transmission technology of mobile phone.
Background technology
The development of current social smart mobile phone is maked rapid progress, operating system is also not only upgraded, the external interface of mobile phone terminal mainly contains 2: USB interface (i Phone is Dock interface) and handset audio channel interface, therefore by audio interface, communicating by letter with the related application of mobile phone terminal APP is to have very much market and development potentiality.There is application in this technical market at present, but have compatibility and transmission rate issues, and user experience is not high.
Although there is the equipment of the data-transmission mode that some are relevant in Vehicles Collected from Market, but there is no unified standard and the otherness of port based on cell phone manufacturer, the mobile phone of one or more respective type is only supported or mated to city's field device, causes generalization and practicality greatly to reduce.
Wherein, compatibility issue is mainly that cell phone manufacturer does not have unified audio standard, and terminal equipment need to solve data integrity and stability problem on software and hardware.The difference that terminal data receives mainly appears at the inconsistence problems of mobile phone MAC port different in audio interface and ground port.For example HTC mobile phone is just in time contrary at the interface of MAC and ground end with Huawei mobile phone.If do not processed, so identical data there will be difference when receiving, cause compatibility poor, part manufacturer is by hardware device, when transfer of data, first find ground and the MAC interface of audio frequency, but will greatly increase hardware cost like this, and can greatly affect the apparent size of equipment, be unfavorable for portable and small and exquisite feature, change after mobile phone, hardware need to detect again simultaneously.
For the different mobile phones of compatibility, and guarantee correctness and the integrality of data, some mobile phone is when transmitting data by audio frequency, the transmission rate of just having to reduce, for some, need to transmit quickly and accurately the situation of data, cannot complete by the voice-grade channel interface of this mobile phone, this will affect and limit the application of mobile phone greatly.
Summary of the invention
The compatibility and the speed problem that for existing handset audio passage, when transmitting data, exist, the object of the present invention is to provide a kind of fast and stable data transmission method based on handset audio passage, and solve message data rate and relevant compatible problem with this.
In order to achieve the above object, the present invention adopts following technical scheme:
A fast and stable data transmission method based on handset audio passage, described transmission method utilizes the difference manchester data to be sent of encoding, and within a fixing cycle, if voltage exists saltus step to represent 0, voltage does not exist saltus step to represent 1.
In such scheme, when sending data, necessarily there is the saltus step of data in mobile phone terminal within 2 adjacent cycles.
Further, when data start to transmit, first transmit leg initiates transfer of data can to one section of initial previous video frames, then according to this previous video frames, determine the time of each fixed cycle, in one-period, start counting, if when encountering next saltus step, the time of time much larger than fixed cycle, think so and there is no saltus step within this cycle, the data bit of reception is 1, otherwise data are position 0.
Further, the described time of being carried out definite fixed cycle by previous video frames, specifically given by timer.
Further, in transmitting procedure, by timer, sample, when edge transition, show that the value of counter is controlled rate compatible.
Mobile audio interface data transmission scheme provided by the invention, mobile phone that can be compatible different, and can under the prerequisite that guarantees data correctness and integrality, greatly improve the transmission rate of data, well solve available data transfer rate and relevant compatible problem.
Accompanying drawing explanation
Below in conjunction with the drawings and specific embodiments, further illustrate the present invention.
Fig. 1 is the schematic diagram of manchester coding;
Fig. 2 is the oscillogram that employing standard manchester coding sends data 0x9C;
Fig. 3 is for adopting the oscillogram that the rear half period of the last position of difference manchester coding transmission data 0x9C and byte 0x9c is electronegative potential;
Fig. 4 is for adopting the oscillogram that the rear half period of the last position of difference manchester coding transmission data 0x9C and byte 0x9c is high potential;
Fig. 5 is the schematic diagram of previous video frames in the present invention;
Fig. 6 obtains the flow chart in the sampling time of fixed cycle in the present invention;
Fig. 7 is agreement and the hierarchical Design schematic diagram of transfer of data in example of the present invention.
Embodiment
For technological means, creation characteristic that the present invention is realized, reach object and effect is easy to understand, below in conjunction with concrete diagram, further set forth the present invention.
The data of audio interface need to be shaken generation, therefore can not be according to basic embedded level input and output.Simple high level and simple low level are nonsensical for audio interface, need to represent by relevant coded system corresponding data, the namely encoding and decoding of data.
Manchester's code (Manchester Encoding), is also called phase code, is usually used in local area network (LAN) transmission.With the saltus step of voltage, represent to distinguish 0 and 1, with positive voltage saltus step (low level is to high level saltus step), represent 0, negative voltage saltus step (high level is to low transition) represents 1, therefore obtain after suitable waveform hardware handles is complete, software is by interrupting or voltage sample carrys out the content of specified data.Manchester coding as shown in Figure 1, synchronization frame and to stop frame be data integrity and the function that plays shake.
Hence one can see that, and standard Manchester's code is within a fixing cycle: rising edge represents current potential 0, and trailing edge represents current potential 1, for example, send data 0x9C, and so according to Manchester's code, waveform should be as shown in Figure 2.
Because different mobile phone take-off potentials is not identical, some mobile phone take-off potentials are high level, and some mobile phone take-off potentials are low level, if still use the Manchester's code of standard, there will be the phenomenon of data back.
Because difference manchester coding does not need the hardware handles correct data of yet well sampling out, for this reason, this programme adopts Differential Manchester Encoding to solve this problem.In this programme, utilize Differential Manchester Encoding no longer by judgement rising edge and trailing edge, to determine BIT0 and BIT1, but determine by saltus step, in the fixing cycle, if voltage exist saltus step so this current potential be BIT0, if voltage does not have saltus step, this current potential is BIT1 so, efficiently solves thus the problem that mobile phone take-off potential difference causes data back.In 2 cycles that simultaneously guarantee to be connected, the current potential of rear half period in previous cycle is not identical with the current potential of the front half period of rear one-period, guarantees in a word to have saltus step during 2 week.
No matter whether there is thus forward and reverse problem, when sending or accepting data, only need to detect saltus step; The relevant APP of mobile phone terminal, when sending data, need to guarantee necessarily to exist the saltus step of data within 2 adjacent cycles.This programme coding forming accordingly does not need to detect the high electronegative potential of data, only needs to detect whether have saltus step.
Same data 0x9C, if use Differential Manchester Encoding to send, waveform (the rear half period of the last position of byte is electronegative potential, and some mobile phone may occur that) as shown in Figure 3 and Figure 4 so.
Wherein, Figure 3 shows that the oscillogram that the rear half period of the last position of byte 0x9c is electronegative potential; The oscillogram that the rear half period that Figure 4 shows that the last position of byte 0x9c is high potential.
Shown in Fig. 3 and Fig. 4, even according to different mobile phones, there is the problem that waveform is reverse, the coding result of acquisition is 0x9c.
While utilizing such scheme realization to pass through the fast and stable transmission data of handset audio passage, mobile phone is realized the saltus step of data with corresponding application software according to above-mentioned difference manchester coded system, then realizes by audio transmission data by the high and low variation of current potential.It does not need the hardware handles correct data of yet well sampling out, and efficient solution is never with forward and reverse problem of mobile phone take-off potential, compatible high.
Based on such scheme, when data are sent to terminal equipment by mobile phone terminal, when data start to transmit, mobile phone terminal initiates transfer of data can to one section of initial previous video frames.
Because some mobile phone audio-frequency data initial part branch is unstable, in order to guarantee that data are when sending useful data, audio frequency can be stablized, and need to before each transmission data, add the previous video frames of certain length.
Concrete, when operation mobile phone terminal APP, the high electronegative potential of height that mobile phone terminal developer can send certain length is shaken and is stablized audio signal (as shown in Figure 5).
Mobile phone terminal is being initiated after transfer of data by initial previous video frames, and the application program in terminal equipment (firmware program) is determined the sampling time of each fixed cycle according to this previous video frames, and this time is given by timer, and is denoted as Rt.
Simultaneously, in one-period, start counting, if when encountering next saltus step, time is much larger than Rt, be if (Time_CntTmp> (u16) (Time_Cnt+ (Time_Cnt>>1))), think so and there is no saltus step within this cycle, the data bit of reception be 1. otherwise data for position 0.
Wherein, the timer is here the timer in main control chip MCU in terminal equipment, the start-up routine of writing according to execution carrys out opening and closing timer (TIM), after opening timing device, the firmware program in terminal equipment reads the register that this timer is relevant (CNT) and obtains the time regularly.Firmware program is after this register clear 0, and timer can restart to clock.
For above-mentioned starting in one-period, count, for the timer in terminal equipment carries out timer counter in the cycle of a position.
Thus, the firmware program in terminal equipment is specifically realized the time (referring to Fig. 6) of determining the fixed cycle according to previous video frames as follows:
1. mobile phone sends previous video frames, and in terminal equipment, main control chip MCU starts timer (TIM) and starts reception sampling, and CNT clear 0.
When the MIC passage that 2.MCU detects audio frequency is electronegative potential, wait until MIC is high potential always, record the value of register CNT.
3. wait for when the low high potential of MIC jumps to electronegative potential, CNT is clear 0, repeats 2 steps poly-.
4. recording occurring continuously is sampled after 30 times, calculating mean value Rt, and this mean value is the fixedly sampling time Rt of half period.
In this programme, with carrying out calculating mean value latter 20 times in these 30 times samplings, because mixed and disorderly situation may appear in the waveform of first 10 times of mobile phone, cause like this time of record inaccurate.
Moreover the firmware program in terminal equipment is got BIT0 or the BIT1 of current period as follows:
Differential Manchester Encoding based on above-mentioned, in the information data that mobile phone sends, between each and next bit, certainly there is saltus step, therefore while saltus step being detected in one-period, timer CNT clear 0 starts timing, be recorded to always and reappear new saltus step, obtain the value Time_CntTmp of register CNT at that time.
If Time_CntTmp is much larger than the value of Rt for this value, illustrate so within this whole cycle and all there is no saltus step, that illustrate that this cycle represents is BIT1, otherwise illustrates that the value that this cycle represents is BIT0.
As from the foregoing, this programme, by recording high potential or lasting time of electronegative potential in one-period, if this time, much larger than the value of RT, represents BIT1 so, if suitable with the value of RT, represents BIT0 so.This scheme, in the situation that mobile phone MIC transmission data are not mixed and disorderly, even if partial distortion appears in waveform, also can be obtained the data message that mobile phone sends accurately.
For the different mobile phones of compatibility, this programme is by timer sample (adopting high potential or lasting time of electronegative potential in one-period by the timer in MCU main control chip), the value that draws counter when edge transition is controlled rate compatible, has guaranteed to send according to different mobile phone data correct of different rates.
When data send to mobile phone terminal by terminal equipment, equally also use the coded system of this programme, according to the agreement of definition and data erection method, send information to mobile phone terminal, mobile phone terminal decoded data.
Below, by a concrete application example, further illustrate the solution of the present invention:
The data of this example based on above-mentioned mobile phone terminal send and reception programme, realize mobile phone card-brushing project etc.
Whole embodiment has mainly been coordinated by hardware circuit part and software section.
Hardware circuit wherein: mainly complete shaping filter and amplification to mobile phone initial data waveform.
Software for Design: use difference manchester coding, need carry out the logic of the standard frame such as error checking and repeating transmission wait according to the agreement defining and mode data packet packaged data, may send for the larger informational needs subpackage of data volume.
Wherein design agreement and level following (referring to Fig. 7):
Application layer: be mainly application system service logic, application software realizes the funcall of concrete terminal by interface SDK, but SDK interface can not relate to concrete application system logic, only for doing adaptive and some general-purpose interfaces between application layer and data Layer.
Data Layer: mainly take APDU order data form as main, SDK provides support for application layer, and the physical layer interface providing by link layer carries out encapsulated delivery, this layer is only responsible for the sending and receiving of order.
Link layer: for data Layer provides basic-level support, comprise the CRC check of order data, synchronous, wait; Command packet is divided into Frame and uses synchronization frame and stop frame composition transmission frame to be transmitted on physical channel.
Physical layer: for link layer Frame carries out the modulation and demodulation of analog signal, realize the object of transmitting transfer of data by audio interface, this programme is applied to this level, and concrete process as mentioned above, is not repeated herein.
More than show and described basic principle of the present invention, principal character and advantage of the present invention.The technical staff of the industry should understand; the present invention is not restricted to the described embodiments; that in above-described embodiment and specification, describes just illustrates principle of the present invention; without departing from the spirit and scope of the present invention; the present invention also has various changes and modifications, and these changes and improvements all fall in the claimed scope of the invention.The claimed scope of the present invention is defined by appending claims and equivalent thereof.

Claims (5)

1. the fast and stable data transmission method based on handset audio passage, it is characterized in that, described transmission method utilizes the difference manchester data to be sent of encoding, and within a fixing cycle, if voltage exists saltus step to represent 0, voltage does not exist saltus step to represent 1.
2. a kind of fast and stable data transmission method based on handset audio passage according to claim 1, is characterized in that, mobile phone terminal, when sending data, necessarily exists the saltus step of data within 2 adjacent cycles.
3. a kind of fast and stable data transmission method based on handset audio passage according to claim 1 and 2, it is characterized in that, when data start to transmit, first transmit leg initiates transfer of data can to one section of initial previous video frames, then according to this previous video frames, determine the time of each fixed cycle, in one-period, start counting, if when encountering next saltus step, the time of time much larger than fixed cycle, think so and there is no saltus step within this cycle, the data bit receiving is 1, otherwise data are position 0.
4. a kind of fast and stable data transmission method based on handset audio passage according to claim 3, is characterized in that, the described time of being carried out definite fixed cycle by previous video frames, specifically given by timer.
5. a kind of fast and stable data transmission method based on handset audio passage according to claim 3, is characterized in that, in transmitting procedure, by timer, samples, and show that the value of counter is controlled rate compatible when edge transition.
CN201410417978.8A 2014-08-22 2014-08-22 Rapid and stable data transmission method based on mobile phone audio channels Pending CN104202312A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410417978.8A CN104202312A (en) 2014-08-22 2014-08-22 Rapid and stable data transmission method based on mobile phone audio channels

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410417978.8A CN104202312A (en) 2014-08-22 2014-08-22 Rapid and stable data transmission method based on mobile phone audio channels

Publications (1)

Publication Number Publication Date
CN104202312A true CN104202312A (en) 2014-12-10

Family

ID=52087537

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410417978.8A Pending CN104202312A (en) 2014-08-22 2014-08-22 Rapid and stable data transmission method based on mobile phone audio channels

Country Status (1)

Country Link
CN (1) CN104202312A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104580742A (en) * 2015-01-28 2015-04-29 深圳市探索果科技有限公司 Device and method for transmitting data on basis of audio port
CN105763291A (en) * 2014-12-17 2016-07-13 天彩电子(深圳)有限公司 High-speed digital communication method based on cellphone audio signal
CN106327849A (en) * 2016-08-29 2017-01-11 福建新大陆支付技术有限公司 Data communication method based on mobile phone audio frequency

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201654798U (en) * 2010-04-21 2010-11-24 深圳市江波龙电子有限公司 Card reading system, mobile communication terminal and information read-write device of magnetic strip card
CN201780639U (en) * 2010-07-06 2011-03-30 杭州华冲科技有限公司 Passive magnetic card reader
CN102123207A (en) * 2011-03-15 2011-07-13 广州市动景计算机科技有限公司 Information processing method and system based on mobile terminal
CN103002118A (en) * 2011-09-20 2013-03-27 朱星宇 Data transmission method based on audio input output interface

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201654798U (en) * 2010-04-21 2010-11-24 深圳市江波龙电子有限公司 Card reading system, mobile communication terminal and information read-write device of magnetic strip card
CN201780639U (en) * 2010-07-06 2011-03-30 杭州华冲科技有限公司 Passive magnetic card reader
CN102123207A (en) * 2011-03-15 2011-07-13 广州市动景计算机科技有限公司 Information processing method and system based on mobile terminal
CN103002118A (en) * 2011-09-20 2013-03-27 朱星宇 Data transmission method based on audio input output interface

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105763291A (en) * 2014-12-17 2016-07-13 天彩电子(深圳)有限公司 High-speed digital communication method based on cellphone audio signal
CN104580742A (en) * 2015-01-28 2015-04-29 深圳市探索果科技有限公司 Device and method for transmitting data on basis of audio port
CN104580742B (en) * 2015-01-28 2017-02-22 深圳市探索果科技有限公司 Device and method for transmitting data on basis of audio port
CN106327849A (en) * 2016-08-29 2017-01-11 福建新大陆支付技术有限公司 Data communication method based on mobile phone audio frequency

Similar Documents

Publication Publication Date Title
US9710423B2 (en) Methods to send extra information in-band on inter-integrated circuit (I2C) bus
US10027504B2 (en) Protocol-assisted advanced low-power mode
CN104954096B (en) A kind of high-speed synchronous serial communication data transmission method of one master and multiple slaves
CN105850021B (en) Ammeter for loading modulation communication receiver architecture
US20180027174A1 (en) Signaling camera configuration changes using metadata defined for a camera command set
US8675742B2 (en) Method and system for synchronously transmitting asynchronous data
CN102355382A (en) Method for analyzing and triggering controller area network (CAN) bus
US9088403B1 (en) Identification codewords for a rate-adapted version of a data stream
CN102163180A (en) I2C bus interface circuit module and control method thereof
CN104202312A (en) Rapid and stable data transmission method based on mobile phone audio channels
CN204633784U (en) A kind of data transmission device
CN108429612A (en) A kind of semiduplex means of communication of single line
CN201917898U (en) Inter-integrated circuit (I2C) bus interface circuit module
CN105262489A (en) Time delay circuit and time delay method for differential Manchester decoding
CN104333401A (en) Methods, devices and systems for sending and receiving Bluetooth data
TWI624174B (en) Methods and a system for transmitting and receiving audio-video data.
JP2003264598A (en) Encoding and decoding techniques using variable length codes in wireless communication
CN104468042A (en) Data transmission method and system
CN105323053B (en) The method and device of business clock transparent transmission
CN103812610B (en) A kind of data communications method, terminal and information safety devices
US9490964B2 (en) Symbol transition clocking clock and data recovery to suppress excess clock caused by symbol glitch during stable symbol period
CN103685640B (en) A kind of controller of communicating with intelligent terminal based on tone frequency channel wire and communication means thereof
CN102932103B (en) A kind of message transmission rate adaptive reception method based on digital transformer substation
IL259732A (en) Serial data multiplexing
CN102006083B (en) Method for decoding phase code

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20141210