CN104618365B - protocol message processing method, device and terminal - Google Patents

protocol message processing method, device and terminal Download PDF

Info

Publication number
CN104618365B
CN104618365B CN201510038878.9A CN201510038878A CN104618365B CN 104618365 B CN104618365 B CN 104618365B CN 201510038878 A CN201510038878 A CN 201510038878A CN 104618365 B CN104618365 B CN 104618365B
Authority
CN
China
Prior art keywords
data
message
length
protocol message
layer protocol
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.)
Active
Application number
CN201510038878.9A
Other languages
Chinese (zh)
Other versions
CN104618365A (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.)
XFusion Digital Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201510038878.9A priority Critical patent/CN104618365B/en
Publication of CN104618365A publication Critical patent/CN104618365A/en
Application granted granted Critical
Publication of CN104618365B publication Critical patent/CN104618365B/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/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • 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/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/168Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP] specially adapted for link layer protocols, e.g. asynchronous transfer mode [ATM], synchronous optical network [SONET] or point-to-point protocol [PPP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Communication Control (AREA)
  • Computer And Data Communications (AREA)

Abstract

The present invention discloses a kind of protocol message processing method, device and terminal, is related to the communications field, is invented to reduce transmission data delay.Including:The information at least two data for assembling or parsing for this layer protocol message is obtained, the information includes the maximum length, the load maximum length of lower-layer protocols message of this layer protocol message, at least two data type and respective length;When obtaining the information at least two data for being used for the assembling of this layer protocol message, according to the maximum length of this layer protocol message and the load maximum length of lower-layer protocols message, at least two total length of data is determined;Or, when obtaining the information at least two data for being used for the parsing of this layer protocol message, according to the maximum length of this layer protocol message, determine at least two total length of data;According at least two total length of data of determination, a shared buffer memory region is distributed;To these parallel data processings in shared buffer memory region.The applicable Message processing technology of the present invention.

Description

Protocol message processing method, device and terminal
Technical field
The present invention relates to communication technical field, more particularly to protocol message processing method, device and terminal.
Background technology
At present, RDMA (Remote Direct Memory Access, i.e. remote direct memory are accessed) technology is universal Data transmission procedure is applied to, RDMA technologies allow computer to be directly accessed the internal memory of other computers by network, that is, led to The mode for crossing DMA (Direct Memory Access, direct memory access) transmits data.This transmission can be by NIC A reliable rdma protocol is disposed in the hardware of (Network Interface Card, network interface card) to realize, such as based on TCP (Transmission Control Protocol, transmission control protocol)/IP's (Internet Protocol, procotol) IWARP (Internet Wide Area Rdma Protocol, internet wide area rdma protocol) agreement.
By taking the iWARP agreements based on TCP/IP as an example, prior art is when using RDMA technical transmission data, at transmitting terminal The module for managing rdma protocol and the workflow of module for handling Transmission Control Protocol are:As shown in figure 1, the mould of processing rdma protocol Block completes RDMA connections scheduling;The buffer zone (buffer) of stored messages is distributed for rdma protocol;From hair by way of DMA The main frame transmission of sending end needs the data transmitted;Carry out the assembling of rdma protocol message;RDMA CRC(Cyclic Redundancy Check, CRC) check value calculating.Afterwards, the module for handling Transmission Control Protocol is attached scheduling; Distribute the buffer zone of TCP message storage;Data copy (is moved the data for needing to transmit from the module of processing rdma protocol Into the module of processing Transmission Control Protocol);Carry out TCP message assembling;TCP CRC checks value calculates, and finally sends out packaged data It is sent to receiving terminal.
The reception flow of receiving terminal then parses data successively according to the step substantially opposite with the transmission flow of transmitting terminal, from And obtain needing the data transmitted.
When the above-mentioned rdma protocol utilized in the prior art based on TCP transmits data, transmission flow and reception flow have Repeatedly scheduling, multiple buffer zone are distributed and data-moving process be present, therefore the problem of time delay is larger be present.
The content of the invention
In view of this, the embodiment of the present invention provides a kind of protocol message processing method, device and terminal, to reduce transmission number According to when time delay.
To reach above-mentioned purpose, the embodiment of the present invention adopts the following technical scheme that:
First aspect, there is provided a kind of protocol message processing method, performed by United Dispatching module, including:
The information at least two data for assembling or parsing for this layer protocol message is obtained, described information is assisted including this layer Discuss maximum length, the load maximum length of lower-layer protocols message of message, the type and respective length of at least two data Degree;
When obtaining the information at least two data for being used for the assembling of this layer protocol message, according to described layer protocol message Maximum length and the lower-layer protocols message load maximum length, determine the total lengths of at least two data;Or, work as When obtaining the information at least two data of this layer protocol message parsing, according to most greatly enhancing for described layer protocol message Degree, determine the total length of at least two data;
According to the total length of at least two data of the determination, a shared buffer memory region is distributed;
According to the type of at least two data and respective length, in the shared buffer memory region to it is described at least Two kinds of parallel data processings, wherein every kind of data are handled by a data processing module, a data processing module is to one kind The processing time of data overlaps with another data processing module to the processing time of another data.
In the first possible implementation, the maximum length according to described layer protocol message and the lower floor The maximum load length of protocol massages, determine that the total length of at least two data specifically includes:
Two are selected from the maximum length of described layer protocol message and the maximum load length of the lower-layer protocols message The minimum value of length in person, total length of the minimum value as at least two data.
In second of possible implementation, in the letter for obtaining at least two data for protocol massages parsing After breath, in the shared buffer memory region at least two parallel data processing before, methods described also includes:
Determine whether at least two data are partial datas;
According to the type of at least two data and respective length, in the shared buffer memory region to it is described at least Two kinds of parallel data processings specifically,
When it is determined that at least two data are partial datas, according to the type of at least two data and respective Length, at least two data parallel is parsed in the shared buffer memory region.
With reference to first aspect or the first possible implementation, in the third possible implementation, it is described at least Two kinds of data specifically include:
The data that transmission control protocol TCP message data and needs transmit;Or,
TCP message data, RDMA message datas;Or,
The data that TCP message data, RDMA message datas and needs transmit.
Second aspect, the invention provides a kind of protocol massages processing unit, described device include at least one processor, Memory, communication interface and bus, wherein,
The processor is used for:
The information at least two data for assembling or parsing for this layer protocol message is obtained, described information is assisted including this layer Discuss maximum length, the load maximum length of lower-layer protocols message of message, the type and respective length of at least two data Degree;
When obtaining the information at least two data for being used for the assembling of this layer protocol message, according to described layer protocol message Maximum length and the lower-layer protocols message load maximum length, determine the total lengths of at least two data;Or, work as When obtaining the information at least two data of this layer protocol message parsing, according to most greatly enhancing for described layer protocol message Degree, determine the total length of at least two data;
According to the total length of at least two data of determination, a shared buffer memory region is distributed;
According to the type of at least two data of acquisition and respective length, in the shared buffer memory region to it is described extremely Few two kinds of parallel data processings, wherein every kind of data are handled by a data processing module, a data processing module is to one The processing time of kind data overlaps with another data processing module to the processing time of another data.
In the first possible implementation, the processor is specifically used for:
Two are selected from the maximum length of described layer protocol message and the maximum load length of the lower-layer protocols message The minimum value of length in person, total length of the minimum value as at least two data.
In second of possible implementation, the processor is additionally operable to:
Determine whether at least two data are partial datas;
When it is determined that at least two data are partial datas, according to the type of at least two data and respective Length, at least two data parallel is parsed in the shared buffer memory region.
The third aspect, there is provided a kind of terminal, the terminal may including any one in second aspect or second aspect Implementation described in protocol massages processing unit.
Protocol message processing method, device and terminal provided in an embodiment of the present invention.First, obtain for this layer protocol report The information of at least two data of text assembling or parsing, and determine the total length of at least two data;Then, according to determination At least two data total length, distribute a shared buffer memory region;And to described at least two in shared buffer memory region Parallel data processing.It will thus be seen that it is this by once dispatching, disposably distribute shared buffer memory region and parallel data processing Mode, the problem of avoiding present in prior art repeatedly scheduling, repeated dispensing buffer zone and data-moving process.Cause This, present invention reduces data used when data assembling time used during data transmission and data receiver to parse the time, from And reduce the time delay of data transfer.
Brief description of the drawings
In order to illustrate the technical solution of the embodiments of the present invention more clearly, required use in being described below to embodiment Accompanying drawing be briefly described, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for For those of ordinary skill in the art, on the premise of not paying creative work, other can also be obtained according to these accompanying drawings Accompanying drawing.
Fig. 1 is the transmission flow figure of protocol message processing method in the prior art;
Fig. 2 is the schematic diagram that iWARP protocol massages encapsulate level;
Fig. 3 is the flow chart of the protocol message processing method of the embodiment of the present invention one;
Fig. 4 is the Transmission Control Protocol message of the embodiment of the present invention one and the schematic diagram of rdma protocol message;
Fig. 5 is the flow chart of the protocol message processing method of the embodiment of the present invention two;
Fig. 6 is the flow chart of the protocol message processing method of the embodiment of the present invention three;
Fig. 7 is the structure chart of the protocol massages processing unit of the embodiment of the present invention four.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, rather than whole embodiments.Based on this Embodiment in invention, the every other reality that those of ordinary skill in the art are obtained under the premise of creative work is not made Example is applied, belongs to the scope of protection of the invention.
In order to illustrate more clearly of the solution of the present invention, letter is carried out to the encapsulating structure of protocol massages in the prior art first It is single to introduce.
By taking the iWARP agreements of the RDMA technologies based on TCP/IP as an example, as shown in Fig. 2 one six layers are divided into from top to bottom, First layer is upper-layer protocol message structure.The second layer and the encapsulating structure that third layer is iWARP protocol layers, wherein, the second layer is DDP (Direct Data Placement Protocol, immediate data put agreement)/RDMAP (Remote Direct Memory Access Protocol, RDMA agreement) section, the section includes DDP/RDMAP headings (DDP/ RDMAP Headers) and DDP/RDMAP loads (DDP/RDMAP Payload), wherein, RDMAP is used to identify message class Type, DDP are used for data sectional and restructuring;Third layer is MPA FPDU (Marker-based ULP (Upper Layer Protocol, upper-layer protocol) layer, including two MPA loads (MPA Payload), mark (Marker) and CRC results, its In, MPA is used to define message from data flow.The 4th layer of encapsulating structure for Transmission Control Protocol, including TCP message head (TCP Header) and TCP loads (TCP Payload);Layer 5 is IP packets (Datagram) layer, including IP headings (IP Header) and IP loads (IP Payload);Layer 6 is ethernet frame (Frame), including Ethernet heading (Ethernet Header), Ethernet load (Ethernet Payload) and CRC results.
It can be seen that from above-mentioned encapsulating structure, for iWARP, protocol massages thereon are all used as its data payload (Payload) encapsulate, and the load as TCP message of iWARP messages in itself, addition TCP message head (Header) are formed afterwards Transmission Control Protocol message;Similarly, the TCP message load as IP messages again, add and IP messages are formed after IP headings, thus one Encapsulation is gone down layer by layer.Accordingly flow chart can refer to Fig. 1 with this process, although only show iWARP messages TCP in Fig. 1 The encapsulation of two layers of protocol layer of message, but can be seen that by Fig. 1, the encapsulation of iWARP message TCP message sums will be sequentially completed tune Degree, data-moving, message assembling, check value calculate.That is, above-mentioned mistake will be repeated by completing the encapsulation of one layer of message every time Journey, so there is the step of repeatedly scheduling, the distribution of multiple buffer zone and multiple data-moving during whole message encapsulates Suddenly.Meanwhile then parsed successively according to the step opposite with encapsulation when the data of the encapsulation are parsed in opposite end.
Based on above-mentioned scene, inventor proposes following scheme to reduce during data transfer because encapsulating and parsing is made Into time delay.
Embodiment one
The embodiment of the present invention one provides a kind of protocol message processing method, and this method is performed by United Dispatching module, should United Dispatching module may be provided in each terminal.As shown in figure 4, this method comprises the following steps:
S11, obtains the information at least two data for assembling or parsing for this layer protocol message, and the information includes this layer The maximum length of protocol massages, the load maximum length of lower-layer protocols message, the type of at least two data and respective Length.
Wherein, at least two data include being used for heading data, the needs that this layer protocol message is assembled or parsed The data of transmission, and other protocol massages data.For example, so that this layer protocol message is Transmission Control Protocol message as an example, then institute Stating at least two data may include the data that transmission control protocol TCP message data and needs transmit;Or it may include TCP message number According to, RDMA message datas and need the data transmitted;Or it may include TCP message data, RDMA message datas.
Specifically, the protocol massages processing of the embodiment of the present invention occurs in data transmission procedure end to end.The data Transmission includes data transmission and data receiver, after needing to be assembled to assembling to the data of transmission before local terminal sends data Data be sent to opposite end;Need to parse data so that this terminal obtains transmitted number after opposite end reception data According to.Wherein, before data assembling, the information of at least two data for the assembling of this layer protocol message, the packet are first obtained Include the maximum length, the load maximum length of lower-layer protocols message of this layer protocol message, the type of at least two data and Respective length;And before data parsing, first obtain the information of at least two data for the assembling of this layer protocol message, the letter Breath includes the maximum length of this layer protocol message and the type of at least two data and respective length.
It should be noted that, it is contemplated that the data after this layer of assembling are as new data payload, for next layer protocol message Encapsulation;If moreover, the load maximum length of the next layer protocol message provided is less than the length of the new data payload Degree, namely the load data section of the next layer protocol message provided are not enough to accommodate new data payload, then this assembling is It is unsuccessful, so as to not realize the technique effect of the present invention.Therefore, for the assembling success of this layer protocol message, it is also necessary to The load maximum length of the maximum length of this layer protocol message and lower-layer protocols message is compared.Therefore, in data assembling Preceding acquisition be used for this layer protocol message assembling at least two data information, including the maximum length of this layer protocol message and The load maximum length of lower-layer protocols message.
In addition, if the data after this layer of assembling are directly used in and are sent to opposite end, that is, the data after assembling are without the need under The encapsulation of one layer protocol message, then what is obtained before data assembling is used for the letter of at least two data of this layer protocol message assembling Breath can only include the maximum length of this layer protocol message.
It should be noted that the information of at least two data in step S11 should also comprise at least the report of this layer protocol message Literary header and the data message to be transmitted.Wherein, length of the heading information including heading, type of message, message The information such as version, message entity.If assembling the information that this layer protocol message also needs to other protocol massages, at least two numbers According to information also include other protocol massages information.For example, so that this layer protocol message is Transmission Control Protocol message as an example, the layer protocol Message will also include the letter of the information of rdma protocol message, wherein rdma protocol message in addition to including Transmission Control Protocol message header Breath further comprises the information such as RDMA types and various sub-protocols.
In view of such a case always occurs during sending end data and sending:Some important services come one Sent after a little insignificant business.If important service queue waiting time is overtime, easily cause important service delay or Abandon.Therefore, in a specific embodiment of the invention, before step S11, also comprise the following steps:
111, the QoS policy from upper-layer service is obtained, the qos policy is used to set not upper-layer service Same priority, the priority level of setting is higher, then the business is more preferred;
112, according to the qos policy from upper-layer service of the acquisition, selected in being provided from the upper-layer service for task Selecting needs task to be processed;
113, based on it is described need to task to be processed, obtain the letters of at least two data for the assembling of this layer protocol message Breath.
Wherein, upper-layer service can be specially the task on transport layer, and task is, for example, to browse webpage, initiate video etc.. QoS (Quality of Service, service quality) in the embodiment of the present invention is used for different pieces of information corresponding to different task Different priority is set, and the priority level of setting is higher, and data corresponding with the priority are more preferred, described Business corresponding to data is more preferred transmission.
In the prior art, before protocol massages encapsulation, each scheduler module carries out the scheduling of oneself, Wu Fashi respectively Existing qos policy, therefore high priority data corresponding to important service can not be selected to transmit.
It is intelligible, when receiving terminal receives the data that above-mentioned mark has, if receiving terminal determines the data Priority higher than the data to be received such as before it priority, then the data receiving end preferentially parse.
S12, when obtaining the information at least two data for being used for the assembling of this layer protocol message, according to this layer protocol message Maximum length and lower-layer protocols message load maximum length, determine the total lengths of at least two data;Or, when acquisition During the information of at least two data parsed for this layer protocol message, according to the maximum length of this layer protocol message, institute is determined State the total length of at least two data.
Wherein, when obtaining the information at least two data for being used for the assembling of this layer protocol message, assisted according to described layer The maximum length of message and the maximum load length of the lower-layer protocols message are discussed, determines the total length of at least two data Can be specially:
Selection length in both from the maximum length of this layer protocol message and the maximum load length of lower-layer protocols message Minimum value, total length of the minimum value as at least two data.
S13, according to the total length of at least two data of determination, distribute a shared buffer memory region.
In this step, it is only necessary to disposable distribution can accommodate the shared buffer memory region of acquired multiple data, this Compared with prior art repeated dispensing buffer zone, reduce the time distributed again shared by buffer zone.Moreover, existing skill By terminal is any or the buffer zone size of fixed setting data in art, imperfect message is easily formed, and energy in the present embodiment The size in shared buffer memory region is set dynamically in the length of enough data according to acquisition, realizes that the region can accommodate all numbers completely According to so as to form a complete message in this region.
S14, according to the type of at least two data and respective length, in shared buffer memory region to it is described at least Two kinds of parallel data processings, wherein every kind of data are handled by a data processing module, a data processing module is to one kind The processing time of data overlaps with another data processing module to the processing time of another data.
Wherein, alternatively, in a specific embodiment of the invention, the type according at least two data and Respective length, at least two parallel data processing is comprised the following steps in the shared buffer memory region:
141, according to the type of at least two data and respective length, energy is distributed in the shared buffer memory region The buffer zone of each data at least two data is enough accommodated, and determines that each leisure of at least two data is described common Enjoy the original position in buffer zone;
142, the original position in the shared buffer memory region of the determination, at least two data parallel Reason.
The protocol message processing method that the embodiment of the present invention one provides, is performed by United Dispatching module.First, obtain and be used for This layer protocol message assembles or the information of at least two data of parsing, described information include most greatly enhancing for this layer protocol message Degree, the load maximum length of lower-layer protocols message, the type and respective length of at least two data;It is used for this when obtaining During the information of at least two data of layer protocol message assembling, according to the load maximum length and lower-layer protocols of this layer protocol message The load maximum length of message, determine the total length of at least two data;Or, it is used for the parsing of this layer protocol message when obtaining At least two data information when, according to the maximum length of this layer protocol message, determine the overall length of at least two data Degree;Then, according to the total length of at least two data of determination, a shared buffer memory region is distributed;And according to described at least two The type and respective length of kind data, at least two parallel data processing in shared buffer memory region, wherein every kind of Data are handled by a data processing module, and a data processing module is to a kind of processing time of data and another data Processing module overlaps to the processing time of another data.It will thus be seen that this United Dispatching of the present invention, disposable distribution Shared buffer memory region and the mode of parallel data processing, avoid present in prior art repeatedly scheduling, repeated dispensing caching The problem of region and data-moving process.Therefore, the embodiment of the present invention shortens the data assembling time used when data are sent The time is parsed with data used during data receiver, so as to reduce the time delay of data transfer.
The parallel processing of multiple data for assembling protocol massages can be realized in embodiments of the present invention.Here parallel Processing can be proper parallel processing, namely United Dispatching module is simultaneously to the transmission requirement of each data processing module The message of each self-corresponding data is handled, each data processing module is started simultaneously at the respective data of processing.Certainly, parallel place Reason can also be in non-critical meaning parallel processing, namely United Dispatching module with very short time difference first backward each data at Manage module and send the message for requiring to handle each self-corresponding data, make each respective number of data processing module priority start to process According to.
On the basis of the parallel processing of above-mentioned non-critical meaning, alternatively, at least two number is obtained in step S11 According to type and respective length after, it is further comprising the steps of:
111, determine the process performance of each data processing module;
112, at the data length of each at least two data of acquisition and/or each data of determination The process performance of module is managed, sends the message for requiring processing protocol message successively to each data processing module.
Wherein, the message sent to each data processing module can also have diversified forms, and alternatively, the message is specially A kind of message for being used to assemble the data of protocol massages;Or, it is specially that one kind is used to trigger the data processing module to obtain The message for being used to assemble the data of protocol massages.
Specifically, the length of data is longer, then with the same treatment resume module data when time used it is longer;Mould The process performance of block is poorer, then the time used when handling identical data is longer.In consideration of it, above-mentioned steps 111 and 112 include Following three kinds of embodiments:
Mode one, according to the data length of each at least two data of acquisition, to each data processing mould Block sends the message for requiring processing protocol message successively.
The step of including being respectively compared the data length of every kind of data in this approach.Data length is longer, then it is corresponding Data processing module it is more early handle the data.
Mode two, according to the process performance of each data processing module of determination, sent out successively to each data processing module Send the message for requiring processing protocol message.
Which include be respectively compared each data processing module process performance the step of.The place of data processing module Rationality can be poorer, then its more early its corresponding data of processing.
Mode three, at the data length of each at least two data of acquisition and each data determined The process performance of module is managed, sends the message for requiring processing protocol message successively to each data processing module.
Include being respectively compared the data length of every kind of data in which and be respectively compared the place of each data processing module The step of rationality energy.The process performance of the data length of integrated data data processing module corresponding with its, such as when a certain number When according to length, the most long and performance of its corresponding data processing module is worst, the worst data processing module of the performance is handled earliest The data.Weighting method, this hair can be used by wherein considering the process performance of data length data processing module corresponding with its It is bright that this is not specifically limited.
It should be noted that even if in embodiments of the present invention using the parallel processing in above-mentioned non-critical meaning, to data The time difference that the priority of processing module is sent only is tens nanoseconds or hundreds of nanoseconds.This and the existing middle each data institute of serial process Time is that several microseconds are compared, and is inappreciable.That is, prior art to for protocol massages assemble or parse The time of at least two serial modes processing is the result after the number of species of data is multiplied with several microseconds, and the embodiment of the present invention The time of at least two parallel data processings to assembling or parsing for protocol massages is that several microseconds are added with hundreds of nanoseconds Result.Thus, the embodiment of the present invention remains able to reduce the time delay of data transfer based on above-mentioned steps 111 and 112.
By above-mentioned steps 111 and 112, in step S14 a data processing module to a kind of processing time of data with Another data processing module overlaps to the processing time of another data can be further specifically, finally receive message The deadline of data processing module processing corresponding data is less than or equal to the data processing module processing for being initially received message The deadline of corresponding data.
During data transfer, because physical layer causes certain data of transmission to be likely to imperfect extremely, therefore, It is described common after the information at least two data for being used for protocol massages parsing is obtained in a specific embodiment of the invention Before enjoying in buffer zone at least two parallel data processing, methods described also includes:Determine at least two number According to whether being partial data;
In the case of it is determined that at least two data are partial data, according to the type of at least two data and Respective length, at least two data parallel is parsed in the shared buffer memory region.
Specifically, exemplified by parsing the Transmission Control Protocol message comprising rdma protocol message, if judging, rdma protocol message is complete It is whole, then Transmission Control Protocol message and rdma protocol message are parsed parallel in buffer zone;If judging, rdma protocol message is endless It is whole, then incomplete rdma protocol message is cached, to be spliced with another incomplete rdma protocol message.
If in addition, without incomplete rdma protocol message before this Transmission Control Protocol packet parsing, it is determined that rdma protocol Position of the heading of message in buffer zone, according to the heading of the rdma protocol message in the buffer zone The information of position and rdma protocol message (such as MPA length) judges whether the rdma protocol message is complete;
It is incomplete before basis if there is incomplete rdma protocol message before this Transmission Control Protocol packet parsing The information of rdma protocol message and the information of current rdma protocol message (such as MPA length) judge current rdma protocol Whether message and the spliced rdma protocol message of rdma protocol message before are complete.
It should be noted that in actual applications, if current rdma protocol message is spelled with rdma protocol message before A complete rdma protocol message is formed after connecing, then is needed in the rdma protocol report to current rdma protocol message with before After text is spliced, to both carrying out dissection process so that two protocol massages can finally form one completely Rdma protocol message.Wherein, multiple complete or imperfect rdma protocol message may be included in a Transmission Control Protocol message, Fig. 4 is The schematic diagram of Transmission Control Protocol message and rdma protocol message in the present invention.
In order to which those skilled in the art are better understood from the skill of the protocol message processing method of the offer of the embodiment of the present invention one Art scheme, protocol message processing method provided by the invention is carried out respectively below by specific embodiment two and embodiment three Describe in detail.
Embodiment two
By taking the RDMA technologies based on TCP/IP as an example, TCP is performed by United Dispatching module before transmitting terminal sends data The parallel composition of protocol massages, as shown in figure 5, comprising the following steps:
Step 201, the QoS policy from upper-layer service is obtained, according to qos policy, is provided from upper-layer service Task in selection need task to be processed.
Wherein, qos policy is used to set different priority, the priority level of setting to the task that upper-layer service provides Higher, task corresponding with the priority is more preferred.
Step 202, based on the need task to be processed, at least two data for the assembling of Transmission Control Protocol message are obtained Information.
Wherein, whether RDMA is included in being connected according to TCP, at least two data may include data below content:
If TCP connections include RDMA, at least two data include TCP message data, RDMA message datas and needs The data of transmission.
If not including RDMA in TCP connections, at least two data include TCP message data and need the data transmitted.
Step 203, determine whether the pending task belongs to RDMA connection tasks according to the information of acquisition.
If pending task belongs to RDMA connection tasks, step 204 is performed, otherwise performs step 207.
Step 204, TCP message, the RDMA information in RDMA connections, TCP are also obtained from the information of at least two data The length and RDMA message classes for the data that packet maximum length information, the load maximum length information of IP messages, needs transmit Type and length information.
Step 205, according to TCP message maximum length information and the load maximum length information of IP messages, it is determined that for depositing Put the size of the buffer zone of TCP message.
Step 206, the length for the data transmitted according to the length of TCP message, the length of RDMA messages and needs, described The data parallel transmitted in shared buffer memory region to TCP message, RDMA messages and needs assembles, and generates Transmission Control Protocol message.
Afterwards, in order to ensure the correctness of data transfer and integrality, CRC meters can be carried out to the Transmission Control Protocol message of generation Calculate, and result of calculation is inserted into buffer zone, transfer to next layer protocol resume module.Wherein, the CRC of Transmission Control Protocol message Calculate the CRC calculating for including rdma protocol message and the CRC calculating of Transmission Control Protocol message.
Step 210 is performed after this step.
Step 207, TCP message, TCP message maximum length information, IP messages are obtained from the information of at least two data Load maximum length information and need the length information of data transmitted.
Step 208, according to TCP message maximum length information and the load maximum length information of IP messages, it is determined that for depositing Put the size of the buffer zone of TCP message.
Step 209, the length for the data transmitted according to the length of TCP message and needs, to TCP in shared buffer memory region Message and the data parallel for needing to transmit assemble, and generate Transmission Control Protocol message.
Afterwards, in order to ensure the correctness of data transfer and integrality, TCP associations can be carried out to the Transmission Control Protocol message of generation The CRC for discussing message is calculated.
Step 210, determine whether the pending task has been completed, if task does not complete, enter task buffer team Row are waited and dispatched again, that is, perform step 201;If task is completed, flow terminates.
Embodiment three
Still by taking the RDMA technologies based on TCP/IP as an example, performed before receiving terminal receives data by United Dispatching module The parallel parsing of Transmission Control Protocol message, as shown in fig. 6, comprising the following steps:
Step 301, the Transmission Control Protocol message of TCP connections is obtained.
Step 302, according to the maximum length of Transmission Control Protocol message, a buffer zone is distributed;
Step 303, determine whether include rdma protocol message in Transmission Control Protocol message.If so, step 304 is then performed, it is no Then, step 310 is performed.
Step 304, judge whether rdma protocol message is complete.If rdma protocol message is complete, step 305 is performed, it is no Then perform step 308.
Step 305, the Transmission Control Protocol message and the rdma protocol message are parsed parallel in the buffer zone.
Step 306, when analysis result is correct, output needs the data transmitted.
Specifically, when all parsing correct to Transmission Control Protocol message and rdma protocol message, receiving scheduler module will can need The information such as position of the destination address and load data of the load data transmitted by way of DMA in buffer zone are sent to Dma module so that dma module traffic load data by way of DMA.
Step 307, judge whether also have rdma protocol message in Transmission Control Protocol message.If so, then turn to step 304;If not yet Have, then the flow terminates.
Step 308, dissection process is carried out to Transmission Control Protocol message in buffer zone.
Step 309, incomplete rdma protocol message is carried out when correct to the Transmission Control Protocol packet parsing in step 308 Caching, wait follow-up splicing.In actual applications, it is rotatable after this step to arrive step 301.
Step 310, the Transmission Control Protocol message is parsed.
Step 311, when analysis result is correct, output needs the data transmitted.
Example IV
The embodiment of the present invention four provides a kind of protocol massages processing unit 41, and Fig. 7 is the association that the embodiment of the present invention four provides Discuss the structural representation of message process device.Including:
At least one processor 401, memory 402, communication interface 403 and bus.Processor 401, memory 402 and logical Letter interface 403 is connected by bus and completes mutual communication.The bus can be industry standard architecture (Industry Standard Architecture, referred to as ISA) bus, external equipment interconnection (Peripheral Component, referred to as PCI) bus or extended industry-standard architecture (Extended Industry Standard Architecture, referred to as EISA) bus etc..The bus can be divided into address bus, data/address bus, controlling bus etc.. For ease of representing, only represented in Fig. 7 with a thick line, it is not intended that an only bus or a type of bus.Wherein:
Communication interface 403 is mainly used in realizing between the protocol massages processing unit of the present embodiment and other equipment or device Communication.
Memory 402 is used to store executable program code, and the program code includes computer-managed instruction.Memory 402 may include high speed ROM memory, it is also possible to also including nonvolatile memory (non-volatile memory), such as At least one magnetic disk storage.Wherein, in embodiments of the present invention, memory 402 can be particularly at least two described in storage The shared buffer memory region of kind data.
Processor 401 is probably a central processing unit (Central Processing Unit, referred to as CPU), or Specific integrated circuit (Application Specific Integrated Circuit, referred to as ASIC), or by with It is set to the one or more integrated circuits for implementing the embodiment of the present invention.
In one embodiment, processor 401 is run by reading the executable program code stored in memory 402 Program corresponding with the executable program code, for:
The information at least two data for assembling or parsing for this layer protocol message is obtained, described information is assisted including this layer Discuss maximum length, the load maximum length of lower-layer protocols message of message, the type and respective length of at least two data Degree;
When obtaining the information at least two data for being used for the assembling of this layer protocol message, according to described layer protocol message Maximum length and the lower-layer protocols message load maximum length, determine the total lengths of at least two data;Or, work as When obtaining the information at least two data of this layer protocol message parsing, according to most greatly enhancing for described layer protocol message Degree, determine the total length of at least two data;
According to the total length of at least two data of determination, a shared buffer memory region is distributed;
According to the type of at least two data of acquisition and respective length, in the shared buffer memory region to it is described extremely Few two kinds of parallel data processings, wherein every kind of data are handled by a data processing module, a data processing module is to one The processing time of kind data overlaps with another data processing module to the processing time of another data.
What the embodiment of the present invention four provided is used for protocol massages processing unit.The device includes processor, the processor It is used for the information at least two data that this layer protocol message is assembled or parsed for obtaining and determines at least two data Total length;Processor is additionally operable to the total length of at least two data according to determination, distributes a shared buffer memory region;And To at least two parallel data processing in shared buffer memory region.Once dispatch it will thus be seen that the present invention is this, be disposable The device of shared buffer memory region and parallel data processing is distributed, avoids present in prior art repeatedly scheduling, repeated dispensing The problem of buffer zone and data-moving process.Therefore, the embodiment of the present invention shortens data assembling used when data are sent Data used parsing time when time and data receiver, so as to reduce the time delay of data transfer.
In another embodiment, processor 401 is transported by reading the executable program code stored in memory 402 Row program corresponding with the executable program code, for:
Two are selected from the maximum length of described layer protocol message and the maximum load length of the lower-layer protocols message The minimum value of length in person, total length of the minimum value as at least two data.
In another embodiment, processor 401 is additionally operable to:
When it is determined that at least two data are partial datas, according to the type of at least two data and respective Length, at least two data parallel is parsed in the shared buffer memory region.
It should be noted that above-mentioned processor 401 is in addition to above-mentioned function, it may also be used for performs the above method and implements Other flows in example, will not be repeated here.
Embodiment five
The embodiment of the present invention five provides a kind of terminal 51, and the terminal is included described in any embodiment of previous embodiment four Protocol massages processing unit 41.
Wherein, the workflow of the protocol massages processing unit can refer to the method and step in embodiment one to three, herein Do not repeat.
In addition, the terminal in the embodiment of the present invention can be desktop computer, tablet personal computer, personal assistant (Personal Assistance, PA), mobile phone and it is any can pass through protocol massages transmit data terminal.
One of ordinary skill in the art will appreciate that realize all or part of flow in above-described embodiment method, being can be with The hardware of correlation is instructed to complete by computer program, described program can be stored in a computer read/write memory medium In, the program is upon execution, it may include such as the flow of the embodiment of above-mentioned each method.Wherein, described storage medium can be magnetic Dish, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random Access Memory, RAM), register (Register), Cache (Cache) etc..
The foregoing is only a specific embodiment of the invention, but protection scope of the present invention is not limited thereto, any Those familiar with the art the invention discloses technical scope in, change or replacement can be readily occurred in, should all be contained Cover within protection scope of the present invention.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.

Claims (8)

  1. A kind of 1. protocol message processing method, it is characterised in that performed by United Dispatching module, including:
    The information at least two data for assembling or parsing for this layer protocol message is obtained, described information includes this layer protocol report Maximum length, the load maximum length of lower-layer protocols message of text, the type and respective length of at least two data;
    When obtaining the information at least two data for being used for the assembling of this layer protocol message, according to described layer protocol message most The load maximum length of long length and the lower-layer protocols message, determine the total length of at least two data;Or, when acquisition During information at least two data of this layer protocol message parsing, according to the maximum length of described layer protocol message, really The total length of fixed at least two data;
    According to the total length of at least two data of the determination, a shared buffer memory region is distributed;
    According to the type of at least two data and respective length, to described at least two in the shared buffer memory region Parallel data processing, wherein every kind of data are handled by a data processing module, a data processing module is to a kind of data Processing time the processing time of another data is overlapped with another data processing module.
  2. 2. according to the method for claim 1, it is characterised in that the maximum length according to described layer protocol message and The maximum load length of the lower-layer protocols message, determine that the total length of at least two data specifically includes:
    Selection is in both from the maximum length of described layer protocol message and the maximum load length of the lower-layer protocols message The minimum value of length, total length of the minimum value as at least two data.
  3. 3. according to the method for claim 1, it is characterised in that
    After the information obtained at least two data of protocol massages parsing, to described in the shared buffer memory region Before at least two parallel data processings, methods described also includes:
    Determine whether at least two data are partial datas;
    According to the type of at least two data and respective length, to described at least two in the shared buffer memory region Parallel data processing specifically,
    When it is determined that at least two data are partial datas, according to the type of at least two data and respective length Degree, at least two data parallel is parsed in the shared buffer memory region.
  4. 4. method according to claim 1 or 2, it is characterised in that at least two data specifically include:
    The data that transmission control protocol TCP heading data and needs transmit;Or,
    TCP message data, remote direct memory access RDMA message datas;Or,
    The data that TCP message head data, RDMA headings data and needs transmit.
  5. 5. a kind of protocol massages processing unit, it is characterised in that described device includes at least one processor, memory, communication Interface and bus, wherein,
    The processor is used for:
    The information at least two data for assembling or parsing for this layer protocol message is obtained, described information includes this layer protocol report Maximum length, the load maximum length of lower-layer protocols message of text, the type and respective length of at least two data;
    When obtaining the information at least two data for being used for the assembling of this layer protocol message, according to described layer protocol message most The load maximum length of long length and the lower-layer protocols message, determine the total length of at least two data;Or, when acquisition During information at least two data of this layer protocol message parsing, according to the maximum length of described layer protocol message, really The total length of fixed at least two data;
    According to the total length of at least two data of the determination, a shared buffer memory region is distributed;
    According to the type of at least two data of the acquisition and respective length, in the shared buffer memory region to it is described extremely Few two kinds of parallel data processings, wherein every kind of data are handled by a data processing module, a data processing module is to one The processing time of kind data overlaps with another data processing module to the processing time of another data.
  6. 6. device according to claim 5, it is characterised in that the processor is used for:
    Selection is in both from the maximum length of described layer protocol message and the maximum load length of the lower-layer protocols message The minimum value of length, total length of the minimum value as at least two data.
  7. 7. device according to claim 5, it is characterised in that the processor is used for:
    Determine whether at least two data are partial datas;
    When it is determined that at least two data are partial datas, according to the type of at least two data and respective length Degree, at least two data parallel is parsed in the shared buffer memory region.
  8. 8. a kind of terminal, it is characterised in that the terminal includes the protocol massages processing described in preceding claims any one of 5-7 Device.
CN201510038878.9A 2015-01-26 2015-01-26 protocol message processing method, device and terminal Active CN104618365B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510038878.9A CN104618365B (en) 2015-01-26 2015-01-26 protocol message processing method, device and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510038878.9A CN104618365B (en) 2015-01-26 2015-01-26 protocol message processing method, device and terminal

Publications (2)

Publication Number Publication Date
CN104618365A CN104618365A (en) 2015-05-13
CN104618365B true CN104618365B (en) 2018-02-13

Family

ID=53152640

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510038878.9A Active CN104618365B (en) 2015-01-26 2015-01-26 protocol message processing method, device and terminal

Country Status (1)

Country Link
CN (1) CN104618365B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105743894A (en) * 2016-01-29 2016-07-06 瑞斯康微电子(深圳)有限公司 Multi-protocol message parsing method and system based on file mode
CN107979490A (en) * 2017-11-17 2018-05-01 北京联想超融合科技有限公司 The recording method of daily record data and server cluster
CN110380970B (en) * 2019-07-22 2020-10-13 北京邮电大学 Self-adaptive data message forwarding method and device suitable for heterogeneous network
CN111031044A (en) * 2019-12-13 2020-04-17 浪潮(北京)电子信息产业有限公司 Message analysis hardware device and message analysis method
CN111327625A (en) * 2020-03-02 2020-06-23 武汉中旗生物医疗电子有限公司 Parameter monitoring method and device, multi-parameter monitor and storage medium
CN115514712B (en) * 2021-06-22 2023-09-05 中移物联网有限公司 Data processing method, device, terminal and network side equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6675200B1 (en) * 2000-05-10 2004-01-06 Cisco Technology, Inc. Protocol-independent support of remote DMA
EP1573454A2 (en) * 2002-06-11 2005-09-14 Ashish Pandya High performance ip processor for tcp/ip, rdma and ip storage applications
CN101252579A (en) * 2008-02-22 2008-08-27 浙江大学 Method for packing and unpacking network layer
CN101488960A (en) * 2009-03-04 2009-07-22 哈尔滨工程大学 Apparatus and method for TCP protocol and data recovery based on parallel processing

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6675200B1 (en) * 2000-05-10 2004-01-06 Cisco Technology, Inc. Protocol-independent support of remote DMA
EP1573454A2 (en) * 2002-06-11 2005-09-14 Ashish Pandya High performance ip processor for tcp/ip, rdma and ip storage applications
CN101252579A (en) * 2008-02-22 2008-08-27 浙江大学 Method for packing and unpacking network layer
CN101488960A (en) * 2009-03-04 2009-07-22 哈尔滨工程大学 Apparatus and method for TCP protocol and data recovery based on parallel processing

Also Published As

Publication number Publication date
CN104618365A (en) 2015-05-13

Similar Documents

Publication Publication Date Title
CN104618365B (en) protocol message processing method, device and terminal
US10666777B2 (en) Reducing network latency
US9003053B2 (en) Message acceleration
CN100552626C (en) With network stack synchronously with upload the method that unloaded network stack is connected
US7756990B2 (en) Configurable protocol engine
TWI241804B (en) Arrangement for creating multiple virtual queue pairs from a compressed queue pair based on shared attributes
CN108494817A (en) Data transmission method, relevant apparatus and system
US8756270B2 (en) Collective acceleration unit tree structure
CN105472023B (en) A kind of method and device of direct distance input and output
US6760304B2 (en) Apparatus and method for receive transport protocol termination
CN107392768A (en) A kind of futures trading system and method based on FPGA
JP2020522922A (en) Method and system for selectively using network coding to propagate transactions in a blockchain network
CN107787570A (en) Light weight transportation protocol
CN106233694A (en) The head management sequential value of interpolation is utilized in calculating equipment
CN109327511A (en) A kind of data request method and server based on http protocol
CN107508828B (en) A kind of very-long-range data interaction system and method
CN113691589A (en) Message transmission method, device and system
CN102315918B (en) Method and device for intercommunicating TCP (Transmission Control Protocol) connection with SCTP (Stream Control Transmission Protocol) connection
CN110247926A (en) A kind of exchange method and system
WO2022268137A1 (en) Tcp connection method, system, network device, and storage medium
US11463560B2 (en) Network interface architecture having a directly modifiable pre-stage packet transmission buffer
CN106713170B (en) A kind of message fragmenting method and device in the channel VSM
WO2015057149A1 (en) Customizable macro-based order entry protocol and system
CN105847289A (en) Data transmission method and data transmission device
CN116155971A (en) Multiplexing network data transmission method and system based on TCP

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20211223

Address after: 450046 Floor 9, building 1, Zhengshang Boya Plaza, Longzihu wisdom Island, Zhengdong New Area, Zhengzhou City, Henan Province

Patentee after: Super fusion Digital Technology Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.

TR01 Transfer of patent right