A flow table keyword matching method, device, electronic device and storage medium

By storing the complete key and hash signature value in a hash chain, and comparing the hash signature value first and then the complete key, the problem of low flow table matching performance in cloud computing virtual networks is solved, and the efficiency of packet forwarding in virtual networks is improved.

CN116248593BActive Publication Date: 2024-11-26CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211733675.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2024-11-26
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

In cloud computing virtual networks, when virtual switches need to handle a large number of concurrent connections, existing technologies use hash chains to compare complete keys, resulting in poor performance, especially since keys contain multiple fields, leading to multiple comparisons and low performance.

Method used

The flow table is stored using a hash linked list structure. Each node stores the complete key and hash signature value. The hash signature value is compared first, and then the complete key is compared to quickly eliminate mismatches and improve matching efficiency.

Benefits of technology

By comparing hash signature values ​​first and then comparing complete keys, the performance and matching efficiency of virtual network packet forwarding are significantly improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116248593B_ABST
    Figure CN116248593B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a flow table keyword matching method, device, electronic device and storage medium. The flow table is stored in a hash linked list structure. The nodes of the hash linked list store complete keys, hash signature values ​​and processing information. When a new flow table node is created, a hash signature value of the complete key is saved on the basis of saving the complete key of the flow table. In the process of forwarding a virtual network message, a message to be forwarded is received, the complete key of the message is extracted to calculate the hash signature value of the message, and the hash signature value of the message is compared with the hash signature value of the flow table; if the message matches the hash signature value of the flow table, the message is compared with the complete key of the flow table to determine whether it matches the corresponding flow table, and the processing operation is determined according to the matching result. The present invention first compares the hash signature value of the flow table with the message, and then compares the complete key of the flow table with the message when the signature value matches, so as to quickly exclude unmatched items, improve matching efficiency, and improve the performance of virtual network message forwarding.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a flow table keyword matching method, a flow table keyword matching device, an electronic device and a computer-readable storage medium. Background Art

[0002] In the cloud computing virtual machine scenario, the virtual switch on the host machine usually needs to forward a large amount of data. This data often has a large number of concurrent connections. Therefore, the virtual switch needs to save a large number of connections - flow tables, which are generally in the range of millions to tens of millions. Hash linked lists are usually used to save a large number of flow tables.

[0003] After a message hash hits a hash bucket, the message's keywords need to be compared with the keywords of the existing flow tables in the hash list one by one to determine whether the flow table corresponding to the message exists. However, the keywords of cloud computing virtual network flow tables usually contain many fields, and multiple keyword comparisons are required, resulting in poor performance of virtual network message forwarding. Summary of the invention

[0004] In view of the above problems, embodiments of the present invention are proposed to provide a flow table keyword matching method, a flow table keyword matching device, an electronic device and a computer-readable storage medium that overcome the above problems or at least partially solve the above problems.

[0005] In order to solve the above problem, an embodiment of the present invention discloses a flow table keyword matching method, wherein the flow table is stored in a hash linked table structure, and the nodes of the hash linked table store the corresponding complete key and hash signature value, and the method includes:

[0006] In the process of forwarding a virtual network message, receiving a message to be forwarded;

[0007] Extracting the complete key of the message, and calculating the hash signature value of the message according to the complete key of the message;

[0008] Compare the hash signature value of the message with the hash signature value of the flow table;

[0009] If the hash signature value of the message matches the hash signature value of the flow table, the message is compared with the complete key of the flow table to determine whether it matches the corresponding flow table, and the processing operation is determined according to the matching result.

[0010] Optionally, the method further comprises:

[0011] If the hash signature value of the message does not match the hash signature value of the flow table, the message is not compared with the complete key of the flow table, and the hash signature value of the message is compared with the hash signature value of the next flow table.

[0012] Optionally, extracting the complete key of the message and calculating the hash signature value of the message according to the complete key of the message includes:

[0013] Extract the complete key of the message, perform a hash operation on the complete key of the message, and obtain a hash signature value of the message.

[0014] Optionally, comparing the hash signature value of the message with the hash signature value of the flow table includes:

[0015] The hash signature value of the message is compared with the hash signature value in each node of the hash linked list one by one.

[0016] Optionally, comparing the message with the complete key of the flow table to determine whether the corresponding flow table is matched, and determining a processing operation according to the matching result includes:

[0017] If the message matches the complete key of the flow table, a flow table corresponding to the match is determined, and the message is processed according to the flow table.

[0018] Optionally, comparing the message with the complete key of the flow table to determine whether the corresponding flow table is matched, and determining a processing operation according to the matching result, further includes:

[0019] If the message does not match all the nodes of the hash bucket corresponding to the flow table, it is determined that the flow table corresponding to the message does not exist, a new node is inserted into the hash linked list, and the complete key and hash signature value of the message are stored.

[0020] Optionally, after extracting the complete key of the message and calculating the hash signature value of the message according to the complete key of the message, the method further includes:

[0021] According to the complete key of the flow table, the hash value of the hash chain table is calculated to search the corresponding hash chain table according to the hash value.

[0022] The embodiment of the present invention further discloses a flow table keyword matching device, wherein the flow table is stored in a hash chain table structure, and the nodes of the hash chain table store the corresponding complete key and hash signature value, and the device comprises:

[0023] A flow table keyword acquisition module is used to receive a message to be forwarded during the virtual network message forwarding process;

[0024] A message signature value calculation module, used to extract the complete key of the message and calculate the hash signature value of the message according to the complete key of the message;

[0025] A signature value comparison module, used to compare the hash signature value of the message with the hash signature value of the flow table;

[0026] The signature value matching module is used to compare the message with the complete key of the flow table if the hash signature value of the message matches the hash signature value of the flow table, determine whether they match the corresponding flow table, and determine the processing operation based on the matching result.

[0027] Optionally, the device further comprises:

[0028] A keyword mismatch module is used to compare the hash signature value of the message with the hash signature value of the next flow table instead of comparing the message with the complete key of the flow table if the hash signature value of the message does not match the hash signature value of the flow table.

[0029] Optionally, the message signature value calculation module includes:

[0030] The hash operation submodule is used to extract the complete key of the message, perform a hash operation on the complete key of the message, and obtain a hash signature value of the message.

[0031] Optionally, the signature value comparison module includes:

[0032] The one-by-one comparison submodule is used to compare the hash signature value of the message with the hash signature value in each node of the hash chain list one by one.

[0033] Optionally, the signature matching module includes:

[0034] The message processing submodule is used to determine the corresponding flow table if the message matches the complete key of the flow table, and process the message according to the flow table.

[0035] Optionally, the signature matching module further includes:

[0036] The node insertion submodule is used to determine that the flow table corresponding to the message does not exist if the message does not match all the nodes of the hash bucket corresponding to the flow table, insert a new node into the hash linked list, and store the complete key and hash signature value of the message.

[0037] Optionally, after extracting the complete key of the message and calculating the hash signature value of the message according to the complete key of the message, the device further includes:

[0038] A linked list search module is used to calculate the hash value of the hash linked list according to the complete key of the flow table, so as to search the corresponding hash linked list according to the hash value.

[0039] An embodiment of the present invention further discloses an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the steps of the flow table keyword matching method described above when executed by the processor.

[0040] The embodiment of the present invention further discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the flow table keyword matching method described above are implemented.

[0041] The embodiments of the present invention include the following advantages:

[0042] In an embodiment of the present invention, the flow table can be stored in a hash linked list structure, and the nodes of the hash linked list store the corresponding complete key + hash signature value and processing information. The method includes: when creating a new flow table node, on the basis of saving the complete key of the flow table, save a hash signature value of the complete key. In the process of forwarding virtual network messages, receive the message to be forwarded; extract the complete key of the message, and calculate the hash signature value of the message based on the complete key; compare the message with the hash signature value of the flow table; if the message matches the hash signature value of the flow table, then compare the message with the complete key of the flow table to determine whether it matches the corresponding flow table, and determine the processing operation based on the matching result. The embodiment of the present invention compares the hash signature value of the flow table with the message first, and then compares the complete key of the flow table with the message when the signature value matches, so that the unmatched items can be quickly eliminated, the matching efficiency can be improved, and the performance of virtual network message forwarding can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 It is a schematic diagram of using a hash linked list structure to store a flow table;

[0044] Figure 2 This is a schematic diagram of a traditional flow table keyword matching;

[0045] Figure 3 It is a flowchart of the steps of a flow table keyword matching method provided by an embodiment of the present invention;

[0046] Figure 4 is a flowchart of another flow table keyword matching method provided by an embodiment of the present invention;

[0047] Figure 5is a schematic diagram of a flow table keyword matching provided by an embodiment of the present invention;

[0048] Figure 6 It is a structural block diagram of a flow table keyword matching device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0049] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0050] In cloud computing virtual machine scenarios, the virtual switch on the host usually needs to forward a large amount of data. This data often has a large number of concurrent connections. Therefore, the virtual switch needs to save a large number of connections - flow tables, which are generally in the range of millions to tens of millions. Figure 1 , shows a schematic diagram of using a hash linked list structure to store flow tables, wherein a hash linked list can be used to store a large number of flow tables.

[0051] Due to the inevitable collision of hashes, hash lists usually have a certain depth. After a message hash hits a hash bucket, the message's key needs to be compared with the key of the existing flow in the hash list one by one to determine whether the flow corresponding to the message exists. The key of a cloud computing virtual network flow usually contains many fields (for example, source MAC (Media Access Control Address), destination MAC, source IP (Internet Protocol), source port, destination IP, destination port, protocol, message receiving port, and VPCID (Virtual Private Cloud Identity Document), totaling 31 bytes). Most of these comparisons are mismatched.

[0052] Reference Figure 2 , shows a schematic diagram of a traditional flow table keyword matching. In traditional solutions, the complete key is usually stored in the flow, and after the complete key is extracted from the message, the two complete keys are compared to see if they match.

[0053] However, the traditional method of directly comparing complete keys has obvious defects. First, a complete key needs to be compared, and a large amount of data needs to be compared. When the hash table is deep and the corresponding message does not hit or hits late, multiple complete key comparisons are required, resulting in poor performance of virtual network message forwarding. Second, the complete key that needs to be compared is not distributed continuously in the message. When comparing, it is necessary to compare each field multiple times, or copy the key to obtain a continuous key and then compare it, resulting in poor performance of virtual network message forwarding and low matching efficiency.

[0054] One of the core concepts of the embodiment of the present invention is that the flow table can be stored in a hash linked list structure, and the nodes of the hash linked list store the corresponding complete key + hash signature value and processing information. The method includes: when creating a new flow table node, on the basis of saving the complete key of the flow table, save a hash signature value of the complete key. In the process of forwarding virtual network messages, receive the message to be forwarded; extract the complete key of the message, and calculate the hash signature value of the message based on the complete key; compare the message with the hash signature value of the flow table; if the message matches the hash signature value of the flow table, then compare the message with the complete key of the flow table to determine whether it matches the corresponding flow table, and determine the processing operation based on the matching result. The embodiment of the present invention compares the hash signature value of the flow table with the message first, and then compares the complete key of the flow table with the message when the signature value matches, so that the unmatched items can be quickly eliminated, the matching efficiency is improved, and the performance of virtual network message forwarding is improved.

[0055] Reference Figure 3 , shows a flow chart of a flow table keyword matching method provided by an embodiment of the present invention, wherein the flow table is stored in a hash linked table structure, and the nodes of the hash linked table store the corresponding complete key and hash signature value and processing information. The method may specifically include the following steps:

[0056] Step 301: During the virtual network message forwarding process, a message to be forwarded is received.

[0057] The flow table keyword matching method of the embodiment of the present invention can be applied to the virtual network message forwarding process. The nodes of the hash linked list can store the complete key and hash signature value of the corresponding flow table. When comparing, the hash signature values ​​of the flow table and the message are compared first. When the signature values ​​match, the complete key of the flow table and the message are compared, thereby quickly eliminating unmatched items and improving the flow table matching efficiency.

[0058] In an embodiment of the present invention, a hash linked table structure can be used to store the flow table, wherein the node of the hash linked table can store the complete key and hash signature value and processing information of the corresponding flow table. When a new flow table node is created, a hash signature value of the complete key is saved on the basis of saving the complete key of the flow table. In the process of forwarding virtual network messages, messages that need to be forwarded can be received.

[0059] Step 302: extract the complete key of the message, and calculate the hash signature value of the message according to the complete key of the message.

[0060] Specifically, after extracting the complete key of the message to be forwarded, a hash signature algorithm may be used to perform a hash operation on the complete key of the message to obtain a hash signature value of the message.

[0061] Step 303: compare the hash signature value of the message with the hash signature value of the flow table.

[0062] In an embodiment of the present invention, the hash signature value of the message and the flow table can be compared first, and then the complete key of the flow table and the message can be compared when the signature values ​​match, so as to quickly eliminate unmatched items and improve the flow table matching efficiency.

[0063] Step 304: If the hash signature value of the message matches the hash signature value of the flow table, the message is compared with the keyword of the flow table to determine whether it matches the corresponding flow table, and a processing operation is determined according to the matching result.

[0064] When the hash signature value of the message matches the flow table, the complete key of the flow table and the message can be compared to determine whether the corresponding flow table is matched, and corresponding processing operations can be performed based on the matching results.

[0065] In an embodiment of the present invention, the flow table can be stored in a hash linked list structure, and the nodes of the hash linked list store the corresponding complete key + hash signature value and processing information. The method includes: when creating a new flow table node, on the basis of saving the complete key of the flow table, save a hash signature value of the complete key. In the process of forwarding virtual network messages, receive the message to be forwarded; extract the complete key of the message, and calculate the hash signature value of the message based on the complete key; compare the message with the hash signature value of the flow table; if the message matches the hash signature value of the flow table, then compare the message with the complete key of the flow table to determine whether it matches the corresponding flow table, and determine the processing operation based on the matching result. The embodiment of the present invention compares the hash signature value of the flow table with the message first, and then compares the complete key of the flow table with the message when the signature value matches, so that the unmatched items can be quickly eliminated, the matching efficiency can be improved, and the performance of virtual network message forwarding can be improved.

[0066] Reference Figure 4 , shows a flowchart of another flow table keyword matching method provided by an embodiment of the present invention, wherein the flow table is stored in a hash linked table structure, and the nodes of the hash linked table store the corresponding complete key and hash signature value and processing information. The method may specifically include the following steps:

[0067] Step 401: During the virtual network message forwarding process, a message to be forwarded is received.

[0068] The flow table keyword matching method of the embodiment of the present invention can be applied to the virtual network message forwarding process. The node entry of the hash linked table can store the keyword key and hash signature value sign_value of the corresponding flow table. When comparing, the hash signature value of the flow table and the message are compared first. When the signature values ​​match, the complete key of the flow table and the message are compared, thereby quickly eliminating unmatched items and improving matching efficiency.

[0069] Step 402: extract the complete key of the message, and calculate the hash signature value of the message according to the complete key of the message.

[0070] In an optional embodiment, after extracting the complete key of the message and calculating the hash signature value of the message based on the complete key of the message, the method may further include: calculating the hash value of the hash linked list based on the complete key of the flow table, so as to search the corresponding hash linked list according to the hash value.

[0071] In the process of forwarding virtual network packets, the complete key of the flow table stored in the hash table structure can be obtained first, and then the hash value hash_value of the hash table is calculated using the hash algorithm according to the complete key of the flow table, so as to find the corresponding hash table according to the hash value hash_value. The hash algorithm can map a binary value of any length to a smaller binary value of a fixed length. This small binary value can be called a hash value. The hash value can be a unique and extremely compact numerical representation of a piece of data.

[0072] In an optional embodiment, the step 402 may include: extracting a complete key of the message, performing a hash operation on the complete key of the message, and obtaining a hash signature value of the message.

[0073] After extracting the complete key of the message to be forwarded, a hash signature algorithm can be used to perform a hash operation on the complete key of the message to obtain the hash signature value of the message.

[0074] Step 403: compare the hash signature value of the message with the hash signature value of the flow table.

[0075] In an optional embodiment, the step 403 may include: comparing the hash signature value of the message with the hash signature value in each node of the hash linked list one by one.

[0076] The hash signature value sign_value of the message can be compared with the hash signature value sign_value of each node entry in the hash linked list one by one to determine whether the hash signature value of the message matches the hash signature value of the flow table.

[0077] Step 404: If the hash signature value of the message matches the hash signature value of the flow table, the message is compared with the complete key of the flow table to determine whether they match the corresponding flow table, and a processing operation is determined based on the matching result.

[0078] In an optional embodiment, step 404 may include: if the message matches the complete key of the flow table, determining a flow table corresponding to the match, and processing the message according to the flow table.

[0079] If the hash signature value of the message matches the flow table, the message can be compared with the complete key of the flow table. In most cases, the complete key of the message and the flow table also match. When the message matches the complete key of the flow table, that is, the match hits, the corresponding flow table can be determined, and the message can be processed according to the matching flow table.

[0080] In an optional embodiment, step 404 may also include: if the message does not match all nodes of the hash bucket corresponding to the flow table, determining that the flow table corresponding to the message does not exist, inserting a new node into the hash linked list, and storing the complete key and hash signature value of the message.

[0081] If the message matches the hash signature value of the flow table, the message can be compared with the complete key of the flow table. When the message does not match all the nodes of the hash bucket corresponding to the flow table, it can be determined that the flow table corresponding to the message does not exist, and a new node entry can be inserted at the end of the hash chain table. The new node entry can store the complete key and hash signature value sign_value of the message at the same time.

[0082] Step 405: If the hash signature value of the message does not match the hash signature value of the flow table, the message is not compared with the complete key of the flow table, and the hash signature value of the message is compared with the hash signature value of the next flow table.

[0083] If the hash signature value of the message does not match the flow table, the complete key of the message and the flow table will not match either. In this case, the message does not need to be compared with the complete key of the flow table, and the hash signature value of the message can be directly compared with the hash signature value of the next flow table.

[0084] In the embodiment of the present invention, a hash signature of a complete key is added on the basis of the original direct comparison of the complete key. When comparing, the hash signatures are compared first, and the complete key is compared only when the signatures match. Because the hash algorithm of the signature is different from the hash algorithm of the hash bucket, and the 4 bytes of the signature are generally much larger than the width of the hash bucket, the probability of the signature colliding again is extremely low, so most of the keys that match the signature also match. The present invention can quickly exclude unmatched items through signature comparison, thereby improving the matching efficiency of the flow table.

[0085] In an embodiment of the present invention, the flow table can be stored in a hash linked list structure, and the nodes of the hash linked list store the corresponding complete key + hash signature value and processing information. The method includes: when creating a new flow table node, on the basis of saving the complete key of the flow table, save a hash signature value of the complete key. In the process of forwarding virtual network messages, receive the message to be forwarded; extract the complete key of the message, and calculate the hash signature value of the message based on the complete key; compare the message with the hash signature value of the flow table; if the message matches the hash signature value of the flow table, then compare the message with the complete key of the flow table to determine whether it matches the corresponding flow table, and determine the processing operation based on the matching result. The embodiment of the present invention compares the hash signature value of the flow table with the message first, and then compares the complete key of the flow table with the message when the signature value matches, so that the unmatched items can be quickly eliminated, the matching efficiency can be improved, and the performance of virtual network message forwarding can be improved.

[0086] In order to enable those skilled in the art to better understand the embodiments of the present invention, an example is provided below to illustrate the embodiments of the present invention. Figure 5, showing a schematic diagram of a flow table keyword matching provided by an embodiment of the present invention. First, a message is received, and the hash value of the hash table is calculated according to the complete key, recorded as hash_value, and the signature value is calculated by another hash algorithm, recorded as sign_value. Then, according to the hash_value, the corresponding hash table is found, and the sign_value of each entry in the hash table is compared with the sign_value of the message one by one. If the sign_value does not match, the key does not match, and you can directly skip comparing the next one; if the sign_value matches, you can compare the key again, and in most cases the key also matches. If the match is hit, the message can be processed according to the flow table of this entry; if the match is not hit, a new entry can be inserted at the end of the hash table, and the new entry stores the complete key+sign at the same time.

[0087] Taking the average depth of the hash chain table as 8 as an example, assuming that each message needs to compare half the bucket depth on average. In the traditional solution, the number of bytes to be compared is 31*4=124; while in the flow table keyword matching solution provided by the embodiment of the present invention, the number of bytes to be compared is 4*4+31=47 bytes. It can be seen that since the flow table matching is performed for each message, the embodiment of the present invention can improve the performance of virtual network message forwarding, thereby improving the efficiency of flow table keyword matching.

[0088] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0089] Reference Figure 6 , shows a structural block diagram of a flow table keyword matching device provided by an embodiment of the present invention, wherein the flow table is stored in a hash linked table structure, and the nodes of the hash linked table store the keywords and hash signature values ​​of the corresponding flow table, and specifically may include the following modules:

[0090] The flow table keyword acquisition module 601 is used to receive the message to be forwarded during the virtual network message forwarding process;

[0091] A message signature value calculation module 602, used for extracting the complete key of the message and calculating the hash signature value of the message according to the complete key of the message;

[0092] A signature value comparison module 603, used to compare the hash signature value of the message with the hash signature value of the flow table;

[0093] The signature value matching module 604 is used to compare the message with the complete key of the flow table if the hash signature value of the message matches the hash signature value of the flow table, determine whether they match the corresponding flow table, and determine the processing operation based on the matching result.

[0094] In an optional embodiment, the device further includes:

[0095] A keyword mismatch module is used to compare the hash signature value of the message with the hash signature value of the next flow table instead of comparing the message with the complete key of the flow table if the hash signature value of the message does not match the hash signature value of the flow table.

[0096] In an optional embodiment, the message signature value calculation module includes:

[0097] The hash operation submodule is used to extract the complete key of the message, perform a hash operation on the complete key of the message, and obtain a hash signature value of the message.

[0098] In an optional embodiment, the signature value comparison module includes:

[0099] The one-by-one comparison submodule is used to compare the hash signature value of the message with the hash signature value in each node of the hash chain list one by one.

[0100] In an optional embodiment, the signature matching module includes:

[0101] The message processing submodule is used to determine the corresponding flow table if the message matches the complete key of the flow table, and process the message according to the flow table.

[0102] In an optional embodiment, the signature matching module further includes:

[0103] The node insertion submodule is used to determine that the flow table corresponding to the message does not exist if the message does not match all the nodes of the hash bucket corresponding to the flow table, insert a new node into the hash linked list, and store the complete key and hash signature value of the message.

[0104] In an optional embodiment, after extracting the complete key of the message and calculating the hash signature value of the message according to the complete key of the message, the device further includes:

[0105] A linked list search module is used to calculate the hash value of the hash linked list according to the complete key of the flow table, so as to search the corresponding hash linked list according to the hash value.

[0106] In an embodiment of the present invention, the flow table can be stored in a hash linked list structure, and the nodes of the hash linked list store the corresponding complete key + hash signature value and processing information. The method includes: when creating a new flow table node, on the basis of saving the complete key of the flow table, save a hash signature value of the complete key. In the process of forwarding virtual network messages, receive the message to be forwarded; extract the complete key of the message, and calculate the hash signature value of the message based on the complete key; compare the message with the hash signature value of the flow table; if the message matches the hash signature value of the flow table, then compare the message with the complete key of the flow table to determine whether it matches the corresponding flow table, and determine the processing operation based on the matching result. The embodiment of the present invention compares the hash signature value of the flow table with the message first, and then compares the complete key of the flow table with the message when the signature value matches, so that the unmatched items can be quickly eliminated, the matching efficiency can be improved, and the performance of virtual network message forwarding can be improved.

[0107] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0108] An embodiment of the present invention further provides an electronic device, including:

[0109] It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, each process of the above-mentioned flow table keyword matching method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0110] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned flow table keyword matching method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0111] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0112] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0113] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0114] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0115] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0116] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0117] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0118] The above is a detailed introduction to a flow table keyword matching method, device, electronic device and storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A flow table keyword matching method, characterized in that: The flow table is stored in a hash linked list structure, and the nodes of the hash linked list store the corresponding complete key and hash signature value. The method includes: In the process of forwarding a virtual network message, receiving a message to be forwarded; Extracting the complete key of the message, and calculating the hash signature value of the message according to the complete key of the message; Compare the hash signature value of the message with the hash signature value of the flow table; If the hash signature value of the message matches the hash signature value of the flow table, the message is compared with the complete key of the flow table to determine whether it matches the corresponding flow table, and a processing operation is determined according to the matching result; If the hash signature value of the message does not match the hash signature value of the flow table, the message is not compared with the complete key of the flow table, and the hash signature value of the message is compared with the hash signature value of the next flow table.

2. The method according to claim 1, characterized in that: The extracting the complete key of the message and calculating the hash signature value of the message according to the complete key of the message includes: Extract the complete key of the message, perform a hash operation on the complete key of the message, and obtain a hash signature value of the message.

3. The method according to claim 2, characterized in that The comparing the hash signature value of the message with the hash signature value of the flow table includes: The hash signature value of the message is compared with the hash signature value in each node of the hash linked list one by one.

4. The method according to claim 1, characterized in that: The comparing the message with the complete key of the flow table to determine whether the corresponding flow table is matched, and determining a processing operation according to the matching result, includes: If the message matches the complete key of the flow table, a corresponding flow table is determined, and the message is processed according to the flow table.

5. The method according to claim 4, characterized in that The comparing the message with the complete key of the flow table, determining whether the corresponding flow table is matched, and determining a processing operation according to the matching result, further includes: If the message does not match all the nodes of the hash bucket corresponding to the flow table, it is determined that the flow table corresponding to the message does not exist, a new node is inserted into the hash linked list, and the complete key and hash signature value of the message are stored.

6. The method according to claim 1, characterized in that After extracting the complete key of the message and calculating the hash signature value of the message according to the complete key of the message, the method further includes: According to the complete key of the flow table, the hash value of the hash chain table is calculated to search the corresponding hash chain table according to the hash value.

7. A flow table keyword matching device, characterized in that: The flow table is stored in a hash linked table structure, and the nodes of the hash linked table store the corresponding complete key and hash signature value. The device includes: A flow table keyword acquisition module is used to receive a message to be forwarded during the virtual network message forwarding process; A message signature value calculation module, used to extract the complete key of the message and calculate the hash signature value of the message according to the complete key of the message; A signature value comparison module, used to compare the hash signature value of the message with the hash signature value of the flow table; A signature value matching module, used for comparing the message with the complete key of the flow table if the hash signature value of the message matches the hash signature value of the flow table, judging whether they match the corresponding flow table, and determining a processing operation according to the matching result; A keyword mismatch module is used to compare the hash signature value of the message with the hash signature value of the next flow table instead of comparing the message with the complete key of the flow table if the hash signature value of the message does not match the hash signature value of the flow table.

8. The device according to claim 7, characterized in that The message signature value calculation module includes: The hash operation submodule is used to extract the complete key of the message, perform a hash operation on the complete key of the message, and obtain a hash signature value of the message.

9. The device according to claim 8, characterized in that The signature value comparison module comprises: The one-by-one comparison submodule is used to compare the hash signature value of the message with the hash signature value in each node of the hash chain list one by one.

10. The device according to claim 7, characterized in that The signature value matching module includes: The message processing submodule is used to determine the corresponding flow table if the message matches the complete key of the flow table, and process the message according to the flow table.

11. The device according to claim 10, characterized in that The signature value matching module further includes: The node insertion submodule is used to determine that the flow table corresponding to the message does not exist if the message does not match all the nodes of the hash bucket corresponding to the flow table, insert a new node into the hash linked list, and store the complete key and hash signature value of the message.

12. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the flow table keyword matching method according to any one of claims 1 to 6 are implemented.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the flow table keyword matching method according to any one of claims 1 to 6 are implemented.