CN114979236A - Data transmission method, data transmission device, storage medium and electronic equipment - Google Patents

Data transmission method, data transmission device, storage medium and electronic equipment Download PDF

Info

Publication number
CN114979236A
CN114979236A CN202210516142.8A CN202210516142A CN114979236A CN 114979236 A CN114979236 A CN 114979236A CN 202210516142 A CN202210516142 A CN 202210516142A CN 114979236 A CN114979236 A CN 114979236A
Authority
CN
China
Prior art keywords
session
session information
information
message
target
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.)
Pending
Application number
CN202210516142.8A
Other languages
Chinese (zh)
Inventor
韦文
王章磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hillstone Networks Co Ltd
Original Assignee
Hillstone Networks 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 Hillstone Networks Co Ltd filed Critical Hillstone Networks Co Ltd
Priority to CN202210516142.8A priority Critical patent/CN114979236A/en
Publication of CN114979236A publication Critical patent/CN114979236A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding

Abstract

The application discloses a data transmission method, a data transmission device, a storage medium and electronic equipment. The method comprises the following steps: acquiring a message received by a network receiving port, and extracting message characteristics of the message; judging whether session information corresponding to the message characteristics exists in a target session library or not; under the condition that the session information exists in the target session library, acquiring the session information and sending the message to a network sending port indicated by the session information; and under the condition that the session information does not exist in the target session library, sending the message to the CPU, receiving the target session information and the message returned by the CPU, and sending the message to a network sending port indicated by the target session information according to the target session information. By the method and the device, the problem that the efficiency of processing the message through the CPU is low in the related technology is solved.

Description

Data transmission method, device, storage medium and electronic equipment
Technical Field
The present application relates to the field of data processing, and in particular, to a data transmission method, an apparatus, a storage medium, and an electronic device.
Background
After the network device receives the message, the session corresponding to the message needs to be acquired, and the message is operated according to the session content, so that the message is processed. The current method for processing the message mainly comprises the following steps: and storing the session through a DRAM in the CPU, and acquiring the session corresponding to the message through the CPU after receiving the message, thereby obtaining the session content corresponding to the message and processing the message.
However, since the IPv 4-based protocol processes data of 64 to 128 bytes per session, the IPv 6-based protocol requires more data, the maximum number of sessions required by a high-performance system can be as many as tens of millions or more, and thus the memory of the DRAM occupied by the sessions is large. Moreover, because each message is processed by the CPU, the CPU needs to search for a matching session in the DRAM, and when the number of messages is large, the speed of processing the messages by the CPU is limited by the speed of the DRAM of the read/write system, so that the CPU is in an idle state, thereby affecting the working efficiency of the CPU and the processing efficiency of the messages.
Aiming at the problem of low message processing efficiency through a CPU in the related technology, an effective solution is not provided at present.
Disclosure of Invention
The application provides a data transmission method, a data transmission device, a storage medium and electronic equipment, which are used for solving the problem of low efficiency of message processing through a CPU in the related technology.
According to one aspect of the present application, a data transmission method is provided. The method comprises the following steps: acquiring a message received by a network receiving port, and extracting message characteristics of the message; judging whether session information corresponding to the message characteristics exists in a target session library or not; under the condition that the session information exists in the target session library, acquiring the session information and sending the message to a network sending port indicated by the session information; and under the condition that the session information does not exist in the target session library, sending the message to the CPU, receiving the target session information and the message returned by the CPU, and sending the message to a network sending port indicated by the target session information according to the target session information, wherein the target session information is the session information generated by the CPU according to the message.
Optionally, the message characteristic includes quintuple information, and determining whether session information exists in the target session library includes: generating a hash value according to the quintuple information; judging whether session information corresponding to the hash value is stored in the target session library; under the condition that the session information corresponding to the hash value is not stored in the target session library, determining that the session information corresponding to the message characteristics does not exist in the target session library; respectively acquiring quintuple information of each session information under the condition that at least one session information corresponding to the hash value is stored in the session library to obtain at least one target quintuple information; judging whether quintuple information identical to the quintuple information exists in at least one target quintuple information or not; determining that session information corresponding to message characteristics does not exist in a target session library under the condition that five-tuple information identical to the five-tuple information does not exist in at least one target five-tuple information; and under the condition that the five-tuple information identical to the five-tuple information exists in at least one target five-tuple information, determining that the session information corresponding to the message characteristics exists in the target session library.
Optionally, after sending the packet to the CPU and sending the packet to the network sending port indicated by the session information in the CPU, the method further includes: creating a session space corresponding to the hash value in a target session library to obtain a target session space, wherein the session library comprises a plurality of session spaces; and storing the session information into the target session space according to the quintuple information.
Optionally, before determining whether session information corresponding to the message feature exists in the target session library, the method further includes: acquiring a plurality of pieces of preset session information, and acquiring a preset hash value generated by quintuple information of each piece of preset session information to obtain a plurality of preset hash values; packing a plurality of pieces of preset session information into a preset session information set, wherein each piece of preset session information is associated with a corresponding preset hash value; and storing each piece of preset session information in the preset session information set into a session space corresponding to the associated preset hash value through the CPU to obtain a target session library.
Optionally, the step of storing, by the CPU, each piece of preset session information in the preset session information set into a session space corresponding to the associated preset hash value to obtain the target session library includes: the CPU stores each piece of preset session information into a session space corresponding to the associated preset hash value through the Ethernet port; or the CPU stores each piece of preset session information into the session space corresponding to the associated preset hash value through the PCIe bridge.
Optionally, before determining whether session information corresponding to the message feature exists in the target session library, the method further includes: judging whether the message carries a preset identifier or not; under the condition that the session information carries a preset identifier, sending the message to a CPU (central processing unit) and sending the message to a network sending port indicated by the session information in the CPU; and under the condition that the session information does not carry a preset identifier, executing the step of judging whether the session information corresponding to the message characteristics exists in the target session library.
Optionally, before creating a session space corresponding to the hash value in the target session library and obtaining the target session space, the method further includes: judging whether the quantity of the stored session information in the CPU cache is greater than or equal to a preset threshold value or not; under the condition that the number of the session information is larger than or equal to a preset threshold value, a step of creating a session space corresponding to the hash value in a target session library to obtain a target session space is executed; and storing the session information into a CPU cache under the condition that the number of the session information is less than a preset threshold value.
According to another aspect of the present application, a data transmission apparatus is provided. The device includes: the first acquisition unit is used for acquiring the message received by the network receiving port and extracting the message characteristics of the message; the first judging unit is used for judging whether the session information corresponding to the message characteristics exists in the target session library or not; the first sending unit is used for acquiring the session information under the condition that the session information exists in the target session library and sending the message to a network sending port indicated by the session information; and the second sending unit is used for sending the message to the CPU under the condition that the session information does not exist in the target session library, receiving the target session information and the message returned by the CPU, and sending the message to a network sending port indicated by the target session information according to the target session information, wherein the target session information is the session information generated by the CPU according to the message.
According to another aspect of the embodiments of the present invention, there is also provided a computer storage medium for storing a program, where the program controls a device in which the computer storage medium is located to execute a data transmission method when the program runs.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including one or more processors and a memory; the memory has stored therein computer readable instructions, and the processor is configured to execute the computer readable instructions, wherein the computer readable instructions when executed perform a data transmission method.
Through the application, the following steps are adopted: acquiring a message received by a network receiving port, and extracting message characteristics of the message; judging whether session information corresponding to the message characteristics exists in a target session library or not; under the condition that the session information exists in the target session library, acquiring the session information and sending the message to a network sending port indicated by the session information; and under the condition that the session information does not exist in the target session library, sending the message to the CPU, receiving the target session information and the message returned by the CPU, and sending the message to a network sending port indicated by the target session information according to the target session information, wherein the target session information is the session information generated by the CPU according to the message. The problem of low efficiency of processing the message through the CPU in the related technology is solved. By setting the session library, part of the session information is stored in the session library, whether the session information corresponding to the message is in the session library is judged when the message is received, and the session information in the session library can be directly called under the condition of the session library, so that the message does not need to be acquired through a CPU (central processing unit), and the effects of reducing the running pressure of the CPU and improving the processing efficiency of the message are further achieved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this application, illustrate embodiments of the application and, together with the description, serve to explain the application and are not intended to limit the application. In the drawings:
fig. 1 is a flowchart of a data transmission method provided according to an embodiment of the present application;
fig. 2 is a system architecture diagram corresponding to an alternative data transmission method provided in an embodiment of the present application;
FIG. 3 is a schematic diagram of an alternative fixed hash table provided in accordance with an embodiment of the present application;
fig. 4 is a schematic diagram of a data transmission device according to an embodiment of the present application.
Detailed Description
It should be noted that, in the present application, the embodiments and features of the embodiments may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the accompanying drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be used. Moreover, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that relevant information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for presentation, analyzed data, etc.) referred to in the present disclosure are information and data that are authorized by the user or sufficiently authorized by various parties. For example, an interface is provided between the system and the relevant user or institution, and before obtaining the relevant information, an obtaining request needs to be sent to the user or institution through the interface, and after receiving the consent information fed back by the user or institution, the relevant information needs to be obtained.
It should be noted that the data transmission method, the data transmission apparatus, the storage medium, and the electronic device determined in the present disclosure may be used in the data processing field, and may also be used in any field other than the data processing field.
For convenience of description, some terms or expressions referred to in the embodiments of the present application are explained below:
an Ethernet port: a port for a network data connection.
PCIe bridge: i.e., PCIe lanes, can be used for data transmission, and the main advantage is high data transmission rate.
According to an embodiment of the present application, a data transmission method is provided.
Fig. 1 is a flowchart of a data transmission method according to an embodiment of the present application. As shown in fig. 1, the method comprises the steps of:
step S102, obtaining the message received by the network receiving port, and extracting the message characteristic of the message.
It should be noted that the acceleration chip may be used to obtain the message, where the acceleration chip may be an FPGA (Field Programmable Gate Array) chip or an ASIC (Application Specific Integrated Circuit) chip. Fig. 2 is a system architecture diagram corresponding to an optional data transmission method provided in an embodiment of the present application, and as shown in fig. 2, an acceleration chip is connected to a network receiving port, a network sending port, a CPU, and a session library, respectively, and the acceleration chip may acquire a message received by the network receiving port, send the message to the network sending port, and also acquire session information in the session library.
Specifically, after obtaining the packet received by the network receiving port, the acceleration chip may obtain feature information in the packet information, for example, obtain quintuple information in the packet information, so as to obtain session information corresponding to the packet from the session library according to the quintuple information.
In order to avoid frequently obtaining session information from the CPU, optionally, in the data transmission method provided in the embodiment of the present application, before determining whether the session information corresponding to the message feature exists in the target session library, the method further includes: acquiring a plurality of pieces of preset session information, and acquiring a preset hash value generated by quintuple information of each piece of preset session information to obtain a plurality of preset hash values; packing a plurality of pieces of preset session information into a preset session information set, wherein each piece of preset session information is associated with a corresponding preset hash value; and storing each piece of preset session information in the preset session information set into a session space corresponding to the associated preset hash value through the CPU to obtain a target session library.
It should be noted that, since the session information corresponding to each acquired packet needs to be acquired from the CPU cache, in order to reduce the CPU occupancy, part of the commonly used session information may be stored in the session library, and the session information corresponding to the packet is directly acquired in the session library according to the quintuple information after the acceleration chip receives the packet and acquires the quintuple information, thereby avoiding acquiring the session information through the CPU, and improving the acquisition efficiency of the session information.
Specifically, the preset session information may be session information with a higher called frequency, five-tuple information of each piece of session information is acquired, and then a hash value may be generated according to a preset calculation rule according to data in the five-tuple information, so as to obtain a hash value corresponding to each piece of preset session information. And then, packaging all the preset session information, and sending the preset session information set to a session library through the acceleration chip.
Further, a session library may store session information by using a data structure of a fixed hash table, each hash value corresponds to the same amount of session information, and fig. 3 is a schematic diagram of an optional fixed hash table provided according to an embodiment of the present application, where as shown in fig. 3, a chain table head of each hash chain is a hash value, session spaces included in each hash chain are the same, and each session space stores one piece of session information. After the preset session set is sent to the session library, the session library generates a corresponding hash chain and a fixed number of session spaces according to the hash value of each preset session information in the preset session set, at this time, each preset session information can be determined according to the hash value and stored in the corresponding session space, and the storage position is returned to the CPU, so that the CPU can obtain the position where each session information is stored, thereby obtaining the target session library.
It should be noted that, when the hash table is used to store session information, the session storage space corresponding to each hash value in the hash table is usually not limited in number, that is, when the number of session information with the same hash value is very large, the number of session storage space corresponding to each hash value is also very large, so that when the session information is read, since the number of session information is unknown, after the hash value is obtained, it is necessary to sequentially perform traversal comparison on each session information in the hash chain table corresponding to the hash value, and after the comparison is successful, obtain the session information. However, this method needs to consume a lot of time in the process of traversing the narrative session information, which affects the efficiency of message processing. In the technical scheme, the fixed hash table is used for storing the session information, at the moment, when the session information is acquired, the session information can be directly acquired according to the storage position of each session, and the session information is acquired from the CPU when the corresponding session information is not stored in the session library, so that the pipeline operation for processing the message can not be influenced by time delay generated by traversal, and the message processing efficiency is improved.
And step S104, judging whether the session information corresponding to the message characteristics exists in the target session library.
Specifically, after the target session library is generated, after the message is received and the quintuple information corresponding to the message is obtained, traversal may be performed in the session library according to the quintuple information, so as to obtain the session information corresponding to the message.
In order to determine whether the session library has session information corresponding to a packet quickly and accurately, optionally, in the data transmission method provided in the embodiment of the present application, the packet characteristics include quintuple information, and determining whether the session information exists in the target session library includes: generating a hash value according to the quintuple information; judging whether session information corresponding to the hash value is stored in the target session library; under the condition that the session information corresponding to the hash value is not stored in the target session library, determining that the session information corresponding to the message characteristics does not exist in the target session library; respectively acquiring quintuple information of each session information under the condition that at least one session information corresponding to the hash value is stored in the session library to obtain at least one target quintuple information; judging whether quintuple information identical to the quintuple information exists in at least one target quintuple information or not; determining that session information corresponding to message characteristics does not exist in a target session library under the condition that five-tuple information identical to the five-tuple information does not exist in at least one target five-tuple information; and determining that the session information corresponding to the message characteristics exists in the target session library under the condition that five-tuple information identical to the five-tuple information exists in at least one target five-tuple information.
Specifically, after the quintuple information of the packet is obtained, a hash value corresponding to the packet may be generated according to the quintuple information by a preset calculation rule, and the hash value is traversed in the target session library, so as to determine whether a hash chain having the same hash value as the packet exists in the target session library, and in the absence of a hash chain having the same hash value as the packet, it is determined that the session information corresponding to the packet is not stored in the target session library, and in the presence of a hash chain having the same hash value as the packet, the quintuple information of each session information in the hash chain is obtained, and the quintuple information of each session information is compared with the quintuple information of the packet, and in the presence of the same quintuple information of the session information as the quintuple information of the packet, the session information corresponding to the packet may be obtained, and in the absence of the same quintuple information as the packet, then the session information corresponding to the message is judged not to be stored in the target session library. The embodiment achieves the purpose of rapidly and accurately determining whether the session information corresponding to the message exists in the target session library, thereby improving the acquisition efficiency of the session information.
And step S106, acquiring the session information under the condition that the session information exists in the target session library, and sending the message to a network sending port indicated by the session information.
Specifically, when the session information corresponding to the message exists in the target session library, the session information may be directly obtained through the acceleration chip, and the content in the session information is read, so as to perform a corresponding operation on the message, for example, perform an operation such as correspondingly modifying the message content, designating a destination port for sending the message, and so on, so as to send the message information to the network sending port indicated in the session information, thereby performing a corresponding operation on the message, so that the network sending port may receive the message after the corresponding operation is performed.
And S108, under the condition that the session information does not exist in the target session library, sending the message to the CPU, receiving the target session information and the message returned by the CPU, and sending the message to a network sending port indicated by the target session information according to the target session information, wherein the target session information is the session information generated by the CPU according to the message.
Specifically, under the condition that the session information corresponding to the message does not exist in the target session library, the acceleration chip needs to send the message to the CPU, and obtains the session information corresponding to the message in the CPU cache, after the acceleration chip sends the message to the CPU, the acceleration chip does not hold the message but forwards the message to the CPU, under the condition that the CPU cache also has no session information corresponding to the message, the CPU can generate target session information corresponding to the message according to a corresponding program, and sends the message and the target session information to the acceleration chip, the acceleration chip can execute corresponding operation to the message according to the target session information, and sending the message to a corresponding network sending port, wherein the network sending port may be carried in the target session information, or the network sending port may be sent to the acceleration chip together when the CPU sends the message and the target session information to the acceleration chip.
According to the data transmission method provided by the embodiment of the application, the message received by the network receiving port is obtained, and the message characteristic of the message is extracted; judging whether session information corresponding to the message characteristics exists in a target session library or not; under the condition that the session information exists in the target session library, acquiring the session information and sending the message to a network sending port indicated by the session information; and under the condition that the session information does not exist in the target session library, sending the message to the CPU, receiving the target session information and the message returned by the CPU, and sending the message to a network sending port indicated by the target session information according to the target session information, wherein the target session information is the session information generated by the CPU according to the message. The problem of low efficiency of processing the message through the CPU in the related technology is solved. By setting the session library, part of the session information is stored in the session library, whether the session information corresponding to the message is in the session library is judged when the message is received, and the session information in the session library can be directly called under the condition of the session library, so that the message does not need to be acquired through a CPU (central processing unit), thereby achieving the effects of reducing the operating pressure of the CPU and improving the processing efficiency of the message.
Optionally, in the data transmission method provided in the embodiment of the present application, the obtaining, by the CPU, each piece of preset session information in the preset session information set to a session space corresponding to the associated preset hash value includes: the CPU stores each piece of preset session information into a session space corresponding to the associated preset hash value through the Ethernet port; or, the CPU stores each piece of preset session information into the session space corresponding to the associated preset hash value through the PCIe bridge.
Specifically, because the session library used in the technical scheme stores the session information by using the data structure of the fixed hash table, the address information of the session space corresponding to each piece of session information in the session library is known in the CPU, so that when the CPU sends the session information to the session library, the session information can be directly sent to the session library according to the known address information in the CPU without first obtaining the address information of the session information, and therefore, two data transmission methods, namely an ethernet port with low stability and a PCIe bridge with high stability, can be used for data transmission, thereby avoiding the phenomenon that the session information cannot be sent to the session library under the condition that the PCIe bridge is abnormal, and ensuring the timeliness of data transmission.
Optionally, in the data transmission method provided in the embodiment of the present application, before determining whether session information corresponding to a message feature exists in the target session library, the method further includes: judging whether the message carries a preset identifier or not; under the condition that the session information carries a preset identifier, the steps of sending the message to a CPU and sending the message to a network sending port indicated by the session information in the CPU are executed; and under the condition that the session information does not carry a preset identifier, executing the step of judging whether the session information corresponding to the message characteristics exists in the target session library.
Specifically, since the message stored in the session library corresponding to the session information may need to be specially managed during a certain transmission, after the message is received, it may be determined whether the message carries a preset identifier, and under the condition that the session information carries the preset identifier, it is verified that the message needs to be specially managed, so that the quintuple information is not determined, the message is directly sent to the CPU, and under the condition that the session information does not carry the preset identifier, the quintuple information is continuously obtained and determined. The embodiment achieves the effect of screening the special messages, thereby improving the efficiency of message operation.
Optionally, in the data transmission method provided in the embodiment of the present application, after sending the packet to the CPU and sending the packet to the network sending port indicated by the session information in the CPU, the method further includes: creating a session space corresponding to the hash value in a target session library to obtain a target session space, wherein the session library comprises a plurality of session spaces; and storing the session information into the target session space according to the quintuple information.
Specifically, after the CPU creates the session information corresponding to the packet, the session information may be stored in the target session library, so that when the packet is received again, the session information corresponding to the packet may be directly obtained through the target session library, thereby improving the efficiency of processing the packet.
Optionally, in the data transmission method provided in the embodiment of the present application, before creating a session space corresponding to the hash value in the target session library and obtaining the target session space, the method further includes: judging whether the quantity of the stored session information in the CPU cache is greater than or equal to a preset threshold value or not; under the condition that the number of the session information is larger than or equal to a preset threshold value, a step of creating a session space corresponding to the hash value in a target session library to obtain a target session space is executed; and storing the session information into a CPU cache under the condition that the number of the session information is less than a preset threshold value.
Specifically, since the CPU needs to perform a write operation to store the session information into the session library, the CPU may frequently work by immediately transmitting the session information into the session library every time one session information is generated, thereby affecting the operating efficiency of the CPU. Therefore, after one piece of session information is generated, the session information can be stored in the CPU cache, and after a preset number of pieces of session information are cached in the CPU cache, a plurality of pieces of session information are packaged and sent to the session library, so that the CPU can store a large number of pieces of session information into the session library only by performing one-time writing operation, the operation amount of the CPU is reduced, and the execution efficiency of the CPU is improved.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be performed in an order different than presented herein.
The embodiment of the present application further provides a data transmission device, and it should be noted that the data transmission device in the embodiment of the present application may be used to execute the method for data transmission provided in the embodiment of the present application. The following describes a data transmission device provided in an embodiment of the present application.
Fig. 4 is a schematic diagram of a data transmission device according to an embodiment of the present application. As shown in fig. 4, the apparatus includes: a first acquiring unit 41, a first judging unit 42, a first transmitting unit 43, and a second transmitting unit 44.
The first obtaining unit 41 is configured to obtain a message received by a network receiving port, and extract a message feature of the message.
The first determining unit 42 is configured to determine whether session information corresponding to the message feature exists in the target session library.
And a first sending unit 43, configured to, in a case that the session information exists in the target session library, obtain the session information, and send the packet to the network sending port indicated by the session information.
And a second sending unit 44, configured to send the message to the CPU when session information does not exist in the target session library, receive target session information and a message returned by the CPU, and send the message to a network sending port indicated by the target session information according to the target session information, where the target session information is session information generated by the CPU according to the message.
In the data transmission apparatus provided in the embodiment of the present application, a first obtaining unit 41 obtains a message received by a network receiving port, and extracts a message feature of the message; the first judging unit 42 judges whether the session information corresponding to the message feature exists in the target session library; the first sending unit 43 obtains the session information when the session information exists in the target session library, and sends the message to the network sending port indicated by the session information; the second sending unit 44 sends the message to the CPU when the session information does not exist in the target session library, receives the target session information and the message returned by the CPU, and sends the message to the network sending port indicated by the target session information according to the target session information, where the target session information is the session information generated by the CPU according to the message. The problem of low efficiency of processing the message through the CPU in the related technology is solved. By setting the session library, part of the session information is stored in the session library, whether the session information corresponding to the message is in the session library is judged when the message is received, and the session information in the session library can be directly called under the condition of the session library, so that the message does not need to be acquired through a CPU (central processing unit), thereby achieving the effects of reducing the operating pressure of the CPU and improving the processing efficiency of the message.
Optionally, in the data transmission apparatus provided in this embodiment of the present application, the packet feature includes quintuple information, and the first determining unit 42 includes: the generating module is used for generating a hash value according to the quintuple information; the first judgment module is used for judging whether the session information corresponding to the hash value is stored in the target session library; the first determining module is used for determining that the session information corresponding to the message characteristics does not exist in the target session library under the condition that the session information corresponding to the hash value is not stored in the target session library; the acquisition module is used for respectively acquiring quintuple information of each session information under the condition that at least one session information corresponding to the hash value is stored in the session library to obtain at least one target quintuple information; the second judgment module is used for judging whether quintuple information identical to the quintuple information exists in at least one target quintuple information or not; the second determining module is used for determining that the session information corresponding to the message characteristics does not exist in the target session library under the condition that five-tuple information identical to the five-tuple information does not exist in at least one target five-tuple information; and the third determining module is used for determining that the session information corresponding to the message characteristics exists in the target session library under the condition that five-tuple information identical to the five-tuple information exists in at least one target five-tuple information.
Optionally, in the data transmission device provided in the embodiment of the present application, the device further includes: the creating unit is used for creating a session space corresponding to the hash value in a target session library to obtain a target session space, wherein the session library comprises a plurality of session spaces; and the first storage unit is used for storing the session information into the target session space according to the quintuple information.
Optionally, in the data transmission device provided in the embodiment of the present application, the device further includes: the second acquisition unit is used for acquiring a plurality of pieces of preset session information and acquiring a preset hash value generated by quintuple information of each piece of preset session information to obtain a plurality of preset hash values; the device comprises a packing unit, a processing unit and a processing unit, wherein the packing unit is used for packing a plurality of pieces of preset session information into a preset session information set, and each piece of preset session information is associated with a corresponding preset hash value; and the second storage unit is used for storing each piece of preset session information in the preset session information set into the session space corresponding to the associated preset hash value through the CPU to obtain a target session library.
Optionally, in the data transmission device provided in the embodiment of the present application, the second storage unit includes: the first storage module is used for storing each piece of preset session information into a session space corresponding to the associated preset hash value through the Ethernet port by the CPU; or, the second storage module is configured to store, by the CPU through the PCIe bridge, each piece of preset session information into a session space corresponding to the associated preset hash value.
Optionally, in the data transmission device provided in the embodiment of the present application, the device further includes: the second judging unit is used for judging whether the message carries a preset identifier or not; the first execution unit is used for sending the message to the CPU and sending the message to a network sending port indicated by the session information in the CPU under the condition that the session information carries a preset identifier; and the second execution unit is used for executing the step of judging whether the session information corresponding to the message characteristics exists in the target session library or not under the condition that the session information does not carry the preset identification.
Optionally, in the data transmission device provided in the embodiment of the present application, the device further includes: a third judging unit, configured to judge whether the number of session information stored in the CPU cache is greater than or equal to a preset threshold; a third execution unit, configured to, when the number of session information is greater than or equal to a preset threshold, execute a step of creating a session space corresponding to the hash value in the target session library to obtain a target session space; and the third storage unit is used for storing the session information into the CPU cache under the condition that the number of the session information is smaller than a preset threshold value.
The data transmission device comprises a processor and a memory, wherein the first acquiring unit 41, the first judging unit 42, the first sending unit 43, the second sending unit 44 and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more than one, and the problem of low message processing efficiency through a CPU in the related technology is solved by adjusting kernel parameters.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
An embodiment of the present invention provides a computer-readable storage medium on which a program is stored, the program implementing the data transmission method when executed by a processor.
The embodiment of the invention provides a processor, which is used for running a program, wherein the data transmission method is executed when the program runs.
The embodiment of the invention provides electronic equipment, which comprises a processor, a memory and a program which is stored on the memory and can run on the processor, wherein the processor executes the program and realizes the following steps: acquiring a message received by a network receiving port, and extracting message characteristics of the message; judging whether session information corresponding to the message characteristics exists in a target session library or not; under the condition that the session information exists in the target session library, acquiring the session information and sending the message to a network sending port indicated by the session information; and under the condition that the session information does not exist in the target session library, sending the message to the CPU, receiving the target session information and the message returned by the CPU, and sending the message to a network sending port indicated by the target session information according to the target session information, wherein the target session information is the session information generated by the CPU according to the message. The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application also provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device: acquiring a message received by a network receiving port, and extracting message characteristics of the message; judging whether session information corresponding to the message characteristics exists in a target session library or not; under the condition that the session information exists in the target session library, acquiring the session information and sending the message to a network sending port indicated by the session information; and under the condition that the session information does not exist in the target session library, sending the message to the CPU, receiving the target session information and the message returned by the CPU, and sending the message to a network sending port indicated by the target session information according to the target session information, wherein the target session information is the session information generated by the CPU according to the message.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A method of data transmission, comprising:
acquiring a message received by a network receiving port, and extracting message characteristics of the message;
judging whether session information corresponding to the message characteristics exists in a target session library or not;
under the condition that the session information exists in the target session library, acquiring the session information and sending the message to a network sending port indicated by the session information;
and under the condition that the session information does not exist in the target session library, sending the message to a CPU, receiving target session information and the message returned by the CPU, and sending the message to a network sending port indicated by the target session information according to the target session information, wherein the target session information is the session information generated by the CPU according to the message.
2. The method of claim 1, wherein the packet characteristics include quintuple information, and wherein determining whether the session information exists in a target session repository comprises:
generating a hash value according to the quintuple information;
judging whether the session information corresponding to the hash value is stored in the target session library or not;
determining that the session information corresponding to the message features does not exist in the target session library under the condition that the session information corresponding to the hash value is not stored in the target session library;
respectively acquiring quintuple information of each session information under the condition that at least one session information corresponding to the hash value is stored in the session library to obtain at least one target quintuple information;
judging whether quintuple information identical to the quintuple information exists in at least one target quintuple information or not;
determining that session information corresponding to the message characteristics does not exist in the target session library under the condition that five-tuple information identical to the five-tuple information does not exist in at least one piece of target five-tuple information;
and determining that the session information corresponding to the message characteristics exists in the target session library under the condition that five-tuple information identical to the five-tuple information exists in at least one piece of target five-tuple information.
3. The method according to claim 2, wherein after sending the message to a CPU and sending the message to a network sending port indicated by session information in the CPU, the method further comprises:
creating a session space corresponding to the hash value in the target session library to obtain a target session space, wherein the session library comprises a plurality of session spaces;
and storing the session information into the target session space according to the quintuple information.
4. The method according to claim 2, wherein before determining whether session information corresponding to the packet feature exists in a target session library, the method further comprises:
acquiring a plurality of pieces of preset session information, and acquiring a preset hash value generated by quintuple information of each piece of preset session information to obtain a plurality of preset hash values;
packing a plurality of pieces of preset session information into a preset session information set, wherein each piece of preset session information is associated with a corresponding preset hash value;
and storing each piece of preset session information in the preset session information set into a session space corresponding to the associated preset hash value through the CPU to obtain the target session library.
5. The method according to claim 4, wherein the obtaining, by the CPU, the target session library by storing each piece of the preset session information in the preset session information set into a session space corresponding to the associated preset hash value comprises:
the CPU stores each piece of preset session information into a session space corresponding to the associated preset hash value through an Ethernet port; or the like, or, alternatively,
and the CPU stores each piece of preset session information into a session space corresponding to the associated preset hash value through a PCIe bridge.
6. The method according to claim 1, wherein before determining whether session information corresponding to the message feature exists in a target session library, the method further comprises:
judging whether the message carries a preset identifier or not;
under the condition that the session information carries the preset identification, the steps of sending the message to a CPU and sending the message to a network sending port indicated by the session information in the CPU are executed;
and under the condition that the session information does not carry the preset identification, executing the step of judging whether the session information corresponding to the message characteristics exists in a target session library.
7. The method according to claim 3, wherein before creating the session space corresponding to the hash value in the target session library to obtain the target session space, the method further comprises:
judging whether the quantity of the session information stored in the CPU cache is greater than or equal to a preset threshold value or not;
under the condition that the number of the session information is larger than or equal to the preset threshold value, a step of creating a session space corresponding to the hash value in the target session library to obtain a target session space is executed;
and storing the session information into the CPU cache under the condition that the number of the session information is smaller than the preset threshold value.
8. A data transmission apparatus, comprising:
the first acquisition unit is used for acquiring a message received by a network receiving port and extracting the message characteristics of the message;
the first judging unit is used for judging whether the session information corresponding to the message characteristics exists in a target session library or not;
a first sending unit, configured to, when the session information exists in the target session library, obtain the session information, and send the packet to a network sending port indicated by the session information;
and a second sending unit, configured to send the packet to a CPU under a condition that the session information does not exist in the target session library, receive target session information and the packet returned by the CPU, and send the packet to a network sending port indicated by the target session information according to the target session information, where the target session information is session information generated by the CPU according to the packet.
9. A computer storage medium for storing a program, wherein the program when executed controls an apparatus in which the computer storage medium is located to execute the data transmission method according to any one of claims 1 to 7.
10. An electronic device comprising one or more processors and memory storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the data transmission method of any one of claims 1 to 7.
CN202210516142.8A 2022-05-12 2022-05-12 Data transmission method, data transmission device, storage medium and electronic equipment Pending CN114979236A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210516142.8A CN114979236A (en) 2022-05-12 2022-05-12 Data transmission method, data transmission device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210516142.8A CN114979236A (en) 2022-05-12 2022-05-12 Data transmission method, data transmission device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN114979236A true CN114979236A (en) 2022-08-30

Family

ID=82980842

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210516142.8A Pending CN114979236A (en) 2022-05-12 2022-05-12 Data transmission method, data transmission device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN114979236A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115878214A (en) * 2022-11-30 2023-03-31 广西壮族自治区信息中心 Application software access method, device, equipment and storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101316271A (en) * 2008-07-04 2008-12-03 华为技术有限公司 Method for implementing information backup, fire wall and network system
CN101562784A (en) * 2008-04-14 2009-10-21 华为技术有限公司 Method, device and system for distributing messages
JP2010219637A (en) * 2009-03-13 2010-09-30 Kawasaki Microelectronics Inc Packet repeater
US20120215926A1 (en) * 2011-02-22 2012-08-23 Cisco Technology, Inc. Mechanism for Quick Data Path Setup by Cloning Session Content
WO2016106592A1 (en) * 2014-12-30 2016-07-07 华为技术有限公司 Method and device for feature information analysis
CN106302179A (en) * 2016-07-29 2017-01-04 杭州迪普科技有限公司 A kind of method and device managing concordance list
CN106534287A (en) * 2016-10-27 2017-03-22 杭州迪普科技股份有限公司 Session table item management method and device
CN107124402A (en) * 2017-04-12 2017-09-01 杭州迪普科技股份有限公司 A kind of method and apparatus of packet filtering
CN108055202A (en) * 2017-12-07 2018-05-18 锐捷网络股份有限公司 A kind of message processor and method
CN113542445A (en) * 2021-05-28 2021-10-22 新华三信息安全技术有限公司 Address translation method, device, equipment and machine readable storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101562784A (en) * 2008-04-14 2009-10-21 华为技术有限公司 Method, device and system for distributing messages
CN101316271A (en) * 2008-07-04 2008-12-03 华为技术有限公司 Method for implementing information backup, fire wall and network system
JP2010219637A (en) * 2009-03-13 2010-09-30 Kawasaki Microelectronics Inc Packet repeater
US20120215926A1 (en) * 2011-02-22 2012-08-23 Cisco Technology, Inc. Mechanism for Quick Data Path Setup by Cloning Session Content
WO2016106592A1 (en) * 2014-12-30 2016-07-07 华为技术有限公司 Method and device for feature information analysis
CN106302179A (en) * 2016-07-29 2017-01-04 杭州迪普科技有限公司 A kind of method and device managing concordance list
CN106534287A (en) * 2016-10-27 2017-03-22 杭州迪普科技股份有限公司 Session table item management method and device
CN107124402A (en) * 2017-04-12 2017-09-01 杭州迪普科技股份有限公司 A kind of method and apparatus of packet filtering
CN108055202A (en) * 2017-12-07 2018-05-18 锐捷网络股份有限公司 A kind of message processor and method
CN113542445A (en) * 2021-05-28 2021-10-22 新华三信息安全技术有限公司 Address translation method, device, equipment and machine readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"云计算时代虚拟化技术研究", 电信技术, no. 10 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115878214A (en) * 2022-11-30 2023-03-31 广西壮族自治区信息中心 Application software access method, device, equipment and storage medium
CN115878214B (en) * 2022-11-30 2023-10-27 广西壮族自治区信息中心 Application software access method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
US11605087B2 (en) Method and apparatus for identifying identity information
CN107040585B (en) Service checking method and device
CN110943961B (en) Data processing method, device and storage medium
CN110768912B (en) API gateway current limiting method and device
US20160119198A1 (en) Deep Packet Inspection Method and Device, and Coprocessor
CN107102944B (en) Analysis method and device for calling function
JP2019523952A (en) Streaming data distributed processing method and apparatus
CN109951494B (en) Simulation data processing method and device, simulation equipment and storage medium
CN113472900B (en) Message processing method, device, storage medium and computer program product
CN113079200A (en) Data processing method, device and system
CN108184170B (en) Data processing method and device
CN107181636B (en) Health check method and device in load balancing system
US20230153432A1 (en) Method and Device for Determining Malicious File
CN110798490A (en) Method and device for accessing third-party system based on data center and data center
CN114979236A (en) Data transmission method, data transmission device, storage medium and electronic equipment
CN109241282A (en) A kind of warning message assemblage method and device
CN109428682A (en) A kind of Message Processing confirmation method and device
CN107276998B (en) OpenSSL-based performance optimization method and device
CN109948056B (en) Evaluation method and device of recommendation system
CN115039082A (en) Log writing method and device, electronic equipment and storage medium
CN113098868B (en) Container-based network security processing method and device
CN110019497B (en) Data reading method and device
CN114895852A (en) Data processing method, system, device, storage medium and electronic equipment
WO2017088382A1 (en) Data processing method and device
CN112559565A (en) Abnormity detection method, system and device

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