CN107182083A - Mobile terminal and data pack transmission method - Google Patents

Mobile terminal and data pack transmission method Download PDF

Info

Publication number
CN107182083A
CN107182083A CN201710395965.9A CN201710395965A CN107182083A CN 107182083 A CN107182083 A CN 107182083A CN 201710395965 A CN201710395965 A CN 201710395965A CN 107182083 A CN107182083 A CN 107182083A
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.)
Granted
Application number
CN201710395965.9A
Other languages
Chinese (zh)
Other versions
CN107182083B (en
Inventor
车晓东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nubia Technology Co Ltd
Original Assignee
Nubia Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN201710395965.9A priority Critical patent/CN107182083B/en
Publication of CN107182083A publication Critical patent/CN107182083A/en
Application granted granted Critical
Publication of CN107182083B publication Critical patent/CN107182083B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W88/00Devices specially adapted for wireless communication networks, e.g. terminals, base stations or access point devices
    • H04W88/02Terminal devices
    • H04W88/06Terminal devices adapted for operation in multiple networks or having at least two operational modes, e.g. multi-mode terminals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W28/00Network traffic management; Network resource management
    • H04W28/02Traffic management, e.g. flow control or congestion control
    • H04W28/06Optimizing the usage of the radio link, e.g. header compression, information sizing, discarding information

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (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, first process chip includes the first application processor and the first modem being connected with the first Subscriber Identity Module and second user identification card, and second processing chip includes the second application processor and second modem;First modem receives the packet acquisition request that second modem is sent by preset interface, and packet is extracted from the first Subscriber Identity Module or second user identification card;The packet of extraction is compressed;Cache again into the extra buffer buffer of preset interface, so that second modem extracts the packet after compression from buffer, to complete 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

Mobile terminal and data pack transmission method
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 that the present invention is provided, the mobile terminal includes being based on preset interface The first process chip and second processing chip of connection, the first radio-frequency module, the Yi Jiyu being connected with first process chip Second radio-frequency module of second processing chip connection, first process chip includes the first application processor and with the One Subscriber Identity Module and the first modem of second user identification card connection, 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 the first Subscriber Identity Module or second 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 provides a kind of data pack transmission method, the data pack transmission method Applied to mobile terminal, the mobile terminal include the first process chip connected based on preset interface and second processing chip, The first radio-frequency module being connected with first process chip and the second radio frequency mould being connected with the second processing chip Block, first process chip includes the first application processor and is connected with the first Subscriber Identity Module and second user identification card The first modem, the second processing chip include the second application processor and second modem, methods described Including:
When first modem receives the packet acquisition request that second modem is sent by preset interface, from The packet is extracted in first Subscriber Identity Module or second 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.
Technical scheme proposed by the present invention, the mobile terminal include based on preset interface connect the first process chip and Second processing chip, the first radio-frequency module being connected with first process chip and it is connected with the second processing chip The second radio-frequency module, first process chip include the first application processor and with the first Subscriber Identity Module and second use First modem of family identification card connection, the second processing chip includes the second application processor and the second modulation /demodulation Device;First modem by preset interface receive the packet that second modem sends obtain ask when, first from the The packet is extracted in one Subscriber Identity Module or second user identification card and obtains the corresponding packet of request, then to extraction Packet is compressed, then by the 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.This programme in transmission packet, First packet waiting for transmission is compressed, then the packet after compression is transmitted so that the capacity of the packet of transmission Value 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 includes the first application processor (Application Processor, is represented with AP1) 10, the first modulation /demodulation for being connected with the first Subscriber Identity Module 13 and second user identification card 14 Device 11 (modem1), RPM (Resource Power Manager, resource power supervisor) 15.Second processing chip 002 includes Second application processor 20 and second modem (modem2) 21.Subscriber Identity Module (the first Subscriber Identity Module 13 and second Subscriber Identity Module 14) block for SIM (Subscriber Identity Module, subscriber identification module).
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 the first Subscriber Identity Module 13 In SIM card parameter access eNodeB 101, second modem 21 can be by the SIM card in second user identification card 14 Parameter accesses eNodeB 101;Or first modem 11 by the SIM card parameter in second user identification card 14 come ENodeB 101 is accessed, second modem 21 accesses eNodeB by the SIM card parameter in the first Subscriber Identity Module 13 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 the first Subscriber Identity Module 13 or second user identification card 14, hereafter with the first modem 11 Data instance is obtained according to data acquisition request from the first Subscriber Identity Module 13 to be described in detail.
(grasped it is to be appreciated that including COS in the first Subscriber Identity Module 13 in Chip Operating System, piece Make system) operating system and memory module, wherein, the COS operating systems as memory module File Agent, according to described The data acquisition request that first modem 11 is sent extracts data from the memory module, and the memory module is used for depositing Store up data.That is, in the embodiment of the present invention, the first modem 11 is can not be with the storage mould inside the first Subscriber Identity Module 13 Block is interacted to obtain data, can only be obtained by COS operating systems.Therefore, when first modem 11 When data acquisition request is sent to the first Subscriber Identity Module 13, the COS operating systems parsing inside the first Subscriber Identity Module 13 Go out the address information of the data acquisition request, then according to the address information, obtained from the memory module describedly The corresponding data of location information.After the COS operating systems get data from memory module, by the data feedback of acquisition To first modem 11.
First modem 11 is sent data by UART after the data of COS 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.
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..
The first Subscriber Identity Module 13 and second user identification card 14 in mobile terminal 1 00 store different channel radio beacons The associated user profile of standard.It should be appreciated that current mobile terminal only has two users inside a set of radio frequency, mobile terminal 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, the first Subscriber Identity Module 13 and second 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 Subscriber Identity Module (the first Subscriber Identity Module 13 and second user identification card 14) is interacted with mobile terminal 1 00, move Dynamic terminal 100 detects that the signal of the Subscriber Identity Module presence or absence is only instantaneously produced in start, knows when start can't detect user Not Ka in the presence of, mobile terminal 1 00 will be prompted to " insertion Subscriber Identity Module ".After mobile terminal 1 00 is started shooting, mobile terminal 1 00 Communication in 28 seconds once, completes the communication check of some fixations (for example, whether Subscriber Identity Module is in place between Subscriber Identity Module Deng).
In an embodiment of the present invention, the first Subscriber Identity Module 13 and the carrying information of second 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, the first user Identification card 13 can support LTE by the first modem 11 in mobile terminal 1 00, and second user identification card 14 passes through the Two modems 21 support LTE;Or, the first Subscriber Identity Module 13 can support LTE by second modem 21, and the Two Subscriber Identity Modules 14 support 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 in mobile terminal 1 00 When one Subscriber Identity Module 13 and second user identification card 14 are all mobile card or UNICOM's card, due to mobile 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 the first Subscriber Identity Module 13 and second user identification card 14 is also less than 512 bytes, accordingly , the packet stored to buffer is also less than 512 bytes, therefore, the storage that packet can be complete into buffer, 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 whole in the case where the first Subscriber Identity Module 13 and second user identification card 14 are telecommunications card by taking Fig. 2 as an example End 100 the first modem 11 is from the first Subscriber Identity Module 13 or second user identification card 14 extracts a data 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.
What the Organization Chart based on above-mentioned LTE network, the hardware architecture diagram of mobile terminal 1 00 and prior art were present Problem, proposes each embodiment of the present invention.
Reference picture 2, the present embodiment proposes a kind of mobile terminal, and the mobile terminal includes the connected based on preset interface One process chip 001 and second processing chip 002, the first radio-frequency module 12 being connected with first process chip 001 and The second radio-frequency module 22 being connected with the second processing chip 002, first process chip 001 includes the first application processing Device 10 and the first modem 11 being connected with the first Subscriber Identity Module 13 and second user identification card 14, at described second Managing 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 the first Subscriber Identity Module 13 or second user identification card 14 and obtains the corresponding data of request 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 the according to packet Packet is obtained in one Subscriber Identity Module 13 or second user identification card 14;First modem 11 get packet it Afterwards, in order to ensure that the data of transmission are not more than UART buffer, first the packet of acquisition is compressed, obtained after compression Packet;The packet after compression is sent to by second modem 21 by UART again;Second modem 21 connects 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, first modem 11 is extracted from the first Subscriber Identity Module 13 or second user identification card 14 The packet obtains the corresponding packet of request and specifically included:
First modem 11 is operated in the piece into the first Subscriber Identity Module 13 or second user identification card 14 System sends packet and obtains request, by the chip operating system in the first Subscriber Identity Module 13 or second user identification card 14 In file storage module in extract the packet and obtain the corresponding packet of request, and feed back to first modulation /demodulation Device 11;
First modem 11 receives the packet of chip operating system feedback.
In the present embodiment, it is necessary to illustrate, the data in the first Subscriber Identity Module 13 or second user identification card 14 Bag is stored in file storage module, when the first modem 11 will obtain the first Subscriber Identity Module 13 or second user identification Card 14 in packet when, the first modem 11 will not directly with the first Subscriber Identity Module 13 or second user identification card 14 In file storage module interaction, but first COS (Chip into the first Subscriber Identity Module 13 or second user identification card 14 Operating System, chip operating system) operating system send packet obtain request be Request, then first use The COS operating systems of family identification card 13 or second user identification card 14 obtain number based on the Request in file storage module According to bag, the packet of acquisition is then transmitted further to the first modem 11, as long as the first modem 11 receives COS behaviour The acquisition process of packet can be achieved in the packet for making system feedback.
It is appreciated that because the first modem 11 can not be in the first Subscriber Identity Module 13 or second user identification card 14 In file storage module directly extract packet, therefore by with the first Subscriber Identity Module 13 or second 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 the first Subscriber Identity Module 13 or second 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 Adjust device 11 after the first Subscriber Identity Module 13 or second user identification card 14 extract packet, first deposit the packet of extraction Store up in buffer1, to be transmitted by UART into the buffer2 of second modem 21, second modem 21 is again Packet is obtained from buffer2.
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 the first Subscriber Identity Module or second 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 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 the first Subscriber Identity Module 13 or second 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 the first user The packet extracted in identification card 13 or second user identification card 14 is parsed, to obtain the packet header of the packet, then The length of packet is obtained from packet header, to determine the size of the packet.Wherein, packet is TLV forms, and TLV forms are One kind of BER (Basic Encoding Rules, BER Basic Encoding Rules) codings, full name is Type (type), and Length is (long Degree), Value (value), T field lists show the type of packet, and L field represents that the length of packet, V fields are used to deposit packet Content.
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:3A 3B 4C 4D;By this 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 5A B B 4C B B 3C;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 meant that Go out the number of times of repetition.That is, when text string character carries out coding compression using the algorithm of variant 2, first volume in encoded The initial of sequence illustrate spcial character be B, then due to followed by occur 5 character A, it is necessary to this 5 character A it One spcial character of preceding addition is character B, therefore is exactly B B 5A, occurs occurring 3 C again after B, and B after 5A, because This is exactly B B 5A B B 4C with above connecting, it is necessary to add a spcial character B again before 3 C, behind use Same mode, you can obtain final coded strings B B 5A B B 4C B B 3C.
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 5A B D 4C B D 3C。
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:85A 4B C D E 83F (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 4B 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 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 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 includes connecting based on preset interface The first process chip 001 and second processing chip 002 that connect, the first radio-frequency module being connected with first process chip 001 12 and the second radio-frequency module 22 for being connected with the second processing chip 002, first process chip 001 includes first Application processor 10 and the first modem 11 being connected with the first Subscriber Identity Module 13 and second user identification card 14, institute Stating second processing chip 002 includes the second application processor 20 and second modem 21, and methods described includes:
Step S10, the first modem receives the packet acquisition that second modem is sent by preset interface During request, the packet is extracted from the first Subscriber Identity Module or second 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 the according to packet Packet is obtained in one Subscriber Identity Module 13 or second user identification card 14;First modem 11 get packet it Afterwards, in order to ensure that the data of transmission are not more than UART buffer, first the packet of acquisition is compressed, obtained after compression Packet;The packet after compression is sent to by second modem 21 by UART again;Second modem 21 connects 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 is operated in the piece into the first Subscriber Identity Module or second user identification card System sends packet and obtains request, by the chip operating system in the first Subscriber Identity Module or second user identification card The packet is extracted in file storage module and obtains the corresponding packet of request, and feeds back to first modem;
Step B, first modem receives the packet of chip operating system feedback.
In the present embodiment, it is necessary to illustrate, the data in the first Subscriber Identity Module 13 or second user identification card 14 Bag is stored in file storage module, when the first modem 11 will obtain the first Subscriber Identity Module 13 or second user identification Card 14 in packet when, the first modem 11 will not directly with the first Subscriber Identity Module 13 or second user identification card 14 In file storage module interaction, but first COS (Chip into the first Subscriber Identity Module 13 or second user identification card 14 Operating System, chip operating system) operating system send packet obtain request be Request, then first use The COS operating systems of family identification card 13 or second user identification card 14 obtain number based on the Request in file storage module According to bag, the packet of acquisition is then transmitted further to the first modem 11, as long as the first modem 11 receives COS behaviour The acquisition process of packet can be achieved in the packet for making system feedback.
It is appreciated that because the first modem 11 can not be in the first Subscriber Identity Module 13 or second user identification card 14 In file storage module directly extract packet, therefore by with the first Subscriber Identity Module 13 or second 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 the first Subscriber Identity Module 13 or second 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 Adjust device 11 after the first Subscriber Identity Module 13 or second user identification card 14 extract packet, first deposit the packet of extraction Store up in buffer1, to be transmitted by UART into the buffer2 of second modem 21, second modem 21 is again Packet is obtained from buffer2.
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 the first Subscriber Identity Module or second 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 the first Subscriber Identity Module 13 or second 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 the first user The packet extracted in identification card 13 or second user identification card 14 is parsed, to obtain the packet header of the packet, then The length of packet is obtained from packet header, to determine the size of the packet.Wherein, packet is TLV forms, and TLV forms are One kind of BER (Basic Encoding Rules, BER Basic Encoding Rules) codings, full name is Type (type), and Length is (long Degree), Value (value), T field lists show the type of packet, and L field represents that the length of packet, V fields are used to deposit packet Content.
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:3A 3B 4C 4D;By this 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 5A B B 4C B B 3C;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 meant that Go out the number of times of repetition.That is, when text string character carries out coding compression using the algorithm of variant 2, first volume in encoded The initial of sequence illustrate spcial character be B, then due to followed by occur 5 character A, it is necessary to this 5 character A it One spcial character of preceding addition is character B, therefore is exactly B B 5A, occurs occurring 3 C again after B, and B after 5A, because This is exactly B B 5A B B 4C with above connecting, it is necessary to add a spcial character B again before 3 C, behind use Same mode, you can obtain final coded strings B B 5A B B 4C B B 3C.
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 5A B D 4C B D 3C。
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:85A 4B C D E 83F (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 4B 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, 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 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.
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 the first application processor and with the first Subscriber Identity Module and second First modem of Subscriber Identity Module connection, the second processing chip includes the second application processor and the second modulatedemodulate Adjust device;
First modem, during for receiving the packet acquisition request that second modem is sent by preset interface, The packet is extracted from the first Subscriber Identity Module or second 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 include the first application processor and with First Subscriber Identity Module and the first modem of second user identification card connection, the second processing chip includes second should With processor and second modem, methods described includes:
When first modem receives the packet acquisition request that second modem is sent by preset interface, from first The packet is extracted in Subscriber Identity Module or second 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.
CN201710395965.9A 2017-05-27 2017-05-27 Mobile terminal and data packet transmission method Active CN107182083B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710395965.9A CN107182083B (en) 2017-05-27 2017-05-27 Mobile terminal and data packet transmission method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710395965.9A CN107182083B (en) 2017-05-27 2017-05-27 Mobile terminal and data packet transmission method

Publications (2)

Publication Number Publication Date
CN107182083A true CN107182083A (en) 2017-09-19
CN107182083B CN107182083B (en) 2021-08-10

Family

ID=59836598

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710395965.9A Active CN107182083B (en) 2017-05-27 2017-05-27 Mobile terminal and data packet transmission method

Country Status (1)

Country Link
CN (1) CN107182083B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111954202A (en) * 2019-05-15 2020-11-17 现代自动车株式会社 Moving object, method for operating moving object and edge calculation system

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012112618A1 (en) * 2011-02-14 2012-08-23 The Regents Of The University Of California Multi-band interconnect for inter-chip and intra-chip communications
CN102905259A (en) * 2011-07-27 2013-01-30 中国移动通信有限公司 Communication implementation method, central processing unit and terminal
CN103067907A (en) * 2012-12-20 2013-04-24 中兴通讯股份有限公司 Multi-mode terminals and switching method of multi-mode terminals
US9111368B1 (en) * 2004-11-15 2015-08-18 Nvidia Corporation Pipelined L2 cache for memory transfers for a video processor
US20150261583A1 (en) * 2014-03-13 2015-09-17 Qualcomm Incorporated System and method for providing dynamic clock and voltage scaling (dcvs) aware interprocessor communication
US20150310789A1 (en) * 2014-03-18 2015-10-29 Nvidia Corporation Superresolution display using cascaded panels
CN105657691A (en) * 2016-01-27 2016-06-08 努比亚技术有限公司 Mobile terminal and data sharing method of double-chip system thereof
CN105682083A (en) * 2016-01-28 2016-06-15 努比亚技术有限公司 Mobile terminal and communication method of dual modem system
CN105850056A (en) * 2013-08-30 2016-08-10 高通股份有限公司 Antenna switching for dual-radio device
CN106060787A (en) * 2016-05-16 2016-10-26 北京奇虎科技有限公司 Information transmitting method, apparatus and device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9111368B1 (en) * 2004-11-15 2015-08-18 Nvidia Corporation Pipelined L2 cache for memory transfers for a video processor
WO2012112618A1 (en) * 2011-02-14 2012-08-23 The Regents Of The University Of California Multi-band interconnect for inter-chip and intra-chip communications
CN102905259A (en) * 2011-07-27 2013-01-30 中国移动通信有限公司 Communication implementation method, central processing unit and terminal
CN103067907A (en) * 2012-12-20 2013-04-24 中兴通讯股份有限公司 Multi-mode terminals and switching method of multi-mode terminals
CN105850056A (en) * 2013-08-30 2016-08-10 高通股份有限公司 Antenna switching for dual-radio device
US20150261583A1 (en) * 2014-03-13 2015-09-17 Qualcomm Incorporated System and method for providing dynamic clock and voltage scaling (dcvs) aware interprocessor communication
US20150310789A1 (en) * 2014-03-18 2015-10-29 Nvidia Corporation Superresolution display using cascaded panels
CN105657691A (en) * 2016-01-27 2016-06-08 努比亚技术有限公司 Mobile terminal and data sharing method of double-chip system thereof
CN105682083A (en) * 2016-01-28 2016-06-15 努比亚技术有限公司 Mobile terminal and communication method of dual modem system
CN106060787A (en) * 2016-05-16 2016-10-26 北京奇虎科技有限公司 Information transmitting method, apparatus and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111954202A (en) * 2019-05-15 2020-11-17 现代自动车株式会社 Moving object, method for operating moving object and edge calculation system
CN111954202B (en) * 2019-05-15 2024-05-14 现代自动车株式会社 Moving object, method of operating the same, and edge computing system

Also Published As

Publication number Publication date
CN107182083B (en) 2021-08-10

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
CN107466070A (en) Data transmission system, method, external equipment and mobile terminal
CN107124737A (en) Mobile terminal and data pack transmission method
CN107182083A (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
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
CN107257569A (en) Mobile terminal and data pack transmission method
CN107124738A (en) Mobile terminal and data pack transmission method
CN107182086A (en) Data packet transmission system and method
CN107257568A (en) Data packet transmission system and method
CN107094308A (en) Data packet transmission system and method
CN107094152A (en) Data packet transmission system and method
CN107182082A (en) Data packet transmission system and method
CN107071832A (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
CN107277859A (en) Data transmission system, method, external equipment and mobile terminal
CN107466029A (en) Data transmission system, method, external equipment and mobile terminal
CN107182084A (en) Mobile terminal and data pack transmission method

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
GR01 Patent grant
GR01 Patent grant