WO2014205638A1 - 一种数据包传输方法及设备 - Google Patents

一种数据包传输方法及设备 Download PDF

Info

Publication number
WO2014205638A1
WO2014205638A1 PCT/CN2013/077831 CN2013077831W WO2014205638A1 WO 2014205638 A1 WO2014205638 A1 WO 2014205638A1 CN 2013077831 W CN2013077831 W CN 2013077831W WO 2014205638 A1 WO2014205638 A1 WO 2014205638A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
cache
address space
address information
address
Prior art date
Application number
PCT/CN2013/077831
Other languages
English (en)
French (fr)
Inventor
陈卫
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2013/077831 priority Critical patent/WO2014205638A1/zh
Priority to CN201380002426.4A priority patent/CN104396195A/zh
Publication of WO2014205638A1 publication Critical patent/WO2014205638A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches

Definitions

  • the present invention relates to the field of communications, and in particular, to a data packet transmission method and device. Background technique
  • the processing efficiency of each part of the data included in a data packet is different, and some parts of the data require high processing efficiency, that is, the part of the data needs to access the data cache with high efficiency to cache the part of the data, and the data packet is Some of the data is insensitive to processing efficiency, allowing this portion of the data to be cached in a less efficient data cache. Now all the data is cached in a data cache, that is, all the data of a data packet is stored in a data cache, which will result in some data and processing efficiency that is insensitive to processing efficiency.
  • the data is stored in the data cache with high access efficiency, and the cache space of the data cache with high access efficiency is very small, so the data packet will occupy too much cache space of the data cache with high efficiency, resulting in the communication device.
  • the other modules of the chip occupy less buffer space for accessing the data cache, so that the overall performance of the communication device processing data is reduced.
  • some data that is insensitive to processing efficiency and some data that requires high processing efficiency are stored in a data cache with low access efficiency, so that data with high processing efficiency cannot be efficiently cached, that is, communication device processing The overall performance of the processed data is reduced.
  • the embodiment of the present invention provides a data packet transmission method and device, which can improve the comprehensive performance of processing data of the communication device.
  • a data packet transmission method provided by an embodiment of the present invention includes:
  • the parsing the data packet to obtain the first data and the second data includes:
  • Parsing the data packet to obtain parsed data and extracting data of length N from the start position of the parsed data as the first data, and using all data except the first data in the parsed data as the first Two data;
  • the N is an integer specified by the preset to be greater than zero, or the N is an integer greater than zero indicated by the indication information carried by the sending end by the sending end.
  • the first address information of the first address space that is to be cached by the second data is cached And saving the first data to the first data cache, including:
  • the second address space is a pre-designated address space
  • the method further includes:
  • the acquiring the first data and the first address information in the first data cache including:
  • the first address information of the first address space that is to be cached by the second data is cached And saving the first data to the first data cache, including:
  • the obtaining the first data and the first address information in the first data cache includes:
  • the first data includes at least two first sub-data
  • the saving the first address information of the first address space of the second data and the first data to the first data cache includes:
  • the address space corresponding to the first sub-data is a pre-designated address space, or the address space corresponding to the first sub-data is an address space indicated by a cache descriptor of the data packet.
  • a fifth possible implementation manner of the first aspect when the data processing needs to be performed on the first data and the second data, Decoding the first data and the first address information in the first data cache, and acquiring the second data in the second data cache according to the first address information, and the first data Data processing with the second data, including:
  • the target layer needs to perform data processing on the first data and the second data, acquiring first sub-data and the first address information corresponding to the target layer in the first data cache, and then Acquiring the second data in the second data cache according to the first address information, and performing data processing on the first sub data and the second data corresponding to the target layer.
  • an embodiment of the present invention provides a data packet transmission device, including: a receiving unit, an analyzing unit, a buffer unit, and a processing unit, where:
  • the receiving unit is configured to receive a data packet sent by the sending end
  • the parsing unit is configured to parse the data packet to obtain first data and second data, where the processing efficiency of the first data requirement is higher than the processing efficiency of the second data requirement;
  • the buffer unit is configured to save the second data to the second data cache, and save the first address information of the first address space that caches the second data and the first data to the first data cache
  • the access efficiency of the first data cache is higher than the access efficiency of the second data cache
  • the processing unit is configured to: when data processing is required on the first data and the second data, Obtaining the first data and the first address information in the first data cache, and acquiring the second data in the second data cache according to the first address information, and acquiring the second data A data and the second data are processed for data.
  • the parsing unit is configured to parse the data packet to obtain parsed data, and intercept data of length N as the first data from a starting position of the parsing data. And all data except the first data in the parsed data is used as the second data;
  • the N is an integer specified by the preset to be greater than zero, or the N is an integer greater than zero indicated by the indication information carried by the sending end by the sending end.
  • the cache unit is specifically configured to save the first data to the first data cache a second address space, and updating the first address information of the first address space of the second data to a pre-designated location in the first data; wherein the second address space is pre-designated Address space
  • the device also includes:
  • An adding unit configured to add second address information of the second address space in a completion message for indicating completion of receipt of the data packet; or for adding the second address to a receiving descriptor of the data packet Second address information of the space;
  • the processing unit is configured to acquire the first data and the first address information in the second address space according to the second address information included in the completion message or the receiving descriptor.
  • the cache unit is specifically configured to save the first data to the first data cache a third address space, and updating the first address information of the first address space of the second data to a pre-specified location in the first data; wherein the third address space is the data packet The address space indicated by the cache descriptor;
  • the processing unit is configured to acquire the first data and the first address information in the third address space according to the cache descriptor.
  • the first data includes at least two first sub-data
  • the buffer unit is configured to save each of the first sub-data to an address space corresponding to the first sub-data in the first data cache, and cache the first address space of the second data.
  • the address information is updated to a pre-designated location in each of the first sub-data;
  • the address space corresponding to the first sub-data is a pre-designated address space, or the address space corresponding to the first sub-data is an address space indicated by a cache descriptor of the data packet.
  • the processing unit is specifically configured to: when the target layer needs to use the first data and the second Obtaining, in the data processing, the first sub-data and the first address information corresponding to the target layer in the first data cache, and acquiring the second data cache according to the first address information. The second data, and performing data processing on the first sub data and the second data corresponding to the target layer.
  • an embodiment of the present invention provides a data packet transmission device, including: a communication interface and a storage a memory, and a processor coupled to the communication interface and the memory, the memory storing a set of program codes, the processor for calling the program stored by the memory to perform the following operations:
  • the performing, by the processor, the parsing the data packet to obtain the first data and the second data includes:
  • Parsing the data packet to obtain parsed data and extracting data of length N from the start position of the parsed data as the first data, and using all data except the first data in the parsed data as the first Two data;
  • the N is an integer specified by the preset to be greater than zero, or the N is an integer greater than zero indicated by the indication information carried by the sending end by the sending end.
  • the performing, by the processor, the first address space of the second data to be cached includes:
  • the second address space is a pre-designated address space
  • the processor is configured to save the first data to a second address space of the first data cache, and update the first address information of the first address space of the second data to the first data After the operation of the pre-specified location, before performing the operation of acquiring the first data and the first address information in the first data cache, the following operations are also performed: Adding second address information of the second address space in a completion message for indicating completion of the data packet reception; or adding second address information of the second address space to a reception descriptor of the data packet;
  • the operation of the processor to obtain the first data and the first address information in the first data cache includes:
  • the performing, by the processor, the first address space of the second data to be cached includes:
  • the third address space is an address space indicated by a cache descriptor of the data packet
  • the operation of the processor to obtain the first data and the first address information in the first data cache includes:
  • the first data includes at least two first sub-data
  • the operation performed by the processor to save the first address information of the first address space of the second data and the first data to the first data cache includes:
  • the address space corresponding to the first sub-data is a pre-designated address space, or the address space corresponding to the first sub-data is an address space indicated by a cache descriptor of the data packet.
  • the processor performs data processing on the first data and the second data Obtaining the first data and the first address information in the first data cache, and then according to The obtaining, by the first address information, the second data in the second data cache, and performing data processing on the first data and the second data, includes:
  • the target layer needs to perform data processing on the first data and the second data, acquiring first sub-data and the first address information corresponding to the target layer in the first data cache, and then Acquiring the second data in the second data cache according to the first address information, and performing data processing on the first sub data and the second data corresponding to the target layer.
  • the data included in the data packet is parsed into the first data and the second data, and the processing efficiency required by the first data is higher than the processing efficiency required by the second data, and the second data is saved to the second data cache. And saving the first address information of the first address space of the second data and the first data to the first data cache, and the access efficiency of the first data cache is higher than the access efficiency of the second data cache; Acquiring the first data in the first data cache, and acquiring the second data in the second data cache, and performing data processing on the first data and the second data.
  • the processing efficiency when the first data processing is performed is higher than the processing efficiency when the second data is processed, the processing efficiency required to satisfy the first data requirement, and the processing efficiency satisfying the second data requirement, thereby realizing the requirement.
  • Data with different processing efficiency is saved to a data cache of different access efficiency to improve the performance of processing data.
  • FIG. 1 is a schematic flowchart of a data packet transmission method according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of another data packet transmission method according to an embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of another data packet transmission device according to an embodiment of the present invention
  • FIG. 5 is a schematic structural diagram of another data packet transmission device according to an embodiment of the present invention.
  • FIG. 1 is a schematic flowchart of a data packet transmission method according to an embodiment of the present invention. As shown in FIG. 1, the method includes the following steps:
  • the data packet can be any form of data packet, for example: a message transmission (MSG) data packet, or a data stream transmission (DS) data packet.
  • the receiving packet sent by the transmitting end may be a data packet sent by the transmitting end through a serial high speed interface (Serial Rapid 10, sRIO).
  • the step may specifically be: parsing the data packet to obtain parsed data, and then splitting the parsed data into the first data and the second data.
  • the data of the data packet may be split into the first data and the second data according to the processing efficiency required by each part of the data packet.
  • the access efficiency of the first data cache is higher than the access efficiency of the second data cache.
  • the first address information may be combined with the first data and saved to the first data cache.
  • the first data, the first address information, and the second data may be buffered in a circular buffer manner, that is, the first data cache and the second data cache may be cyclic data caches.
  • the cache order of the first data and the second data is not limited, that is, the second data may be saved to the second data cache, and then the second data may be cached.
  • the first address information of an address space and the first data are saved to the first data cache.
  • the method may further save the first data to the first data cache, save the second data to the second data cache, and save the first address information of the first address space that caches the second data to the cache.
  • the address space of a data Obtaining, when data processing is performed on the first data and the second data, acquiring the first data and the first address information in the first data cache, and then according to the first address The information acquires the second data in the second data cache, and performs data processing on the first data and the second data.
  • the data processing of the first data and the second data may be performed by the application layer for data processing of the first data and the second data, or by the transport layer for data processing of the first data and the second data, and other
  • the layer performs data processing on the first data and the second data. Since the access efficiency of the first data cache is higher than the access efficiency of the second data cache, the processing efficiency when processing the first data is higher than the processing efficiency when processing the second data to meet the first data requirement. Processing efficiency, and processing efficiency that meets the requirements of the second data, thereby improving the performance of processing data.
  • the above method can be implemented in any communication device having a function of data packet transmission and buffering data, that is, the communication device can implement the method.
  • DMA Direct Access Access
  • the data included in the data packet is parsed into the first data and the second data, and the processing efficiency required by the first data is higher than the processing efficiency required by the second data, and the second data is saved to the second data cache. And saving the first address information of the first address space of the second data and the first data to the first data cache, and the access efficiency of the first data cache is higher than the access efficiency of the second data cache; Acquiring the first data in the first data cache, and acquiring the second data in the second data cache, and performing data processing on the first data and the second data.
  • FIG. 2 is a schematic flowchart of another data packet transmission method according to an embodiment of the present invention. As shown in FIG. 2, the method includes:
  • the step may be that the sRIO device receives the data packet sent by the sending end, or receives the data packet sent by the sending end through a physical channel in the sRIO device. 202. Parse the data packet to obtain parsed data, and intercept the parsing into the first data and the second data, where the processing efficiency of the first data requirement is higher than the processing efficiency required by the second data.
  • the header data of the data packet is used as the first data, and the other remaining data is used as the second data.
  • the data of length N is intercepted from the start position of the parsed data as the first data, and all data except the first data in the parsed data is used as the second data;
  • the N is an integer specified by the preset to be greater than zero.
  • N is an integer specified by the communication device that is greater than zero, and may be an integer greater than zero specified by the communication device of the method; or an integer greater than zero specified in different physical channels in the communication device implementing the method, that is, Different physical channels can be pre-specified with different Ns. That is, the position of the first data and the second data of all the data packets received by the communication device that implements the method in the parsed data after parsing the data packet may be unified in advance. Or pre-uniformly indicating the location of the first data and the second data of the data packet received by each physical channel of the communication device implementing the method in the parsed data after parsing the data packet.
  • the N may further send, by the sending end, an integer greater than zero indicated by the indication information carried by the data packet. That is, the indication information in the data packet transmitted by the transmitting end indicates the position of the first data and the second data in the parsed data after the packet parsing.
  • the packet header data of the data packet needs to be processed in various ways during data processing, for example, data processing such as authentication, identification, authentication, etc., that is, the processing efficiency of the packet header data requirement of the data packet is generally higher than that.
  • Other data for the packet such as payload data.
  • the header data is generally located in front of the parsed data after the parsing of the packet, that is, the header data of the packet can be used as the first data by the above method.
  • the first data is not limited in this embodiment, that is, the first data may be header data or other first data that satisfies requirements.
  • step 203 When data processing is performed on the first data and the second data, acquiring the first data and the first address information in the first data cache, and then according to the first address The information acquires the second data in the second data cache, and performs data processing on the first data and the second data.
  • saving the first address information of the first address space of the second data and the first data to the first data cache in step 203 may include:
  • the second address space is a pre-designated address space, and may be an address space uniformly designated in the communication device that implements the method, or an address space specified in a different physical channel in the communication device that implements the method, that is, each The second address space specified in the physical channels can be different.
  • the method may further include: adding the second address information of the second address space to the completion message indicating that the data packet is received; or The receive descriptor of the data packet increases second address information of the second address space. That is, the second address information may be carried in the completion message or the second address information may be carried in the received descriptor.
  • the obtaining the first data and the first address information in the first data cache in step 204 may include:
  • the foregoing completion message or the receiving descriptor may be transmitted to the application layer, and the application layer acquires the second address space according to the second address information included in the completion message or the receiving descriptor. Decoding the first data and the first address information, and acquiring the second data, and performing data processing on the first data and the second data.
  • the saving the first address information of the first address space of the second data and the first data to the first data cache in step 203 may include:
  • the third address space is a buffer descriptor (Buffer Descriptor, BD) of the data packet.
  • the indicated address space That is, the BD of the data packet will contain a third address space of the first data cache for buffering the first data of the data packet. Specifically, when a BD is allocated for the data packet, a buffer space for buffering the first data of the data packet is allocated.
  • the obtaining the first data and the first address information in the first data cache in step 204 may include:
  • the application layer acquires the first data and the first address information according to the address information of the BD for indicating the third address space, and performs data processing on the first data and the second data.
  • the foregoing first data may include at least two first sub-data; for example, the data of the length N1 is intercepted from the start position of the parsed data as the first sub-data, and the A sub-data corresponds to a layer in the Transmission Control Protocol (TCP) / Internet Protocol (IP) layer or the Open System Interconnection (OSI) layer (for example: with the application layer)
  • TCP Transmission Control Protocol
  • IP Internet Protocol
  • OSI Open System Interconnection
  • the data of length N2 is intercepted from the beginning position of the parsed data as another first sub-data
  • the first sub-data corresponds to another layer in the TCP/IP layer or the 0SI layer (for example: The transport layer corresponds to)
  • data of length N3 may be intercepted from the start position of the parsed data as another first sub-data.
  • Nl, N2 and N3 are all integers greater than zero.
  • the saving of the first address information of the first address space of the second data and the first data to the first data cache in step 203 may include:
  • the address space corresponding to the first sub-data is a pre-designated address space, or the address space corresponding to the first sub-data is an address space indicated by the BD of the data packet.
  • step 204 may include:
  • the target layer is not limited in this embodiment, and may be different layers for different applications, for example, the target layer is any one of a TCP/IP layer or an OSI layer, for example, an application layer or a transport layer. .
  • the first sub-data corresponding to different layers is different data, for example:
  • the application layer processes data
  • only the first N1 data requirements in the parsed data of the data packet are required.
  • the processing efficiency is high, so that the first N1 bit data can be used as the first sub data, and the first sub data is saved to an address space of the first data cache.
  • the transport layer processes the data
  • only the first N2 bit data in the parsed data of the data packet requires high processing efficiency, so that the first N2 bit data can be used as the first sub data, and the first sub data is saved to the above.
  • An address space of the first data cache is used to the first sub data, and the first sub-data corresponding to different layers.
  • the address information may be the first address information, that is, the address information includes only the first address information of the address space, for example, the first address information may be the first of the first address space.
  • the address information that is, the first address information is the information of the first address of the first address space or the address information of the previous part of the first address space.
  • the second address information may specifically be the first address information of the second address space.
  • a device or DMA connected to an Ethernet device may be a communication device having a data packet transmission function and a cache data function, such as a computer, a server, a mobile phone, a tablet computer, and an in-vehicle device.
  • FIG. 3 is a schematic structural diagram of a data packet transmission device according to an embodiment of the present invention, as shown in FIG. 3
  • the receiving unit 31 includes a receiving unit 31, a parsing unit 32, a buffer unit 33, and a processing unit 34.
  • the receiving unit 31 is configured to receive a data packet sent by the sending end.
  • the data packet can be any form of data packet, such as: MSG data packet, or DS data packet.
  • the data packet sent by the receiving sender may be a data packet sent by the sending end through the sRIO.
  • the parsing unit 32 is configured to parse the data packet to obtain first data and second data, where the processing efficiency of the first data requirement is higher than the processing efficiency of the second data requirement.
  • the parsing unit 32 may parse the data packet to obtain parsed data, and then split the parsed data into the first data and the second data. Specifically, the data of the data packet is split into the first data and the second data according to the processing efficiency required by each part of the data packet.
  • the buffer unit 33 is configured to save the second data to the second data cache, and save the first address information of the first address space that caches the second data and the first data to the first data cache;
  • the access efficiency of the first data cache is higher than the access efficiency of the second data cache.
  • the first address information is combined with the first data and saved to the first data cache.
  • the first data, the first address information, and the second data may be buffered in a circular buffer manner, that is, the first data cache and the second data cache may be cyclic data caches.
  • the cache order of the first data and the second data is not limited, that is, the second data may be saved to the second data cache, and then the second data may be cached.
  • the first address information of an address space and the first data are saved to the first data cache.
  • the method may further save the first data to the first data cache, save the second data to the second data cache, and save the first address information of the first address space that caches the second data to the cache.
  • the address space of a data is not limited, that is, the second data may be saved to the second data cache, and then the second data may be cached.
  • the first address information of an address space and the first data are saved to the first data cache.
  • the method may further save the first data to the first data cache, save the second data to the second data cache, and save the first address information of the first address space that caches the second data to the cache.
  • the address space of a data is not limited, that is, the second data may be saved to the second data cache, and then the second data may be cached.
  • the processing unit 34 is configured to: when the data processing needs to be performed on the first data and the second data, acquire the first data and the first address information in the first data cache, and then The first address information acquires the second data in the second data cache, and performs data processing on the first data and the second data.
  • the data processing of the first data and the second data may be performed by the application layer for data processing of the first data and the second data, or by the transport layer for data processing of the first data and the second data, and other
  • the layer performs data processing on the first data and the second data. Due to the first data cache
  • the access efficiency is higher than the access efficiency of the second data cache, so that the processing efficiency when processing the first data is higher than the processing efficiency when processing the second data, to meet the processing efficiency of the first data requirement, and satisfying The processing efficiency required by the second data, thereby improving the performance of processing data.
  • the above device may be any communication device having a function of data packet transmission and buffering data.
  • a device or DMA connected to an Ethernet device may be a communication device having a data packet transmission function and a cache data function, such as a computer, a server, a mobile phone, a tablet computer, and an in-vehicle device.
  • the data included in the data packet is parsed into the first data and the second data, and the processing efficiency required by the first data is higher than the processing efficiency required by the second data, and the second data is saved to the second data cache. And saving the first address information of the first address space of the second data and the first data to the first data cache, and the access efficiency of the first data cache is higher than the access efficiency of the second data cache; Acquiring the first data in the first data cache, and acquiring the second data in the second data cache, and performing data processing on the first data and the second data.
  • FIG. 4 is a schematic structural diagram of another data packet transmission device according to an embodiment of the present invention. As shown in FIG. 4, the method includes: a receiving unit 41, a parsing unit 42, a buffer unit 43, and a processing unit 44, where: a receiving unit 41, Used to receive packets sent by the sender.
  • the receiving unit 41 may specifically receive the data packet sent by the transmitting end through the sRIO device, or receive the data packet sent by the transmitting end through a physical channel in the sRIO device.
  • the parsing unit 42 is configured to parse the data packet to obtain parsed data, and the parsing is performed as the first data and the second data, where the processing efficiency of the first data request is higher than the processing of the second data request effectiveness.
  • the parsing unit 42 may be specifically configured to use the header data of the data packet as the first data and the other remaining data as the second data. Or the parsing unit 42 may be configured to parse the data packet to obtain parsed data, and intercept data of length N from the start position of the parsed data as the first data, and divide the parsed data into the first data. All data except data is used as the second data;
  • the N is an integer specified by the preset to be greater than zero. N is the preset specified greater than zero
  • the number may be an integer greater than zero uniformly specified by the device; or an integer greater than zero specified in different physical channels in the device, that is, different physical channels may specify different Ns in advance. That is, the location of the first data and the second data of all the data packets received by the device in the parsed data after the parsing of the data packet may be unified in advance. Or pre-uniformly indicating the location of the first data and the second data of the data packet received by each physical channel of the device in the parsed data after the parsing of the data packet.
  • the N may further send, by the sending end, an integer greater than zero indicated by the indication information carried by the data packet. That is, the indication information in the data packet transmitted by the transmitting end indicates the position of the first data and the second data in the parsed data after the packet parsing.
  • the packet header data of the data packet needs to be processed in various ways during data processing, for example, data processing such as authentication, identification, authentication, etc., that is, the processing efficiency of the packet header data requirement of the data packet is generally higher than that.
  • Other data for the packet such as payload data.
  • the header data is generally located in front of the parsed data after the parsing of the packet, that is, the header data of the packet can be used as the first data by the above method.
  • the first data is not limited in this embodiment, that is, the first data may be header data or other first data that satisfies requirements.
  • the buffer unit 43 is configured to save the second data to the second data cache, and save the first address information of the first address space of the second data and the first data to the first data cache;
  • the access efficiency of the first data cache is higher than the access efficiency of the second data cache.
  • the processing unit 44 is configured to: when the data processing needs to be performed on the first data and the second data, acquire the first data and the first address information in the first data cache, and then The first address information acquires the second data in the second data cache, and performs data processing on the first data and the second data.
  • the cache unit 43 may be specifically configured to save the first data to a second address space of the first data cache, and cache the first address space of the second data.
  • the address information is updated to a pre-designated location in the first data; wherein the second address space is a pre-designated address space. Updating the first address information to the pre-designated location in the first data may specifically be: loading the first address information to the front or the back of the first data, or loading the first address information to an intermediate location of the first data, That is, the first address information and the first data constitute a data saved to the second address space of the first data cache.
  • the second address space is a pre-designated address space, and may be a uniformly specified address space in the device, or different objects in the device.
  • the address space specified in the physical channel, that is, the second address space specified in each physical channel may be different.
  • the device may further include:
  • An adding unit for adding second address information of the second address space in a completion message for indicating completion of receipt of the data packet; or for receiving the data packet
  • the descriptor increases the second address information of the second address space.
  • the foregoing completion message or the receiving descriptor may be transmitted to the application layer, and the application layer acquires the second address space according to the second address information included in the completion message or the receiving descriptor. Decoding the first data and the first address information, and acquiring the second data, and performing data processing on the first data and the second data.
  • the processing unit 44 is specifically configured to acquire the first data and the first address information in the second address space according to the second address information included in the completion message or the receiving descriptor.
  • the cache unit 43 may be further configured to save the first data to a third address space of the first data cache, and cache the first address space of the second data.
  • An address information is updated to a pre-designated location in the first data; wherein the third address space is an address space indicated by a BD of the data packet. That is, the BD of the data packet will contain a third address space for buffering the first data cache of the first data of the data packet. Specifically, when a BD is allocated for the data packet, a buffer space for buffering the first data of the data packet is allocated.
  • the processing unit may be further configured to acquire the first data and the first address information in the third address space according to the BD.
  • the foregoing first data may include at least two first sub-data; for example, the data of the length N1 is intercepted from the start position of the parsed data as the first sub-data, and the A sub-data corresponds to one of the 1 ⁇ ?/1? layer or the 081 layer (for example, corresponding to the application layer), and the data of length N2 is intercepted from the start position of the parsed data as another first sub- Data, the first sub-data corresponds to another layer in the TCP/IP layer or the OSI layer (for example, corresponding to the transport layer). Similarly, the length of the parsed data may be intercepted from the start position of the parsed data. The data is used as another first subdata.
  • the cache unit 43 may be further configured to save each of the first sub-data to an address space corresponding to the first sub-data in the first data cache, and cache the first address space of the second data. An address information is updated to a pre-designated location in each of the first sub-data;
  • the address space corresponding to the first sub-data is a pre-designated address space, or the address space corresponding to the first sub-data is an address space indicated by the BD of the data packet.
  • the processing unit 44 is further configured to: when the target layer needs to perform data processing on the first data and the second data, acquire, in the first data cache, corresponding to the target layer. And acquiring, by the first sub-data and the first address information, the second data in the second data cache according to the first address information, and the first sub-data corresponding to the target layer Data processing is performed with the second data.
  • the target layer is not limited in this embodiment, and may be different layers for different applications, for example, the target layer is any one of a TCP/IP layer or an OSI layer, for example, an application layer or a transport layer. . In this way, different layers can read different first sub-data, and the first sub-data corresponding to different layers is different data.
  • the application layer processes data
  • only the first N1 data requirements in the parsed data of the data packet are required.
  • the processing efficiency is high, so that the first N1 bit data can be used as the first sub data, and the first sub data is saved to an address space of the first data cache.
  • the transport layer processes the data
  • only the first N2 bit data in the parsed data of the data packet requires high processing efficiency, so that the first N2 bit data can be used as the first sub data, and the first sub data is saved to the above.
  • An address space of the first data cache is used to the first data cache.
  • the address information may be the first address information, that is, the address information includes only the first address information of the address space, for example, the first address information may be the first of the first address space.
  • the address information that is, the first address information is the information of the first address of the first address space or the address information of the previous part of the first address space.
  • the second address information may specifically be the first address information of the second address space.
  • a device or DMA connected to an Ethernet device may be a communication device having a data packet transmission function and a cache data function, such as a computer, a server, a mobile phone, a tablet computer, and an in-vehicle device.
  • FIG. 5 is a schematic structural diagram of another data packet transmission device according to an embodiment of the present invention.
  • the device includes: a communication interface 51 and a memory 52, and a processor 53 connected to the communication interface 51 and the memory 52.
  • 52 stores a set of program codes
  • the processor 53 is configured to call the program stored in the memory 52 to perform the following operations:
  • the foregoing data packet may be any type of data packet, for example, an MSG data packet, or a DS data packet.
  • the data packet sent by the receiving sender may be a data packet sent by the sending end through the sRIO.
  • the processor 53 may specifically analyze the data packet to obtain the parsed data, and then split the parsed data into the first data and the second data. Specifically, the data of the data packet is split into the first data and the second data according to the processing efficiency required by each part of the data packet.
  • the processor 53 may specifically combine the first address information with the first data and save to the first data cache.
  • the first data, the first address information, and the second data may be buffered in a circular buffer manner, that is, the first data cache and the second data cache may be a loop data cache.
  • the cache order of the first data and the second data is not limited, that is, the second data may be saved to the second data cache, and then the second data may be cached.
  • the first address information of an address space and the first data are saved to the first data cache. It is also possible to save the first data to the first data cache, and then save the second data to the second data cache, and then The first address information of the first address space storing the second data is saved to an address space for buffering the first data.
  • the data processing of the first data and the second data may be performed by the application layer for data processing of the first data and the second data, or by the transport layer for data processing of the first data and the second data, and other
  • the layer performs data processing on the first data and the second data. Since the access efficiency of the first data cache is higher than the access efficiency of the second data cache, the processing efficiency when processing the first data is higher than the processing efficiency when processing the second data to meet the first data requirement. Processing efficiency, and processing efficiency that meets the requirements of the second data, thereby improving the performance of processing data.
  • the operation performed by the processor 53 to parse the data packet to obtain the first data and the second data may include:
  • Parsing the data packet to obtain parsed data and extracting data of length N from the start position of the parsed data as the first data, and using all data except the first data in the parsed data as the first Two data;
  • the N is an integer specified by the preset to be greater than zero.
  • An integer greater than zero, which is specified by the device may be an integer greater than zero uniformly specified by the device, or an integer greater than zero specified in different physical channels in the device, that is, different physical channels may be specified differently in advance.
  • the location of the first data and the second data of all the data packets received by the device in the parsed parsed data of the data packet may be pre-uniformly unified. Or pre-uniformly indicating the location of the first data and the second data of the data packet received by each physical channel of the device in the parsed data after the parsing of the data packet.
  • the N may further send, by the sending end, an integer greater than zero indicated by the indication information carried by the data packet. That is, the indication information in the data packet transmitted by the transmitting end indicates the position of the first data and the second data in the parsed data after the packet parsing.
  • the packet header data of the data packet needs to be processed in various ways during data processing, for example, data processing such as authentication, identification, authentication, etc., that is, the processing efficiency of the packet header data requirement of the data packet is generally higher than that.
  • Other data for the packet such as payload data.
  • the header data is generally located in front of the parsed data after the parsing of the packet, that is, the header data of the packet can be used as the first data by the above method.
  • the first data is not limited in this embodiment, that is, the first data may be header data or other first data that satisfies requirements.
  • the first performed by the processor 53 to cache the second data may include:
  • the second address space is a pre-designated address space
  • the processor 53 is configured to save the first data to a second address space of the first data cache, and update the first address information of the first address space that buffers the second data to the first data. After the operation of the specified location is performed, before the operation of acquiring the first data and the first address information in the first data cache is performed, the following operations may also be performed:
  • the operation performed by the processor 53 to obtain the first data and the first address information in the first data cache may include:
  • the operation performed by the processor 53 to save the first address information of the first address space of the second data and the first data to the first data cache may include:
  • the third address space is an address space indicated by a BD of the data packet. That is, the BD of the data packet will contain a third address space of the first data cache for buffering the first data of the data packet. Specifically, when a BD is allocated for the data packet, a cache space for buffering the first data of the data packet is allocated.
  • the operation performed by the processor 53 to obtain the first data and the first address information in the first data cache may include:
  • the foregoing first data may include at least two first sub-data; for example, the data of the length N1 is intercepted from the start position of the parsed data as the first sub-data, and the A sub-data corresponds to one of the 1 ⁇ ?/1? layer or the 081 layer (for example, corresponding to the application layer), and the data of length N2 is intercepted from the start position of the parsed data as another first sub- Data, the first sub-data corresponds to another layer in the TCP/IP layer or the OSI layer (for example, corresponding to the transport layer).
  • the length of the parsed data may be intercepted from the start position of the parsed data.
  • the data is used as another first subdata. That is, different first sub-data corresponds to different layers. This allows different first sub-data to be intercepted according to different layers, because the processing efficiency of different data requirements within the data packet may be different when processing data at different layers.
  • N1, N2 and N3 are all integers greater than zero.
  • the operation performed by the processor 53 to save the first address information of the first address space of the second data and the first data to the first data cache may include:
  • the address space corresponding to the first sub-data is a pre-designated address space, or the address space corresponding to the first sub-data is an address space indicated by the BD of the data packet.
  • the obtaining, by the processor 53, the first data and the first address information in the first data cache when performing data processing on the first data and the second data, according to the The obtaining, by the first address information, the second data in the second data cache, and performing data processing on the first data and the second data may include:
  • the target layer needs to perform data processing on the first data and the second data, acquiring first sub-data and the first address information corresponding to the target layer in the first data cache, and then Acquiring the second data in the second data cache according to the first address information, and performing data processing on the first sub data and the second data corresponding to the target layer.
  • the target layer is any one of a TCP/IP layer or an OSI layer, for example, an application layer or a transport layer.
  • different layers can read different first sub-data, and the first sub-data corresponding to different layers is different data, for example:
  • the application layer processes data, only the first N1 data requirements in the parsed data of the data packet are required.
  • the processing efficiency is high, so that the first N1 bit data can be used as the first sub data, and the first sub data is saved to an address space of the first data cache.
  • the transport layer processes the data, only The first N2 bit data in the parsed data of the data packet requires high processing efficiency, so that the first N2 bit data can be used as the first sub data, and the first sub data is saved to an address of the first data cache. space.
  • the address information may be the first address information, that is, the address information includes only the first address information of the address space, for example, the first address information may be the first of the first address space.
  • the address information that is, the first address information is the information of the first address of the first address space or the address information of the previous part of the first address space.
  • the second address information may specifically be the first address information of the second address space.
  • the above device may be any communication device having a function of data packet transmission and buffering data.
  • a device or DMA connected to an Ethernet device may be a communication device having a data packet transmission function and a cache data function, such as a computer, a server, a mobile phone, a tablet computer, and an in-vehicle device.
  • the data included in the data packet is parsed into the first data and the second data, and the processing efficiency required by the first data is higher than the processing efficiency required by the second data, and the second data is saved to the second data cache. And saving the first address information of the first address space of the second data and the first data to the first data cache, and the access efficiency of the first data cache is higher than the access efficiency of the second data cache; Acquiring the first data in the first data cache, and acquiring the second data in the second data cache, and performing data processing on the first data and the second data.
  • the processing efficiency when the first data processing is performed is higher than the processing efficiency when the second data is processed, the processing efficiency required to satisfy the first data requirement, and the processing efficiency satisfying the second data requirement, thereby realizing the requirement.
  • Data with different processing efficiency is saved to a data cache of different access efficiency to improve the performance of processing data.
  • Computer readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one location to another.
  • a storage medium may be any available media that can be accessed by a computer.
  • computer readable media may comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage media or other magnetic storage device, or can be used for carrying or storing in the form of an instruction or data structure.
  • connection may suitably be a computer readable medium.
  • the software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave
  • coaxial cable , fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, wireless, and microwaves are included in the fixing of the associated media.
  • a disk and a disc include a compact disc (CD), a laser disc, a disc, a digital versatile disc (DVD), a floppy disk, and a Blu-ray disc, wherein the disc is usually magnetically copied, and the disc is The laser is used to optically replicate the data. Combinations of the above should also be included within the scope of the computer readable media.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Communication Control (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明实施例公开了一种数据包传输方法,包括:接收发送端发送的数据包;解析所述数据包得到第一数据和第二数据;将所述第二数据保存至第二数据缓存,并将缓存所述第二数据的第一地址空间的第一地址信息和所述第一数据保存至第一数据缓存;当需要对所述第一数据和所述第二数据进行数据处理时,获取所述第一数据缓存中的所述第一数据和所述第一地址信息,再根据所述第一地址信息获取所述第二数据缓存中的所述第二数据,并对所述第一数据和所述第二数据进行数据处理。相应地,本发明实施例还公开一种数据包传输设备。本发明实施例可以提高通信设备处理数据的性能。

Description

一种数据包传输方法及设备
技术领域
本发明涉及通信领域, 尤其涉及一种数据包传输方法及设备。 背景技术
通信技术中在通信设备之间,存在大量的以数据包为单位的传输,在传输 过程中是从一个设备内的一块或者多块数据緩存中读取数据包,然后按照数据 包的顺序向另一通信设备发送, 通信设备在接收到一个数据包时, 只能把数据 包存放在一块緩存中, 再从该緩存中读取数据包, 之后对数据包进行处理。 而 目前的通信设备的芯片中包括多个数据緩存,每种緩存的访问效率不同, 而由 于数据緩存的成本问题,导致在通信设备的芯片中访问效率越高的数据緩存的 緩存空间越小,访问效率越低的数据緩存的緩存空间越大。在实际应用中一个 数据包包括的各部分数据要求的处理效率是不同,有些部分数据要求的处理效 率高, 即该部分数据需要访问效率高的数据緩存来緩存该部分数据, 而该数据 包内有些部分数据对处理效率不敏感,允许这部分数据緩存在访问效率较低的 数据緩存。 而现在的都是将一个数据包緩存在一个数据緩存中, 即将一个数据 包的所有数据都存放在一个数据緩存中,这样就会导致将一些对处理效率不敏 感的数据和一些处理效率要求高的数据都存放在访问效率高的数据緩存中,而 访问效率高的数据緩存的緩存空间是很小的,这样数据包会占用过多的访问效 率高的数据緩存的緩存空间,导致通信设备的芯片的其它模块占用访问效率高 的数据緩存的緩存空间就变小,从而使通信设备处理数据的综合性能降低。或 者将一些对处理效率不敏感的数据和一些处理效率要求高的数据都存放在访 问效率较低的数据緩存中, 这样处理效率要求高的数据就得不到高效率的緩 存, 即通信设备处理的处理数据的综合性能降低。
综上所述, 目前通信设备处理数据的综合性能比较低。 发明内容 有鉴于此, 本发明实施例提供了一种数据包传输方法及设备, 可以提高通 信设备处理数据的综合性能。
第一方面, 本发明实施例提供的一种数据包传输方法, 包括:
接收发送端发送的数据包;
解析所述数据包得到第一数据和第二数据, 其中, 所述第一数据要求的处 理效率高于所述第二数据要求的处理效率;
将所述第二数据保存至第二数据緩存,并将緩存所述第二数据的第一地址 空间的第一地址信息和所述第一数据保存至第一数据緩存; 其中, 所述第一数 据緩存的访问效率高于所述第二数据緩存的访问效率;
当需要对所述第一数据和所述第二数据进行数据处理时,获取所述第一数 据緩存中的所述第一数据和所述第一地址信息,再根据所述第一地址信息获取 所述第二数据緩存中的所述第二数据,并对所述第一数据和所述第二数据进行 数据处理。
在第一方面的第一种可能的实现方式中,所述解析所述数据包得到第一数 据和第二数据, 包括:
解析所述数据包得到解析数据,从所述解析数据的起始位置开始截取长度 为 N的数据作为第一数据, 并将所述解析数据中除所述第一数据之外的所有 数据作为第二数据;
其中, 所述 N为预设指定的大于零的整数, 或者所述 N为所述发送端发 送所述数据包所携带的指示信息所指示的大于零的整数。
结合第一方面或者第一方面的第一种可能的实现方式,在第一方面的第二 种可能的实现方式中,所述将緩存所述第二数据的第一地址空间的第一地址信 息和所述第一数据保存至第一数据緩存, 包括:
将所述第一数据保存至第一数据緩存的第二地址空间,并将緩存所述第二 数据的第一地址空间的第一地址信息更新至所述第一数据中预先指定的位置; 其中, 所述第二地址空间为预先指定的地址空间;
所述将所述第一数据保存至第一数据緩存的第二地址空间,并将緩存所述 第二数据的第一地址空间的第一地址信息更新至所述第一数据中预先指定的 位置之后,所述获取所述第一数据緩存中的所述第一数据和所述第一地址信息 之前, 所述方法还包括:
在用于表示所述数据包接收完成的完成消息中增加所述第二地址空间的 第二地址信息;或者在所述数据包的接收描述符增加所述第二地址空间的第二 地址信息;
所述获取所述第一数据緩存中的所述第一数据和所述第一地址信息, 包 括:
根据所述完成消息包括的或者所述接收描述符包括的所述第二地址信息, 在所述第二地址空间获取所述第一数据和所述第一地址信息。
结合第一方面或者第一方面的第一种可能的实现方式,在第一方面的第三 种可能的实现方式中,所述将緩存所述第二数据的第一地址空间的第一地址信 息和所述第一数据保存至第一数据緩存, 包括:
将所述第一数据保存至第一数据緩存的第三地址空间,并将緩存所述第二 数据的第一地址空间的第一地址信息更新至所述第一数据中预先指定的位置; 其中, 所述第三地址空间为所述数据包的緩存描述符所指示的地址空间; 所述获取所述第一数据緩存中的所述第一数据和所述第一地址信息, 包 括:
根据所述緩存描述符在所述第三地址空间获取所述第一数据和所述第一 地址信息。
结合第一方面或者第一方面的第一种可能的实现方式,在第一方面的第四 种可能的实现方式中, 所述第一数据包括至少两个第一子数据;
所述将緩存所述第二数据的第一地址空间的第一地址信息和所述第一数 据保存至第一数据緩存, 包括:
将每个所述第一子数据保存至第一数据緩存的中该第一子数据对应的地 址空间,并将緩存所述第二数据的第一地址空间的第一地址信息更新至每个所 述第一子数据中预先指定的位置;
其中, 所述第一子数据对应的地址空间为预先指定的地址空间, 或者所述 第一子数据对应的地址空间为所述数据包的緩存描述符所指示的地址空间。
结合第一方面的第四种可能的实现方式,在第一方面的第五种可能的实现 方式中, 所述当需要对所述第一数据和所述第二数据进行数据处理时, 获取所 述第一数据緩存中的所述第一数据和所述第一地址信息,再根据所述第一地址 信息获取所述第二数据緩存中的所述第二数据,并对所述第一数据和所述第二 数据进行数据处理, 包括:
当目标层需要对所述第一数据和所述第二数据进行数据处理时,获取所述 第一数据緩存中的与所述目标层对应的第一子数据和所述第一地址信息,再根 据所述第一地址信息获取所述第二数据緩存中的所述第二数据,并对所述与所 述目标层对应的第一子数据和所述第二数据进行数据处理。
第二方面, 本发明实施例提供一种数据包传输设备, 包括: 接收单元、 解 析单元、 緩存单元和处理单元, 其中:
所述接收单元, 用于接收发送端发送的数据包;
所述解析单元, 用于解析所述数据包得到第一数据和第二数据, 其中, 所 述第一数据要求的处理效率高于所述第二数据要求的处理效率;
所述緩存单元, 用于将所述第二数据保存至第二数据緩存, 并将緩存所述 第二数据的第一地址空间的第一地址信息和所述第一数据保存至第一数据緩 存; 其中, 所述第一数据緩存的访问效率高于所述第二数据緩存的访问效率; 所述处理单元,用于当需要对所述第一数据和所述第二数据进行数据处理 时, 获取所述第一数据緩存中的所述第一数据和所述第一地址信息,再根据所 述第一地址信息获取所述第二数据緩存中的所述第二数据,并对所述第一数据 和所述第二数据进行数据处理。
在第二方面的第一种可能的实现方式中,所述解析单元具体用于解析所述 数据包得到解析数据, 从所述解析数据的起始位置开始截取长度为 N的数据 作为第一数据,并将所述解析数据中除所述第一数据之外的所有数据作为第二 数据;
其中, 所述 N为预设指定的大于零的整数, 或者所述 N为所述发送端发 送所述数据包所携带的指示信息所指示的大于零的整数。
结合第二方面或者第二方面的第一种可能的实现方式,在第二方面的第二 种可能的实现方式中,所述緩存单元具体用于将所述第一数据保存至第一数据 緩存的第二地址空间,并将緩存所述第二数据的第一地址空间的第一地址信息 更新至所述第一数据中预先指定的位置; 其中, 所述第二地址空间为预先指定 的地址空间;
所述装置还包括:
增加单元,用于在用于表示所述数据包接收完成的完成消息中增加所述第 二地址空间的第二地址信息;或者用于在所述数据包的接收描述符增加所述第 二地址空间的第二地址信息;
所述处理单元具体用于根据所述完成消息包括的或者所述接收描述符包 括的所述第二地址信息,在所述第二地址空间获取所述第一数据和所述第一地 址信息。
结合第二方面或者第二方面的第一种可能的实现方式,在第二方面的第三 种可能的实现方式中,所述緩存单元具体用于将所述第一数据保存至第一数据 緩存的第三地址空间,并将緩存所述第二数据的第一地址空间的第一地址信息 更新至所述第一数据中预先指定的位置; 其中, 所述第三地址空间为所述数据 包的緩存描述符所指示的地址空间;
所述处理单元具体用于根据所述緩存描述符在所述第三地址空间获取所 述第一数据和所述第一地址信息。
结合第二方面或者第二方面的第一种可能的实现方式,在第二方面的第四 种可能的实现方式中, 所述第一数据包括至少两个第一子数据;
所述緩存单元具体用于将每个所述第一子数据保存至第一数据緩存的中 该第一子数据对应的地址空间,并将緩存所述第二数据的第一地址空间的第一 地址信息更新至每个所述第一子数据中预先指定的位置;
其中, 所述第一子数据对应的地址空间为预先指定的地址空间, 或者所述 第一子数据对应的地址空间为所述数据包的緩存描述符所指示的地址空间。
结合者第二方面的第四种可能的实现方式,在第二方面的第五种可能的实 现方式中,所述处理单元具体用于当目标层需要对所述第一数据和所述第二数 据进行数据处理时,获取所述第一数据緩存中的与所述目标层对应的第一子数 据和所述第一地址信息,再根据所述第一地址信息获取所述第二数据緩存中的 所述第二数据,并对所述与所述目标层对应的第一子数据和所述第二数据进行 数据处理。
第三方面, 本发明实施例提供一种数据包传输设备, 包括: 通信接口和存 储器, 以及与所述通信接口和所述存储器连接的处理器, 所述存储器存储一组 程序代码, 所述处理器用于调用所述存储器存储的程序执行如下操作:
接收发送端发送的数据包;
解析所述数据包得到第一数据和第二数据, 其中, 所述第一数据要求的处 理效率高于所述第二数据要求的处理效率;
将所述第二数据保存至第二数据緩存,并将緩存所述第二数据的第一地址 空间的第一地址信息和所述第一数据保存至第一数据緩存; 其中, 所述第一数 据緩存的访问效率高于所述第二数据緩存的访问效率;
当需要对所述第一数据和所述第二数据进行数据处理时,获取所述第一数 据緩存中的所述第一数据和所述第一地址信息,再根据所述第一地址信息获取 所述第二数据緩存中的所述第二数据,并对所述第一数据和所述第二数据进行 数据处理。
在第三方面的第一种可能的实现方式中,所述处理器执行的解析所述数据 包得到第一数据和第二数据的操作, 包括:
解析所述数据包得到解析数据,从所述解析数据的起始位置开始截取长度 为 N的数据作为第一数据, 并将所述解析数据中除所述第一数据之外的所有 数据作为第二数据;
其中, 所述 N为预设指定的大于零的整数, 或者所述 N为所述发送端发 送所述数据包所携带的指示信息所指示的大于零的整数。
结合第三方面或者第三方面的第一种可能的实现方式,在第三方面的第二 种可能的实现方式中,所述处理器执行的将緩存所述第二数据的第一地址空间 的第一地址信息和所述第一数据保存至第一数据緩存的操作, 包括:
将所述第一数据保存至第一数据緩存的第二地址空间,并将緩存所述第二 数据的第一地址空间的第一地址信息更新至所述第一数据中预先指定的位置; 其中, 所述第二地址空间为预先指定的地址空间;
所述处理器在执行将所述第一数据保存至第一数据緩存的第二地址空间, 并将緩存所述第二数据的第一地址空间的第一地址信息更新至所述第一数据 中预先指定的位置的操作之后,在执行获取所述第一数据緩存中的所述第一数 据和所述第一地址信息的操作之前, 还用于执行如下操作: 在用于表示所述数据包接收完成的完成消息中增加所述第二地址空间的 第二地址信息;或者在所述数据包的接收描述符增加所述第二地址空间的第二 地址信息;
所述处理器执行的获取所述第一数据緩存中的所述第一数据和所述第一 地址信息的操作, 包括:
根据所述完成消息包括的或者所述接收描述符包括的所述第二地址信息, 在所述第二地址空间获取所述第一数据和所述第一地址信息。
结合第三方面或者第三方面的第一种可能的实现方式,在第三方面的第三 种可能的实现方式中,所述处理器执行的将緩存所述第二数据的第一地址空间 的第一地址信息和所述第一数据保存至第一数据緩存的操作, 包括:
将所述第一数据保存至第一数据緩存的第三地址空间,并将緩存所述第二 数据的第一地址空间的第一地址信息更新至所述第一数据中预先指定的位置; 其中, 所述第三地址空间为所述数据包的緩存描述符所指示的地址空间;
所述处理器执行的获取所述第一数据緩存中的所述第一数据和所述第一 地址信息的操作, 包括:
根据所述緩存描述符在所述第三地址空间获取所述第一数据和所述第一 地址信息。
结合第三方面或者第三方面的第一种可能的实现方式,在第三方面的第四 种可能的实现方式中, 所述第一数据包括至少两个第一子数据;
所述处理器执行的将緩存所述第二数据的第一地址空间的第一地址信息 和所述第一数据保存至第一数据緩存的操作, 包括:
将每个所述第一子数据保存至第一数据緩存的中该第一子数据对应的地 址空间,并将緩存所述第二数据的第一地址空间的第一地址信息更新至每个所 述第一子数据中预先指定的位置;
其中, 所述第一子数据对应的地址空间为预先指定的地址空间, 或者所述 第一子数据对应的地址空间为所述数据包的緩存描述符所指示的地址空间。
结合第三方面的第四种可能的实现方式,在第三方面的第五种可能的实现 方式中,所述处理器执行的当需要对所述第一数据和所述第二数据进行数据处 理时, 获取所述第一数据緩存中的所述第一数据和所述第一地址信息,再根据 所述第一地址信息获取所述第二数据緩存中的所述第二数据,并对所述第一数 据和所述第二数据进行数据处理的操作, 包括:
当目标层需要对所述第一数据和所述第二数据进行数据处理时,获取所述 第一数据緩存中的与所述目标层对应的第一子数据和所述第一地址信息,再根 据所述第一地址信息获取所述第二数据緩存中的所述第二数据,并对所述与所 述目标层对应的第一子数据和所述第二数据进行数据处理。
上述技术方案中, 将数据包包括的数据解析为第一数据和第二数据, 第一 数据要求的处理效率高于第二数据要求的处理效率,将所述第二数据保存至第 二数据緩存,并将緩存所述第二数据的第一地址空间的第一地址信息和所述第 一数据保存至第一数据緩存,而第一数据緩存的访问效率高于第二数据緩存的 访问效率; 在第一数据緩存中获取第一数据, 以及在第二数据緩存中获取第二 数据, 并对所述第一数据和所述第二数据进行数据处理。从而实现对第一数据 处理时的处理效率就会高于对第二数据进行处理时的处理效率,以满足第一数 据要求的处理效率, 和满足第二数据要求的处理效率,从而实现对要求处理效 率不同的数据保存至不同访问效率的数据緩存, 以提高处理数据的性能。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施 例或现有技术描述中所需要使用的附图作筒单地介绍,显而易见地, 下面描述 中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲, 在不付 出创造性劳动的前提下, 还可以根据这些附图获得其他的附图。
图 1是本发明实施例提供的一种数据包传输方法的流程示意图; 图 2是本发明实施例提供的另一种数据包传输方法的流程示意图; 图 3是本发明实施例提供的一种数据包传输设备的结构示意图; 图 4是本发明实施例提供的另一种数据包传输设备的结构示意图; 图 5是本发明实施例提供的另一种数据包传输设备的结构示意图。 具体实施方式 下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清 楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而不是 全部的实施例。基于本发明中的实施例, 本领域普通技术人员在没有作出创造 性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。
图 1 是本发明实施例提供的一种数据包传输方法的流程示意图, 如图 1 所示, 包括以下步骤:
101、 接收发送端发送的数据包。
该数据包可以是任何形式的数据包, 例如: 消息传输( Message , MSG ) 数据包, 或者数据流传输(Data Streaming, DS )数据包等。 且接收发送端发 送的数据包可以是通过串行高速接口 (Serial Rapid 10, sRIO )接收发送端发 送的数据包。
102、 解析所述数据包得到第一数据和第二数据, 其中, 所述第一数据要 求的处理效率高于所述第二数据要求的处理效率。
该步骤具体可以是对数据包进行解析得到解析数据,再将解析数据拆分为 上述第一数据和第二数据。具体可以是根据数据包的各部分数据要求的处理效 率, 将数据包的数据拆分为第一数据和第二数据。
103、 将所述第二数据保存至第二数据緩存, 并将緩存所述第二数据的第 一地址空间的第一地址信息和所述第一数据保存至第一数据緩存; 其中, 所述 第一数据緩存的访问效率高于所述第二数据緩存的访问效率。
具体可以是将上述第一地址信息与上述第一数据组合在一起,并保存至上 述第一数据緩存。 其中, 可以是以循环緩存的方式緩存上述第一数据、 第一地 址信息和第二数据, 即上述第一数据緩存和第二数据緩存可以是循环数据緩 存。
需要说明的是, 本实施例中,对緩存第一数据和第二数据的緩存顺序不作 限定, 即可以是先将第二数据保存至第二数据緩存,再将緩存所述第二数据的 第一地址空间的第一地址信息和所述第一数据保存至第一数据緩存。还可以是 将第一数据保存至第一数据緩存,再将第二数据保存至第二数据緩存,再将緩 存所述第二数据的第一地址空间的第一地址信息保存至用于緩存第一数据的 地址空间。 104、 当需要对所述第一数据和所述第二数据进行数据处理时, 获取所述 第一数据緩存中的所述第一数据和所述第一地址信息,再根据所述第一地址信 息获取所述第二数据緩存中的所述第二数据,并对所述第一数据和所述第二数 据进行数据处理。
其中,上述对第一数据和第二数据进行数据处理具体可以是应用层对第一 数据和第二数据进行数据处理,还可以是传输层对第一数据和第二数据进行数 据处理, 以及其它层对第一数据和第二数据进行数据处理。 由于第一数据緩存 的访问效率高于第二数据緩存的访问效率,这样对第一数据处理时的处理效率 就会高于对第二数据进行处理时的处理效率, 以满足第一数据要求的处理效 率, 和满足第二数据要求的处理效率, 从而实现提高处理数据的性能。
上述方法可以实现于任何具备数据包传输功能和緩存数据功能的通信设 备, 即这些通信设备都可以实现所述方法。 例如: 连接以太网的设备或者緩存 直接访问设备 ( Direct Memory Access , DMA ), 具体可以是计算机、 服务器、 手机、平板电脑、车载设备等具备数据包传输功能和緩存数据功能的通信设备。
上述技术方案中, 将数据包包括的数据解析为第一数据和第二数据, 第一 数据要求的处理效率高于第二数据要求的处理效率,将所述第二数据保存至第 二数据緩存,并将緩存所述第二数据的第一地址空间的第一地址信息和所述第 一数据保存至第一数据緩存,而第一数据緩存的访问效率高于第二数据緩存的 访问效率; 在第一数据緩存中获取第一数据, 以及在第二数据緩存中获取第二 数据, 并对所述第一数据和所述第二数据进行数据处理。从而实现对第一数据 处理时的处理效率就会高于对第二数据进行处理时的处理效率,以满足第一数 据要求的处理效率, 和满足第二数据要求的处理效率,从而实现对要求处理效 率不同的数据保存至不同访问效率的数据緩存, 以提高处理数据的性能。 图 2是本发明实施例提供的另一种数据包传输方法的流程示意图, 如图 2 所示, 包括:
201、 接收发送端发送的数据包。
该步骤具体可以是通过 sRIO 装置接收发送端发送的数据包, 或者通过 sRIO装置中某一物理通道接收发送端发送的数据包。 202、 解析所述数据包得到解析数据, 将所述解析截取为第一数据和第二 数据,其中,所述第一数据要求的处理效率高于所述第二数据要求的处理效率。
具体可以是将数据包的头部数据作为第一数据,将其它剩余的数据作为第 二数据。 或者具体可以是从所述解析数据的起始位置开始截取长度为 N 的数 据作为第一数据,并将所述解析数据中除所述第一数据之外的所有数据作为第 二数据;
其中, 所述 N为预设指定的大于零的整数。 N为预设指定的大于零的整 数具体可以实现所述方法的通信设备统一指定的大于零的整数;或者是实现所 述方法的通信设备中不同的物理通道中指定的大于零的整数,即不同的物理通 道可以预先指定不同的 N。即可以预先统一指示实现所述方法的通信设备接收 到的所有数据包的第一数据和第二数据在该数据包解析后的解析数据中的位 置。或者预先统一指示实现所述方法的通信设备的各物理通道接收到的数据包 的第一数据和第二数据在该数据包解析后的解析数据中的位置。
其中, 所述 N还可以为所述发送端发送所述数据包所携带的指示信息所 指示的大于零的整数。即在发送端发送的数据包中的指示信息就指示的第一数 据和第二数据在所述数据包解析后的解析数据中的位置。
例如: 在实际应用中数据包的包头数据在数据处理时,是需要进行多种处 理的, 如, 认证、 识别、 鉴权等数据处理, 即数据包的包头数据要求的处理效 率一般会高于数据包的其它数据, 如, 负荷 (payload )数据。 而包头数据一 般都位于在数据包解析后的解析数据的前面,即通过上述方法可以将数据包的 包头数据作为上述第一数据。 当然, 在本实施例中并不对第一数据进行限定, 即第一数据可以是包头数据还可以是其它满足要求的第一数据。
203、 将所述第二数据保存至第二数据緩存, 并将緩存所述第二数据的第 一地址空间的第一地址信息和所述第一数据保存至第一数据緩存; 其中, 所述 第一数据緩存的访问效率高于所述第二数据緩存的访问效率。
204、 当需要对所述第一数据和所述第二数据进行数据处理时, 获取所述 第一数据緩存中的所述第一数据和所述第一地址信息,再根据所述第一地址信 息获取所述第二数据緩存中的所述第二数据,并对所述第一数据和所述第二数 据进行数据处理。 作为一种可选的实施方式,步骤 203中的将緩存所述第二数据的第一地址 空间的第一地址信息和所述第一数据保存至第一数据緩存, 可以包括:
将所述第一数据保存至第一数据緩存的第二地址空间,并将緩存所述第二 数据的第一地址空间的第一地址信息更新至所述第一数据中预先指定的位置; 其中, 所述第二地址空间为预先指定的地址空间。将第一地址信息更新至所述 第一数据中预先指定的位置具体可以是将第一地址信息加载至第一数据的前 面或者后面,或者将第一地址信息加载至第一数据的中间位置, 即将第一地址 信息和第一数据组成一个数据保存至第一数据緩存的第二地址空间。所述第二 地址空间为预先指定的地址空间具体可以是实现所述方法的通信设备中统一 指定的地址空间,或者实现所述方法的通信设备中不同的物理通道中指定的地 址空间, 即每个物理通道中指定的第二地址空间可以是不同的。
该实施方式, 在步骤 203之后, 在步骤 204之前, 所述方法还可以包括: 在用于表示所述数据包接收完成的完成消息中增加所述第二地址空间的 第二地址信息;或者在所述数据包的接收描述符增加所述第二地址空间的第二 地址信息。即可以在上述完成消息中携带上述第二地址信息或者在上述接收描 述符中携带上述第二地址信息。
其中,步骤 204中的获取所述第一数据緩存中的所述第一数据和所述第一 地址信息, 可以包括:
根据所述完成消息包括的或者所述接收描述符包括的所述第二地址信息, 在所述第二地址空间获取所述第一数据和所述第一地址信息。具体可以将上述 完成消息或者接收描述符传输至应用层,而由应用层根据所述完成消息包括的 或者所述接收描述符包括的所述第二地址信息 ,在所述第二地址空间获取所述 第一数据和所述第一地址信息, 以及获取到第二数据,再对第一数据和第二数 据进行数据处理。
作为一种可选的实施方式,步骤 203中的将緩存所述第二数据的第一地址 空间的第一地址信息和所述第一数据保存至第一数据緩存, 可以包括:
将所述第一数据保存至第一数据緩存的第三地址空间,并将緩存所述第二 数据的第一地址空间的第一地址信息更新至所述第一数据中预先指定的位置; 其中, 所述第三地址空间为所述数据包的緩存描述符(Buffer Descriptor, BD ) 所指示的地址空间。即数据包的 BD中会包含用于緩存该数据包的第一数据的 第一数据緩存的第三地址空间。 具体可以是在为数据包分配 BD时, 分配了用 于緩存该数据包的第一数据的緩存空间。
该实施方式中,步骤 204中的获取所述第一数据緩存中的所述第一数据和 所述第一地址信息, 可以包括:
根据所述 BD 在所述第三地址空间获取所述第一数据和所述第一地址信 息。具体可以应用层根据 BD的用于指示第三地址空间的地址信息获取所述第 一数据和所述第一地址信息, 再对第一数据和第二数据进行数据处理。
作为一种可选的实施方式, 上述第一数据可以包括至少两个第一子数据; 例如, 从所述解析数据的起始位置开始截取长度为 N1的数据为第一子数据, 且该第一子数据与传输控制协议(Transmission Control Protocol, TCP ) /网络 协议(Internet Protocol, IP )层或者开放式系统互联参考模型 (Open System Interconnection, 0SI )层中的一层对应 (例如: 与应用层对应), 从所述解析 数据的起始位置开始截取长度为 N2的数据为另一个第一子数据, 该第一子数 据与 TCP/IP层或者 0SI层中的另一层对应(例如: 与传输层对应), 同理, 还 可以从所述解析数据的起始位置开始截取长度为 N3的数据作为另一个第一子 数据。 即不同的第一子数据与不同的层对应。这样可以根据不同的层截取不同 的第一子数据, 因为在不同的层处理数据时,数据包内不同的数据要求的处理 效率可能是不同的。 其中, 上述 Nl、 N2和 N3都为大于零的整数。
步骤 203 中的将緩存所述第二数据的第一地址空间的第一地址信息和所 述第一数据保存至第一数据緩存, 可以包括:
将每个所述第一子数据保存至第一数据緩存的中该第一子数据对应的地 址空间,并将緩存所述第二数据的第一地址空间的第一地址信息更新至每个所 述第一子数据中预先指定的位置;
其中, 所述第一子数据对应的地址空间为预先指定的地址空间, 或者所述 第一子数据对应的地址空间为所述数据包的 BD所指示的地址空间。
即可以将不同的第一子数据保存至不同的地址空间。
该实施方式中, 步骤 204可以包括:
当目标层需要对所述第一数据和所述第二数据进行数据处理时,获取所述 第一数据緩存中的与所述目标层对应的第一子数据和所述第一地址信息,再根 据所述第一地址信息获取所述第二数据緩存中的所述第二数据,并对所述与所 述目标层对应的第一子数据和所述第二数据进行数据处理。 其中, 本实施例中 对上述目标层不作限定, 针对不同的应用可以是不同的层, 例如: 上述目标层 为 TCP/IP层或者 OSI层中的任意一层, 例如: 应用层或者传输层等。 这样可 以实现不同的层读取不同的第一子数据 ,且不同层对应的第一子数据为不同的 数据, 例如: 应用层处理数据时, 只有数据包的解析数据中的前 N1位数据要 求的处理效率高, 这样就可以将这前 N1位数据作为第一子数据, 将该第一子 数据保存至上述第一数据緩存的某一地址空间。 或者, 传输层处理数据时, 只 有数据包的解析数据中的前 N2位数据要求的处理效率高, 这样就可以将这前 N2位数据作为第一子数据, 将该第一子数据保存至上述第一数据緩存的某一 地址空间。
作为一种可选的实施方式, 上述地址信息具体可以是首地址信息, 即上述 地址信息都只包括地址空间的首地址信息, 例如: 上述第一地址信息具体可以 为上述第一地址空间的首地址信息,即第一地址信息为第一地址空间的第一个 地址的信息或者第一地址空间的前一部分地址的地址信息。上述第二地址信息 具体可以为上述第二地址空间的首地址信息。
上述方法可以实现于任何具备数据包传输功能和緩存数据功能的通信设 备,即这些通信设备都可以实现所述方法。例如:连接以太网的设备或者 DMA, 具体可以是计算机、 服务器、 手机、 平板电脑、 车载设备等具备数据包传输功 能和緩存数据功能的通信设备。
上述技术方案中, 在上面实施例的基础上增加了多种可选的实施方式, 且 都可以实现提高处理数据的性能。 下面为本发明装置实施例,本发明装置实施例用于执行本发明方法实施例 一至二实现的方法, 为了便于说明, 仅示出了与本发明实施例相关的部分, 具 体技术细节未揭示的, 请参照本发明实施例一和实施例二。 图 3 是本发明实施例提供的一种数据包传输设备的结构示意图, 如图 3 所示, 包括: 接收单元 31、 解析单元 32、 緩存单元 33和处理单元 34, 其中: 接收单元 31 , 用于接收发送端发送的数据包。
该数据包可以是任何形式的数据包, 例如: MSG数据包, 或者 DS数据 包等。且接收发送端发送的数据包可以是通过 sRIO接收发送端发送的数据包。
解析单元 32, 用于解析所述数据包得到第一数据和第二数据, 其中, 所 述第一数据要求的处理效率高于所述第二数据要求的处理效率。
解析单元 32具体可以是对数据包进行解析得到解析数据, 再将解析数据 拆分为上述第一数据和第二数据。具体可以是根据数据包的各部分数据要求的 处理效率, 将数据包的数据拆分为第一数据和第二数据。
緩存单元 33 , 用于将所述第二数据保存至第二数据緩存, 并将緩存所述 第二数据的第一地址空间的第一地址信息和所述第一数据保存至第一数据緩 存; 其中, 所述第一数据緩存的访问效率高于所述第二数据緩存的访问效率; 具体可以是将上述第一地址信息与上述第一数据组合在一起,并保存至上 述第一数据緩存。 其中, 可以是以循环緩存的方式緩存上述第一数据、 第一地 址信息和第二数据, 即上述第一数据緩存和第二数据緩存可以是循环数据緩 存。
需要说明的是, 本实施例中,对緩存第一数据和第二数据的緩存顺序不作 限定, 即可以是先将第二数据保存至第二数据緩存,再将緩存所述第二数据的 第一地址空间的第一地址信息和所述第一数据保存至第一数据緩存。还可以是 将第一数据保存至第一数据緩存,再将第二数据保存至第二数据緩存,再将緩 存所述第二数据的第一地址空间的第一地址信息保存至用于緩存第一数据的 地址空间。
处理单元 34, 用于当需要对所述第一数据和所述第二数据进行数据处理 时, 获取所述第一数据緩存中的所述第一数据和所述第一地址信息,再根据所 述第一地址信息获取所述第二数据緩存中的所述第二数据,并对所述第一数据 和所述第二数据进行数据处理。
其中,上述对第一数据和第二数据进行数据处理具体可以是应用层对第一 数据和第二数据进行数据处理,还可以是传输层对第一数据和第二数据进行数 据处理, 以及其它层对第一数据和第二数据进行数据处理。 由于第一数据緩存 的访问效率高于第二数据緩存的访问效率,这样对第一数据处理时的处理效率 就会高于对第二数据进行处理时的处理效率, 以满足第一数据要求的处理效 率, 和满足第二数据要求的处理效率, 从而实现提高处理数据的性能。
上述设备可以是任何具备数据包传输功能和緩存数据功能的通信设备,。 例如: 连接以太网的设备或者 DMA, 具体可以是计算机、 服务器、 手机、 平 板电脑、 车载设备等具备数据包传输功能和緩存数据功能的通信设备。
上述技术方案中, 将数据包包括的数据解析为第一数据和第二数据, 第一 数据要求的处理效率高于第二数据要求的处理效率,将所述第二数据保存至第 二数据緩存,并将緩存所述第二数据的第一地址空间的第一地址信息和所述第 一数据保存至第一数据緩存,而第一数据緩存的访问效率高于第二数据緩存的 访问效率; 在第一数据緩存中获取第一数据, 以及在第二数据緩存中获取第二 数据, 并对所述第一数据和所述第二数据进行数据处理。从而实现对第一数据 处理时的处理效率就会高于对第二数据进行处理时的处理效率,以满足第一数 据要求的处理效率, 和满足第二数据要求的处理效率,从而实现对要求处理效 率不同的数据保存至不同访问效率的数据緩存, 以提高处理数据的性能。 图 4是本发明实施例提供的另一种数据包传输设备的结构示意图, 如图 4 所示, 包括: 接收单元 41、 解析单元 42、 緩存单元 43和处理单元 44, 其中: 接收单元 41 , 用于接收发送端发送的数据包。
接收单元 41具体可以是通过 sRIO装置接收发送端发送的数据包,或者通 过 sRIO装置中某一物理通道接收发送端发送的数据包。
解析单元 42, 用于解析所述数据包得到解析数据, 将所述解析截取为第 一数据和第二数据, 其中, 所述第一数据要求的处理效率高于所述第二数据要 求的处理效率。
解析单元 42具体可以用于将数据包的头部数据作为第一数据, 将其它剩 余的数据作为第二数据。 或者解析单元 42具体可以用于解析所述数据包得到 解析数据, 从所述解析数据的起始位置开始截取长度为 N 的数据作为第一数 据, 并将所述解析数据中除所述第一数据之外的所有数据作为第二数据;
其中, 所述 N为预设指定的大于零的整数。 N为预设指定的大于零的整 数具体可以所述设备统一指定的大于零的整数;或者是所述设备中不同的物理 通道中指定的大于零的整数, 即不同的物理通道可以预先指定不同的 N。 即可 以预先统一指示所述设备接收到的所有数据包的第一数据和第二数据在该数 据包解析后的解析数据中的位置。或者预先统一指示所述设备的各物理通道接 收到的数据包的第一数据和第二数据在该数据包解析后的解析数据中的位置。
其中, 所述 N还可以为所述发送端发送所述数据包所携带的指示信息所 指示的大于零的整数。即在发送端发送的数据包中的指示信息就指示的第一数 据和第二数据在所述数据包解析后的解析数据中的位置。
例如: 在实际应用中数据包的包头数据在数据处理时,是需要进行多种处 理的, 如, 认证、 识别、 鉴权等数据处理, 即数据包的包头数据要求的处理效 率一般会高于数据包的其它数据, 如, 负荷 (payload )数据。 而包头数据一 般都位于在数据包解析后的解析数据的前面,即通过上述方法可以将数据包的 包头数据作为上述第一数据。 当然, 在本实施例中并不对第一数据进行限定, 即第一数据可以是包头数据还可以是其它满足要求的第一数据。
緩存单元 43 , 用于将所述第二数据保存至第二数据緩存, 并将緩存所述 第二数据的第一地址空间的第一地址信息和所述第一数据保存至第一数据緩 存; 其中, 所述第一数据緩存的访问效率高于所述第二数据緩存的访问效率。
处理单元 44, 用于当需要对所述第一数据和所述第二数据进行数据处理 时, 获取所述第一数据緩存中的所述第一数据和所述第一地址信息,再根据所 述第一地址信息获取所述第二数据緩存中的所述第二数据,并对所述第一数据 和所述第二数据进行数据处理。
作为一种可选的实施方式, 緩存单元 43具体可以用于将所述第一数据保 存至第一数据緩存的第二地址空间,并将緩存所述第二数据的第一地址空间的 第一地址信息更新至所述第一数据中预先指定的位置; 其中,所述第二地址空 间为预先指定的地址空间。将第一地址信息更新至所述第一数据中预先指定的 位置具体可以是将第一地址信息加载至第一数据的前面或者后面,或者将第一 地址信息加载至第一数据的中间位置,即将第一地址信息和第一数据组成一个 数据保存至第一数据緩存的第二地址空间。所述第二地址空间为预先指定的地 址空间具体可以是所述设备中统一指定的地址空间,或者所述设备中不同的物 理通道中指定的地址空间,即每个物理通道中指定的第二地址空间可以是不同 的。
该实施方式, 所述装置还可以包括:
增加单元(附图中未画出), 用于在用于表示所述数据包接收完成的完成 消息中增加所述第二地址空间的第二地址信息;或者用于在所述数据包的接收 描述符增加所述第二地址空间的第二地址信息。具体可以将上述完成消息或者 接收描述符传输至应用层,而由应用层根据所述完成消息包括的或者所述接收 描述符包括的所述第二地址信息,在所述第二地址空间获取所述第一数据和所 述第一地址信息, 以及获取到第二数据,再对第一数据和第二数据进行数据处 理。
处理单元 44具体可以用于根据所述完成消息包括的或者所述接收描述符 包括的所述第二地址信息 ,在所述第二地址空间获取所述第一数据和所述第一 地址信息。
作为一种可选的实施方式, 緩存单元 43具体还可以用于将所述第一数据 保存至第一数据緩存的第三地址空间,并将緩存所述第二数据的第一地址空间 的第一地址信息更新至所述第一数据中预先指定的位置; 其中, 所述第三地址 空间为所述数据包的 BD所指示的地址空间。 即数据包的 BD中会包含用于緩 存该数据包的第一数据的第一数据緩存的第三地址空间。具体可以是在为数据 包分配 BD时, 分配了用于緩存该数据包的第一数据的緩存空间。
处理单元具体还可以用于根据所述 BD 在所述第三地址空间获取所述第 一数据和所述第一地址信息。
作为一种可选的实施方式, 上述第一数据可以包括至少两个第一子数据; 例如, 从所述解析数据的起始位置开始截取长度为 N1的数据为第一子数据, 且该第一子数据与 1^?/ 1?层或者081层中的一层对应(例如:与应用层对应), 从所述解析数据的起始位置开始截取长度为 N2的数据为另一个第一子数据, 该第一子数据与 TCP/IP层或者 OSI层中的另一层对应(例如:与传输层对应), 同理, 还可以从所述解析数据的起始位置开始截取长度为 N3的数据作为另一 个第一子数据。 即不同的第一子数据与不同的层对应。这样可以根据不同的层 截取不同的第一子数据, 因为在不同的层处理数据时,数据包内不同的数据要 求的处理效率可能是不同的。 其中, 上述 Nl、 N2和 N3都为大于零的整数。 緩存单元 43具体还可以用于将每个所述第一子数据保存至第一数据緩存 的中该第一子数据对应的地址空间,并将緩存所述第二数据的第一地址空间的 第一地址信息更新至每个所述第一子数据中预先指定的位置;
其中, 所述第一子数据对应的地址空间为预先指定的地址空间, 或者所述 第一子数据对应的地址空间为所述数据包的 BD所指示的地址空间。
该实施方式中, 处理单元 44具体还可以用于当目标层需要对所述第一数 据和所述第二数据进行数据处理时,获取所述第一数据緩存中的与所述目标层 对应的第一子数据和所述第一地址信息 ,再根据所述第一地址信息获取所述第 二数据緩存中的所述第二数据,并对所述与所述目标层对应的第一子数据和所 述第二数据进行数据处理。 其中, 本实施例中对上述目标层不作限定, 针对不 同的应用可以是不同的层, 例如: 上述目标层为 TCP/IP层或者 OSI层中的任 意一层, 例如: 应用层或者传输层等。 这样可以实现不同的层读取不同的第一 子数据,且不同层对应的第一子数据为不同的数据,例如:应用层处理数据时, 只有数据包的解析数据中的前 N1位数据要求的处理效率高, 这样就可以将这 前 N1位数据作为第一子数据, 将该第一子数据保存至上述第一数据緩存的某 一地址空间。 或者, 传输层处理数据时, 只有数据包的解析数据中的前 N2位 数据要求的处理效率高, 这样就可以将这前 N2位数据作为第一子数据, 将该 第一子数据保存至上述第一数据緩存的某一地址空间。
作为一种可选的实施方式, 上述地址信息具体可以是首地址信息, 即上述 地址信息都只包括地址空间的首地址信息, 例如: 上述第一地址信息具体可以 为上述第一地址空间的首地址信息,即第一地址信息为第一地址空间的第一个 地址的信息或者第一地址空间的前一部分地址的地址信息。上述第二地址信息 具体可以为上述第二地址空间的首地址信息。
上述设备可以实现于任何具备数据包传输功能和緩存数据功能的通信设 备。 例如: 连接以太网的设备或者 DMA, 具体可以是计算机、 服务器、 手机、 平板电脑、 车载设备等具备数据包传输功能和緩存数据功能的通信设备。
上述技术方案中, 在上面实施例的基础上增加了多种可选的实施方式, 且 都可以实现提高处理数据的性能。 图 5是本发明实施例提供的另一种数据包传输设备的结构示意图, 如图 5 所示, 包括: 通信接口 51和存储器 52 , 以及与通信接口 51和存储器 52连接 的处理器 53 , 存储器 52存储一组程序代码, 处理器 53用于调用存储器 52存 储的程序执行如下操作:
接收发送端发送的数据包;
解析所述数据包得到第一数据和第二数据, 其中, 所述第一数据要求的处 理效率高于所述第二数据要求的处理效率;
将所述第二数据保存至第二数据緩存,并将緩存所述第二数据的第一地址 空间的第一地址信息和所述第一数据保存至第一数据緩存; 其中, 所述第一数 据緩存的访问效率高于所述第二数据緩存的访问效率;
当需要对所述第一数据和所述第二数据进行数据处理时,获取所述第一数 据緩存中的所述第一数据和所述第一地址信息,再根据所述第一地址信息获取 所述第二数据緩存中的所述第二数据,并对所述第一数据和所述第二数据进行 数据处理。
其中, 上述数据包可以是任何形式的数据包, 例如: MSG数据包, 或者 DS数据包等。 且接收发送端发送的数据包可以是通过 sRIO接收发送端发送 的数据包。
其中, 处理器 53具体可以是对数据包进行解析得到解析数据, 再将解析 数据拆分为上述第一数据和第二数据。具体可以是根据数据包的各部分数据要 求的处理效率, 将数据包的数据拆分为第一数据和第二数据。
处理器 53具体可以是将上述第一地址信息与上述第一数据组合在一起, 并保存至上述第一数据緩存。其中, 可以是以循环緩存的方式緩存上述第一数 据、第一地址信息和第二数据, 即上述第一数据緩存和第二数据緩存可以是循 环数据緩存。
需要说明的是, 本实施例中,对緩存第一数据和第二数据的緩存顺序不作 限定, 即可以是先将第二数据保存至第二数据緩存,再将緩存所述第二数据的 第一地址空间的第一地址信息和所述第一数据保存至第一数据緩存。还可以是 将第一数据保存至第一数据緩存,再将第二数据保存至第二数据緩存,再将緩 存所述第二数据的第一地址空间的第一地址信息保存至用于緩存第一数据的 地址空间。
其中,上述对第一数据和第二数据进行数据处理具体可以是应用层对第一 数据和第二数据进行数据处理,还可以是传输层对第一数据和第二数据进行数 据处理, 以及其它层对第一数据和第二数据进行数据处理。 由于第一数据緩存 的访问效率高于第二数据緩存的访问效率,这样对第一数据处理时的处理效率 就会高于对第二数据进行处理时的处理效率, 以满足第一数据要求的处理效 率, 和满足第二数据要求的处理效率, 从而实现提高处理数据的性能。
作为一种可选的实施方式, 处理器 53执行的解析所述数据包得到第一数 据和第二数据的操作, 可以包括:
解析所述数据包得到解析数据,从所述解析数据的起始位置开始截取长度 为 N的数据作为第一数据, 并将所述解析数据中除所述第一数据之外的所有 数据作为第二数据;
其中, 所述 N为预设指定的大于零的整数。 N为预设指定的大于零的整 数具体可以所述设备统一指定的大于零的整数;或者是所述设备中不同的物理 通道中指定的大于零的整数, 即不同的物理通道可以预先指定不同的 N。 即可 以预先统一指示所述设备接收到的所有数据包的第一数据和第二数据在该数 据包解析后的解析数据中的位置。或者预先统一指示所述设备的各物理通道接 收到的数据包的第一数据和第二数据在该数据包解析后的解析数据中的位置。
其中, 所述 N还可以为所述发送端发送所述数据包所携带的指示信息所 指示的大于零的整数。即在发送端发送的数据包中的指示信息就指示的第一数 据和第二数据在所述数据包解析后的解析数据中的位置。
例如: 在实际应用中数据包的包头数据在数据处理时,是需要进行多种处 理的, 如, 认证、 识别、 鉴权等数据处理, 即数据包的包头数据要求的处理效 率一般会高于数据包的其它数据, 如, 负荷 (payload )数据。 而包头数据一 般都位于在数据包解析后的解析数据的前面,即通过上述方法可以将数据包的 包头数据作为上述第一数据。 当然, 在本实施例中并不对第一数据进行限定, 即第一数据可以是包头数据还可以是其它满足要求的第一数据。
作为一种可选的实施方式, 处理器 53执行的将緩存所述第二数据的第一 地址空间的第一地址信息和所述第一数据保存至第一数据緩存的操作,可以包 括:
将所述第一数据保存至第一数据緩存的第二地址空间,并将緩存所述第二 数据的第一地址空间的第一地址信息更新至所述第一数据中预先指定的位置; 其中, 所述第二地址空间为预先指定的地址空间;
处理器 53在执行将所述第一数据保存至第一数据緩存的第二地址空间, 并将緩存所述第二数据的第一地址空间的第一地址信息更新至所述第一数据 中预先指定的位置的操作之后,在执行获取所述第一数据緩存中的所述第一数 据和所述第一地址信息的操作之前, 还可以用于执行如下操作:
在用于表示所述数据包接收完成的完成消息中增加所述第二地址空间的 第二地址信息;或者在所述数据包的接收描述符增加所述第二地址空间的第二 地址信息;
处理器 53执行的获取所述第一数据緩存中的所述第一数据和所述第一地 址信息的操作, 可以包括:
根据所述完成消息包括的或者所述接收描述符包括的所述第二地址信息, 在所述第二地址空间获取所述第一数据和所述第一地址信息。
作为一种可选的实施方式, 处理器 53执行的将緩存所述第二数据的第一 地址空间的第一地址信息和所述第一数据保存至第一数据緩存的操作,可以包 括:
将所述第一数据保存至第一数据緩存的第三地址空间,并将緩存所述第二 数据的第一地址空间的第一地址信息更新至所述第一数据中预先指定的位置; 其中, 所述第三地址空间为所述数据包的 BD所指示的地址空间。 即数据包的 BD中会包含用于緩存该数据包的第一数据的第一数据緩存的第三地址空间。 具体可以是在为数据包分配 BD时,分配了用于緩存该数据包的第一数据的緩 存空间。
处理器 53执行的获取所述第一数据緩存中的所述第一数据和所述第一地 址信息的操作, 可以包括:
根据所述 BD 在所述第三地址空间获取所述第一数据和所述第一地址信 息。 作为一种可选的实施方式, 上述第一数据可以包括至少两个第一子数据; 例如, 从所述解析数据的起始位置开始截取长度为 N1的数据为第一子数据, 且该第一子数据与 1^?/ 1?层或者081层中的一层对应(例如:与应用层对应), 从所述解析数据的起始位置开始截取长度为 N2的数据为另一个第一子数据, 该第一子数据与 TCP/IP层或者 OSI层中的另一层对应(例如:与传输层对应), 同理, 还可以从所述解析数据的起始位置开始截取长度为 N3的数据作为另一 个第一子数据。 即不同的第一子数据与不同的层对应。这样可以根据不同的层 截取不同的第一子数据, 因为在不同的层处理数据时,数据包内不同的数据要 求的处理效率可能是不同的。 其中, 上述 Nl、 N2和 N3都为大于零的整数。
处理器 53执行的将緩存所述第二数据的第一地址空间的第一地址信息和 所述第一数据保存至第一数据緩存的操作, 可以包括:
将每个所述第一子数据保存至第一数据緩存的中该第一子数据对应的地 址空间,并将緩存所述第二数据的第一地址空间的第一地址信息更新至每个所 述第一子数据中预先指定的位置;
其中, 所述第一子数据对应的地址空间为预先指定的地址空间, 或者所述 第一子数据对应的地址空间为所述数据包的 BD所指示的地址空间。
处理器 53 执行的当需要对所述第一数据和所述第二数据进行数据处理 时, 获取所述第一数据緩存中的所述第一数据和所述第一地址信息,再根据所 述第一地址信息获取所述第二数据緩存中的所述第二数据,并对所述第一数据 和所述第二数据进行数据处理的操作, 可以包括:
当目标层需要对所述第一数据和所述第二数据进行数据处理时,获取所述 第一数据緩存中的与所述目标层对应的第一子数据和所述第一地址信息,再根 据所述第一地址信息获取所述第二数据緩存中的所述第二数据,并对所述与所 述目标层对应的第一子数据和所述第二数据进行数据处理。其中, 上述目标层 为 TCP/IP层或者 OSI层中的任意一层, 例如: 应用层或者传输层等。 这样可 以实现不同的层读取不同的第一子数据 ,且不同层对应的第一子数据为不同的 数据, 例如: 应用层处理数据时, 只有数据包的解析数据中的前 N1位数据要 求的处理效率高, 这样就可以将这前 N1位数据作为第一子数据, 将该第一子 数据保存至上述第一数据緩存的某一地址空间。 或者, 传输层处理数据时, 只 有数据包的解析数据中的前 N2位数据要求的处理效率高, 这样就可以将这前 N2位数据作为第一子数据, 将该第一子数据保存至上述第一数据緩存的某一 地址空间。
作为一种可选的实施方式, 上述地址信息具体可以是首地址信息, 即上述 地址信息都只包括地址空间的首地址信息, 例如: 上述第一地址信息具体可以 为上述第一地址空间的首地址信息,即第一地址信息为第一地址空间的第一个 地址的信息或者第一地址空间的前一部分地址的地址信息。上述第二地址信息 具体可以为上述第二地址空间的首地址信息。
上述设备可以是任何具备数据包传输功能和緩存数据功能的通信设备,。 例如: 连接以太网的设备或者 DMA, 具体可以是计算机、 服务器、 手机、 平 板电脑、 车载设备等具备数据包传输功能和緩存数据功能的通信设备。
上述技术方案中, 将数据包包括的数据解析为第一数据和第二数据, 第一 数据要求的处理效率高于第二数据要求的处理效率,将所述第二数据保存至第 二数据緩存,并将緩存所述第二数据的第一地址空间的第一地址信息和所述第 一数据保存至第一数据緩存,而第一数据緩存的访问效率高于第二数据緩存的 访问效率; 在第一数据緩存中获取第一数据, 以及在第二数据緩存中获取第二 数据, 并对所述第一数据和所述第二数据进行数据处理。从而实现对第一数据 处理时的处理效率就会高于对第二数据进行处理时的处理效率,以满足第一数 据要求的处理效率, 和满足第二数据要求的处理效率,从而实现对要求处理效 率不同的数据保存至不同访问效率的数据緩存, 以提高处理数据的性能。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到本发 明可以用硬件实现, 或固件实现, 或它们的组合方式来实现。 当使用软件实现 时,可以将上述功能存储在计算机可读介质中或作为计算机可读介质上的一个 或多个指令或代码进行传输。 计算机可读介质包括计算机存储介质和通信介 质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介 质。 存储介质可以是计算机能够存取的任何可用介质。 以此为例但不限于: 计 算机可读介质可以包括 RAM、 ROM, EEPROM、 CD-ROM或其他光盘存储、 磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据 结构形式的期望的程序代码并能够由计算机存取的任何其他介质。此外。任何 连接可以适当的成为计算机可读介质。 例如, 如果软件是使用同轴电缆、 光纤 光缆、 双绞线、 数字用户线(DSL )或者诸如红外线、 无线电和微波之类的无 线技术从网站、 服务器或者其他远程源传输的, 那么同轴电缆、 光纤光缆、 双 绞线、 DSL或者诸如红外线、 无线和微波之类的无线技术包括在所属介质的 定影中。 如本发明所使用的, 盘 (Disk )和碟(disc ) 包括压缩光碟(CD )、 激光碟、 光碟、 数字通用光碟(DVD )、 软盘和蓝光光碟, 其中盘通常磁性的 复制数据, 而碟则用激光来光学的复制数据。上面的组合也应当包括在计算机 可读介质的保护范围之内。
总之, 以上所述仅为本发明技术方案的较佳实施例而已, 并非用于限定本 发明的保护范围。凡在本发明的精神和原则之内,所作的任何修改、等同替换、 改进等, 均应包含在本发明的保护范围之内。

Claims

权 利 要 求
1、 一种数据包传输方法, 其特征在于, 包括:
接收发送端发送的数据包;
解析所述数据包得到第一数据和第二数据, 其中, 所述第一数据要求的处 理效率高于所述第二数据要求的处理效率;
将所述第二数据保存至第二数据緩存,并将緩存所述第二数据的第一地址 空间的第一地址信息和所述第一数据保存至第一数据緩存; 其中, 所述第一数 据緩存的访问效率高于所述第二数据緩存的访问效率;
当需要对所述第一数据和所述第二数据进行数据处理时,获取所述第一数 据緩存中的所述第一数据和所述第一地址信息,再根据所述第一地址信息获取 所述第二数据緩存中的所述第二数据,并对所述第一数据和所述第二数据进行 数据处理。
2、 如权利要求 1所述的方法, 其特征在于, 所述解析所述数据包得到第 一数据和第二数据, 包括:
解析所述数据包得到解析数据,从所述解析数据的起始位置开始截取长度 为 N的数据作为第一数据, 并将所述解析数据中除所述第一数据之外的所有 数据作为第二数据;
其中, 所述 N为预设指定的大于零的整数, 或者所述 N为所述发送端发 送所述数据包所携带的指示信息所指示的大于零的整数。
3、 如权利要求 1或 2所述的方法, 其特征在于, 所述将緩存所述第二数 据的第一地址空间的第一地址信息和所述第一数据保存至第一数据緩存, 包 括:
将所述第一数据保存至第一数据緩存的第二地址空间,并将緩存所述第二 数据的第一地址空间的第一地址信息更新至所述第一数据中预先指定的位置; 其中, 所述第二地址空间为预先指定的地址空间;
所述将所述第一数据保存至第一数据緩存的第二地址空间,并将緩存所述 第二数据的第一地址空间的第一地址信息更新至所述第一数据中预先指定的 位置之后,所述获取所述第一数据緩存中的所述第一数据和所述第一地址信息 之前, 所述方法还包括:
在用于表示所述数据包接收完成的完成消息中增加所述第二地址空间的 第二地址信息;或者在所述数据包的接收描述符增加所述第二地址空间的第二 地址信息;
所述获取所述第一数据緩存中的所述第一数据和所述第一地址信息, 包 括:
根据所述完成消息包括的或者所述接收描述符包括的所述第二地址信息, 在所述第二地址空间获取所述第一数据和所述第一地址信息。
4、 如权利要求 1或 2所述的方法, 其特征在于, 所述将緩存所述第二数 据的第一地址空间的第一地址信息和所述第一数据保存至第一数据緩存, 包 括:
将所述第一数据保存至第一数据緩存的第三地址空间,并将緩存所述第二 数据的第一地址空间的第一地址信息更新至所述第一数据中预先指定的位置; 其中, 所述第三地址空间为所述数据包的緩存描述符所指示的地址空间; 所述获取所述第一数据緩存中的所述第一数据和所述第一地址信息, 包 括:
根据所述緩存描述符在所述第三地址空间获取所述第一数据和所述第一 地址信息。
5、 如权利要求 1或 2所述的方法, 其特征在于, 所述第一数据包括至少 两个第一子数据;
所述将緩存所述第二数据的第一地址空间的第一地址信息和所述第一数 据保存至第一数据緩存, 包括:
将每个所述第一子数据保存至第一数据緩存的中该第一子数据对应的地 址空间,并将緩存所述第二数据的第一地址空间的第一地址信息更新至每个所 述第一子数据中预先指定的位置;
其中, 所述第一子数据对应的地址空间为预先指定的地址空间, 或者所述 第一子数据对应的地址空间为所述数据包的緩存描述符所指示的地址空间。
6、 如权利要求 5所述的方法, 其特征在于, 所述当需要对所述第一数据 和所述第二数据进行数据处理时,获取所述第一数据緩存中的所述第一数据和 所述第一地址信息,再根据所述第一地址信息获取所述第二数据緩存中的所述 第二数据, 并对所述第一数据和所述第二数据进行数据处理, 包括:
当目标层需要对所述第一数据和所述第二数据进行数据处理时,获取所述 第一数据緩存中的与所述目标层对应的第一子数据和所述第一地址信息,再根 据所述第一地址信息获取所述第二数据緩存中的所述第二数据,并对所述与所 述目标层对应的第一子数据和所述第二数据进行数据处理。
7、 一种数据包传输设备, 其特征在于, 包括: 接收单元、 解析单元、 緩 存单元和处理单元, 其中:
所述接收单元, 用于接收发送端发送的数据包;
所述解析单元, 用于解析所述数据包得到第一数据和第二数据, 其中, 所 述第一数据要求的处理效率高于所述第二数据要求的处理效率;
所述緩存单元, 用于将所述第二数据保存至第二数据緩存, 并将緩存所述 第二数据的第一地址空间的第一地址信息和所述第一数据保存至第一数据緩 存; 其中, 所述第一数据緩存的访问效率高于所述第二数据緩存的访问效率; 所述处理单元,用于当需要对所述第一数据和所述第二数据进行数据处理 时, 获取所述第一数据緩存中的所述第一数据和所述第一地址信息,再根据所 述第一地址信息获取所述第二数据緩存中的所述第二数据,并对所述第一数据 和所述第二数据进行数据处理。
8、 如权利要求 7所述的设备, 其特征在于, 所述解析单元具体用于解析 所述数据包得到解析数据, 从所述解析数据的起始位置开始截取长度为 N的 数据作为第一数据,并将所述解析数据中除所述第一数据之外的所有数据作为 送所述数据包所携带的指示信息所指示的大于零的整数。
9、 如权利要求 7或 8所述的设备, 其特征在于, 所述緩存单元具体用于 将所述第一数据保存至第一数据緩存的第二地址空间,并将緩存所述第二数据 的第一地址空间的第一地址信息更新至所述第一数据中预先指定的位置; 其 中, 所述第二地址空间为预先指定的地址空间;
所述装置还包括:
增加单元,用于在用于表示所述数据包接收完成的完成消息中增加所述第 二地址空间的第二地址信息;或者用于在所述数据包的接收描述符增加所述第 二地址空间的第二地址信息;
所述处理单元具体用于根据所述完成消息包括的或者所述接收描述符包 括的所述第二地址信息,在所述第二地址空间获取所述第一数据和所述第一地 址信息。
10、 如权利要求 7或 8所述的设备, 其特征在于, 所述緩存单元具体用于 将所述第一数据保存至第一数据緩存的第三地址空间,并将緩存所述第二数据 的第一地址空间的第一地址信息更新至所述第一数据中预先指定的位置; 其 中, 所述第三地址空间为所述数据包的緩存描述符所指示的地址空间;
所述处理单元具体用于根据所述緩存描述符在所述第三地址空间获取所 述第一数据和所述第一地址信息。
11、 如权利要求 7或 8所述的设备, 其特征在于, 所述第一数据包括至少 两个第一子数据;
所述緩存单元具体用于将每个所述第一子数据保存至第一数据緩存的中 该第一子数据对应的地址空间,并将緩存所述第二数据的第一地址空间的第一 地址信息更新至每个所述第一子数据中预先指定的位置;
其中, 所述第一子数据对应的地址空间为预先指定的地址空间, 或者所述 第一子数据对应的地址空间为所述数据包的緩存描述符所指示的地址空间。
12、 如权利要求 11所述的设备, 其特征在于, 所述处理单元具体用于当 目标层需要对所述第一数据和所述第二数据进行数据处理时,获取所述第一数 据緩存中的与所述目标层对应的第一子数据和所述第一地址信息,再根据所述 第一地址信息获取所述第二数据緩存中的所述第二数据,并对所述与所述目标 层对应的第一子数据和所述第二数据进行数据处理。
13、 一种数据包传输设备, 其特征在于, 包括: 通信接口和存储器, 以及 与所述通信接口和所述存储器连接的处理器, 所述存储器存储一组程序代码, 所述处理器用于调用所述存储器存储的程序执行如下操作:
接收发送端发送的数据包;
解析所述数据包得到第一数据和第二数据, 其中, 所述第一数据要求的处 理效率高于所述第二数据要求的处理效率;
将所述第二数据保存至第二数据緩存,并将緩存所述第二数据的第一地址 空间的第一地址信息和所述第一数据保存至第一数据緩存; 其中, 所述第一数 据緩存的访问效率高于所述第二数据緩存的访问效率;
当需要对所述第一数据和所述第二数据进行数据处理时,获取所述第一数 据緩存中的所述第一数据和所述第一地址信息,再根据所述第一地址信息获取 所述第二数据緩存中的所述第二数据,并对所述第一数据和所述第二数据进行 数据处理。
14、 如权利要求 13所述的设备, 其特征在于, 所述处理器执行的解析所 述数据包得到第一数据和第二数据的操作, 包括:
解析所述数据包得到解析数据,从所述解析数据的起始位置开始截取长度 为 N的数据作为第一数据, 并将所述解析数据中除所述第一数据之外的所有 数据作为第二数据;
其中, 所述 N为预设指定的大于零的整数, 或者所述 N为所述发送端发 送所述数据包所携带的指示信息所指示的大于零的整数。
15、 如权利要求 13或 14所述的设备, 其特征在于, 所述处理器执行的将 緩存所述第二数据的第一地址空间的第一地址信息和所述第一数据保存至第 一数据緩存的操作, 包括:
将所述第一数据保存至第一数据緩存的第二地址空间,并将緩存所述第二 数据的第一地址空间的第一地址信息更新至所述第一数据中预先指定的位置; 其中, 所述第二地址空间为预先指定的地址空间;
所述处理器在执行将所述第一数据保存至第一数据緩存的第二地址空间, 并将緩存所述第二数据的第一地址空间的第一地址信息更新至所述第一数据 中预先指定的位置的操作之后,在执行获取所述第一数据緩存中的所述第一数 据和所述第一地址信息的操作之前, 还用于执行如下操作:
在用于表示所述数据包接收完成的完成消息中增加所述第二地址空间的 第二地址信息;或者在所述数据包的接收描述符增加所述第二地址空间的第二 地址信息;
所述处理器执行的获取所述第一数据緩存中的所述第一数据和所述第一 地址信息的操作, 包括:
根据所述完成消息包括的或者所述接收描述符包括的所述第二地址信息, 在所述第二地址空间获取所述第一数据和所述第一地址信息。
16、 如权利要求 13或 14所述的设备, 其特征在于, 所述处理器执行的将 緩存所述第二数据的第一地址空间的第一地址信息和所述第一数据保存至第 一数据緩存的操作, 包括:
将所述第一数据保存至第一数据緩存的第三地址空间,并将緩存所述第二 数据的第一地址空间的第一地址信息更新至所述第一数据中预先指定的位置; 其中, 所述第三地址空间为所述数据包的緩存描述符所指示的地址空间; 所述处理器执行的获取所述第一数据緩存中的所述第一数据和所述第一 地址信息的操作, 包括:
根据所述緩存描述符在所述第三地址空间获取所述第一数据和所述第一 地址信息。
17、 如权利要求 13或 14所述的设备, 其特征在于, 所述第一数据包括至 少两个第一子数据;
所述处理器执行的将緩存所述第二数据的第一地址空间的第一地址信息 和所述第一数据保存至第一数据緩存的操作, 包括:
将每个所述第一子数据保存至第一数据緩存的中该第一子数据对应的地 址空间,并将緩存所述第二数据的第一地址空间的第一地址信息更新至每个所 述第一子数据中预先指定的位置;
其中, 所述第一子数据对应的地址空间为预先指定的地址空间, 或者所述 第一子数据对应的地址空间为所述数据包的緩存描述符所指示的地址空间。
18、 如权利要求 17所述的设备, 其特征在于, 所述处理器执行的当需要 对所述第一数据和所述第二数据进行数据处理时,获取所述第一数据緩存中的 所述第一数据和所述第一地址信息,再根据所述第一地址信息获取所述第二数 据緩存中的所述第二数据,并对所述第一数据和所述第二数据进行数据处理的 操作, 包括:
当目标层需要对所述第一数据和所述第二数据进行数据处理时,获取所述 第一数据緩存中的与所述目标层对应的第一子数据和所述第一地址信息,再根 据所述第一地址信息获取所述第二数据緩存中的所述第二数据,并对所述与所 述目标层对应的第一子数据和所述第二数据进行数据处理。
PCT/CN2013/077831 2013-06-25 2013-06-25 一种数据包传输方法及设备 WO2014205638A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2013/077831 WO2014205638A1 (zh) 2013-06-25 2013-06-25 一种数据包传输方法及设备
CN201380002426.4A CN104396195A (zh) 2013-06-25 2013-06-25 一种数据包传输方法及设备

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2013/077831 WO2014205638A1 (zh) 2013-06-25 2013-06-25 一种数据包传输方法及设备

Publications (1)

Publication Number Publication Date
WO2014205638A1 true WO2014205638A1 (zh) 2014-12-31

Family

ID=52140760

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/077831 WO2014205638A1 (zh) 2013-06-25 2013-06-25 一种数据包传输方法及设备

Country Status (2)

Country Link
CN (1) CN104396195A (zh)
WO (1) WO2014205638A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109815176A (zh) * 2019-01-14 2019-05-28 中国科学院上海高等研究院 特定dma数据发送方法、接收方法、系统及介质
CN112214429A (zh) * 2020-09-28 2021-01-12 武汉汇迪森信息技术有限公司 一种基于srio的数据传输装置及方法

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102117248A (zh) * 2011-03-09 2011-07-06 浪潮(北京)电子信息产业有限公司 一种缓存系统和在缓存系统中缓存数据的方法
CN103164667A (zh) * 2011-12-08 2013-06-19 三星电子株式会社 数据存储设备和数据管理方法

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7173863B2 (en) * 2004-03-08 2007-02-06 Sandisk Corporation Flash controller cache architecture
CN101222430B (zh) * 2008-01-24 2011-01-19 中兴通讯股份有限公司 一种高速多协议数据传输系统和方法
CN102737171B (zh) * 2011-04-12 2015-06-17 腾讯科技(深圳)有限公司 一种病毒文件存储的方法、装置及存储设备

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102117248A (zh) * 2011-03-09 2011-07-06 浪潮(北京)电子信息产业有限公司 一种缓存系统和在缓存系统中缓存数据的方法
CN103164667A (zh) * 2011-12-08 2013-06-19 三星电子株式会社 数据存储设备和数据管理方法

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109815176A (zh) * 2019-01-14 2019-05-28 中国科学院上海高等研究院 特定dma数据发送方法、接收方法、系统及介质
CN112214429A (zh) * 2020-09-28 2021-01-12 武汉汇迪森信息技术有限公司 一种基于srio的数据传输装置及方法
CN112214429B (zh) * 2020-09-28 2022-06-14 武汉汇迪森信息技术有限公司 一种基于srio的数据传输装置及方法

Also Published As

Publication number Publication date
CN104396195A (zh) 2015-03-04

Similar Documents

Publication Publication Date Title
US9203734B2 (en) Optimized bi-directional communication in an information centric network
US9591524B2 (en) Method and apparatus for transmitting data in network system, and data transmission system
CN104754003B (zh) 传输数据的方法及系统
CN110022264B (zh) 控制网络拥塞的方法、接入设备和计算机可读存储介质
US10341469B2 (en) Data transmission method and apparatus and data receiving method and apparatus
WO2018113373A1 (zh) 一种数据传输方法及装置
WO2014169860A1 (zh) 一种数据传输方法及设备
US9304939B2 (en) Method and multi-core communication processor for replacing data in system cache
US9794354B1 (en) System and method for communication between networked applications
US8589586B2 (en) Method and apparatus for managing transmission of TCP data segments
CN109922144B (zh) 用于处理数据的方法和装置
CN110581812A (zh) 一种数据报文的处理方法和装置
US10136375B2 (en) Method for service data management, apparatus, and system
WO2017148419A1 (zh) 数据传输方法及服务器
WO2018133172A1 (zh) 数据传输方法、装置、发送端、接收端及系统
EP3186959B1 (en) Enrichment of upper layer protocol content in tcp based session
US9407670B2 (en) Broadcasting media from a stationary source to multiple mobile devices over Wi-Fi
WO2015024373A1 (zh) 一种虚拟机通信方法及装置
WO2014205638A1 (zh) 一种数据包传输方法及设备
CN115176453A (zh) 报文缓存方法、内存分配器及报文转发系统
WO2015055008A1 (zh) 一种存储控制芯片及磁盘报文传输方法
WO2012094901A1 (zh) 超长短信发送/接收方法、装置及系统
WO2021103822A1 (zh) 用于获取共用最大分段大小mss的方法及装置
KR102519390B1 (ko) 캐시 장치, 상기 캐시 장치에서의 mmt 컨텐츠 전송 방법
WO2023279802A1 (zh) 协议数据传输方法、装置、网络节点及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13888453

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13888453

Country of ref document: EP

Kind code of ref document: A1