CN107231622A - Mobile terminal and data pack transmission method - Google Patents
Mobile terminal and data pack transmission method Download PDFInfo
- Publication number
- CN107231622A CN107231622A CN201710397275.7A CN201710397275A CN107231622A CN 107231622 A CN107231622 A CN 107231622A CN 201710397275 A CN201710397275 A CN 201710397275A CN 107231622 A CN107231622 A CN 107231622A
- Authority
- CN
- China
- Prior art keywords
- packet
- modem
- length
- character
- compressed
- 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.)
- Withdrawn
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W28/00—Network traffic management; Network resource management
- H04W28/02—Traffic management, e.g. flow control or congestion control
- H04W28/06—Optimizing the usage of the radio link, e.g. header compression, information sizing, discarding information
- H04W28/065—Optimizing the usage of the radio link, e.g. header compression, information sizing, discarding information using assembly or disassembly of packets
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W8/00—Network data management
- H04W8/18—Processing of user or subscriber data, e.g. subscribed services, user preferences or user profiles; Transfer of user or subscriber data
- H04W8/183—Processing at user equipment or user record carrier
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W8/00—Network data management
- H04W8/18—Processing of user or subscriber data, e.g. subscribed services, user preferences or user profiles; Transfer of user or subscriber data
- H04W8/20—Transfer of user or subscriber data
- H04W8/205—Transfer to or from user equipment or user record carrier
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W88/00—Devices specially adapted for wireless communication networks, e.g. terminals, base stations or access point devices
- H04W88/02—Terminal devices
- H04W88/06—Terminal devices adapted for operation in multiple networks or having at least two operational modes, e.g. multi-mode terminals
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The invention discloses a kind of mobile terminal and data pack transmission method, mobile terminal includes the first process chip, second processing chip, the first radio-frequency module and the second radio-frequency module connected based on preset interface, first process chip includes the first application processor for embedding virtual user identifying card, the first modem being connected with entity user identification card, and second processing chip includes the second application processor and second modem;When first modem receives the packet acquisition request that second modem is sent by preset interface, corresponding packet is extracted from virtual user identifying card or entity user identification card;Packet is compressed to cache into the extra buffer buffer of preset interface, so that second modem extracts the packet after compression from buffer, completes the transmission of packet.Present invention, avoiding transmission of data packets, due to containing, value is excessive to cause the situation of terminal crash.
Description
Technical field
The present invention relates to communication technical field, more particularly to a kind of mobile terminal and data pack transmission method.
Background technology
With the development of mobile communication technology, increasing mobile terminal such as smart mobile phone has the work(of double card bilateral
Can so that user realize speech business it is standby simultaneously, can set up data service connection.Mobile terminal generally has two use
Family identification card and the modem being connected respectively with described two Subscriber Identity Modules, during two Subscriber Identity Module standard-sized sheets, one
Individual Subscriber Identity Module (SIM1) can use 4G (the 4th Generation Mobile Communication
Technology, forth generation mobile communication technology), such as LTE (Long Term Evolution, Long Term Evolution) network,
Another Subscriber Identity Module (SIM2) be only capable of using 2G (2-Generation wireless telephone technology,
Second generation mobile communication technical specification) or 3G (3rd Generation, 3rd generation mobile communication technology) network, SIM2 can not on
The reason for 4G, is mainly:Mobile terminal only has a set of radio frequency, and two cards are the relation of time-sharing multiplex using the set radio frequency, can not
Take simultaneously, during due to two card standard-sized sheets, only one card can use 4G networks, and another card can only use 2G or 3G nets
Network, causes the less efficient of data in mobile terminal transmission.
Therefore, in order that mobile terminal can support double LTE, to improve data transmission efficiency, mobile terminal can built-in two
Individual process chip, one modem of each process chip correspondence, so that two SIM cards of mobile terminal connect different tune
Modulator-demodulator, so as to realize double LTE communication functions.But, when the Subscriber Identity Module in mobile terminal is telecommunications card, due to electricity
Letter card is typically greater than the capability value of the extra buffer buffer of data transfer between modem, therefore buffer can not
A complete packet is cached, if directly carrying out data transmission, mobile terminal deadlock is easily caused.
The content of the invention
It is a primary object of the present invention to propose a kind of mobile terminal and data pack transmission method, it is intended to solve existing number
According to bag transmission means, the technical problem of mobile terminal deadlock is easily caused.
To achieve the above object, a kind of mobile terminal for providing of the present invention, including based on preset interface connect first at
Reason chip and second processing chip, the first radio-frequency module for being connected with first process chip and with the second processing
Second radio-frequency module of chip connection, first process chip includes being embedded with the first application processing of virtual user identifying card
Device and entity user identification card connection the first modem, the second processing chip include the second application processor and
Second modem,
First modem, for receiving the packet acquisition request that second modem is sent by preset interface
When, the packet is extracted from virtual user identifying card or entity user identification card and obtains the corresponding packet of request;To carrying
The packet taken is compressed;By in the extra buffer buffer of the data pack buffer after compression to the preset interface, with
The packet after compression is extracted from the buffer for second modem, to complete the transmission of packet.
Alternatively, first modem, can be additionally operable to judgement extract from packet acquisition request
The compressing mark of second modem addition;If compressing mark can be extracted, the packet of extraction is compressed.
Alternatively, first modem, is additionally operable to parse the packet of extraction, described to obtain
The packet header of packet;Packet header based on the packet determines the length of the packet;It is more than in the length of the packet
During predetermined threshold value, then the packet of extraction is compressed.
Alternatively, first modem is compressed to the packet of extraction specifically includes:
First modem obtains the corresponding source text of the packet;
Determine character field of the frequency of occurrences more than predeterminated frequency in source text;
In pre-set dictionary list, the corresponding coding of the character field is searched, wherein, the length of coding is less than corresponding word
Accord with the length of section;
Corresponding character field is replaced by the coding of lookup, to realize the compression of packet.
Alternatively, first modem is additionally operable to, and is determined identical and length is big with the presence or absence of content in source text
In the character field of preset value;
If in the presence of determining the distance and the length of the character field of latter character field and previous character end;
Latter character field is replaced using the mark of distance and length, to realize the compression of packet.
In addition, to achieve the above object, the present invention also proposes a kind of data pack transmission method, applied to mobile terminal, institute
State the first process chip and second processing chip and first process chip that mobile terminal includes connecting based on preset interface
First radio-frequency module of connection and the second radio-frequency module being connected with the second processing chip, first process chip
Including the first modulatedemodulate for being embedded with the first application processor of virtual user identifying card and being connected with entity user identification card
Device is adjusted, the second processing chip includes the second application processor and second modem, and methods described includes:
When first modem receives the packet acquisition request that second modem is sent by preset interface, from
The packet is extracted in virtual user identifying card or entity user identification card and obtains the corresponding packet of request;
The packet of extraction is compressed;
By in the extra buffer buffer of the data pack buffer after compression to the preset interface, for the second modulatedemodulate
Device is adjusted to extract the packet after compression from the buffer, to complete the transmission of packet.
Alternatively, before the step of packet of described pair of extraction is compressed, the data pack transmission method also includes:
Can first modem, which judge obtain in request from the packet, extracts second modem
The compressing mark of addition;
If compressing mark can be extracted, the step of packet for performing described pair of extraction is compressed.
Alternatively, before the step of packet of described pair of extraction is compressed, the data pack transmission method also includes:
First modem is parsed to the packet of extraction, to obtain the packet header of the packet;
Packet header based on the packet determines the length of the packet;
When the length of the packet is more than predetermined threshold value, the step that the packet of described pair of extraction is compressed is performed
Suddenly.
Alternatively, the step of packet of described pair of extraction is compressed includes:
First modem obtains the corresponding source text of the packet;
Determine character field of the frequency of occurrences more than predeterminated frequency in source text;
In pre-set dictionary list, the corresponding coding of the character field is searched, wherein, the length of coding is less than corresponding word
Accord with the length of section;
Corresponding character field is replaced by the coding of lookup, to realize the compression of packet.
Alternatively, it is described right after the step of first modem obtains the packet corresponding source text
The step of packet of extraction is compressed also includes:
Determine in source text with the presence or absence of content is identical and length is more than the character field of preset value;
If in the presence of determining the distance and the length of the character field of latter character field and previous character end;
Latter character field is replaced using the mark of distance and length, to realize the compression of packet.
Mobile terminal and data pack transmission method proposed by the present invention, the mobile terminal are included based on preset interface connection
The first process chip and second processing chip, the first radio-frequency module for being connected with first process chip and with it is described
Second radio-frequency module of second processing chip connection, first process chip includes being embedded with the first of virtual user identifying card
Application processor and the first modem of entity user identification card connection, the second processing chip include the second application
Processor and second modem;First modem receives the data that second modem is sent by preset interface
When bag obtains request, the packet acquisition request is first extracted from virtual user identifying card or entity user identification card corresponding
Packet, is then compressed to the packet of extraction, then by the data pack buffer after compression to the preset interface
In buffer, so that second modem extracts the packet after compression from the buffer, to complete the biography of packet
It is defeated.This programme is first compressed in transmission packet to packet waiting for transmission, then the packet after compression is passed
It is defeated so that the capability value of the packet of transmission has reduced, it is to avoid the situation that mobile terminal crashes in data transmission procedure.
Brief description of the drawings
Fig. 1 is the schematic diagram of the LTE network framework of one embodiment of the invention;
Fig. 2 is a kind of hardware architecture diagram of mobile terminal in the embodiment of the present invention;
Fig. 3 is the interaction schematic diagram between the first modem of the invention and second modem;
Fig. 4 is the schematic flow sheet of data pack transmission method first embodiment of the present invention.
The realization, functional characteristics and advantage of the object of the invention will be explained referring to the drawings in conjunction with the embodiments.
Embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
It should be noted that in the case where not conflicting, the embodiment in the present invention and the feature in embodiment mutually can be tied arbitrarily
Close.
In order to which technical characteristic, purpose and effect to the present invention are more clearly understood from, now compare accompanying drawing and describe in detail
The embodiment of the present invention.
Fig. 1 is the schematic diagram of the LTE network framework of one embodiment of the invention.The LTE network framework of one embodiment of the invention
Including:One or more mobile terminals (user equipment, UE) 100, E-UTRAN (Evolved UMTS
Terrestrial Radio Access Network, the UMTS Terrestrial radio access network of evolution) (non-label in figure), evolution point
Group core (EPC) (non-label in figure), home subscriber servers (HSS) 107, network (for example, internet) (non-label in figure)
And circuit switching system (non-label in figure).
E-UTRAN includes evolution B node (eNodeB) 101 and other eNodeB 102.ENodeB 101 is provided towards shifting
The user plane of dynamic terminal 100 and the protocol terminations of chain of command.ENodeB 101 can be connected to other eNodeB via X2 interface.
ENodeB 101 is alternatively referred to as base station, base transceiver station, radio base station, wireless set, transceiver function, basic service
Collection, extended service set or some other suitable terms.ENodeB 101 is that mobile terminal 1 00 provides the access for going to EPC
Point.
ENodeB 101 is connected to EPC by S1 interfaces.EPC includes mobile management entity (EEM) 104, other moving tubes
Manage entity 106, gateway 103, and packet data network (PDN) gateway 105.Mobile management entity 104 is processing movement
The control node of signaling between terminal 100 and EPC.Mobile management entity 104 provides carrying and connection management.All User IPs
Packet is transmitted by gateway 103, and gateway 103 is itself coupled to PDN Gateway 105.PDN Gateway 105 provides UE IP
Address is distributed and other functions.PDN Gateway 105 is connected to network, for example, internet.
Circuit switching system includes interaction solution module (IWS) 108, mobile switching centre (MSC) 109, base station 110
With movement station 111.In one aspect, circuit switching system can pass through IWS and MME (Mobility Management
Entity, mobile management entity) communicated with EPS (Evolved Packet System, the grouping system of evolution).
Fig. 2 is a kind of hardware architecture diagram of mobile terminal 1 00 in the embodiment of the present invention.
In embodiments of the present invention, mobile terminal 1 00 includes the first process chip 001 and second processing chip 002, with institute
The second radio frequency stated the first radio-frequency module 12 of the first process chip 001 connection and be connected with the second processing chip 002
Module 22.Wherein, the first process chip 001 and second processing chip 002 are connected by preset interface.The preset interface includes
First preset interface and the second preset interface.First process chip 001 should including being embedded with the first of virtual user identifying card 10A
With the modem 11 (modem1) of processor (Application Processor, represented with AP1) 10, first, entity user
Identification card 14 and RPM (Resource Power Manager, resource power supervisor) 15.Second processing chip 002 includes the
Two application processors 20 and second modem (modem2) 21.
Wherein, virtual user identifying card 10A includes memory module and virtual chip operating system (Virtual Chip
Operating System, VCOS), the memory module can be EFS (Encrypting File System, encryption file system
System), memory module is used for the authorization data for storing virtual user identifying card 10A.Entity user identification card 14 is SIM
(Subscriber Identity Module, subscriber identification module) blocks.
The inner frame of first application processor 10 and the second application processor 20 includes application layer, ccf layer etc., can locate
Manage the logical operation of complexity and carry out task distribution etc..In embodiments of the present invention, application processor refers to Android operations system
System, and the various apk (Android Package, Android installation kit) based on Android operation system.
In an embodiment of the present invention, the first application processor 10 and the second application processor 20 pass through the first preset interface
Connection is realized, interactive interface is provided the user, the operational order that user is inputted is (for example, what user was inputted by user interface
Operational order about starting video calling) the first modem 11 or second modem 21 are transferred to, to realize two
The definition and transmission of data between individual application processor, for example, carrying out the dormancy of two application processors, wake-up, synchronous control
Control of chip boot sequence etc. when system, switching on and shutting down.Wherein, the first preset interface be USB (Universal Serial Bus,
USB).It should be appreciated that in embodiments of the present invention, USB data line is multiplexed out two data passages, respectively
For the interaction of user data and control signaling data between the first application processor 10 and the second application processor 20, i.e., first
The data that the application processor 20 of application processor 10 and second is transmitted by USB data line include above two data.Wherein, use
User data includes the data that online is produced, picture and chat message data;Control signaling data include the control data of switching on and shutting down,
Switch the control data of offline mode, the control data of dispaly state signal.
In the present embodiment, the first application processor 10 and the second application processor 20 are entered by OTG (On-The-Go) technology
Row data interaction.By OTG technologies, the first modem 11 in mobile terminal 1 00 can pass through virtual user identifying card 10A
In SIM card parameter access eNodeB 101, second modem 21 can be joined by the SIM card of entity user identification card 14
Count to access eNodeB 101;Or first modem 11 connect by the SIM card parameter in entity user identification card 14
Enter eNodeB 101, second modem 21 accesses eNodeB by virtual user identifying card 10A SIM card parameter
101.SIM card parameter includes but is not limited to SIM card authorization data.
First modem 11 and second modem 21 are connected by the second preset interface.In the embodiment of the present invention
In, the second preset interface is UART (Universal Asynchronous Receiver/Transmitter, universal asynchronous receipts
Send out transmitter).UART is used for the transmission of SIM card parameter between the first modem 11 and second modem 21.Wherein,
The buffer of UART interface is present in the two ends of the first modem 11 and second modem 21, with buffer1 and
Buffer2 is represented.It should be noted that buffer1 and buffer2 correspond to same physical address, by the physical address,
The synchronous change of controllable buffer1 and buffer2 capability values and state.
Specifically:The SIM card data that second modem 21 receives base station transmission by the second radio-frequency module 22 are obtained
When taking request, data acquisition request is sent in the first modem 11, by the feedback response of the first modem 11
SIM card data.
Wherein, the triggering mode of the SIM card data acquisition request includes two kinds:
A, the Active Registration LTE network of second modem 21, to trigger SIM card data acquisition request;
Whether B, base station side need authentication user legal, and authentication request is issued into second modem 21, are adjusted by second
Modulator-demodulator 21 actively sends out SIM card data acquisition request.
Second modem 21 receives the SIM card data acquisition request that base station is sent by the second radio-frequency module 22
When, data acquisition request is sent in the first modem 11 by UART, by the first modem 11 according to data
Obtain request and obtain data from virtual user identifying card 10A or entity user identification card 14, hereafter with the first modem 11
Data instance is obtained according to data acquisition request from virtual user identifying card 10A to be described in detail.
It is to be appreciated that include VCOS operating systems and file system in virtual user identifying card 10A, wherein, institute
VCOS operating systems are stated as the File Agent of memory module, please according to the data acquisition that first modem 11 is sent
Ask and data are extracted from the memory module, the memory module is used for data storage.That is, in the embodiment of the present invention, first adjusts
Modulator-demodulator 11 is can not to be interacted with the memory module inside virtual user identifying card 10A to obtain data, can only be passed through
VCOS operating systems are obtained.Therefore, when first modem 11 sends data acquisition request to Virtual User
During identification card 10A, the VCOS operating systems inside virtual user identifying card 10A parse the address letter of the data acquisition request
Breath, then according to the address information, obtains the corresponding data of the address information from the memory module.As the VCOS
Operating system is got from memory module after data, by the data feedback of acquisition to first modem 11.
First modem 11 is sent data by UART after the data of VCOS operating systems feedback are got
To second modem 21, data are uploaded to base station by final second modem 21 by the second radio-frequency module 22, with
Complete authentication.
COS (Chip Operating System, chip operating system) operating system that entity user identification card 14 is included
And memory module, the mode of operation of acquisition data is consistent with the above from entity user identification card 14, and here is omitted.
Due to having already described above, buffer1 and buffer2 correspond to same physical address, therefore the first modulatedemodulate
When adjusting device 11 by the data pack buffer of extraction to buffer1, packet sends into buffer2 caching, second by the UART
When modem 21 detects the packet in buffer2, you can get the packet, to realize the biography of packet
It is defeated.
It is understood that passing through the first preset interface and/or the second preset interface, you can the first process chip can be achieved
Connection between 001 and second processing chip 002.
The protocol stack of the network formats of first modem 11 and second modem 21 comprising various network interactions,
Protocol stack includes LTE (Long Term Evolution, Long Term Evolution)/WCDMA (Wideband Code Division
Multiple Access, WCDMA)/GSM (Global System for Mobile Communication, the whole world
GSM)/TD-SCDMA (Time Division-Synchronous Code Division Multiple
Access, synchronous time division CDMA)/CDMA (Code Division Multiple Access, CDMA)/EDGE
Inside communication standards such as (Enhanced Data Rate for GSM Evolution, strong type Data for GSM Evolution)
Defined protocol code.Mobile terminal 1 00 is interacted by agreement with carrier network, that is, carry out data traffic online,
VOLTE (Voice Over LTE) is made a phone call or CS (Circuit Switched, circuit switching) domain is made a phone call.First modulation
Demodulator 11 and second modem 21 are additionally operable to management and control to SIM card etc..
In embodiments of the present invention, the first radio-frequency module 12 is used for after the data processing of transmitting the first process chip 001
It is transmitted to eNodeB 101 (base station network), and for being transmitted to the first process chip after the data processing of transmitting eNodeB 101
001.Second radio-frequency module 22 is transmitted to (the base station nets of eNodeB 101 after being used for the data processing of transmitting second processing chip 002
Network), and for being transmitted to second processing chip 002 after the data processing of transmitting eNodeB 101.
Wireless access technology involved by first radio-frequency module 12 and the second radio-frequency module 22 can include LTE, GSM,
GPRS (General Packet Radio Service, general packet radio service), CDMA, EDGE, WLAN (Wireless
Local Area Networks, WLAN), CDMA-2000, TD-SCDMA, WCDMA, WIFI (Wireless
Fidelity, Wireless Fidelity) etc..
Virtual user identifying card 10A and entity user identification card 14 in mobile terminal 1 00 store different radio communications
The associated user profile of standard.It should be appreciated that current mobile terminal only has two use inside a set of radio frequency, mobile terminal
Family identification card can not be taken simultaneously using the relation that the set radio frequency is time-sharing multiplex.For example, in two Subscriber Identity Module standard-sized sheets
When, a card can handle GSM calls, and another card can only handle the 4G network informations, and what which specific Subscriber Identity Module performs
Network is planted, is not limited.Therefore current this framework of radio frequency double card time-sharing multiplex has only accomplished LTE+GSM (i.e. one user
The corresponding technical standard of identification card is LTE, and the corresponding technical standard of another Subscriber Identity Module is GSM).
That is, although existing mobile terminal 1 00 can support Dual-user identification card, mobile terminal 1 00 exists
In the case of registered network, what two Subscriber Identity Modules were supported is the network of different technologies standard, and one is supported 2G or 3G, another
Individual support 4G, can cause during the use of mobile terminal 1 00, surfing flow speed is slower, therefore in the present invention, mobile terminal
100 connect the first process chip 001 and second processing chip 002 by preset interface, because second processing chip 002 includes the
Two modems 21 simultaneously connect the second radio-frequency module 22, and the second radio-frequency module 22 supports 4G networks.Therefore, mobile terminal
100 can possess double LTE functions by the first process chip 001 and second processing chip 002.
In the present embodiment, virtual user identifying card 10A and entity user identification card 14 are used to provide mobile communication business
Related data needed for (CS speech businesses, PS data services and PS speech businesses), and in its storage inside user profile, short disappear
Breath, execution authentication arithmetic and generation cryptographic keys etc..
When entity user identification card 14 is interacted with mobile terminal 1 00, mobile terminal 1 00 detect the Subscriber Identity Module exist with
No signal is only in the instantaneous generation of start, and in the presence of start can't detect Subscriber Identity Module, mobile terminal 1 00 will be prompted to " insert
Access customer identification card ".After mobile terminal 1 00 is started shooting, communication in 28 seconds is once, complete between mobile terminal 1 00 and Subscriber Identity Module
Into the communication check (for example, Subscriber Identity Module whether in place etc.) of some fixations.
In an embodiment of the present invention, virtual user identifying card 10A and the carrying information of entity user identification card 14, and root
Correspondence card parameter is returned according to external world's request, and authentication computing, the first radio-frequency module 12 and the second radio-frequency module are carried out to network
Wireless access technology involved by 22 is LTE.When the first application chip 001 and the second application chip 002 are connected, Virtual User
Identification card 10A can support LTE by the first modem 11 in mobile terminal 1 00, and entity user identification card 14 passes through
Second modem 21 supports LTE;Or, virtual user identifying card 10A can support LTE by second modem 21,
And entity user identification card 14 supports LTE by the first modem 11, to realize that mobile terminal 1 00 can support double LTE.
RPM15 in mobile terminal 1 00 is used for the various resources of management and control, including clock sources, bus resource, PMIC (Power
Management IC, the voltage of power management integrated circuit, i.e. each chip), DDR (Memory Allocation), and managing chip
The deadline that the interruption of dormancy awakening and application processor wake up.The subsystems of mobile terminal 1 00, are needing resource
When, apply for resource to RPM15, subsystems include the first application processor 10, the first modem 11, PRONTO respectively
(WIFI/ bluetooths, NFC (Near Field Communication, near-field communication) etc.), LPASS (Low power audio
Subsystem, low-power consumption audio subsystem), RPM15 is used for determining the resting state of the system of mobile terminal 1 00, is specifically,
Voting mechanisms of the RPM15 based on subsystems realizes that, when subsystems all throw dormancy ticket, RPM15 can just make movement
The whole system of terminal 100 carries out dormancy.After the whole system dormancy of mobile terminal 1 00, if to restart operation, the
Two process chips 002 can automatically wake up, but the first process chip 001 needs second processing chip 002 to wake up, to carry out data
Transmission interaction.
In embodiments of the present invention, connected between the first process chip 001 and second processing chip 002 by preset interface
In the case of, wake-up mode can be following three kinds:
1st, should to second by USB interface transmission detection bag when the first application processor 10 receives control signaling data
With processor 20, to wake up the second application processor 20.
2nd, when second modem 21 receives user data, the second application processor 20 is waken up, by the second application
Device 20 is managed by USB interface transmission detection bag to the first application processor 10, to wake up the first application processor 10.
3rd, second modem 21 periodically searches paging request, with active activation oneself, if receiving paging request,
The second application processor 20 is waken up, detection bag is sent to the first application processor by USB interface by the second application processor 20
10, to wake up the second application processor 20.
In addition, second modem 21 can be with periodic wakeup oneself, to carry out location updating in mobile terminal 1 00
When, interaction of shaking hands is carried out with base station, the first application processor 10 need not be now waken up.
In embodiments of the present invention, mobile terminal includes but is not limited to mobile phone, PC (Personal Computer, personal electricity
Brain) or PAD (Personal Digital Assistant, personal digital assistant).
It should be noted that when the packet of transmission is user data or control signaling data, user data or control letter
Data are made to be transmitted between application processor;When the packet of transmission is SIM card data for Subscriber Identity Module data, SIM card
Data can only be transmitted between modems;Due to the embodiment of the present invention mainly for telecommunications card be SIM card transmission data lead
Cause the situation of terminal crash, therefore the packet that packet in the present embodiment is mainly transmitted between modems.
In the present embodiment, SIM card includes mobile card, UNICOM's card and telecommunications card, wherein, mobile card and UNICOM's card refer to use
The phonecard that 3GPP standard agreements are communicated, the capacity that 3GPP standard agreements define phonecard transmission packet can not exceed
Certain value, the value is set to 512 bytes;And telecommunications card refers to the phonecard using 3GPP2 standard agreements, GPP2 standard agreements
The capacity of the packet transmitted to telecommunications card is not limited, and the capacity of the packet of telecommunications card transmission can typically exceed 512 bytes.
Wherein, mobile card is the SIM card provided a user by China Mobile (operator), UNICOM's card be from CHINAUNICOM (operator) to
The SIM card that user provides, telecommunications card is the SIM card provided a user by China Telecom (operator).
Due to existing buffer capacity typically no more than 512 bytes.Therefore, when the void in mobile terminal 1 00
When plan Subscriber Identity Module 10A or entity user identification card 14 are mobile card or UNICOM's card, due to movement card either UNICOM
Ka Shoufashuojubao data capacity is less than 512 bytes, therefore, and the first modem 11 receives that packet obtains please
When asking, the packet got from virtual user identifying card 10A or entity user identification card 14 is also less than 512 bytes, phase
Answer, the packet stored to buffer is also less than 512 bytes, therefore, the storage that packet can be complete to buffer
In, subsequently, second modem 21 can also take out a complete packet.
But, because telecommunications card is generally higher than 512 bytes, therefore, in the first modem 11 and the second modulation /demodulation
In the data exchange process of device 21, if what is connected in the first modem 11 is telecommunications card, it may appear that such situation:
It is mobile in the case where virtual user identifying card 10A or entity user identification card 14 are telecommunications card by taking Fig. 2 as an example
First modem 11 of terminal 100 extracts a data from virtual user identifying card 10A or entity user identification card 14
Bag, because the packet is more than 512 bytes, and buffer can only disposably cache the packet no more than 512 bytes, this feelings
, can be due to big data bag can not be forwarded to cause the system in case of system halt of mobile terminal under condition.
If solving this problem, according to conventional thinking, the packet will not disposably be forwarded, but tear open
It is divided into multiple packets to be forwarded, but for second modem 21, when having detected packet from buffer
When, it is believed that the packet is complete packet, and now second modem 21 directly obtains the packet from buffer, and
The packet is forwarded to base station.It is obvious that in this case, the packet of forwarding is incomplete packet.
The hardware architecture diagram of Organization Chart and mobile terminal 1 00 based on above-mentioned LTE network, proposes the present invention's
Each embodiment.
Reference picture 2, the present embodiment proposes a kind of mobile terminal, and the mobile terminal 1 00 is included based on preset interface connection
The first process chip 001 and second processing chip 002, be connected with first process chip 001 the first radio-frequency module 12,
And the second radio-frequency module 22 being connected with the second processing chip 002, first process chip 001 is including being embedded with void
The first modem intended Subscriber Identity Module 10A the first application processor 10 and be connected with entity user identification card 14
11, the second processing chip 002 includes the second application processor 20 and second modem 21,
First modem 11, for receiving the packet acquisition that second modem 21 is sent by preset interface
During request, the packet is extracted from virtual user identifying card 10A or entity user identification card 14 and obtains the corresponding number of request
According to bag;
The packet of extraction is compressed;
By in the extra buffer buffer of the data pack buffer after compression to the preset interface, for the second modulatedemodulate
Device 21 is adjusted to extract the packet after compression from the buffer, to complete the transmission of packet.
In the present embodiment, first modem 11 receives second modem 21 by preset interface and sent
Packet obtain request, be also subsequently that packet is fed back to by the second modem 21 by the preset interface.
The preset interface is UART interface.
Wherein, when the second modem 21 of second processing chip 002 by the second radio-frequency module 22 receives base station
When the packet of transmission obtains request, first pass through UART and send packet acquisition request the first of the first process chip 001 to
Modem 11;First modem 11 receives the packet and obtained after request, and request is obtained from void according to packet
Intend obtaining packet in Subscriber Identity Module 10A or entity user identification card 14;First modem 11 is getting packet
Afterwards, in order to ensure that the data of transmission are not more than UART bufferBuffer, first the packet of acquisition is compressed, obtained
Packet after to compression;The packet after compression is sent to by second modem 21 by UART again;Second modulatedemodulate
Adjust device 21 to receive after packet, then packet is uploaded to by base station by the second radio-frequency module 22, to complete the biography of packet
It is defeated.
Specifically, first modem 11 is carried from virtual user identifying card 10A or entity user identification card 14
Take the packet to obtain the corresponding packet of request to specifically include:
First modem 11 is operated in the piece into virtual user identifying card 10A or entity user identification card 14
System sends packet and obtains request, by the chip operating system in virtual user identifying card 10A or entity user identification card
The packet is extracted in file storage module in 14 and obtains the corresponding packet of request, and feeds back to first modulatedemodulate
Adjust device 11;
First modem 11 receives the packet of chip operating system feedback.
In the present embodiment, it is necessary to data in explanation, virtual user identifying card 10A or entity user identification card 14
Bag is stored in file storage module, when the first modem 11 will obtain virtual user identifying card 10A or entity user knowledge
Ka be in 14 packet when, the first modem 11 will not be recognized directly with virtual user identifying card 10A or entity user
File storage module interaction in card 14, but the first COS into virtual user identifying card 10A or entity user identification card 14
It is Request that (Chip Operating System, chip operating system) operating system, which sends packet and obtains request, then
The COS operating systems of virtual user identifying card 10A or entity user identification card 14 are based on the Request in file storage module
Packet is obtained, the packet of acquisition is then transmitted further to the first modem 11, as long as the first modem 11 connects
The packet for receiving COS operating systems feedback is the acquisition process that packet can be achieved.
It is appreciated that because the first modem 11 can not be in virtual user identifying card 10A or entity user identification card
File storage module in 14 directly extracts packet, thus by with virtual user identifying card 10A or entity user identification card
14 COS operating systems are interacted, to realize the extraction of packet, it is ensured that follow-up data transmission procedure is normally run.
When the first modem 11 extracts packet from virtual user identifying card 10A or entity user identification card 14
After the corresponding packet of acquisition request, then the packet of extraction is compressed, in the present embodiment, the first modem 11
When being compressed to packet, the compression of packet can be carried out by the way of ciphered compressed, can also be directly using in plain text
It is compressed.Because the SIM card Network authentication data amount of transmission is smaller, cause data to reduce the operation such as encrypting and decrypting
Efficiency of transmission is low, and the mode that the embodiment of the present invention is preferred to use compression in plain text is compressed to packet, i.e., used in this programme
Compression algorithm with it is simple efficiently based on, the compression algorithm and compression process specifically used is described in detail in embodiments below.
After first modem 11 is to data packet compressing, you can default connect the data pack buffer after compression to described
In mouth UART buffer, so that second modem 21 extracts the packet after compression from the buffer, to complete
The transmission of packet.
It should be noted that buffer is present in the two ends point of the two ends of UART interface, i.e. UART interface in the present embodiment
Buffer1 and buffer2 are not provided with it.When second modem 21 by the second radio-frequency module 22 receive base station send
During data acquisition request, packet is obtained into request the first modem 11, the first modulatedemodulate are sent to by UART interface
Device 11 is adjusted after virtual user identifying card 10A or entity user identification card 14 extract packet, first by the packet of extraction
Store in buffer1, to be transmitted by UART into the buffer2 of second modem 21, second modem 21
Packet is obtained from buffer2 again.
The mobile terminal that the present embodiment is proposed, the first modem receives second modem by preset interface and sent out
When the packet sent obtains request, the packet acquisition is first extracted from virtual user identifying card or entity user identification card please
Corresponding packet is sought, then the packet of extraction is compressed, then the data pack buffer after compression to described preset is connect
In the buffer of mouth, so that second modem extracts the packet after compression from the buffer, to complete packet
Transmission.This programme is first compressed in transmission packet to packet waiting for transmission, then the packet after compression is carried out
Transmission so that the capability value of the packet of transmission reduced, it is to avoid the situation that mobile terminal crashes in data transmission procedure.
Further, mobile terminal second embodiment of the present invention is proposed based on first embodiment.
The difference of mobile terminal second embodiment and mobile terminal first embodiment is, first modem
11, it is additionally operable to judge that the compressing mark for extracting the addition of second modem 21 in request can be obtained from the packet;
If compressing mark can be extracted, the packet of extraction is compressed.
In the present embodiment, request is obtained when second modem 21 sends packet to the first modem 11
(Request) before, in order to prevent the packet of transmission excessive, when second modem 21 sends Request, first determination is
No needs add compressing mark in Request, if desired, a compressing mark, such as addition word are then first added in Request
Section 01, to inform that the first modem 11 is compressed to sent packet.
It should be noted that because data waiting for transmission are determined according to communication protocol standard, therefore, the second modulatedemodulate
Device 21 is adjusted to learn the data type and size of data for the packet that will be obtained, then, when second modem 21 is sent out
Before sending Request, first judge the size of current packet to be obtained, if the size of packet to be obtained beyond
Buffer capability value, then second modem 21 compressing mark is added in Request, to inform the first modem
11 pairs of packets waiting for transmission are compressed, if second modem 21 judge the size of packet to be obtained without departing from
Buffer capability value, then directly transmit Request, without adding compressing mark.
In the present embodiment, before second modem 21 sends Request, the size to packet to be obtained is entered
Row identification, only when packet to be obtained exceeds buffer capability value, just adds compressing mark in Request, it is to avoid
All packets obtain request and all add compressing mark, shorten the time of packet transmission, improve packet transmission
Efficiency.
When the first modem 11 receives the packet of the transmission of second modem 21 by preset interface (UART)
When obtaining request, request first is obtained to the packet and parsed, is carried with determining whether to obtain from the packet in request
The compressing mark that second modem 21 is added is taken out, if extracting compressing mark in the packet obtains request, this
When, first modem 11 can be compressed to the packet of extraction, subsequently again by the data pack buffer after compression
Into the buffer1 of the preset interface, and transmitted by UART into buffer2, so that second modem 21 is from institute
State and the packet after compression is extracted in buffer2, to complete the transmission of packet.
In the present embodiment, transmission of data packets is that the first modem 11 of generation and second modem 21 are called out
After waking up, then after the first modem 11 and second modem 21 wake up, if second modem 21 is logical
The packet acquisition request that the second radio-frequency module 22 receives base station transmission is crossed, following operate is performed:
Judge:The size of packet to be obtained is first determined, to judge whether to need to add compressing mark;
Decision-making:If packet to be obtained exceedes UART bufferBuffer capacity, obtained sending packet
Before request, request addition compressing mark is obtained in packet;
Send:After packet obtains request addition compressing mark, send packet and obtain request.
When first modem 11 receives packet acquisition request by UART, following operate is performed:
Extract:Determine whether to obtain in request from packet and extract compressing mark, if can, extract compressing mark;
Compression:Compressing mark based on extraction, to what is extracted from virtual user identifying card 10A or entity user identification card 14
Packet is compressed;
Feedback:Feed back the packet of compression.
Finally, second modem 21 receives the packet that the first modem 11 feeds back by UART, to complete
Transmission of data packets.Above-mentioned operating process, can refer to Fig. 3.
It should be noted that the transmission of second modem 21 is that packet obtains request, asked because packet is obtained
Generally less than buffer capacity is sought, therefore request can not be obtained to packet and is compressed.
In the present embodiment, the first modem 11 is to packet before being compressed, and can first judge from described
Packet obtains the compressing mark that second modem addition is extracted in request, if compressing mark can be extracted, ability logarithm
It is compressed according to bag, prevents packet to be also compressed when being less than buffer capacity, to prevent the waste of locking system resource, and
The time of packet transmission is saved, so as to improve the efficiency of packet transmission.
Further, mobile terminal 3rd embodiment of the present invention is proposed based on first embodiment.
The difference of mobile terminal 3rd embodiment and mobile terminal first embodiment is, first modem
11, it is additionally operable to parse the packet of extraction, to obtain the packet header of the packet;Bag based on the packet
Head determines the length of the packet;When the length of the packet is more than predetermined threshold value, then the packet of extraction is carried out
Compression.
In the present embodiment, before first modem 11 is compressed to packet, first to from entity user
The packet extracted in identification card 14 is parsed, and to obtain the packet header of the packet, packet is then obtained from packet header
Length, to determine the size of the packet.Wherein, packet is TLV forms, and TLV forms are BER (Basic Encoding
Rules, BER Basic Encoding Rules) coding one kind, full name be Type (type), Length (length), Value (value), T field lists
Show the type of packet, L field represents that the length of packet, V fields are used for the content for depositing packet.
In the present embodiment, the generating process of the packet is:Transport layer gets the corresponding initial data of packet, and is
Initial data adds the data packet head of transport layer, and data packet head includes transport layer data type and data length, obtains initial number
Transmitted according to bag, and by initial data packets to transmission multiplex layer.After transmission multiplex layer receives initial data packets, for initialization number
According to the data packet head of bag addition transmission multiplex layer, data packet head includes the data type and data length of multiplex layer, obtains data
Bag, and call the transmission interface of physical drives layer to send the packet to physical layer.Subsequently, 11 pairs of the first modem is carried
The packet taken is parsed, from the physical drives layer detection packet on physical layer (physical transmission medium)
Packet header, to parse the size (length) for obtaining packet.
After the first modem 11 determines the length of packet, then judge the length of the packet whether more than default
Threshold value (i.e. buffer capability value).In the present embodiment, the predetermined threshold value is chosen as 512 bytes, in other embodiments,
The predetermined threshold value can also be set to other length, no longer limited herein.When the length of packet is more than the default threshold
During value, in order to prevent packet transmission from causing terminal crash, the packet of 11 pairs of extractions of the first modem is pressed
Contracting.It is appreciated that if the length of the packet extracted is less than predetermined threshold value, first modem 11 can directly pass through
UART interface sends the packet to second modem 21.
In the present embodiment, before being compressed to packet, the number of first modem to extraction
Parsed according to bag, to obtain the packet header of the packet, then determine the length of the packet, it is only big in the length of packet
When predetermined threshold value, just the packet of extraction is compressed, so as to improve the accuracy of data packet compressing.
Further, mobile terminal fourth embodiment of the present invention is proposed based on first to 3rd embodiment.
Mobile terminal fourth embodiment and the difference of mobile terminal first to 3rd embodiment be, first modulatedemodulate
Adjust the packet of 11 pairs of extractions of device to be compressed to specifically include:
Obtain the corresponding source text of the packet;
Determine character field of the frequency of occurrences more than predeterminated frequency in source text;
In pre-set dictionary list, the corresponding coding of the character field is searched, wherein, the length of coding is less than corresponding word
Accord with the length of section;
Corresponding character field is replaced by the coding of lookup, to realize the compression of packet.
In the present embodiment, first modem 11 is compressed to packet, specifically, first obtains packet
Corresponding source text, it is then determined that the frequency of occurrences is more than the character field of predeterminated frequency in source text, then from pre-set dictionary list,
The corresponding coding of the character field is searched, wherein, the length of coding is less than the length of corresponding character field, eventually through lookup
Coding replaces corresponding character field, to realize the compression of packet.
The algorithm that the process is related to is dictionary algorithm, and dictionary algorithm is one of compression algorithm the simplest.The dictionary is calculated
The word or word combination that the frequency of occurrences in text is more than default certain value are made a corresponding dictionary list by method, and with special
Different code represents this word or vocabulary, for example, in current dictionary list:
00=Chinese
01=People
02=China
If the source text in current-period data bag is:I am a Chinese people, I am from China.So,
Using the dictionary algorithm, being encoded to after compression:I am a 00 01, I am from 02.
It is appreciated that the length after compressed encoding is reduced significantly, such coding proper noun or fixed Combination are more
Content in, compression efficiency is very notable, and predetermined coding mapping in predetermined content of text dictionary is substituted, decompression
When perform reversely reduction.
Further, first modem 11, is additionally operable to determine in source text that high four are zero and adjacent successively
Any two character fields;
High four of any two character fields are deleted, and by low four carry out group of any two character fields
Close, to realize the compression of packet.
That is, described first modem 11 is got after the corresponding source text of packet, and source document can be also determined successively
High four are zero and any two adjacent character fields in this, then high four of any two character fields are deleted, and by wantonly two
Low four of individual character field are combined, to realize the compression of packet.
The algorithm that the process is related to is fixed bit length algorithm (Fixed Bit Length Packing), and this algorithm is handle
Text is compressed coding with the minimum position needed.Such as:Eight hexadecimal numbers:1,2,3,4,5,6,7,8.Be converted to
Binary system is:00000001,00000010,00000011,00000100,00000101,00000110,00000111,
00001000.Only used per number low 4, and high 4 are not used and (are all 0), therefore low 4 are compressed after coding
Obtain:0001,0010,0011,0100,0101,0110,0111,1000.Then supplement and obtained for octet two-by-two:
00010010,00110100,01010110,01111000.So eight original hexadecimal numbers shorten half, 4 are obtained
Individual hexadecimal number:12,34,56,78.
It is appreciated that passing through this combination, it would be desirable to which the digit used is reduced so that the capacity of packet
It has been reduced that, similarly, during decompression perform repercussion and split addition combination.
Further, first modem 11, is additionally operable to the character to continuously occurring in source text, using repetition
Number of times padding is replaced, to realize the compression of packet.
That is, described first modem 11 is got after the corresponding source text of packet, can also be to connecting in source text
The continuous character occurred, is replaced using number of repetition padding, to realize the compression of packet.
The algorithm that the process is related to is RLE (Run Length Encoding, Run- Length Coding translates run length encoding again)
Algorithm, this compressed encoding is a kind of elongated coding, and RLE has different compressed encodings according to the different concrete condition of text
Variant is adapted therewith, to produce bigger compression ratio.Specifically:
Variant 1:Number of repetition+character
Text-string:Obtained after A A A B B B C C C C D D D D, coding:3 A 3 B 4 C 4 D;It is logical
Cross the variant algorithm, you can be compressed packet terminal text character string.
Variant 2:Spcial character+number of repetition+character
Text-string:Obtained after A A AA A B C C C C B C C C, coding:B B 5 A B B 4 C B B
3 C;Wherein, the explanation spcial character that most starts of the coded strings is B, a B is then added again, the numeral that B is followed by is with regard to table
The number of times repeated is shown.That is, when text string character carries out coding compression using the algorithm of variant 2, first in encoded
The initial of coded strings illustrate spcial character be B, then due to followed by occur 5 character A, it is necessary in this 5 character A
It is character B to add a spcial character before, therefore is exactly the A of B B 5, occurs occurring 3 C again after B, and B after 5A,
It is exactly the C of 5 A B B of B B 4 with above connecting accordingly, it would be desirable to add a spcial character B again before 3 C, behind
In the same way, you can obtain the final C of 5 A B B of coded strings B B, 4 C B B 3.
In order to become apparent from understanding the program, for another example:Text-string is remained as:A A A A A B C C C
C B C C C, if the explanation spcial character that most starts of present encoding string is D, then, obtained after coding:D D 5 A B D 4 C
B D 3 C。
Variant 3:
The each byte packet of text is blocking, and each character is at most repeated 127 times.Each block is opened with a special byte
Head.If the 7th of that special byte is set, then remaining 7 bit value is exactly the number of repetition of character below.Such as
Really the 7th is not set, then be left the quantity of 7 characters not compressed below exactly.
For example:Text-string:Obtained after A A A A A B C D E F F F, coding:85 A 4 B C D E 83
F (85H=10000101B, 4H=00000100B, 83H=10000011B).Wherein, text-string is first grouped into three
Block, is A A A A A, B C D E and F F F respectively, three fast corresponding spcial characters are 10000101,00000100 respectively
With 10000011, because the 7th is set to 1 in 10000101, therefore remaining 7 bit value is the repetition time of character below
Number, now understands that the corresponding value of remaining 7 bit value is 5, you can obtain 85A;Similarly, because the 7th in 00000100 does not have
Be set to 1, then remaining 7 be the character not compressed below quantity, it is known that being now left 7 corresponding values is
4, you can obtain 4 B C D E;83F is similarly can determine that, is not being repeated herein.
Calculated it should be noted that three kinds enumerated, 3 kinds of RLE variant algorithms listed above are only preferably several variants
Method, those skilled in the art are equal according to other RLE variants algorithms that its real needs is proposed using technological thought of the invention
Within the scope of the present invention, herein without exhaustive one by one.
Further, first modem 11, is additionally operable to determine identical and long with the presence or absence of content in source text
Character field of the degree more than preset value;
If in the presence of determining the distance and the length of the character field of latter character field and previous character end;
Latter character field is replaced using the mark of distance and length, to realize the compression of packet.
That is, described first modem 11 is got after the corresponding source text of packet, may further determine that in source text
With the presence or absence of content is identical and length is more than the character field of preset value, if in the presence of determining latter character field and previous character
The distance at end and the length of character field, replace latter character field, to realize packet using the mark of distance and length
Compression.
The algorithm that the process is related to is that LZ77 (was proposed, so life by Jacob Ziv and Abraham Lempel in 1977
Entitled LZ77) algorithm.
The contraction principle of LZ77 algorithms:If having two pieces of string contents identical in file, then only it is to be understood that preceding
The position of one piece of string content and size, we are assured that the content of latter piece of character string.So we can use (two
The distance between block character string, the length of identical content) such a pair of information, to replace latter piece of string content.Due to (two
The distance between block character string, the length of identical content) this pair of information size, less than the size for being replaced content, so
File is compressed.
To be best understood from, below we give one example:
There is the content of a file as follows:http://jiurl.yeah.net http://jiurl.nease.net, its
In some parts content, before occurred, behind the part that is bracketed with () be exactly identical part:http://
jiurl.yeah.net(http://jiurl.)nease(.net)。
We use the distance between (two pieces character string, the length of identical content) such a pair of information, latter to replace
Block string content, obtains http://jiurl.yeah.net(22,13)nease(23,4).
In (22,13), 22 represent latter piece of http://jiurl. and previous piece of http:Any two phase in //jiurl.
With the distance between character, such as latter h and previous h distance;13 be the length of identical content;(23,4) similarly, herein
Repeat no more.
It can be seen that from above-mentioned example, due to the distance between (two pieces character string, the length of identical content) this pair of letters
The size of breath, less than the size for being replaced content, so file is compressed.
Specifically, LZ77 algorithms find matching string using sliding window:
The method that i.e. LZ77 algorithms use " sliding window ", to find same section in the same section in file, file
I.e. matching is gone here and there.First, an explanation done to matching string, matching string refers to the sequence of any byte, not exclusively can be
The sequence of those bytes shown in text, can also be the sequence including punctuation mark.What string here was emphasized
It is its position hereof, its length changes with the situation of matching.Specifically:
LZ77 is since the beginning of file, and one byte of byte is handled backward.In the embodiment of the present invention,
The length of sliding window is fixed, and the final position of the sliding window is close to current before currently processed byte
Byte is handled, is constantly slided backward with the byte of processing, as in the sun, the shadow skating of aircraft is too greatly.It is right
Each byte in file, the string started with currently processed byte, and each string in window are matched, most long to find
Matching string.
Each string in window refers to the string that each byte starts in window.If the string that currently processed byte starts is in window
In there is matching to go here and there, just with the distance between (, matching length) such a pair of information, to replace current string, then handled from just now
Next byte after complete string, is continued with.If the string that currently processed byte starts does not match string in the window, just
Do not do the currently processed byte of the output changed.
When handling first character section in file, window is before currently processed byte, that is, does not slide into text also
On part, at this moment there is no any content in window, processed byte will not do the output changed.With processing it is continuous to
Afterwards, window more and more slips into file, and last whole window slips into file, and then whole window is slided backward on file,
Until the whole end of file.
It should be noted that the length of matching string has been limited, i.e., in the present embodiment, there is provided smallest match string and maximum
Matching string, it is necessary to limit by sliding window match come character string be more than the smallest match string and less than the maximum matching
String, can just be compressed, if matching the character string come is less than the smallest match string, or match string more than the maximum, then not
Follow-up squeeze operation can be carried out.
To be best understood from the present embodiment, it is exemplified below:
Assuming that text-string is:A A A B A B A A A C, currently there is the sliding window of 6 character, represent
Disposably 6 characters are contained up in sliding window.
The first step of coding:Sliding window is an empty window, and now sliding window is not necessary to slide, by sliding window
It is compared with first character of text-string outside sliding window, the character in the absence of matching is found, now by sliding window
Mouthful toward moving right one, that is, sliding window from the right side slipped into text-string, then character string initial enters the slip
Window, now sliding window show character A;
The second step of coding:And then there is character A due to only having inside sliding window outside character A, sliding window, although
There is the character A of matching in sliding window inside and outside, however, to ensure that the efficiency of character code, sets smallest match in advance
String, is such as set to 2 characters by smallest match string, undesirable because now only one of which character A is matched, then to slide
Window is remained stationary as, and by the character of processing toward moving right one, i.e., the character being compared with sliding window is exactly A A, now
Only one of which character A in sliding window, therefore, in the absence of the character of matching, then continue the sliding window to slide to the right, that
Second character of text-string also enters sliding window, and the character A as two is now occurred in that in sliding window.
3rd step of coding:When there is two identical character A inside sliding window, by two inside sliding window
Character A is compared with the character outside window, because back to back two characters are A B outside sliding window, mismatches, therefore sliding
Dynamic window continues right cunning, when sliding window, which is slided, A A A occurs, and the character and then occurred outside sliding window is B A B, with
Character in sliding window is mismatched, then sliding window continues to slide to the right, to occur inside sliding window A A A
B, now, because the character A B inside sliding window are matched with back to back character A B outside sliding window, it is believed that have found
Similar-length is 2 A B, therefore the AB outside sliding window meets the requirement of smallest match string, therefore a pair of < length, apart from > just
It is output, length (length) is 2 and distance is also 2 backward, so being output as<2,2>.
4th step of coding:When latter character string AB is used<2,2>After output, this section of character string is equivalent to delete
, now sliding window is compared with remaining text-string, remaining text-string is A A A C, by this
When sliding window is compared, when the first two A A in A A A C and sliding window are compared, although A A and sliding window
There is the character of identical content and length, and meet minimum character string, but in order to improve compression efficiency, may proceed to judge text
Whether there is the character string of matching behind this character string, if now detecting out also one character A, i.e., just have text character
The A A A that go here and there are identical with three character A in sliding window, then determine remaining text-string A A A and A in sliding window
A A distance and the length of identical characters string, now due to deleting latter AB in script character string, therefore A A A
Distance with A A A in sliding window is 4, and identical content-length is 3, exportable<4,3>.
5th step of coding:Output<4,3>Afterwards, the character that processing is also needed in text character string only has C, due to this
Character in sliding window is A A A B, is mismatched, therefore sliding window slides to the right one, and character C is also slided into the slip
Window, then the character in sliding window is just A A A B C.Because follow-up no content needs processing, then this is slided
All characters in window are all exported, and the coded strings finally given are A A A B<2,2><4,3>C.
It is compressed and decompresses using LZ77 algorithm
In order to which " byte not matched " and " the distance between (, matching length) to " in decompression, can be distinguished, and also
Need before each " byte not matched " or " the distance between (, matching length) to ", put one, be to indicate
The distance between " byte not matched ", still " (, matching length) to ".In the embodiment of the present invention, it can select 0 and represent " do not have
The distance between have the byte of matching ", represented with 1 " (, matching length) to ".
The distance between the distance between in practical application, fixed (, matching length) centering, " " and " matching length " institute
The digit used.Due to fixing " the distance between " used in digit, so just having used the window of fixed size, such as
The size of window is 32KB, then can just preserve any one value in the range of 0-32K with 15 (2^15=32K).In addition,
The matching length of maximum will also be defined, so, digit is also just secured used in " matching length ".
In practical application, a smallest match length will be also set, only when the matching length of two strings is more than minimum
During with length, a matching is just considered.To be best understood from, the reason for giving one example to illustrate so to do:Such as, " distance "
The distance between using 15, " length " uses 8, then " (, matching length) to " 23, that is, poor 13 will be used
Byte.If matching length is less than 3 bytes, then if being replaced with " the distance between (, matching length) to ",
Do not compress not only, can increase on the contrary, so needing a smallest match length.
Compression:
To the end of file since file, one byte of byte is handled backward.Use currently processed byte
The string of beginning, and each string in sliding window are matched, and find most long matching string.What if currently processed byte started
The distance between string has matching to go here and there in the window, just first exports a flag bit, to show be below one (, matching length) it is right,
The distance between then export (, matching length) it is right, then at next byte after the string handled just now, continuation
Reason.If the string that currently processed byte starts does not match string in the window, a flag bit is just first exported, shows to be below one
The individual byte without change, does not then do the currently processed byte of the output changed, then proceedes to handle under currently processed byte
One byte.
Decompression:
To the end of file since file, bit flag position is first read every time, judges to be below one by this flag bit
The distance between individual (, matching length) it is right, or a byte without change.The distance between if one (, matching length
Degree) it is right, the distance between (, matching length) for just reading fixed bit number is right, then according to the information of centering, will matching string output
To current location.If one without the byte changed, a byte is just read, this byte is then exported.
In view of the foregoing it is apparent that, LZ77 needs to do substantial amounts of matching work when compressing, and the work done is needed when decompressing
Make seldom, that is to say, that decompression will be much faster relative to compression, this is for needing to carry out first compression, the feelings repeatedly decompressed
Condition, is a significant advantage of effect.
After the first modem 11 is compressed by any of the above-described compression algorithm to packet, then will compression
Packet storage afterwards is forwarded into buffer.Subsequently, second modem 21 can extract pressure from buffer
The packet of contracting, and the compressed data packets of extraction are decompressed, wherein, the mode of decompression also includes two kinds:When the first modulation
When demodulator 11 is ciphered compressed, the second modem 21 is decompressed using corresponding ciphertext, when the first modulatedemodulate
It is that the second modem 21 can be decompressed directly, with the packet after being decompressed when compressing in plain text to adjust device 11.
Because each compression algorithm in the present embodiment is mainly plaintext algorithm, therefore, the mode of decompression is also to decompress in plain text.
It is appreciated that in this programme, when the packet of telecommunications card transmission in the mobile terminal 100 is larger, the second modulation
Demodulator 21 adds mark in Request, the first modem 11 is compressed packet, with change data bag
Desired value, the packet of further cache to buffer would not exceed buffer capability value, then, it is to avoid big data bag is passed
The problem of transporting lethal machine, while packet will not be split into multiple packets, it is to avoid packet forwards incomplete feelings
Condition.
The present invention further provides a kind of data pack transmission method.
Reference picture 4, Fig. 4 is the schematic flow sheet of data pack transmission method first embodiment of the present invention.
The present embodiment proposes a kind of packet identifying method, and there is provided the reality of data pack transmission method in the present embodiment
Example is applied, it is necessary to which explanation is, although show logical order in flow charts, but in some cases, can with different from
Order herein performs shown or described step.
In the present invention, data pack transmission method is applied to mobile terminal, and the mobile terminal 1 00 includes being based on preset interface
The first process chip 001 and second processing chip 002 of connection, the first radio frequency mould being connected with first process chip 001
Block 12 and the second radio-frequency module 22 being connected with the second processing chip 002, first process chip 001 include interior
The first modulatedemodulate for being embedded with virtual user identifying card 10A the first application processor 10 and being connected with entity user identification card 14
Device 11 is adjusted, the second processing chip 002 includes the second application processor 20 and second modem 21, methods described bag
Include:
Step S10, the first modem receives the packet acquisition that second modem is sent by preset interface
During request, the packet is extracted from virtual user identifying card or entity user identification card and obtains the corresponding packet of request;
Step S20, is compressed to the packet of extraction;
Step S30, by the buffer of the data pack buffer after compression to the preset interface, for the second modulation /demodulation
Device extracts the packet after compression from the buffer, to complete the transmission of packet.
In the present embodiment, first modem 11 receives second modem 21 by preset interface and sent
Packet obtain request, be also subsequently that packet is fed back to by the second modem 21 by the preset interface.
The preset interface is UART interface.
Wherein, when the second modem 21 of second processing chip 002 by the second radio-frequency module 22 receives base station
When the packet of transmission obtains request, first pass through UART and send packet acquisition request the first of the first process chip 001 to
Modem 11;First modem 11 receives the packet and obtained after request, and request is obtained from void according to packet
Intend obtaining packet in Subscriber Identity Module 10A or entity user identification card 14;First modem 11 is getting packet
Afterwards, in order to ensure that the data of transmission are not more than UART buffer, first the packet of acquisition is compressed, compressed
Packet afterwards;The packet after compression is sent to by second modem 21 by UART again;Second modem 21
Receive after packet, then packet is uploaded to by base station by the second radio-frequency module 22, to complete the transmission of packet.
Specifically, the step S10 includes:
Step A, first modem to virtual user identifying card or or entity user identification card in piece in grasp
Make system and send packet acquisition request, by the chip operating system in virtual user identifying card or entity user identification card
File storage module in extract the packet and obtain the corresponding packet of request, and feed back to first modulation /demodulation
Device;
Step B, first modem receives the packet of chip operating system feedback.
In the present embodiment, it is necessary to data in explanation, virtual user identifying card 10A or entity user identification card 14
Bag is stored in file storage module, when the first modem 11 will obtain virtual user identifying card 10A or entity user knowledge
Ka be in 14 packet when, the first modem 11 will not be recognized directly with virtual user identifying card 10A or entity user
File storage module interaction in card 14, but the first COS into virtual user identifying card 10A or entity user identification card 14
It is Request that (Chip Operating System, chip operating system) operating system, which sends packet and obtains request, then
The COS operating systems of virtual user identifying card 10A or entity user identification card 14 are based on the Request in file storage module
Packet is obtained, the packet of acquisition is then transmitted further to the first modem 11, as long as the first modem 11 connects
The packet for receiving COS operating systems feedback is the acquisition process that packet can be achieved.
It is appreciated that because the first modem 11 can not be in virtual user identifying card 10A or entity user identification card
File storage module in 14 directly extracts packet, thus by with virtual user identifying card 10A or entity user identification card
14 COS operating systems are interacted, to realize the extraction of packet, it is ensured that follow-up data transmission procedure is normally run.
When the first modem 11 extracts packet from virtual user identifying card 10A or entity user identification card 14
After the corresponding packet of acquisition request, then the packet of extraction is compressed, in the present embodiment, the first modem 11
When being compressed to packet, the compression of packet can be carried out by the way of ciphered compressed, can also be directly using in plain text
It is compressed.Because the SIM card Network authentication data amount of transmission is smaller, cause data to reduce the operation such as encrypting and decrypting
Efficiency of transmission is low, and the mode that the embodiment of the present invention is preferred to use compression in plain text is compressed to packet, i.e., used in this programme
Compression algorithm with it is simple efficiently based on, the compression algorithm and compression process specifically used is described in detail in embodiments below.
After first modem 11 is to data packet compressing, you can default connect the data pack buffer after compression to described
In mouth UART buffer, so that second modem 21 extracts the packet after compression from the buffer, to complete
The transmission of packet.
It should be noted that buffer is present in the two ends point of the two ends of UART interface, i.e. UART interface in the present embodiment
Buffer1 and buffer2 are not provided with it.When second modem 21 by the second radio-frequency module 22 receive base station send
During data acquisition request, packet is obtained into request the first modem 11, the first modulatedemodulate are sent to by UART interface
Device 11 is adjusted after virtual user identifying card 10A or entity user identification card 14 extract packet, first by the packet of extraction
Store in buffer1, to be transmitted by UART into the buffer2 of second modem 21, second modem 21
Packet is obtained from buffer2 again.
The data pack transmission method that the present embodiment is proposed, the first modem receives the second modulatedemodulate by preset interface
When the packet for adjusting device to send obtains request, first the packet is extracted from virtual user identifying card or entity user identification card
The corresponding packet of request is obtained, then the packet of extraction is compressed, then by the data pack buffer after compression to described
In the buffer of preset interface, so that second modem extracts the packet after compression from the buffer, to complete
The transmission of packet.This programme is first compressed in transmission packet to packet waiting for transmission, then by the data after compression
Bag is transmitted so that the capability value of the packet of transmission has reduced, it is to avoid mobile terminal crashes in data transmission procedure
Situation.
Further, data pack transmission method second embodiment of the present invention is proposed based on first embodiment.
The difference of data pack transmission method second embodiment and data pack transmission method first embodiment is, the step
Before S20, methods described also includes:
Can first modem, which judge obtain in request from the packet, extracts second modem
The compressing mark of addition;
If compressing mark can be extracted, the step S20 is performed.
In the present embodiment, request is obtained when second modem 21 sends packet to the first modem 11
(Request) before, in order to prevent the packet of transmission excessive, when second modem 21 sends Request, first determination is
No needs add compressing mark in Request, if desired, a compressing mark, such as addition word are then first added in Request
Section 01, to inform that the first modem 11 is compressed to sent packet.
It should be noted that because data waiting for transmission are determined according to communication protocol standard, therefore, the second modulatedemodulate
Device 21 is adjusted to learn the data type and size of data for the packet that will be obtained, then, when second modem 21 is sent out
Before sending Request, first judge the size of current packet to be obtained, if the size of packet to be obtained beyond
Buffer capability value, then second modem 21 compressing mark is added in Request, to inform the first modem
11 pairs of packets waiting for transmission are compressed, if second modem 21 judge the size of packet to be obtained without departing from
Buffer capability value, then directly transmit Request, without adding compressing mark.
In the present embodiment, before second modem 21 sends Request, the size to packet to be obtained is entered
Row identification, only when packet to be obtained exceeds buffer capability value, just adds compressing mark in Request, it is to avoid
All packets obtain request and all add compressing mark, shorten the time of packet transmission, improve packet transmission
Efficiency.
When the first modem 11 receives the packet of the transmission of second modem 21 by preset interface (UART)
When obtaining request, request first is obtained to the packet and parsed, is carried with determining whether to obtain from the packet in request
The compressing mark that second modem 21 is added is taken out, if extracting compressing mark in the packet obtains request, this
When, first modem 11 can be compressed to the packet of extraction, subsequently again by the data pack buffer after compression
Into the buffer1 of the preset interface, and transmitted by UART into buffer2, so that second modem 21 is from institute
State and the packet after compression is extracted in buffer2, to complete the transmission of packet.
In the present embodiment, transmission of data packets is that the first modem 11 of generation and second modem 21 are called out
After waking up, then after the first modem 11 and second modem 21 wake up, if second modem 21 is logical
The packet acquisition request that the second radio-frequency module 22 receives base station generation is crossed, following operate is performed:
Judge:The size of packet to be obtained is first determined, to judge whether to need to add compressing mark;
Decision-making:If packet to be obtained exceedes UART buffer capacity, request is obtained sending packet
Before, obtain request addition compressing mark in packet;
Send:After packet obtains request addition compressing mark, send packet and obtain request.
When first modem 11 receives packet acquisition request by UART, following operate is performed:
Extract:Determine whether to obtain in request from packet and extract compressing mark, if can, extract compressing mark;
Compression:Compressing mark based on extraction, to what is extracted from virtual user identifying card 10A or entity user identification card 14
Packet is compressed;
Feedback:Feed back the packet of compression.
Finally, second modem 21 receives the packet that the first modem 11 feeds back by UART, to complete
Transmission of data packets.Above-mentioned operating process, can refer to Fig. 3.
It should be noted that the transmission of second modem 21 is that packet obtains request, asked because packet is obtained
Generally less than buffer capacity is sought, therefore request can not be obtained to packet and is compressed.
In the present embodiment, the first modem 11 is to packet before being compressed, and can first judge from described
Packet obtains the compressing mark that second modem addition is extracted in request, if compressing mark can be extracted, ability logarithm
It is compressed according to bag, prevents packet to be also compressed when being less than buffer capacity, to prevent the waste of locking system resource, and
The time of packet transmission is saved, so as to improve the efficiency of packet transmission.
Further, data pack transmission method 3rd embodiment of the present invention is proposed based on first embodiment.
The difference of data pack transmission method 3rd embodiment and data pack transmission method first embodiment is, the step
Before S20, methods described also includes:
First modem is parsed to the packet of extraction, to obtain the packet header of the packet;
Packet header based on the packet determines the length of the packet;
When the length of the packet is more than predetermined threshold value, the step S20 is performed.
In the present embodiment, before first modem 11 is compressed to packet, first to from entity user
The packet extracted in identification card 14 is parsed, and to obtain the packet header of the packet, packet is then obtained from packet header
Length, to determine the size of the packet.Wherein, packet is TLV forms, and TLV forms are BER (Basic Encoding
Rules, BER Basic Encoding Rules) coding one kind, full name be Type (type), Length (length), Value (value), T field lists
Show the type of packet, L field represents that the length of packet, V fields are used for the content for depositing packet.
In the present embodiment, the generating process of the packet is:Transport layer gets the corresponding initial data of packet, and is
Initial data adds the data packet head of transport layer, and data packet head includes transport layer data type and data length, obtains initial number
Transmitted according to bag, and by initial data packets to transmission multiplex layer.After transmission multiplex layer receives initial data packets, for initialization number
According to the data packet head of bag addition transmission multiplex layer, data packet head includes the data type and data length of multiplex layer, obtains data
Bag, and call the transmission interface of physical drives layer to send the packet to physical layer.Subsequently, 11 pairs of the first modem is carried
The packet taken is parsed, from the physical drives layer detection packet on physical layer (physical transmission medium)
Packet header, to parse the size (length) for obtaining packet.
After the first modem 11 determines the length of packet, then judge the length of the packet whether more than default
Threshold value (i.e. buffer capability value).In the present embodiment, the predetermined threshold value is chosen as 512 bytes, in other embodiments,
The predetermined threshold value can also be set to other length, no longer limited herein.When the length of packet is more than the default threshold
During value, in order to prevent packet transmission from causing terminal crash, the packet of 11 pairs of extractions of the first modem is pressed
Contracting.It is appreciated that if the length of the packet extracted is less than predetermined threshold value, first modem 11 can directly pass through
UART interface sends the packet to second modem 21.
In the present embodiment, before being compressed to packet, the number of first modem to extraction
Parsed according to bag, to obtain the packet header of the packet, then determine the length of the packet, it is only big in the length of packet
When predetermined threshold value, just the packet of extraction is compressed, so as to improve the accuracy of data packet compressing.
Further, data pack transmission method fourth embodiment of the present invention is proposed based on first to 3rd embodiment.
Data pack transmission method fourth embodiment and the difference of data pack transmission method first to 3rd embodiment be, institute
Stating step S20 includes:
Step a, first modem obtain the corresponding source text of the packet;
Step b, determine that the frequency of occurrences in source text is more than the character field of predeterminated frequency;
Step c, in pre-set dictionary list, search the corresponding coding of the character field, wherein, the length of coding less than pair
The length for the character field answered;
Step d, corresponding character field replaced by the coding of lookup, to realize the compression of packet.
In the present embodiment, first modem 11 is compressed to packet, specifically, first obtains packet
Corresponding source text, it is then determined that the frequency of occurrences is more than the character field of predeterminated frequency in source text, then from pre-set dictionary list,
The corresponding coding of the character field is searched, wherein, the length of coding is less than the length of corresponding character field, eventually through lookup
Coding replaces corresponding character field, to realize the compression of packet.
The algorithm that the process is related to is dictionary algorithm, and dictionary algorithm is one of compression algorithm the simplest.The dictionary is calculated
The word or word combination that the frequency of occurrences in text is more than default certain value are made a corresponding dictionary list by method, and with special
Different code represents this word or vocabulary, for example, in current dictionary list:
00=Chinese
01=People
02=China
If the source text in current-period data bag is:I am a Chinese people, I am from China.So,
Using the dictionary algorithm, being encoded to after compression:I am a 00 01, I am from 02.
It is appreciated that the length after compressed encoding is reduced significantly, such coding proper noun or fixed Combination are more
Content in, compression efficiency is very notable, and predetermined coding mapping in predetermined content of text dictionary is substituted, decompression
When perform reversely reduction.
Further, after the step a, the step S20 also includes:
High four are zero and any two adjacent character fields in step e, successively determination source text;
Step f, high four of any two character fields are deleted, and by the low four of any two character fields
It is combined, to realize the compression of packet.
That is, described first modem 11 is got after the corresponding source text of packet, and source document can be also determined successively
High four are zero and any two adjacent character fields in this, then high four of any two character fields are deleted, and by wantonly two
Low four of individual character field are combined, to realize the compression of packet.
The algorithm that the process is related to is fixed bit length algorithm (Fixed Bit Length Packing), and this algorithm is handle
Text is compressed coding with the minimum position needed.Such as:Eight hexadecimal numbers:1,2,3,4,5,6,7,8.Be converted to
Binary system is:00000001,00000010,00000011,00000100,00000101,00000110,00000111,
00001000.Only used per number low 4, and high 4 are not used and (are all 0), therefore low 4 are compressed after coding
Obtain:0001,0010,0011,0100,0101,0110,0111,1000.Then supplement and obtained for octet two-by-two:
00010010,00110100,01010110,01111000.So eight original hexadecimal numbers shorten half, 4 are obtained
Individual hexadecimal number:12,34,56,78.
It is appreciated that passing through this combination, it would be desirable to which the digit used is reduced so that the capacity of packet
It has been reduced that, similarly, during decompression perform repercussion and split addition combination.
Further, after the step a, the step S20 also includes:
Step g, the character to continuously occurring in source text, are replaced using number of repetition padding, to realize data
The compression of bag.
That is, described first modem 11 is got after the corresponding source text of packet, can also be to connecting in source text
The continuous character occurred, is replaced using number of repetition padding, to realize the compression of packet.
The algorithm that the process is related to is RLE (Run Length Encoding, Run- Length Coding translates run length encoding again)
Algorithm, this compressed encoding is a kind of elongated coding, and RLE has different compressed encodings according to the different concrete condition of text
Variant is adapted therewith, to produce bigger compression ratio.Specifically:
Variant 1:Number of repetition+character
Text-string:Obtained after A A A B B B C C C C D D D D, coding:3 A 3 B 4 C 4 D;It is logical
Cross the variant algorithm, you can be compressed packet terminal text character string.
Variant 2:Spcial character+number of repetition+character
Text-string:Obtained after A A A A A B C C C C B C C C, coding:B B 5 A B B 4 C B B
3 C;Wherein, the explanation spcial character that most starts of the coded strings is B, a B is then added again, the numeral that B is followed by is with regard to table
The number of times repeated is shown.That is, when text string character carries out coding compression using the algorithm of variant 2, first in encoded
The initial of coded strings illustrate spcial character be B, then due to followed by occur 5 character A, it is necessary in this 5 character A
It is character B to add a spcial character before, therefore is exactly the A of B B 5, occurs occurring 3 C again after B, and B after 5A,
It is exactly the C of 5 A B B of B B 4 with above connecting accordingly, it would be desirable to add a spcial character B again before 3 C, behind
In the same way, you can obtain the final C of 5 A B B of coded strings B B, 4 C B B 3.
In order to become apparent from understanding the program, for another example:Text-string is remained as:A A A A A B C C C
C B C C C, if the explanation spcial character that most starts of present encoding string is D, then, obtained after coding:D D 5 A B D 4 C
B D 3 C。
Variant 3:
The each byte packet of text is blocking, and each character is at most repeated 127 times.Each block is opened with a special byte
Head.If the 7th of that special byte is set, then remaining 7 bit value is exactly the number of repetition of character below.Such as
Really the 7th is not set, then be left the quantity of 7 characters not compressed below exactly.
For example:Text-string:Obtained after A A A A A B C D E F F F, coding:85 A 4 B C D E 83
F (85H=10000101B, 4H=00000100B, 83H=10000011B).Wherein, text-string is first grouped into three
Block, is A A A A A, B C D E and F F F respectively, three fast corresponding spcial characters are 10000101,00000100 respectively
With 10000011, because the 7th is set to 1 in 10000101, therefore remaining 7 bit value is the repetition time of character below
Number, now understands that the corresponding value of remaining 7 bit value is 5, you can obtain 85 A;Similarly, because the 7th in 00000100 does not have
Be set to 1, then remaining 7 be the character not compressed below quantity, it is known that being now left 7 corresponding values is
4, you can obtain 4 B C D E;83 F are similarly can determine that, are not being repeated herein.
Calculated it should be noted that three kinds enumerated, 3 kinds of RLE variant algorithms listed above are only preferably several variants
Method, those skilled in the art are equal according to other RLE variants algorithms that its real needs is proposed using technological thought of the invention
Within the scope of the present invention, herein without exhaustive one by one.
Further, after the step a, the step S20 also includes:
Step h, determine in source text with the presence or absence of content is identical and length is more than the character field of preset value;
If step i, in the presence of determining the distance and the length of the character field of latter character field and previous character end
Degree;
Step j, latter character field replaced using the mark of distance and length, to realize the compression of packet.
That is, described first modem 11 is got after the corresponding source text of packet, may further determine that in source text
With the presence or absence of content is identical and length is more than the character field of preset value, if in the presence of determining latter character field and previous character
The distance at end and the length of character field, replace latter character field, to realize packet using the mark of distance and length
Compression.
The algorithm that the process is related to is that LZ77 (was proposed, so life by Jacob Ziv and Abraham Lempel in 1977
Entitled LZ77) algorithm.
The contraction principle of LZ77 algorithms:If having two pieces of string contents identical in file, then only it is to be understood that preceding
The position of one piece of string content and size, we are assured that the content of latter piece of character string.So we can use (two
The distance between block character string, the length of identical content) such a pair of information, to replace latter piece of string content.Due to (two
The distance between block character string, the length of identical content) this pair of information size, less than the size for being replaced content, so
File is compressed.
To be best understood from, below we give one example:
There is the content of a file as follows:http://jiurl.yeah.net http://jiurl.nease.net, its
In some parts content, before occurred, behind the part that is bracketed with () be exactly identical part:http://
jiurl.yeah.net(http://jiurl.)nease(.net)。
We use the distance between (two pieces character string, the length of identical content) such a pair of information, latter to replace
Block string content, obtains http://jiurl.yeah.net(22,13)nease(23,4).
In (22,13), 22 represent latter piece of http://jiurl. and previous piece of http:Any two phase in //jiurl.
With the distance between character, such as latter h and previous h distance;13 be the length of identical content;(23,4) similarly, herein
Repeat no more.
It can be seen that from above-mentioned example, due to the distance between (two pieces character string, the length of identical content) this pair of letters
The size of breath, less than the size for being replaced content, so file is compressed.
Specifically, LZ77 algorithms find matching string using sliding window:
The method that i.e. LZ77 algorithms use " sliding window ", to find same section in the same section in file, file
I.e. matching is gone here and there.First, an explanation done to matching string, matching string refers to the sequence of any byte, not exclusively can be
The sequence of those bytes shown in text, can also be the sequence including punctuation mark.What string here was emphasized
It is its position hereof, its length changes with the situation of matching.Specifically:
LZ77 is since the beginning of file, and one byte of byte is handled backward.In the embodiment of the present invention,
The length of sliding window is fixed, and the final position of the sliding window is close to current before currently processed byte
Byte is handled, is constantly slided backward with the byte of processing, as in the sun, the shadow skating of aircraft is too greatly.It is right
Each byte in file, the string started with currently processed byte, and each string in window are matched, most long to find
Matching string.
Each string in window refers to the string that each byte starts in window.If the string that currently processed byte starts is in window
In there is matching to go here and there, just with the distance between (, matching length) such a pair of information, to replace current string, then handled from just now
Next byte after complete string, is continued with.If the string that currently processed byte starts does not match string in the window, just
Do not do the currently processed byte of the output changed.
When handling first character section in file, window is before currently processed byte, that is, does not slide into text also
On part, at this moment there is no any content in window, processed byte will not do the output changed.With processing it is continuous to
Afterwards, window more and more slips into file, and last whole window slips into file, and then whole window is slided backward on file,
Until the whole end of file.
It should be noted that the length of matching string has been limited, i.e., in the present embodiment, there is provided smallest match string and maximum
Matching string, it is necessary to limit by sliding window match come character string be more than the smallest match string and less than the maximum matching
String, can just be compressed, if matching the character string come is less than the smallest match string, or match string more than the maximum, then not
Follow-up squeeze operation can be carried out.
To be best understood from the present embodiment, it is exemplified below:
Assuming that text-string is:A A A B A B A A A C, currently there is the sliding window of 6 character, represent
Disposably 6 characters are contained up in sliding window.
The first step of coding:Sliding window is an empty window, and now sliding window is not necessary to slide, by sliding window
It is compared with first character of text-string outside sliding window, the character in the absence of matching is found, now by sliding window
Mouthful toward moving right one, that is, sliding window from the right side slipped into text-string, then character string initial enters the slip
Window, now sliding window show character A;
The second step of coding:And then there is character A due to only having inside sliding window outside character A, sliding window, although
There is the character A of matching in sliding window inside and outside, however, to ensure that the efficiency of character code, sets smallest match in advance
String, is such as set to 2 characters by smallest match string, undesirable because now only one of which character A is matched, then to slide
Window is remained stationary as, and by the character of processing toward moving right one, i.e., the character being compared with sliding window is exactly AA, is now slided
Only one of which character A in dynamic window, therefore, in the absence of the character of matching, then continue the sliding window to slide to the right, then
Second character of text-string also enters sliding window, and the character A as two is now occurred in that in sliding window.
3rd step of coding:When there is two identical character A inside sliding window, by two inside sliding window
Character A is compared with the character outside window, because back to back two characters are A B outside sliding window, mismatches, therefore sliding
Dynamic window continues right cunning, when sliding window, which is slided, A A A occurs, and the character and then occurred outside sliding window is B A B, with
Character in sliding window is mismatched, then sliding window continues to slide to the right, to occur inside sliding window A A A
B, now, because the character A B inside sliding window are matched with back to back character A B outside sliding window, it is believed that have found
Similar-length is 2 A B, therefore the AB outside sliding window meets the requirement of smallest match string, therefore a pair of < length, apart from > just
It is output, length (length) is 2 and distance is also 2 backward, so being output as<2,2>.
4th step of coding:When latter character string AB is used<2,2>After output, this section of character string is equivalent to delete
, now sliding window is compared with remaining text-string, remaining text-string is A A A C, by this
When sliding window is compared, when the first two A A in A A A C and sliding window are compared, although A A and sliding window
There is the character of identical content and length, and meet minimum character string, but in order to improve compression efficiency, may proceed to judge text
Whether there is the character string of matching behind this character string, if now detecting out also one character A, i.e., just have text character
The A A A that go here and there are identical with three character A in sliding window, then determine remaining text-string A A A and A in sliding window
A A distance and the length of identical characters string, now due to deleting latter AB in script character string, therefore A AA with
A A A distance is 4 in sliding window, and identical content-length is 3, exportable<4,3>.
5th step of coding:Output<4,3>Afterwards, the character that processing is also needed in text character string only has C, due to this
Character in sliding window is A A A B, is mismatched, therefore sliding window slides to the right one, and character C is also slided into the slip
Window, then the character in sliding window is just A A A B C.Because follow-up no content needs processing, then this is slided
All characters in window are all exported, and the coded strings finally given are A A A B<2,2><4,3>C.
It is compressed and decompresses using LZ77 algorithm
In order to which " byte not matched " and " the distance between (, matching length) to " in decompression, can be distinguished, and also
Need before each " byte not matched " or " the distance between (, matching length) to ", put one, be to indicate
The distance between " byte not matched ", still " (, matching length) to ".In the embodiment of the present invention, it can select 0 and represent " do not have
The distance between have the byte of matching ", represented with 1 " (, matching length) to ".
The distance between the distance between in practical application, fixed (, matching length) centering, " " and " matching length " institute
The digit used.Due to fixing " the distance between " used in digit, so just having used the window of fixed size, such as
The size of window is 32KB, then can just preserve any one value in the range of 0-32K with 15 (2^15=32K).In addition,
The matching length of maximum will also be defined, so, digit is also just secured used in " matching length ".
In practical application, a smallest match length will be also set, only when the matching length of two strings is more than minimum
During with length, a matching is just considered.To be best understood from, the reason for giving one example to illustrate so to do:Such as, " distance "
The distance between using 15, " length " uses 8, then " (, matching length) to " 23, that is, poor 13 will be used
Byte.If matching length is less than 3 bytes, then if being replaced with " the distance between (, matching length) to ",
Do not compress not only, can increase on the contrary, so needing a smallest match length.
Compression:
To the end of file since file, one byte of byte is handled backward.Use currently processed byte
The string of beginning, and each string in sliding window are matched, and find most long matching string.What if currently processed byte started
The distance between string has matching to go here and there in the window, just first exports a flag bit, to show be below one (, matching length) it is right,
The distance between then export (, matching length) it is right, then at next byte after the string handled just now, continuation
Reason.If the string that currently processed byte starts does not match string in the window, a flag bit is just first exported, shows to be below one
The individual byte without change, does not then do the currently processed byte of the output changed, then proceedes to handle under currently processed byte
One byte.
Decompression:
To the end of file since file, bit flag position is first read every time, judges to be below one by this flag bit
The distance between individual (, matching length) it is right, or a byte without change.The distance between if one (, matching length
Degree) it is right, the distance between (, matching length) for just reading fixed bit number is right, then according to the information of centering, will matching string output
To current location.If one without the byte changed, a byte is just read, this byte is then exported.
In view of the foregoing it is apparent that, LZ77 needs to do substantial amounts of matching work when compressing, and the work done is needed when decompressing
Make seldom, that is to say, that decompression will be much faster relative to compression, this is for needing to carry out first compression, the feelings repeatedly decompressed
Condition, is a significant advantage of effect.
After the first modem 11 is compressed by any of the above-described compression algorithm to packet, then will compression
Packet storage afterwards is forwarded into buffer.Subsequently, second modem 21 can extract pressure from buffer
The packet of contracting, and the compressed data packets of extraction are decompressed, wherein, the mode of decompression also includes two kinds:When the first modulation
When demodulator 11 is ciphered compressed, the second modem 21 is decompressed using corresponding ciphertext, when the first modulatedemodulate
It is that the second modem 21 can be decompressed directly, with the packet after being decompressed when compressing in plain text to adjust device 11.
Because each compression algorithm in the present embodiment is mainly plaintext algorithm, therefore, the mode of decompression is also to decompress in plain text.
It is appreciated that in this programme, when the packet of telecommunications card transmission in the mobile terminal 100 is larger, the second modulation
Demodulator 21 adds mark in Request, the first modem 11 is compressed packet, with change data bag
Desired value, the packet of further cache to buffer would not exceed buffer capability value, then, it is to avoid big data bag is passed
The problem of transporting lethal machine, while packet will not be split into multiple packets, it is to avoid packet forwards incomplete feelings
Condition.
It should be noted that herein, term " comprising ", "comprising" or its any other variant are intended to non-row
His property is included, so that process, method, article or system including a series of key elements not only include those key elements, and
And also including the other key elements being not expressly set out, or also include for this process, method, article or system institute inherently
Key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that including this
Also there is other identical element in process, method, article or the system of key element.
The embodiments of the present invention are for illustration only, and the quality of embodiment is not represented.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Understood based on such, technical scheme is substantially done to prior art in other words
Going out the part of contribution can be embodied in the form of software product, and the computer software product is stored in a storage medium
In (such as ROM/RAM, magnetic disc, CD), including some instructions are to cause a station terminal equipment (can be mobile phone, computer, clothes
It is engaged in device, air conditioner, or network equipment etc.) perform method described in each embodiment of the invention.
The preferred embodiments of the present invention are these are only, are not intended to limit the scope of the invention, it is every to utilize this hair
Equivalent structure or equivalent flow conversion that bright specification and accompanying drawing content are made, or directly or indirectly it is used in other related skills
Art field, is included within the scope of the present invention.
Claims (10)
1. a kind of mobile terminal, it is characterised in that the mobile terminal includes the first process chip connected based on preset interface
The first radio-frequency module for being connected with second processing chip, with first process chip and connect with the second processing chip
The second radio-frequency module connect, first process chip include be embedded with virtual user identifying card the first application processor and
The first modem being connected with entity user identification card, the second processing chip includes the second application processor and second
Modem;
First modem, during for receiving the packet acquisition request that second modem is sent by preset interface,
The packet is extracted from virtual user identifying card or entity user identification card and obtains the corresponding packet of request;To extraction
Packet is compressed;By in the extra buffer buffer of the data pack buffer after compression to the preset interface, for
Two modems extract the packet after compression from the buffer, to complete the transmission of packet.
2. mobile terminal as claimed in claim 1, it is characterised in that first modem, can be additionally operable to judgement
The compressing mark that second modem addition is extracted in request is obtained from the packet;If compressing mark can be extracted,
Then the packet of extraction is compressed.
3. mobile terminal as claimed in claim 1, it is characterised in that first modem, is additionally operable to extraction
The packet is parsed, to obtain the packet header of the packet;Packet header based on the packet determines the packet
Length;When the length of the packet is more than predetermined threshold value, then the packet of extraction is compressed.
4. the mobile terminal as described in any one of claims 1 to 3, it is characterised in that first modem is to extracting
Packet be compressed and specifically include:
First modem obtains the corresponding source text of the packet;
Determine character field of the frequency of occurrences more than predeterminated frequency in source text;
In pre-set dictionary list, the corresponding coding of the character field is searched, wherein, the length of coding is less than corresponding character field
Length;
Corresponding character field is replaced by the coding of lookup, to realize the compression of packet.
5. mobile terminal as claimed in claim 4, it is characterised in that first modem is additionally operable to, and determines source document
With the presence or absence of content is identical and length is more than the character field of preset value in this;
If in the presence of determining the distance and the length of the character field of latter character field and previous character end;
Latter character field is replaced using the mark of distance and length, to realize the compression of packet.
6. a kind of data pack transmission method, it is characterised in that applied to mobile terminal, the mobile terminal includes connecing based on default
The first process chip and second processing chip of mouthful connection, the first radio-frequency module for being connected with first process chip and
The second radio-frequency module being connected with the second processing chip, first process chip includes being embedded with virtual user identifying card
The first application processor and the first modem for being connected with entity user identification card, the second processing chip includes
Second application processor and second modem, methods described include:
First modem by preset interface receive the packet that second modem sends obtain ask when, from virtual
The packet is extracted in Subscriber Identity Module or entity user identification card and obtains the corresponding packet of request;
The packet of extraction is compressed;
By in the extra buffer buffer of the data pack buffer after compression to the preset interface, for second modem
The packet after compression is extracted from the buffer, to complete the transmission of packet.
7. data pack transmission method as claimed in claim 6, it is characterised in that what the packet of described pair of extraction was compressed
Before step, the data pack transmission method also includes:
Can first modem, which judge obtain from the packet, extracts second modem addition in request
Compressing mark;
If compressing mark can be extracted, the step of packet for performing described pair of extraction is compressed.
8. data pack transmission method as claimed in claim 6, it is characterised in that what the packet of described pair of extraction was compressed
Before step, the data pack transmission method also includes:
First modem is parsed to the packet of extraction, to obtain the packet header of the packet;
Packet header based on the packet determines the length of the packet;
When the length of the packet is more than predetermined threshold value, the step of packet for performing described pair of extraction is compressed.
9. the data pack transmission method as described in any one of claim 6 to 8, it is characterised in that the packet of described pair of extraction
The step of being compressed includes:
First modem obtains the corresponding source text of the packet;
Determine character field of the frequency of occurrences more than predeterminated frequency in source text;
In pre-set dictionary list, the corresponding coding of the character field is searched, wherein, the length of coding is less than corresponding character field
Length;
Corresponding character field is replaced by the coding of lookup, to realize the compression of packet.
10. data pack transmission method as claimed in claim 9, it is characterised in that first modem obtains described
After the step of packet corresponding source text, the step of packet of described pair of extraction is compressed also includes:
Determine in source text with the presence or absence of content is identical and length is more than the character field of preset value;
If in the presence of determining the distance and the length of the character field of latter character field and previous character end;
Latter character field is replaced using the mark of distance and length, to realize the compression of packet.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710397275.7A CN107231622A (en) | 2017-05-27 | 2017-05-27 | Mobile terminal and data pack transmission method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710397275.7A CN107231622A (en) | 2017-05-27 | 2017-05-27 | Mobile terminal and data pack transmission method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107231622A true CN107231622A (en) | 2017-10-03 |
Family
ID=59933967
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710397275.7A Withdrawn CN107231622A (en) | 2017-05-27 | 2017-05-27 | Mobile terminal and data pack transmission method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107231622A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112822301A (en) * | 2021-04-19 | 2021-05-18 | 成都同飞科技有限责任公司 | Smart card reading and writing method and system based on HTTP (hyper text transport protocol) |
-
2017
- 2017-05-27 CN CN201710397275.7A patent/CN107231622A/en not_active Withdrawn
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112822301A (en) * | 2021-04-19 | 2021-05-18 | 成都同飞科技有限责任公司 | Smart card reading and writing method and system based on HTTP (hyper text transport protocol) |
CN112822301B (en) * | 2021-04-19 | 2021-07-20 | 成都同飞科技有限责任公司 | Smart card reading and writing method and system based on HTTP (hyper text transport protocol) |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107222581A (en) | Data transmission system, method, external equipment and mobile terminal | |
CN107231660A (en) | Data packet transmission system and method | |
CN107124737A (en) | Mobile terminal and data pack transmission method | |
CN107231622A (en) | Mobile terminal and data pack transmission method | |
CN107071831A (en) | Mobile terminal and data pack transmission method | |
CN107182083A (en) | Mobile terminal and data pack transmission method | |
CN107318107A (en) | Data transmission system, method, external equipment and mobile terminal | |
CN107071833A (en) | Data packet transmission system and method | |
CN107318108A (en) | Data transmission system, method, external equipment and mobile terminal | |
CN107094151A (en) | Mobile terminal and data pack transmission method | |
CN107124738A (en) | Mobile terminal and data pack transmission method | |
CN107257569A (en) | Mobile terminal and data pack transmission method | |
CN107094152A (en) | Data packet transmission system and method | |
CN107094308A (en) | Data packet transmission system and method | |
CN107071832A (en) | Data packet transmission system and method | |
CN107257568A (en) | Data packet transmission system and method | |
CN107182082A (en) | Data packet transmission system and method | |
CN107182086A (en) | Data packet transmission system and method | |
CN107247679A (en) | Data transmission system and method | |
CN107222429A (en) | Data transmission system and method | |
CN107395606A (en) | Data packet transmission system and method | |
CN107466029A (en) | Data transmission system, method, external equipment and mobile terminal | |
CN107277859A (en) | Data transmission system, method, external equipment and mobile terminal | |
CN107182084A (en) | Mobile terminal and data pack transmission method | |
CN107466028A (en) | Data transmission system, method, external equipment and mobile terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WW01 | Invention patent application withdrawn after publication | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20171003 |