CN104022851A - Mobile terminal as well as method and device for data transmission - Google Patents

Mobile terminal as well as method and device for data transmission Download PDF

Info

Publication number
CN104022851A
CN104022851A CN201410286852.1A CN201410286852A CN104022851A CN 104022851 A CN104022851 A CN 104022851A CN 201410286852 A CN201410286852 A CN 201410286852A CN 104022851 A CN104022851 A CN 104022851A
Authority
CN
China
Prior art keywords
data
carrier
frequency data
binary value
mobile terminal
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
CN201410286852.1A
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.)
Shenzhen ZTE Mobile Telecom Co Ltd
Original Assignee
Shenzhen ZTE Mobile Telecom Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen ZTE Mobile Telecom Co Ltd filed Critical Shenzhen ZTE Mobile Telecom Co Ltd
Priority to CN201410286852.1A priority Critical patent/CN104022851A/en
Publication of CN104022851A publication Critical patent/CN104022851A/en
Pending legal-status Critical Current

Links

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a mobile terminal as well as a method and a device for data transmission, which belongs to the technical field of mobile terminals. The method comprises the following steps that a data transmitting terminal acquires carrier frequency data which are encoded to be binary when receiving a starting instruction, the data transmitting terminal selects continuous identical binary values in the carrier frequency data, maintains a first continuous identical binary values, encodes the other binary values by using repeating codes, and transmits the encoded carrier frequency data, and when receiving the encoded carrier frequency data, the mobile terminal analyzes the repeating codes in the carrier frequency data and decodes the repeating codes into a previous binary value. By adopting the mobile terminal, the problem of error codes caused by imprecise synchronization when peripheral communicates with the mobile terminal is avoided.

Description

The method and apparatus of a kind of mobile terminal and transfer of data thereof
Technical field
The present invention relates to technical field of mobile terminals, be specifically related to the method and apparatus of a kind of mobile terminal and transfer of data thereof.
Background technology
Current intelligent terminal (smart mobile phone, panel computer etc.) mode being connected with peripheral hardware is generally wireless connections (NFC, WIFI, bluetooth etc.) and USB interface connect, the peripheral hardware (as existing pressure sensor, financial terminal equipment etc.) that there is no wireless connections mode for some, can only be connected with intelligent terminal by USB interface, when USB mouth is occupied, these peripheral hardwares cannot be connected with intelligent terminal.It uses upper and inconvenient.In addition, USB mouth communication modes need to pass through certain protocol stack, although its message transmission rate is high, but resources occupation rate is also larger, and does not need the very peripheral hardware of high transfer rate for some, can only connect USB mouth, cause resources occupation rate larger, caused the waste that resource is unnecessary simultaneously.
The patent of CN102394979A discloses a kind of method of utilizing earphone interface to carry out high speed data transfer, between earphone interface and peripheral hardware, pass through wired connection, when peripheral hardware transmits data to mobile phone, peripheral hardware is by described transmission Data Modulation (20-20khz) to audio carrier signal, by coder transitions, it is voice data, the microphone MIC passage that again voice data is sent to the earphone interface of mobile phone is recorded described voice data, the application software of embedded in mobile phone is decoded to voice data, is converted to voice data.
Yet, when peripheral hardware transmits data to intelligent mobile terminal, be loaded with the signal of voice communication frequency range usually because synchronous inaccuracy causes error code problem, particularly for the modulator approach of FSK (Frequency-shift keying), by audio-frequency signal coding, it is binary zero and 1 o'clock, due to 0 and 1 easily generation saltus step, when being communicated, peripheral hardware and intelligent mobile terminal easily cause error code problem.
Summary of the invention
The invention provides the method and apparatus of a kind of mobile terminal and transfer of data thereof, to reach, overcome above-mentioned communication and cause the defect of error code because of synchronous inaccuracy.
The technical scheme that the present invention solves the problems of the technologies described above is as follows.
According to an aspect of the present invention, the method for a kind of transfer of data providing, the method is applied to mobile terminal and data sending terminal, and the method comprises: when data sending terminal receives enabled instruction, obtain and be encoded as binary carrier-frequency data; Data sending terminal is selected consecutive identical binary value in carrier-frequency data, retains first wherein consecutive identical binary value, remaining binary value is encoded with duplication code, and the carrier-frequency data after coding is sent; During carrier-frequency data after mobile terminal receives coding, resolve the duplication code in carrier-frequency data; Duplication code is decoded as to a binary value above.
Preferably, by the carrier-frequency data after the earphone interface received code of mobile terminal.Above-mentioned duplication code is letter.
According to another aspect of the present invention, the method for a kind of transfer of data providing, the method is applied to mobile terminal, and the method comprises: during carrier-frequency data after receiving coding, resolve the duplication code in carrier-frequency data; Duplication code is decoded as to a binary value above.
According to a further aspect of the invention, the method for a kind of transfer of data providing, the method is applied to data sending terminal, and the method comprises: when receiving enabled instruction, obtain and be encoded as binary carrier-frequency data; Select consecutive identical binary value in carrier-frequency data, retain first wherein consecutive identical binary value, remaining binary value is encoded with duplication code, and the carrier-frequency data after coding is sent.
Preferably, the transducer that above-mentioned data sending terminal is peripheral hardware.
According to a further aspect of the invention, a kind of mobile terminal providing, this mobile terminal comprises: parsing module, during for carrier-frequency data after mobile terminal receives coding, resolve the duplication code in carrier-frequency data; Decoder module, for being decoded as duplication code a binary value above.
According to an also aspect of the present invention, a kind of transmitting terminal providing, this transmitting terminal comprises data acquisition module, for when receiving enabled instruction, obtains and is encoded as binary carrier-frequency data; Coding module, for selecting the consecutive identical binary value of carrier-frequency data, retains first wherein consecutive identical binary value, remaining binary value is encoded with duplication code, and the data after coding are sent.
The invention provides the method and apparatus of a kind of mobile terminal and transfer of data thereof, on the basis of FSK modulating-coding and prior art, defined a kind of coded system of duplication code, the transfer of data of being undertaken by this coded system, there is saltus step the adjacent two bits position that can guarantee send, thereby because synchronizeing inaccuracy, causes error code problem while avoiding peripheral hardware to communicate with mobile phone.
Accompanying drawing explanation
Fig. 1 is the flow chart of the method for transfer of data according to an embodiment of the invention;
Fig. 2 is the demonstrative structure block diagram of mobile terminal according to an embodiment of the invention;
Fig. 3 is the demonstrative structure block diagram of transmitting terminal according to an embodiment of the invention;
Fig. 4 is entity connection diagram according to an embodiment of the invention;
Fig. 5 is the Principle of Communication schematic diagram of I2C bus according to an embodiment of the invention.
Embodiment
Below in conjunction with accompanying drawing, principle of the present invention and feature are described, example, only for explaining the present invention, is not intended to limit scope of the present invention.
Fig. 1 is the flow chart of the method for transfer of data according to an embodiment of the invention, below in conjunction with Fig. 1, describe according to the method for the transfer of data of an embodiment of invention, the method is applied to mobile terminal and data sending terminal, and as shown in Figure 1, the method comprises the following steps.
S100, when data sending terminal receives enabled instruction, obtain and be encoded as binary carrier-frequency data.
Wherein, data sending terminal can be the transducer of peripheral hardware, and this transducer includes but not limited to pressure sensor, temperature/humidity pick-up transducers etc.
S200, above-mentioned data sending terminal are selected consecutive identical binary value in carrier-frequency data, retain first wherein consecutive identical binary value, remaining binary value is encoded with duplication code, and the data after coding are sent.
Wherein, above-mentioned duplication code letter ' M ' for example.When adjacent binary value is not identical, above-mentioned consecutive identical binary value refers to this binary system itself (own with oneself identical), and above-mentioned first or last consecutive identical binary value are this binary value itself.
When S300, the carrier-frequency data after mobile terminal receives coding, resolve the duplication code in carrier-frequency data.
S400, this duplication code is decoded as to a binary value above.
Wherein, receiving terminal can be the earphone interface of mobile terminal, and this mobile terminal includes but not limited to panel computer, mobile phone etc.
From only to send data " 0 " in traditional communication code different with data " 1 ", the present invention adopts the thought of introducing data duplication code, use respectively data " 0 ", data " 1 " and Data duplication code represent data to be sent, in communication as while needing to send two identical datas (data " 0 " or " 1 ") continuously, with Data duplication code, replace second data, can guarantee that so there is saltus step the adjacent two bits position sending, for example, while sending a lot of " 0 " or " 1 ", by coding method defined above, its form becomes " 0M0M ... " or " 1M1M ... " thereby the signal of avoiding being loaded with voice communication frequency range causes error code problem because of synchronous inaccuracy.In communication, by the mode that sends continuously two same-sign, represent data communication end mark, while communicating by letter after sending last bit data more additional one be that identical symbol represents sign off sign and beginning flag (beginning flag and end mark are different from last bit data, but can represent with " MM " or " 00 " or " 11 ", the embodiment of the present invention is also unrestricted to this).In test side, data length is determined by the data bit figure place between data communication beginning flag and sign off sign.
It should be noted that the data encoding format described in the embodiment of the present invention is followed successively by data communication initial code, check digit, net load data and DTD identity code.Wherein said check digit is calculated and is adopted RS error correction coding to calculate.
In addition, terminal is according to this coding method, the decoding data that end-on is received, and three kinds of data that occur in communication are respectively the duplication code of data 1, data 0 and data.Corresponding data position 1 when data receiver is 1, corresponding data position 0 when data receiver is 0, represents that when receiving the duplication code of data present bit data bit is identical with the binary value that last position receives.
Fig. 2 is the demonstrative structure block diagram of the device of transfer of data according to an embodiment of the invention, describes a kind of mobile terminal 100 according to an embodiment of the invention below according to Fig. 2, and as shown in Figure 2, this mobile terminal 100 comprises:
Parsing module 01, during for carrier-frequency data after mobile terminal receives coding, resolves the duplication code in carrier-frequency data;
Decoder module 02, for being decoded as this duplication code a binary value above.
Fig. 3 is the demonstrative structure block diagram of transmitting terminal according to an embodiment of the invention, transmitting terminal 200 as shown in Figure 3, and this transmitting terminal comprises:
Data acquisition module 03, for when receiving enabled instruction, obtains and is encoded as binary carrier-frequency data;
Coding module 04, for selecting the consecutive identical binary value of carrier-frequency data, retains first wherein consecutive identical binary value, remaining binary value is encoded with duplication code, and the data after coding are sent.
Above-mentioned transmitting terminal can be the transducer of peripheral hardware, and this transducer includes but not limited to pressure sensor, temperature/humidity pick-up transducers etc.
Fig. 4 is entity connection diagram according to an embodiment of the invention, and as shown in Figure 4, this figure utilizes earphone interface to realize to communicate by letter with slave, and carries out a schematic diagram of transfer of data.Wherein, receiving terminal is any terminal with earphone interface, comprises mobile phone, panel computer etc.Slave (peripheral hardware) is transducer in embodiments of the present invention, pressure sensor for example, temperature/humidity pick-up transducers etc.Receiving terminal is as main frame, clocking, and peripheral hardware, as slave, carries out initialization after the order of receiving terminal, and the information exchange that sends collecting unit collection crosses encoder and encode, and sends digital signal after coding to terminal.
Earphone interface rule has 2.5mm conventionally, several specifications such as 3.5mm, and conventionally there is four-way, respectively L channel L, R channel R, microphone channel MIC and sense channel D, in embodiments of the present invention, need to use left and/or right passage, and MIC passage (i.e. L/R output interface in figure, MIC input interface), wherein, L/R passage is as output, adopt the communication mode of I2C (Inter-Integrated Circuit) bus, MIC passage is as input, receive the digital signal that peripheral hardware sends, and decode by decoder, decoded data are passed to processing and control element (PCE), thereby realize the data interaction of peripheral hardware and terminal.
Fig. 5 is the Principle of Communication schematic diagram of I2C bus according to an embodiment of the invention, and as shown in Figure 5, I2C has two bus lines: a serial data line SDA, a serial time clock line SCL.When scl line is high level, sda line switches to low level from high level, and this situation represents initial conditions; When scl line is high level, sda line is switched to high level by low level, and this situation represents stop condition.Each byte sending on sda line is necessary for 8, and the byte quantity that each transmission can send is unrestricted.Must be with a response bit after each byte.First transmission is the highest order (MSB) of data, for example, if complete (in-line interrupt service routine) some other functions and could receive or send next complete data byte from confidential, can make clock line SCL keep low level, force main frame to enter wait state, after slave is ready to receive next data byte and discharges clock line SCL, transfer of data continues.
Generally speaking, I2C transfer of data must have response, when data wire only being detected and being rising edge or trailing edge, just starts or stops.And in embodiments of the present invention, because L/R interface can only send initialization command as output, therefore after sending order, without wait acknowledge response or the response of ignoring, pressure draws high level or drag down, to start to carry out data receiver or stop carrying out data receiver.
By the method and apparatus of a kind of mobile terminal provided by the invention and transfer of data thereof, on the basis of FSK modulation and prior art, defined a kind of new coded system, the transfer of data of being undertaken by this coded system, there is saltus step the adjacent two bits position that can guarantee send, thereby because synchronizeing inaccuracy, causes error code problem while avoiding peripheral hardware to communicate with mobile phone.
The foregoing is only preferred embodiment of the present invention, in order to limit the present invention, within the spirit and principles in the present invention not all, any modification of doing, equivalent code, improvement etc., within all should being included in protection scope of the present invention.

Claims (8)

1. a method for transfer of data, the method is applied to mobile terminal and data sending terminal, it is characterized in that, and the method comprises:
When receiving enabled instruction described in described data sending terminal, obtain and be encoded as binary carrier-frequency data;
Described data sending terminal is selected binary value consecutive identical in described carrier-frequency data, retains first wherein consecutive identical binary value, remaining binary value is encoded with duplication code, and the carrier-frequency data after coding is sent;
During carrier-frequency data after described mobile terminal receives described coding, resolve the duplication code in described carrier-frequency data;
Described duplication code is decoded as to a binary value above.
2. method according to claim 1, is characterized in that, the earphone interface by described mobile terminal receives the carrier-frequency data after described coding.
3. method according to claim 1 and 2, is characterized in that, described duplication code is letter.
4. a method for transfer of data, the method is applied to mobile terminal, it is characterized in that, and the method comprises:
During carrier-frequency data after receiving coding, resolve the duplication code in described carrier-frequency data;
Described duplication code is decoded as to a binary value above.
5. a method for transfer of data, the method is applied to data sending terminal, it is characterized in that, and the method comprises:
When receiving enabled instruction, obtain and be encoded as binary carrier-frequency data;
Select binary value consecutive identical in described carrier-frequency data, retain first wherein consecutive identical binary value, remaining binary value is encoded with duplication code, and the carrier-frequency data after coding is sent.
6. method according to claim 5, is characterized in that, the transducer that described data sending terminal is peripheral hardware.
7. a mobile terminal, is characterized in that, this mobile terminal comprises:
Parsing module, during for carrier-frequency data after described mobile terminal receives described coding, resolves the duplication code in described carrier-frequency data;
Decoder module, for being decoded as described duplication code a described binary value above.
8. a transmitting terminal, is characterized in that, this transmitting terminal comprises:
Data acquisition module, when receiving enabled instruction, obtains and is encoded as binary carrier-frequency data;
Coding module, for selecting the consecutive identical binary value of described carrier-frequency data, retains first wherein consecutive identical binary value, remaining binary value is encoded with duplication code, and the data after coding are sent.
CN201410286852.1A 2014-06-24 2014-06-24 Mobile terminal as well as method and device for data transmission Pending CN104022851A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410286852.1A CN104022851A (en) 2014-06-24 2014-06-24 Mobile terminal as well as method and device for data transmission

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410286852.1A CN104022851A (en) 2014-06-24 2014-06-24 Mobile terminal as well as method and device for data transmission

Publications (1)

Publication Number Publication Date
CN104022851A true CN104022851A (en) 2014-09-03

Family

ID=51439440

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410286852.1A Pending CN104022851A (en) 2014-06-24 2014-06-24 Mobile terminal as well as method and device for data transmission

Country Status (1)

Country Link
CN (1) CN104022851A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101297486A (en) * 2006-09-25 2008-10-29 华为技术有限公司 Information carrying synchronization code and method for frame timing synchronization
CN103825675A (en) * 2014-01-28 2014-05-28 华南理工大学 Coding method and apparatus in secondary ultrasonic communication

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101297486A (en) * 2006-09-25 2008-10-29 华为技术有限公司 Information carrying synchronization code and method for frame timing synchronization
CN103825675A (en) * 2014-01-28 2014-05-28 华南理工大学 Coding method and apparatus in secondary ultrasonic communication

Similar Documents

Publication Publication Date Title
CN102832968B (en) Method for performing communication between mobile phone and equipment by using audio interface
CN106170781A (en) The method sending extraneous information in (I2C) bus between integrated circuit in band
EP2510744B1 (en) Method for transmitting object between devices having multi-radio interface
CN102394979A (en) Method for performing high-speed data transmission through communication earphone interface
CN103248434A (en) Communication method for electronic device
CN103220428A (en) Audio signal data communication method for cell phone
JP2017511044A (en) Bit allocation via shared bus to facilitate error detection optimization
KR20160065206A (en) Camera control interface slave device to slave device communication
CN201717878U (en) Vehicle communication network data conversion gateway
CN103812536A (en) Bluetooth equipment connecting method and Bluetooth equipment
CN103997571A (en) Business card exchange method based on audio coding
TW201411336A (en) Debug control system and method thereof
US9990330B2 (en) Simultaneous edge toggling immunity circuit for multi-mode bus
CN105681819B (en) Method, device and system for transmitting and receiving signals
CN104951344B (en) Utilize the method and device of voice signal firmware updating
CN103067587A (en) Device, mobile phone and method based on audio interface and used for bidirectional data transmission
CN103812610A (en) Data communication method, terminal and information safety equipment
CN101841393A (en) PWM (Pulse Width Modulation) input module and MVB (Multifunction Vehicle Bus) equipment based on MVB interface
CN104113933A (en) Information transmission method and device and mobile terminal
CN101650872B (en) System and method for collecting power utilization information
KR100927092B1 (en) Method for setting parameter in plc network
JP2010074786A (en) Encoding/decoding system, encoding circuit, decoding circuit, and tag communication device
CN104022851A (en) Mobile terminal as well as method and device for data transmission
CN104008641B (en) Mobile terminal, card reader, mobile terminal audio communication method and mobile terminal voice communication system
CN102420675A (en) Methods and devices for transmitting and receiving using state information of buffer of data message

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20140903