Flow table aging method, device, equipment and program product

By configuring binary bitmaps and a timed polling mechanism through hardware logic to identify inactivated entries, the problem of low flow table space utilization is solved and efficient management of flow tables is achieved in high-speed network environments.

CN120750826AActive Publication Date: 2025-10-03WUXI STARS MICRO SYSTEM TECHNOLOGIES CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510891259.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-30
Publication Date
2025-10-03
Estimated Expiration
2045-06-30

AI Technical Summary

Technical Problem

The existing flow table aging solution results in low flow table space utilization and cannot effectively meet the table entry management needs in high-speed network environments.

Method used

The binary bitmap configured by hardware logic represents the activation status of table entries in real time, and combines with the timed polling mechanism to identify and delete inactivated table entries, giving priority to reusing inactivated table entry space, reducing the probability of table entry discarding during hash conflicts, and improving flow table space utilization.

Benefits of technology

It improves the utilization of flow table space, reduces the computational overhead of flow table aging, enhances the flexibility and adaptability of flow table management, and avoids the loss of key flow table entries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120750826A_ABST
    Figure CN120750826A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of network chips, in particular to a flow table aging method, device, equipment and program product, and the method comprises the steps: obtaining a to-be-managed target flow table, and representing the activation state of each table item in the target flow table through a binary bitmap configured by hardware logic; periodically polling the binary bitmap to identify and delete the non-activated table items in the target flow table; and when the target flow table has a newly-added table item, determining whether to cover an unactivated table item with the same hash address as the newly-added table item in the target flow table according to the table item occupation condition of the hash bucket corresponding to the newly-added table item and the value of the coverage permission control bit carried by the newly-added table item. According to the method, the flow table space utilization rate is improved, and table item management requirements in a high-speed network environment can be effectively met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of network chips, and in particular to a flow table aging method, device, equipment and program product. Background Art

[0002] In the design of network chips, in order to meet the ever-increasing demand for network throughput, pipeline-structured flow table engines are widely adopted to achieve efficient editing and forwarding of data packets.

[0003] In actual projects, the flow table engine usually uses a hash algorithm to find the table address and uses SRAM particles to store the table data. Figure 1 As shown, the hash map matches the key of the input data packet, and after a hash algorithm is applied, a unique entry address is generated. The flow table is a collection of entries that store forwarding rules. Each row contains the key and an ad indicating the processing action. Under this architecture, entry address management generally follows a "first-come, first-served" principle. This results in subsequent entries being unable to write to the same hash address due to hash conflicts when added, thus affecting the efficient use of flow table space. Therefore, identifying and removing inactive entries to free up space and allow new entries to be added becomes a key requirement for flow table management.

[0004] However, current flow table aging solutions rely on either software-based processing, resulting in complex logic, or rely on hardware statistics, incurring significant overhead, or lack flexible repair due to poor hardware logic controllability. These technical bottlenecks result in low flow table space utilization, making it ineffective in addressing the table entry management requirements of high-speed network environments. Summary of the Invention

[0005] In view of this, the present invention provides a flow table aging method, device, equipment and program product to solve the problem that the current flow table aging solution has low flow table space utilization and cannot effectively meet the table entry management needs in high-speed network environments.

[0006] In a first aspect, the present invention provides a flow meter aging method, the method comprising:

[0007] Obtaining a target flow table to be managed, and representing the activation state of each entry in the target flow table through a binary bitmap; the binary bitmap is configured by hardware logic;

[0008] Periodically polling the binary bitmap to identify and delete inactivated entries in the target flow table;

[0009] When there is a new entry in the target flow table, it is decided whether to overwrite the inactivated entry in the target flow table with the same hash address as the new entry based on the entry occupancy of the hash bucket corresponding to the new entry and the value of the overwrite permission control bit carried by the new entry.

[0010] The above solution uses binary bitmaps to represent the activation status of table entries in real time. The hardware logic configuration can realize fast status query, which greatly reduces the computational overhead of flow table aging; the timed polling mechanism automatically identifies inactivated table entries and deletes them, avoiding invalid table entries from occupying memory for a long time and improving the utilization rate of flow table space; combined with the hash bucket occupancy and overwrite permission control bits, the space of inactivated table entries is reused first, reducing the probability of table entry discarding in the event of hash conflicts, improving the adaptability of the flow table to burst traffic, avoiding the loss of key flow table entries, and effectively responding to the table entry management needs in high-speed network environments.

[0011] In an optional embodiment, the binary bitmap consists of N binary bits; wherein N is equal to the product of the total number of entries in the target flow table and the number of binary bits M required for the activation state of a single entry;

[0012] Each table entry corresponds to M consecutive binary bits in the binary bitmap, and the values ​​of the M binary bits represent the activation state level of the corresponding table entry; N and M are both positive integers, and M≥2.

[0013] The above scheme stipulates that each table entry corresponds to M binary bits, which can represent multi-level activation states. Compared with single-bit marking, it can more accurately reflect the actual usage frequency of the table entry and avoid the accidental deletion of frequently hit table entries.

[0014] In an optional implementation manner, representing the activation state of each entry in the target flow table by using a binary bitmap includes:

[0015] When a new entry exists in the target flow table, initializing the values ​​of M binary bits corresponding to the new entry to 0;

[0016] When the target entry in the target flow table is hit by the table lookup, the value of the M binary bits corresponding to the target entry is incremented based on the number of hits until it reaches a maximum value of 2 M -1 means no change;

[0017] A first timer is configured to scan the binary bitmap at a first time interval, and decrement the values ​​of M binary bits corresponding to entries with non-zero values ​​based on the number of scans until the values ​​are decremented to a minimum value of 0 and remain unchanged; the first timer is set by hardware logic.

[0018] The above solution clarifies the operation process of the binary bitmap, initialization, increment and decrement processing, and timed scanning mechanism to ensure the accurate recording and timely update of the activation status of the table items, providing a reliable basis for the aging processing of the flow table; the first timer is controlled by hardware logic to ensure the real-time and periodicity of the status decrement operation, avoiding status update lags caused by software scheduling delays.

[0019] In an optional implementation, the periodically polling the binary bitmap to identify and delete inactivated entries in the target flow table includes:

[0020] A second timer is enabled to scan the binary bitmap at a second time interval, and when an inactivated entry is identified, the corresponding entry is deleted from the target flow table; the second timer is set by software logic.

[0021] The above solution implements timed polling and deletion of inactivated entries through the second timer set by software logic, so that the software can flexibly adjust timing parameters according to system requirements and enhance the flexibility of flow table management.

[0022] In an optional implementation, the periodically polling the binary bitmap to identify and delete inactivated entries in the target flow table includes:

[0023] When the delete register is enabled, the third timer scans the binary bitmap at a third time interval, and when an inactivated table entry is identified, the corresponding table entry is deleted from the target flow table; the delete register and the third timer are both set by hardware logic.

[0024] The deletion register and the third timer of the above solution are both controlled by hardware logic. Compared with software processing, they greatly reduce the delay of flow table aging. It is especially suitable for high-speed network scenarios to avoid flow table overflow caused by aging lag.

[0025] In an optional implementation, the periodically polling the binary bitmap to identify and delete inactivated entries in the target flow table includes:

[0026] When the interrupt register is enabled, the fourth timer scans the binary bitmap at a fourth time interval and reports the address of the unactivated table entry to the software control program so that the software control program deletes the corresponding table entry after responding to the interrupt; the interrupt register and the fourth timer are both set by hardware logic.

[0027] The above solution uses a hardware timer to scan the binary bitmap and report an interrupt. The software performs the deletion operation after the response. It combines the advantages of hardware high-speed scanning and software flexible processing. The hardware is responsible for quickly locating inactivated table items, and the software is responsible for the complex deletion logic, improving the overall efficiency of the system.

[0028] In an optional embodiment, the determining, based on the occupancy of the hash bucket corresponding to the newly added entry and the value of the overwrite permission control bit carried by the newly added entry, whether to overwrite an inactivated entry in the target flow table having the same hash address as the newly added entry includes:

[0029] If the hash bucket corresponding to the hash address of the newly added entry is empty, the newly added entry is written into the first entry position of the hash bucket;

[0030] If the hash bucket corresponding to the hash address of the newly added entry is not empty, comparing the newly added keyword of the newly added entry with the existing keywords of all valid entries in the hash bucket;

[0031] If there is an existing keyword that matches the newly added keyword, the entry data of the matching entry in the hash bucket is replaced with the entry data of the newly added entry;

[0032] If there is no existing keyword matching the newly added keyword, whether to overwrite an inactivated entry in the target flow table having the same hash address as the newly added entry is determined based on the value of the overwrite permission control bit carried by the newly added entry.

[0033] When adding a new entry, the above solution first checks whether there is a matching keyword in the hash bucket. If so, it is directly replaced to avoid duplicate entries occupying space. If not, inactive entries are reused first to reduce the probability of hash bucket overflow and improve the flow table search hit rate. Through keyword matching, the use of flow table space is optimized and the intelligent level of flow table management is improved.

[0034] In an optional embodiment, if the value of the overwrite permission control bit carried by the newly added entry is high, determining whether to overwrite an inactivated entry in the target flow table having the same hash address as the newly added entry based on the value of the overwrite permission control bit carried by the newly added entry includes:

[0035] If there is an inactivated valid entry in the hash bucket, the entry data of the newly added entry is written into the inactivated valid entry with the smallest index in the hash bucket;

[0036] If there is no inactivated valid entry in the hash bucket and the hash bucket is not full, the entry data of the newly added entry is written into the invalid entry with the smallest index in the hash bucket.

[0037] In the above scheme, when the value of the overwrite permission control bit is high, the inactive valid entries in the hash bucket are overwritten first, ensuring that the frequently used entries are retained while making reasonable use of the space for the infrequently used entries. If the hash bucket is not full and there are no inactive entries, the invalid entry position is written to avoid the situation where the overall space is not fully utilized due to the activeness of local entries.

[0038] In an optional embodiment, if the value of the overwrite permission control bit carried by the newly added entry is low, determining whether to overwrite an inactivated entry in the target flow table having the same hash address as the newly added entry based on the value of the overwrite permission control bit carried by the newly added entry includes:

[0039] The entry data of the newly added entry is written into the invalid entry with the smallest index in the hash bucket.

[0040] In the above scheme, when the value of the overwrite permission control bit is low, only invalid table entries are allowed to be written, and overwriting of valid table entries is prohibited, thereby avoiding accidental deletion of key business flow table entries; there is no need to determine whether the table entry is activated, and the invalid table entry position can be written directly, which reduces the hardware logic complexity and reduces the chip design cost.

[0041] In an optional embodiment, the method further includes:

[0042] If the hash bucket corresponding to the hash address of the newly added entry is full, a failure to write the newly added entry is reported.

[0043] The above solution promptly reports the failure to write a new entry when the hash bucket is full, allowing the software to take quick action to ensure the normal operation of the flow table and network performance.

[0044] In a second aspect, the present invention provides a flow meter aging device, comprising:

[0045] An activation status representation module is used to obtain a target flow table to be managed and represent the activation status of each entry in the target flow table through a binary bitmap; the binary bitmap is configured by hardware logic;

[0046] an inactivated entry identification module, configured to periodically poll the binary bitmap to identify and delete inactivated entries in the target flow table;

[0047] A new entry overwriting module is used to decide whether to overwrite an inactivated entry in the target flow table with the same hash address as the new entry based on the entry occupancy of the hash bucket corresponding to the new entry and the value of the overwriting permission control bit carried by the new entry when a new entry exists in the target flow table.

[0048] In some optional embodiments, the binary bitmap consists of N binary bits; wherein N is equal to the product of the total number of entries in the target flow table and the number of binary bits M required for the activation state of a single entry;

[0049] Each entry corresponds to M consecutive binary bits in the binary bitmap, and the values ​​of the M binary bits represent the activation state level of the corresponding entry; N and M are both positive integers, and M≥2.

[0050] In some optional implementations, the activation state characterization module is further configured to:

[0051] When a new entry exists in the target flow table, the values ​​of the M binary bits corresponding to the new entry are initialized to 0;

[0052] When the target entry in the target flow table is hit by the table lookup, the value of the M binary bits corresponding to the target entry is incremented based on the number of hits until it reaches a maximum value of 2 M -1 means no change;

[0053] A first timer is configured to scan the binary bitmap at a first time interval, and decrement the values ​​of the M binary bits corresponding to entries with non-zero values ​​based on the number of scans until the values ​​are decremented to a minimum value of 0 and remain unchanged; the first timer is set by hardware logic.

[0054] In some optional implementations, the inactivated entry identification module is further configured to:

[0055] A second timer is used to scan the binary bitmap at a second time interval, and when an inactivated entry is identified, the corresponding entry is deleted from the target flow table; the second timer is set by software logic.

[0056] In some optional implementations, the inactivated entry identification module is further configured to:

[0057] When the delete register is enabled, the third timer scans the binary bitmap at a third time interval, and when an inactivated entry is identified, the corresponding entry is deleted from the target flow table; the delete register and the third timer are both set by hardware logic.

[0058] In some optional implementations, the inactivated entry identification module is further configured to:

[0059] When the interrupt register is enabled, the fourth timer scans the binary bitmap at a fourth time interval and reports the address of the unactivated table entry to the software control program so that the software control program deletes the corresponding table entry after responding to the interrupt; the interrupt register and the fourth timer are both set by hardware logic.

[0060] In some optional implementations, the newly added entry coverage module is further configured to:

[0061] If the hash bucket corresponding to the hash address of the newly added entry is empty, the newly added entry is written to the first entry position of the hash bucket;

[0062] If the hash bucket corresponding to the hash address of the newly added entry is not empty, then compare the newly added keyword of the newly added entry with the existing keywords of all valid entries in the hash bucket;

[0063] If there is an existing keyword that matches the newly added keyword, the entry data of the matching entry in the hash bucket is replaced with the entry data of the newly added entry;

[0064] If there is no existing keyword matching the newly added keyword, then based on the value of the overwrite permission control bit carried by the newly added entry, it is determined whether to overwrite the inactivated entry in the target flow table with the same hash address as the newly added entry.

[0065] In some optional implementations, if the value of the overwrite permission control bit carried by the newly added entry is a high level, the newly added entry overwrite module is further configured to:

[0066] If there is an inactivated valid entry in the hash bucket, the entry data of the newly added entry is written into the inactivated valid entry with the smallest index in the hash bucket;

[0067] If there is no inactivated valid entry in the hash bucket and the hash bucket is not full, the entry data of the newly added entry is written into the invalid entry with the smallest index in the hash bucket.

[0068] In some optional implementations, if the value of the overwrite permission control bit carried by the newly added entry is low, the newly added entry overwrite module is further configured to:

[0069] The entry data of the newly added entry is written into the invalid entry with the smallest index in the hash bucket.

[0070] In some optional embodiments, the device is further used to:

[0071] If the hash bucket corresponding to the hash address of the newly added entry is full, a write failure of the newly added entry is reported.

[0072] In a third aspect, the present invention provides a computer device comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, computer instructions being stored in the memory, and the processor executing the computer instructions to thereby execute a flow table aging method according to the first aspect or any corresponding embodiment thereof.

[0073] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute a flow table aging method according to the first aspect or any corresponding embodiment thereof.

[0074] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute a flow table aging method according to the first aspect or any corresponding embodiment thereof.

[0075] The technical solution provided by the present invention can have the following beneficial effects:

[0076] The present invention uses a binary bitmap and a timed polling mechanism configured by hardware logic, which is easy to implement and requires less additional logic resources, and can effectively solve the aging problem of the flow table. By regularly polling the binary bitmap and identifying inactivated table entries, and then deleting these table entries, the cache space occupied by inactivated table entries is released, thereby improving the utilization rate of the flow table cache. At the same time, the invention supports multiple implementation methods. On the one hand, the software can delete inactivated table entries by setting a timer and scanning the binary bitmap, which is simple and flexible to handle. On the other hand, it is also possible to choose to completely handle aging by hardware logic, by setting a delete register or interrupt register, and using the timer and register configuration of the hardware logic to independently complete the deletion or reporting operation of the table entry, reducing software intervention, reducing the burden and complexity of the software, and improving the overall performance and response speed of the system, so that the flow table management can be optimized and adjusted according to actual needs and system resource conditions. BRIEF DESCRIPTION OF THE DRAWINGS

[0077] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0078] Figure 1 A schematic diagram showing how the flow table engine searches and stores table entry data using a hash algorithm is shown;

[0079] Figure 2 is a flow chart of a flow table aging method according to an embodiment of the present invention;

[0080] Figure 3 is a flow chart of another flow table aging method according to an embodiment of the present invention;

[0081] Figure 4 1 is a schematic diagram of an entry activation state of a binary bitmap according to an embodiment of the present invention;

[0082] Figure 5 This is a structural block diagram of a flow meter aging device according to an embodiment of the present invention;

[0083] Figure 6 Schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0084] To make the purpose, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of the present invention.

[0085] According to an embodiment of the present invention, an embodiment of a flow table aging method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0086] In this embodiment, a flow table aging method is provided. Figure 2 FIG. 1 is a flow chart of a flow table aging method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0087] Step S201: Acquire a target flow table to be managed, and represent the activation state of each entry in the target flow table through a binary bitmap; the binary bitmap is configured by hardware logic.

[0088] Furthermore, this embodiment obtains the target flow table that needs to be managed, and records the activation status of each table item in the flow table through a binary bitmap configured by the hardware logic, that is, the hardware logic stores the activation status of the table items through a newly added SRAM, and uses a binary bitmap (such as a 3-bit active value) to represent the activation level of each table item. For example, when an item is added to the flow table, the hardware logic will initialize the corresponding binary bit to 0 (indicating inactive). As the network traffic table is looked up, if the table item is hit, the hardware logic will update the value of the corresponding binary bit (such as incrementing) to reflect the activation status of the table item. This method of directly managing the binary bitmap by the hardware logic can quickly record and update the activation status of the table item.

[0089] Step S202: Periodically poll the binary bitmap to identify and delete inactivated entries in the target flow table.

[0090] Furthermore, this embodiment can periodically poll the binary bitmap through software logic or hardware logic to identify and delete inactivated entries. In software implementation, the software logic will set a timer to scan the binary bitmap at regular intervals. If a table entry is found to be inactivated, the software logic will delete the table entry from the flow table. In hardware implementation, the hardware logic can complete this process independently. The hardware logic has a built-in timer that scans the binary bitmap at set time intervals. When an inactivated table entry is detected, the hardware logic can directly delete the table entry, or report the table entry address to the software, and the software logic will perform the deletion operation. This periodic polling mechanism can clean up inactivated table entries in a timely manner, free up flow table space, and improve resource utilization.

[0091] Step S203, when there is a new entry in the target flow table, decide whether to overwrite the inactivated entry in the target flow table with the same hash address as the new entry based on the entry occupancy of the hash bucket corresponding to the new entry and the value of the overwrite permission control bit carried by the new entry.

[0092] Furthermore, this embodiment can handle the overwriting operation of newly added entries through software logic, and decide whether to overwrite inactive entries based on the entry occupancy of the hash bucket and the value of the overwrite permission control bit (such as the del_unact control field) carried by the newly added entry. Specifically, when a new entry is added, the software logic calculates its hash address and checks the corresponding hash bucket. If the hash bucket is empty, the software logic directly inserts the new entry into the first position of the hash bucket. If the hash bucket is not empty, the software logic checks whether there is an entry with the same keyword in the bucket. If there is an entry with the same keyword, the existing entry is replaced. If there is no entry with the same keyword, the software logic determines whether to overwrite the inactive entry based on the value of the overwrite permission control bit. For example, if the overwrite permission control bit is high (e.g., 1), the software logic will select and replace the first valid, inactive entry in the hash bucket. If the overwrite permission control bit is low (e.g., 0), the software logic will not replace the valid, inactive entry, but instead search for other invalid entries to insert the new entry. This mechanism ensures that the flow table can efficiently manage newly added entries while avoiding unnecessary entry replacements, thereby improving the flexibility and efficiency of flow table management.

[0093] To summarize, this embodiment uses a binary bitmap to represent the activation status of table entries in real time, and the hardware logic configuration can realize fast status query, which greatly reduces the computational overhead of flow table aging; the timed polling mechanism automatically identifies inactivated table entries and deletes them, avoiding invalid table entries from occupying memory for a long time and improving the utilization rate of flow table space; combined with the hash bucket occupancy and the overwrite permission control bit, the inactivated table entry space is reused first, reducing the probability of table entry discarding during hash conflicts, improving the adaptability of the flow table to burst traffic, avoiding the loss of key flow table entries, and effectively responding to the table entry management needs in high-speed network environments.

[0094] In this embodiment, a flow table aging method is provided. Figure 3 FIG. 1 is a flow chart of another flow table aging method according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:

[0095] Step S301: Acquire a target flow table to be managed, and represent the activation state of each entry in the target flow table through a binary bitmap; the binary bitmap is configured by hardware logic.

[0096] In an optional embodiment, the binary bitmap consists of N binary bits; wherein N is equal to the product of the total number of entries in the target flow table and the number of binary bits M required for the activation state of a single entry;

[0097] Each entry corresponds to M consecutive binary bits in the binary bitmap, and the values ​​of the M binary bits represent the activation state level of the corresponding entry; N and M are both positive integers, and M≥2.

[0098] In an optional embodiment, the “representing the activation state of each entry in the target flow table by using a binary bitmap” in step S201 includes:

[0099] When a new entry exists in the target flow table, the values ​​of the M binary bits corresponding to the new entry are initialized to 0;

[0100] When the target entry in the target flow table is hit by the table lookup, the value of the M binary bits corresponding to the target entry is incremented based on the number of hits until it reaches a maximum value of 2 M -1 means no change;

[0101] A first timer is configured to scan the binary bitmap at a first time interval, and decrement the values ​​of the M binary bits corresponding to entries with non-zero values ​​based on the number of scans until the values ​​are decremented to a minimum value of 0 and remain unchanged; the first timer is set by hardware logic.

[0102] Furthermore, the binary bitmap (such as a Bitmap table, i.e., a storage structure that records the activation status of table entries in binary bits) is configured by hardware logic and is located in a hardware storage unit, such as SRAM storage. The total number of bits N of the binary bitmap is determined by the product of the total number of table entries in the target flow table and the number of bits M of the status of a single table entry (such as N = 1024 table entries × 3bit = 3072bit), and each table entry corresponds to M consecutive bits (M ≥ 2, taking 3bit as an example) to represent the activation level. When a new table entry is added, the hardware logic initializes the M bit corresponding to the newly added table entry to 0; when the table entry is hit, the hardware logic automatically increments the M bit value (such as from 0 to 1) until it reaches a maximum value of 2. M The first timer built into the hardware logic periodically scans the bitmap and decrements the non-zero M bit value (e.g., from 1 to 0), with the minimum value remaining at 0. This process is automatically completed by the hardware logic without software intervention, reducing resource consumption through compact binary storage.

[0103] See Figure 4 The table entry activation state diagram of the binary bitmap is shown. Static random access memory (SRAM) is used by the hardware logic to store the activation state of each table entry in the flow table. SRAM provides fast read and write capabilities and is suitable for frequently updated activation state data. The binary bitmap encodes the activation state of each table entry in the flow table as a continuous binary bit segment (such as Figure 4 Take 3 bits as an example, that is, M=3). Each row of the flow table entry (including the keyword key and the processing action ad) is mapped one by one to the continuous 3-bit space of the Active Bitmap (i.e., the binary bitmap) through the hardware logic. When the software logic initiates the writing of a new table entry, the hardware logic automatically triggers the following operations: locate the physical address of the new table entry in the flow table; force the continuous 3 bits in the Active Bitmap corresponding to the address to 0 (such as 000), indicating that the table entry is initially inactive (no traffic hit record). This process is completed by the hardware in direct response to the software write operation, without the need for additional instruction interaction, ensuring the efficiency of the new process. When network traffic triggers a table lookup hit (the hardware detects a key match), the hardware logic reads the 3-bit value of the Active Bitmap corresponding to the table entry; if the current value is less than 7 (i.e., the maximum value of 3 bits), it automatically adds 1 (such as 001→010); if it has reached 7 (111), it remains unchanged to avoid overflow. This mechanism is implemented through hardware logic to ensure low-latency response in high-speed traffic scenarios. A built-in hardware timer (configurable to 1μs intervals) periodically traverses the ActiveBitmap in the order of the flow table addresses, checking the 3-bit value bit by bit. This process is completely autonomous in hardware (no software interrupts are required). Table entries that have not been hit for a long time will have their Active values ​​gradually drop to 0, marking them as inactive and providing a basis for subsequent aging and deletion.

[0104] Step S302: Periodically poll the binary bitmap to identify and delete inactivated entries in the target flow table.

[0105] In an optional implementation, step S302 includes:

[0106] A second timer is used to scan the binary bitmap at a second time interval, and when an inactivated entry is identified, the corresponding entry is deleted from the target flow table; the second timer is set by software logic.

[0107] In an optional implementation, step S302 includes:

[0108] When the delete register is enabled, the third timer scans the binary bitmap at a third time interval, and when an inactivated entry is identified, the corresponding entry is deleted from the target flow table; the delete register and the third timer are both set by hardware logic.

[0109] In an optional implementation, step S302 includes:

[0110] When the interrupt register is enabled, the fourth timer scans the binary bitmap at a fourth time interval and reports the address of the unactivated table entry to the software control program so that the software control program deletes the corresponding table entry after responding to the interrupt; the interrupt register and the fourth timer are both set by hardware logic.

[0111] Furthermore, this embodiment involves periodically polling a binary bitmap to identify and delete inactive entries. There are three specific implementation methods. The first involves software logic, which sets a second timer to scan the binary bitmap at a second interval and delete inactive entries. The second involves hardware logic, which enables a delete register and then scans and directly deletes inactive entries at a third interval. The third, also hardware logic, enables an interrupt register, scans and reports the addresses of inactive entries, and the software control program deletes them after responding to the interrupt. These three methods provide flexible implementation options, allowing the appropriate execution entity to be selected based on system requirements, balancing the processing burden between hardware and software. In the first method, the software logic periodically scans the binary bitmap using a second timer (configurable intervals of 1ms or longer). When the M bit of an entry is detected as 0, the software logic writes 0 to the entry address to delete the entry. This mode allows administrators to dynamically adjust the polling interval based on network load, achieving a balance between flow table aging efficiency and CPU resource usage. It is suitable for scenarios requiring high flexibility. For the second type, when the hardware's delete register is enabled by the software, the third timer (such as a fixed 1ms interval) starts scanning. If it is found that the M bit value of a table entry is 0, the hardware directly writes 0 to the corresponding address to complete the deletion. In this mode, the hardware independently completes the entire scanning and deletion process without the need for software intervention. For the third type, when the hardware's interrupt register is enabled by the software, the fourth timer (such as a fixed 1ms interval) scans the bitmap. If a table entry with an M bit of 0 is found, the hardware logic reports its address to the software. After the software responds to the interrupt, it performs the deletion operation (such as writing 0 and reclaiming resources). This mode combines hardware high-speed scanning (the hardware is responsible for locating inactivated table entries) with software flexible processing (the software is responsible for logging), which not only ensures efficiency but also enhances system reliability.

[0112] That is to say, this embodiment can autonomously configure the second timer through software logic to periodically traverse the entire Active Bitmap. When the active value of a table entry is read as 0, the software logic writes all 0 data to the physical address of the table entry (such as clearing the key and ad fields) to complete the table entry deletion. This mode flexibly adjusts the scanning frequency through software logic to adapt to different network loads. Secondly, this embodiment can also use a third timer with a fixed interval built into the hardware and add a del register (i.e., a delete register). When the software sets the del register to valid, the third timer triggers a periodic scan. If a table entry with active 0 is detected, the hardware logic directly writes all 0 to its physical address to autonomously complete the deletion. This mode uses hardware logic and does not require software intervention. In addition, this embodiment can also add an inten register (interrupt register) through hardware logic. When the inten register is valid, the fourth timer scans the Active Bitmap. After finding a table entry with active 0, it first reports the physical address of the table entry to the software (triggering an interrupt). After the software responds to the interrupt, it performs a write 0 operation. This mechanism allows the hardware to be responsible for efficient detection and address location, while the software is responsible for decision-making and execution, avoiding the overhead of full scanning while maintaining business flexibility.

[0113] Step S303, when there is a new entry in the target flow table, if the hash bucket corresponding to the hash address of the new entry is empty, the new entry is written to the first entry position of the hash bucket; if the hash bucket corresponding to the hash address of the new entry is not empty, the new keyword of the new entry is compared with the existing keywords of all valid entries in the hash bucket.

[0114] Furthermore, this embodiment processes new entries in the target flow table through software logic. When a new entry is added, the software logic calculates its hash address and checks the corresponding hash bucket status. If the hash bucket is empty, the software logic writes the new entry directly into the first entry position of the hash bucket. If the hash bucket is not empty, the software logic compares the keyword of the new entry with the keywords of all valid entries in the hash bucket to determine whether an entry with the same keyword already exists. This step provides necessary information for the subsequent decision on whether to overwrite the inactivated entry. For example, when a new entry is added, the software logic calculates its hash address as bucket 5. If bucket 5 is empty, the software logic writes the new entry into the first position of bucket 5. If bucket 5 is not empty, the software logic checks each entry in bucket 5 to see if there is an entry with the same keyword.

[0115] Step S304: If there is an existing keyword that matches the newly added keyword, the entry data of the matching table item in the hash bucket is replaced with the entry data of the newly added table item; if there is no existing keyword that matches the newly added keyword, based on the value of the overwrite permission control bit carried by the newly added table item, decide whether to overwrite the inactivated table item in the target flow table that has the same hash address as the newly added table item.

[0116] In an optional embodiment, if the value of the overwrite permission control bit carried by the newly added entry is high, the step S304 of "determining whether to overwrite the inactivated entry in the target flow table having the same hash address as the newly added entry based on the value of the overwrite permission control bit carried by the newly added entry" includes:

[0117] If there is an inactivated valid entry in the hash bucket, the entry data of the newly added entry is written into the inactivated valid entry with the smallest index in the hash bucket;

[0118] If there is no inactivated valid entry in the hash bucket and the hash bucket is not full, the entry data of the newly added entry is written into the invalid entry with the smallest index in the hash bucket.

[0119] In an optional embodiment, if the value of the overwrite permission control bit carried by the newly added entry is low, the step S304 of "determining whether to overwrite the inactivated entry in the target flow table having the same hash address as the newly added entry based on the value of the overwrite permission control bit carried by the newly added entry" includes:

[0120] The entry data of the newly added entry is written into the invalid entry with the smallest index in the hash bucket.

[0121] Furthermore, this embodiment uses software logic to determine whether to overwrite an inactivated entry based on the comparison result of step S303 and the value of the overwrite permission control bit carried by the newly added entry. If a matching keyword exists, the software logic replaces the data of the matching entry. If there is no matching keyword and the overwrite permission control bit value is high (such as the del_unact control field value is 1), the software logic selects the inactivated or invalid entry with the smallest index in the hash bucket to write the newly added entry data. If the overwrite permission control bit value is low (such as the del_unact control field value is 0), the newly added entry data is only written to the invalid entry. This ensures the flexibility and stability of flow table management. For example, if the overwrite permission control bit of the newly added entry is 1 and there is an inactivated entry in the hash bucket, the software logic will write the newly added entry to the position of the inactivated entry with the smallest index. If the overwrite permission control bit is 0, the software logic will only write the newly added entry to the position of the invalid entry. When adding a new table entry, the software logic can add an overwrite permission control bit (del_unact control field segment) to the table data of the new table entry, that is, the table data of the new table entry includes the keyword key, processing action ad and overwrite permission control bit. When the new table entry is written into the hash bucket, the corresponding overwrite permission control bit will also be written, that is, the table data after writing also includes the keyword key, processing action ad and overwrite permission control bit.

[0122] Valid entries are those stored in the hash bucket and have not been deleted. In the flow table, valid entries occupy the physical storage location of the hash bucket, and their entry data (such as the keyword key and the processing action ad) is valid and has not been cleared. For example, when there are 6 entries in the hash bucket, all 6 entries are valid, regardless of whether they are activated or not. Valid entries may be in an activated or inactivated state (determined by the active value), but have not yet been marked as deletable by the system.

[0123] Invalid entries are unused or deleted entries in a hash bucket. The storage location of an invalid entry has been cleared (e.g., written with 0) or has never had valid data written to it. For example, when software or hardware deletes an entry, 0 is written to the address of the entry, making it invalid. Unfilled slots in a hash bucket (e.g., the last three slots when the bucket is 8 deep but only contains 5 entries) are also considered invalid entries.

[0124] The active state refers to the table entry whose active value in the binary bitmap is not 0 (that is, the M bit is not 0), indicating that the table entry has been hit by network traffic within a certain period of time. The active state is maintained by hardware logic. Each time the table entry is hit, the active value increases by 1 (the maximum value is 2). M-1, or 7 when M=3). During periodic scans, the timer decrements any non-zero active value. If it remains greater than 0 after decrement, the entry remains active. For example, entries with active values ​​of 1 to 7 are all active, indicating that they have been recently used.

[0125] An inactive entry is one with an active value of 0 (i.e., the M bit is 0) in the binary bitmap, indicating that the entry has not been hit for a long time. An inactive entry may still be valid (not deleted), but its active value has decayed to 0 due to long periods of inactivity. For example, if an entry in a hash bucket has an active value of 0 but has not been deleted, it is considered an inactive, valid entry and can be replaced by a new entry based on the overwrite policy.

[0126] Step S305: If the hash bucket corresponding to the hash address of the newly added entry is full, a failure to write the newly added entry is reported.

[0127] Furthermore, if the hash bucket is completely full (e.g., all eight entries are valid and active when the 3-bit value is set), this embodiment detects this through hardware logic and reports a failure to write a new entry. Upon receiving this information, the software logic can take appropriate measures, such as adjusting the hash strategy or expanding the flow table size, to ensure proper flow table operation and network performance. This step ensures that the system can respond and handle insufficient flow table space in a timely manner, avoiding potential performance issues.

[0128] Specifically, when the software logic adds a new entry to a flow table, the entry data structure for the new entry includes an overwrite permission control bit named del_unact. This overwrite permission control bit determines whether the new entry is allowed to overwrite an existing but inactive entry in the flow table. If the bucket corresponding to the hash address of the new entry is empty (i.e., no entries are stored in the bucket), the new entry is directly stored at the first position of the bucket (index 0). In this case, no comparison or overwrite operation is required. If an entry already exists in the bucket, all valid entries in the bucket are read and the key of the new entry (the new keyword) is checked to see if it matches the key of an existing entry in the bucket (the existing keyword). If a match exists, the data in the entry is replaced with the data of the new entry. If no match exists, the process is determined by the value of the del_unact control bit. If the del_unact control bit is 1, overwriting an inactive entry is allowed. The active value of all valid entries in the bucket is then checked. If there is an entry with an active value of 0 (an inactivated entry), the first inactivated entry is selected for replacement. If the active values ​​of all valid entries are 1 (i.e., all entries are in the activated state), the position of the invalid entry in the bucket is selected to store the newly added entry. If the bucket is full (the active values ​​of all 8 positions are 1), the failure to add a new entry is reported to the software. If the value of the del_unact control bit is 0, overwriting of inactivated entries is not allowed. At this time, the newly added entry can only be stored in an idle position in the bucket (the position of the invalid entry). If the bucket is full, the failure to add a new entry is reported. By combining the entry deletion processing and refresh processing mechanism, this embodiment can flexibly decide whether to overwrite the inactivated entry based on the value of the del_unact control bit, thereby effectively managing the flow table space and improving the utilization of the entry space.

[0129] In summary, this embodiment is easy to implement and requires less additional logic resources through the binary bitmap and timed polling mechanism configured by hardware logic, which can effectively solve the aging problem of the flow table. By regularly polling the binary bitmap and identifying inactivated table entries, and then deleting these table entries, the cache space occupied by inactivated table entries is released, thereby improving the utilization rate of the flow table cache. At the same time, this embodiment supports multiple implementation methods. On the one hand, the software can delete inactivated table entries by setting a timer and scanning the binary bitmap, which is simple and flexible to handle. On the other hand, it is also possible to choose to completely handle aging by hardware logic, by setting a delete register or interrupt register, and using the timer and register configuration of the hardware logic to independently complete the deletion or reporting operation of the table entry, reducing software intervention, reducing the burden and complexity of the software, and improving the overall performance and response speed of the system, so that the flow table management can be optimized and adjusted according to actual needs and system resource conditions.

[0130] In this embodiment, a flow table aging device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation methods. The details that have been explained will not be repeated here. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and conceivable.

[0131] This embodiment provides a flow meter aging device, such as Figure 5 As shown, including:

[0132] The activation state representation module 501 is used to obtain the target flow table to be managed and represent the activation state of each entry in the target flow table through a binary bitmap; the binary bitmap is configured by hardware logic;

[0133] an inactivated entry identification module 502, configured to periodically poll the binary bitmap to identify and delete inactivated entries in the target flow table;

[0134] The new entry overwriting module 503 is used to decide whether to overwrite the inactivated entry in the target flow table with the same hash address as the new entry based on the entry occupancy of the hash bucket corresponding to the new entry and the value of the overwrite permission control bit carried by the new entry when there is a new entry in the target flow table.

[0135] In some optional embodiments, the binary bitmap consists of N binary bits; wherein N is equal to the product of the total number of entries in the target flow table and the number of binary bits M required for the activation state of a single entry;

[0136] Each entry corresponds to M consecutive binary bits in the binary bitmap, and the values ​​of the M binary bits represent the activation state level of the corresponding entry; N and M are both positive integers, and M≥2.

[0137] In some optional implementations, the activation state characterization module 501 is further configured to:

[0138] When a new entry exists in the target flow table, the values ​​of the M binary bits corresponding to the new entry are initialized to 0;

[0139] When the target entry in the target flow table is hit by the table lookup, the value of the M binary bits corresponding to the target entry is incremented based on the number of hits until it reaches a maximum value of 2 M -1 means no change;

[0140] A first timer is configured to scan the binary bitmap at a first time interval, and decrement the values ​​of the M binary bits corresponding to entries with non-zero values ​​based on the number of scans until the values ​​are decremented to a minimum value of 0 and remain unchanged; the first timer is set by hardware logic.

[0141] In some optional implementations, the inactivated entry identification module 502 is further configured to:

[0142] A second timer is used to scan the binary bitmap at a second time interval, and when an inactivated entry is identified, the corresponding entry is deleted from the target flow table; the second timer is set by software logic.

[0143] In some optional implementations, the inactivated entry identification module 502 is further configured to:

[0144] When the delete register is enabled, the third timer scans the binary bitmap at a third time interval, and when an inactivated entry is identified, the corresponding entry is deleted from the target flow table; the delete register and the third timer are both set by hardware logic.

[0145] In some optional implementations, the inactivated entry identification module 502 is further configured to:

[0146] When the interrupt register is enabled, the fourth timer scans the binary bitmap at a fourth time interval and reports the address of the unactivated table entry to the software control program so that the software control program deletes the corresponding table entry after responding to the interrupt; the interrupt register and the fourth timer are both set by hardware logic.

[0147] In some optional implementations, the newly added entry covering module 503 is further configured to:

[0148] If the hash bucket corresponding to the hash address of the newly added entry is empty, the newly added entry is written to the first entry position of the hash bucket;

[0149] If the hash bucket corresponding to the hash address of the newly added entry is not empty, then compare the newly added keyword of the newly added entry with the existing keywords of all valid entries in the hash bucket;

[0150] If there is an existing keyword that matches the newly added keyword, the entry data of the matching entry in the hash bucket is replaced with the entry data of the newly added entry;

[0151] If there is no existing keyword matching the newly added keyword, then based on the value of the overwrite permission control bit carried by the newly added entry, it is determined whether to overwrite the inactivated entry in the target flow table with the same hash address as the newly added entry.

[0152] In some optional implementations, if the value of the overwrite permission control bit carried by the newly added entry is high, the newly added entry overwriting module 503 is further configured to:

[0153] If there is an inactivated valid entry in the hash bucket, the entry data of the newly added entry is written into the inactivated valid entry with the smallest index in the hash bucket;

[0154] If there is no inactivated valid entry in the hash bucket and the hash bucket is not full, the entry data of the newly added entry is written into the invalid entry with the smallest index in the hash bucket.

[0155] In some optional implementations, if the value of the overwrite permission control bit carried by the newly added entry is low, the newly added entry overwriting module 503 is further configured to:

[0156] The entry data of the newly added entry is written into the invalid entry with the smallest index in the hash bucket.

[0157] In some optional embodiments, the device is further used to:

[0158] If the hash bucket corresponding to the hash address of the newly added entry is full, a write failure of the newly added entry is reported.

[0159] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0160] In summary, this embodiment is easy to implement and requires less additional logic resources through the binary bitmap and timed polling mechanism configured by hardware logic, which can effectively solve the aging problem of the flow table. By regularly polling the binary bitmap and identifying inactivated table entries, and then deleting these table entries, the cache space occupied by inactivated table entries is released, thereby improving the utilization rate of the flow table cache. At the same time, this embodiment supports multiple implementation methods. On the one hand, the software can delete inactivated table entries by setting a timer and scanning the binary bitmap, which is simple and flexible to handle. On the other hand, it is also possible to choose to completely handle aging by hardware logic, by setting a delete register or interrupt register, and using the timer and register configuration of the hardware logic to independently complete the deletion or reporting operation of the table entry, reducing software intervention, reducing the burden and complexity of the software, and improving the overall performance and response speed of the system, so that the flow table management can be optimized and adjusted according to actual needs and system resource conditions.

[0161] The present invention also provides a computer device. Figure 6 , Figure 6 is a structural diagram of a computer device provided by an optional embodiment of the present invention, such as Figure 6As shown, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components utilize different buses to communicate with each other and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in the memory or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Equally, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 10 is taken as an example.

[0162] The processor 10 may be a central processing unit, a network processor, or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic, or any combination thereof.

[0163] The memory 20 stores instructions that can be executed by at least one processor 10, so as to enable at least one processor 10 to execute the method shown in the above embodiment.

[0164] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created based on the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0165] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid-state drive; the memory 20 may also include a combination of the above types of memory.

[0166] The computer device also includes a communication interface 30 for communicating with other devices or a communication network. The computer device is also provided with a timer, which can be set by software or hardware. The computer device is also provided with a binary bitmap, a delete register, and an interrupt register, which can be set by hardware.

[0167] The embodiment of the present invention also provides a computer-readable storage medium. The above-mentioned method according to the embodiment of the present invention can be implemented in hardware, firmware, or implemented as a computer code that can be recorded in a storage medium, or implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor or hardware, the method shown in the above embodiment is implemented.

[0168] A portion of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the form in which the computer program instruction exists in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc. Accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium that can be accessed by the computer.

[0169] Although the embodiments of the present invention have been described with reference to the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the defined scope.

Claims

1. A flow table aging method, characterized in that: The method comprises: Obtaining a target flow table to be managed, and representing the activation state of each entry in the target flow table through a binary bitmap; the binary bitmap is configured by hardware logic; Periodically polling the binary bitmap to identify and delete inactivated entries in the target flow table; When there is a new entry in the target flow table, it is decided whether to overwrite the inactivated entry in the target flow table with the same hash address as the new entry based on the entry occupancy of the hash bucket corresponding to the new entry and the value of the overwrite permission control bit carried by the new entry.

2. The method according to claim 1, characterized in that The binary bitmap consists of N binary bits; wherein N is equal to the product of the total number of entries in the target flow table and the number of binary bits M required for the activation state of a single entry; Each table entry corresponds to M consecutive binary bits in the binary bitmap, and the values ​​of the M binary bits represent the activation state level of the corresponding table entry; N and M are both positive integers, and M≥2.

3. The method according to claim 2, characterized in that The binary bitmap is used to represent the activation state of each entry in the target flow table, including: When a new entry exists in the target flow table, initializing the values ​​of M binary bits corresponding to the new entry to 0; When the target entry in the target flow table is hit by the table lookup, the value of the M binary bits corresponding to the target entry is incremented based on the number of hits until it reaches a maximum value of 2 M -1 means no change; A first timer is configured to scan the binary bitmap at a first time interval, and decrement the values ​​of M binary bits corresponding to entries with non-zero values ​​based on the number of scans until the values ​​are decremented to a minimum value of 0 and remain unchanged; the first timer is set by hardware logic.

4. The method according to claim 1, wherein The periodically polling the binary bitmap to identify and delete inactivated entries in the target flow table includes: A second timer is enabled to scan the binary bitmap at a second time interval, and when an inactivated entry is identified, the corresponding entry is deleted from the target flow table; the second timer is set by software logic.

5. The method according to claim 1, wherein The periodically polling the binary bitmap to identify and delete inactivated entries in the target flow table includes: When the delete register is enabled, the third timer scans the binary bitmap at a third time interval, and when an inactivated table entry is identified, the corresponding table entry is deleted from the target flow table; the delete register and the third timer are both set by hardware logic.

6. The method according to claim 1, characterized in that The periodically polling the binary bitmap to identify and delete inactivated entries in the target flow table includes: When the interrupt register is enabled, the fourth timer scans the binary bitmap at a fourth time interval and reports the address of the unactivated table entry to the software control program so that the software control program deletes the corresponding table entry after responding to the interrupt; the interrupt register and the fourth timer are both set by hardware logic.

7. The method according to any one of claims 1 to 6, characterized in that The determining, based on an occupancy status of an entry in a hash bucket corresponding to the newly added entry and a value of an overwrite permission control bit carried by the newly added entry, whether to overwrite an inactivated entry in the target flow table that has the same hash address as the newly added entry, includes: If the hash bucket corresponding to the hash address of the newly added entry is empty, the newly added entry is written into the first entry position of the hash bucket; If the hash bucket corresponding to the hash address of the newly added entry is not empty, comparing the newly added keyword of the newly added entry with the existing keywords of all valid entries in the hash bucket; If there is an existing keyword that matches the newly added keyword, the entry data of the matching entry in the hash bucket is replaced with the entry data of the newly added entry; If there is no existing keyword matching the newly added keyword, whether to overwrite an inactivated entry in the target flow table having the same hash address as the newly added entry is determined based on the value of the overwrite permission control bit carried by the newly added entry.

8. The method according to claim 7, characterized in that If the value of the overwrite permission control bit carried by the newly added entry is high, determining whether to overwrite an inactivated entry in the target flow table having the same hash address as the newly added entry based on the value of the overwrite permission control bit carried by the newly added entry includes: If there is an inactivated valid entry in the hash bucket, the entry data of the newly added entry is written into the inactivated valid entry with the smallest index in the hash bucket; If there is no inactivated valid entry in the hash bucket and the hash bucket is not full, the entry data of the newly added entry is written into the invalid entry with the smallest index in the hash bucket.

9. The method according to claim 7, characterized in that If the value of the overwrite permission control bit carried by the newly added entry is low, determining whether to overwrite an inactivated entry in the target flow table having the same hash address as the newly added entry based on the value of the overwrite permission control bit carried by the newly added entry includes: The entry data of the newly added entry is written into the invalid entry with the smallest index in the hash bucket.

10. The method according to claim 7, characterized in that The method further comprises: If the hash bucket corresponding to the hash address of the newly added entry is full, a failure to write the newly added entry is reported.

11. A flow meter aging device, characterized in that: The device comprises: An activation status representation module is used to obtain a target flow table to be managed and represent the activation status of each entry in the target flow table through a binary bitmap; the binary bitmap is configured by hardware logic; an inactivated entry identification module, configured to periodically poll the binary bitmap to identify and delete inactivated entries in the target flow table; A new entry overwriting module is used to decide whether to overwrite an inactivated entry in the target flow table with the same hash address as the new entry based on the entry occupancy of the hash bucket corresponding to the new entry and the value of the overwriting permission control bit carried by the new entry when a new entry exists in the target flow table.

12. The device according to claim 11, characterized in that The binary bitmap consists of N binary bits, where N is equal to the product of the total number of entries in the target flow table and the number of binary bits M required for the activation state of a single entry; Each entry corresponds to M consecutive binary bits in the binary bitmap, and the values ​​of the M binary bits represent the activation state level of the corresponding entry; N and M are both positive integers, and M≥2.

13. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes a flow table aging method according to any one of claims 1 to 10 by executing the computer instructions.

14. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute a flow table aging method according to any one of claims 1 to 10.

15. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to enable a computer to execute a flow table aging method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Table entry adding, deleting and searching method of hash table and hash table storage device

    CN102194002A

  • Hardware flow table aging method and device, software flow table aging method and device and electronic equipment

    CN116074247A

  • Flow table query method and device, electronic equipment and storage medium

    CN118245643A

  • Openflow match and action pipeline structure

    US20140334489A1

  • Techniques for dynamic database access modes

    US20190042602A1