CN107231660A - Data packet transmission system and method - Google Patents

Data packet transmission system and method Download PDF

Info

Publication number
CN107231660A
CN107231660A CN201710395846.3A CN201710395846A CN107231660A CN 107231660 A CN107231660 A CN 107231660A CN 201710395846 A CN201710395846 A CN 201710395846A CN 107231660 A CN107231660 A CN 107231660A
Authority
CN
China
Prior art keywords
packet
application processor
length
data
character
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN201710395846.3A
Other languages
Chinese (zh)
Inventor
李隽�
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 CN201710395846.3A priority Critical patent/CN107231660A/en
Publication of CN107231660A publication Critical patent/CN107231660A/en
Withdrawn legal-status Critical Current

Links

Classifications

    • 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
    • H04W28/065Optimizing the usage of the radio link, e.g. header compression, information sizing, discarding information using assembly or disassembly of packets
    • 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

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 data packet transmission system and method, the system includes:Mobile terminal and external equipment, mobile terminal includes the first application processor, the first modem, the first radio-frequency module of embedded virtual user identifying card, and the first Subscriber Identity Module and second user identification card being connected with first modem, external equipment include the second application processor, second modem and the second radio-frequency module;When first application processor receives the packet acquisition request that the second application processor is sent by preset interface, the packet is extracted from virtual user identifying card and obtains the corresponding packet of request;The packet of extraction is compressed and cached into the extra buffer buffer of the preset interface, so that the second application processor extracts the packet after compression from the 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

Data packet transmission system and method
Technical field
The present invention relates to communication technical field, more particularly to a kind of data packet transmission system and 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 with it is external Equipment connects (being provided with modem in the external equipment), to realize double LTE communication functions.But, current mobile terminal Carried out with external equipment in transmission of data packets, if the Subscriber Identity Module in mobile terminal is telecommunications card, due to telecommunications card The extra buffer buffer of data transfer capability value typically greater than between mobile terminal and external equipment, therefore buffer A complete packet can not be 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 data packet transmission system and method, it is intended to solve existing packet Transmission means, is easily caused the technical problem of mobile terminal deadlock.
To achieve the above object, a kind of data packet transmission system that the present invention is provided, the data packet transmission system includes Mobile terminal, and the external equipment being connected by preset interface with the mobile terminal, the mobile terminal includes first should With processor, the first modem for being embedded with virtual user identifying card, the first radio-frequency module, and with the described first modulation The first Subscriber Identity Module and second user identification card of demodulator connection, the external equipment include the second application processor, the Two modems and the second radio-frequency module;
First application processor, for receiving the packet acquisition that the second application processor is sent by preset interface During request, the packet is extracted from virtual user identifying card and obtains the corresponding packet of request;The packet of extraction is entered Row compression;By in the extra buffer buffer of the data pack buffer after compression to the preset interface, at the second application Reason device extracts the packet after compression from the buffer, to complete the transmission of packet.
Alternatively, first application processor, can be additionally operable to judgement extract from packet acquisition request The compressing mark of second application processor addition;If compressing mark can be extracted, the packet of extraction is compressed.
Alternatively, first application processor, 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 application processor is compressed to the packet of extraction specifically includes:
First application processor 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 application processor, is additionally operable to determine identical and length is big with the presence or absence of content in source text In the character field of preset value;
If in the presence of determining the distance and the length of the character field of latter character field and previous character end;
Latter character field is replaced using the mark of distance and length, to realize the compression of packet.
In addition, to achieve the above object, the present invention also proposes a kind of data pack transmission method, applied to mobile terminal and The external equipment being connected by preset interface with mobile terminal, the mobile terminal includes the first application processor, is embedded with void Intend the first modem, the first radio-frequency module of Subscriber Identity Module, and first be connected with first modem Subscriber Identity Module and second user identification card, the external equipment include the second application processor, second modem and the Two radio-frequency modules, methods described includes:
When first application processor receives the packet acquisition request that the second application processor is sent by preset interface, from The packet is extracted in virtual user identifying 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, at the second application Reason device extracts 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 application processor, which judge obtain in request from the packet, extracts the second application processor 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 application processor 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 application processor 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 application processor 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 data packet transmission system includes mobile terminal, and passes through preset interface The external equipment being connected with the mobile terminal, the mobile terminal includes the first application processor, the first modem the One radio-frequency module, and the first Subscriber Identity Module and second user identification card being connected with first modem, it is described External equipment includes the second application processor, second modem and the second radio-frequency module;First application processor leads to When crossing the packet acquisition request that preset interface the second application processor of reception is sent, institute is first extracted from virtual user identifying card State packet and obtain the corresponding packet of request, then the packet of extraction is compressed, then the packet after compression is delayed Deposit into the buffer of the preset interface, so that the second application processor extracts the data after compression from the buffer Bag, to complete the transmission of packet.This programme is first compressed in transmission packet to packet waiting for transmission, then will pressure Packet after contracting is transmitted so that the capability value of the packet of transmission has reduced, it is to avoid moved in data transmission procedure The situation of dynamic terminal crash.
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 entity signal of communication connection of mobile terminal and external equipment communication connection in the embodiment of the present invention Figure;
Fig. 3 is mobile terminal and a kind of hardware architecture diagram of external equipment communication connection in the embodiment of the present invention;
Fig. 4 is the interaction schematic diagram between the first application processor of the invention and the second application processor;
Fig. 5 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 signal of LTE (Long Term Evolution, Long Term Evolution) network architecture of one embodiment of the invention Figure.The LTE network framework of one embodiment of the invention includes:One or more mobile terminals (user equipment, UE) 100, External equipment 200, E-UTRAN (Evolved UMTS Terrestrial Radio Access Network, the UMTS of evolution Land radio access web) (non-label in figure), evolution block core (EPC) (non-label in figure), home subscriber servers (HSS) 107th, 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).
Mobile terminal 1 00 passes through preset interface, such as USB (Universal Serial Bus, USB) data Line 300 is connected with the communication of external equipment 200.
Fig. 2 is the entity schematic diagram of mobile terminal 1 00 of the present invention and the communication connection of external equipment 200.
As shown in Fig. 2 mobile terminal 1 00 is connected by USB data line 300 with the communication of external equipment 200, wherein, it is described Mobile terminal includes but is not limited to mobile phone, PC (Personal Computer, PC) or PAD (Personal Digital Assistant, personal digital assistant), the external equipment 200 is chosen as wireless Internet card or data card.
Fig. 3 is the structural representation of mobile terminal 1 00 of the present invention and the communication connection of external equipment 200.
The mobile terminal 1 00 of the embodiment of the present invention is connected by USB data line 300 with the communication of external equipment 200, based on shifting Dynamic terminal 100 and the basis of the communication connection of external equipment 200, mobile terminal 1 00 can support double LTE.Specifically:
Mobile terminal 1 00 includes the first process chip 001, and first be connected with first process chip 001 is penetrated Frequency module 12, wherein, the first process chip 001 includes the first application processor, and (Application Processor use AP1 tables Show) 10, be embedded with virtual user identifying card 11A and be connected with the first Subscriber Identity Module 13 and second user identification card 14 first Modem 11 (modem1), RPM (Resource Power Manager, resource power supervisor) 15, wherein, it is virtual to use Family identification card 11A include memory module and virtual chip operating system (Virtual Chip Operating System, VCOS), the memory module can be EFS (Encrypting File System, encrypted file system), and memory module is used to store Virtual user identifying card 11A authorization data.First Subscriber Identity Module 13 and second user identification card 14 are SIM (Subscriber Identity Module, subscriber identification module) blocks.
External equipment 200 includes second processing chip 002, and second be connected with the second processing chip 002 is penetrated Frequency module 22, wherein, second processing chip 002 includes the second application processor (being represented with AP2) 20, second modem (modem2)21。
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 one embodiment, application processor refers to Android operations system System, and the various apk (Android Package, Android installation kit) based on Android operation system.In the reality of the present invention Apply in example, the first application processor 10 and the second application processor 20 realize communication connection by USB data line, provide the user Interactive interface, the operational order that user is inputted is (for example, the behaviour for the relevant startup video calling that user is inputted by user interface Instruct) the first modem 11 or second modem 21 are transferred to, to realize data between two application processors Definition and transmission, for example, it is suitable to carry out chip startup when the dormancy of two application processors, wake-ups, synchronous control, switching on and shutting down Control of sequence etc..
It should be appreciated that in embodiments of the present invention, USB data line 300 is multiplexed out three data passages, is respectively used to User data between first application processor 10 and the second application processor 20, control signaling data and SIM card authorization data The data that interaction, i.e. the first application processor 10 and the second application processor 20 are transmitted by USB data line 300 include above-mentioned three Plant data.Wherein, user data includes the data that online is produced, picture and chat message data;Control signaling data include opening The control data of shutdown, switchs the control data of offline mode, the control data of dispaly state signal;SIM card authorization data bag Include but be not limited to IMSI (International Mobile Subscriber Identification Number, world movement CUSTOMER ID), Ki (key identifier, KI) etc..
In the present embodiment, the first application processor 10 and the second application processor 20 are entered by OTG (On-The-Go) technology Row data interaction.By OTG technologies, the first modem 11 in mobile terminal 1 00 can pass through virtual user identifying card SIM card parameter in 11A, the first Subscriber Identity Module 13 or second user identification card 14 accesses eNodeB 101, external equipment Second modem 21 in 200 can also be known by second user identification card 14, the first Subscriber Identity Module 13 or Virtual User SIM card parameter that Ka be in 11A accesses eNodeB 101, and the SIM card parameter includes but is not limited to SIM card authorization data. Wherein, the buffer of USB interface is present in the two ends of the first application processor 10 and the second application processor 20, uses buffer1 Represented with buffer2.It should be noted that buffer1 and buffer2 correspond to same physical address, by this physically Location, can control the synchronous change of buffer1 and buffer2 capability values and state.
Because buffer1 and buffer2 correspond to same physical address, therefore the first application processor 10 is by extraction When data pack buffer is to buffer1, packet sends into buffer2 caching by the UART, and the second application processor 20 exists When the packet is detected in buffer2, you can get the packet, to realize the transmission of packet.
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 transmitted to after being used for the data processing of transmitting mobile terminal 1 00 ENodeB 101 (base station network), and for being transmitted to mobile terminal 1 00 after the data processing of transmitting eNodeB 101.Second Radio-frequency module 22 is transmitted to eNodeB 101 (base station network) after being used for the data processing of transmitting external equipment 200, and is used for External equipment 200 is transmitted to after the data processing that eNodeB 101 is transmitted.
Wireless access technology involved by first radio-frequency module 12 and the second radio-frequency module 22 can include LTE, GSM, GPRS (General Packet Radio Service, general packet radio service), CDMA, EDGE, WLAN (Wireless Local Area Networks, WLAN), CDMA-2000, TD-SCDMA, WCDMA, WIFI (Wireless Fidelity, Wireless Fidelity) etc..
Virtual user identifying card 11A, the first Subscriber Identity Module 13 and second user identification card 14 in mobile terminal 1 00 are deposited The different wireless communication standard associated user information of storage.It should be appreciated that current mobile terminal only has a set of radio frequency, it is mobile whole Two Subscriber Identity Modules inside end are the relation of time-sharing multiplex using the set radio frequency, can not be taken simultaneously.For example, at two During Subscriber Identity Module standard-sized sheet, a card can handle GSM calls, and another card can only handle the 4G network informations, which specific use Which kind of network family identification card performs, and does not limit.Therefore current this framework of radio frequency double card time-sharing multiplex has only accomplished LTE+ GSM (the corresponding technical standard of i.e. one Subscriber Identity Module 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 external equipment 200 by USB data line 300, and because external equipment 200 includes the second radio-frequency module 22, and second penetrates Frequency module 22 supports 4G networks, and therefore, mobile terminal 1 00 can be interacted by USB line 300 with external equipment 200, so that moving Dynamic terminal 100 possesses double LTE functions.
In the present embodiment, data packet transmission system includes mobile terminal 1 00 and external equipment 200, and mobile terminal 1 00 is led to Crossing external equipment 200 and possessing the implementation process of double LTE functions to be:1. second user identification card 14 passes through second modem 21 support LTE, and detailed process is:First modem 11 will need the number of access LTE network in second user identification card 14 According to the first application processor 10 is sent to, received data is sent to external equipment by the first application processor 10 by USB Received data is sent to second modem 21 by 200 the second application processor 20, the second application processor 20, by Second modem 21 is transmitted to the second radio-frequency module 22, and received data is passed through LTE network by the second radio-frequency module 22 Send;And the first Subscriber Identity Module 13 supports LTE by the first modem 11, to realize that mobile terminal 1 00 can be propped up Hold double LTE.2. the first Subscriber Identity Module 13 supports LTE by second modem 21, and detailed process is:First application processing Device 10 will need the data for accessing LTE network to be sent to the second of external equipment 200 by USB in first Subscriber Identity Module 13 should With processor 20, received data is sent to second modem 21 by the second application processor 20, by the second modulatedemodulate Device 21 is adjusted to be transmitted to the second radio-frequency module 22, the second radio-frequency module 22 sends received data by LTE network;And Second user identification card 14 supports LTE by the first modem 11, to realize that mobile terminal 1 00 can support double LTE.When So, available virtual Subscriber Identity Module 11A substitutes above-mentioned the first Subscriber Identity Module 13 and second user identification card 14, does not do specifically Repeat.
In the present embodiment, virtual user identifying card 11A, the first Subscriber Identity Module 13 and second user identification card 14 are used for Related data needed for mobile communication business (CS speech businesses, PS data services and PS speech businesses) is provided, and inside it User profile, short message are stored, authentication arithmetic is performed and produces cryptographic keys etc..
Subscriber Identity Module (virtual user identifying card 11A, the first Subscriber Identity Module 13 and second user identification card 14) is with moving When dynamic terminal 100 is interacted, mobile terminal 1 00 detects that the signal of the Subscriber Identity Module presence or absence is only produced start is instantaneous, when Start can't detect in the presence of Subscriber Identity Module, and mobile terminal 1 00 will be prompted to " insertion Subscriber Identity Module ".Mobile terminal 1 00 is opened After machine, between mobile terminal 1 00 and Subscriber Identity Module 28 seconds communication once, complete some fixation communication check (for example, with Whether family identification card is in place etc.).
In an embodiment of the present invention, virtual user identifying card 11A, the first Subscriber Identity Module 13 and second user identification card 14 carrying informations, and correspondence card parameter is returned to according to external world's request, and authentication computing, the first radio-frequency module are carried out to network 12 and the second wireless access technology involved by radio-frequency module 22 be LTE.For example, when mobile terminal 1 00 not by USB with it is external When equipment 200 is connected, the technical standard corresponding to the first Subscriber Identity Module 13 is GSM, for carrying out speech communication, second user Identification card 14 supports LTE by the first modem 11, for carrying out data access by 4G networks.When mobile terminal 1 00 When being connected by USB data line 300 with external equipment 200, the first Subscriber Identity Module 13 can be by first in mobile terminal 1 00 Modem 11 supports LTE, and second user identification card 14 supports LTE by second modem 21;Or, first uses Family identification card 13 can support LTE by second modem 21, and second user identification card 14 passes through the first modem 11 support LTE, to realize that mobile terminal 1 00 can support double LTE in the case of connecting external equipment 200.
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, it is necessary to wake up at the first application Reason device 10 is interacted with the transmission for carrying out data.
In the case where mobile terminal 1 00 and external equipment 200 are by the communication connection of USB data line 300, wake-up mode bag Include three kinds:
1st, when the first application processor 10 receives control signaling data, by the transmission detection bag of USB data line 300 to the Two application processors 20, to wake up the second application processor 20.
2nd, when the second modem 21 of external equipment 200 receives user data, the second application processor 20 is waken up, Detection bag is transmitted to the first application processor 10 by USB data line 300 by the second application processor 20, 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 by USB data line 300 by the second application processor 20 Device 10 is managed, 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.
It should be noted that the packet of transmission is SIM for user data, control signaling data or Subscriber Identity Module data During card data, three kinds of data are transmitted all between application processor.
In the present embodiment, SIM card includes mobile card, UNICOM's card and telecommunications card, wherein, mobile card and UNICOM's card refer to use The phonecard that 3GPP standard agreements are communicated, the capacity that 3GPP standard agreements define phonecard transmission packet can not exceed Certain value, the value is set to 512 bytes;And telecommunications card refers to the phonecard using 3GPP2 standard agreements, GPP2 standard agreements The capacity of the packet transmitted to telecommunications card is not limited, and the capacity of the packet of telecommunications card transmission can typically exceed 512 bytes. Wherein, mobile card is the SIM card provided a user by China Mobile (operator), UNICOM's card be from CHINAUNICOM (operator) to The SIM card that user provides, telecommunications card is the SIM card provided a user by China Telecom (operator).
Due to existing buffer capacity typically no more than 512 bytes.Therefore, when the void in mobile terminal 1 00 When plan Subscriber Identity Module 11A, the first Subscriber Identity Module 13 and second user identification card 14 are all mobile card or UNICOM's card, by It is less than 512 bytes, therefore, the first application processor 10 in mobile card either UNICOM Ka Shoufashuojubao data capacity When receiving packet acquisition request, from virtual user identifying card 11A, the first Subscriber Identity Module 13 and second user identification card 14 The packet got is also less than 512 bytes, accordingly, and the packet stored to buffer is also less than 512 bytes , therefore, the storage that packet can be complete is into buffer, subsequently, and the second application processor 20 can also take out one completely Packet.
But, because telecommunications card is generally higher than 512 bytes, therefore, in the first application processor 10 and the second application processing In the data exchange process of device 20, if what is connected in the first application processor 10 is telecommunications card, it may appear that such situation:
It is electricity in virtual user identifying card 11A, the first Subscriber Identity Module 13 and second user identification card 14 by taking Fig. 3 as an example In the case of letter card, the application processor 10 of mobile terminal 1 00 first is by the first modem 11 from virtual user identifying card In 11A, the first Subscriber Identity Module 13 or second user identification card 14 extracts a packet, because the packet is more than 512 Byte, and buffer can only disposably cache the packet no more than 512 bytes, in this case, can be big due to that can not forward Packet causes the system in case of system halt of mobile terminal.
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 the second application processor 20, when having detected packet from buffer When, it is believed that the packet is complete packet, and now the second application processor 20 directly obtains the packet from buffer, and The packet is forwarded to base station.It is obvious that in this case, the packet of forwarding is incomplete packet.
The structure of Organization Chart and mobile terminal 1 00 and the communication connection of external equipment 200 based on above-mentioned LTE network is shown It is intended to, proposes each embodiment of the present invention.
Reference picture 3, the present embodiment proposes a kind of data packet transmission system, and the data packet transmission system includes mobile terminal 100, and the external equipment 200 being connected by preset interface with the mobile terminal 1 00, the mobile terminal 1 00 includes the One application processor 10, the first modem 11 for being embedded with virtual user identifying card 11A, the first radio-frequency module 12, and The first Subscriber Identity Module 13 and second user identification card 14 being connected with first modem 11, the external equipment 200 include the second application processor 20, the radio-frequency module 22 of second modem 21 and second;
First application processor 10, for receiving the packet that the second application processor 20 is sent by preset interface When obtaining request, the packet is extracted from virtual user identifying card 11A and obtains the corresponding packet of request;To the number of extraction It is compressed according to bag;By in the extra buffer buffer of the data pack buffer after compression to the preset interface, for second Application processor 20 extracts the packet after compression from the buffer, to complete the transmission of packet.
In the present embodiment, first application processor 10 receives the second application processor 20 by preset interface and sent Packet obtain request, be also subsequently that packet is fed back to by second application processor 20 by the preset interface. The preset interface is USB 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, packet is obtained into request and sent to the second application processor of second processing chip 002 In 20, when the second application processor 20, which receives packet, obtains request, first pass through USB data line 300 and obtain packet Request is sent in the first application processor 10 of mobile terminal 1 00;First application processor 10 receives packet acquisition During request, packet is obtained into request and is sent in the first modem 11 of mobile terminal 1 00, by the first modem 11 obtain request according to the packet obtains packet from virtual user identifying card 11A;First modem 11 is got After packet, packet is transmitted into the first application processor 10;First application processor 10 is got after packet, In order to ensure that the data of transmission are not more than USB buffer, first the packet of acquisition is compressed, the number after being compressed According to bag;The packet after compression is sent to by the second application processor 20 by USB again;Second application processor 20 is being received After packet, then packet is sent to the second radio-frequency module 22, packet is uploaded to base station by the second radio-frequency module 22, with Complete the transmission of data.
In the present embodiment, the first application processor is not limited to the virtual user identifying card embedded from the first modem Packet is obtained in 11A, certainly, can also be obtained according to actual needs in the first Subscriber Identity Module 13 or second user identification card 14 Packet is taken, the first application processor is in virtual user identifying card 11A, the first Subscriber Identity Module 13 or second user identification card 14 The middle mode for obtaining packet is consistent, hereafter in order to sketch, other only exemplified by obtaining packet in virtual user identifying card Two kinds repeat no more.
Specifically, first application processor 10, is additionally operable to recognize to Virtual User by the first modem 11 Block the chip operating system in 11A and send packet acquisition request, by the chip operating system in virtual user identifying card 11A 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 application processor 10, is additionally operable to receive what chip operating system fed back by the first modem 11 Data.
In the present embodiment, it is necessary to which the packet in explanation, virtual user identifying card 11A is stored in file storage mould In block, when the first modem 11 will obtain the packet in virtual user identifying card 11A, the first modem 11 is not Directly it can be interacted with the file storage module in virtual user identifying card 11A, but first into virtual user identifying card 11A It is Request that COS (Chip Operating System, chip operating system) operating system, which sends packet and obtains request, so Virtual user identifying card 11A COS operating systems obtain packet based on the Request in file storage module afterwards, then The packet of acquisition is transmitted further to the first modem 11, as long as the first modem 11 reception COS operating systems are anti- The packet of feedback, it is that data can be achieved that follow-up first application processor 10 obtains packet in the first modem 11 The acquisition process of bag.
It is appreciated that because the first modem 11 can not be in the file storage module in virtual user identifying card 11A Packet is directly extracted, therefore is interacted by the COS operating systems with virtual user identifying card 11A, to realize packet Extraction, it is ensured that follow-up data transmission procedure is normally run.
The corresponding data of request are obtained when the first application processor 10 extracts packet from virtual user identifying card 11A After bag, then the packet of extraction is compressed, in the present embodiment, the first application processor 10 is compressed to packet When, the compression of packet can be carried out by the way of ciphered compressed, directly can also be compressed using plaintext.Due to transmission SIM card Network authentication data amount it is smaller, in order to reduce encrypting and decrypting etc. operation and cause data transmission efficiency low, the present invention The mode that embodiment is preferred to use compression in plain text is compressed to packet, i.e., the compression algorithm used in this programme is with simple high Based on effect, the compression algorithm and compression process specifically used is described in detail in embodiments below.
After first application processor 10 is to data packet compressing, you can default connect the data pack buffer after compression to described In mouth USB buffer, so that the second application processor 20 extracts the packet after compression from the buffer, to complete number According to the transmission of bag.
It should be noted that buffer is present in the two ends difference of the two ends of USB interface, i.e. USB interface in the present embodiment It is provided with buffer1 and buffer2.The is sent to when packet is obtained request by USB interface by the second application processor 20 During one application processor 10, the first application processor 10 is extracted by the first modem 11 from virtual user identifying card 11A Go out after packet, first store the packet of extraction into buffer1, to pass through USB transmission to buffer2, the second application Processor 20 obtains packet from buffer2 again.
The technical scheme that the present embodiment is proposed, first application processor receives the second application by preset interface and handled When the packet that device is sent obtains request, the packet is first extracted from virtual user identifying card and obtains the corresponding data of request Bag, is then compressed to the packet of extraction, then by the buffer of the data pack buffer after compression to the preset interface, So that the second application processor extracts 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 transmission The capability value of packet reduced, it is to avoid the situation that mobile terminal crashes in data transmission procedure.
Further, data packet transmission system second embodiment of the present invention is proposed based on first embodiment.
The difference of data packet transmission system second embodiment and data packet transmission system first embodiment is, described first Can application processor 10, be additionally operable to judge obtain from the packet to extract the addition of the second application processor 20 in request Compressing mark;If compressing mark can be extracted, the packet of extraction is compressed.
In the present embodiment, request is obtained when the second application processor 20 sends packet to the first application processor 10 (Request) before, in order to prevent the packet of transmission excessive, when the second application processor 20 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 application processor 10 is compressed to sent packet.
It should be noted that because data waiting for transmission are determined according to communication protocol standard, therefore, at the second application Reason device 20 can learn the data type and size of data for the packet that will be obtained, then, when the second application processor 20 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 the second application processor 20 compressing mark is added in Request, to inform the first application processor 10 pairs of packets waiting for transmission are compressed, if the second application processor 20 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 the second application processor 20 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 packet that the first application processor 10 receives the transmission of the second application processor 20 by preset interface (USB) is obtained When taking request, request first is obtained to the packet and parsed, is extracted with determining whether to obtain in request from the packet Go out the compressing mark of the second application processor 20 addition, if extracting compressing mark in the packet obtains request, now, First application processor 10 can be compressed to the packet of extraction, subsequently again by the data pack buffer after compression to institute In the buffer1 for stating preset interface, and by USB transmission into buffer2, so that the second application processor 20 is from described 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 application processor 10 of generation and the second application processor 20 are called out After waking up, then after the first application processor 10 and the second application processor 20 wake up, if the second application processor 20 is logical The second radio-frequency module 22 for crossing the connection of second modem 21 receives the packet acquisition request of base station transmission, performs following Operation:
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 USB 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 application processor 10 receives packet acquisition request by USB, 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 being extracted by the first modem 11 from virtual user identifying card 11A Packet be compressed;
Feedback:Feed back the packet of compression.
Finally, the second application processor 20 receives the packet that the first application processor 10 feeds back by USB, to complete number According to bag transmitting procedure.Above-mentioned operating process, can refer to Fig. 4.
It should be noted that the transmission of the second application processor 20 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 application processor 10 is to packet before being compressed, and can first judge from described Packet obtains the compressing mark that the addition of the second application processor 20 is extracted in request, if compressing mark can be extracted, just right Packet is compressed, and prevents packet to be also compressed when being less than buffer capacity, to prevent the waste of locking system resource, and And the time of packet transmission is saved, so as to improve the efficiency of packet transmission.
Further, data packet transmission system 3rd embodiment of the present invention is proposed based on first embodiment.
The difference of data packet transmission system 3rd embodiment and data packet transmission system first embodiment is, described first Application processor 10, is additionally operable to parse the packet of extraction, to obtain the packet header of the packet;Based on described The packet header of packet determines the length of the packet;When the length of the packet is more than predetermined threshold value, then to extraction Packet is compressed.
In the present embodiment, before first application processor 10 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, 10 pairs of the first application processor 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 application processor 10 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 10 pairs of extractions of the first application processor is pressed Contracting.It is appreciated that if the length of the packet extracted is less than predetermined threshold value, first application processor 10 can directly pass through USB interface sends the packet to the second application processor 20.
In the present embodiment, before being compressed to packet, it is described that 10 pairs of first application processor is extracted Packet is parsed, to obtain the packet header of the packet, then determines the length of the packet, the only length in packet During more than predetermined threshold value, just the packet of extraction is compressed, so as to improve the accuracy of data packet compressing.
Further, data packet transmission system fourth embodiment of the present invention is proposed based on first to 3rd embodiment.
Data packet transmission system fourth embodiment and the difference of data packet transmission system first to 3rd embodiment be, institute The packets for stating the extraction of 10 pairs of the first application processor are compressed and specifically included:
First application processor 10 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.
In the present embodiment, first application processor 10 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 application processor 10, 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 application processor 10 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 application processor 10, 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 application processor 10 is got after the corresponding source text of packet, can also be to connecting in source text The continuous character occurred, is replaced using number of repetition padding, to realize the compression of packet.
The algorithm that the process is related to is RLE (Run Length Encoding, Run- Length Coding translates run length encoding again) Algorithm, this compressed encoding is a kind of elongated coding, and RLE has different compressed encodings according to the different concrete condition of text Variant is adapted therewith, to produce bigger compression ratio.Specifically:
Variant 1:Number of repetition+character
Text-string:Obtained after A A A B B B C C C C D D D D, coding:3 A 3 B 4 C 4 D;It is logical Cross the variant algorithm, you can be compressed packet terminal text character string.
Variant 2:Spcial character+number of repetition+character
Text-string:Obtained after A A A A A B C C C C B C C C, coding:B B 5 A B B 4 C B B 3 C;Wherein, the explanation spcial character that most starts of the coded strings is B, a B is then added again, the numeral that B is followed by is with regard to table The number of times repeated is shown.That is, when text string character carries out coding compression using the algorithm of variant 2, first in encoded The initial of coded strings illustrate spcial character be B, then due to followed by occur 5 character A, it is necessary in this 5 character A It is character B to add a spcial character before, therefore is exactly the A of B B 5, occurs occurring 3 C again after B, and B after 5A, It is exactly the C of 5 A B B of B B 4 with above connecting accordingly, it would be desirable to add a spcial character B again before 3 C, behind In the same way, you can obtain the final C of 5 A B B of coded strings B B, 4 C B B 3.
In order to become apparent from understanding the program, for another example:Text-string is remained as:A A A A A B C C C C B C C C, if the explanation spcial character that most starts of present encoding string is D, then, obtained after coding:D D 5 A B D 4 C B D 3 C。
Variant 3:
The each byte packet of text is blocking, and each character is at most repeated 127 times.Each block is opened with a special byte Head.If the 7th of that special byte is set, then remaining 7 bit value is exactly the number of repetition of character below.Such as Really the 7th is not set, then be left the quantity of 7 characters not compressed below exactly.
For example:Text-string:Obtained after A A A A A B C D E F F F, coding:85 A 4 B C D E 83 F (85H=10000101B, 4H=00000100B, 83H=10000011B).Wherein, text-string is first grouped into three Block, is A A A A A, B C D E and F F F respectively, three fast corresponding spcial characters are 10000101,00000100 respectively With 10000011, because the 7th is set to 1 in 10000101, therefore remaining 7 bit value is the repetition time of character below Number, now understands that the corresponding value of remaining 7 bit value is 5, you can obtain 85A;Similarly, because the 7th in 00000100 does not have Be set to 1, then remaining 7 be the character not compressed below quantity, it is known that being now left 7 corresponding values is 4, you can obtain 4 B C D E;83F is similarly can determine that, is not being repeated herein.
Calculated it should be noted that three kinds enumerated, 3 kinds of RLE variant algorithms listed above are only preferably several variants Method, those skilled in the art are equal according to other RLE variants algorithms that its real needs is proposed using technological thought of the invention Within the scope of the present invention, herein without exhaustive one by one.
Further, first application processor 10, 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 application processor 10 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 application processor 10 is compressed by any of the above-described compression algorithm to packet, then will compression Packet storage afterwards is forwarded into buffer.Subsequently, the second application processor 20 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 application When processor 10 is ciphered compressed, second application processor 20 is decompressed using corresponding ciphertext, at the first application Reason device 10 is that second application processor 20 can be decompressed directly, with the packet after being decompressed when compressing in plain text. 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 application Processor 20 adds mark in Request, the first application processor 10 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 5, Fig. 5 is the schematic flow sheet of data pack transmission method first embodiment of the present invention.
The present embodiment proposes a kind of data pack transmission 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 the mobile terminal being connected by preset interface with external equipment 200 100, the mobile terminal 1 00 includes the first application processor 10, is embedded with virtual user identifying card 11A the first modulation /demodulation Device 11, the first radio-frequency module 12, and the first Subscriber Identity Module 13 and second being connected with first modem 11 are used Family identification card 14, the external equipment 200 includes the second application processor 20, the radio-frequency module of second modem 21 and second 22, methods described includes:
Step S10, the first application processor receives the packet acquisition that the second application processor is sent by preset interface During request, the packet is extracted from virtual user identifying 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 application processing Device extracts the packet after compression from the buffer, to complete the transmission of packet.
In the present embodiment, first application processor 10 receives the second application processor 20 by preset interface and sent Packet obtain request, be also subsequently that packet is fed back to by second application processor 20 by the preset interface. The preset interface is USB 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, packet is obtained into request and sent to the second application processor of second processing chip 002 In 20, when the second application processor 20, which receives packet, obtains request, first pass through USB data line 300 and obtain packet Request is sent in the first application processor 10 of mobile terminal 1 00;First application processor 10 receives packet acquisition During request, packet is obtained into request and is sent in the first modem 11 of mobile terminal 1 00, by the first modem 11 obtain request according to the packet obtains packet from virtual user identifying card 11A;First modem 11 is got After packet, packet is transmitted into the first application processor 10;First application processor 10 is got after packet, In order to ensure that the data of transmission are not more than USB buffer, first the packet of acquisition is compressed, the number after being compressed According to bag;The packet after compression is sent to by the second application processor 20 by USB again;Second application processor 20 is being received After packet, then packet is sent to the second radio-frequency module 22, packet is uploaded to base station by the second radio-frequency module 22, with Complete the transmission of data.
In the present embodiment, the first application processor is not limited to from the embedded virtual user identifying card of the first modem Packet is obtained, certainly, also packet can be obtained in the first Subscriber Identity Module or second user identification card according to actual needs, First application processor obtains the side of packet in virtual user identifying card, the first Subscriber Identity Module or second user identification card Formula is consistent, hereafter in order to sketch, and only exemplified by obtaining packet in virtual user identifying card, other two kinds repeat no more.
Specifically, the step S10 includes:
Step A, first application processor is grasped by the first modem in piece into virtual user identifying card Make system and send packet acquisition request, in file storage module of the chip operating system in virtual user identifying card Extract the packet and obtain the corresponding packet of request, and feed back to first modem;
Step B, first application processor receives the data that chip operating system feeds back by the first modem Bag.
In the present embodiment, it is necessary to which the packet in explanation, virtual user identifying card 11A is stored in file storage mould In block, when the first modem 11 will obtain the packet in virtual user identifying card 11A, the first modem 11 is not Directly it can be interacted with the file storage module in virtual user identifying card 11A, but first into virtual user identifying card 11A It is Request that COS (Chip Operating System, chip operating system) operating system, which sends packet and obtains request, so Virtual user identifying card 11A COS operating systems obtain packet based on the Request in file storage module afterwards, then The packet of acquisition is transmitted further to the first modem 11, as long as the first modem 11 reception COS operating systems are anti- The packet of feedback, it is that data can be achieved that follow-up first application processor 10 obtains packet in the first modem 11 The acquisition process of bag.
It is appreciated that because the first modem 11 can not be in the file storage module in virtual user identifying card 11A Packet is directly extracted, therefore is interacted by the COS operating systems with virtual user identifying card 11A, to realize packet Extraction, it is ensured that follow-up data transmission procedure is normally run.
The corresponding data of request are obtained when the first application processor 10 extracts packet from virtual user identifying card 11A After bag, then the packet of extraction is compressed, in the present embodiment, the first application processor 10 is compressed to packet When, the compression of packet can be carried out by the way of ciphered compressed, directly can also be compressed using plaintext.Due to transmission SIM card Network authentication data amount it is smaller, in order to reduce encrypting and decrypting etc. operation and cause data transmission efficiency low, the present invention The mode that embodiment is preferred to use compression in plain text is compressed to packet, i.e., the compression algorithm used in this programme is with simple high Based on effect, the compression algorithm and compression process specifically used is described in detail in embodiments below.
After first application processor 10 is to data packet compressing, you can default connect the data pack buffer after compression to described In mouth USB buffer, so that the second application processor 20 extracts the packet after compression from the buffer, to complete number According to the transmission of bag.
It should be noted that buffer is present in the two ends difference of the two ends of USB interface, i.e. USB interface in the present embodiment It is provided with buffer1 and buffer2.The is sent to when packet is obtained request by USB interface by the second application processor 20 During one application processor 10, the first application processor 10 is extracted by the first modem 11 from virtual user identifying card 11A Go out after packet, first store the packet of extraction into buffer1, so that, into buffer2, second should by USB transmission Packet is obtained from buffer2 again with processor 20.
The data pack transmission method that the present embodiment is proposed, first application processor receives second by preset interface should When the packet sent with processor obtains request, the packet is first extracted from virtual user identifying card and obtains request correspondence Packet, then the packet of extraction is compressed, then by the data pack buffer after compression to the preset interface In buffer, so that the second application processor extracts the packet after compression from the buffer, to complete the biography of packet It is defeated.This programme is first compressed in transmission packet to packet waiting for transmission, then the packet after compression is passed It is defeated so that the capability value of the packet of transmission has reduced, it is to avoid the situation that mobile terminal crashes in data transmission procedure.
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, the data pack transmission method also includes:
Can first application processor, which judge obtain in request from the packet, extracts the second application processor The compressing mark of addition;
If compressing mark can be extracted, the step of packet for performing described pair of extraction is compressed.
In the present embodiment, request is obtained when the second application processor 20 sends packet to the first application processor 10 (Request) before, in order to prevent the packet of transmission excessive, when the second application processor 20 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 application processor 10 is compressed to sent packet.
It should be noted that because data waiting for transmission are determined according to communication protocol standard, therefore, at the second application Reason device 20 can learn the data type and size of data for the packet that will be obtained, then, when the second application processor 20 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 the second application processor 20 compressing mark is added in Request, to inform the first application processor 10 pairs of packets waiting for transmission are compressed, if the second application processor 20 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 the second application processor 20 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 packet that the first application processor 10 receives the transmission of the second application processor 20 by preset interface (USB) is obtained When taking request, request first is obtained to the packet and parsed, is extracted with determining whether to obtain in request from the packet Go out the compressing mark of the second application processor 20 addition, if extracting compressing mark in the packet obtains request, now, First application processor 10 can be compressed to the packet of extraction, subsequently again by the data pack buffer after compression to institute In the buffer1 for stating preset interface, and by USB transmission into buffer2, so that the second application processor 20 is from described 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 application processor 10 of generation and the second application processor 20 are called out After waking up, then after the first application processor 10 and the second application processor 20 wake up, if the second application processor 20 is logical The second radio-frequency module 22 for crossing the connection of second modem 21 receives the packet acquisition request of base station transmission, performs following Operation:
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 USB 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 application processor 10 receives packet acquisition request by USB, 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 being extracted by the first modem 11 from virtual user identifying card 11A Packet be compressed;
Feedback:Feed back the packet of compression.
Finally, the second application processor 20 receives the packet that the first application processor 10 feeds back by USB, to complete number According to bag transmitting procedure.Above-mentioned operating process, can refer to Fig. 4.
It should be noted that the transmission of the second application processor 20 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 application processor 10 is to packet before being compressed, and can first judge from described Packet obtains the compressing mark that the addition of the second application processor 20 is extracted in request, if compressing mark can be extracted, just right Packet is compressed, and prevents packet to be also compressed when being less than buffer capacity, to prevent the waste of locking system resource, and 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, the data pack transmission method also includes:
First application processor 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.
In the present embodiment, before first application processor 10 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, 10 pairs of the first application processor 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 application processor 10 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 10 pairs of extractions of the first application processor is pressed Contracting.It is appreciated that if the length of the packet extracted is less than predetermined threshold value, first application processor 10 can directly pass through USB interface sends the packet to the second application processor 20.
In the present embodiment, before being compressed to packet, it is described that 10 pairs of first application processor is extracted Packet is parsed, to obtain the packet header of the packet, then determines the length of the packet, the only length in packet During more than 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 application processor 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 application processor 10 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 application processor 10 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 application processor 10 is got after the corresponding source text of packet, can also be to connecting in source text The continuous character occurred, is replaced using number of repetition padding, to realize the compression of packet.
The algorithm that the process is related to is RLE (Run Length Encoding, Run- Length Coding translates run length encoding again) Algorithm, this compressed encoding is a kind of elongated coding, and RLE has different compressed encodings according to the different concrete condition of text Variant is adapted therewith, to produce bigger compression ratio.Specifically:
Variant 1:Number of repetition+character
Text-string:Obtained after A A A B B B C C C C D D D D, coding:3 A 3 B 4 C 4 D;It is logical Cross the variant algorithm, you can be compressed packet terminal text character string.
Variant 2:Spcial character+number of repetition+character
Text-string:Obtained after A A A A A B C C C C B C C C, coding:B B 5 A B B 4 C B B 3 C;Wherein, the explanation spcial character that most starts of the coded strings is B, a B is then added again, the numeral that B is followed by is with regard to table The number of times repeated is shown.That is, when text string character carries out coding compression using the algorithm of variant 2, first in encoded The initial of coded strings illustrate spcial character be B, then due to followed by occur 5 character A, it is necessary in this 5 character A It is character B to add a spcial character before, therefore is exactly the A of B B 5, occurs occurring 3 C again after B, and B after 5A, It is exactly the C of 5 A B B of B B 4 with above connecting accordingly, it would be desirable to add a spcial character B again before 3 C, behind In the same way, you can obtain the final C of 5 A B B of coded strings B B, 4 C B B 3.
In order to become apparent from understanding the program, for another example:Text-string is remained as:A A A A A B C C C C B C C C, if the explanation spcial character that most starts of present encoding string is D, then, obtained after coding:D D 5 A B D 4 C B D 3 C。
Variant 3:
The each byte packet of text is blocking, and each character is at most repeated 127 times.Each block is opened with a special byte Head.If the 7th of that special byte is set, then remaining 7 bit value is exactly the number of repetition of character below.Such as Really the 7th is not set, then be left the quantity of 7 characters not compressed below exactly.
For example:Text-string:Obtained after A A A A A B C D E F F F, coding:85 A 4 B C D E 83 F (85H=10000101B, 4H=00000100B, 83H=10000011B).Wherein, text-string is first grouped into three Block, is A A A A A, B C D E and F F F respectively, three fast corresponding spcial characters are 10000101,00000100 respectively With 10000011, because the 7th is set to 1 in 10000101, therefore remaining 7 bit value is the repetition time of character below Number, now understands that the corresponding value of remaining 7 bit value is 5, you can obtain 85A;Similarly, because the 7th in 00000100 does not have Be set to 1, then remaining 7 be the character not compressed below quantity, it is known that being now left 7 corresponding values is 4, you can obtain 4 B C D E;83F is similarly can determine that, is not being repeated herein.
Calculated it should be noted that three kinds enumerated, 3 kinds of RLE variant algorithms listed above are only preferably several variants Method, those skilled in the art are equal according to other RLE variants algorithms that its real needs is proposed using technological thought of the invention Within the scope of the present invention, herein without exhaustive one by one.
Further, 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 application processor 10 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 application processor 10 is compressed by any of the above-described compression algorithm to packet, then will compression Packet storage afterwards is forwarded into buffer.Subsequently, the second application processor 20 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 application When processor 10 is ciphered compressed, second application processor 20 is decompressed using corresponding ciphertext, at the first application Reason device 10 is that second application processor 20 can be decompressed directly, with the packet after being decompressed when compressing in plain text. 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 application Processor 20 adds mark in Request, the first application processor 10 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 data packet transmission system, it is characterised in that the data packet transmission system includes mobile terminal, and by pre- If the external equipment that interface is connected with the mobile terminal, the mobile terminal includes the first application processor, is embedded with virtually The first modem, the first radio-frequency module of Subscriber Identity Module, and first be connected with first modem are used Family identification card and second user identification card, the external equipment include the second application processor, second modem and second Radio-frequency module;
First application processor, for receiving the packet acquisition request that the second application processor is sent by preset interface When, the packet is extracted from virtual user identifying card and obtains the corresponding packet of request;The packet of extraction is pressed Contracting;By in the extra buffer buffer of the data pack buffer after compression to the preset interface, for the second application processor The packet after compression is extracted from the buffer, to complete the transmission of packet.
2. data packet transmission system as claimed in claim 1, it is characterised in that first application processor, is additionally operable to sentence It is disconnected that the compressing mark that the addition of the second application processor is extracted in request can be obtained from the packet;If compression can be extracted Mark, then be compressed to the packet of extraction.
3. data packet transmission system as claimed in claim 1, it is characterised in that first application processor, it is additionally operable to pair The packet extracted is parsed, to obtain the packet header of the packet;Packet header based on the packet determines described The length of packet;When the length of the packet is more than predetermined threshold value, then the packet of extraction is compressed.
4. the data packet transmission system as described in any one of claims 1 to 3, it is characterised in that first application processor The packet of extraction is compressed and specifically included:
First application processor 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. data packet transmission system as claimed in claim 4, it is characterised in that first application processor, is additionally operable to really 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.
6. a kind of data pack transmission method, it is characterised in that applied to mobile terminal and pass through preset interface and mobile terminal The external equipment of connection, the mobile terminal includes the first application processor, is embedded with the first modulation of virtual user identifying card Demodulator, the first radio-frequency module, and the first Subscriber Identity Module and second user being connected with first modem are known Do not block, the external equipment includes the second application processor, second modem and the second radio-frequency module, methods described bag Include:
First application processor by preset interface receive the packet that the second application processor sends obtain ask when, from virtual The packet is extracted in Subscriber Identity Module 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 application processor 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 application processor, which judge obtain from the packet, extracts the addition of the second application processor 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 application processor 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 application processor 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 application processor 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.
CN201710395846.3A 2017-05-27 2017-05-27 Data packet transmission system and method Withdrawn CN107231660A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710395846.3A CN107231660A (en) 2017-05-27 2017-05-27 Data packet transmission system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710395846.3A CN107231660A (en) 2017-05-27 2017-05-27 Data packet transmission system and method

Publications (1)

Publication Number Publication Date
CN107231660A true CN107231660A (en) 2017-10-03

Family

ID=59933900

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710395846.3A Withdrawn CN107231660A (en) 2017-05-27 2017-05-27 Data packet transmission system and method

Country Status (1)

Country Link
CN (1) CN107231660A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108111492A (en) * 2017-12-11 2018-06-01 广州三星通信技术研究有限公司 For the method and its electric terminal of the protection call voice of electric terminal
WO2023151329A1 (en) * 2022-02-09 2023-08-17 华为技术有限公司 Packet forwarding method, computer device, storage medium, program product and chip

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108111492A (en) * 2017-12-11 2018-06-01 广州三星通信技术研究有限公司 For the method and its electric terminal of the protection call voice of electric terminal
CN108111492B (en) * 2017-12-11 2021-03-19 广州三星通信技术研究有限公司 Method for protecting conversation voice for electronic terminal and electronic terminal thereof
WO2023151329A1 (en) * 2022-02-09 2023-08-17 华为技术有限公司 Packet forwarding method, computer device, storage medium, program product and chip

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
CN107071833A (en) Data packet transmission system and method
CN107231622A (en) Mobile terminal and data pack transmission method
CN107071831A (en) Mobile terminal and data pack transmission method
CN107182083A (en) Mobile terminal and data pack transmission method
CN107318107A (en) Data transmission system, method, external equipment and mobile terminal
CN107071832A (en) Data packet transmission system and method
CN107257569A (en) Mobile terminal and data pack transmission method
CN107094308A (en) Data packet transmission system and method
CN107257568A (en) Data packet transmission system and method
CN107318108A (en) Data transmission system, method, external equipment and mobile terminal
CN107182086A (en) Data packet transmission system and method
CN107094151A (en) Mobile terminal and data pack transmission method
CN107182082A (en) Data packet transmission system and method
CN107124738A (en) Mobile terminal and data pack transmission method
CN107247679A (en) Data transmission system and method
CN107222429A (en) Data transmission system and method
CN107466029A (en) Data transmission system, method, external equipment and mobile terminal
CN107277859A (en) Data transmission system, method, external equipment and mobile terminal
CN107466028A (en) Data transmission system, method, external equipment and mobile terminal
CN107466027A (en) Data transmission system, method, external equipment and mobile terminal
CN107148052A (en) Mobile terminal and its data transmission method
CN107257567A (en) Data transmission system and 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
WW01 Invention patent application withdrawn after publication

Application publication date: 20171003

WW01 Invention patent application withdrawn after publication