CN107222793A - A kind of method and device of data transfer - Google Patents

A kind of method and device of data transfer Download PDF

Info

Publication number
CN107222793A
CN107222793A CN201710314176.8A CN201710314176A CN107222793A CN 107222793 A CN107222793 A CN 107222793A CN 201710314176 A CN201710314176 A CN 201710314176A CN 107222793 A CN107222793 A CN 107222793A
Authority
CN
China
Prior art keywords
sub
video data
internal memory
rtsp
rtp
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
CN201710314176.8A
Other languages
Chinese (zh)
Other versions
CN107222793B (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 CN201710314176.8A priority Critical patent/CN107222793B/en
Publication of CN107222793A publication Critical patent/CN107222793A/en
Application granted granted Critical
Publication of CN107222793B publication Critical patent/CN107222793B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/643Communication protocols
    • H04N21/64322IP
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/231Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/643Communication protocols
    • H04N21/6437Real-time Transport Protocol [RTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Television Signal Processing For Recording (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a kind of method and device of data transfer, methods described includes:For each first sub-video data, RTSP or RTP heads are determined, the first internal memory is write by described RTSP or RTP;Copy each first sub-video data to second internal memory;For each first sub-video data, the first TCP header and the first IP heads are determined, and write the first internal memory;The address of each first sub-video data and RTSP or RTP, the first TCP header and the first address of IP are write into grid descriptor, so that network interface card sends the first sub-video data.Due in embodiments of the present invention, directly copy each first sub-video data to second internal memory, by RTSP or RTP heads, and first TCP header and the first IP write-in the first internal memories in, therefore the process that each first sub-video data copies the internal memory of User space to is reduced, reduces the consumption of bandwidth in data transmission procedure.

Description

A kind of method and device of data transfer
Technical field
The present invention relates to technical field of data transmission, more particularly to a kind of method and device of data transfer.
Background technology
With the development of wireless communication technology, using smart mobile phone as the highly popular of the portable mobile termianl of representative, it is The transmission of video built towards mobile environment is provided convenience condition, first will be waiting for transmission during existing video data transmission Video data is according to real time streaming transport protocol (Real Time Streaming Protocol, RTSP) or RTP (Real-time Transport Protocol, RTP) form carries out subpackage, then by subpackage transmission control protocol (Transmission Control Protocol, TCP) or UDP (User Datagram Protocol, UDP) send.
The subpackage process of existing video data waiting for transmission is as shown in figure 1, for video data waiting for transmission, carry out RTSP packs, and now needs to carry out video data waiting for transmission in 1st copy, i.e., copies video data waiting for transmission to use In the internal memory of family state, and plus RTSP heads in internal memory;By video data waiting for transmission from User space be transferred to kernel state when, it is right Video data waiting for transmission is carried out in the 2nd copy, i.e., the internal memory that video data waiting for transmission is copied to kernel state;Pass through TCP and Internet Protocol (Internet Protocol, IP) protocol stack are packed to video data waiting for transmission, plus Upper TCP header and IP head;By video data waiting for transmission write-in Ethernet (Ethernet) direct memory access (Direct Memory Access, DMA) transmit queue;In described RTSP, TCP header and IP and video data waiting for transmission are all stored in In the internal memory of core state, by RTSP leading address, TCP header and IP leading address and video data address waiting for transmission write-in network description Symbol;Address acquisition of the network interface card in grid descriptor RTSP, TCP header and IP heads, and video data waiting for transmission, concurrently Send video data waiting for transmission.
In the internal memory that video data waiting for transmission is copied to User space in the prior art, RTSP heads are added;Copy to again In the internal memory of kernel state, TCP header and IP heads are added;In so make it that RTSP, TCP header and IP and video data are all stored in In the internal memory of core state.But, network interface card send data when, as long as the address in being accorded with according to network sweep, can obtain RTSP, TCP header and IP heads, and video data waiting for transmission, RTSP, TCP header and IP and video data might not be preserved In same internal memory.Therefore during the subpackage of existing video data, it adds additional once video data waiting for transmission Copy procedure, i.e., above-mentioned 1st copy in the internal memory that video data waiting for transmission is copied to User space, add data Bandwidth consumption in transmitting procedure.
The content of the invention
The embodiments of the invention provide a kind of method and device of data transfer, to solve bandwidth in data transmission procedure The problem of consuming big.
The embodiments of the invention provide a kind of method of data transfer, this method includes:
Video data waiting for transmission is divided into multiple first sub-video datas, for each first sub-video data, really Real time streaming transport protocol RTSP or realtime transmission protocol RTP head of fixed first sub-video data, by described RTSP or RTP The first internal memory in head write-in kernel state;
Each first sub-video data is copied to the second internal memory in kernel state;
For each first sub-video data, determine first sub-video data the first transmission control protocol TCP head and First Internet Protocol IP heads, by the first internal memory in first TCP header and the first IP write-in kernel states;
For each first sub-video data, by address of first sub-video data in second internal memory and should The RTSP heads of first sub-video data or RTP, the first TCP header and the first IP address write-ins in first internal memory should The corresponding grid descriptor of first sub-video data, so that address of the network interface card in grid descriptor, obtains corresponding RTSP Head or RTP, the first TCP header and the first IP and the first sub-video data are simultaneously sent.
Further, it is described to include described RTSP or RTP the first internal memory write in kernel state:
Judge the RTSP being had been written into the first internal memory heads or first data volume of RTP and the RTSP having been written into Second data volume of head or RTP corresponding first sub-video data and whether reach general segmentation offloading GSO driving most It is big to support traffic volume;
If not, the first internal memory that described RTSP or RTP is write in kernel state.
Further, if first data volume and the second data volume and reach general segmentation offloading GSO drivings Maximum supports traffic volume, described to copy each first sub-video data to the second internal memory in kernel state and include:
Corresponding each first sub-video data of the RTSP heads being had been written into first internal memory or RTP is copied to The second internal memory in kernel state.
Further, it is described by corresponding each first son of the RTSP heads being had been written into first internal memory or RTP The second internal memory that video data is copied in kernel state includes:
According to corresponding each first sub-video data of the RTSP heads being had been written into first internal memory or RTP, really The second TCP header and the 2nd IP heads of fixed second sub-video data to be packaged;
By corresponding each first sub-video data of the RTSP heads being had been written into first internal memory or RTP, and really Fixed the second TCP header and the 2nd IP be encapsulated as the second sub-video data, copy second sub-video data to kernel state In the second internal memory.
Further, second TCP header for determining the second sub-video data to be packaged and the 2nd is after IP, by institute State the RTSP heads being had been written into the first internal memory or RTP corresponding each first sub-video data, and the second TCP header determined With the 2nd IP be encapsulated as before the second sub-video data, methods described also includes:
Judge whether to carry out acceleration processing to second sub-video data to be packaged;
If it is, copying the described 2nd of determination the Type Of Service TOS field in IP to institute as original TOS fields The first internal memory is stated, the corresponding reserved place in the described 2nd of determination the TOS fields in IP is set to 1;
Second internal memory second sub-video data copied in kernel state includes:
Judge whether the corresponding reserved place in the determine the described 2nd TOS fields in IP is 1;
If it is, second sub-video data to be copied to the second internal memory in kernel state.
Further, it is described to be directed to each first sub-video data, determine the first transmission control of first sub-video data Agreement TCP header processed and the first Internet Protocol IP include:
Each first sub-video data that second sub-video data is included is determined, for each first sub-video number According to according to the data volume included in the RTSP of first sub-video data heads or RTP, to the 2nd TCP and the 2nd IP heads In the data volume that includes be updated, and according to the original TOS fields, to correspondence of the 2nd after the renewal in IP TOS fields are updated, using the second TCP header after renewal and the 2nd IP be used as the first of first sub-video data TCP header and the first IP heads.
On the other hand, the embodiments of the invention provide a kind of device of data transfer, described device includes:
First writing module, for video data waiting for transmission to be divided into multiple first sub-video datas, for each First sub-video data, determines real time streaming transport protocol RTSP or realtime transmission protocol RTP head of first sub-video data, The first internal memory that described RTSP or RTP is write in kernel state;
Module is copied, for each first sub-video data to be copied to the second internal memory in kernel state;
Second writing module, for for each first sub-video data, determining that the first of first sub-video data passes Transport control protocol discusses TCP header and the first Internet Protocol IP heads, by first TCP header and the first IP write-in kernel states The first internal memory;
3rd writing module, for for each first sub-video data, by first sub-video data described second The RTSP heads of address and first sub-video data in internal memory or RTP, the first TCP header and the first IP described first Address in internal memory writes the corresponding grid descriptor of the first sub-video data, so that ground of the network interface card in grid descriptor Location, obtains corresponding RTSP or RTP, the first TCP header and the first IP and the first sub-video data and sends.
Further, first writing module, specifically for the RTSP heads or RTP for judging to have been written into the first internal memory First data volume of head and the second data volume of the RTSP heads having been written into or RTP corresponding first sub-video data Whether reach that general the maximum of segmentation offloading GSO drivings supports traffic volume;If not, described RTSP or RTP is write The first internal memory in kernel state.
Further, the copy module, if specifically for first data volume and the second data volume and reach The maximum support traffic volume of general segmentation offloading GSO drivings is right by the RTSP heads being had been written into first internal memory or RTP Each first sub-video data answered copies the second internal memory in kernel state to.
Further, the copy module, specifically for according to the RTSP heads or RTP being had been written into first internal memory Corresponding each first sub-video data, determines the second TCP header and the 2nd IP heads of the second sub-video data to be packaged;Will The RTSP heads being had been written into first internal memory or RTP corresponding each first sub-video data, and the 2nd TCP determined Head and the 2nd IP be encapsulated as the second sub-video data, second sub-video data is copied in second in kernel state Deposit.
Further, described device also includes:
Setup module is judged, for judging whether to carry out acceleration processing to second sub-video data to be packaged;Such as Fruit is to copy the described 2nd of determination the Type Of Service TOS field in IP in described first as original TOS fields to Deposit, the corresponding reserved place in the described 2nd of determination the TOS fields in IP is set to 1;
The copy module, specifically for the corresponding reserved place in the described 2nd TOS fields in IP that judge to determine Whether it is 1;If it is, second sub-video data to be copied to the second internal memory in kernel state.
Further, second writing module, specifically for determine that second sub-video data includes each the One sub-video data, for each first sub-video data, is included according in the RTSP of first sub-video data heads or RTP Data volume, the data volume included in IP of the 2nd TCP and the 2nd is updated, and according to the original TOS fields, Corresponding TO S field of the 2nd after the renewal in IP is updated, by the second TCP header and the 2nd IP after renewal Head as first sub-video data the first TCP header and the first IP heads.
The embodiments of the invention provide a kind of method and device of data transfer, methods described includes:Regarded waiting for transmission Frequency, for each first sub-video data, determines first sub-video data according to multiple first sub-video datas are divided into Real time streaming transport protocol RTSP or realtime transmission protocol RTP head, first that described RTSP or RTP is write in kernel state Internal memory;Each first sub-video data is copied to the second internal memory in kernel state;For each first sub-video data, The the first transmission control protocol TCP head and the first Internet Protocol IP heads of first sub-video data are determined, by described The first internal memory in one TCP header and the first IP write-in kernel states;For each first sub-video data, by first sub-video The RTSP heads or RTP, the first TCP header and first of address and first sub-video data of the data in second internal memory The IP addresses in first internal memory write the corresponding grid descriptor of the first sub-video data, so that network interface card is according to net Address in network descriptor, obtains corresponding RTSP or RTP, the first TCP header and the first IP and the first sub-video number According to and send.Due in embodiments of the present invention, directly each first sub-video data is copied in second in kernel state Deposit, the RTSP heads or RTP heads of the first sub-video data, and the first TCP header and the first IP write-in kernel state the first internal memory In, although the RTSP heads of the first sub-video data or RTP, the first TCP header and the first IP and first sub-video data guarantor In the different address that there is internal memory, but network interface card accorded with according to network sweep in address, still can obtain first son and regard The RTSP heads of frequency evidence or RTP, the first TCP header and the first IP heads, and first sub-video data and send, therefore reduce Each first sub-video data copies the process of the internal memory of User space to, reduces the consumption of bandwidth in data transmission procedure.
Brief description of the drawings
Technical scheme in order to illustrate the embodiments of the present invention more clearly, makes required in being described below to embodiment 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, other can also be obtained according to these accompanying drawings Accompanying drawing.
A kind of process schematic for data transfer that Fig. 1 provides for prior art;
Fig. 2 is a kind of process schematic for data transfer that the embodiment of the present invention 1 is provided;
Fig. 3 is a kind of process schematic for data transfer that the embodiment of the present invention 2 is provided;
A kind of Fig. 4 apparatus structure schematic diagrams of data transfer provided in an embodiment of the present invention.
Embodiment
Below in conjunction with accompanying drawing, the present invention is described in further detail, it is clear that described embodiment is only this The a part of embodiment of invention, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art exist The all other embodiment obtained under the premise of creative work is not made, the scope of protection of the invention is belonged to.
Embodiment 1:
Fig. 2 is a kind of process schematic of data transfer provided in an embodiment of the present invention, and the process comprises the following steps:
S201:Video data waiting for transmission is divided into multiple first sub-video datas, for each first sub-video number According to, determine the RTSP heads or RTP heads of first sub-video data, by described RTSP or RTP write kernel state in first Internal memory.
The method of data transfer provided in an embodiment of the present invention be applied to electronic equipment, the electronic equipment can be PC, The equipment such as intelligent television and mobile phone.
Electronic equipment finally sends data when carrying out data transmission by network interface card, and the size of data that network interface card is sent every time Have certain limitations, therefore when carrying out data transmission, it is necessary to which video data waiting for transmission is divided.Of the invention real Apply in example, for video data waiting for transmission, video data waiting for transmission can be divided into multiple first by the electronic equipment Sub-video data, when being divided, can arbitrarily divide video data waiting for transmission, as long as ensureing each the after dividing The size of data of one sub-video data disclosure satisfy that network interface card sends the size of data requirement of data every time.Certainly, in order to more Video data waiting for transmission is easily divided into multiple first sub-video datas, video data waiting for transmission can also be averaged Multiple first sub-video datas are divided into, make the size of data of each first sub-video data identical.
Preferably, the efficiency in order to improve data transfer, multiple first are averagely being divided into by video data waiting for transmission During sub-video data, the size of video data, enters to video data waiting for transmission in the data that can be every time sent according to network interface card Row is divided.
For example, video data is 1.4K to the maximum in the data that network interface card is sent every time, divided by video data waiting for transmission During for multiple first sub-video datas, video data waiting for transmission can arbitrarily be divided, as long as each first son after dividing The size of data of video data is not more than 1.4K;Of course, it is possible to which video data waiting for transmission is averagely divided into multiple One sub-video data, as long as the size of data of each first sub-video data after dividing is not more than 1.4K, such as each The size of data of sub-video data can be 0.8K, 1.0K, 1.3K etc..Preferably, video data waiting for transmission can be put down Multiple first sub-video datas are divided into, the size for making each first sub-video data is 1.4K.
Electronic equipment when carrying out data transmission, it is necessary to realize data transfer according to the RTSP of data heads or RTP, because This, after video data waiting for transmission is divided into multiple first sub-video datas, for each first sub-video data, it is determined that The RTSP heads or RTP heads of first sub-video data.Wherein, for each first sub-video data, first sub-video is determined The RTSP heads of data or the process of RTP belong to prior art, this process are not repeated in embodiments of the present invention.
Electronic equipment, by initialization, determines the first internal memory in kernel state, by the pin before carrying out data transmission The first internal memory in the RTSP heads determined to each first sub-video data or RTP write-in kernel states.
S202:Each first sub-video data is copied to the second internal memory in kernel state.
Electronic equipment determines to have the second internal memory that can store video data in kernel state in advance, is regarded for waiting for transmission Frequency copies each first sub-video data in kernel state to according to each first sub-video data obtained after division Second internal memory.
S203:For each first sub-video data, the first TCP header and the first IP of first sub-video data are determined Head, by the first internal memory in first TCP header and the first IP write-in kernel states.
Electronic equipment when carrying out data transmission, it is necessary to according to the first TCP header of data and the first IP realize data pass It is defeated.Therefore, after video data waiting for transmission is divided into multiple first sub-video datas, for each first sub-video number According to determining the first TCP header and the first IP heads of first sub-video data.General electronic equipment can be according to TCP and IP agreement Stack, determines the first TCP header and the first IP heads of first sub-video data.Wherein, for each first sub-video data, really First TCP header of fixed first sub-video data and the first process of IP belong to prior art, in embodiments of the present invention not This process is repeated.
Electronic equipment is it is determined that the first TCP header of each first sub-video data and the first is after IP, by the first TCP Head and the first IP write-ins are described by initializing, it is determined that kernel state in the first internal memory.Wherein, first TCP header and First IP heads, RTSP or RTP the first internal memories for being all stored in kernel state, but first TCP header and the first IP heads, The RTSP or RTP addresses in the first internal memory are different.
S204:For each first sub-video data, by address of first sub-video data in second internal memory And the RTSP heads of first sub-video data or RTP, the first TCP header and the first IP addresses in first internal memory The corresponding grid descriptor of the first sub-video data is write, so that address of the network interface card in grid descriptor, obtains correspondence RTSP heads or RTP, the first TCP header and the first IP and the first sub-video data and send.
During data transfer, each first sub-video data is corresponded in a grid descriptor, grid descriptor Record has the address of first sub-video data, and the RTSP heads of first sub-video data or RTP, corresponding first TCP header and the first address of IP, address of the network interface card in grid descriptor, obtain corresponding RTSP or RTP, correspondingly The first TCP header and the first IP and the first sub-video data and send.
Due in embodiments of the present invention, directly each first sub-video data is copied in second in kernel state Deposit, the RTSP heads or RTP heads of the first sub-video data, and the first TCP header and the first IP write-in kernel state the first internal memory In, although the RTSP heads of the first sub-video data or RTP, the first TCP header and the first IP and first sub-video data guarantor In the different address that there is internal memory, but network interface card accorded with according to network sweep in address, still can obtain first son and regard The RTSP heads of frequency evidence or RTP, the first TCP header and the first IP heads, and first sub-video data and send, therefore reduce Each first sub-video data copies the process of the internal memory of User space to, reduces the consumption of bandwidth in data transmission procedure.
Embodiment 2:
It is in embodiments of the present invention, described by institute on the basis of above-described embodiment in order to improve the efficiency of data transfer The first internal memory stated in RTSP or RTP write-in kernel states includes:
Judge the RTSP being had been written into the first internal memory heads or first data volume of RTP and the RTSP having been written into Head or RTP corresponding first sub-video data the second data volume and whether reach general segmentation offloading (Generic Segmentation Offload, GSO) the maximum of driving support traffic volume;
If not, the first internal memory that described RTSP or RTP is write in kernel state.
Electronic equipment can send first sub-video data every time, i.e., for be sent when carrying out data transmission The first sub-video data, by the RTSP heads of first sub-video data or RTP, the first TCP header and the first IP write-ins The first internal memory in core state, first sub-video data is copied to the second internal memory in kernel state, and then first son is regarded Frequency is according to the address in second internal memory and the RTSP heads of first sub-video data or RTP, the first TCP header and the The one IP address in first internal memory writes the corresponding grid descriptor of the first sub-video data so that network interface card according to Address in grid descriptor, obtains corresponding RTSP or RTP, the first TCP header and the first IP and the first sub-video Data Concurrent is sent.
In order to improve the efficiency of data transfer, in embodiments of the present invention, several first sub-videos can also be once sent Data.The specific process includes:Determine the RTSP heads that are had been written into the first internal memory or first data volume of RTP and The sum of second data volume of the RTSP heads of write-in or RTP corresponding first sub-video data, if first data volume and It is two data volumes and that not up to GSO drives maximum when supporting traffic volume, by determine first sub-video data RTSP heads or The first internal memory in RTP write-in kernel states.
When writing described RTSP or RTP the first internal memory in kernel state, as long as ensureing in the first internal memory The RTSP heads or first data volume of RTP of write-in and the RTSP heads having been written into or RTP corresponding first sub-video data It is the second data volume and maximum support traffic volume no more than what GSO drove.
For example, the maximum of GSO drivings supports traffic volume to be 64K, the size of data of each first sub-video data is 1.4K, Can be by the first internal memory in the RTSP heads or RTP write-in kernel states of 10 the first sub-video datas, can also be 20,30 Etc. the RTSP heads of the first sub-video data or RTP write-in kernel states in the first internal memories, as long as ensure the first internal memory in RTSP heads or first data volume of RTP and the RTSP heads having been written into or RTP corresponding first sub-video number through write-in According to it is the second data volume and maximum support traffic volume no more than what GSO drove.
When by the RTSP heads of each first sub-video data or RTP the first internal memories write in kernel states, need first Judge the RTSP being had been written into the first internal memory heads or first data volume of RTP and the RTSP heads having been written into or Maximum support traffic volume that is second data volume of RTP corresponding first sub-video data and whether reaching GSO drivings, if The first internal memory no, that described RTSP or RTP is write in kernel state.For example, by the 40th the first sub-video data During the first internal memory in RTSP or RTP write-in kernel states, judge to have been written into first internal memory 39 first are sub The RTSP heads or first data volume of RTP of video data and 39 RTSP or the RTP corresponding first sub-video number According to it is the second data volume and whether reach that the maximum of GSO drivings supports traffic volume, if it is not, then by the 40th the first sub-video The first internal memory in the RTSP heads of data or RTP write-in kernel states.
In embodiments of the present invention, if first data volume and the second data volume and reach the maximum of GSO drivings Traffic volume is supported, it is described to copy each first sub-video data to the second internal memory in kernel state and include:
Corresponding each first sub-video data of the RTSP heads being had been written into first internal memory or RTP is copied to The second internal memory in kernel state.
Electronic equipment can send first sub-video data every time, i.e., for be sent when carrying out data transmission The first sub-video data, by the RTSP heads of first sub-video data or RTP, the first TCP header and the first IP write-ins The first internal memory in core state, first sub-video data is copied to the second internal memory in kernel state, and then first son is regarded Frequency is according to the address in second internal memory and the RTSP heads of first sub-video data or RTP, the first TCP header and the The one IP address in first internal memory writes the corresponding grid descriptor of the first sub-video data so that network interface card according to Address in grid descriptor, obtains corresponding RTSP or RTP, the first TCP header and the first IP and the first sub-video Data Concurrent is sent.
In embodiments of the present invention, when the RTSP heads or first data volume of RTP being had been written into the first internal memory and Maximum branch that is second data volume of RTSP heads or RTP corresponding first sub-video data through write-in and reaching GSO drivings , can be by the corresponding each first sub-video number of the RTSP heads being had been written into first internal memory or RTP when holding traffic volume According to the second internal memory copied in kernel state, can so realize multiple first sub-video datas copied in kernel state Two internal memories, so as to improve the efficiency of data transfer.
In the corresponding each first sub-video data copy of the RTSP heads that will be had been written into first internal memory or RTP After the second internal memory into kernel state, for each first sub-video data, the first TCP header of first sub-video data is determined With the first IP heads, by first TCP header and the first IP write-in kernel states in the first internal memory, for each first sub-video Data, by the RTSP heads of address of first sub-video data in second internal memory and first sub-video data or RTP, the first TCP header and the first IP addresses in first internal memory write the corresponding network of the first sub-video data Descriptor, so that address of the network interface card in grid descriptor, obtains corresponding RTSP or RTP, the first TCP header and first IP and the first sub-video data are simultaneously sent.
For example, the maximum support traffic volume driven according to GSO, by the RTSP heads or RTP heads of 40 the first sub-video datas When writing the first internal memory in kernel state, reach that the maximum of GSO driving supports traffic volume, then by first internal memory RTSP heads or RTP corresponding 40 first sub-video data through write-in are copied in second in kernel state successively Deposit.
Further, since video data waiting for transmission is divided into multiple first sub-video datas by electronic equipment, for each First sub-video data, determines the RTSP heads or RTP heads of first sub-video data, if had been written into first internal memory RTSP heads or first data volume of RTP and the RTSP heads having been written into or RTP corresponding first sub-video data It is the second data volume and reach that the maximum of GSO drivings supports traffic volume, the RTSP heads that will be had been written into first internal memory Or RTP corresponding each first sub-video data copies the second internal memory in kernel state to.But when in write-in described first When RTSP heads in depositing or RTP is the RTSP heads of last the first sub-video data or RTP, it is possible to now in first The RTSP heads being had been written into depositing or first data volume of RTP and the RTSP heads having been written into or RTP corresponding It is second data volume of one sub-video data and that not up to GSO drives it is maximum support traffic volume, now also by described first Deposit the RTSP heads having been written into or RTP corresponding each first sub-video data copies the second internal memory in kernel state to.
In the corresponding each first sub-video data copy of the RTSP heads that will be had been written into first internal memory or RTP After the second internal memory into kernel state, the first sub-video data write in the second internal memory is sent, and judgement is It is no also to there is the first sub-video data not sent, if it is, first internal memory is initialized, determine successively not The RTSP heads or RTP heads of each first sub-video data are sent, by the RTSP heads or RTP heads of each first sub-video data When writing the first internal memory, judge the RTSP being had been written into the first internal memory heads or first data volume of RTP and described write Maximum branch that is second data volume of the RTSP heads entered or RTP corresponding first sub-video data and whether reaching GSO drivings Hold traffic volume;If not, by the RTSP heads of first sub-video data or RTP the first internal memories of write-in, if it is, by described the The RTSP heads being had been written into one internal memory or RTP corresponding each first sub-video data are copied in second in kernel state Deposit, and each first sub-video data for writing in the second internal memory, determine first sub-video data the first TCP header and First IP heads, by the first internal memory in first TCP header and the first IP write-in kernel states.
Fig. 3 is a kind of process schematic of data transfer provided in an embodiment of the present invention, and the process comprises the following steps:
S301:It is determined that the RTSP heads or RTP heads of current first sub-video data, wherein video data waiting for transmission is drawn It is divided into multiple first sub-video datas, current first sub-video data can be any one first sub-video number therein According to.
S302:Judge the RTSP being had been written into the first internal memory heads or first data volume of RTP and described have been written into RTSP heads or RTP corresponding first sub-video data maximum support that is the second data volume and whether reaching GSO drivings Traffic volume, if not, S303 is carried out, if it is, carrying out S305.
S303:By the first internal memory in the RTSP heads of first sub-video data or RTP write-in kernel states.
S304:Whether be last first sub-video data, if it is, carrying out if judging first sub-video data S305, if not, reading next first sub-video data, regard next first sub-video data as current first son Video data simultaneously returns to S301.
S305:By corresponding each first sub-video data of the RTSP heads being had been written into first internal memory or RTP Copy the second internal memory in kernel state to.
S306:For each first sub-video data in the second internal memory in the kernel state, determine that first son is regarded The first TCP header and the first IP heads of frequency evidence, by the first internal memory in first TCP header and the first IP write-in kernel states.
S307:For each first sub-video data in the second internal memory in the kernel state, by first sub-video The RTSP heads or RTP, the first TCP header and first of address and first sub-video data of the data in second internal memory The IP addresses in first internal memory write the corresponding grid descriptor of the first sub-video data, so that network interface card is according to net Address in network descriptor, obtains corresponding RTSP or RTP, the first TCP header and the first IP and the first sub-video number According to and send.
By the first TCP header and the first IP heads of each first sub-video data in the second internal memory in the kernel state Write after the first internal memory in kernel state, each first son in the second internal memory during the kernel state is sent by network interface card During video data, for each first sub-video data in the second internal memory in the kernel state, it is necessary to which first son is regarded Frequency is according to the address in second internal memory and the RTSP heads of first sub-video data or RTP, the first TCP header and the The one IP address in first internal memory writes the corresponding grid descriptor of the first sub-video data, so network interface card according to Address in grid descriptor, obtains corresponding RTSP or RTP, in the first TCP header and the first IP and kernel state The first sub-video data in second internal memory is simultaneously sent.
S308:First internal memory is initialized, step S303 is carried out.
Due in embodiments of the present invention, when the RTSP heads or first data volume of RTP that are had been written into the first internal memory And the second data volume of the RTSP heads having been written into or RTP corresponding first sub-video data and reach GSO driving most During big support traffic volume, by the corresponding each first sub-video number of the RTSP heads being had been written into first internal memory or RTP According to the second internal memory copied in kernel state, write multiple first sub-video datas in kernel state second can be so realized Internal memory, so as to improve the efficiency of data transfer.
Embodiment 3:
In order to further improve the efficiency of transmission of data, on the basis of the various embodiments described above, in embodiments of the present invention, It is described to copy corresponding each first sub-video data of the RTSP heads being had been written into first internal memory or RTP to kernel The second internal memory in state includes:
According to corresponding each first sub-video data of the RTSP heads being had been written into first internal memory or RTP, really The second TCP header and the 2nd IP heads of fixed second sub-video data to be packaged;
By corresponding each first sub-video data of the RTSP heads being had been written into first internal memory or RTP, and really Fixed the second TCP header and the 2nd IP be encapsulated as the second sub-video data, copy second sub-video data to kernel state In the second internal memory.
In the corresponding each first sub-video data copy of the RTSP heads that will be had been written into first internal memory or RTP During the second internal memory into kernel state, each first sub-video data can be successively copied in second in kernel state Deposit, can be according to the RTSP heads or RTP heads being had been written into first internal memory in order to further improve the efficiency of data transfer Corresponding each first sub-video data, determines the second TCP header and the 2nd IP heads of the second sub-video data to be packaged, typically Electronic equipment can be according to TCP and IP protocol stack, it may be determined that the second TCP header of second sub-video data to be packaged and 2nd IP heads.By corresponding each first sub-video data of the RTSP heads being had been written into first internal memory or RTP, and really Fixed the second TCP header and the 2nd IP be packaged, obtain the second sub-video data, and then second sub-video data is copied Second internal memory of the shellfish into kernel state.Wherein, second sub-video data to be packaged is determined according to TCP and IP protocol stack 2nd TCP and the 2nd process of IP belong to prior art, this process are not repeated in embodiments of the present invention.Follow-up When sending each first sub-video data by network interface card, second sub-video can be determined according to each RTSP or RTP head Each first sub-video data in data.
Due to the RTSP heads that will be had been written into first internal memory or RTP corresponding each first sub-video data, And the second TCP header for determining and the 2nd IP be encapsulated as the second sub-video data, second sub-video data is copied to interior The second internal memory in core state, so as to further increase the efficiency of data transfer.
In order that GSO drivings can recognize the video data for needing to accelerate processing, so as to ensure to carrying out accelerating processing During video data transmission, the second internal memory realized and write the second sub-video data in kernel state is driven using GSO, so as to improve The efficiency of data transfer, in embodiments of the present invention, second TCP header for determining the second sub-video data to be packaged and the After two IP, by corresponding each first sub-video data of the RTSP heads being had been written into first internal memory or RTP, and Determine the second TCP header and the 2nd IP be encapsulated as before the second sub-video data, methods described also includes:
Judge whether to carry out acceleration processing to second sub-video data to be packaged;
If it is, copying the described 2nd of determination the Type Of Service TOS field in IP to institute as original TOS fields The first internal memory is stated, the corresponding reserved place in the described 2nd of determination the TOS fields in IP is set to 1;
Second internal memory second sub-video data copied in kernel state includes:
Judge whether the corresponding reserved place in the determine the described 2nd TOS fields in IP is 1;
If it is, second sub-video data to be copied to the second internal memory in kernel state.
Electronic equipment is it is determined that the second TCP header of the second sub-video data to be packaged and the 2nd is after IP, and judgement is It is no that acceleration processing is carried out to second sub-video data to be packaged, if it is determined that to the second sub-video number to be packaged According to acceleration processing is carried out, then need second sub-video data to be packaged being marked, so that GSO drivings being capable of root It is to need at acceleration according to the second sub-video data to be packaged described in the marker recognition of second sub-video data to be packaged The video data of reason.
In embodiments of the present invention, second sub-video data is marked by the 2nd TOS fields in IP. What is utilized herein is that second sub-video data is marked for the reserved places of TOS fields, can either so make GSO driving energies Enough recognize second sub-video data to be packaged to need the video data for accelerating to handle, also do not interfere with follow-up to described The transmission of second sub-video data to be packaged.
It is determined that the 2nd after IP of second sub-video data to be packaged, in order to ensure during subsequent data transmission The correctness and integrality of agreement are, it is necessary to which the described 2nd of determination the TOS fields in IP are copied to as original TOS fields First internal memory, and the corresponding reserved place in the described 2nd of determination the TOS fields in IP is set to 1, described second The corresponding reserved place in TOS fields in IP as makes GSO drivings to recognize the second sub-video number to be packaged for 1 According to the mark for for needs accelerate processing.
In the second internal memory during second sub-video data to be copied to kernel state, described the determined is first determined whether Whether the corresponding reserved place in TOS fields in two IP is 1, if 1, then it is needs to illustrate second sub-video data Accelerate the video data of processing, then second sub-video data is copied to the second internal memory in kernel state to, if institute It is not 1 to state the corresponding reserved place in the 2nd TOS fields in IP, then can not be using GSO drivings to the second sub-video number According to acceleration processing is carried out, the transmission of data can only be now carried out by standard TCP and IP agreement.
TOS fields include two reserved places, and a certain reserved place in the TOS fields can be used in embodiments of the present invention It is identified, it would however also be possible to employ two reserved places are identified.But use in advance several and use which electronic equipment Know, therefore when accelerate processing, relative set can be carried out according to correspondence reserved place set in advance, and according to corresponding Reserved place judges whether to the copy of the second sub-video data.
Any one reserved place that can be preset in TOS fields is identified.Such as preset using TOS fields In reserved place the 6th be identified, then, will when judging accelerate processing to second sub-video data to be packaged The 6th of TOS fields is set to 1;In the second internal memory during second sub-video data to be copied to kernel state, judge true Whether the 6th in the fixed described 2nd TOS fields in IP be 1, if it is, second sub-video data is copied to The second internal memory in kernel state;Or the reserved place the 7th preset in use TOS fields is identified, then in judgement pair Second sub-video data to be packaged is carried out after acceleration processing, and 1 is set to by the 7th of TOS fields, by described second When sub-video data copies the second internal memory in kernel state to, the 7th in the determine the described 2nd TOS fields in IP is judged Whether position is 1, if it is, second sub-video data to be copied to the second internal memory in kernel state.
Preferably, in order to ensure that GSO drivings can accurately identify the video data for needing to accelerate processing, presetting use Reserved place in TOS fields the 6th and the 7th is identified, then is judging to enter second sub-video data to be packaged After row acceleration processing, 1 is set to by the 6th of TOS fields and the 7th, second sub-video data is being copied to kernel During the second internal memory in state, whether the 6th and the 7th in TOS fields in judge to determine the described 2nd IP be all for 1 When, if second sub-video data to be copied to the second internal memory in kernel state.
Due in embodiments of the present invention, when it is determined that accelerate processing to the video data waiting for transmission, passing through Corresponding reserved place in the described 2nd of the determination TOS fields in IP is set to 1, GSO drivings is recognized that needs add The video data of speed processing, second sub-video data is copied to the second internal memory in kernel state.Therefore it can ensure pair When accelerate the video data transmission of processing, for realizing and writing the second sub-video data in kernel state is driven using GSO Two internal memories, so as to improve the efficiency of data transfer.
In order to ensure to obtain corresponding RTSP or RTP, the first TCP header and the first IP and first by network interface card Sub-video data and when sending TCP and IP agreement correctness and integrality, it is in embodiments of the present invention, described for each the One sub-video data, determine first sub-video data the first TCP header and the first IP include:
Each first sub-video data that second sub-video data is included is determined, for each first sub-video number According to according to the data volume included in the RTSP of first sub-video data heads or RTP, to the 2nd TCP and the 2nd IP heads In the data volume that includes be updated, and according to the original TOS fields, to correspondence of the 2nd after the renewal in IP TOS fields are updated, using the second TCP header after renewal and the 2nd IP be used as the first of first sub-video data TCP header and the first IP heads.
Address of the network interface card in grid descriptor, obtains corresponding RTSP or RTP, the first TCP header and the first IP Head and the first sub-video data are simultaneously sent, it is thus necessary to determine that the first TCP header and the first IP of each first sub-video data Head.For the second sub-video data, it is determined that the second TCP header and the 2nd IP heads of the second sub-video data, for each One sub-video data, determines the first TCP header of first sub-video data and at the first IP, due to by video counts waiting for transmission According to being divided into after multiple first sub-video datas, for each first sub-video data, first sub-video data is determined RTSP or RTP heads, therefore, it can, according to each RTSP or RTP heads having been written into the first internal memory, determine that second son is regarded Frequency according to comprising each first sub-video data.First TCP header of each first sub-video data and the first number in IP It is different according to the data amount information of the second TCP header of amount information and the second sub-video data of the determination and the 2nd in IP, because This, it is determined that after each first sub-video data that second sub-video data is included, for each first sub-video number According to according to the data volume included in the RTSP of first sub-video data heads or RTP, to the 2nd TCP and the 2nd IP heads In the data volume that includes be updated.In order to ensure to obtain corresponding RTSP or RTP, the first TCP and first by network interface card IP and the first sub-video data and when sending TCP and IP agreement correctness and integrality, according to the original TOS words Section, is updated to corresponding TO S fields of the 2nd after the renewal in IP, by the second TCP header after renewal and the Two IP the first TCP header and the first IP heads as first sub-video data.
Due in embodiments of the present invention, each first sub-video data included for second sub-video data, According to the data volume included in the RTSP of first sub-video data heads or RTP, the 2nd TCP and the 2nd are wrapped in IP The data volume contained is updated, and according to the original TOS fields, to corresponding TO S word of the 2nd after the renewal in IP Section is updated, using the second TCP header after renewal and the 2nd IP the first TCP headers as first sub-video data with First IP heads.So as to ensure to obtain corresponding RTSP or RTP, the first TCP and the first IP and first sub by network interface card Video data and when sending TCP and IP agreement correctness and integrality.
A kind of Fig. 4 apparatus structure schematic diagrams of data transfer provided in an embodiment of the present invention, described device includes:
First writing module 41, for video data waiting for transmission to be divided into multiple first sub-video datas, for every Individual first sub-video data, determines real time streaming transport protocol RTSP or realtime transmission protocol RTP of first sub-video data Head, the first internal memory that described RTSP or RTP is write in kernel state;
Module 42 is copied, for each first sub-video data to be copied to the second internal memory in kernel state;
Second writing module 43, for for each first sub-video data, determining the first of first sub-video data Transmission control protocol TCP head and the first Internet Protocol IP heads, by first TCP header and the first IP write-in kernel states In the first internal memory;
3rd writing module 44, for for each first sub-video data, by first sub-video data described The RTSP heads of address and first sub-video data in two internal memories or RTP, the first TCP header and the first IP described Address in one internal memory writes the corresponding grid descriptor of the first sub-video data, so that network interface card is according in grid descriptor Address, obtains corresponding RTSP or RTP, the first TCP header and the first IP and the first sub-video data and sends.
First writing module 41, specifically for the RTSP heads for judging to have been written into the first internal memory or the of RTP Second data volume of one data volume and the RTSP heads having been written into or RTP corresponding first sub-video data and whether Reach that general the maximum of segmentation offloading GSO drivings supports traffic volume;If not, writing kernel state by described RTSP or RTP In the first internal memory.
The copy module 42, if specifically for first data volume and the second data volume and reach general segmentation Unload the maximum of GSO drivings and support traffic volume, the RTSP heads being had been written into first internal memory or RTP is corresponding each First sub-video data copies the second internal memory in kernel state to.
The copy module 42, specifically for according to the RTSP heads being had been written into first internal memory or RTP correspondences Each first sub-video data, determine the second TCP header and the 2nd IP heads of the second sub-video data to be packaged;By described The RTSP heads being had been written into one internal memory or RTP corresponding each first sub-video data, and the second TCP header determined and the Two IP is encapsulated as the second sub-video data, and second sub-video data is copied to the second internal memory in kernel state.
Described device also includes:
Setup module 45 is judged, for judging whether to carry out acceleration processing to second sub-video data to be packaged; If it is, the described 2nd of determination the Type Of Service TOS field in IP is copied in described first as original TOS fields Deposit, the corresponding reserved place in the described 2nd of determination the TOS fields in IP is set to 1;
The copy module 42, it is reserved specifically for the correspondence in the described 2nd TOS fields in IP that judge to determine Whether position is 1;If it is, second sub-video data to be copied to the second internal memory in kernel state.
Second writing module 43, specifically for determining each first sub-video that second sub-video data is included Data, for each first sub-video data, according to the data included in the RTSP of first sub-video data heads or RTP Amount, is updated to the data volume included in IP of the 2nd TCP and the 2nd, and according to the original TOS fields, to described The 2nd corresponding TO S fields in IP after renewal are updated, using the second TCP header after renewal and the 2nd IP as The first TCP header and the first IP heads of first sub-video data.
The embodiments of the invention provide a kind of method and device of data transfer, methods described includes:Regarded waiting for transmission Frequency, for each first sub-video data, determines first sub-video data according to multiple first sub-video datas are divided into Real time streaming transport protocol RTSP or realtime transmission protocol RTP head, first that described RTSP or RTP is write in kernel state Internal memory;Each first sub-video data is copied to the second internal memory in kernel state;For each first sub-video data, The the first transmission control protocol TCP head and the first Internet Protocol IP heads of first sub-video data are determined, by described The first internal memory in one TCP header and the first IP write-in kernel states;For each first sub-video data, by first sub-video The RTSP heads or RTP, the first TCP header and first of address and first sub-video data of the data in second internal memory The IP addresses in first internal memory write the corresponding grid descriptor of the first sub-video data, so that network interface card is according to net Address in network descriptor, obtains corresponding RTSP or RTP, the first TCP header and the first IP and the first sub-video number According to and send.Due in embodiments of the present invention, directly each first sub-video data is copied in second in kernel state Deposit, the RTSP heads or RTP heads of the first sub-video data, and the first TCP header and the first IP write-in kernel state the first internal memory In, although the RTSP heads of the first sub-video data or RTP, the first TCP header and the first IP and first sub-video data guarantor In the different address that there is internal memory, but network interface card accorded with according to network sweep in address, still can obtain first son and regard The RTSP heads of frequency evidence or RTP, the first TCP header and the first IP heads, and first sub-video data and send, therefore reduce Each first sub-video data copies the process of the internal memory of User space to, reduces the consumption of bandwidth in data transmission procedure.
The present invention is the flow with reference to method according to embodiments of the present invention, equipment (system) and computer program product Figure and/or block diagram are described.It should be understood that can be by every first-class in computer program instructions implementation process figure and/or block diagram Journey and/or the flow in square frame and flow chart and/or block diagram and/or the combination of square frame.These computer programs can be provided The processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce A raw machine so that produced by the instruction of computer or the computing device of other programmable data processing devices for real The device for the function of being specified in present one flow of flow chart or one square frame of multiple flows and/or block diagram or multiple square frames.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which is produced, to be included referring to Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or The function of being specified in multiple square frames.
These computer program instructions can be also loaded into 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 processing, thus in computer or The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one The step of function of being specified 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, appended 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 departing from the present invention to the present invention God and scope.So, if these modifications and variations of the present invention 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 including these changes and modification.

Claims (12)

1. a kind of method of data transfer, it is characterised in that methods described includes:
Video data waiting for transmission is divided into multiple first sub-video datas, for each first sub-video data, it is determined that should The real time streaming transport protocol of first sub-video data RTSP or realtime transmission protocol RTP head, described RTSP or RTP is write Enter the first internal memory in kernel state;
Each first sub-video data is copied to the second internal memory in kernel state;
For each first sub-video data, the first transmission control protocol TCP head and first of first sub-video data is determined Internet Protocol IP heads, by the first internal memory in first TCP header and the first IP write-in kernel states;
For each first sub-video data, by address of first sub-video data in second internal memory and this first The RTSP heads of sub-video data or RTP, the first TCP header and the first IP addresses in first internal memory write this first The corresponding grid descriptor of sub-video data so that address of the network interface card in grid descriptor, obtain corresponding RTSP or RTP, the first TCP header and the first IP and the first sub-video data are simultaneously sent.
2. the method as described in claim 1, it is characterised in that described to write described RTSP or RTP in kernel state First internal memory includes:
Judge the RTSP being had been written into the first internal memory heads or first data volume of RTP and the RTSP heads having been written into or Maximum branch that is second data volume of RTP corresponding first sub-video data and whether reaching general segmentation offloading GSO driving Hold traffic volume;
If not, the first internal memory that described RTSP or RTP is write in kernel state.
3. method as claimed in claim 2, it is characterised in that if first data volume and the second data volume and reach The maximum support traffic volume of general segmentation offloading GSO drivings, it is described to copy each first sub-video data to kernel state In the second internal memory include:
Copy corresponding each first sub-video data of the RTSP heads being had been written into first internal memory or RTP to kernel The second internal memory in state.
4. method as claimed in claim 3, it is characterised in that it is described by the RTSP heads being had been written into first internal memory or The second internal memory that RTP corresponding each first sub-video data is copied in kernel state includes:
According to corresponding each first sub-video data of the RTSP heads being had been written into first internal memory or RTP, it is determined that treating The second TCP header and the 2nd IP heads of second sub-video data of encapsulation;
By corresponding each first sub-video data of the RTSP heads being had been written into first internal memory or RTP, and determine Second TCP header and the 2nd IP be encapsulated as the second sub-video data, second sub-video data is copied in kernel state Second internal memory.
5. method as claimed in claim 4, it is characterised in that the second of the determination the second sub-video data to be packaged TCP header and the 2nd regards corresponding each first son of the RTSP heads being had been written into first internal memory or RTP after IP Frequency evidence, and determine the second TCP header and the 2nd IP be encapsulated as before the second sub-video data, methods described also includes:
Judge whether to carry out acceleration processing to second sub-video data to be packaged;
If it is, copying the described 2nd of determination the Type Of Service TOS field in IP to described as original TOS fields One internal memory, 1 is set to by the corresponding reserved place in the described 2nd of determination the TOS fields in IP;
Second internal memory second sub-video data copied in kernel state includes:
Judge whether the corresponding reserved place in the determine the described 2nd TOS fields in IP is 1;
If it is, second sub-video data to be copied to the second internal memory in kernel state.
6. method as claimed in claim 5, it is characterised in that described to be directed to each first sub-video data, determine this first The the first transmission control protocol TCP head and the first Internet Protocol IP of sub-video data include:
Each first sub-video data that second sub-video data is included is determined, for each first sub-video data, root According to the data volume included in the RTSP heads of first sub-video data or RTP, the 2nd TCP and the 2nd are included in IP Data volume be updated, and according to the original TOS fields, to corresponding TO S field of the 2nd after the renewal in IP Be updated, using the second TCP header after renewal and the 2nd IP be used as the first TCP header of first sub-video data and One IP heads.
7. a kind of device of data transfer, it is characterised in that described device includes:
First writing module, for video data waiting for transmission to be divided into multiple first sub-video datas, for each first Sub-video data, determines real time streaming transport protocol RTSP or realtime transmission protocol RTP head of first sub-video data, by institute State the first internal memory in RTSP or RTP write-in kernel states;
Module is copied, for each first sub-video data to be copied to the second internal memory in kernel state;
Second writing module, for for each first sub-video data, determining the first transmission control of first sub-video data Agreement TCP header processed and the first Internet Protocol IP heads, by the in first TCP header and the first IP write-in kernel states One internal memory;
3rd writing module, for for each first sub-video data, by first sub-video data in second internal memory In address and the RTSP heads of first sub-video data or RTP, the first TCP header and the first IP in first internal memory In address write the corresponding grid descriptor of the first sub-video data so that address of the network interface card in grid descriptor, Obtain corresponding RTSP or RTP, the first TCP header and the first IP and the first sub-video data and send.
8. device as claimed in claim 7, it is characterised in that first writing module, specifically for judging the first internal memory In the RTSP heads that have been written into or first data volume of RTP and the RTSP heads having been written into or RTP corresponding first Maximum support traffic volume that is second data volume of sub-video data and whether reaching general segmentation offloading GSO drivings;If not, The first internal memory that described RTSP or RTP is write in kernel state.
9. device as claimed in claim 8, it is characterised in that the copy module, if specifically for first data Amount and the second data volume and reach that the maximum of general segmentation offloading GSO driving supports traffic volume, by first internal memory RTSP heads or RTP corresponding each first sub-video data through write-in copy the second internal memory in kernel state to.
10. device as claimed in claim 9, it is characterised in that the copy module, specifically for according to first internal memory In the RTSP heads that have been written into or RTP corresponding each first sub-video data, determine the second sub-video data to be packaged The second TCP header and the 2nd IP heads;By corresponding each first son of the RTSP heads being had been written into first internal memory or RTP Video data, and determine the second TCP header and the 2nd IP be encapsulated as the second sub-video data, by second sub-video data Copy the second internal memory in kernel state to.
11. device as claimed in claim 10, it is characterised in that described device also includes:
Setup module is judged, for judging whether to carry out acceleration processing to second sub-video data to be packaged;If it is, The described 2nd of determination the Type Of Service TOS field in IP is copied to first internal memory as original TOS fields, will be true Corresponding reserved place in the fixed described 2nd TOS fields in IP is set to 1;
The copy module, specifically for the corresponding reserved place in the described 2nd TOS fields in IP that judge to determine whether For 1;If it is, second sub-video data to be copied to the second internal memory in kernel state.
12. device as claimed in claim 11, it is characterised in that second writing module, specifically for determining described the Each first sub-video data that two sub-video datas are included, for each first sub-video data, according to first sub-video The data volume included in the RTSP heads of data or RTP, is carried out more to the data volume included in IP of the 2nd TCP and the 2nd Newly, and according to the original TOS fields, corresponding TO S field of the 2nd after the renewal in IP is updated, will passed through The second TCP header and the 2nd IP the first TCP headers and the first IP heads as first sub-video data after renewal.
CN201710314176.8A 2017-05-05 2017-05-05 A kind of method and device of data transmission Active CN107222793B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710314176.8A CN107222793B (en) 2017-05-05 2017-05-05 A kind of method and device of data transmission

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710314176.8A CN107222793B (en) 2017-05-05 2017-05-05 A kind of method and device of data transmission

Publications (2)

Publication Number Publication Date
CN107222793A true CN107222793A (en) 2017-09-29
CN107222793B CN107222793B (en) 2019-11-19

Family

ID=59943961

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710314176.8A Active CN107222793B (en) 2017-05-05 2017-05-05 A kind of method and device of data transmission

Country Status (1)

Country Link
CN (1) CN107222793B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112153338A (en) * 2020-09-23 2020-12-29 平安国际智慧城市科技股份有限公司 Video distribution method and device, electronic equipment and storage medium
CN112953850A (en) * 2021-04-06 2021-06-11 腾讯科技(深圳)有限公司 Data transmission method and device, computer readable medium and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101340574A (en) * 2008-08-04 2009-01-07 中兴通讯股份有限公司 Method and system realizing zero-copy transmission of stream media data
CN101631128A (en) * 2009-08-19 2010-01-20 中兴通讯股份有限公司 Method and device for transmitting stream media data
CN101771599A (en) * 2008-12-26 2010-07-07 中国移动通信集团公司 Method and device for receiving RTP data packets
CN102256182A (en) * 2011-07-26 2011-11-23 重庆大唐科技股份有限公司 RTP (Real-time Transport Protocol)-based video stream fragment framing method
US20130188644A1 (en) * 2011-02-28 2013-07-25 Huawei Technologies Co., Ltd. Internet protocol multimedia subsystem network, and data transmission method and apparatus

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101340574A (en) * 2008-08-04 2009-01-07 中兴通讯股份有限公司 Method and system realizing zero-copy transmission of stream media data
CN101771599A (en) * 2008-12-26 2010-07-07 中国移动通信集团公司 Method and device for receiving RTP data packets
CN101631128A (en) * 2009-08-19 2010-01-20 中兴通讯股份有限公司 Method and device for transmitting stream media data
US20130188644A1 (en) * 2011-02-28 2013-07-25 Huawei Technologies Co., Ltd. Internet protocol multimedia subsystem network, and data transmission method and apparatus
CN102256182A (en) * 2011-07-26 2011-11-23 重庆大唐科技股份有限公司 RTP (Real-time Transport Protocol)-based video stream fragment framing method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112153338A (en) * 2020-09-23 2020-12-29 平安国际智慧城市科技股份有限公司 Video distribution method and device, electronic equipment and storage medium
CN112953850A (en) * 2021-04-06 2021-06-11 腾讯科技(深圳)有限公司 Data transmission method and device, computer readable medium and electronic equipment
CN112953850B (en) * 2021-04-06 2022-09-02 腾讯科技(深圳)有限公司 Data transmission method and device, computer readable medium and electronic equipment

Also Published As

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

Similar Documents

Publication Publication Date Title
US6988144B1 (en) Packet scheduling system and method for multimedia data
CN101841470B (en) High-speed capturing method of bottom-layer data packet based on Linux
US9152580B1 (en) Method and apparatus for transferring data between a host and an embedded device
US7561573B2 (en) Network adaptor, communication system and communication method
CN103581181B (en) Data packet capturing, processing and sending method and system
CN110086571A (en) A kind of data transmission and received method, apparatus and data processing system
CN112783455B (en) Data transmission control method, device, medium and electronic equipment
US11671678B2 (en) Method and device, equipment, and storage medium for data processing
CN111343148A (en) FGPA communication data processing method, system and device
CN103986763A (en) Vector data stream transmission method and system oriented to Web visualization
CN111641566B (en) Data processing method, network card and server
CN104378161A (en) FCoE protocol acceleration engine IP core based on AXI4 bus formwork
CN110944003B (en) File transmission method and electronic equipment
CN107222793B (en) A kind of method and device of data transmission
CN109688606B (en) Data processing method and device, computer equipment and storage medium
US6643710B1 (en) Architecture to fragment transmitted TCP packets to a requested window size
CN115905061B (en) Data transfer device, DMA device, electronic apparatus, and data transfer method
CN112614041A (en) Data driving method and device for sparse rendering, storage medium and electronic device
CN104303471A (en) Method and apparatus for providing content by selecting data acceleration algorithm
CN111726647A (en) Data distribution equipment and data processing system
CN106789917A (en) Data package processing method and device
CN108093047B (en) Data sending method and device, electronic equipment and middleware system
CN112614042A (en) Data driving method and device for delayed rendering of map
US20110283068A1 (en) Memory access apparatus and method
CN103927341B (en) A kind of method and device for obtaining scene information

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