Data message forwarding method and device, storage medium and electronic device

By building an index table in a programmable switch and selecting packets using hash function, the bandwidth consumption and delay problems caused by multiple round trips between the interactive machine and the server are solved, and efficient data packet forwarding is achieved.

CN114265869BActive Publication Date: 2024-12-13CHINA TELECOM CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111568014.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-21
Publication Date
2024-12-13
Estimated Expiration
2041-12-21

AI Technical Summary

Technical Problem

In the prior art, multiple round trips between the interactive machine and the server lead to problems such as bandwidth resource consumption and message processing delay.

Method used

The hash function is used to randomly select the packet set of state information, and an index table with the mapping relationship between the packet and the state identification bits are constructed. The status information matching high-traffic services is cached in the programmable switch, and the low-traffic services are guided through the index table. The status information is migrated to the server to realize the rapid matching and forwarding of data packets.

Benefits of technology

Improve bandwidth usage efficiency, reduce message processing delay, and reduce the number of round trips between the interactive machine and the server.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114265869B_ABST
    Figure CN114265869B_ABST
Patent Text Reader

Abstract

The present disclosure provides a data message forwarding method and device, storage medium and electronic device, and relates to the field of computer technology. Among them, the data message forwarding method includes: receiving a data message, obtaining the state information of the data message network; using a hash function to randomly select in the group set of the state information, and constructing an index table of the mapping relationship between the group and the state identification bit of the state information according to the random selection result; based on the guidance of the index table, when the existing cache information matches the state information, the data message corresponding to the cache information is forwarded first; after the index table queries the information matching the virtual address of the state information, the state information is sent to the server corresponding to the destination address; the forwarding path is re-established for the state information that does not match the forwarding path. By organizing the caching and forwarding of data messages through the index table, it is possible to quickly match and forward data messages in a single round.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] As more and more services are deployed on the cloud, virtual network element deployment using programmable switches is favored by cloud vendors due to its low cost, high performance, and low latency. Due to the cache capacity limitations of programmable switches, when faced with stateful forwarding network elements such as gateways, firewalls, and load balancing, external general servers are more often used to implement extended cache of state information.

[0003] When using external resources to cache state information, the existing technology mostly uses sequential segmentation or horizontal segmentation of state information to achieve state information caching. Data message forwarding requires multiple round trips between the programmable switch and the server, which consumes a lot of bandwidth resources and has message processing delays.

[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0005] The purpose of the present disclosure is to provide a message forwarding method and device, a storage medium and an electronic device, which at least to a certain extent overcome the problem that message forwarding in related technologies requires multiple round trips between an interactive machine and a server, resulting in excessive consumption of bandwidth resources and message processing delays.

[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.

[0007] According to one aspect of the present disclosure, a method for forwarding a data message is provided, comprising: receiving a data message, obtaining status information of the data message network, the status information comprising a mapping relationship between a virtual address and a destination address; performing random selection in a set of packets of the status information using a hash function, constructing an index table of a mapping relationship between packets of the status information and status identification bits according to the random selection result, each packet of the status information being provided with the status identification bit, and organizing a cache of the status information according to the index table; based on the guidance of the index table, preferentially forwarding a data message corresponding to the cache information when existing cache information matches the status information; after information matching the virtual address of the status information is queried in the index table, sending the status information to a server corresponding to the destination address, wherein the server matches the status information and triggers the corresponding data message to be forwarded after the match; and reestablishing a forwarding path for the status information that has not matched a forwarding path.

[0008] In one embodiment of the present disclosure, the hash function is used to perform random selection in the group set of the state information, and an index table of the mapping relationship between the group of the state information and the state identification bit is constructed according to the random selection result. Each group of the state information is respectively provided with the state identification bit. The step of organizing the cache of the state information according to the index table includes: grouping according to the virtual address of the state information to obtain an initial set of groups, and each group is constructed with a state identification bit; sorting according to the data message forwarding amount in each group, and selecting multiple groups using the hash function; for each selected group, the mth destination address is selected through the mod of the hash function to form a shadow group; the state information corresponding to the shadow group is placed in the cache of the programmable device, and the other state information is gradually migrated to the server.

[0009] In one embodiment of the present disclosure, the step of sorting according to the data packet forwarding amount in each group and selecting multiple groups using a hash function includes: counting the data packet forwarding amount corresponding to each group, and arranging the groups in the group set in descending order based on the counting result; randomly selecting a subset of length d from the top K groups through a hash function; resetting the status flag of the selected group to 1, and resetting the status flag of the unselected group to 0.

[0010] In one embodiment of the present disclosure, the step of selecting the mth destination address for each selected group by the mod of a hash function to form a shadow group includes: selecting the mth destination address for each selected group by the mod of a hash function to form a shadow group, and setting the status identification of the shadow group to 1; forming a new group with the unselected destination addresses in each selected group, replacing the group at the same position in the initial set with the new group, and resetting the status identification bit of the new group to 0.

[0011] In one embodiment of the present disclosure, the step of re-establishing a forwarding path for the status information that is not matched to a forwarding path includes: obtaining the status information of the data message through a routing table; setting the status identification bit of the group corresponding to the virtual address of the status information to 0, and gradually migrating to the corresponding server; after the migration is completed, triggering the server to forward the data message that matches the status information.

[0012] In one embodiment of the present disclosure, the hash function is used to perform random selection in the group set of the state information, and an index table of the mapping relationship between the group of the state information and the state identification bit is constructed according to the random selection result. Each group of the state information is respectively provided with the state identification bit. The step of organizing the cache of the state information according to the index table also includes: detecting whether the current cached information exceeds a set threshold, and setting different migration schemes according to the detection result.

[0013] In one embodiment of the present disclosure, the hash function is used to perform random selection in the set of groups of the state information, and an index table of the mapping relationship between the groups of the state information and the state identification bits is constructed according to the random selection results. Each group of the state information is respectively provided with the state identification bit. The step of organizing the cache of the state information according to the index table also includes: resetting the constructed index table at fixed intervals.

[0014] According to another aspect of the present disclosure, a message forwarding device is provided, including: a receiving module, used to receive a data message and obtain the status information of the data message network; a building module, used to use a hash function to perform random selection in the group set of the status information, and to construct an index table of the mapping relationship between the group of the status information and the status identification bit according to the random selection result, each group of the status information is respectively provided with the status identification bit, and the cache of the status information is organized according to the index table; a first forwarding module, used to forward the data message corresponding to the cache information based on the guidance of the index table, preferentially when the existing cache information matches the status information; a second forwarding module, after searching the index table for information matching the virtual address of the status information, sending the status information to a server corresponding to the destination address, wherein the server matches the status information and triggers the corresponding data message to be forwarded after the match; and a reconstruction module, used to re-establish a forwarding path for the status information that has not matched the forwarding path.

[0015] According to another aspect of the present disclosure, there is provided an electronic device, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the above-mentioned message forwarding method by executing the executable instructions.

[0016] According to another aspect of the present disclosure, there is provided a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned message forwarding method is implemented.

[0017] The message forwarding method provided by the embodiment of the present disclosure constructs a cache index table, caches the status information of high-traffic services in a programmable device for matching and forwarding, and guides the status information of non-high-traffic services to the server through the index table. It can quickly match and forward data messages in a single round, improve bandwidth utilization efficiency, and reduce message processing delay.

[0018] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0020] Figure 1 A schematic diagram showing a computer system structure in an embodiment of the present disclosure;

[0021] Figure 2 A schematic diagram showing a data message forwarding system structure in an embodiment of the present disclosure;

[0022] Figure 3 A flow chart of a method for forwarding a data message in an embodiment of the present disclosure is shown;

[0023] Figure 4 A flow chart of another method for forwarding data packets according to an embodiment of the present disclosure is shown;

[0024] Figure 5 A mapping relationship between grouping sets in an embodiment of the present disclosure is shown;

[0025] Figure 6 A mapping relationship of a group set bitmap in an embodiment of the present disclosure is shown;

[0026] Figure 7 A flowchart of index table construction in an embodiment of the present disclosure is shown;

[0027] Figure 8 A flow chart of another method for forwarding a data message in an embodiment of the present disclosure is shown;

[0028] Fig. 9 A flow chart of another method for forwarding a data message in an embodiment of the present disclosure is shown;

[0029] Fig.10 A flow chart of another method for forwarding data packets according to an embodiment of the present disclosure is shown;

[0030] Fig.11 A flow chart of another method for forwarding a data message in an embodiment of the present disclosure is shown;

[0031] Fig.12 A flow chart of another method for forwarding a data message in an embodiment of the present disclosure is shown;

[0032] Fig.13 A schematic diagram of a data message forwarding device in an embodiment of the present disclosure is shown; and

[0033] Fig.14A structural block diagram of a computer device for forwarding data packets in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0034] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0035] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0036] The solution provided by this application caches the status information of high-traffic services in a programmable switch by constructing an index table, and gradually migrates the status information of other services to a distributed server cluster based on the index table. The forwarding of data messages is guided by matching the status information of the data message with the cache information. For ease of understanding, several terms involved in this application are first explained below.

[0037] The index table uses a balanced tree (B-tree) variant to organize data storage; while the regular table uses a heap to organize data storage. Here, the so-called balanced tree variant structure means that the data stored in it needs to be sorted, and the data is sorted according to the primary key.

[0038] Bitmap indexes on index tables support the use of bitmap indexes on partitioned or unpartitioned index tables. A mapping table is required to create a bitmap index. A bitmap index on an index table is very similar to a bitmap index on a heap organization table. The difference is that the rowids used by the former bitmap index are the rowids in the mapping table, not the base table. Each index table can have a mapping table, and all bitmaps of an index table will use a mapping table.

[0039] Programmable switches, in Ethernet networks, act as information transfer stations. They forward data received from a certain port through other ports. Programmable switches are divided into control plane programmability and data plane programmability. Fully programmable switches are controllable in both the control plane and the data plane. Users can define how the switch processes data packets, and the switch is not bound to any specific network protocol. When the switch leaves the factory, the content of the forwarding chip ASIC is empty. Customers can program it according to their own needs to complete customized needs, and can perform online programming upgrades at any time according to business needs.

[0040] The solution provided in the embodiment of the present application relates to a data message forwarding technology, which is specifically described by the following embodiments:

[0041] Figure 1 1 is a schematic diagram of a computer system provided by an exemplary embodiment of the present application. The system includes: a plurality of terminals 120 and a server cluster 140.

[0042] The terminal 120 may be a mobile terminal such as a mobile phone, a game console, a tablet computer, an e-book reader, smart glasses, an MP4 (Moving Picture Experts Group Audio Layer IV) player, a smart home device, an AR (Augmented Reality) device, a VR (Virtual Reality) device, or the terminal 120 may also be a personal computer (PC), such as a laptop computer and a desktop computer.

[0043] The terminal 120 is connected to the programmable device 130 via a communication network. Optionally, the communication network is a wired network or a wireless network. The programmable device 130 can be connected to the communication network via a router, a modem, and the like.

[0044] like Figure 2 As shown, the programmable device 130 can be directly connected to the server cluster 140, and a physical address or Ethernet address can be bound to the server cluster on the router.

[0045] The server cluster 140 is a server, or is composed of several servers, or is a virtualization platform, or is a cloud computing service center. The server cluster 140 is used to provide services for forwarding and storing data messages. Optionally, the server cluster 140 undertakes the main computing work, and the terminal 120 undertakes the secondary computing work; or, the server cluster 140 undertakes the secondary computing work, and the terminal 120 undertakes the main computing work; or, the terminal 120 and the server cluster 140 adopt a distributed computing architecture for collaborative computing.

[0046] In some optional embodiments, the server cluster 140 is used to store data packets and status information of the data packets.

[0047] Below, each step of the message forwarding method in this example implementation will be described in more detail with reference to the accompanying drawings and embodiments.

[0048] Figure 3 The method provided by the embodiment of the present disclosure can be executed by any electronic device with computing and processing capabilities, such as Figure 2 The programmable switch 130 and / or the server cluster 140 in the embodiment. In the following example description, the programmable switch 130 is used as the execution subject for example description.

[0049] like Figure 3 As shown, the programmable switch 130 executes a method for forwarding a data message, and the method for forwarding a data message includes the following steps:

[0050] S302, receiving a data message, and obtaining status information of the data message network;

[0051] Among them, data messages in the process of network transmission can be obtained. Specifically, data messages may include data units exchanged and transmitted in the network, that is, data blocks to be sent by the site at one time. The message contains the complete data information to be sent, and its length may be inconsistent, and the length is unlimited and variable. Furthermore, during the network transmission process, the data message will be continuously encapsulated into groups, packets, and frames for transmission. The encapsulation method is to add some information segments, such as adding a message header, and organize them in a certain format. The encapsulation package includes a variety of information, such as message type, message version, message length, message entity, etc. Messages can be used to exchange information when making requests and responses between various systems, and they need to comply with the prescribed format.

[0052] When the data message reaches the network element in the programmable device, it is interpreted with the help of PARSE in the ASIC of the programmable chip. The status information of the data message network can be obtained.

[0053] S304: Use a hash function to randomly select from the grouping set of the state information, and construct an index table of the state information and the bit information of the state information cache.

[0054] Among them, different information index tables can be constructed based on different grouping sets in the MATCH-ACTION of the programmable device.

[0055] The state information is the mapping relationship between the virtual address and the destination address. The state information can be obtained by querying the routing table. A routing table is a spreadsheet (file) or a database-like file stored in a router or a networked computer. The routing table stores the path to a specific network address. Furthermore, the routing table contains the topology information of the network periphery, which can implement routing protocols and static routing selection. The data packet routing information corresponding to the data packet can be determined through the routing table.

[0056] A virtual address (VIP) reflects the external virtual IP address of a business, and as a whole can reflect the network traffic of the business or service itself.

[0057] The state information forms a group set, and a random selection is performed based on the sorting of the group set through a hash function to distinguish the state information of high-traffic services from the state information of low-traffic services. The difference between the two services is not absolute, but has a certain degree of randomness and relativity. The state information of low-traffic services can be queried to its corresponding destination address through the index table. The index table can organize the state information of high-traffic services and the state information of low-traffic services to be cached in different storage areas, and establish a forwarding path for data packets.

[0058] Among them, step S304 can be before or after the data forwarding step. There are changes and construction actions of the index table when the programmable device is initially set up, when the index table is updated, when the forwarding path cannot be found, etc.

[0059] S306, based on the guidance of the index table, preferentially forwarding the data message corresponding to the cache information when the existing cache information matches the state information;

[0060] Among them, the identifier corresponding to the state identification bit in the index table can determine that the state information is cached in the programmable device, and this part of the state information is matched first, and the data message corresponding to the matched state information is forwarded from the programmable device.

[0061] S308, after searching the index table for information matching the virtual address of the state information, sending the state information to a server corresponding to the destination address, wherein the server matches the state information and triggers the corresponding data message to be forwarded after matching;

[0062] For status information corresponding to services other than high-traffic services, the destination address is first queried in the index table through the virtual address. If the destination address can be matched, the status information is matched through the server, and the corresponding data message is triggered for forwarding after the match.

[0063] S310: Re-establish a forwarding path for the state information that is not matched to a forwarding path.

[0064] In steps S306 and S308, no forwarding path is matched, and forwarding can only be performed after a forwarding path needs to be established.

[0065] like Figure 4 As shown, in one embodiment, step S304, using a hash function to randomly select from the grouping set of the state information, and constructing an index table of the state information and the bit information of the state information cache, includes:

[0066] S402, grouping is performed according to the virtual address of the state information to obtain an initial set of groups, and each group is constructed with a state identification bit.

[0067] Each data packet has corresponding status information, which includes the virtual address and the destination address, and the corresponding relationship between the two. There are many situations for the corresponding relationship between the virtual address and the destination address, as shown in the following table. A virtual address can correspond to one destination address or multiple destination addresses.

[0068] Among them, Figure 5 As shown, the destination address is divided into different groups G according to different virtual address information, that is, one virtual address is divided into one group. After grouping, a group set {G1, G2, ...Gi, ...Gn} is formed.

[0069] like Figure 6 As shown, in the group set {G1, G2, ... Gi, ... Gn}, each group Gi is constructed with a 1-bit status identification bit, where bit = 0 indicates that the group is not selected, and bit = 1 indicates that the group is selected.

[0070] S404, sorting according to the forwarding amount of data packets in each group, and selecting multiple groups using a hash function.

[0071] Among them, after each group is sorted according to the forwarding volume, it can distinguish between high-traffic services and low-traffic services, but the services ranked in the top few forwarding volumes are not directly regarded as high-traffic services. Instead, the hash function is used to randomly select the data packets ranked in the top few. When the index table is updated, the services ranked in the top few forwarding volumes have the opportunity to be selected as high-traffic services. This can make programmable devices more adaptable and more balanced during business changes.

[0072] S406, for each selected group, select the mth destination address through the mod of the hash function to form a shadow group.

[0073] Among them, fixed m destination addresses are selected from different groups respectively, and each selected group further selects a destination address, which can improve the balance of each group.

[0074] S408, placing the state information corresponding to the shadow group in the cache of the device, and gradually migrating the other state information to the server.

[0075] The cache of status information is organized through the index table, and the status information of high-traffic services is cached in the programmable device. The status information corresponding to other services is guided to the target server through the index table, realizing single-round fast matching to guide the forwarding of data messages.

[0076] like Figure 7 , 8 As shown, in one embodiment, step S404, a specific implementation method of selecting multiple groups by using a hash function according to the order of the data message forwarding amount in each group, includes:

[0077] S802, counting the data message forwarding amount corresponding to each group, and arranging the groups in the group set in descending order based on the counting result.

[0078] Each group is provided with a data packet counter, and the data packet forwarded to any destination address in the group Gi is incremented by 1. The counter can be based on the relevant counting rules set by the programmable device, for example, the block coloring counting method in RFC8321 is adopted, and the counting result is stored in the cache area.

[0079] Arrange the groups in the group set {G1, G2, ..., Gi, ..., Gn} in descending order based on the counting results of the data message counter to generate {Gr1, Gr2, ..., Gri, ..., Grn}. And clear the counter of the data message so that it can count from zero at the next reset.

[0080] S804: randomly select a subset of length d from the top K groups by using a hash function.

[0081] Among them, in the set of groups arranged in descending order outputted in step S802, the top K groups are randomly selected by a hash function, and the required sequence numbers {Gh1, Gh2...Ghk} are recorded and selected, where K is less than or equal to n.

[0082] Then, a subset of length d is randomly selected from the above K groups through the hash function: {Gd1, Gd2…Gdd}. The group is selected based on the hash value of KEY=VIP address+Port. That is:

[0083] HASH({Gh1, Gh2,…,Ghk})={Gd1,Gd2,…,Gdd}.

[0084] S806: reset the status flag of the selected group to 1, and reset the status flag of the unselected group to 0.

[0085] The flag of the group {Gd1, Gd2, …, Gdd} in the state flag bit is updated to 1, and the state flag bits of other unselected groups are updated to 0.

[0086] like Figure 7 , 9 As shown, in one embodiment, step S406, for each selected group, selects the mth destination address through the mod of the hash function to form a specific implementation of the shadow group, including:

[0087] S902, for each selected group, select the mth destination address through the mod of the hash function to form a shadow group, and set the state identifier of the shadow group to 1.

[0088] Among the groups selected in steps S802 to S806, m fixed destination addresses are selected according to the hash value mod m of the destination address to form a shadow group G', and the state flag bit of the shadow group is set to 1. The details are as follows:

[0089] HASH1(Gd1)=Gd1'=DIP'1, HASH2(Gd2)=Gd2'=DIP'2,..., HASHd(Gdd)=Gdd'=DIP'd;

[0090] Shadow group G'={Gd1',Gd2',…,Gdd'}={DIP'1,DIP'2,…,DIP'd}.

[0091] And the state information corresponding to the shadow group is placed in the cache of the programmable device.

[0092] S904: The unselected destination addresses in each selected group are grouped into a new group, the new group replaces the group at the same position in the initial set, and the state flag bit of the new group is reset to 0.

[0093] A new group {Gd”1, Gd”2, …, Gd”d} is formed for other destination addresses in the group {Gd1, Gd2, …, Gdd}, and the group at the same position in the original set is replaced, and the status flag of the group is set to 0.

[0094] The state information corresponding to the group marked as 0 is gradually migrated to the external server. The migration path can be established by the control plane of the programmable device or centralized in the controller, for example, based on the target address or other related flow information. RDMA can be used first to improve the latency of subsequent cache information query and reduce the CPU investment cost.

[0095] like Fig.10 As shown, in one embodiment, step S210, a specific implementation method of re-establishing a forwarding path for the state information that is not matched to a forwarding path includes:

[0096] S1002, obtaining the status information of the data message through a routing table;

[0097] When the corresponding virtual address cannot be found in the established index table, the data message status information can be obtained by querying the routing table. The status information includes the virtual address, the destination address corresponding to the virtual address, and the mapping relationship between the destination address and the server.

[0098] S1004, setting the status flag of the group corresponding to the virtual address of the status information to 0, and gradually migrating to the corresponding server.

[0099] The virtual address of the state information corresponds to the group Gn+1 by default, and the state flag of the group Gn+1 is set to 0, and the migration of the cache information is gradually implemented subsequently.

[0100] S1006: After the migration is completed, trigger the server to forward the matching data message.

[0101] After the state information is cached to the corresponding server, the forwarding path of the data message has been established, and the programmable device can send a forwarding request to the corresponding server, triggering the server to start matching and forwarding operations. The server matches the cache information based on the request, for example, by matching the hash value of the state information with the hash value of the cache information, and forwards the corresponding cache information if they match.

[0102] like Fig.11As shown, in one embodiment, step S304 further includes, after step S408: step S409, detecting whether the current cache information exceeds a set threshold, and setting different migration schemes according to the detection result.

[0103] Among them, as the state information of the cache area gradually increases, when the cache information exceeds the set threshold, 1 / 2 of the cache-related information items in the cache area will be migrated to the external destination server cache according to the destination address, while maintaining the cache migration time and detecting the time interval between each migration. As the time interval between two cache migrations changes, the scale of cache information migration is reasonably selected. If the time interval gradually decreases, the cache migration ratio will be gradually increased, such as 1 / 2+1 / 4...; otherwise, the migration cache ratio will be gradually reduced.

[0104] like Fig.12 As shown, in one embodiment, step S304 also includes: step S410, resetting the constructed index table at fixed intervals.

[0105] The counters in each group can be re-counted and sorted after a fixed time interval, that is, steps S802-806 and steps S902-904 are repeatedly executed, and a new index table can be generated under a new sorting and a new random selection of the hash function.

[0106] In addition, the cache information in the distributed server cluster can be gradually cleared according to the DIP address for the state information newly included in the programmable device cache. For the network state cache information that has been migrated to the server, as the traffic count increases, it will be necessary to implement network state information caching on the programmable device side. Then, for the cache of these new network state cache information on the programmable device side, the cache information on the server side can be gradually deleted or automatically cleared when it expires.

[0107] It should be noted that the above figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0108] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".

[0109] Refer to the following Fig.13The data packet forwarding device according to this embodiment of the present invention is described. Fig.13 The data message forwarding device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0110] The data message forwarding device 1300 is in the form of a hardware module and includes: a receiving module 1301 , a building module 1302 , a first forwarding module 1303 , a second forwarding module 1304 , and a reconstruction module 1305 .

[0111] The receiving module 1301 is used to receive data packets and obtain the state information of the data packet network; the constructing module 1302 is used to use a hash function to randomly select from the grouping set of the state information and construct an index table of the state information and the bit information cached by the state information. The first forwarding module 1303 is used to forward the data packet corresponding to the cache information based on the guidance of the index table, preferentially when the existing cache information matches the state information. The second forwarding module 1304 sends the state information to the server corresponding to the destination address after searching the index table for information matching the virtual address of the state information, wherein the server matches the state information and triggers the corresponding data packet to be forwarded after matching. And the reconstruction module 1305 is used to re-establish the forwarding path for the state information that has not matched the forwarding path.

[0112] Refer to the following Fig.14 14 to 15. The electronic device 1400 according to this embodiment of the present invention is described. Fig.14 The electronic device 1400 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0113] like Fig.14 As shown, the electronic device 1400 is in the form of a general computing device. The components of the electronic device 1400 may include but are not limited to: at least one processing unit 1410, at least one storage unit 1420, and a bus 1430 connecting different system components (including the storage unit 1420 and the processing unit 1410).

[0114] The storage unit stores program codes, which can be executed by the processing unit 1410, so that the processing unit 1410 performs the steps according to various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification. For example, the processing unit 1410 can perform the following steps: Figure 3As shown in S302, receiving a data message and obtaining the status information of the data message network; S304, using a hash function to randomly select from the grouping set of the status information, and constructing an index table of the status information and the bit information of the status information cache; S306, based on the guidance of the index table, preferentially forwarding the data message corresponding to the cache information when the existing cache information matches the status information; S308, after searching the index table for information matching the virtual address of the status information, sending the status information to the server corresponding to the destination address, wherein the server matches the status information and triggers the corresponding data message to be forwarded after matching; S310, re-establishing a forwarding path for the status information that has not matched the forwarding path.

[0115] The storage unit 1420 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 14201 and / or a cache storage unit 14202 , and may further include a read-only storage unit (ROM) 14203 .

[0116] The storage unit 1420 may also include a program / utility 14204 having a set (at least one) of program modules 14205, such program modules 14205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0117] Bus 1430 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0118] The electronic device 1400 may also communicate with one or more external devices 1500 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1400, and / or may communicate with any device that enables the electronic device 1400 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1450. In addition, the electronic device 1400 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 1460. As shown, the network adapter 1460 communicates with other modules of the electronic device 1400 via a bus 1430. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1400, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0119] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0120] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of the present specification.

[0121] A program product for implementing the above method according to an embodiment of the present invention is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.

[0122] The program product may be any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0123] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0124] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0125] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0126] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0127] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0128] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0129] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.

Claims

1. A method for forwarding a data message, characterized in that: include: Receive a data message, and obtain state information of the data message network, wherein the state information includes a mapping relationship between a virtual address and a destination address; A hash function is used to randomly select the group set of the state information, and an index table of the mapping relationship between the group of the state information and the state identification bit is constructed according to the random selection result, each group of the state information is respectively provided with the state identification bit, and the cache of the state information is organized according to the index table; Based on the guidance of the index table, when the existing cache information matches the state information, the data message corresponding to the cache information is forwarded preferentially; After the index table searches for information matching the virtual address of the state information, the state information is sent to a server corresponding to the destination address, wherein the server matches the state information and triggers the corresponding data message to be forwarded after the match; The state information that is not matched to the forwarding path re-establishes the forwarding path.

2. The method according to claim 1, characterized in that The step of using a hash function to randomly select from the group set of the state information, constructing an index table of mapping relationships between the groups of the state information and the state identification bits according to the random selection result, each group of the state information is respectively provided with the state identification bit, and organizing the cache of the state information according to the index table includes: Grouping is performed according to the virtual address of the state information to obtain an initial set of groups, and each group is constructed with a state identification bit; Sorting the data packets forwarded in each group, and selecting multiple groups using a hash function; For each selected group, select the mth destination address through the mod of the hash function to form a shadow group; The state information corresponding to the shadow group is placed in the cache of the programmable device, and the other state information is gradually migrated to the server.

3. The method according to claim 2, characterized in that The step of selecting multiple groups by using a hash function according to the order of the forwarding amount of data packets in each group includes: Count the data message forwarding amount corresponding to each group, and arrange the groups in the group set in descending order based on the counting result; A subset of length d is randomly selected from the top K groups through a hash function; The status flag of the selected group is reset to 1, and the status flag of the unselected group is reset to 0.

4. The method according to claim 3, characterized in that The step of selecting the mth destination address of each selected group through the mod of the hash function to form a shadow group includes: For each selected group, select the mth destination address through the mod of the hash function to form a shadow group, and set the state of the shadow group to 1; The unselected destination addresses in each selected group are formed into a new group, the new group replaces the group at the same position in the initial set, and the state identification bit of the new group is reset to 0.

5. The method according to claim 1, characterized in that The step of re-establishing a forwarding path for the state information that is not matched to a forwarding path comprises: Acquire the status information of the data message through the routing table; The state flag bit of the group corresponding to the virtual address of the state information is set to 0, and the group is gradually migrated to the corresponding server; After the migration is completed, the server is triggered to forward the data message matching the status information.

6. The method according to any one of claims 1 to 5, characterized in that The step of randomly selecting the group set of the state information by using a hash function, constructing an index table of the mapping relationship between the group of the state information and the state identification bit according to the random selection result, each group of the state information is respectively provided with the state identification bit, and organizing the cache of the state information according to the index table also includes: Check whether the current cache information exceeds the set threshold and set different migration plans based on the detection results.

7. The method according to claim 2, characterized in that The step of using a hash function to randomly select from the group set of the state information, constructing an index table of mapping relationships between the groups of the state information and the state identification bits according to the random selection result, each group of the state information is respectively provided with the state identification bit, and organizing the cache of the state information according to the index table also includes: At fixed intervals, the constructed index table is reset.

8. A data message forwarding device, characterized in that: include: A receiving module, used to receive a data message and obtain state information of the data message network, wherein the state information includes a mapping relationship between a virtual address and a destination address; A construction module, used to use a hash function to randomly select from the group set of the state information, and to construct an index table of mapping relationships between the groups of the state information and the state identification bits according to the random selection results, wherein each group of the state information is respectively provided with the state identification bit, and the cache of the state information is organized according to the index table; A first forwarding module, configured to forward the data message corresponding to the cache information based on the guidance of the index table and preferentially when the existing cache information matches the state information; A second forwarding module, after searching the index table for information matching the virtual address of the state information, sends the state information to a server corresponding to the destination address, wherein the server matches the state information and triggers the corresponding data message to be forwarded after matching; and The reconstruction module is used to re-establish a forwarding path for the state information that is not matched to the forwarding path.

9. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the data message forwarding method according to any one of claims 1 to 7 by executing the executable instructions.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the data message forwarding method according to any one of claims 1 to 7 is implemented.