Smart mobile phone and its data transmission method and system
Technical field
The present invention relates to technical field of data transmission, more particularly to a kind of smart mobile phone and its data transmission method and being
System.
Background technology
Two processors are generally comprised in intelligent mobile phone platform:The referred to as application processor of responsible calculating business
(Application Processor, AP), that is responsible for communication service is referred to as BBP(Base band Processor,
BP).Two processors have each independent storage system, and the chip operation program that runs is also completely self-contained.
The online upgrading of smart mobile phone not only includes the chip operation program upgrading of application processor, while also including base band
The chip operation program upgrading of processor.Wherein, application processor can be directly by downloading data bag to the storage system of itself
Online upgrading is carried out in system, and BBP itself does not have the function of file download, accordingly, it would be desirable to by application processor elder generation
Packet is downloaded in the storage system of application processor control, then the storage that above-mentioned packet is controlled by application processor
In transmitting in system to the storage system of BBP control.
Pass through USB in prior art(Universal Serial Bus, USB)Or universal asynchronous receiving-transmitting is passed
Defeated device(Universal Asynchronous Receiver/Transmitter, UART)To realize application processor and base band
Data transfer between processor.
When the data transfer between application processor and BBP is realized using USB, due to BBP
USB controller and USB interface are not included, the therefore realization of such scheme needs USB controls are set up on BBP
Device and USB interface, result in BBP high cost and take up room excessive.
When the data transfer between application processor and BBP is realized using UART, due to the transmission of UART
, generally in below 5Mbps, therefore transfer rate is too slow for speed, it is impossible to meets and requires.
As can be seen here, realize in prior art that the method for data transfer between application processor and BBP cannot be same
When take into account the requirement of cost and transfer rate.
Content of the invention
What the present invention was solved is the method for realizing data transfer between application processor and BBP in prior art
The technical problem of cost and transfer rate is taken into account simultaneously cannot.
In order to solve the above problems, the embodiment of the present invention provides a kind of data transmission method, at application processor and base band
Reason device is transmitted by data handshakes data wire control data, including:
When determining the data handshakes data wire for the first time in the first level, the application processor is by outside serial
If the data output data wire of interface SPI is to the length information of the BBP transmission objectives file;
When determining that the data handshakes data wire is in the first level second, the application processor is by described
The data output data wire of SPI transmits the file destination to the BBP.
Optionally, institute is transmitted to the BBP by the data output data wire of SPI in the application processor
After stating file destination, also include:
The BBP is verified to the file destination for receiving, and draws check results information;
When the data handshakes data wire third time is determined in the first level, the BBP is by SPI's
Data input data wire transmits the check results information to the application processor.
Optionally, institute is transmitted to the application processor by the data input data wire of SPI in the BBP
After stating check results information, in the case where the check results information is for mistake, also include:
When determining that the data handshakes data wire is in the first level the 4th time, the application processor is by described
The data output data wire of SPI transmits the file destination to the BBP.
Optionally, institute is transmitted to the application processor by the data input data wire of SPI in the BBP
After stating check results information, in the case where the check results information is for mistake, also include:
When determining that the data handshakes data wire is in the first level the 4th time, the application processor is by described
The data output data wire of SPI transmits the length information of the file destination to the BBP;
When determining that the data handshakes data wire is in the first level the 5th time, the application processor is by described
The data output data wire of SPI transmits the file destination to the BBP.
Optionally, the file destination is the chip operation program upgrade file of the BBP.
In order to solve the above problems, the embodiment of the present invention also provides a kind of data transmission system, including:Application processor and
BBP, the application processor and the BBP are held by the data output data wire and data of SPI respectively
Hand data wire is connected, wherein:
The application processor, when determining the data handshakes data wire for the first time in the first level, by described
The data output data wire of SPI sends the length information of file destination to the BBP;When the determination data handshakes
When data wire is in the first level second, institute is sent to the BBP by the data output data wire of the SPI
State file destination;
The BBP, when determining the data handshakes data wire for the first time in the first level, by described
The data output data wire of SPI receives the length information of the file destination that the application processor sends;Described when determining
When data handshakes data wire is in the first level second, by answering use described in the data output data wire reception of the SPI
The file destination that reason device sends.
Optionally, data input data wire of the application processor with the BBP also by SPI is connected,
The BBP, is additionally operable to the file destination to receiving and verifies, draw check results information;
When the data handshakes data wire third time is determined in the first level, by the data input data wire of the SPI to institute
State application processor and send the check results information;
The application processor, is additionally operable to, when the data handshakes data wire third time is determined in the first level, lead to
The data input data wire for crossing the SPI receives the check results information that the BBP sends.
Optionally, the application processor, be additionally operable to the BBP by the data input data wire of SPI to
After the application processor sends the check results information, in the case where the check results information is for mistake, when true
When the fixed data handshakes data wire is in the first level the 4th time, by the data output data wire of the SPI to the base
Provided with processor sends the file destination;
The BBP, is additionally operable to sending institute by the data input data wire of SPI to the application processor
After stating check results information, in the case where the check results information is for mistake, when the determination data handshakes data wire
When being in the first level the 4th time, received described in the application processor transmission by the data output data wire of the SPI
File destination.
Optionally, the application processor, be additionally operable to the BBP by the data input data wire of SPI to
After the application processor sends the check results information, in the case where the check results information is for mistake, when true
When the fixed data handshakes data wire is in the first level the 4th time, by the data output data wire of the SPI to the base
Provided with processor sends the length information of the file destination;When determining that the data handshakes data wire is in the first level the 5th time
When, the file destination is sent to the BBP by the data output data wire of the SPI;
The BBP, is additionally operable to sending institute by the data input data wire of SPI to the application processor
After stating check results information, in the case where the check results information is for mistake, when the determination data handshakes data wire
When being in the first level the 4th time, received described in the application processor transmission by the data output data wire of the SPI
The length information of file destination;When determining that the data handshakes data wire is in the first level the 5th time, by the SPI's
Data output data wire receives the file destination that the application processor sends.
Optionally, the file destination is the chip operation program upgrade file of the BBP.
In order to solve the above problems, the embodiment of the present invention also provides a kind of smart mobile phone, including above-mentioned data transmission system.
Compared with prior art, the technical scheme of the embodiment of the present invention has advantages below:
Sequential by the level state of identification data handshake data line and in the level state, controls to apply
Processor by the data output data wire of existing SPI to BBP transmission data, so as to need only to set up one
Data wire, you can realize the function of data transfer between application processor and BBP and data-flow-control, low cost,
The little, transfer rate that takes up room is fast.And as the level change of hardware can be detected in microsecond rank, therefore respond speed
Degree is faster.
Further, the BBP is verified to the file destination for receiving, and show that check results are believed
Breath, and changed by the level of the data handshakes data wire, indicate that the BBP is anti-to the application processor
Feedback check results information, so that furthermore achieved that the function of reception state reply.
Further, in the case where the check results information is for mistake, by the electricity of the data handshakes data wire
Flat change, indicates that the application processor carries out the re-transmission of wrong data to the BBP, so as to further realize
The function of erroneous retransmissions.
Description of the drawings
Fig. 1 is data transmission system structured flowchart in the embodiment of the present invention;
Fig. 2 is data transmission method flow chart in the embodiment of the present invention one;
Fig. 3 is data handshakes data wire operating protocol sequential chart in the embodiment of the present invention one;
Fig. 4 is data transmission method flow chart in the embodiment of the present invention two.
Specific embodiment
Serial Peripheral Interface (SPI)(Serial Peripheral Interface, SPI)Worked with master-slave mode, generally included
From equipment, SPI standard agreement includes four data lines, respectively clock signal data line to one main equipment and at least one
(SCK), data output data wire(SDO), data input data wire(SDI)Data wire is selected with piece(CS).
It is connected by SPI between application processor and BBP, wherein, the transfer rate of SPI can reach
The transfer rate of 50Mbps, significantly larger than UART.As shown in figure 1, in the embodiment of the present invention, included by SPI standard agreement
On the basis of four data lines, a single data handshake data line Request_CLK is increased, by identification data handshake data line
Level state and the sequential in the level state, the data for controlling application processor 101 by existing SPI are defeated
Go out data wire to 102 transmission data of BBP, so as to need only to set up data lines, you can realize application processor
The function of data transfer and data-flow-control between 101 and BBP 102, low cost, take up room little, transfer rate
Hurry up.And as the level change of hardware can be detected in microsecond rank, therefore response speed is faster.
For more fully understanding those skilled in the art and realizing the present invention, referring to the drawings, by specific embodiment
It is described in detail.
Embodiment one
Data transmission method flow chart with reference to shown in Fig. 2, is described in detail below by way of concrete steps:
S201, when determining the data handshakes data wire for the first time in the first level, the application processor passes through
Length information of the data output data wire of serial peripheral equipment interface SPI to the BBP transmission objectives file.
In the present embodiment, application processor and BBP are transmitted by data handshakes data wire control data.
In being embodied as, the application processor and the BBP determine whether data handshakes data wire is in
The action of the first level can be separate, i.e., described application processor and the BBP determine the number respectively
The first level whether is according to handshake data line, rather than testing result is transferred to the opposing party again after only being detected by a side.
In being embodied as, first level can be low level, in the case of first level is low level,
The high level produced when can avoid system electrification is mistakenly considered data transfer signal.It is understood that first electricity
Flat can also be high level, and in the case where first level is high level, application processor and BBP can be with head
Produce when first judging whether the high level is system electrification, for example, can be realized by way of software, so as to avoid
The erroneous judgement of signal.
The application processor is a continuous process to the length information of the BBP transmission objectives file,
From the beginning of the data handshakes data wire is detected for the first level, till lasting till that first level terminates.
S202, when determining that the data handshakes data wire is in the first level second, the application processor passes through
The data output data wire of the SPI transmits the file destination to the BBP.
In being embodied as, the file destination can be the chip operation program upgrade file of the BBP,
Can certainly be other files.
By the level state of identification data handshake data line and in the level in step S201 and step S202
The sequential of state, controls application processor by the data output data wire of existing SPI to BBP transmission data,
Wherein, step S201 is used for data-flow-control, and step S202 is used for data transfer, so as to need only to set up data lines, i.e.,
The function of data transfer and data-flow-control between achievable application processor and BBP, low cost, takes up room
Little, transfer rate is fast.And as the level change of hardware can be detected in microsecond rank, therefore response speed is faster.
S203, the BBP are verified to the file destination for receiving, and draw check results information.
File destination is verified, show that the work of check results information can be independently complete by the BBP
Into, specific verification mode can be diversified, for example can be by the check information that is included in file destination come right
File destination is verified.
In being embodied as, can be by verification information Store in the header part of file destination.It is understood that described
Check information is stored in the other parts of file destination.
S204, when the data handshakes data wire third time is determined in the first level, the BBP passes through
The data input data wire of SPI transmits the check results information to the application processor.
In the present embodiment, changed by the level of the data handshakes data wire, indicate the BBP to institute
Application processor feedback check object information is stated, so as to furthermore achieved that the function of reception state reply.
The operating protocol sequential chart of data handshakes data wire described in the present embodiment is as shown in figure 3, with described first in figure
As a example by level is low level.
Low level stage first time 301 of the data handshakes data wire is file destination Length Indication stage d1, now,
The application processor passes through the length information of the data output data wire of SPI to the BBP transmission objectives file,
To inform when data transfer terminates.
Second low level stage 302 of the data handshakes data wire is file destination data transfer phase d2, described
Application processor transmits the file destination, the base by the data output data wire of the SPI to the BBP
The length information of the file destination that provided with processor was received according to low level stage first time 301 calculates when data transfer is tied
Beam.
The third time low level stage 303 of the data handshakes data wire is data receiving state recovery stage d3, described
BBP transmits the check results information by the data input data wire of SPI to the application processor.
In being embodied as, only when the check results information is mistake can feed back to the application processor
Check results information., in the case where check results information is not received, default data transmission is correct for the application processor.
It is understood that the function of reception state reply in being embodied as, can be realized using above-mentioned means, also may be used
To realize the data transfer between application processor and BBP only by step S201 and step S202.
In the case where reception state recovery function is not needed, the file destination in S203 to receiving carries out school
Test, can also omit in the lump the step of draw check results information.
In being embodied as, exceed default threshold when the time that application processor and BBP are not detected by the first level
During value, whole flow process can be reset.
Embodiment two
The present embodiment is with the difference of embodiment one, furthermore achieved that the function of erroneous retransmissions, with reference to Fig. 4 institutes
The data transmission method flow chart for showing, wherein step S201 to S204 are referred to the concrete steps in embodiment one, below in detail
Describe the bright step different from embodiment one in detail:
S205, when determining that the data handshakes data wire is in the first level the 4th time, the application processor passes through
The data output data wire of the SPI transmits the file destination to the BBP.
Before erroneous retransmissions are carried out, need first to be verified to receiving file destination by the BBP, obtain
Go out check results information, and by the check results feedback of the information to the application processor.Therefore, the reality of erroneous retransmissions function
On the basis of now needing establishment step S203 and step S204, in the case where the check results information is for mistake, just carry out
Erroneous retransmissions.
S206, when determining that the data handshakes data wire is in the first level the 4th time, the application processor passes through
The data output data wire of the SPI transmits the length information of the file destination to the BBP.
S207, when determining that the data handshakes data wire is in the first level the 5th time, the application processor passes through
The data output data wire of the SPI transmits the file destination to the BBP.
When erroneous retransmissions are carried out, only the file destination can be retransmitted, i.e. execution step S205, it is also possible to
The length information and the file destination of the file destination are all retransmitted, i.e. execution step S206 and step S207.
In being embodied as, can further to re-transmission after data verify again, and in check results information
Data re-transmission is carried out again in the case of for mistake, till data transfer is correct.
In being embodied as, exceed default threshold when the time that application processor and BBP are not detected by the first level
During value, whole flow process is reset.
Embodiment three
Data transmission system with reference to shown in Fig. 1, including:Application processor 101 and BBP 102, the application
Processor 101 is connected with data handshake data line by the data output data wire of SPI respectively with the BBP 102,
Wherein:
The application processor 101, when determining the data handshakes data wire for the first time in the first level, by institute
The data output data wire for stating SPI sends the length information of file destination to the BBP 102;When the determination data
When handshake data line is in the first level second, by the data output data wire of the SPI to the BBP 102
Send the file destination;
The BBP 102, when determining the data handshakes data wire for the first time in the first level, by institute
The data output data wire for stating SPI receives the length information of the file destination that the application processor 101 sends;Work as determination
When the data handshakes data wire is in the first level second, described answering is received by the data output data wire of the SPI
The file destination sent with processor 101.
In the present embodiment, by the level state of identification data handshake data line and in the level state when
Sequence, controls application processor 101 by the data output data wire of existing SPI to 102 transmission data of BBP, from
And need only to set up data lines, you can realize data transfer and the number of application processor 101 and BBP 102
According to the function of stream control, low cost, the little, transfer rate that takes up room are fast.And as the level change of hardware can be in Microsecond grade
It is not detected, therefore response speed is faster.
Data input data wire of the application processor 101 with the BBP 102 also by SPI is connected,
The BBP 102, is additionally operable to the file destination to receiving and verifies, and show that check results are believed
Breath;When data handshakes data wire third time is determined in the first level, by the data input data wire of the SPI to
The application processor 101 sends the check results information;
The application processor 101, is additionally operable to when the data handshakes data wire third time is determined in the first level,
The check results information that the BBP 102 sends is received by the data input data wire of the SPI.
Further, the file destination that the BBP 102 pairs is received is verified, and draws check results
Information, and changed by the level of the data handshakes data wire, indicate that the BBP 102 is processed to the application
101 feedback check object information of device, so that furthermore achieved that the function of reception state reply.
The application processor 101, be additionally operable to the BBP 102 by the data input data wire of SPI to
After the application processor 101 sends the check results information, in the case where the check results information is for mistake, when
Determine the data handshakes data wire the 4th time in the first level when, by the data output data wire of the SPI to described
BBP 102 sends the length information of the file destination;When determining the data handshakes data wire the 5th time in the
During one level, the file destination is sent to the BBP 102 by the data output data wire of the SPI;
The BBP 102, is additionally operable to passing through the data input data wire of SPI to the application processor 101
After sending the check results information, in the case where the check results information is for mistake, when the determination data handshakes
When data wire is in the first level the 4th time, the application processor 101 is received by the data output data wire of the SPI
The length information of the file destination for sending;When determining that the data handshakes data wire is in the first level the 5th time, pass through
The data output data wire of the SPI receives the file destination that the application processor 101 sends.
Further, in the case where the check results information is for mistake, by the electricity of the data handshakes data wire
Flat change, indicates that the application processor 101 carries out the re-transmission of wrong data to the BBP 102, so as to enter one
Step achieves the function of erroneous retransmissions.
Example IV
The present embodiment provides a kind of smart mobile phone, and the smart mobile phone includes the data transmission system provided in embodiment three
System.
The application processor of the smart mobile phone is directly carried out in the storage system of itself by downloading data bag online
Upgrading, and packet is first downloaded to application processor control by application processor when carrying out online upgrading by BBP
In storage system, then depositing to BBP control in the storage system that above-mentioned packet is controlled, is transmitted by application processor
In storage system.
In the present embodiment, by the level state of identification data handshake data line and in the level state when
Sequence, controls application processor by the data output data wire of existing SPI to BBP transmission data, so as to only
Need to set up data lines, you can realize data transfer between application processor and BBP and data-flow-control
Function, low cost, the little, transfer rate that takes up room are fast.And as the level change of hardware can be detected in microsecond rank,
Therefore response speed is faster.
One of ordinary skill in the art will appreciate that all or part of step in the various methods of above-described embodiment is can
Completed with instructing the hardware of correlation by program, the program can be stored in a computer-readable recording medium, storage
Medium can include:ROM, RAM, disk or CD etc..
Although present disclosure is as above, the present invention is not limited to this.Any those skilled in the art, without departing from this
In the spirit and scope of invention, can make various changes or modifications, therefore protection scope of the present invention should be with claim institute
The scope of restriction is defined.