Multi-card distributed flow table unloading method, computer equipment and medium
Through the multi-card distributed flow table offloading method, a memory card group composed of multiple memory cards is used to realize flow table offloading, which solves the problem of limited hardware resources of the data forwarding chip and improves resource utilization and adaptability.
Patent Information
- Application Number
- CN202411537159.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-01-24
Smart Images

Figure CN119363693A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a multi-card distributed flow table unloading method, computer equipment and medium. Background Art
[0002] The development of cloud computing networks, data centers, artificial intelligence and other technologies has generated a large amount of data traffic forwarding requirements, so high-performance data forwarding chips are needed to carry data forwarding services. In the prior art, the unloaded flow table deployment solution is to increase the service specifications of the hardware cache to carry larger flow table specifications. However, due to the limited hardware resources on the data forwarding chip, it is difficult to meet the increasing requirements of data forwarding services, and it leads to low utilization of hardware resources. It is also difficult to flexibly adapt to the requirements of complex and changing application environments and communication protocols.
[0003] To this end, the present application provides a multi-card distributed flow table unloading method, computer equipment and medium, which not only efficiently utilizes limited hardware resources to provide a high-performance flow table unloading deployment solution for data forwarding services, but also flexibly adapts to various application environments, user needs and communication protocol requirements. Summary of the invention
[0004] In the first aspect, the present application provides a multi-card distributed flow table unloading method. The flow table unloading method includes: determining a first flow table specification and a first message matching requirement associated with a first message data service, wherein the first message matching requirement indicates whether to perform tunnel encapsulation, whether to match a three-layer message, and whether to match a four-layer message; based on the first flow table specification and the first message matching requirement, allocating at least one storage card group consisting of at least one storage card for flow table unloading of the first message data service, wherein all storage cards in each storage card group of the at least one storage card group are used for flow table unloading of the same type of flow table, and the at least one storage card group is used for flow table unloading of different types of flow tables, respectively, and the sum of the service specifications of all storage cards in each storage card group of the at least one storage card group is not less than the flow table specification of the type of flow table corresponding to the storage card group in the first flow table specification.
[0005] Through the first aspect of the present application, not only limited hardware resources are efficiently utilized to provide a high-performance flow table unloading deployment solution for data forwarding services, but also various application environments, user needs and communication protocol requirements are flexibly adapted.
[0006] In a possible implementation of the first aspect of the present application, based on the first flow table specification and the first message matching requirement, the at least one storage card group consisting of the at least one storage card is allocated for flow table unloading of the first message data service, including: based on the first flow table specification, the at least one storage card group consisting of the minimum number of storage cards is allocated, and the sum of the service specifications of all storage cards in the at least one storage card group is not less than the first flow table specification.
[0007] In a possible implementation of the first aspect of the present application, the flow table unloading method further includes: in response to an update of the first flow table specification, determining an updated first flow table specification, and then, based on the updated first flow table specification, allocating at least one updated storage card group consisting of a minimum number of storage cards, and the sum of the business specifications of all storage cards in the at least one updated storage card group is not less than the updated first flow table specification.
[0008] In a possible implementation of the first aspect of the present application, when the first message matching requirement indicates non-matching of layer 3 messages and non-matching of layer 4 messages, the at least one storage card group includes a first storage card group, wherein all storage cards in the first storage card group are used for flow table unloading of flow tables of layer 2 message types in the first flow table specification.
[0009] In a possible implementation of the first aspect of the present application, when the first message matching requirement indicates matching three-layer messages and not matching four-layer messages, the at least one storage card group includes the first storage card group and also includes a second storage card group, wherein all storage cards in the second storage card group are used for flow table unloading of flow tables of the three-layer message type in the first flow table specification.
[0010] In a possible implementation of the first aspect of the present application, when the first message matching requirement indicates matching layer-3 messages and matching layer-4 messages, the at least one storage card group includes the first storage card group, the second storage card group also includes a third storage card group, wherein all storage cards in the third storage card group are used for flow table unloading of flow tables of the layer-4 message type in the first flow table specification.
[0011] In a possible implementation of the first aspect of the present application, when the first message matching requirement indicates tunnel encapsulation, the at least one storage card group includes a fourth storage card group, wherein all storage cards in the fourth storage card group are used for flow table unloading of flow tables of the tunnel message type in the first flow table specification.
[0012] In a possible implementation of the first aspect of the present application, the flow table unloading method also includes: when the used business specifications of any one of the at least one storage card groups reach a preset threshold, calling a storage card that meets the preset requirements from another storage card group in the at least one storage card group that is different from the any one of the storage card groups to the any one of the storage card groups.
[0013] In a possible implementation manner of the first aspect of the present application, the preset threshold is determined based on a preset ratio of the sum of the business specifications of all the memory cards in any one memory card group.
[0014] In a possible implementation of the first aspect of the present application, the preset requirement is the memory card with the largest business specification among all unoccupied memory cards in the memory card groups of the at least one memory card group except any one of the memory card groups that do not reach the preset threshold.
[0015] In a possible implementation of the first aspect of the present application, the preset requirement is the memory card with the largest business specification among the unoccupied memory cards in the other memory card groups in the at least one memory card group except for any one memory card group, determined in a first order, wherein the first order is determined based on the first message matching requirement relative to the flow table of the type corresponding to any one memory card group.
[0016] In a possible implementation of the first aspect of the present application, the flow table unloading method further includes: when the used business specification of the other storage card group reaches the preset threshold, recovering from the any storage card group the storage card previously called from the other storage card group to the any storage card group.
[0017] In a possible implementation of the first aspect of the present application, the first message matching requirement also indicates a first message data format associated with the first message data service, and the first message data format is used to determine the flow table specifications of each type of flow table in the first flow table specifications.
[0018] In a second aspect, an embodiment of the present application further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements a method according to any one of the implementation modes of any of the above aspects when executing the computer program.
[0019] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on a computer device, the computer device executes a method according to any one of the implementation methods of any of the above aspects.
[0020] In a fourth aspect, an embodiment of the present application further provides a computer program product, which includes instructions stored on a computer-readable storage medium, and when the instructions are executed on a computer device, the computer device executes a method according to any one of the implementation methods of any of the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0022] Figure 1 A schematic diagram of an application scenario of flow table offloading;
[0023] Figure 2 A schematic diagram of a flow chart of a multi-card distributed flow table unloading method provided in an embodiment of the present application;
[0024] Figure 3 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] The embodiments of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0026] It should be understood that, in the description of this application, "at least one" means one or more, and "a plurality of" means two or more. In addition, unless otherwise specified, the words "first", "second", etc. are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.
[0027] Figure 1 A schematic diagram of an application scenario of flow table unloading. Figure 1 As shown, there are multiple memory cards on the data forwarding chip 101. These memory cards can be random access memories (RAM) of different business specifications and can adopt different product types, such as double data rate synchronous dynamic random access memory (doubledatarate SDRAM, DDR SDRAM), referred to as DDR. Figure 1Memory card A111, memory card B113, memory card C115, memory card D117, and memory card E119 are exemplarily shown. These different memory cards may have different service specifications. For example, the service specification of memory card A111 is 10 megabytes (MB), the service specification of memory card B113 is 20MB, the service specification of memory card C115 is 30MB, the service specification of memory card D117 is 40MB, and the service specification of memory card E119 is 50MB. The flow table to be unloaded to the data forwarding chip 101 is the flow table 103 associated with the first message data service, which is used to meet the data forwarding service requirements of the first message data service. Therefore, depending on the application environment, user needs, and communication protocol requirements of the first message data service, the flow table 103 associated with the first message data service may have different flow table specifications and message matching requirements, and may also have different message data formats. These differences can improve data forwarding performance by optimizing the hardware deployment solution. Considering that the hardware resources on the data forwarding chip 101 are limited, although the storage resources available to the data forwarding chip 101 can be expanded by external storage, such as inserting an additional memory card, it will still increase the data processing delay, which is not conducive to improving the data forwarding efficiency. Therefore, it is necessary to consider how to utilize the limited storage resources on the data forwarding chip 101, such as Figure 1 The multiple memory cards on the data forwarding chip 101 shown in the figure can meet the increasing requirements of data forwarding services and improve the utilization rate of hardware resources as much as possible. Figure 2 The specific embodiments are used to explain in detail how a multi-card distributed flow table unloading method provided in the embodiment of the present application can not only efficiently utilize limited hardware resources to provide a high-performance flow table unloading deployment solution for data forwarding services, but also flexibly adapt to various application environments, user needs and communication protocol requirements.
[0028] Figure 2 A schematic diagram of a multi-card distributed flow table unloading method provided in an embodiment of the present application. Figure 2 As shown, the flow table unloading method includes the following steps.
[0029] Step S201: Determine a first flow table specification and a first message matching requirement associated with a first message data service, wherein the first message matching requirement indicates whether to perform tunnel encapsulation, whether to match a layer-3 message, and whether to match a layer-4 message.
[0030] Step S203: Based on the first flow table specification and the first message matching requirement, at least one storage card group consisting of at least one storage card is allocated for flow table unloading of the first message data service, wherein all the storage cards in each storage card group in the at least one storage card group are used for flow table unloading of the same type of flow table, and the at least one storage card group is used for flow table unloading of different types of flow tables, respectively, and the sum of the service specifications of all the storage cards in each storage card group in the at least one storage card group is not less than the flow table specification of the flow table of the type corresponding to the storage card group in the first flow table specification.
[0031] See also Figure 2 , in step S201, determine the first flow table specification and the first message matching requirement associated with the first message data service. The first message matching requirement indicates whether to perform tunnel encapsulation, whether to match the third layer message, and whether to match the fourth layer message. At the data link layer, according to the specific communication protocol and message data format, the message hierarchy can be divided into multiple levels, such as three levels, four levels, etc., which correspond to the second layer message (L2), the third layer message (L3) and the fourth layer message (L4). The specific definition of the characteristic field of each layer message can be set in combination with the specific application. In some embodiments, the characteristic field of the second layer message is the machine physical address, therefore, the second layer message matching or L2 matching is to look up the machine physical address to forward the message to the corresponding port; the characteristic field of the third layer message is the network protocol address, therefore, the third layer message matching or L3 matching is to look up the network protocol address to forward the message to the corresponding port. In order to improve the utilization efficiency of the unloaded flow table specifications, a multi-card distributed flow table unloading method provided in an embodiment of the present application divides the flow table into four types, corresponding to layer 2 messages (L2), layer 3 messages (L3), layer 4 messages (L4), and tunnel messages (tunnel). Here, the tunnel message is used for tunnel encapsulation and decapsulation, that is, the original message is encapsulated inside the tunnel message and then transmitted through the tunnel network. As a message data format that carries the original message, the tunnel message also has its own flow table, that is, a flow table of the tunnel message type. In this way, by distinguishing the first message matching requirement associated with the first message data service into multiple types of flow tables, that is, dividing into flow tables corresponding to four types of layer 2 messages, layer 3 messages, layer 4 messages, and tunnel messages, various message matching requirements can be met. For example, the flow table matching of the tunnel message can be performed first, and then L2 matching, or L2 plus L3 matching, or L2 plus L3 plus L4 matching can be performed. Among them, when it comes to the layered matching of the original message, it is necessary to go from the outermost layer L2 to L3 and then to L4, that is, first perform L2 matching and then L3 matching, or first perform L2 matching and then L3 matching and L4 matching. This can be used to improve the subsequent flow table unloading business.
[0032] Continue reading Figure 2 In step S203, based on the first flow table specification and the first message matching requirement, at least one memory card group consisting of at least one memory card is allocated for flow table unloading of the first message data service. Among them, all memory cards in each memory card group in the at least one memory card group are used for flow table unloading of the same type of flow table, and the at least one memory card group is used for flow table unloading of different types of flow tables, and the sum of the service specifications of all memory cards in each memory card group in the at least one memory card group is not less than the flow table specification of the type of flow table corresponding to the memory card group in the first flow table specification. In this way, by making different types of flow tables distributed on different memory card groups as much as possible, the memory cards in the same memory card group are used for flow table unloading of the same type of flow table, so that the distributed business division improves the independence between the businesses, and can better combine the message matching requirements corresponding to different types of flow tables for comprehensive layout. Specifically, the storage cards corresponding to the same type of flow table can be organized into a group, that is, the same storage card group, such as a layer 2 message storage card group, a layer 3 message storage card group, a layer 4 message storage card group, and a tunnel message storage card group. By adding or deleting the storage cards in a certain storage card group, the sum of the service specifications of the storage cards used for the flow table unloading service of the corresponding type of flow table can be conveniently adjusted, that is, the storage resources that can be controlled by the flow table unloading of the corresponding type of flow table can be adjusted. This is conducive to flexible adaptation to complex and changeable application environments such as cloud computing networks, can simplify user policies and flexibly adapt to actual needs, and use different storage cards together to meet the specification requirements of flow table unloading, which is conducive to intelligent adjustment of the specifications corresponding to a certain type of flow table. For example, if the flow table specifications of the layer 2 message storage card group are full, a storage card can be drawn from the layer 3 message storage card group and added to the layer 2 message storage card group, so that the flow table specifications of the flow table unloading service of the layer 2 message can be increased. In some embodiments, in each memory card group, the memory card with the largest business specification is used first, that is, the memory card with the largest business specification is sorted from the largest to the smallest according to the size of the business specification, and the memory card with the highest order is used first. When it is necessary to support other memory card groups, the memory card with the largest business specification that is not used is selected from the extracted memory card group for support. Therefore, for a certain memory card group, the memory card with the largest business specification is used first to unload the flow table of the corresponding type, and when supporting other memory card groups, the memory card with the largest business specification among the unoccupied memory cards is preferentially extracted. In this way, the resource utilization rate of multiple memory cards is improved. In some embodiments, according to business needs, a combination scheme with the least number of memory cards is selected, and the flow table specifications of multiple cards combined are required to be exactly the flow table specifications required by the user. In this way, the scheme with the least number of memory cards is selected, because the small number of memory cards can reduce the interaction between memory cards, further improving the access performance of the memory cards.
[0033] See also Figure 1 and Figure 2 , Figure 1Memory card A111, memory card B113, memory card C115, memory card D117, and memory card E119 are exemplarily shown. These different memory cards may have different service specifications. For example, the service specification of memory card A111 is 10 megabytes (MB), the service specification of memory card B113 is 20MB, the service specification of memory card C115 is 30MB, the service specification of memory card D117 is 40MB, and the service specification of memory card E119 is 50MB. As described above, the flow table types are divided into four types: layer 2 message (L2), layer 3 message (L3), layer 4 message (L4), and tunnel message (tunnel), and different types of flow tables are distributed as much as possible in different memory card groups and thus distributed on different memory cards. According to the matching requirements in the business needs, a combination scheme with the least number of memory cards is selected. Here, it is assumed that the user has three business requirements, the flow table specification of the first business requirement is 60MB, the flow table specification of the second business requirement is 80MB, and the flow table specification of the third business requirement is 120MB. For the flow table specification of the first business requirement of 60MB, memory card A111 (10MB), memory card B113 (20MB) and memory card C115 (30MB) can be combined together, or memory card A111 (10MB) and memory card E119 (50MB) can be combined together. Here, the combination scheme with the least number of memory cards is selected to reduce the interaction between memory cards. Therefore, memory card A111 (10MB) and memory card E119 (50MB) are selected to be combined together to meet the flow table specification of the first business requirement. Similarly, for the flow table specification of the second business requirement of 80MB, memory card C115 (30MB) and memory card E119 (50MB) are combined together. For the third business requirement, the flow table specification is 120MB, and memory card C115 (30MB), memory card D117 (40MB) and memory card E119 (50MB) are combined together. In this way, the user can choose which business requirement the server where the data forwarding chip is located is used for, and select the corresponding combination of memory cards, so as to use the combination with the least number of memory cards and improve access performance. In addition, depending on the actual message matching requirements, different types of flow tables are distributed on different memory cards as much as possible to improve business independence. For example, assuming that the message matching requirement is L2 plus L3, two memory cards are selected. For another example, assuming that the message matching requirement is L2 plus L3 plus L4, three memory cards are selected.For example, assuming that the flow table specification of the first service requirement is 60MB, the memory card A111 (10MB) and the memory card E119 (50MB) are selected to be combined together to meet the flow table specification of the first service requirement, and assuming that the message matching requirement of the first service requirement is L2 plus L3, the memory card A111 (10MB) can be arranged for L2 service, that is, for the flow table unloading of the second-layer message type, and the memory card E119 (50MB) can be arranged for L3 service, that is, for the flow table unloading of the third-layer message type. In this way, by dispersing different services, the deployment of distributed services on multiple memory cards is achieved, the independence of services is increased, and the specifications of a certain service can be conveniently increased or decreased by adding or removing memory cards, which is conducive to flexible adaptation to complex and changing application environments.
[0034] In conclusion, Figure 2 The multi-card distributed flow table unloading method shown realizes that the user allocates each storage card according to the specifications required by the business, so that the flow table specifications of multiple storage cards combined can just meet the flow table specifications required by the user, and the solution with the least number of storage cards can be selected, thereby reducing the interaction between storage cards. By using multiple cards together, the specifications of the unloaded flow table are increased; the flow table is divided into different types, so that different types of flow tables are distributed on different cards as much as possible, so that the distributed business division makes the business more independent, and the specifications of a certain business can be increased or reduced by simply replacing the storage card corresponding to the business, which is convenient and fast; the specifications of a certain type of flow table can be intelligently adjusted, and the full utilization and recycling of resources are realized, and the utilization rate of the storage resources of multiple cards is improved. In this way, not only the limited hardware resources are efficiently utilized to provide a high-performance flow table unloading deployment solution for data forwarding services, but also various application environments, user needs and communication protocol requirements are flexibly adapted.
[0035] In a possible implementation, based on the first flow table specification and the first message matching requirement, allocating the at least one storage card group consisting of the at least one storage card for flow table unloading of the first message data service includes: based on the first flow table specification, allocating the at least one storage card group consisting of the least number of storage cards, and the sum of the service specifications of all storage cards in the at least one storage card group is not less than the first flow table specification. Figure 1Taking the multiple memory cards shown as an example, assuming that the first flow table specification is 60MB, memory card A111 (10MB), memory card B113 (20MB) and memory card C115 (30MB) can be combined together, or memory card A111 (10MB) and memory card E119 (50MB) can be combined together. Here, the combination scheme with the least number of memory cards is selected to reduce the interaction between memory cards. Therefore, memory card A111 (10MB) and memory card E119 (50MB) are selected to be combined together to meet the flow table specification of the first business requirement. In this way, by allocating the least number of memory cards, the loss caused by the interaction between memory cards is reduced, which is conducive to improving access performance.
[0036] In some embodiments, the flow table unloading method further includes: in response to the update of the first flow table specification, determining the updated first flow table specification, and then, based on the updated first flow table specification, allocating at least one updated memory card group consisting of the least number of memory cards, and the sum of the service specifications of all memory cards in the updated at least one memory card group is not less than the updated first flow table specification. In this way, on the basis of improving access performance, it is conducive to flexibly adapting to complex and changeable application environments.
[0037] In a possible implementation, when the first message matching requirement indicates that the third-layer message and the fourth-layer message are not matched, the at least one storage card group includes a first storage card group, wherein all the storage cards in the first storage card group are used for the flow table unloading of the flow table of the second-layer message type in the first flow table specification. In this way, by distinguishing the first message matching requirement associated with the first message data service into multiple types of flow tables, that is, dividing into flow tables corresponding to four types of layer 2 messages, layer 3 messages, layer 4 messages and tunnel messages, various message matching requirements can be met, and by making different types of flow tables distributed on different storage card groups as much as possible, the storage cards in the same storage card group are used for the flow table unloading of the same type of flow table, so that the distributed service division improves the independence between services, and can better combine the message matching requirements corresponding to different types of flow tables for comprehensive layout.
[0038] In a possible implementation, when the first message matching requirement indicates matching the layer 3 message and not matching the layer 4 message, the at least one storage card group includes the first storage card group and also includes the second storage card group, wherein all the storage cards in the second storage card group are used for the flow table unloading of the flow table of the layer 3 message type in the first flow table specification. In this way, by distinguishing the first message matching requirement associated with the first message data service into multiple types of flow tables, that is, dividing into flow tables corresponding to four types of layer 2 messages, layer 3 messages, layer 4 messages and tunnel messages, various message matching requirements can be met, and by making different types of flow tables distributed on different storage card groups as much as possible, the storage cards in the same storage card group are used for the flow table unloading of the same type of flow table, so that the distributed service division improves the independence between services, and can better combine the message matching requirements corresponding to different types of flow tables for comprehensive layout.
[0039] In a possible implementation, when the first message matching requirement indicates matching a layer 3 message and matching a layer 4 message, the at least one storage card group includes the first storage card group, the second storage card group also includes a third storage card group, wherein all storage cards in the third storage card group are used for flow table unloading of a flow table of a layer 4 message type in the first flow table specification. In this way, by distinguishing the first message matching requirement associated with the first message data service into multiple types of flow tables, that is, dividing into flow tables corresponding to four types of layer 2 messages, layer 3 messages, layer 4 messages, and tunnel messages, various message matching requirements can be met, and by making different types of flow tables distributed on different storage card groups as much as possible, the storage cards in the same storage card group are used for flow table unloading of the same type of flow table, so that the distributed service division improves the independence between services, and can better combine the message matching requirements corresponding to different types of flow tables for comprehensive layout.
[0040] In a possible implementation, when the first message matching requirement indicates tunnel encapsulation, the at least one storage card group includes a fourth storage card group, wherein all storage cards in the fourth storage card group are used for flow table unloading of flow tables of the tunnel message type in the first flow table specification. In this way, by distinguishing the first message matching requirement associated with the first message data service into multiple types of flow tables, that is, dividing into flow tables corresponding to four types of layer 2 messages, layer 3 messages, layer 4 messages, and tunnel messages, various message matching requirements can be met, and by making different types of flow tables distributed on different storage card groups as much as possible, the storage cards in the same storage card group are used for flow table unloading of the same type of flow table, so that the distributed service division improves the independence between services, and can better combine the message matching requirements corresponding to different types of flow tables for comprehensive layout.
[0041] In a possible implementation, the flow table unloading method further includes: when the used service specifications of any one of the at least one storage card groups reach a preset threshold, calling a memory card that meets the preset requirements from another storage card group in the at least one storage card group that is different from the any one of the storage card groups to the any one of the storage card groups. In this way, by adding or deleting the memory cards in a certain storage card group, the sum of the service specifications of the memory cards used for the flow table unloading services of the corresponding type of flow table can be conveniently adjusted, that is, the storage resources that can be controlled by the flow table unloading of the corresponding type of flow table can be adjusted. This is conducive to flexible adaptation to complex and changeable application environments such as cloud computing networks, can simplify user policies and flexibly adapt to actual needs, use different memory cards together to meet the specification requirements of flow table unloading, and help to intelligently adjust the specifications corresponding to a certain type of flow table.
[0042] In some embodiments, the preset threshold is determined based on a preset ratio of the sum of the business specifications of all the memory cards in any memory card group. Here, the preset ratio can be set to 80% or any suitable value. For example, for a certain type of memory card group, the business threshold is set to be a preset ratio of the business specifications of the memory card group, such as 80%. Therefore, when 80% of the full data specification is reached, it is determined that the memory card group needs support, that is, the warning of the full flow table specification is triggered. In this way, it is possible to find a memory card group that has not reached the business threshold from other memory card groups, select a memory card group with an unoccupied memory card with the largest data specification to support, and give priority to extracting the unoccupied memory card with the largest business specification from the memory card group providing support. In this way, resource utilization and multi-card distributed storage efficiency are improved.
[0043] In some embodiments, the preset requirement is the memory card with the largest service specification among all the unoccupied memory cards in the memory card group that does not reach the preset threshold except any memory card group in the at least one memory card group. Here, from other memory card groups, find the memory card group that does not reach the service threshold, select the memory card group with the largest data specification of the unoccupied memory card to support, and preferentially extract the memory card with the largest service specification from the unoccupied memory card in the memory card group providing support. For example, the L2 service is full of specifications, the threshold of the L3 service is 32M, and the threshold is not reached, so 8M can be given to the L2 service. The threshold of the L4 service is 40M, and the threshold is not reached, so 10M can be allocated to the L2 service. L2 takes the largest RAM specification that can be used by L2 for a service, that is, 10M of the L4 service for unloading. If this 10M is also used up, find the largest RAM specification provided by other services to L2, that is, 8M of the L3 service. If the RAM specification provided by other services cannot be found, the L2 service fails to be unloaded and soft conversion is performed. Therefore, when a certain memory card group triggers a service threshold, it searches for the unoccupied memory card with the largest service specification from other memory cards that have not triggered their own service thresholds, thus improving resource utilization and multi-card distributed storage efficiency.
[0044] In some embodiments, the preset requirement is the memory card with the largest business specification among the unoccupied memory cards determined by the other memory card groups in the at least one memory card group except the any memory card group according to the first order, wherein the first order is determined based on the first message matching requirement relative to the flow table of the type corresponding to the any memory card group. In this way, improvements are made in combination with the message matching requirement, for example, referring to the following Table 1:
[0045] Table 1
[0046]
[0047] Referring to Table 1 above, the hierarchical matching of the original message needs to be from the outermost layer L2 to L3 and then to L4. Therefore, this point can be used to improve the flow table unloading service. Specifically, after the storage cards corresponding to various types of flow tables are initialized and allocated, multiple storage card groups are established. When a certain storage card group needs support, for example, the storage card group corresponding to L2 needs support, how to select the storage card group that provides support can be improved in combination with the message matching requirements. The current solution given in the briefing is that for a certain storage card group, the storage card with the largest business specification is preferentially used to unload the corresponding type of flow table, and when supporting other storage card groups, the storage card with the largest business specification is preferentially extracted from the unoccupied storage card. For example, if the storage card group of L2 reaches the service threshold, the idle storage card with the largest business specification is found from the storage card groups of L3, L4 and the tunnel, which may be L3 or L4. In this way, considering the storage card support strategy in Table 1 above, that is, establishing an order of storage card groups that provide support, it is conducive to adapting to the message matching requirements and improving the overall data forwarding efficiency and storage efficiency. While maximizing the resource utilization of the storage card, the probability of triggering the business threshold can also be reduced in combination with the message matching requirements, which helps to improve overall efficiency. For example, in the scenario of L2 plus L3 plus tunnel, when L2 is full, priority is given to the support of L3. This is because the flow table specifications of the tunnel may be relatively small when it is first allocated. If the storage card of the tunnel is extracted, it may also cause the business threshold of the tunnel to be triggered later, and then the storage card support will have to be performed again. In this way, by intelligently adjusting the specifications corresponding to a certain type of flow table, the storage resources available for flow table unloading of the corresponding type of flow table are adjusted, and the probability of triggering adjustment is reduced in combination with the message matching requirements, which helps to improve overall efficiency.
[0048] In some embodiments, the flow table unloading method further comprises: when the used service specification of the other memory card group reaches the preset threshold, reclaiming the memory card previously called from the other memory card group to the any memory card group from the any memory card group. In this way, resource recovery and overall resource utilization are improved.
[0049] In a possible implementation, the first message matching requirement further indicates a first message data format associated with the first message data service, and the first message data format is used to determine the flow table specifications of each type of flow table in the first flow table specifications. In this way, it is conducive to flexibly adapting to complex and changeable application environments such as cloud computing networks, simplifying user policies and flexibly adapting to actual needs, using different storage cards together to meet the specification requirements of flow table unloading, and facilitating intelligent adjustment of the specifications corresponding to a certain type of flow table.
[0050] Figure 33 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application, and the computing device 300 includes: one or more processors 310, a communication interface 320 and a memory 330. The processor 310, the communication interface 320 and the memory 330 are interconnected via a bus 340. Optionally, the computing device 300 may also include an input / output interface 350, and the input / output interface 350 is connected to an input / output device for receiving parameters set by a user, etc. The computing device 300 can be used to implement some or all of the functions of the device embodiment or system embodiment in the above-mentioned embodiment of the present application; the processor 310 can also be used to implement some or all of the operating steps of the method embodiment in the above-mentioned embodiment of the present application. For example, the specific implementation of the various operations performed by the computing device 300 can refer to the specific details in the above-mentioned embodiments, such as the processor 310 is used to perform some or all of the steps in the above-mentioned method embodiment or some or all of the operations in the above-mentioned method embodiment. For another example, in an embodiment of the present application, the computing device 300 may be used to implement part or all of the functions of one or more components in the above-mentioned apparatus embodiment. In addition, the communication interface 320 may be specifically used to perform the communication functions necessary to implement the functions of these apparatuses and components, and the processor 310 may be specifically used to perform the processing functions necessary to implement the functions of these apparatuses and components.
[0051] It should be understood that Figure 3 The computing device 300 may include one or more processors 310, and the multiple processors 310 may provide processing capabilities in a parallel connection mode, a serial connection mode, a serial-parallel connection mode, or any connection mode, or the multiple processors 310 may form a processor sequence or a processor array, or the multiple processors 310 may be divided into a main processor and an auxiliary processor, or the multiple processors 310 may have different architectures such as a heterogeneous computing architecture. In addition, Figure 3 The computing device 300 shown in the figure, and the related structural description and functional description are exemplary and non-limiting. In some exemplary embodiments, the computing device 300 may include Figure 3 More or fewer components may be shown, or some components may be combined or separated, or may have a different arrangement of components.
[0052] The processor 310 may have a variety of specific implementation forms. For example, the processor 310 may include a central processing unit (CPU), a graphic processing unit (GPU), a neural-network processing unit (NPU), a tensor processing unit (TPU) or a data processing unit (DPU), etc., and the embodiment of the present application does not specifically limit it. The processor 310 may also be a single-core processor or a multi-core processor. The processor 310 may be a combination of a CPU and a hardware chip. The above-mentioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. The processor 310 may also be implemented using a logic device with built-in processing logic alone, such as an FPGA or a digital signal processor (DSP). The communication interface 320 may be a wired interface or a wireless interface for communicating with other modules or devices. The wired interface may be an Ethernet interface, a local interconnect network (LIN), etc., and the wireless interface may be a cellular network interface or a wireless local area network interface, etc.
[0053] The memory 330 may be a non-volatile memory, such as a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The memory 330 may also be a volatile memory, which may be a random access memory (RAM) used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM). The memory 330 may also be used to store program codes and data, so that the processor 310 calls the program codes stored in the memory 330 to execute some or all of the operation steps in the above method embodiment, or to execute the corresponding functions in the above device embodiment. Figure 3 Show more or fewer components, or have different component configurations.
[0054] The bus 340 may be a peripheral component interconnect express (PCIe) bus, an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a compute express link (CXL), a cache coherent interconnect for accelerators (CCIX), etc. The bus 340 may be divided into an address bus, a data bus, a control bus, etc. In addition to the data bus, the bus 340 may also include a power bus, a control bus, and a status signal bus, etc. However, for the sake of clarity, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0055] The method and device provided in the embodiments of the present application are based on the same inventive concept. Since the principles of solving the problems in the methods and devices are similar, the embodiments, implementation methods, examples or implementation methods of the methods and devices can refer to each other, and the repeated parts will not be repeated. The embodiments of the present application also provide a system, which includes multiple computing devices, and the structure of each computing device can refer to the structure of the computing device described above. The functions or operations that can be implemented by the system can refer to the specific implementation steps in the above method embodiments and / or the specific functions described in the above device embodiments, which will not be repeated here.
[0056] The present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and when the computer instructions are executed on a computer device (such as one or more processors), the method steps in the above method embodiment can be implemented. The specific implementation of the processor of the computer-readable storage medium in executing the above method steps can refer to the specific operations described in the above method embodiment and / or the specific functions described in the above device embodiment, which will not be repeated here.
[0057] It should be understood by those skilled in the art that the embodiments of the present application may be provided as methods, systems, or computer program products. The present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. The embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any other combination. When implemented using software, the above embodiments may be implemented in whole or in part in the form of a computer program product. The present application may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program codes. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the process or function described in the embodiments of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions may be transmitted from one website site, computer, server, or data center to another website site, computer, server, or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. Computer-readable storage media can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media. Available media can be magnetic media (such as floppy disks, hard disks, tapes), optical media, or semiconductor media. Semiconductor media can be solid-state hard disks, random access memory, flash memory, read-only memory, erasable programmable read-only memory, electrically erasable programmable read-only memory, registers, or any other form of suitable storage media.
[0058] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. Each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes 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 device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing 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 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in 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.
[0059] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. The steps in the method of the embodiment of the present application can be adjusted in order, merged or deleted according to actual needs; the modules in the system of the embodiment of the present application can be divided, merged or deleted according to actual needs. If these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.
Claims
1. A multi-card distributed flow table unloading method, characterized in that: The flow table unloading method comprises: Determine a first flow table specification and a first message matching requirement associated with a first message data service, wherein the first message matching requirement indicates whether to perform tunnel encapsulation, whether to match a layer 3 message, and whether to match a layer 4 message; Based on the first flow table specification and the first message matching requirement, at least one storage card group consisting of at least one storage card is allocated for flow table unloading of the first message data service, wherein all storage cards in each storage card group in the at least one storage card group are used for flow table unloading of the same type of flow table, and the at least one storage card group is respectively used for flow table unloading of different types of flow tables, and the sum of the service specifications of all storage cards in each storage card group in the at least one storage card group is not lower than the flow table specification of the flow table of the type corresponding to the storage card group in the first flow table specification.
2. The flow table unloading method according to claim 1, characterized in that: Based on the first flow table specification and the first message matching requirement, the at least one storage card group composed of the at least one storage card is allocated for flow table unloading of the first message data service, including: based on the first flow table specification, the at least one storage card group composed of the minimum number of storage cards is allocated, and the sum of the service specifications of all storage cards in the at least one storage card group is not less than the first flow table specification.
3. The flow table unloading method according to claim 2, characterized in that: The flow table unloading method further includes: In response to an update of the first flow table specification, an updated first flow table specification is determined, and then, based on the updated first flow table specification, at least one updated storage card group consisting of a minimum number of storage cards is allocated, and the sum of the business specifications of all storage cards in the at least one updated storage card group is not less than the updated first flow table specification.
4. The flow table unloading method according to claim 1, characterized in that: When the first message matching requirement indicates non-matching of layer 3 messages and non-matching of layer 4 messages, the at least one storage card group includes a first storage card group, wherein all storage cards in the first storage card group are used for flow table unloading of flow tables of layer 2 message types in the first flow table specification.
5. The flow table unloading method according to claim 4, characterized in that: When the first message matching requirement indicates matching layer 3 messages and not matching layer 4 messages, the at least one storage card group includes the first storage card group and also includes a second storage card group, wherein all storage cards in the second storage card group are used for flow table unloading of flow tables of layer 3 message types in the first flow table specification.
6. The flow table unloading method according to claim 5, characterized in that: When the first message matching requirement indicates matching layer 3 messages and matching layer 4 messages, the at least one storage card group includes the first storage card group, and the second storage card group also includes a third storage card group, wherein all storage cards in the third storage card group are used for flow table unloading of the flow table of the layer 4 message type in the first flow table specification.
7. The flow table unloading method according to any one of claims 4 to 6, characterized in that: When the first message matching requirement indicates tunnel encapsulation, the at least one memory card group includes a fourth memory card group, wherein all memory cards in the fourth memory card group are used for flow table unloading of a flow table of a tunnel message type in the first flow table specification.
8. The flow table unloading method according to claim 7, characterized in that: The flow table unloading method further includes: When the used service specification of any memory card group in the at least one memory card group reaches a preset threshold, a memory card meeting preset requirements is called from another memory card group in the at least one memory card group different from the any memory card group to the any memory card group.
9. The flow table unloading method according to claim 8, characterized in that: The preset threshold is determined based on a preset ratio of the sum of the business specifications of all the memory cards in any one memory card group.
10. The flow table unloading method according to claim 8, characterized in that: The preset requirement is the memory card with the largest service specification among all unoccupied memory cards in the memory card groups of the at least one memory card group except any one memory card group that do not reach the preset threshold.
11. The flow table unloading method according to claim 8, characterized in that: The preset requirement is the memory card with the largest business specification among the unoccupied memory cards determined by the other memory card groups in the at least one memory card group except any one of the memory card groups in a first order, wherein the first order is determined based on the first message matching requirement relative to the flow table of the type corresponding to any one of the memory card groups.
12. The flow table unloading method according to claim 8, characterized in that: The flow table unloading method further includes: When the used service specification of the another memory card group reaches the preset threshold, the memory card previously transferred from the another memory card group to the any memory card group is recovered from the any memory card group.
13. The flow table unloading method according to claim 1, characterized in that: The first message matching requirement further indicates a first message data format associated with the first message data service, where the first message data format is used to determine a flow table specification of each type of flow table in the first flow table specification.
14. A computer device, characterized in that: The computer device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 13 when executing the computer program.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, which, when executed on a computer device, cause the computer device to perform the method according to any one of claims 1 to 13.