CN114710438B - Hardware table entry aging processing method and related equipment - Google Patents
Hardware table entry aging processing method and related equipment Download PDFInfo
- Publication number
- CN114710438B CN114710438B CN202210493370.8A CN202210493370A CN114710438B CN 114710438 B CN114710438 B CN 114710438B CN 202210493370 A CN202210493370 A CN 202210493370A CN 114710438 B CN114710438 B CN 114710438B
- Authority
- CN
- China
- Prior art keywords
- aging
- rule
- numerical value
- time counter
- rule entry
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/02—Topology update or discovery
- H04L45/028—Dynamic adaptation of the update intervals, e.g. event-triggered updates
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/54—Organization of routing tables
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/74—Address processing for routing
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the application discloses a hardware table entry aging processing method and related equipment, wherein the method comprises the following steps: acquiring a first rule entry, wherein the first rule entry corresponds to an aging period and an aging time counter, and the first rule entry is any rule entry; comparing a first numerical value of an aging time counter corresponding to the first rule entry with a second numerical value of a local time counter when the first rule entry is hit in the aging period; and when the difference value between the first numerical value and the second numerical value is larger than the refresh period of the aging time counter, refreshing the numerical value of the aging time counter according to the second numerical value. By adopting the embodiment of the application, the aging management efficiency of the table entry can be improved.
Description
Technical Field
The present application relates to the field of communications technologies and internet technologies, and in particular, to a method and a related device for processing aging of a hardware entry.
Background
In practical applications, entries of a data center or network communication hardware (e.g., a Field Programmable Gate Array (FPGA), a Network Processor (NP), an Application Specific Integrated Circuit (ASIC) ASIC chip, etc.) are aged after a certain time, but the problem of how to improve the entry aging management efficiency needs to be solved.
Disclosure of Invention
The embodiment of the application provides a hardware table entry aging processing method and related equipment, and the table entry aging management efficiency can be improved.
In a first aspect, an embodiment of the present application provides a method for aging a hardware table entry, where the method includes:
acquiring a first rule entry, wherein the first rule entry corresponds to an aging period and an aging time counter, and the first rule entry is any rule entry;
comparing a first numerical value of an aging time counter corresponding to the first rule entry with a second numerical value of a local time counter when the first rule entry is hit in the aging period;
and when the difference value between the first numerical value and the second numerical value is larger than the refresh period of the aging time counter, refreshing the numerical value of the aging time counter according to the second numerical value.
In a second aspect, an embodiment of the present application provides an apparatus for aging a hardware table entry, where the apparatus includes: an acquisition unit, a comparison unit and a refresh unit, wherein,
the acquiring unit is used for acquiring a first rule entry, the first rule entry corresponds to an aging period and an aging time counter, and the first rule entry is any rule entry;
the comparison unit is configured to compare, in the aging period, a first numerical value of an aging time counter corresponding to the first rule entry with a second numerical value of a local time counter when the first rule entry is hit;
the refreshing unit is used for refreshing the value of the aging time counter according to the second numerical value when the difference value between the first numerical value and the second numerical value is larger than the refreshing period of the aging time counter.
In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a memory, a communication interface, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing the steps in the first aspect of the embodiment of the present application.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program for electronic data exchange, where the computer program enables a computer to perform some or all of the steps described in the first aspect of the embodiment of the present application.
In a fifth aspect, embodiments of the present application provide a computer program product, where the computer program product comprises a non-transitory computer-readable storage medium storing a computer program, where the computer program is operable to cause a computer to perform some or all of the steps as described in the first aspect of embodiments of the present application. The computer program product may be a software installation package.
The embodiment of the application has the following beneficial effects:
it can be seen that, in the hardware table entry aging processing method and the related device described in the embodiments of the present application, a first rule entry is obtained, where the first rule entry corresponds to an aging period and an aging time counter, and the first rule entry is any rule entry; in the aging period, when the first rule entry is hit, the first numerical value of the aging time counter corresponding to the first rule entry is compared with the second numerical value of the local time counter, when the difference value between the first numerical value and the second numerical value is larger than the refreshing period of the aging time counter, the numerical value of the aging time counter is refreshed according to the second numerical value, on the other hand, when the rule is hit and used each time, the write-back refreshing of the aging time counter is only carried out aiming at the message exceeding the refreshing period of the aging time counter, so that the frequent write-back of the entry is avoided.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a hardware entry aging processing system for implementing a hardware entry aging processing method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a method for processing aging of a hardware table entry according to an embodiment of the present application;
fig. 3 is a flowchart illustrating another hardware table entry aging processing method according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
fig. 5 is a block diagram illustrating functional units of a hardware table entry aging processing apparatus according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," and the like in the description and claims of the present application and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements but may alternatively include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein may be combined with other embodiments.
The electronic device described in the embodiment of the present application may include a smart Phone (e.g., an Android Phone, an iOS Phone, a Windows Phone, etc.), a tablet computer, a palm computer, a car data recorder, a notebook computer, a Mobile Internet Device (MID) or a wearable device (e.g., a smart watch, a bluetooth headset), a Data Processing Unit (DPU) constructed by taking data as a center, and the like, which are merely examples and are not exhaustive, and include but are not limited to the foregoing electronic device, and the electronic device may further include a server, for example, a cloud server. The server may include a hardware chip, which may include a network card, for example, which may include: for example, when the hardware chip is a network card, the network card may be inserted into a server, and for example, the network card may include a DPU network card.
In the embodiment of the present application, the DPU may be a dedicated processor configured by taking data as a center, and may support infrastructure layer resource virtualization by using a software defined technology route, so as to support infrastructure layer services such as storage, security, quality of service management, and the like.
The following describes embodiments of the present application in detail.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a hardware entry aging processing system for implementing a hardware entry aging processing method according to an embodiment of the present application, where as shown in the figure, the hardware aging processing system includes: hardware modules and software modules.
In this embodiment of the present application, the hardware module may include data center or network communication hardware, for example, an FPGA/NP/ASIC chip, and the like, which is not limited herein, and if the corresponding entries of different hardware are different, the entry aging scenarios of different entries are also different. In a specific implementation, after the table entry rule is generated, in a specified aging period, if the rule is not used in a hit manner, the rule needs to be aged and deleted, so as to save table entry space resources. As shown in fig. 2, an entry rule may be generated first, and whether the entry rule needs to be aged is detected in an aging period, if not, periodic detection is continued, and if yes, the rule that needs to be aged is deleted.
The hardware module may store therein a key register for storing the rule table.
In the related art, the table entry rules may be stored in a key register, and the key register may be used to store: an aging timing counter age _ timer, which may be configured by software, and which is globally valid.
The key register may also store a rule table of different entries, as shown in the following table:
that is, different entries may correspond to different rule entries, each rule entry corresponding to an aging flag age.
In the specific implementation, as shown in the above table, the rule table key information: 1. an aging flag age, which is maintained by hardware and is valid based on each rule; 2. the aging period partition counter age _ divider, which is maintained by hardware and is valid on a per rule basis.
In a specific implementation, the age _ timer counts cycles over an aging period T to complete the time indication of an aging period. In the counting process of age _ divider with mbit bit width, the aging period T can be equally divided into 2 m The shares may be placed in a rule table or may be individually listed in an entry, as shown in the above table.
Further, when a rule is generated, age _ divider is set to maximum value 2 m 1, used 1 time each time a rule is hit, if age _ divider is not maximum, add 1 to age _ divider; and each time the age _ timer indicates T/(2) of arrival m ) If the age _ divider is not the minimum value 0, subtracting 1 from the age _ divider, and if the aging period equal-division counter is already 0, setting the aging mark age to be valid, which indicates that the rule is not hit and used in an aging period T and needs to be aged and deleted, wherein the deletion action can be completed by hardware or software.
For this approach in the related art, there are the following drawbacks:
1) When a regular hit event and an aging timing counter indicate that an event crossing of T/(2 m) is reached, frequent write-back is required to refresh an aging equal counter in the entry;
2) The aging period can only be configured globally, and differential configuration cannot be performed on different rule entries.
Furthermore, in an embodiment of the present application, in order to overcome the above disadvantage, a method for processing an aging of a hardware table entry is provided, where the method includes the following steps:
acquiring a first rule entry, wherein the first rule entry corresponds to an aging period and an aging time counter, and the first rule entry is any rule entry;
comparing a first numerical value of an aging time counter corresponding to the first rule entry with a second numerical value of a local time counter when the first rule entry is hit in the aging period;
and when the difference value between the first numerical value and the second numerical value is larger than the refreshing period of the aging time counter, refreshing the numerical value of the aging time counter according to the second numerical value.
Optionally, the method may further include the following steps:
when the difference value between the first value and the second value is less than or equal to the refresh period of the aging time counter, the value of the aging time counter is not refreshed.
Optionally, the first rule entry corresponds to an aging flag, and the method may further include the following steps:
reading an aging time counter corresponding to the first rule entry according to a preset frequency in the aging period;
comparing the first value read each time with a third value that is the latest of the local time counter;
determining that the first rule entry is not hit within the aging period when a difference between the first numerical value and the third numerical value is greater than a period length of the aging period;
setting the aging mark corresponding to the first rule entry as valid;
and deleting the rule corresponding to the first rule entry.
Optionally, the method may further include the following steps:
determining that the first rule entry was hit within the aging period when a difference between the first numerical value and the third numerical value is less than or equal to a period length of the aging period.
It can be seen that, in the policy described in the embodiment of the present application, a first rule entry is obtained, where the first rule entry corresponds to one aging period and one aging time counter, and the first rule entry is any rule entry; in the aging period, when a first rule entry is hit, comparing a first numerical value of an aging time counter corresponding to the first rule entry with a second numerical value of a local time counter; when the difference value between the first numerical value and the second numerical value is larger than the refreshing period of the aging time counter, the numerical value of the aging time counter is refreshed according to the second numerical value, and on the other hand, the introduction of the refreshing period of the aging time counter avoids the frequent write-back operation of the table entry possibly generated when the rule is hit and used every time, and the table entry aging management efficiency can be improved.
Based on the strategy in the embodiment of the application, the following advantages can be achieved:
1) Reducing the write back of the frequent table entries generated when the regular hit event and the aging timing event are staggered;
2) And carrying out differential configuration of the aging period aiming at different rule entries.
Referring to fig. 3, fig. 3 is a schematic flowchart of a hardware entry aging processing method according to an embodiment of the present application, which is applied to the hardware entry aging processing system shown in fig. 1, and as shown in the figure, the hardware entry aging processing method includes:
301. the method comprises the steps of obtaining a first rule entry, wherein the first rule entry corresponds to an aging period and an aging time counter, and the first rule entry is any rule entry.
The hardware module may store therein a key register for storing the rule table. The entry rules may each be stored in a key register that may be used to store: rule entries, aging flags, aging periods, aging time counters, and the like, without limitation. In the concrete implementation, the introduction of the refresh cycle of the aging time counter avoids the frequent write-back operation of the table entry possibly generated when the rule is hit and used each time.
Where the rule entries, which may be configured by software.
Where the aging flag may be maintained by hardware, the aging flag may be denoted as age, which is valid based on each rule.
The aging period may be configured by software, and may be referred to as an age _ cycle, which is valid based on each rule.
The aging time counter may be maintained by hardware, and may be denoted as age _ time _ counter, and is valid based on each rule.
Specifically, the rule table may be as follows:
302. and in the aging period, when the first rule entry is hit, comparing a first numerical value of an aging time counter corresponding to the first rule entry with a second numerical value of a local time counter.
In a specific implementation, in an aging period, when a first rule entry is hit, a first numerical value of an aging time counter corresponding to the first rule entry may be compared with a second numerical value of a local time counter, and then whether to perform a refresh operation on the numerical value of the aging time counter is implemented based on a comparison result.
303. And when the difference value between the first numerical value and the second numerical value is larger than the refreshing period of the aging time counter, refreshing the numerical value of the aging time counter according to the second numerical value.
In a specific implementation, when the difference value between the first value and the second value is greater than the refresh period of the aging time counter, the value of the aging time counter is refreshed according to the second value.
Optionally, the method may further include the following steps:
when the difference value between the first value and the second value is less than or equal to the refresh period of the aging time counter, the value of the aging time counter is not refreshed.
In a specific implementation, when the difference between the first value and the second value is less than or equal to the refresh period of the aging time counter, the value of the aging time counter may not be refreshed, so that the number of times of refreshing is reduced, and power consumption is reduced.
For example, the aging time counter refresh period may be denoted as age _ time _ counter _ refresh _ cycle, aging period may be denoted as age _ cycle, and aging time counter may be denoted as age _ time _ counter, which needs to be multiplied by a time unit to obtain a corresponding time value, while the local time counter local _ time _ counter directly corresponds to a time value.
Furthermore, when the software issues a rule entry, the hardware stores the aging flag age (initial value is 0), the aging period age _ cycle (specified by the software), and the aging time counter age _ time _ counter (initial value is the local time counter local _ time _ counter at this time divided by the unit time _ unit) corresponding to the current rule into the rule table together with the rule entry. The introduction of the time unit can save the space resource consumption of the aging period and the refreshing period of the aging time counter in the table entry.
In specific implementation, every time a message hits the rule, the age _ time _ counter in the rule table is compared with local _ time _ counter/time _ unit, if the difference value is greater than the age _ time _ counter _ refresh _ cycle, the local latest local _ time _ counter/time _ unit is refreshed to replace the age _ time _ counter in the rule table, otherwise, the local latest local _ time _ counter/time _ unit is not refreshed.
Optionally, the first rule entry corresponds to an aging flag, and the method may further include the following steps:
s1, reading an aging time counter corresponding to the first rule item according to a preset frequency in the aging period;
s2, comparing the first numerical value read each time with the latest third numerical value of the local time counter;
s3, when the difference value between the first numerical value and the third numerical value is larger than the cycle length of the aging cycle, determining that the first rule entry is not hit in the aging cycle;
s4, setting the aging mark corresponding to the first rule entry to be effective;
and S5, deleting the rule corresponding to the first rule entry.
In a specific implementation, the preset frequency may be preset or default to the system. In an aging period, reading an aging time counter corresponding to a first rule entry according to a preset frequency, comparing the first value read each time with a latest third value of a local time counter, determining that the first rule entry is not hit in the aging period when the difference value between the first value and the third value is larger than the period length of the aging period, setting an aging mark corresponding to the first rule entry to be valid, and deleting a rule corresponding to the first rule entry, so that the table entry space resource can be saved. In addition, the introduction of the aging period is specified based on each rule, so that the differentiated configuration of the aging period can be realized.
Optionally, in the step S5, the deleting operation of the rule corresponding to the first rule entry may include the following steps:
s51, determining a target deletion parameter corresponding to the first rule entry;
and S52, deleting the rule corresponding to the first rule entry according to the target deletion parameter.
In a specific implementation, different rule entries may correspond to different deletion parameters, and the deletion parameters may include at least one of the following: deletion time, deletion priority, partial deletion, or full deletion, etc., without limitation. Specifically, the target identification information of the first rule entry may be obtained, the target deletion parameter corresponding to the target identification information is determined according to the mapping relationship between the preset identification information and the deletion parameter, and the rule corresponding to the first rule entry is deleted according to the target deletion parameter, so that the personalized deletion operation may be implemented, and the deletion operation is more intelligent.
Optionally, the method may further include the following steps:
determining that the first rule entry was hit within the aging period when a difference between the first numerical value and the third numerical value is less than or equal to a period length of the aging period.
When the difference value between the first numerical value and the third numerical value is smaller than or equal to the cycle length of the aging cycle, it is determined that the first rule entry is hit in the aging cycle, and since the initial value of the aging flag is invalid, the first rule entry does not need to be repeatedly set to be invalid, so that entries which do not need to be aged can be screened out.
For example, there may be a slow background traffic, in an aging period, reading all the aging time counters age _ time _ counter and aging period age _ cycle is done uniformly, and the age _ time _ counter is compared with the local latest local _ time _ counter/time _ unit, if the difference is greater than age _ cycle, it is determined that the rule has not been hit in an aging period, the aging flag age is set to be valid, which indicates that the rule needs to be aged, and then the rule is aged and deleted by hardware or software.
Because the write-back refreshing of the aging time counter age _ time _ counter is only carried out for the message which exceeds the aging time counter refresh period age _ time _ counter _ refresh _ cycle when the rule is hit and used, the problem of frequent write-back of the table entry in the existing typical design is avoided.
Further, the aging period can be specified on a per rule basis, and thus differential configuration of the aging period can be realized.
Furthermore, on one hand, due to the introduction of the refresh cycle of the aging time counter, the frequent table entry write-back generated when the hit event of the rule and the aging timing event are staggered can be greatly reduced, and on the other hand, due to the introduction of the specified aging cycle based on each rule, the differentiated configuration of the aging cycle can be realized, so that the table entry aging management efficiency can be improved.
It can be seen that, in the hardware entry aging processing method described in the embodiment of the present application, a first rule entry is obtained, where the first rule entry corresponds to an aging period and an aging time counter, and the first rule entry is any rule entry; in the aging period, when a first rule entry is hit, comparing a first numerical value of an aging time counter corresponding to the first rule entry with a second numerical value of a local time counter; when the difference value between the first numerical value and the second numerical value is larger than the refresh cycle of the aging time counter, the numerical value of the aging time counter is refreshed according to the second numerical value, on the other hand, the introduction of the refresh cycle of the aging time counter avoids the frequent write-back operation of the table entry which is possibly generated when the rule is hit and used each time, and can improve the table entry aging management efficiency.
In accordance with the foregoing embodiments, please refer to fig. 4, where fig. 4 is a schematic structural diagram of an electronic device provided in an embodiment of the present application, and as shown in the drawing, the electronic device includes a processor, a memory, a communication interface, and one or more programs, which are applied to the electronic device, the one or more programs are stored in the memory and configured to be executed by the processor, and in an embodiment of the present application, the programs include instructions for performing the following steps:
acquiring a first rule entry, wherein the first rule entry corresponds to an aging period and an aging time counter, and the first rule entry is any rule entry;
comparing a first numerical value of an aging time counter corresponding to the first rule entry with a second numerical value of a local time counter when the first rule entry is hit in the aging period;
and when the difference value between the first numerical value and the second numerical value is larger than the refresh period of the aging time counter, refreshing the numerical value of the aging time counter according to the second numerical value.
Optionally, the program further includes instructions for performing the following steps:
when the difference value between the first value and the second value is less than or equal to the refresh period of the aging time counter, the value of the aging time counter is not refreshed.
Optionally, the first rule entry corresponds to an aging flag, and the program further includes instructions for performing the following steps:
reading an aging time counter corresponding to the first rule entry according to a preset frequency in the aging period;
comparing the first value read each time with a third value most recent by the local time counter;
determining that the first rule entry is not hit within the aging period when the difference between the first value and the third value is greater than the period length of the aging period;
setting the aging mark corresponding to the first rule entry as valid;
and deleting the rule corresponding to the first rule entry.
Optionally, in terms of the deleting operation of the rule corresponding to the first rule entry, the program includes instructions for executing the following steps:
determining a target deletion parameter corresponding to the first rule entry;
and deleting the rule corresponding to the first rule entry according to the target deletion parameter.
Optionally, the program further includes instructions for performing the following steps:
determining that the first rule entry is hit within the aging period when a difference between the first numerical value and the third numerical value is less than or equal to a period length of the aging period.
It can be seen that, in the electronic device described in the embodiment of the present application, a first rule entry is obtained, where the first rule entry corresponds to an aging period and an aging time counter, and the first rule entry is any rule entry; in the aging period, when a first rule entry is hit, comparing a first numerical value of an aging time counter corresponding to the first rule entry with a second numerical value of a local time counter; when the difference value between the first numerical value and the second numerical value is larger than the refresh cycle of the aging time counter, the numerical value of the aging time counter is refreshed according to the second numerical value, on the other hand, the introduction of the refresh cycle of the aging time counter avoids the frequent write-back operation of the table entry which is possibly generated when the rule is hit and used each time, and can improve the table entry aging management efficiency.
Fig. 5 is a block diagram of functional units of a hardware table entry aging processing apparatus 500 according to an embodiment of the present application. The hardware table entry aging processing apparatus 500 is applied to an electronic device, and the apparatus 500 includes: an acquisition unit 501, a comparison unit 502 and a refresh unit 503, wherein,
the obtaining unit 501 is configured to obtain a first rule entry, where the first rule entry corresponds to an aging period and an aging time counter, and the first rule entry is any rule entry;
the comparing unit 502 is configured to compare, in the aging period, when the first rule entry is hit, a first numerical value of an aging time counter corresponding to the first rule entry with a second numerical value of a local time counter;
the refreshing unit 503 is configured to, when the difference between the first value and the second value is greater than the refresh period of the aging time counter, perform a refresh operation on the value of the aging time counter according to the second value.
Optionally, the apparatus 500 is further specifically configured to:
when the difference value between the first value and the second value is less than or equal to the refresh period of the aging time counter, the value of the aging time counter is not refreshed.
Optionally, in an aspect that the first rule entry corresponds to an aging flag, the apparatus 500 is further specifically configured to:
reading an aging time counter corresponding to the first rule entry according to a preset frequency in the aging period;
comparing the first value read each time with a third value that is the latest of the local time counter;
determining that the first rule entry is not hit within the aging period when the difference between the first value and the third value is greater than the period length of the aging period;
setting an aging mark corresponding to the first rule entry to be effective;
and deleting the rule corresponding to the first rule entry.
Optionally, in terms of the deleting operation of the rule corresponding to the first rule entry, the apparatus 500 is further specifically configured to:
determining a target deletion parameter corresponding to the first rule entry;
and deleting the rule corresponding to the first rule entry according to the target deletion parameter.
Optionally, the apparatus 500 is further specifically configured to:
determining that the first rule entry was hit within the aging period when a difference between the first numerical value and the third numerical value is less than or equal to a period length of the aging period.
It can be seen that, in the hardware table entry aging processing apparatus described in the embodiment of the present application, a first rule entry is obtained, where the first rule entry corresponds to an aging period and an aging time counter, and the first rule entry is any rule entry; in the aging period, when a first rule entry is hit, comparing a first numerical value of an aging time counter corresponding to the first rule entry with a second numerical value of a local time counter; when the difference value between the first numerical value and the second numerical value is larger than the refreshing period of the aging time counter, the numerical value of the aging time counter is refreshed according to the second numerical value, on the other hand, the introduction of the refreshing period of the aging time counter avoids the frequent write-back operation of the table entry possibly generated when the rule is hit to be used each time, and can improve the management efficiency of table entry aging.
It can be understood that the functions of each program module of the hardware table entry aging processing apparatus in this embodiment may be specifically implemented according to the method in the foregoing method embodiment, and the specific implementation process may refer to the related description of the foregoing method embodiment, which is not described herein again.
Embodiments of the present application further provide a computer-readable storage medium, where the computer-readable storage medium stores a computer program for electronic data exchange, the computer program enables a computer to execute some or all of the steps of any one of the methods as set forth in the above method embodiments, and the computer includes an electronic device.
Embodiments of the present application also provide a computer program product comprising a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods as described in the above method embodiments. The computer program product may be a software installation package, the computer comprising an electronic device.
It should be noted that for simplicity of description, the above-mentioned embodiments of the method are described as a series of acts, but those skilled in the art should understand that the present application is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the above-described division of the units is only one type of division of logical functions, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of some interfaces, devices or units, and may be an electric or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
The integrated unit may be stored in a computer readable memory if it is implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a memory, and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the above-mentioned method of the embodiments of the present application. And the aforementioned memory comprises: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, and various media capable of storing program codes.
Those skilled in the art will appreciate that all or part of the steps of the methods of the above embodiments may be implemented by a program, which is stored in a computer-readable memory, the memory including: flash Memory disks, read-Only memories (ROMs), random Access Memories (RAMs), magnetic or optical disks, and the like.
The foregoing detailed description of the embodiments of the present application has been presented to illustrate the principles and implementations of the present application, and the above description of the embodiments is only provided to help understand the method and the core concept of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.
Claims (6)
1. A hardware table entry aging processing method is characterized by comprising the following steps:
acquiring a first rule entry, wherein the first rule entry corresponds to an aging period and an aging time counter, and the first rule entry is any rule entry;
comparing a first numerical value of an aging time counter corresponding to the first rule entry with a second numerical value of a local time counter when the first rule entry is hit in the aging period;
when the difference value between the first numerical value and the second numerical value is larger than the refresh period of the aging time counter, refreshing the numerical value of the aging time counter according to the second numerical value;
wherein the method further comprises:
when the difference value between the first numerical value and the second numerical value is less than or equal to the refresh period of the aging time counter, not performing refresh operation on the numerical value of the aging time counter;
wherein the first rule entry corresponds to an aging flag, the method further comprising:
reading an aging time counter corresponding to the first rule item according to a preset frequency in the aging period;
comparing the first value read each time with a third value most recent by the local time counter;
determining that the first rule entry is not hit within the aging period when the difference between the first value and the third value is greater than the period length of the aging period;
setting the aging mark corresponding to the first rule entry as valid;
and deleting the rule corresponding to the first rule entry.
2. The method according to claim 1, wherein the deleting the rule corresponding to the first rule entry includes:
determining a target deletion parameter corresponding to the first rule entry;
and deleting the rule corresponding to the first rule entry according to the target deletion parameter.
3. The method of claim 1, further comprising:
determining that the first rule entry was hit within the aging period when a difference between the first numerical value and the third numerical value is less than or equal to a period length of the aging period.
4. An apparatus for processing aging of hardware table entries, the apparatus comprising: an acquisition unit, a comparison unit and a refresh unit, wherein,
the acquiring unit is configured to acquire a first rule entry, where the first rule entry corresponds to an aging period and an aging time counter, and the first rule entry is any rule entry;
the comparison unit is configured to compare a first numerical value of an aging time counter corresponding to the first rule entry with a second numerical value of a local time counter when the first rule entry is hit in the aging period;
the refreshing unit is used for refreshing the value of the aging time counter according to the second numerical value when the difference value between the first numerical value and the second numerical value is larger than the refreshing period of the aging time counter;
wherein the apparatus is further specifically configured to:
when the difference value between the first numerical value and the second numerical value is less than or equal to the refresh period of the aging time counter, not performing refresh operation on the numerical value of the aging time counter;
wherein, in an aspect that the first rule entry corresponds to an aging flag, the apparatus is further specifically configured to:
reading an aging time counter corresponding to the first rule entry according to a preset frequency in the aging period;
comparing the first value read each time with a third value that is the latest of the local time counter;
determining that the first rule entry is not hit within the aging period when the difference between the first value and the third value is greater than the period length of the aging period;
setting the aging mark corresponding to the first rule entry as valid;
and deleting the rule corresponding to the first rule entry.
5. An electronic device, comprising a processor, a memory to store one or more programs and configured to be executed by the processor, the programs including instructions for performing the steps in the method of any of claims 1-3.
6. A computer-readable storage medium, characterized in that a computer program for electronic data exchange is stored, wherein the computer program causes a computer to perform the method according to any one of claims 1-3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210493370.8A CN114710438B (en) | 2022-05-07 | 2022-05-07 | Hardware table entry aging processing method and related equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210493370.8A CN114710438B (en) | 2022-05-07 | 2022-05-07 | Hardware table entry aging processing method and related equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114710438A CN114710438A (en) | 2022-07-05 |
CN114710438B true CN114710438B (en) | 2022-12-27 |
Family
ID=82176653
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210493370.8A Active CN114710438B (en) | 2022-05-07 | 2022-05-07 | Hardware table entry aging processing method and related equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114710438B (en) |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN100587694C (en) * | 2008-03-19 | 2010-02-03 | 杭州华三通信技术有限公司 | Method and device for maintaining item |
US9773036B2 (en) * | 2014-05-28 | 2017-09-26 | Cavium, Inc. | Method and apparatus for table aging in a network switch |
CN106411622B (en) * | 2016-12-16 | 2019-06-07 | 成都西加云杉科技有限公司 | A kind of table entry processing method and device |
CN109617779B (en) * | 2018-12-19 | 2020-12-18 | 锐捷网络股份有限公司 | Routing table maintenance method and device based on VTEP |
-
2022
- 2022-05-07 CN CN202210493370.8A patent/CN114710438B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN114710438A (en) | 2022-07-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105205014B (en) | A kind of date storage method and device | |
CN110018788B (en) | Hierarchical storage method, hierarchical storage device, electronic equipment and computer readable storage medium | |
US10606806B2 (en) | Method and apparatus for storing time series data | |
CN111046164B (en) | Method and equipment for updating book to be read | |
CN110381151B (en) | Abnormal equipment detection method and device | |
CN107807852B (en) | Application program performance control method, device and computer readable storage medium | |
CN103294718A (en) | Method and device for web page cache management | |
CN104657435A (en) | Storage management method for application data and network management system | |
CN112286459A (en) | Data processing method, device, equipment and medium | |
EP2919120A1 (en) | Memory monitoring method and related device | |
CN114710438B (en) | Hardware table entry aging processing method and related equipment | |
CN112035524B (en) | List data query method, device, computer equipment and readable storage medium | |
CN109815351B (en) | Information query method and related product | |
CN116185305A (en) | Service data storage method, device, computer equipment and storage medium | |
CN111061429A (en) | Data access method, device, equipment and medium | |
CN113342762B (en) | Intelligent processing method and related device for shared messages of friends of merchants | |
CN114356970B (en) | Storage system resource caching method and device | |
CN116028696A (en) | Resource information acquisition method and device, electronic equipment and storage medium | |
WO2016184318A1 (en) | Barcode popularity display method and apparatus | |
CN103312785A (en) | Method and device for determining access relation | |
CN112835490A (en) | Menu display method and device, client device and storage medium | |
CN111090633A (en) | Small file aggregation method, device and equipment of distributed file system | |
CN113727128B (en) | Hot spot flow processing method and system | |
CN110677919B (en) | Method and equipment for sharing and determining income based on wireless access point | |
CN112685362A (en) | Cluster storage resource timing cleaning method and device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |