CN106657097A - Data transmission method and apparatus - Google Patents

Data transmission method and apparatus Download PDF

Info

Publication number
CN106657097A
CN106657097A CN201611246767.8A CN201611246767A CN106657097A CN 106657097 A CN106657097 A CN 106657097A CN 201611246767 A CN201611246767 A CN 201611246767A CN 106657097 A CN106657097 A CN 106657097A
Authority
CN
China
Prior art keywords
message
sub
memory space
length
storage
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201611246767.8A
Other languages
Chinese (zh)
Other versions
CN106657097B (en
Inventor
吴惠敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua 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 Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN201611246767.8A priority Critical patent/CN106657097B/en
Publication of CN106657097A publication Critical patent/CN106657097A/en
Priority to EP17878642.2A priority patent/EP3535956B1/en
Priority to PCT/CN2017/113597 priority patent/WO2018103565A1/en
Priority to US16/433,154 priority patent/US11012366B2/en
Application granted granted Critical
Publication of CN106657097B publication Critical patent/CN106657097B/en
Priority to US17/233,426 priority patent/US11570120B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/90Buffering arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/90Buffering arrangements
    • H04L49/9057Arrangements for supporting packet reassembly or resequencing
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Abstract

The invention discloses a data transmission method and apparatus, applied to an electronic device. The method comprises the following steps: according to the length of a received to-be-sent message and a preset size of a reserved storage space, storing the message in the storage space with the corresponding size, dividing the message into a plurality of sub-messages, wherein the length of each sub-message is not greater than the length of a maximum message segment; allocating the plurality of sub-messages to at least two message groups, for each sub-message in each message group, caching data stored in a second storage space that is in front of a first storage space corresponding to the sub-message, is adjacent to the first storage space and has a set length, adding a message header corresponding to the sub-message to the second storage space, sending the packaged sub-message, and restoring the cached data to the second storage space. The problems that a lot of processing resources are occupied, the network delay is prolonged and that the power consumption is increased when the message headers are added to the sub-messages in the prior art are solved.

Description

A kind of data transmission method for uplink and device
Technical field
The present invention relates to data communication technology field, more particularly to a kind of data transmission method for uplink and device.
Background technology
With the popularization and popularization of network service, network service brings facility for people.Network number in network communications According to transmission be even more the ring of most important of which one, in existing network service because every kind of physical network device interface typically can advise Determine the greatest length of link layer data frame, referred to as MTU (Maximum Transmission Unit, MTU), When carrying out message transmissions, the length of whole message can not be more than MTU.And each message can encapsulated message in concrete transmission Head, therefore when message transmissions are carried out, the length (Management of the physical length no more than maximum message segment section of each message Support System, MSS).
So when message is transmitted, if length is accomplished by carrying out burst process to message more than MTU, Burst refers to that a message is divided into into many sub- messages is transmitted.Receiving terminal is received per individual sub- message, will can be received Sub- message recombinated.
After prior art is by message fragment, before sending per individual sub- message, before per individual sub- message message was added During head, need first to copy sub- message to be sent, heading was added before the sub- message and then is sent, but after message fragment Comprising the quantity of sub- message may be a lot, if needing to use many process resources to all carrying out copying per individual sub- message, Mean the increase of network delay and the increase of power consumption.
The content of the invention
The embodiment of the present invention provides a kind of data transmission method for uplink and device, to solve prior art neutron message addition report Literary head takes a large amount of process resources, the problem that network delay increases and power consumption increases.
A kind of data transmission method for uplink is embodiments provided, electronic equipment is applied to, the method includes:
According to the length and the size of default reserved storage space of the message to be sent for receiving, the message is determined The size of the memory space of occupancy, and by the memory space of the packet storage to correspondence size, wherein the message after storage Afterbody align with the afterbody of the memory space, the length of the size of the reserved storage space not less than a heading;
Whether the length of the message is judged more than maximum message segment segment length MSS, if it is, the message is divided into many Individual sub- message, per the length of individual sub- message the MSS is not more than;
The plurality of sub- message is divided at least two message groups, each message group package includes at least two sub- messages, And the sub- message of any two that each message group package contains is non-conterminous;
In for each message group per individual sub- message, cache before corresponding first memory space of the sub- message and adjacent Preseting length the second memory space storage data, the corresponding report of the sub- message is added in second memory space Literary head simultaneously sends the described sub- message after encapsulation, and by the data convert of caching to second memory space, wherein institute Preseting length is stated for heading length.
Further, before corresponding first memory space of described caching message and adjacent preseting length second Before the data of memory space storage, methods described also includes:
Whether the storage state for judging second memory space is upstate, if not, carrying out subsequent step;
After sending the described sub- message after encapsulation, methods described also includes:
The storage state of first memory space is revised as into upstate.
Further, when the storage state of second memory space is upstate, methods described also includes:
Directly add the corresponding heading of the sub- message in second memory space;
The described sub- message after encapsulation is sent, and the storage state of first memory space is revised as into upstate.
Further, before corresponding first memory space of described caching message and adjacent preseting length second Before the data of memory space storage, methods described also includes:
Determine the transmission order of each message group;
According to the transmission order, send successively in each message group per individual sub- message.
Further, the transmission order for determining each message group includes:
Statistics when sub- message transmission is carried out, gather by all transmissions order of message group;
Each the candidate's transmission order included in gathering for transmission order, under counting candidate's transmission order, pin During to sending per individual sub- message, the storage state of the second memory space before corresponding first memory space of the sub- message is not for Upstate, caches the number of times of the data of the second memory space storage;
The minimum candidate's transmission order of the number of times is defined as into the transmission order of message group.
Further, when the length for judging the message is not more than maximum message segment segment length MSS, methods described is also wrapped Include:
Before the 3rd memory space corresponding to the message to be sent and adjacent preseting length the 4th storage Add the corresponding heading of the message in space, and send the message after encapsulation.
A kind of data sending device is embodiments provided, electronic equipment is applied to, the device includes:
Memory module, for according to the big of the length of message to be sent and default reserved storage space for receiving It is little, determine the size of the memory space that the message takes, and by the memory space of the packet storage to correspondence size, wherein The afterbody of the message aligns with the afterbody of the memory space after storage, and the size of the reserved storage space is not less than one The length of heading;
First judge module, for judging the length of the message whether more than maximum message segment segment length MSS;
First division module, for when the judged result of the first judge module is to be, the message being divided into multiple Sub- message, per the length of individual sub- message the MSS is not more than;
Second division module, for the plurality of sub- message to be divided at least two message groups, each message group package At least two sub- messages are included, and the sub- message of any two that each message group package contains is non-conterminous;
Sending module, for storing for per individual sub- message, caching the sub- message corresponding first in each message group Before space and the second memory space storage of adjacent preseting length data, add described in second memory space The corresponding heading of sub- message simultaneously sends the described sub- message after encapsulation, and the data convert of caching is deposited to described second Storage space, wherein the preseting length is heading length.
Further, described device also includes:
Second judge module, for judging whether the storage state of second memory space is upstate;
The sending module, is additionally operable to, when the judged result of the second judge module is no, cache the sub- message corresponding Before first memory space and the second memory space storage of adjacent preseting length data, in second memory space Add the corresponding heading of the sub- message and send the described sub- message after encapsulation;
Described device also includes:
Status modifier module, for the storage state of corresponding first memory space of the sub- message to be revised as into available shape State.
Further, the sending module, is additionally operable to when the judged result of the second judge module is to be, described second Add the corresponding heading of the sub- message in memory space and send;
The status modifier module, is additionally operable to for the storage state of first memory space to be revised as upstate.
Further, the sending module, is additionally operable to determine the transmission order of each message group;Send suitable according to described Sequence, sends successively each the word message in each message group.
Further, the sending module, specifically for statistics when sub- message transmission is carried out, all transmissions of message group Order is gathered;Each the candidate's transmission order included in gathering for transmission order, under counting candidate's transmission order, pin During to sending per individual sub- message, the storage state of the second memory space before corresponding first memory space of the sub- message is not for Upstate, caches the number of times of the data of the second memory space storage;By the minimum candidate's transmission order of the number of times really It is set to the transmission order of message group.
Further, the sending module, be additionally operable to when for when first judge module judged result for it is no when, Add before the 3rd memory space corresponding to the message to be sent and in the 4th memory space of adjacent preseting length Plus the corresponding heading of the message, and send the message after encapsulation.
The embodiment of the present invention provides a kind of data transmission method for uplink and device, and the method includes:It is to be sent according to what is received Message length and the size of default reserved storage space, determine the size of the memory space that the message takes, and will The packet storage to correspondence size memory space, wherein after storage afterbody and the memory space of the message afterbody Alignment, the size of the reserved storage space is not less than the length of a heading;Whether the length for judging the message is more than Maximum message segment segment length MSS, if it is, the message is divided into into many sub- messages, per the length of individual sub- message institute is not more than State MSS;The plurality of sub- message is divided at least two message groups, each message group package includes at least two sub- messages, and The sub- message of any two that each message group package contains is non-conterminous;In for each message group per individual sub- message, cache the sub- report Before corresponding first memory space of text and the second memory space storage of adjacent preseting length data, deposit described second Add the corresponding heading of the sub- message in storage space and send the described sub- message after encapsulation, and the data that will be cached Second memory space is reverted to, wherein the preseting length is heading length.Due in embodiments of the present invention, by son Message is divided at least two message groups, is transmitted for the sub- message in each message group, otherwise for each message group In per individual sub- message, simply cache before corresponding first memory space of the sub- message and an adjacent heading length The data of the second memory space storage, the corresponding heading of the sub- message is added in second memory space and envelope is sent Described sub- message after dress, and by the data convert of caching to second memory space, therefore in data is activation, pin To greatly reducing per the data volume of individual sub- message copy, process resource is saved, reduced network delay and power consumption.
Description of the drawings
Technical scheme in order to be illustrated more clearly that the embodiment of the present invention, below will be to making needed for embodiment description Accompanying drawing is briefly introduced, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for this For the those of ordinary skill in field, on the premise of not paying creative work, can be obtaining other according to these accompanying drawings Accompanying drawing.
Fig. 1 is a kind of data transmission procedure schematic diagram that the embodiment of the present invention 1 is provided;
Fig. 2 is a kind of data transmission procedure schematic diagram that the embodiment of the present invention 2 is provided;
Fig. 3 is a kind of data transmission procedure schematic diagram that the embodiment of the present invention 4 is provided;
Fig. 4 is a kind of data sending device structural representation that the embodiment of the present invention 5 is provided.
Specific embodiment
In order that the object, technical solutions and advantages of the present invention are clearer, below in conjunction with accompanying drawing the present invention is made into One step ground is described in detail, it is clear that described embodiment is only present invention some embodiments, rather than the enforcement of whole Example.Based on the embodiment in the present invention, what those of ordinary skill in the art were obtained under the premise of creative work is not made All other embodiment, belongs to the scope of protection of the invention.
Embodiment 1:
Fig. 1 is a kind of data transmission procedure schematic diagram provided in an embodiment of the present invention, and the process is as follows:
S101:According to the length and the size of default reserved storage space of the message to be sent for receiving, institute is determined The size of the memory space of message occupancy is stated, and by the memory space of the packet storage to correspondence size, wherein institute after storage The afterbody for stating message aligns with the afterbody of the memory space, and the size of the reserved storage space is not less than heading Length.
Data transmission method for uplink provided in an embodiment of the present invention is applied to electronic equipment, and the electronic equipment can be PC (PC), mobile phone, panel computer etc., or the equipment such as the video camera with data is activation function, fire monitoring device.
In embodiments of the present invention, it is message addition correspondence when default reserved storage space can send according to message Heading, needs the memory space for using to determine, the size of the specific reserved storage space is not less than the length of a heading Degree.Because the heading of each type of message is different, the reserved storage size can be according to message to be sent Type determine, it would however also be possible to employ the heading length of the message of the maximum of heading length, such as type-A be 20 bytes, B classes The heading length of the message of type is 18 bytes, and the heading length of the message of type-A is long more than the heading of the message of B types Degree, according to the heading length of the message of type-A, it is determined that reserved storage size is not less than 20 bytes.
Specifically, after message to be sent is received, according to the length of message to be sent, and default reserved storage The size sum in space, determines the size of the memory space that message to be sent need to take, and the packet storage is big to correspondence Little memory space, in storage, the afterbody of the message is alignd with the afterbody of the memory space, and reserved storage space exists Before the memory space that the message takes and adjacent position, during to send, in the reserved storage space message is added Head.For example:The message length to be sent for receiving is 20000 bytes, and the size of default reserved storage space is 20 bytes, The size for then determining the memory space that message to be sent need to take is 20020 bytes, by the report to be sent for receiving To in the memory space that size is 20020 bytes, in storage, length is the message trailer to be sent of 20000 bytes for text storage Portion aligns with the afterbody of the memory space of 20020 byte, what the memory space of 20 reserved bytes took in the message Before memory space and adjacent position.
S102:Whether the length of the message is judged more than maximum message segment segment length MSS, if it is, the message is drawn It is divided into many sub- messages, per the length of individual sub- message the MSS is not more than.
Because in existing network communication during message transmissions, the length of whole message can not be more than MTU, and in concrete transmission Each message can encapsulated message head, therefore when message transmissions are carried out, can hold after the length that heading is removed in each message Length MSS of the message of load is certain, if so the length of message to be sent is needed report to be sent more than MSS Text is divided into the sub- message that multiple length are not more than MSS.
Specifically, whether the length of message to be sent is judged more than MSS, if it does, explanation is needed the message Many sub- messages are divided into, the length of each message is not more than MSS values.Can be with identical per the length of individual sub- message when dividing Can be with difference, preferably, the length per individual sub- message that can make division is equal to MSS, the length of last sub- message can With less than MSS.
S103:The plurality of sub- message is divided at least two message groups, it is sub that each message group package includes at least two Message, and the sub- message of any two that each message group package contains is non-conterminous.
During sending in sub- message, after being often sent completely a sub- message, it is required for returning a sub- message The response message being sent completely, and electronic equipment often receives a response message and is required for being processed, so as to reduce it The efficiency of message transmission is carried out, and wastes substantial amounts of process resource.And sub- message is drawn in message group, with message group as list Position sends sub- message, after all sub- message included in message group is all sent completely, just returns a message group neutron message The response message being sent completely, can improve the transmitting efficiency of message, and can also effectively save the process of electronic equipment Resource.
Therefore in embodiments of the present invention, packet transaction has been carried out for sub- message, specifically, many sub- messages has been divided To at least two message groups, the sub- message that each message group package contains is non-conterminous.For example:Message to be sent is divided into into 16 Sub- message, per the sequence number of individual sub- message 1,2 ... 15,16 are followed successively by, and sub- message can be divided into into two message groups, wherein one In individual message group comprising serial number 1,3,5,7,9,11,13,15 sub- message, in another message group comprising serial number 2,4,6, 8th, 10,12,14,16 sub- message, it is also possible to which sub- message is divided into into three message groups, includes sequence number in one of message group For 1,3,6,8,11,13,15 sub- message, the sub- message of serial number 4,7,10,12,16 is included in another message group, further Sub- message comprising serial number 2,5,9,14 in individual message group, as long as the sub- message of any two included in each message group not phase It is adjacent.
Preferably, user can according to demand set the maximum quantity comprising sub- message in each message group, for example:User Above-mentioned sub- message can be then divided into four message groups by the sub- message maximum quantity included in each the message group for setting as 4, Sub- message of first message group package containing serial number 1,3,5,7, sub- message of second message group package containing serial number 2,4,6,8, the 3rd Sub- message of the message group package containing serial number 9,11,13,15, sub- message of the 4th message group package containing serial number 10,12,14,16, only The quantity for meeting the sub- message included in each message group is not more than the maximum message segment quantity and each message group of user's setting In the sub- message of any two that includes it is non-conterminous.
Sub- message is divided into into different message groups, the son report included in message group is sent together in units of message group Text, after the sub- message included in message group all completes to send, returns the response message that a message group is sent completely, if It is to be transmitted in units of per individual sub- message, after being often sent completely a sub- message, it is necessary to return a sub- message and send The response message for completing, causes the waste of process resource, affects the transmitting efficiency of message.
S104:In for each message group per individual sub- message, before caching corresponding first memory space of the sub- message And the data of the second memory space storage of adjacent preseting length, the sub- message pair is added in second memory space The heading answered simultaneously sends the described sub- message after encapsulation, and by the data convert of caching to second memory space, Wherein described preseting length is heading length.
Specifically, for each message group in per individual sub- message, cache corresponding first memory space of the sub- message it The data of the second memory space storage of front and adjacent preseting length, the length of the setting is equal to message to be sent to be needed The length of addition heading, adds the corresponding heading of the sub- message in second memory space, and sends after encapsulation Described sub- message, after being sent completely, by caching data convert to the second memory space.
Due in embodiments of the present invention, sub- message being divided into at least two message groups, in each message group Sub- message is transmitted, otherwise for each message group in per individual sub- message, simply cache the sub- message corresponding first and deposit Before storage space and the second memory space storage of an adjacent heading length data, in second memory space Add the corresponding heading of the sub- message and send the described sub- message after encapsulation, and by the data convert of caching to institute The second memory space is stated, therefore in data is activation, for greatly reducing per the data volume of individual sub- message copy, has saved process Resource, reduces network delay and power consumption.
Embodiment 2:
In order to further reduce the copy number of data, process resource is saved, on the basis of the embodiment of the present invention 1, at this In inventive embodiments, before corresponding first memory space of described caching message and adjacent preseting length the second storage Before the data of space storage, methods described also includes:
Whether the storage state for judging second memory space is upstate, if not, carrying out subsequent step;
After sending the described sub- message after encapsulation, methods described also includes:
The storage state of first memory space is revised as into upstate.
The storage state of memory space can be set in embodiments of the present invention, when memory space is stored with data, should The storage state of memory space is down state, when memory space does not have data storage, then the storage shape of the memory space State is upstate, and in addition whether the storage state of the memory space can be carried out with being stored with data according to the memory space Dynamic modification.
Specifically, before corresponding first memory space of the sub- message is cached and adjacent preseting length the second storage Before the data of space storage, by judging that whether the storage state of second memory space is upstate judging to be It is no need it is data cached, if it is judged that being no, then illustrate the data that are stored with the second memory space, in order to add this first The heading of the sub- message of memory space storage, needs the data for caching the second memory space.
After described sub- message after encapsulation to be sent, by the data convert of the second memory space of the caching to this second Memory space, therefore the sub- message of first memory space storage sent, the now non-data storage of the first memory space, Therefore the storage state of the first memory space is revised as into upstate, the transmission of convenient follow-up other sub- messages.
Further, in embodiments of the present invention, before corresponding first memory space of sub- message to be sent and phase When second memory space of adjacent preseting length is upstate, non-data storage in second memory space is illustrated, without the need for entering The caching of row data, can directly use, therefore, on the basis of the various embodiments described above, when depositing for second memory space When storage state is upstate, methods described also includes:
Directly add the corresponding heading of the sub- message in second memory space;
The described sub- message after encapsulation is sent, and the storage state of first memory space is revised as into upstate.
Specifically, when the storage state of second memory space is upstate, then the second memory space is illustrated not Data storage, now for further little data copy number, and saves process resource, can not cache second storage empty Between store data, the corresponding heading of the sub- message is added in second memory space and is sent, be sent completely Afterwards, the storage state of first memory space is revised as into upstate.
Fig. 2 show a kind of data transmission procedure schematic diagram provided in an embodiment of the present invention, comprises the following steps:
S201:According to the length and the size of default reserved storage space of the message to be sent for receiving, institute is determined The size of the memory space of message occupancy is stated, and by the memory space of the packet storage to correspondence size, wherein institute after storage The afterbody for stating message aligns with the afterbody of the memory space, and the size of the reserved storage space is not less than heading Length.
S202:If the length of the message is more than maximum message segment segment length MSS, the message is divided into into many height reports Text, per the length of individual sub- message the MSS is not more than.
S203:The plurality of sub- message is divided at least two message groups, it is sub that each message group package includes at least two It is non-conterminous between message, and the sub- message that contains of each message group package.
S204:In for each message group per individual sub- message, before judging corresponding first memory space of the sub- message And whether the second memory space storage of adjacent preseting length is upstate, if it is, S206 is carried out, if not, carrying out S205。
S205:The data of the storage of second memory space are cached, in second memory space is added The corresponding heading of message simultaneously sends the described sub- message after encapsulation, and by the data convert of caching to the described second storage Space, by the storage state of first memory space upstate is revised as.
S206:Directly add the corresponding heading of the sub- message in second memory space;After sending encapsulation The sub- message, and the storage state of first memory space is revised as into upstate.
Embodiment 3:
When message is divided into many sub- messages, and after sub- message is divided at least two message groups, it is determined that each During the transmission order of message group, can arbitrarily determine, such as if three message groups are respectively the first message group, the second message Group and the 3rd message group, then can first send out the sub- message in the first message group, then send out the sub- message in the second message group, finally send out Sub- message in 3rd message group, the now transmission of message group is sequentially the first message group, the second message group and the 3rd message group, Certainly the transmission order of message group can also be the first message group, the 3rd message group and the second message group, or the second message group, 3rd message group and the first message group etc..
But it is adjacent with these complete sub- messages of transmission if after the sub- message of a certain message group sends, and positioned at this When sub- message after a little message is transmitted again, the memory space of the sub- message being sent completely can be directly taken, and nothing The copy of data need to be carried out.Therefore in order to further reduce data copy amount, process resource is saved, in the base of the various embodiments described above On plinth, in embodiments of the present invention, before corresponding first memory space of described caching message and adjacent preseting length The second memory space storage data before, methods described also includes:
Determine the transmission order of each message group;
According to the transmission order, send successively in each message group per individual sub- message.
In embodiments of the present invention, the transmission of each message group can be determined according to user's transmission rule set in advance Sequentially, and according to the transmission of each message group order send successively in each message group per individual sub- message.For example:User sets Transmission rule be, it is preferential to send comprising the less message group of sub- message, then according to the sub- message included in each message group The ascending sequence of quantity, determines the transmission order of each message group;The transmission rule that user sets is as preferential to send comprising son The more message group of message, then according to the descending sequence of quantity of the sub- message included in each message group, determine each report The transmission order of text group.
In order to reduce the data volume of copy, in embodiments of the present invention, the minimum message group of buffer data size can be chosen Sequentially as the transmission order of message group, the transmission order for determining each message group includes for transmission:
Statistics when sub- message transmission is carried out, gather by all transmissions order of message group;
Each the candidate's transmission order included in gathering for transmission order, under counting candidate's transmission order, pin During to sending per individual sub- message, the storage state of the second memory space before corresponding first memory space of the sub- message is not for Upstate, caches the number of times of the data of the second memory space storage;
The minimum candidate's transmission order of the number of times is defined as into the transmission order of message group.
Specifically, count when sub- message transmission is carried out, the set of all candidate's transmission orders of message group, for each The second memory space under candidate's transmission order, when sending per individual sub- message, before corresponding first memory space of the sub- message Storage state be down state, cache the number of times of the data of second memory space storage, selection wherein caches number of times Minimum candidate's transmission order is defined as the transmission order of message group.
Specifically, it is as follows for the determination and its determination of corresponding caching number of times of all candidate's transmission orders of message group It is shown:Three message groups are included after division, wherein sub- message of first message group package containing serial number 1,4,7,10, the second message group Sub- message comprising serial number 2,5,9,11, sub- message of the 3rd message group package containing serial number 3,6,10,12, counts three messages The different transmissions order of group needs the number of times of caching, and transmission order is the first message group, the second message group, the 3rd message group, correspondence Caching number of times be 4, transmission order be the first message group, the 3rd message group.Second message group, corresponding caching number of times is 8, is sent out Order is sent for the second message group, the 3rd message group, the first message group, corresponding caching number of times is 8, transmission order is the second message Group, the first message group, the 3rd message group, corresponding caching number of times is 8, transmission order is the 3rd message group, the first message group, the Two message groups, corresponding caching number of times is 8, and transmission is sequentially the 3rd message group, the second message group, the first message group, corresponding Caching number of times is 12, and minimum caching number of times is 4, it is determined that transmission order is the first message group, the second message group, the 3rd message Group.
Embodiment 4:
When the length of message to be sent is not more than MSS, it is not necessary to message is divided into into sub- message and is transmitted, in order to The efficiency of data is activation is improved, on the basis of above-described embodiment 1, in embodiments of the present invention, when the length for judging the message When degree is not more than maximum message segment segment length MSS, methods described also includes:
Before the 3rd memory space corresponding to the message to be sent and adjacent preseting length the 4th storage Add the corresponding heading of the message in space, and send the message after encapsulation.
Specifically, it is empty in the 3rd storage corresponding to message to be sent when the length of message to be sent is not more than MSS Between before and the 4th memory space of adjacent preseting length in add the corresponding heading of the message, and send after encapsulation The message.4th memory space is located in default reserved storage space, described to stay the size of memory space to be not less than The size of the 4th memory space.
Fig. 3 show a kind of data transmission method for uplink process schematic provided in an embodiment of the present invention, and the process is as follows:
S301:According to the length and the size of default reserved storage space of the message to be sent for receiving, institute is determined The size of the memory space of message occupancy is stated, and by the memory space of the packet storage to correspondence size, wherein institute after storage The afterbody for stating message aligns with the afterbody of the memory space, and the size of the reserved storage space is not less than heading Length.
S302:Whether the length of the message is judged more than maximum message segment segment length MSS, if it is, S303 is carried out, if It is no, carry out S308.
S303:The message is divided into into many sub- messages, per the length of individual sub- message the MSS is not more than.
S304:The plurality of sub- message is divided at least two message groups, it is sub that each message group package includes at least two It is non-conterminous between message, and the sub- message that contains of each message group package.
S305:In for each message group per individual sub- message, before judging corresponding first memory space of the sub- message And whether the second memory space storage of adjacent preseting length is upstate, if not, S306 is carried out, if it is, carrying out S307。
S306:The data of the storage of second memory space are cached, in second memory space is added The corresponding heading of message simultaneously sends the described sub- message after encapsulation, and by the data convert of caching to the described second storage Space, by the storage state of first memory space upstate is revised as.
S307:Directly add the corresponding heading of the sub- message in second memory space and send, will be described The storage state of the first memory space is revised as upstate.
S308:Before the 3rd memory space corresponding to the message to be sent and adjacent preseting length the 4th Add the corresponding heading of the message in memory space, and send the message after encapsulation.
Embodiment 5:
Fig. 4 is a kind of data sending device structural representation provided in an embodiment of the present invention, and the device includes:
Memory module 41, for according to the big of the length of message to be sent and default reserved storage space for receiving It is little, determine the size of the memory space that the message takes, and by the memory space of the packet storage to correspondence size, wherein The afterbody of the message aligns with the afterbody of the memory space after storage, and the size of the reserved storage space is not less than one The length of heading;
First judge module 42, for judging the length of the message whether more than maximum message segment segment length MSS;
First division module 43, for when the judged result of the first judge module is to be, the message being divided into many Individual sub- message, per the length of individual sub- message the MSS is not more than;
Second division module 44, for the plurality of sub- message to be divided at least two message groups, each message group Including at least two sub- messages, and the sub- message of any two that each message group package contains is non-conterminous;
Sending module 45, for for, per individual sub- message, caching the sub- message corresponding first and depositing in each message group Before storage space and the second memory space storage of adjacent preseting length data, add institute in second memory space State the corresponding heading of sub- message and send the described sub- message after encapsulation, and by the data convert of caching to described second Memory space, wherein the preseting length is heading length.
Described device also includes:
Second judge module 46, for judging whether the storage state of second memory space is upstate;
The sending module 45, is additionally operable to, when the judged result of the second judge module is no, cache sub- message correspondence The first memory space before and the second memory space storage of adjacent preseting length data, in second memory space It is middle to add the corresponding heading of the sub- message and send the described sub- message after encapsulation;
Described device also includes:
Status modifier module 47, for the storage state of corresponding first memory space of the sub- message to be revised as can use State.
The sending module 45, is additionally operable to when the judged result of the second judge module is to be, empty in the described second storage Between the corresponding heading of the middle addition sub- message and send;
The status modifier module 47, is additionally operable to for the storage state of first memory space to be revised as upstate.
The sending module 45, is additionally operable to determine the transmission order of each message group;According to transmission order, send out successively Give each the word message in each message group.
The sending module 45, specifically for statistics when sub- message transmission is carried out, all transmission ordered sets of message group Close;Each candidate's transmission order included in gathering for transmission order, under counting candidate's transmission order, for each When sub- message sends, the storage state of the second memory space before corresponding first memory space of the sub- message is unavailable shape State, caches the number of times of the data of the second memory space storage;The minimum candidate's transmission order of the number of times is defined as into report The transmission order of text group.
The sending module 45, is additionally operable to when for when the judged result of first judge module is no, described Addition is described before the 3rd memory space corresponding to message to be sent and in the 4th memory space of adjacent preseting length The corresponding heading of message, and send the message after encapsulation.
The embodiment of the present invention provides a kind of data transmission method for uplink, is applied to electronic equipment, and the method includes:According to receiving Message to be sent length and the size of default reserved storage space, determine the big of the memory space that the message takes It is little, and by the memory space of the packet storage to correspondence size, wherein the afterbody of the message is empty with the storage after storage Between afterbody alignment, the length of the size of the reserved storage space not less than a heading;Judge the length of the message Whether maximum message segment segment length MSS is more than, if it is, the message is divided into into many sub- messages, per the length of individual sub- message No more than described MSS;The plurality of sub- message is divided at least two message groups, it is sub that each message group package includes at least two Message, and the sub- message of any two that each message group package contains is non-conterminous;In for each message group per individual sub- message, caching Before corresponding first memory space of the sub- message and the second memory space storage of adjacent preseting length data, described Add the corresponding heading of the sub- message in second memory space and send the described sub- message after encapsulation, and the institute that will be cached Data convert is stated to second memory space, wherein the preseting length is heading length.Due in the embodiment of the present invention In, sub- message is divided into at least two message groups, it is transmitted for the sub- message in each message group, otherwise for each In message group per individual sub- message, simply cache before corresponding first memory space of the sub- message and an adjacent message be long The data of the second memory space storage of degree, add the corresponding heading of the sub- message concurrent in second memory space The described sub- message after encapsulation is sent, and by the data convert of caching to second memory space, therefore in data is activation When, for greatly reducing per the data volume of individual sub- message copy, process resource is saved, reduce network delay and power consumption.
The present invention is the flow process with reference to method according to embodiments of the present invention, equipment (system) and computer program Figure and/or block diagram are describing.It should be understood that can be by computer program instructions flowchart and/or each stream in block diagram The combination of journey and/or square frame and flow chart and/or the flow process in block diagram and/or square frame.These computer programs can be provided The processor of general purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce A raw machine so that produced for reality by the instruction of computer or the computing device of other programmable data processing devices The device of the function of specifying in present one flow process of flow chart or one square frame of multiple flow processs and/or block diagram or multiple square frames.
These computer program instructions may be alternatively stored in can guide computer or other programmable data processing devices with spy In determining the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory is produced to be included referring to Make the manufacture of device, the command device realize in one flow process of flow chart or one square frame of multiple flow processs and/or block diagram or The function of specifying in multiple square frames.
These computer program instructions also can be loaded in computer or other programmable data processing devices so that in meter Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented process, so as in computer or The instruction performed on other programmable devices is provided for realizing in one flow process of flow chart or multiple flow processs and/or block diagram one The step of function of specifying in individual square frame or multiple square frames.
, but those skilled in the art once know basic creation although preferred embodiments of the present invention have been described Property concept, then can make other change and modification to these embodiments.So, claims are intended to be construed to include excellent Select embodiment and fall into having altered and changing for the scope of the invention.
Obviously, those skilled in the art can carry out the essence of various changes and modification without deviating from the present invention to the present invention God and scope.So, if these modifications of the present invention and modification belong to the scope of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to comprising these changes and modification.

Claims (12)

1. a kind of data transmission method for uplink, it is characterised in that be applied to electronic equipment, the method includes:
According to the length and the size of default reserved storage space of the message to be sent for receiving, determine that the message takes Memory space size, and by the packet storage to correspondence size memory space, wherein storage after the message tail Portion aligns with the afterbody of the memory space, and the size of the reserved storage space is not less than the length of a heading;
Whether the length of the message is judged more than maximum message segment segment length MSS, if it is, the message is divided into into many height Message, per the length of individual sub- message the MSS is not more than;
The plurality of sub- message is divided at least two message groups, each message group package includes at least two sub- messages, and often The sub- message of any two that individual message group package contains is non-conterminous;
In for each message group per individual sub- message, cache before corresponding first memory space of the sub- message and adjacent set The data of the second memory space storage of measured length, add the corresponding heading of the sub- message in second memory space And the described sub- message after encapsulation is sent, and by the data convert of caching to second memory space, wherein described set Measured length is heading length.
2. the method for claim 1, it is characterised in that before corresponding first memory space of the caching message And before the data of the second memory space storage of adjacent preseting length, methods described also includes:
Whether the storage state for judging second memory space is upstate, if not, carrying out subsequent step;
After sending the described sub- message after encapsulation, methods described also includes:
The storage state of first memory space is revised as into upstate.
3. method according to claim 2, it is characterised in that when the storage state of second memory space is available shape During state, methods described also includes:
Directly add the corresponding heading of the sub- message in second memory space;
The described sub- message after encapsulation is sent, and the storage state of first memory space is revised as into upstate.
4. method as claimed in claim 1 or 2, it is characterised in that corresponding first memory space of the caching message Before and before the data of the second memory space storage of adjacent preseting length, methods described also includes:
Determine the transmission order of each message group;
According to the transmission order, send successively in each message group per individual sub- message.
5. according to method as claimed in claim 4, it is characterised in that the transmission order of the determination each message group includes:
Statistics when sub- message transmission is carried out, gather by all transmissions order of message group;
Each candidate's transmission order included in gathering for transmission order, under counting candidate's transmission order, for every When individual sub- message sends, the storage state of the second memory space before corresponding first memory space of the sub- message is unavailable State, caches the number of times of the data of the second memory space storage;
The minimum candidate's transmission order of the number of times is defined as into the transmission order of message group.
6. the method for claim 1, it is characterised in that when the length for judging the message is not more than maximum message segment segment length During degree MSS, methods described also includes:
Before the 3rd memory space corresponding to the message to be sent and adjacent preseting length the 4th memory space It is middle to add the corresponding heading of the message, and send the message after encapsulation.
7. a kind of data sending device, it is characterised in that be applied to electronic equipment, the device includes:
Memory module, the length and the size of default reserved storage space of the message to be sent received for basis, really The size of the memory space that the fixed message takes, and by the memory space of the packet storage to correspondence size, wherein storing Afterwards the afterbody of the message aligns with the afterbody of the memory space, and the size of the reserved storage space is not less than a message The length of head;
First judge module, for judging the length of the message whether more than maximum message segment segment length MSS;
First division module, for when the judged result of the first judge module is to be, the message being divided into into many height reports Text, per the length of individual sub- message the MSS is not more than;
Second division module, for the plurality of sub- message to be divided at least two message groups, each message group package include to Few two sub- messages, and the sub- message of any two that each message group package contains is non-conterminous;
Sending module, for for per individual sub- message, caching corresponding first memory space of the sub- message in each message group Before and the second memory space storage of adjacent preseting length data, the sub- report is added in second memory space The corresponding heading of text simultaneously sends the described sub- message after encapsulation, and the data convert of caching is empty to the described second storage Between, wherein the preseting length is heading length.
8. device as claimed in claim 7, it is characterised in that described device also includes:
Second judge module, for judging whether the storage state of second memory space is upstate;
The sending module, is additionally operable to, when the judged result of the second judge module is no, cache the sub- message corresponding first Before memory space and the second memory space storage of adjacent preseting length data, add in second memory space The corresponding heading of the sub- message simultaneously sends the described sub- message after encapsulation;
Described device also includes:
Status modifier module, for the storage state of corresponding first memory space of the sub- message to be revised as into upstate.
9. device as claimed in claim 8, it is characterised in that the sending module, is additionally operable to sentencing when the second judge module When disconnected result is to be, the corresponding heading of the sub- message is added in second memory space and is sent;
The status modifier module, is additionally operable to for the storage state of first memory space to be revised as upstate.
10. device as claimed in claim 7, it is characterised in that the sending module, is additionally operable to determine sending out for each message group Send order;According to transmission order, each the word message in each message group is sent successively.
11. devices as claimed in claim 10, it is characterised in that the sending module, specifically for statistics sub- report is being carried out When text sends, all transmissions order of message group is gathered;Each candidate included in gathering for transmission order sends suitable Sequence, under counting candidate's transmission order, during for sending per individual sub- message, before corresponding first memory space of the sub- message The storage state of the second memory space is down state, caches the number of times of the data of the second memory space storage;By institute State the transmission order that the minimum candidate's transmission order of number of times is defined as message group.
12. devices as claimed in claim 7, it is characterised in that the sending module, being additionally operable to work as is used for when described first sentences The judged result of disconnected module for it is no when, before the 3rd memory space corresponding to the message to be sent and adjacent setting Add the corresponding heading of the message in 4th memory space of length, and send the message after encapsulation.
CN201611246767.8A 2016-12-09 2016-12-29 A kind of data transmission method for uplink and device Active CN106657097B (en)

Priority Applications (5)

Application Number Priority Date Filing Date Title
CN201611246767.8A CN106657097B (en) 2016-12-29 2016-12-29 A kind of data transmission method for uplink and device
EP17878642.2A EP3535956B1 (en) 2016-12-09 2017-11-29 Methods and systems for data transmission
PCT/CN2017/113597 WO2018103565A1 (en) 2016-12-09 2017-11-29 Methods and systems for data transmission
US16/433,154 US11012366B2 (en) 2016-12-09 2019-06-06 Methods and systems for data transmission
US17/233,426 US11570120B2 (en) 2016-12-09 2021-04-16 Methods and systems for data transmission

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611246767.8A CN106657097B (en) 2016-12-29 2016-12-29 A kind of data transmission method for uplink and device

Publications (2)

Publication Number Publication Date
CN106657097A true CN106657097A (en) 2017-05-10
CN106657097B CN106657097B (en) 2019-11-19

Family

ID=58835852

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611246767.8A Active CN106657097B (en) 2016-12-09 2016-12-29 A kind of data transmission method for uplink and device

Country Status (1)

Country Link
CN (1) CN106657097B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114567413A (en) * 2022-02-17 2022-05-31 中国银联股份有限公司 Data storage method and device
CN114598669A (en) * 2022-03-07 2022-06-07 潍柴动力股份有限公司 Message storage method, device and equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120134369A1 (en) * 2003-12-19 2012-05-31 Andrew Li Programmable Queuing Instruction Set
CN103761053A (en) * 2013-12-30 2014-04-30 华为技术有限公司 Data and method for data processing

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120134369A1 (en) * 2003-12-19 2012-05-31 Andrew Li Programmable Queuing Instruction Set
CN103761053A (en) * 2013-12-30 2014-04-30 华为技术有限公司 Data and method for data processing

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114567413A (en) * 2022-02-17 2022-05-31 中国银联股份有限公司 Data storage method and device
CN114567413B (en) * 2022-02-17 2023-06-30 中国银联股份有限公司 Data storage method and device
CN114598669A (en) * 2022-03-07 2022-06-07 潍柴动力股份有限公司 Message storage method, device and equipment
CN114598669B (en) * 2022-03-07 2024-03-19 潍柴动力股份有限公司 Message storage method, device and equipment

Also Published As

Publication number Publication date
CN106657097B (en) 2019-11-19

Similar Documents

Publication Publication Date Title
CN104508654B (en) It is grouped transmission priority channel distribution
US8310934B2 (en) Method and device for controlling information channel flow
CN107360591A (en) A kind of method and apparatus of reporting buffer status report
CN104378308A (en) Method and device for detecting message sending rate
CN102238068B (en) Message transmitting method and system
CN100542180C (en) Method and device during a kind of bandwidth of advanced data link control channel is dynamically adjusted
CN107347198A (en) A kind of method for limiting speed, Control for Speed Limitation node and speed limiting device
CN102811176B (en) A kind of data flow control method and device
CN106161256A (en) A kind of processing method and processing device of Border Gateway Protocol (BGP) route
CN111181873B (en) Data transmission method, data transmission device, storage medium and electronic equipment
CN102685914A (en) Scheduling and multiplexing method and device for logical channels
CN106453126A (en) Virtual machine traffic control method and device
CN102957626B (en) A kind of message forwarding method and device
CN111935033B (en) Terminal flow reservation method, system and computer equipment for time sensitive flow
CN112019363A (en) Method, device and system for determining service transmission requirement
CN106657097A (en) Data transmission method and apparatus
CN105245313B (en) Unmanned plane multi-load data dynamic multiplexing method
CN107154835A (en) The sending method and device of data
CN106775961A (en) A kind of method of cross-system data and signal transmission
CN103634229A (en) Inter-chip communication method and control device
CN105792361B (en) A kind of LTE logic channel resource allocation methods and device
CN107659966A (en) Data transmission method, the network equipment, user terminal, gateway device
CN106790320A (en) A kind of method that multi-application inter-system data is pushed
CN113867946A (en) Method, device, storage medium and electronic equipment for accessing resources
CN102487303A (en) Time slot distribution management method and apparatus thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant