CN109783409A - Method and apparatus for handling data - Google Patents
Method and apparatus for handling data Download PDFInfo
- Publication number
- CN109783409A CN109783409A CN201910068563.7A CN201910068563A CN109783409A CN 109783409 A CN109783409 A CN 109783409A CN 201910068563 A CN201910068563 A CN 201910068563A CN 109783409 A CN109783409 A CN 109783409A
- Authority
- CN
- China
- Prior art keywords
- data packet
- network interface
- packet
- interface card
- sent
- 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
Links
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The embodiment of the present disclosure discloses the method and apparatus for handling data.One specific embodiment of this method includes: the data packet for obtaining network interface card and receiving;Determine whether above-mentioned data packet is target packet;It is target packet in response to the above-mentioned data packet of determination, above-mentioned data packet is sent to the field programmable gate array by preprogramming, following steps is executed by above-mentioned field programmable gate array: above-mentioned data packet being handled, data packet processing result is obtained;Obtained data packet processing result is sent to above-mentioned network interface card, is issued by above-mentioned network interface card.The embodiment is by being forwarded directly to hardware FPGA processing for target packet, and directly data packet processing result is issued by hardware FPGA, multiple memory copying when operating system handles data packet based on software mode is avoided, to improve the treatment effeciency of data packet.
Description
Technical field
The embodiment of the present disclosure is related to field of computer technology, and in particular to the method and apparatus for handling data.
Background technique
At this stage, more and more network functions, for example, load balancing (Load Balancing, LB), network address turn
Change (Network Address Translation, NAT), Virtual Private Network (Virtual Private Network, VPN)
Deng being realized by way of server (for example, x86 server)+operating system (for example, Linux).For example, due to
Originally original intention that x86 server and (SuSE) Linux OS design is not network data, therefore, is serviced using general x86
Device+(SuSE) Linux OS scheme realizes that network function is often unable to reach higher performance.Operating system is based on software side
Formula introduces bottleneck to performance boost come the mode for realizing that data packet is handled.For example, to the multiple of data in software processes
Memory copying seriously limits the performance of realized network function.
Summary of the invention
The embodiment of the present disclosure proposes the method and apparatus for handling data.
In a first aspect, the embodiment of the present disclosure provides a kind of method for handling data, the center applied to server
Processor, this method comprises: obtaining the data packet that network interface card receives;Determine whether above-mentioned data packet is target packet;Response
In determining that above-mentioned data packet is target packet, above-mentioned data packet is sent to the field-programmable gate array by preprogramming
Column execute following steps by above-mentioned field programmable gate array: handling above-mentioned data packet, obtain data packet processing knot
Fruit;Obtained data packet processing result is sent to above-mentioned network interface card, is issued by above-mentioned network interface card.
In some embodiments, the above method further include: in response to the above-mentioned data packet of determination be not target packet, to upper
It states data packet to be handled, obtains data packet processing result;Obtained data packet processing result is sent to above-mentioned network interface card, by upper
State network interface card sending.
In some embodiments, above-mentioned field programmable gate array realizes load balancing function according to preset logic
Energy;And whether the above-mentioned above-mentioned data packet of determination is target packet, comprising: by the destination in the IP address of above-mentioned data packet
Location is matched with the address in preset address list;If matched, determine that above-mentioned data packet is target packet;
If mismatched, determine that above-mentioned data packet is not target packet.
Second aspect, the embodiment of the present disclosure provide a kind of method for handling data again, are applied to logical with server
The field programmable gate array of connection is believed, this method comprises: the data packet that the network interface card for receiving above-mentioned server is sent;It determines above-mentioned
Whether data packet is target packet;It is target packet in response to the above-mentioned data packet of determination, executes following processing step: to upper
It states data packet to be handled, obtains the first processing result;Determine whether that above-mentioned first processing result is further processed;It rings
Above-mentioned first processing result should be sent to above-mentioned network interface card in determining to above-mentioned first processing result without being further processed,
It is issued by above-mentioned network interface card.
In some embodiments, above-mentioned processing step further include: in response to determine to above-mentioned first processing result carry out into
Above-mentioned first processing result, is sent to the central processing unit of above-mentioned server, is carried out by above-mentioned central processing unit by the processing of one step
Processing, obtain second processing as a result, and above-mentioned second processing result is sent to above-mentioned network interface card by above-mentioned central processing unit, by
Above-mentioned network interface card issues.
In some embodiments, the above method further include: it in response to the above-mentioned data packet of determination is not target packet, it will be upper
The central processing unit that data packet is sent to above-mentioned server is stated, above-mentioned net is sent to after being handled by above-mentioned central processing unit
Card, is issued by above-mentioned network interface card.
In some embodiments, above-mentioned field programmable gate array realizes load balancing function according to preset logic
Energy;And whether the above-mentioned above-mentioned data packet of determination is target packet, comprising: by the destination in the IP address of above-mentioned data packet
Location is matched with the address in preset address list;If matched, determine that above-mentioned data packet is target packet;
If mismatched, determine that above-mentioned data packet is not target packet.
The third aspect, the embodiment of the present disclosure provide a kind of for handling the device of data, and device includes: acquiring unit,
It is configured to obtain the data packet that network interface card receives;Determination unit is configured to determine whether above-mentioned data packet is target data
Packet;First processing units are configured in response to determine that above-mentioned data packet is target packet, by above-mentioned data packet be sent to through
The field programmable gate array for crossing preprogramming executes following steps by above-mentioned field programmable gate array: to above-mentioned data packet
It is handled, obtains data packet processing result;Obtained data packet processing result is sent to above-mentioned network interface card, is sent out by above-mentioned network interface card
Out.
In some embodiments, above-mentioned apparatus further include: the second processing unit is configured in response to determine above-mentioned data
Packet is not target packet, and above-mentioned data packet is handled, data packet processing result is obtained;Transmission unit, be configured to by
Obtained data packet processing result is sent to above-mentioned network interface card, is issued by above-mentioned network interface card.
In some embodiments, above-mentioned field programmable gate array realizes load balancing function according to preset logic
Energy;And above-mentioned determination unit is further configured to: by the IP address of above-mentioned data packet destination address with preset
Address list in address matched;If matched, determine that above-mentioned data packet is target packet;If mismatched,
Determine that above-mentioned data packet is not target packet.
Fourth aspect, the embodiment of the present disclosure provide a kind of for handling the device of data again, and device includes: reception mould
Block is configured to receive the data packet that the network interface card of above-mentioned server is sent;Determining module, being configured to determine above-mentioned data packet is
No is target packet;First processing module is configured in response to determine that above-mentioned data packet is target packet, execute following
Processing step: handling above-mentioned data packet, obtains the first processing result;Determine whether to carry out above-mentioned first processing result
It is further processed;In response to determining to above-mentioned first processing result without being further processed, above-mentioned first processing result is sent out
It send to above-mentioned network interface card, is issued by above-mentioned network interface card.
In some embodiments, above-mentioned first processing module is further configured to: in response to determining at above-mentioned first
Reason result is further processed, and above-mentioned first processing result is sent to the central processing unit of above-mentioned server, by among the above
Central processor is handled, and obtains second processing as a result, and being sent above-mentioned second processing result by above-mentioned central processing unit
To above-mentioned network interface card, issued by above-mentioned network interface card.
In some embodiments, above-mentioned apparatus further include: Second processing module is configured in response to determine above-mentioned data
Packet be not target packet, above-mentioned data packet is sent to the central processing unit of above-mentioned server, by above-mentioned central processing unit into
It is sent to above-mentioned network interface card after row processing, is issued by above-mentioned network interface card.
In some embodiments, above-mentioned field programmable gate array realizes load balancing function according to preset logic
Energy;And above-mentioned determining module is further configured to: by the IP address of above-mentioned data packet destination address with preset
Address list in address matched;If matched, determine that above-mentioned data packet is target packet;If mismatched,
Determine that above-mentioned data packet is not target packet.
5th aspect, the embodiment of the present disclosure provide a kind of server, which includes: one or more processors;
Storage device is stored thereon with one or more programs, when said one or multiple programs are by said one or multiple processors
When execution, so that said one or multiple processors realize the method as described in implementation any in first aspect.
6th aspect, the embodiment of the present disclosure provide a kind of computer-readable medium, are stored thereon with computer program,
In, the method as described in implementation any in first aspect is realized when which is executed by processor.
The data that the method and apparatus for handling data that the embodiment of the present disclosure provides, first acquisition network interface card receive
Packet, then determine data packet whether be target packet, if data packet be target packet, send data packets to by
The FPGA (Field-Programmable Gate Array, field programmable gate array) of preprogramming, is executed by FPGA
Following steps: 1) being handled data packet, obtains data packet processing result;2) obtained data packet processing result is sent to
Network interface card is issued by network interface card.The present embodiment is handled by the way that target packet is forwarded directly to hardware FPGA, and straight by hardware FPGA
It connects and issues data packet processing result, avoid multiple memory copying when operating system handles data packet based on software mode,
To improve the treatment effeciency of data packet.
Detailed description of the invention
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the disclosure is other
Feature, objects and advantages will become more apparent upon:
Fig. 1 is that one embodiment of the disclosure can be applied to exemplary system architecture figure therein;
Fig. 2 is the flow chart according to one embodiment of the method for handling data of the disclosure;
Fig. 3 is the schematic diagram according to an application scenarios of the method for handling data of the disclosure;
Fig. 4 is the flow chart according to another embodiment of the method for handling data of the disclosure;
Fig. 5 is the structural schematic diagram according to one embodiment of the device for handling data of the disclosure;
Fig. 6 is the structural schematic diagram according to another embodiment of the device for handling data of the disclosure;
Fig. 7 is adapted for the structural schematic diagram for the computer system for realizing the server of the embodiment of the present disclosure.
Specific embodiment
The disclosure is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched
The specific embodiment stated is used only for explaining related invention, rather than the restriction to the invention.It also should be noted that in order to
Convenient for description, part relevant to related invention is illustrated only in attached drawing.
It should be noted that in the absence of conflict, the feature in embodiment and embodiment in the disclosure can phase
Mutually combination.The disclosure is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Fig. 1 is shown can the method for handling data using the embodiment of the present disclosure or the device for handling data
Exemplary system architecture 100.
As shown in Figure 1, system architecture 100 may include terminal device 101,102,103, network 104 and server 105.
It wherein, can be with FPGA (Field-Programmable Gate Array, field programmable gate battle array in server 105
Column) communication connection of board (not shown).For example, FPGA card plate and server 105 can pass through the high-speed interface on mainboard
(for example, PCI-E interface) connection.In practice, FPGA card plate can be built into server 105.Network 104 in terminal to set
The medium of communication link is provided between standby 101,102,103 and server 105.Network 104 may include various connection types, example
Such as wired, wireless communication link or fiber optic cables.
User can be used terminal device 101,102,103 and be interacted by network 104 with server 105, to receive or send out
Send message etc..Various telecommunication customer end applications can be installed, such as web browser is answered on terminal device 101,102,103
With, shopping class application, searching class application, instant messaging tools, mailbox client, social platform software etc..
Terminal device 101,102,103 can be hardware, be also possible to software.When terminal device 101,102,103 is hard
When part, it can be the various electronic equipments with display screen and supported web page browsing, including but not limited to smart phone, plate
Computer, pocket computer on knee and desktop computer etc..When terminal device 101,102,103 is software, can install
In above-mentioned cited electronic equipment.Multiple softwares or software module may be implemented into (such as providing distributed clothes in it
Business), single software or software module also may be implemented into.It is not specifically limited herein.
Server 105 can be to provide the server of various services, such as to showing on terminal device 101,102,103
Webpage provides the background server supported.Background server can carry out the data such as the data packet received the processing such as analyzing,
And processing result is fed back into terminal device 101,102,103.
It should be understood that the number of terminal device, network and server in Fig. 1 is only schematical.According to realization need
It wants, can have any number of terminal device, network and server.
It should be noted that for handling the method for data generally by servicing provided by disclosure Fig. 2 corresponding embodiment
The central processing unit (Central Processing Unit, CPU) of device 105 executes, correspondingly, for handling data in Fig. 5
Device is generally positioned in the CPU of server 105;Method provided by disclosure Fig. 4 corresponding embodiment for handling data
It is generally executed by the FPGA communicated to connect with server 105, correspondingly, is generally positioned in Fig. 6 for handling the device of data
In the FPGA communicated to connect with server 105.
With continued reference to Fig. 2, the process of one embodiment of the method for handling data according to the disclosure is shown
200.The method for being used to handle data, comprising the following steps:
Step 201, the data packet that network interface card receives is obtained.
In the present embodiment, for handling executing subject (such as the server shown in FIG. 1 105 of the method for data
CPU) the data packet that available network interface card receives.For example, executing subject can using the technologies such as zero-copy (zero-copy) from
Network interface card obtains data packet, to reduce the time for obtaining data packet.Herein, network interface card can refer to server network card.Network interface card, again
Claim network adapter or network interface card.Server can receive client (such as terminal device shown in FIG. 1 by network interface card
101,102,103) or other servers data packet that sends.It, can will be received complete after network interface card receives data packet
Portion's data packet is transmitted to the CPU of server, is forwarded by CPU or is handled.Here, packet (Packet) is ICP/IP protocol communication
Data unit in transmission, generally also referred to as " data packet ".It may include the address information of sender and recipients in data packet.Number
It is mainly made of destination address, source address, the net part such as data that carries according to packet.Destination address is to illustrate that this data packet is to issue
Whose, i.e. the address information of recipient;Source address be illustrate this data packet be from where, i.e., sender address letter
Breath.
Step 202, determine whether data packet is target packet.
In the present embodiment, executing subject can determine whether the data packet obtained in step 201 is target packet.?
Here, executing subject can determine which data packet is target packet according to preset selection rule, and selection rule
It can be real according to the field programmable gate array (Field-Programmable Gate Array, FPGA) of preprogramming
Existing function determines.Generally, technical staff can according to actual needs configure FPGA, so that FPGA has specific function
Energy.For example, FPGA can be made to have the functions such as load balancing, network address translation, Virtual Private Network by configuring.It
Afterwards, the function that technical staff can realize according to FPGA, determines the selection rule of target packet.In practice, can be based on but
It is not limited to IP (Internet Protocol, the agreement interconnected between network) address, port numbers or MAC (Media Access
Control, medium access control) address etc. determines target packet.
By taking the function that FPGA is realized is network address translation as an example, executing subject can determine one in the following manner
Whether data packet is target packet: firstly, executing subject can by the IP address by the data packet source address and in advance
Address in the address list of setting is matched.If certain in the source address and address list in the IP address of the data packet
One address matches (for example, identical), it is determined that the data packet is target packet;It is on the contrary, it is determined that the data packet is not
Target packet.
In some optional implementations of the present embodiment, FPGA can realize that load is equal according to preset logic
Weigh function.And step 202 specific as follows can carry out:
Firstly, by the address progress in the destination address and preset address list in the IP address of data packet
Match.
In this implementation, executing subject can be by the destination address in the IP address of data packet with preset
Address in the list of location is matched.It herein, the multiple addresses for including in address list can be by technical staff according to reality
It is set.
Secondly, determining that data packet is target packet if matched.
In this implementation, if in destination address in the IP address of data packet and preset address list
One address matches (for example, identical), then executing subject can determine that data packet is target packet.
Then, if mismatched, determine that data packet is not target packet.
In this implementation, if in destination address in the IP address of data packet and preset address list
All addresses all mismatch, then executing subject can determine that data packet is not target packet.
Step 203, in response to determining that data packet is target packet, the scene by preprogramming is sent data packets to
Programmable gate array executes default step by field programmable gate array.
In the present embodiment, in response to determining that data packet is target packet, executing subject can send data packets to through
The FPGA for crossing preprogramming executes default step 2031 and step 2032 by preset configuration by FPGA.
Step 2031, data packet is handled, obtains data packet processing result.
In the present embodiment, the data packet that FPGA can send executing subject is handled, to obtain data packet
Processing result.Since FPGA have passed through preprogramming, so have certain specific data processing function, it therefore, can be right
The data packet that executing subject is sent carries out data processing, obtains the processing result of data packet.Step 2032, the data packet that will be obtained
Processing result is sent to network interface card, is issued by network interface card.
In the present embodiment, the data packet processing result that FPGA can obtain step 2031 is sent to network interface card, by network interface card
It issues.As an example, data packet processing result can be sent to client or other servers according to default rule by network interface card,
Herein without limitation.
In some optional implementations of the present embodiment, the above-mentioned method for handling data can also include Fig. 2
In unshowned following steps:
Firstly, handling in response to determining that data packet is not target packet data packet, data packet processing knot is obtained
Fruit.
In this implementation, in response to determining that data are not target packets, executing subject can be carried out data packet
Processing, obtains data packet processing result.As an example, one or more programs can have been run in executing subject, this or
Multiple programs can be handled data packet.
Then, obtained data packet processing result is sent to network interface card, is issued by network interface card.
In this implementation, obtained data packet processing result can be sent to network interface card by executing subject, be sent out by network interface card
Out.For example, issuing to client or other servers.By this implementation, executing subject can will not be target packet
Data packet handled, to obtain data packet processing result, realize the processing to the data packet for not being target data.
With continued reference to the signal that Fig. 3, Fig. 3 are according to the application scenarios of the method for handling data of the present embodiment
Figure.In the application scenarios of Fig. 3, the network interface card of server received data packet first, the CPU of server obtains the number that network interface card receives
According to packet.Later, CPU determines whether data packet is target packet.Then, in response to determining that data packet is target packet, CPU
The FPGA by preprogramming can be sent data packets to, following steps are executed by FPGA: data packet is handled, are obtained
Data packet processing result;Obtained data packet processing result is sent to network interface card, is issued by network interface card.
The method provided by the above embodiment of the disclosure is handled by the way that target packet is forwarded directly to hardware FPGA, and
Directly data packet processing result is issued by hardware FPGA, it is more when avoiding operating system based on software mode processing data packet
Secondary memory copying, to improve the treatment effeciency of data packet.
With further reference to Fig. 4, it illustrates the processes 400 of another embodiment of the method for handling data.The use
In the process 400 of the method for processing data, comprising the following steps:
Step 401, the data packet that the network interface card of server is sent is received.
In the present embodiment, (such as logical with server 105 shown in FIG. 1 for handling the executing subject of the method for data
Believe the FPGA of connection) it can receive the data packet that the network interface card of server (such as server 105 shown in FIG. 1) is sent.Herein,
The network interface card of server can receive client (such as terminal device shown in FIG. 1 101,102,103) or other servers are sent
Data packet.Later, received entire packet can be transmitted to executing subject, i.e. FPGA by network interface card, be forwarded by FPGA
Or processing.Generally, technical staff can according to actual needs configure FPGA, so that FPGA has specific function.For example,
In the present embodiment, FPGA has the function of whether determining data packet is target packet.In another example FPGA can be made by configuring
Have the functions such as load balancing, network address translation, Virtual Private Network.
Step 402, determine whether data packet is target packet.
In the present embodiment, executing subject can determine whether the data packet received in step 401 is target packet.
Herein, executing subject can determine whether a data packet is target packet according to preset selection rule, and select
Take rule that can be determined according to the function that executing subject can be realized.In general, what technical staff can realize according to executing subject
Function determines the selection rule of target packet.In practice, IP address, port numbers or MAC Address etc. can be based on but are not limited to
Determine target packet.
By taking the function that executing subject is realized is network address translation as an example, executing subject can determine in the following manner
Whether one data packet is target packet: firstly, executing subject can be by source address in the IP address of the data packet and pre-
The address in address list first set is matched.If in the source address and address list in the IP address of the data packet
Some address matches (for example, identical), it is determined that the data packet is target packet;It is on the contrary, it is determined that the data packet is not
It is target packet.
In some optional implementations of the present embodiment, executing subject may be implemented real according to preset logic
Existing load-balancing function.And step 402 specific as follows can carry out:
Firstly, by the address progress in the destination address and preset address list in the IP address of data packet
Match.
In this implementation, executing subject can be by the destination address in the IP address of data packet with preset
Address in the list of location is matched.Herein, including multiple addresses in address list can be by technical staff according to practical need
It is set.
Secondly, determining that data packet is target packet if matched.
In this implementation, if in destination address in the IP address of data packet and preset address list
One address matches (for example, identical), then executing subject can determine that data packet is target packet.
Then, if mismatched, determine that data packet is not target packet.
In this implementation, if in destination address in the IP address of data packet and preset address list
All addresses all mismatch, then executing subject can determine that data packet is not target packet.
Step 403, in response to determining that data packet is target packet, default processing step is executed.
In the present embodiment, in response to determining that data packet is target packet, executing subject can execute default processing step
Rapid 4031~step 4033.
Step 4031, data packet is handled, obtains the first processing result.
In the present embodiment, executing subject can be handled data packet, obtain the first processing result.Due to executing master
Body have passed through default programming, so have certain specific data processing function, therefore, executing subject can to data packet into
Row processing, obtains the first processing result.
Step 4032, it is determined whether the first processing result is further processed.
In the present embodiment, executing subject may determine whether that the first processing result is further processed.As
Example, technical staff can pre-establish rule, can recorde which processing result needs to carry out further in the rule
Processing.In this way, according to the rule executing subject may determine whether that the first processing result is further processed.
Step 4033, in response to determining to the first processing result without being further processed, the first processing result is sent
To network interface card, issued by network interface card.
In the present embodiment, in response to determining that the first processing result, executing subject can be straight without being further processed
It connects and the first processing result is sent to network interface card, issued by network interface card.For example, being sent to client or other servers.
In some optional implementations of the present embodiment, above-mentioned processing step can also include unshowned in Fig. 4
Following steps: the first processing result is further processed in response to determination, the first processing result is sent to server
Central processing unit is handled by central processing unit, obtains second processing as a result, and by central processing unit by second processing knot
Fruit is sent to network interface card, is issued by network interface card.
In this implementation, the first processing result is further processed in response to determining, executing subject can incite somebody to action
First processing result is sent to the central processing unit of server.It, can be right after central processing unit receives the first processing result
First processing result is handled, and second processing result is obtained.Second processing result can also be sent to net by central processing unit
Card, is issued by network interface card.By this implementation, executing subject can will need the first processing that central processing unit is further processed
As a result it is sent to central processing unit, to realize the processing of data.
In some optional implementations of the present embodiment, the above-mentioned method for handling data can also include Fig. 4
In unshowned following steps: in response to determine data packet be not target packet, deliver a packet to the center of server
Processor is sent to network interface card after being handled by central processing unit, is issued by network interface card.
In this implementation, if data packet is not target packet, executing subject can deliver a packet to clothes
The central processing unit of business device, is sent to network interface card after being handled by central processing unit, is issued by network interface card.For example, issuing to visitor
Family end or other servers.By this implementation, executing subject can will not be that the data packet of target packet is transmitted to clothes
The CPU of business device is handled, and the processing to the data packet for not being target packet is realized.
The method provided by the above embodiment of the disclosure is directly handled target packet by hardware FPGA, and will
It does not need the first processing result being further processed directly to issue by network interface card, make in target packet treatment process not to service
Device CPU generates dependence, multiple memory copying when so as to avoid operating system based on software mode processing data packet, to mention
The high treatment effeciency of data packet.
With further reference to Fig. 5, as the realization to method shown in above-mentioned each figure, present disclose provides one kind for handling number
According to device one embodiment, the Installation practice is corresponding with embodiment of the method shown in Fig. 2, which can specifically answer
For in various electronic equipments.
As shown in figure 5, the present embodiment includes: acquiring unit 501, determination unit 502 for handling the device 500 of data
With first processing units 503.Wherein, acquiring unit 501 is configured to obtain the data packet that network interface card receives;Determination unit 502
It is configured to determine whether above-mentioned data packet is target packet;First processing units 503 are configured in response to determine above-mentioned
Data packet is target packet, above-mentioned data packet is sent to the field programmable gate array by preprogramming, by above-mentioned existing
Field programmable gate array executes following steps: handling above-mentioned data packet, obtains data packet processing result;The number that will be obtained
It is sent to above-mentioned network interface card according to packet processing result, is issued by above-mentioned network interface card.
In the present embodiment, for handling the acquiring unit 501, determination unit 502 and the first processing of the device 500 of data
The specific processing of unit 503 and its brought technical effect can be respectively with reference to steps 201, step 202 in Fig. 2 corresponding embodiment
With the related description of step 203, details are not described herein.
In some optional implementations of the present embodiment, above-mentioned apparatus 500 further include: the second processing unit is (in figure
It is not shown), it is configured in response to determine that above-mentioned data packet is not target packet, above-mentioned data packet is handled, is obtained
Data packet processing result;Transmission unit (not shown), the data packet processing result for being configured to obtain are sent to above-mentioned
Network interface card is issued by above-mentioned network interface card.
In some optional implementations of the present embodiment, above-mentioned field programmable gate array is patrolled according to preset
It collects and realizes load-balancing function;And above-mentioned determination unit 502 is further configured to: will be in the IP address of above-mentioned data packet
Destination address is matched with the address in preset address list;If matched, determine that above-mentioned data packet is target
Data packet;If mismatched, determine that above-mentioned data packet is not target packet.
With further reference to Fig. 6, as the realization to method shown in above-mentioned each figure, present disclose provides one kind for handling number
According to device one embodiment, the Installation practice is corresponding with embodiment of the method shown in Fig. 4, which can specifically answer
For in various electronic equipments.
As shown in fig. 6, the present embodiment includes: receiving module 601, determining module 602 for handling the device 600 of data
With first processing module 603.Wherein, receiving module 601 is configured to receive the data packet that the network interface card of above-mentioned server is sent;Really
Cover half block 602 is configured to determine whether above-mentioned data packet is target packet;First processing module 603 is configured in response to
It determines that above-mentioned data packet is target packet, executes following processing step: above-mentioned data packet is handled, obtain the first processing
As a result;Determine whether that above-mentioned first processing result is further processed;In response to determining to above-mentioned first processing result not
It is further processed, above-mentioned first processing result is sent to above-mentioned network interface card, is issued by above-mentioned network interface card.
In the present embodiment, for handling receiving module 601, determining module 602 and the first processing of the device 500 of data
The specific processing of module 603 and its brought technical effect can be respectively with reference to steps 401, step 402 in Fig. 4 corresponding embodiment
With the related description of step 403, details are not described herein.
In some optional implementations of the present embodiment, above-mentioned first processing module 603 is further configured to: being rung
Above-mentioned first processing result should be further processed in determination, above-mentioned first processing result is sent to above-mentioned server
Central processing unit is handled by above-mentioned central processing unit, obtains second processing as a result, and will be upper by above-mentioned central processing unit
It states second processing result and is sent to above-mentioned network interface card, issued by above-mentioned network interface card.
In some optional implementations of the present embodiment, above-mentioned apparatus 600 further include: Second processing module is (in figure
It is not shown), it is configured in response to determine that above-mentioned data packet is not target packet, above-mentioned data packet is sent to above-mentioned service
The central processing unit of device is sent to above-mentioned network interface card after being handled by above-mentioned central processing unit, issued by above-mentioned network interface card.
In some optional implementations of the present embodiment, above-mentioned field programmable gate array is patrolled according to preset
It collects and realizes load-balancing function;And above-mentioned determining module 402 is further configured to: will be in the IP address of above-mentioned data packet
Destination address is matched with the address in preset address list;If matched, determine that above-mentioned data packet is target
Data packet;If mismatched, determine that above-mentioned data packet is not target packet.
Below with reference to Fig. 7, it illustrates the electronic equipment that is suitable for being used to realize embodiment of the disclosure, (example is as shown in figure 1
Server 105) 700 structural schematic diagram.Server shown in Fig. 7 is only an example, should not be to embodiment of the disclosure
Function and use scope bring any restrictions.
As shown in fig. 7, electronic equipment 700 may include processing unit (such as central processing unit, graphics processor etc.)
701, random access can be loaded into according to the program being stored in read-only memory (ROM) 702 or from storage device 708
Program in memory (RAM) 703 and execute various movements appropriate and processing.In RAM 703, it is also stored with electronic equipment
Various programs and data needed for 700 operations.Processing unit 701, ROM 702 and RAM703 are connected with each other by bus 704.
Input/output (I/O) interface 705 is also connected to bus 704.The processing unit 701 of electronic equipment 700 can also and preprogramming
FPGA board (not shown) communication connection.
In general, following device can connect to I/O interface 705: including such as touch screen, touch tablet, keyboard, mouse, taking the photograph
As the input unit 706 of head, microphone, accelerometer, gyroscope etc.;Including such as liquid crystal display (LCD), loudspeaker, vibration
The output device 707 of dynamic device etc.;Storage device 708 including such as tape, hard disk etc.;And communication device 709.Communication device
709, which can permit electronic equipment 700, is wirelessly or non-wirelessly communicated with other equipment to exchange data.Although Fig. 7 shows tool
There is the electronic equipment 700 of various devices, it should be understood that being not required for implementing or having all devices shown.It can be with
Alternatively implement or have more or fewer devices.Each box shown in Fig. 7 can represent a device, can also root
According to needing to represent multiple devices.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description
Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer-readable medium
On computer program, which includes the program code for method shown in execution flow chart.In such reality
It applies in example, which can be downloaded and installed from network by communication device 709, or from storage device 708
It is mounted, or is mounted from ROM 702.When the computer program is executed by processing unit 701, the implementation of the disclosure is executed
The above-mentioned function of being limited in the method for example.
It is situated between it should be noted that computer-readable medium described in embodiment of the disclosure can be computer-readable signal
Matter or computer readable storage medium either the two any combination.Computer readable storage medium for example can be with
System, device or the device of --- but being not limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor, or it is any more than
Combination.The more specific example of computer readable storage medium can include but is not limited to: have one or more conducting wires
Electrical connection, portable computer diskette, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type are programmable
Read-only memory (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic are deposited
Memory device or above-mentioned any appropriate combination.In embodiment of the disclosure, computer readable storage medium, which can be, appoints
What include or the tangible medium of storage program that the program can be commanded execution system, device or device use or and its
It is used in combination.And in embodiment of the disclosure, computer-readable signal media may include in a base band or as carrier wave
The data-signal that a part is propagated, wherein carrying computer-readable program code.The data-signal of this propagation can be adopted
With diversified forms, including but not limited to electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal is situated between
Matter can also be any computer-readable medium other than computer readable storage medium, which can be with
It sends, propagate or transmits for by the use of instruction execution system, device or device or program in connection.Meter
The program code for including on calculation machine readable medium can transmit with any suitable medium, including but not limited to: electric wire, optical cable,
RF (radio frequency) etc. or above-mentioned any appropriate combination.
Above-mentioned computer-readable medium can be included in above-mentioned electronic equipment;It is also possible to individualism, and not
It is fitted into the electronic equipment.Above-mentioned computer-readable medium carries one or more program, when said one or more
When a program is executed by the electronic equipment, so that the electronic equipment: obtaining the data packet that network interface card receives;Determine above-mentioned data packet
It whether is target packet;It is target packet in response to the above-mentioned data packet of determination, above-mentioned data packet is sent to by preparatory
The field programmable gate array of programming executes following steps by above-mentioned field programmable gate array: carrying out to above-mentioned data packet
Reason, obtains data packet processing result;Obtained data packet processing result is sent to above-mentioned network interface card, is issued by above-mentioned network interface card.
The behaviour for executing embodiment of the disclosure can be write with one or more programming languages or combinations thereof
The computer program code of work, described program design language include object oriented program language-such as Java,
Smalltalk, C++ further include conventional procedural programming language-such as " C " language or similar program design language
Speech.Program code can be executed fully on the user computer, partly be executed on the user computer, as an independence
Software package execute, part on the user computer part execute on the remote computer or completely in remote computer or
It is executed on server.In situations involving remote computers, remote computer can pass through the network of any kind --- packet
It includes local area network (LAN) or wide area network (WAN)-is connected to subscriber computer, or, it may be connected to outer computer (such as benefit
It is connected with ISP by internet).
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the disclosure, method and computer journey
The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation
A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use
The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box
The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually
It can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it to infuse
Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding
The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction
Combination realize.
Being described in unit involved in embodiment of the disclosure can be realized by way of software, can also be passed through
The mode of hardware is realized.Described unit also can be set in the processor, for example, can be described as: a kind of processor
Including acquiring unit, determination unit and first processing units.Wherein, the title of these units under certain conditions constitute pair
The restriction of the unit itself, for example, acquiring unit is also described as " obtaining the unit for the data packet that network interface card receives ".
Above description is only the preferred embodiment of the disclosure and the explanation to institute's application technology principle.Those skilled in the art
Member it should be appreciated that embodiment of the disclosure involved in invention scope, however it is not limited to the specific combination of above-mentioned technical characteristic and
At technical solution, while should also cover do not depart from foregoing invention design in the case where, by above-mentioned technical characteristic or its be equal
Feature carries out any combination and other technical solutions for being formed.Such as disclosed in features described above and embodiment of the disclosure (but
It is not limited to) technical characteristic with similar functions is replaced mutually and the technical solution that is formed.
Claims (16)
1. a kind of method for handling data, the central processing unit applied to server, comprising:
Obtain the data packet that network interface card receives;
Determine whether the data packet is target packet;
It is target packet in response to the determination data packet, the data packet, which is sent to the scene by preprogramming, to be compiled
Journey gate array executes following steps by the field programmable gate array: handling the data packet, obtain at data packet
Manage result;Obtained data packet processing result is sent to the network interface card, is issued by the network interface card.
2. according to the method described in claim 1, wherein, the method also includes:
It is not target packet in response to the determination data packet, the data packet is handled, obtains data packet processing knot
Fruit;
Obtained data packet processing result is sent to the network interface card, is issued by the network interface card.
3. according to the method described in claim 1, wherein, the field programmable gate array is realized according to preset logic
Load-balancing function;And
Whether the determination data packet is target packet, comprising:
Destination address in the IP address of the data packet is matched with the address in preset address list;
If matched, determine that the data packet is target packet;
If mismatched, determine that the data packet is not target packet.
4. a kind of method for handling data, applied to the field programmable gate array being connect with server communication, comprising:
Receive the data packet that the network interface card of the server is sent;
Determine whether the data packet is target packet;
It is target packet in response to the determination data packet, executes following processing step: the data packet being handled, is obtained
To the first processing result;Determine whether that first processing result is further processed;In response to determining to described first
Processing result is sent to the network interface card without being further processed, by first processing result, is issued by the network interface card.
5. according to the method described in claim 4, wherein, the processing step further include:
First processing result is further processed in response to determination, first processing result is sent to the clothes
The central processing unit of business device, is handled by the central processing unit, obtains second processing as a result, and by the central processing
The second processing result is sent to the network interface card by device, is issued by the network interface card.
6. according to the method described in claim 4, wherein, the method also includes:
It is not target packet in response to the determination data packet, the data packet is sent to the central processing of the server
Device is sent to the network interface card after being handled by the central processing unit, issued by the network interface card.
7. according to the method described in claim 4, wherein, the field programmable gate array is realized according to preset logic
Load-balancing function;And
Whether the determination data packet is target packet, comprising:
Destination address in the IP address of the data packet is matched with the address in preset address list;
If matched, determine that the data packet is target packet;
If mismatched, determine that the data packet is not target packet.
8. a kind of for handling the device of data, comprising:
Acquiring unit is configured to obtain the data packet that network interface card receives;
Determination unit is configured to determine whether the data packet is target packet;
First processing units are configured in response to determine that the data packet is target packet, the data packet are sent to
By the field programmable gate array of preprogramming, following steps are executed by the field programmable gate array: to the data
Packet is handled, and data packet processing result is obtained;Obtained data packet processing result is sent to the network interface card, by the network interface card
It issues.
9. device according to claim 8, wherein described device further include:
The second processing unit is configured in response to determine that the data packet is not target packet, carries out to the data packet
Processing, obtains data packet processing result;
Transmission unit, the data packet processing result for being configured to obtain are sent to the network interface card, are issued by the network interface card.
10. device according to claim 8, wherein the field programmable gate array is real according to preset logic
Existing load-balancing function;And
The determination unit is further configured to:
Destination address in the IP address of the data packet is matched with the address in preset address list;
If matched, determine that the data packet is target packet;
If mismatched, determine that the data packet is not target packet.
11. a kind of for handling the device of data, comprising:
Receiving module is configured to receive the data packet that the network interface card of the server is sent;
Determining module is configured to determine whether the data packet is target packet;
First processing module is configured in response to determine that the data packet is target packet, executes following processing step: right
The data packet is handled, and the first processing result is obtained;Determine whether that first processing result is further processed;
In response to determining to first processing result without being further processed, first processing result is sent to the net
Card, is issued by the network interface card.
12. device according to claim 11, wherein the first processing module is further configured to:
First processing result is further processed in response to determination, first processing result is sent to the clothes
The central processing unit of business device, is handled by the central processing unit, obtains second processing as a result, and by the central processing
The second processing result is sent to the network interface card by device, is issued by the network interface card.
13. device according to claim 11, wherein described device further include:
Second processing module is configured in response to determine that the data packet is not target packet, the data packet is sent
To the central processing unit of the server, the network interface card is sent to after being handled by the central processing unit, by the net
Card issues.
14. device according to claim 11, wherein the field programmable gate array is real according to preset logic
Existing load-balancing function;And
The determining module is further configured to:
Destination address in the IP address of the data packet is matched with the address in preset address list;
If matched, determine that the data packet is target packet;
If mismatched, determine that the data packet is not target packet.
15. a kind of server, comprising:
One or more processors;
Storage device is stored thereon with one or more programs;When one or more of programs are by one or more of places
It manages device to execute, so that one or more of processors realize such as method as claimed in any one of claims 1-3.
16. a kind of computer-readable medium, is stored thereon with computer program, wherein real when described program is executed by processor
Now such as method as claimed in any one of claims 1-3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910068563.7A CN109783409A (en) | 2019-01-24 | 2019-01-24 | Method and apparatus for handling data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910068563.7A CN109783409A (en) | 2019-01-24 | 2019-01-24 | Method and apparatus for handling data |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109783409A true CN109783409A (en) | 2019-05-21 |
Family
ID=66501302
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910068563.7A Pending CN109783409A (en) | 2019-01-24 | 2019-01-24 | Method and apparatus for handling data |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109783409A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110780608A (en) * | 2019-11-26 | 2020-02-11 | 北京百度网讯科技有限公司 | Simulation test method and device |
CN113094762A (en) * | 2021-04-30 | 2021-07-09 | 北京数盾信息科技有限公司 | Data processing method and device and signature verification server |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102904729A (en) * | 2012-10-26 | 2013-01-30 | 曙光信息产业(北京)有限公司 | Intelligent boost network card supporting multiple applications according to protocol and port shunt |
CN104348677A (en) * | 2013-08-05 | 2015-02-11 | 华为技术有限公司 | Deep packet inspection method and equipment and coprocessor |
CN107690622A (en) * | 2016-08-26 | 2018-02-13 | 华为技术有限公司 | Realize the method, apparatus and system of hardware-accelerated processing |
CN107689931A (en) * | 2017-09-27 | 2018-02-13 | 广州海格通信集团股份有限公司 | It is a kind of that Ethernet exchanging function system and method are realized based on domestic FPGA |
CN108153698A (en) * | 2017-11-15 | 2018-06-12 | 上海微波技术研究所(中国电子科技集团公司第五十研究所) | Data interactive method |
-
2019
- 2019-01-24 CN CN201910068563.7A patent/CN109783409A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102904729A (en) * | 2012-10-26 | 2013-01-30 | 曙光信息产业(北京)有限公司 | Intelligent boost network card supporting multiple applications according to protocol and port shunt |
CN104348677A (en) * | 2013-08-05 | 2015-02-11 | 华为技术有限公司 | Deep packet inspection method and equipment and coprocessor |
CN107690622A (en) * | 2016-08-26 | 2018-02-13 | 华为技术有限公司 | Realize the method, apparatus and system of hardware-accelerated processing |
CN107689931A (en) * | 2017-09-27 | 2018-02-13 | 广州海格通信集团股份有限公司 | It is a kind of that Ethernet exchanging function system and method are realized based on domestic FPGA |
CN108153698A (en) * | 2017-11-15 | 2018-06-12 | 上海微波技术研究所(中国电子科技集团公司第五十研究所) | Data interactive method |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110780608A (en) * | 2019-11-26 | 2020-02-11 | 北京百度网讯科技有限公司 | Simulation test method and device |
CN110780608B (en) * | 2019-11-26 | 2023-03-10 | 北京百度网讯科技有限公司 | Simulation test method and device |
CN113094762A (en) * | 2021-04-30 | 2021-07-09 | 北京数盾信息科技有限公司 | Data processing method and device and signature verification server |
CN113094762B (en) * | 2021-04-30 | 2021-12-07 | 北京数盾信息科技有限公司 | Data processing method and device and signature verification server |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109032760A (en) | Method and apparatus for application deployment | |
CN109561171A (en) | The configuration method and device of virtual private cloud service | |
CN109889621A (en) | The configuration method and device of virtual private cloud service | |
CN109729040B (en) | Method, apparatus and computer readable medium for selection of a protocol | |
CN110149388A (en) | Connection method, device and the equipment of HTTPDNS server | |
CN108540831B (en) | Method and apparatus for pushed information | |
CN110489192B (en) | Remote communication method and device and electronic equipment | |
CN109995877A (en) | Information-pushing method and device | |
CN109558246A (en) | A kind of load-balancing method, device, electronic equipment and storage medium | |
CN109936635A (en) | Load-balancing method and device | |
CN108112060A (en) | For obtaining the method and apparatus of wireless access point information | |
CN110177047B (en) | Message sending method, device, electronic equipment and computer readable storage medium | |
CN113691589B (en) | Message transmission method, device and system | |
CN102904959A (en) | Network accelerating method and gateway | |
CN110391938A (en) | Method and apparatus for deployment services | |
CN110007936A (en) | Data processing method and device | |
CN108200018A (en) | Flow forwarding method and equipment, computer equipment and readable medium in cloud computing | |
CN110489621A (en) | A kind of method, apparatus, medium and the electronic equipment of dynamic adjustment routing | |
CN110505074A (en) | A kind of application module integrated approach and device | |
CN109783409A (en) | Method and apparatus for handling data | |
CN112202744A (en) | Multi-system data communication method and device | |
CN108733527A (en) | System, method and apparatus for test server function | |
CN114296953A (en) | Multi-cloud heterogeneous system and task processing method | |
CN113778499A (en) | Method, device, equipment and computer readable medium for publishing service | |
EP3661126A1 (en) | Generating an application-based proxy auto configuration |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190521 |