Port energy saving method and apparatus, device, storage medium, and program product
By analyzing historical traffic data of network devices, the port bandwidth is automatically adjusted to a dormant state, which solves the problem of low port bandwidth resource utilization efficiency in network devices, achieving energy saving, consumption reduction and improved network transmission efficiency.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-05-12
- Publication Date
- 2026-03-19
AI Technical Summary
Network devices suffer from low port bandwidth utilization efficiency and high energy consumption, especially during off-peak hours when bandwidth is idle and energy is wasted.
By analyzing historical traffic data of network devices, the dormant bandwidth and dormant period of ports can be determined. During off-peak hours, the port bandwidth can be adjusted to the dormant bandwidth. High-frequency traffic statistics can be performed using network processors (NPs) to reduce CPU load and achieve automatic adjustment to adapt to changes in the network environment.
It significantly reduces power consumption and hardware resource usage during off-peak hours, improves network transmission efficiency and response speed, reduces manual intervention costs, and enhances network flexibility and adaptability.
Smart Images

Figure CN2025094277_19032026_PF_FP_ABST
Abstract
Description
Port energy saving method, device, equipment, storage medium and program product
[0001] The present application claims priority to the Chinese patent application No. 202411306988.4, filed on September 14, 2024, and entitled "Port energy saving method, device, equipment, storage medium and program product", the whole content of which is incorporated herein by reference. TECHNICAL FIELD
[0002] The present application relates to the field of communication technology, in particular to a port energy saving method, device, equipment, storage medium and program product. BACKGROUND
[0003] Port bandwidth, as a key indicator of network device data transmission capacity, determines the rate of network transmission. The port bandwidth refers to the amount of data that can be passed through per unit time. With the increasing network traffic, in order to ensure smooth data transmission, greater port bandwidth is needed to ensure network stability and efficiency. However, the size of network traffic is not stable, with characteristics such as periodicity and burstiness. The periodicity of network traffic refers to the significant changes in network traffic at different time periods of a day. For example, during working hours (such as 9 am to 6 pm), the traffic is relatively high due to the use of network by a large number of employees; while during non-working hours (such as night and weekend), the traffic is relatively low. The burstiness of network traffic refers to the fact that due to some special events (such as new product release, major news, network live broadcast, etc.), network traffic may increase sharply in a short period of time, forming a traffic peak.
[0004] Since the device with high port bandwidth has high power consumption, if the port bandwidth is configured to be high in order to meet the network traffic demand during peak period, the bandwidth will be idle and the energy will be wasted during the trough period, resulting in low resource utilization efficiency. Therefore, there is an urgent need for a port energy saving method to avoid resource waste and reduce cost. SUMMARY
[0005] The present application provides a port energy saving method, device, equipment, storage medium and computer program, which can solve the problem of low port bandwidth resource utilization efficiency and high energy consumption in related technologies. The technical solution is as follows:
[0006] In a first aspect, a port energy-saving method is provided, which comprises: determining a first dormant bandwidth of a first port included in the network device and a first dormant period corresponding to the first dormant bandwidth based on historical traffic data of the first port, the historical traffic data representing traffic characteristics of the first port in a historical period, the first dormant bandwidth being less than a maximum bandwidth of the first port; and adjusting the bandwidth of the first port to the first dormant bandwidth in the first dormant period.
[0007] In the present application, by analyzing the historical traffic data of the first port, it is determined that the first port will be in a low or zero traffic state in a certain period (i.e. the first dormant period), and then the bandwidth of the first port is adjusted to the first dormant bandwidth. This method can significantly reduce power consumption and hardware resource occupation in off-peak periods, thereby achieving the purpose of energy saving and consumption reduction. Moreover, by automatically adjusting the bandwidth of the port, more bandwidth resources can be released to the port with high traffic demand, thereby improving the transmission efficiency and response speed of the entire network. That is, the present application can automatically adjust the bandwidth configuration of the port based on historical traffic data analysis and prediction to adapt to the changing network environment and business demand. This flexibility and adaptability helps to reduce the cost and complexity of manual intervention, while improving the intelligent level of the system, and can also reduce unnecessary bandwidth allocation and power consumption.
[0008] In a possible implementation, the historical traffic data comprises traffic data corresponding to at least one time point, the at least one time point corresponding to at least one traffic statistical period, the at least one traffic statistical period being non-overlapping, and the historical period comprising the at least one traffic statistical period. For any one time point, the traffic data corresponding to the time point indicates the traffic characteristics of the first port in the corresponding traffic statistical period.
[0009] In a possible implementation, the network device comprises an NP, the NP is configured to statistically count the traffic flowing through the first port every first time length in the historical period to obtain traffic statistical results corresponding to a plurality of statistical periods, and determine the traffic data corresponding to the at least one time point based on the traffic statistical results corresponding to the plurality of statistical periods to obtain the historical traffic data, the time length of each statistical period being the first time length.
[0010] In a possible implementation, the network device further comprises a processor, and after obtaining the historical traffic data, the NP is configured to store the historical traffic data in a shared memory, and the processor is configured to obtain the historical traffic data from the shared memory and perform step 701.
[0011] The application does not need to count the traffic through the CPU, but counts the traffic flowing through the first port through the NP, and the CPU only needs to obtain the historical traffic data from the shared memory, so as to effectively reduce the task pressure of the CPU, and since the statistical period of the NP is less than or equal to 100 milliseconds, so as to realize high-frequency traffic statistics, thereby ensuring that the historical traffic data can accurately and comprehensively reflect the traffic characteristics of the first port in the historical time period.
[0012] Since the historical traffic data includes different contents, the implementation process of determining the first sleep bandwidth of the first port and the first sleep period corresponding to the first sleep bandwidth based on the historical traffic data of the first port included by the network device is also different, which will be introduced respectively.
[0013] In the first case, the historical traffic data includes the first traffic data corresponding to the first moment (that is, the historical traffic data includes the traffic data corresponding to one moment). At this time, the network device determines the first sleep gear corresponding to the first moment based on the first traffic data corresponding to the first moment, determines the sleep bandwidth corresponding to the first sleep gear as the first sleep bandwidth from the correspondence between the at least one sleep gear and the sleep bandwidth, and obtains the first sleep period based on the first moment.
[0014] In a possible implementation manner, the target traffic range is determined from the at least one traffic range based on the first traffic data, the at least one traffic range corresponds to the at least one sleep gear one by one, and the at least one traffic range does not overlap, the target traffic range is the traffic range where the first traffic data is located, and the sleep gear corresponding to the target traffic range is determined as the first sleep gear corresponding to the first moment.
[0015] In a possible implementation manner, the traffic range is determined based on the maximum bandwidth of the first port, the number of sleep gears, the sleep gear corresponding to the traffic range, and the first time length. The sleep bandwidth is determined based on the maximum bandwidth of the first port, the number of sleep gears, the sleep gear corresponding to the traffic range, the number of Serdes included by the first port, and the bandwidth of each Serdes.
[0016] It should be noted that if the traffic data is the flow rate of the first port in the corresponding traffic statistical time period, the traffic range is determined based on the maximum bandwidth of the first port, the number of sleep gears, and the sleep gear corresponding to the traffic range.
[0017] In a possible implementation manner, the network device can determine the time period with the second time length and including the first moment as the first sleep period.
[0018] In a possible implementation, the network device can also determine the traffic statistics time period corresponding to the first time point as the first sleep time period.
[0019] Since the corresponding traffic data of the first time point is the data bit amount flowing through the first port in the traffic statistics time period, the traffic data characterizes the traffic feature in the traffic statistics time period, the traffic statistics time period corresponding to the first time point can be determined as the first sleep time period, so as to ensure that the determined first sleep time period is consistent with the actual traffic statistics time period, and effectively improve the accuracy of the first sleep time period.
[0020] In the second case, the historical traffic data includes traffic data corresponding to multiple time points. In this case, there are multiple implementation manners for determining the first sleep bandwidth of the first port and the first sleep time period corresponding to the first sleep bandwidth based on the historical traffic data of the first port included by the network device, and the following two implementation manners are introduced.
[0021] In the first implementation manner, the historical traffic data includes first traffic data corresponding to a first time point and second traffic data corresponding to a second time point (that is, the historical traffic data includes traffic data corresponding to two time points), at this time, the first sleep gear corresponding to the first time point and the second sleep gear corresponding to the second time point are determined from the at least one sleep gear based on the first traffic data corresponding to the first time point and the second traffic data corresponding to the second time point, the first sleep bandwidth is determined based on the first sleep gear corresponding to the first time point and the second sleep gear corresponding to the second time point, and the first sleep time period is obtained based on the first time point and the second time point.
[0022] Since the first sleep gear and the second sleep gear can be the same or different, the implementation manner for determining the first sleep bandwidth is different in different cases, which will be introduced respectively.
[0023] If the first sleep gear and the second sleep gear are different, the sleep bandwidth corresponding to the larger gear of the first sleep gear and the second sleep gear is determined as the first sleep bandwidth from the corresponding relationship between the at least one sleep gear and the sleep bandwidth.
[0024] If the first sleep gear and the second sleep gear are the same, the sleep bandwidth corresponding to the first sleep gear or the second sleep gear is determined as the first sleep bandwidth from the corresponding relationship between the at least one sleep gear and the sleep bandwidth.
[0025] In a possible implementation, the implementation process of obtaining the first sleep time period based on the first time point and the second time point includes: determining the time period corresponding to the first time point and the second time point as the first sleep time period.
[0026] In a second implementation, based on historical traffic data, the multiple time instants are respectively determined to correspond to multiple sleep gears, based on the multiple time instants respectively corresponding to the multiple sleep gears, at least one sleep period and a sleep gear corresponding to each sleep period in the at least one sleep period are determined, based on the sleep gear corresponding to each sleep period in the at least one sleep period, a sleep bandwidth corresponding to each sleep period in the at least one sleep period is determined, any one of the at least one sleep period is determined as a first sleep period, and the sleep gear corresponding to the first sleep period is determined as a first sleep bandwidth.
[0027] In a possible implementation, the first port corresponds to multiple Serdes, in which case, the central processor included in the network device can turn off or start a low-power mode of at least one Serdes in the multiple Serdes according to the first sleep bandwidth and according to a related algorithm, so as to adjust the bandwidth of the first port to the first sleep bandwidth.
[0028] In a possible implementation, the network device further includes a MAC chip and an optical module corresponding to the first port, and the central processor included in the network device can reduce the speed of the MAC chip and split the inside of the optical module according to the first sleep bandwidth and according to a related algorithm, so as to adapt the related hardware in the network device to the first sleep bandwidth of the first port.
[0029] In a possible implementation, the network device can further determine, based on traffic data of a second port included in the network device in a current time period, that the second port satisfies a wake-up condition, and adjust the bandwidth of the second port to a maximum bandwidth, the wake-up condition indicating that a sleep bandwidth corresponding to a second sleep period of the second port does not satisfy a transmission requirement of traffic in the current time period, and the current time period is a time period included in the second sleep period.
[0030] In another possible implementation, the network device can determine, based on traffic data of a second port included in the network device in a current time period, that the second port satisfies a wake-up condition, and adjust the bandwidth of each port included in the network device and configured with a sleep bandwidth to a maximum bandwidth corresponding to the port, the wake-up condition indicating that a sleep bandwidth corresponding to a second sleep period of the second port does not satisfy a transmission requirement of traffic in the current time period, and the current time period is a time period included in the second sleep period.
[0031] That is, the network device can monitor the ports configured with the sleep bandwidth to determine whether the corresponding port triggers the wake-up condition, i.e., whether the sleep bandwidth corresponding to the corresponding port can meet the actual traffic transmission requirement. In the case where it is determined that the sleep bandwidth does not meet the actual traffic transmission requirement, the bandwidth of all the ports configured with the sleep bandwidth is adjusted to the corresponding maximum bandwidth, or the bandwidth of the port triggering the wake-up condition is adjusted to the corresponding maximum bandwidth, so that the sleep / wake-up state of the port can be dynamically adjusted, and the flexibility and adaptability of the network device are enhanced. In the case of burst traffic, the port can be quickly woken up through the wake-up mechanism to cope with the additional traffic requirement, so as to prevent network congestion or interruption, thereby improving the stability and reliability of the network.
[0032] In a possible implementation, based on the traffic data of the second port included in the network device in the current time period, the implementation process of determining that the second port meets the wake-up condition includes: determining a traffic feature value of the second port based on the traffic data of the second port in the current time period, the traffic feature value representing the traffic characteristics of the second port in the current time period, and if the traffic feature value of the second port is greater than or equal to the traffic feature value threshold corresponding to the second sleep period, it is determined that the second port meets the wake-up condition.
[0033] In a possible implementation, the network device includes an NP, and the NP is configured to process the traffic flowing through the plurality of ports. In this case, the first port is one of the target ports, and the target port is the port whose bandwidth is to be adjusted among the plurality of ports. At this time, before step 701 is performed, the network device can further determine the target port from the plurality of ports.
[0034] There are various implementation manners for determining the target port from the plurality of ports, and three implementation manners are introduced as follows.
[0035] In a first implementation, the historical traffic data corresponding to the plurality of ports is obtained, and the port with smaller traffic in the historical time period is determined as the target port from the plurality of ports based on the historical traffic data corresponding to the plurality of ports, i.e., the target port is determined from the plurality of ports based on the historical traffic data corresponding to the plurality of ports, and the traffic of each port in the target port in the historical time period is smaller than the traffic of other ports in the plurality of ports in the historical time period.
[0036] In a possible implementation, before the step of determining the target port from the plurality of ports according to the first implementation, the network device can determine the target port from the plurality of ports according to the first implementation only when the plurality of ports includes a wake-up port, the wake-up port being a port that has been woken up in the historical time period; or only when the plurality of ports includes full-bandwidth ports, the full-bandwidth port being a port that has not been configured with a sleep bandwidth in the historical time period; or only when the plurality of ports includes a third port, the third port being a wake-up port and corresponding to a historical traffic characteristic value threshold and a historical sleep bandwidth in the historical time period, the historical traffic characteristic value threshold being a traffic characteristic value threshold corresponding to the third port when the third port is woken up, and the historical traffic characteristic value threshold being a maximum value of at least one traffic characteristic value threshold corresponding to the historical sleep bandwidth, a larger traffic characteristic value threshold indicating a larger required traffic characteristic value when the port is woken up, that is, a larger traffic of the port.
[0037] If the plurality of ports includes a wake-up port, it indicates that a burst of traffic occurs in the historical time period, and the burst of traffic exceeds the traffic transmission capability provided by the sleep bandwidth of the port, and thus the sleep bandwidth and the sleep period configured for the woken-up port in the historical time period are not suitable for the actual change of the traffic of the port. Therefore, the target port can be determined from the plurality of ports, so as to determine a sleep bandwidth and a sleep period corresponding to the sleep bandwidth that are more suitable for the actual situation in a subsequent time period according to the traffic data in the historical time period.
[0038] If the plurality of ports includes full-bandwidth ports, it indicates that no port in the plurality of ports is configured with a sleep bandwidth, and thus the target port can be determined from the plurality of ports, so as to perform energy saving for the ports in the network device by using the method of the present application.
[0039] Based on the foregoing description, the plurality of sleep gears correspond to sleep bandwidths, and the sleep bandwidths correspond to traffic characteristic value thresholds. In this case, the sleep bandwidths correspond to the traffic characteristic value thresholds, and when the number of sleep gears is greater than the number of candidate bandwidths, one sleep bandwidth corresponds to a plurality of sleep gears. Therefore, one sleep bandwidth corresponds to at least one traffic characteristic value threshold, and a maximum value of the at least one traffic characteristic value threshold is an upper limit of the traffic that can be borne by the sleep bandwidth.
[0040] If the third port exists in the plurality of ports, it indicates that the traffic of the third port has exceeded the upper limit of the traffic that the port can bear, and the sleep bandwidth and the sleep period configured for the third port in the historical time period cannot meet the actual traffic transmission demand. Therefore, the target port can be determined from the plurality of ports, so as to determine the sleep bandwidth and the sleep period corresponding to the sleep bandwidth in the subsequent time period according to the traffic data in the historical time period, which is more in line with the actual situation.
[0041] In a second implementation manner, historical traffic data corresponding to full-bandwidth ports in the plurality of ports is acquired, the full-bandwidth port being a port that is not configured with a sleep bandwidth in the historical time period; and a port with smaller traffic in the historical time period is determined as a target port from the full-bandwidth ports based on the historical traffic data corresponding to the full-bandwidth ports, that is, a target port is determined from the full-bandwidth ports based on the historical traffic data corresponding to the full-bandwidth ports, and the traffic of each port in the target port in the historical time period is smaller than the traffic of other ports in the full-bandwidth ports in the historical time period.
[0042] In a possible implementation manner, before the step of determining the target port from the plurality of ports by the second implementation manner is performed, the network device can perform the step of determining the target port from the plurality of ports by the second implementation manner only when the plurality of ports include at least one sleep port and at least one full-bandwidth port, and the at least one sleep port is not woken up in a target time period, the full-bandwidth port being a port that is not configured with a sleep bandwidth in the historical time period, the sleep port being a port that is configured with a sleep bandwidth and a sleep period in the historical time period and is not woken up, and the target time period including the historical time period and having a time length greater than or equal to that of the historical time period.
[0043] The plurality of ports including at least one sleep port and at least one full-bandwidth port means that a part of the plurality of ports are sleep ports, and another part of the plurality of ports are full-bandwidth ports, and there is no wake-up port in the plurality of ports.
[0044] If the plurality of ports include at least one sleep port and at least one full-bandwidth port, and the at least one sleep port is not woken up in the target time period, it indicates that the sleep bandwidth and the sleep period configured for the sleep port in the historical time period meet the actual traffic transmission demand, and there is also a port that is not configured with a sleep bandwidth in the network device. Therefore, a port with smaller traffic in the historical time period can be determined as a target port from the full-bandwidth ports.
[0045] It should be noted that if the plurality of ports include at least one dormant port and at least one full-bandwidth port, and at least one dormant port is not woken up in the target time period, in addition to being able to determine a port with less traffic in the historical time period from the full-bandwidth port as the target port, the historical traffic data corresponding to the dormant ports in the plurality of ports can be used to re-determine the dormant time period and the dormant bandwidth corresponding to the dormant ports, and determine whether the dormant ports in the plurality of ports can be configured with a lower dormant bandwidth, thereby further reducing the energy consumption of the dormant ports.
[0046] In a third implementation manner, the dormant ports in the plurality of ports are directly determined as the target ports.
[0047] In a possible implementation manner, before the step of determining the target ports from the plurality of ports by the third implementation manner, the network device can only perform the step of determining the target ports from the plurality of ports by the third implementation manner when the plurality of ports are all dormant ports and the dormant ports are not woken up in the target time period, the dormant ports are ports configured with a dormant bandwidth and a dormant time period in the historical time period and not woken up, and the target time period includes the historical time period and the length of the target time period is greater than or equal to the length of the historical time period.
[0048] If the plurality of ports are all dormant ports and the dormant ports are not woken up in the target time period, it indicates that the dormant bandwidth and the dormant time period configured for the dormant ports in the historical time period meet the actual traffic transmission requirements, and there is no port in the network device that is not configured with a dormant bandwidth, and therefore, the dormant ports in the plurality of ports can be directly determined as the target ports to determine whether the dormant ports in the plurality of ports can be configured with a lower dormant bandwidth, thereby further reducing the energy consumption of the plurality of ports.
[0049] In a second aspect, a port energy saving apparatus is provided, which has a function of implementing the behaviors of the port energy saving method in the first aspect. The port energy saving apparatus includes at least one module for implementing the port energy saving method provided in the first aspect.
[0050] In a third aspect, a network device is provided, which includes a processor and a memory. The memory is configured to store a computer program for executing the port energy saving method provided in the first aspect. The processor is configured to execute the computer program stored in the memory to implement the port energy saving method in the first aspect.
[0051] Optionally, the network device can further include a communication bus for establishing a connection between the processor and the memory.
[0052] In a fourth aspect, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program. When the computer program is run on a computer or a processor, the computer or the processor is caused to perform the steps of the port energy saving method of the first aspect.
[0053] In a fifth aspect, a computer program product is provided, and the computer program product contains computer instructions. When the computer instructions are run on a computer or a processor, the computer is caused to perform the steps of the port energy saving method of the first aspect. Alternatively, a computer program is provided. When the computer program is run on a computer or a processor, the computer or the processor is caused to perform the steps of the port energy saving method of the first aspect.
[0054] The technical effects obtained by the second aspect, the third aspect, the fourth aspect and the fifth aspect are similar to the technical effects obtained by the corresponding technical means in the first aspect, and thus will not be described here. BRIEF DESCRIPTION OF DRAWINGS
[0055] FIG. 1 is a schematic diagram of a network device according to an embodiment of the present application;
[0056] FIG. 2 is a schematic diagram of a physical interface card 11 according to an embodiment of the present application;
[0057] FIG. 3 is a schematic diagram of an interface board according to an embodiment of the present application;
[0058] FIG. 4 is a schematic diagram of another network device according to an embodiment of the present application;
[0059] FIG. 5 is a schematic diagram of different statistical periods according to an embodiment of the present application;
[0060] FIG. 6 is a schematic diagram of another network device 200 according to an embodiment of the present application;
[0061] FIG. 7 is a flowchart of a port energy saving method according to an embodiment of the present application;
[0062] FIG. 8 is a schematic diagram of a port energy saving device according to an embodiment of the present application. DETAILED DESCRIPTION
[0063] To make the purposes, technical solutions and advantages of the present application clearer, the embodiments of the present application will be described in further detail below with reference to the drawings.
[0064] To facilitate understanding, before the port energy saving method according to the embodiments of the present application is explained in detail, the terms, application scenarios and implementation environments involved in the embodiments of the present application are introduced.
[0065] Firstly, the terms related to the embodiments of the present application are introduced.
[0066] Line speed: usually refers to the ability of network devices (such as switches, routers, etc.) to continuously forward data packets at the maximum rate. This reflects the ability of the device to efficiently process data packets even under full load.
[0067] Serial / parallel circuit (Serdes): a time-division multiplexing, point-to-point communication technology, that is, the low-speed parallel signals at the sending end are converted into high-speed serial signals, transmitted through the transmission medium (such as optical cable or copper wire), and finally converted into low-speed parallel signals at the receiving end. This point-to-point serial communication technology fully utilizes the channel capacity of the transmission medium, reduces the number of transmission channels and device pins, thereby greatly reducing the communication cost.
[0068] Taking a switch as an example, referring to FIG. 1, for a port in the switch, the bandwidth of the port is 100G (i.e. 100 bits per second), and the traffic on the port is distributed on 4 Serdes, and the data transmission rate (bandwidth) of each Serdes is 25.78125 Giga (G) (i.e. 25.78125 G bits per second), that is, the 100G bandwidth of the port is realized by 4 parallel Serdes.
[0069] Next, the application scenarios related to the embodiments of the present application are introduced.
[0070] In today's digital age, the network has become the core infrastructure connecting the world, and its efficient and stable operation is directly related to the development of various industries and the smooth exchange of information. Port bandwidth, as an important indicator of the core data transmission capacity of network communication equipment, directly determines the speed and efficiency of information flow in the network. With the booming development of emerging technologies such as cloud computing, big data, and the Internet of Things, network traffic is showing an explosive growth trend, putting higher demands on port bandwidth. However, this growth in demand is not evenly distributed, but is accompanied by significant time-dependent and bursty characteristics, bringing unprecedented challenges to network planning and resource management.
[0071] The time period characteristics of network traffic require network architecture to have flexible adjustment capabilities to cope with load changes at different time periods. During peak periods, such as 9 am to 6 pm on weekdays, enterprise internal networks often carry a large amount of file transfer, video conference, online collaboration and other tasks, resulting in a surge in traffic. At this time, if the port bandwidth is insufficient, it will directly affect the user experience, and even cause network congestion, service interruption and other serious consequences. On the contrary, in off-peak periods, such as late at night, early in the morning and weekends, network traffic is significantly reduced. In addition to time period, the burstiness of network traffic is a severe test of network stability and flexibility. Events such as online live streaming of large-scale activities, release of new versions of popular games, or outbreak of social hot news can attract a large number of user visits in a very short time, causing network traffic to surge and form a traffic peak.
[0072] Since devices with higher port bandwidth also have higher power consumption, if the port bandwidth is configured to be higher in order to meet the network traffic demand during peak periods, the bandwidth will be idle and energy will be wasted during the trough period, resulting in low resource utilization efficiency. Based on this, the embodiment of the present application provides a port energy saving method, which analyzes the historical traffic data of the first port to determine that the first port will be in a low traffic or zero traffic state during a specific time period (i.e. the first sleep period), and then adjusts the bandwidth of the first port to the first sleep bandwidth. This method can significantly reduce power consumption and hardware resource occupation during off-peak periods, thereby achieving the purpose of energy saving and consumption reduction. Moreover, by automatically adjusting the bandwidth of the port, more bandwidth resources can be released to the port with high traffic demand, thereby improving the transmission efficiency and response speed of the entire network. That is, the embodiment of the present application analyzes and predicts based on historical traffic data, and can automatically adjust the bandwidth configuration of the port to adapt to the changing network environment and business demand. This flexibility and adaptability helps to reduce the cost and complexity of manual intervention, while improving the intelligent level of the system, and can also reduce unnecessary bandwidth allocation and power consumption.
[0073] Next, the implementation environment involved in the embodiment of the present application is introduced.
[0074] Please refer to FIG. 1, which is a schematic diagram of a network device provided by an embodiment of the present application. The network device includes at least one interface board (two interface boards are shown in FIG. 1 to schematically represent the at least one interface board) 01, and the interface board 01 includes at least one physical interface card 11 (two physical interface cards are shown in FIG. 1 to schematically represent the at least one physical interface card) and a central processing unit (CPU) 12. Please refer to FIG. 2, which is a schematic diagram of a physical interface card 11 provided by an embodiment of the present application. The physical interface card 11 includes a physical port (i.e. network interface) 111.
[0075] The CPU 12 is configured to determine, for any physical port (i.e., a first port) included in the at least one physical interface card 11, a first dormant bandwidth of the first port and a first dormant time period corresponding to the first dormant bandwidth based on historical traffic data of the first port, the historical traffic data representing traffic characteristics of the first port in a historical time period, the first dormant bandwidth being less than a maximum bandwidth of the first port, and adjusting the bandwidth of the first port to the first dormant bandwidth in the first dormant time period.
[0076] In a possible implementation, referring to FIG. 3, which is a schematic diagram of an interface board provided by an embodiment of the present application, the interface board 01 further includes a network processor (NP) 13, and the physical interface card 11 further includes a media access control (MAC) chip 112.
[0077] The NP 13 is configured to process traffic flowing through the at least one physical interface card 11, and the physical port 111 is a channel for data frames to enter the network device. The MAC chip 112 is configured to process data frames in the form of electrical signals in the network, such as encapsulating data into data frames, checking data frames, sending data frames, receiving data frames, and the like. The MAC chip 112 controls data transmission between the network layer and the physical layer to ensure that data can be correctly transmitted on the network.
[0078] In some embodiments, referring to FIG. 4, which is a schematic diagram of another network device provided by an embodiment of the present application, the NP 13 is further configured to count traffic flowing through the MAC chip 112 in a historical time period and store the traffic to the shared memory, so as to achieve traffic counting of the first port and obtain the historical traffic data of the first port. In this case, the CPU 12 is further configured to obtain the historical traffic data of the first port from the shared memory.
[0079] In some embodiments, the NP is configured to count traffic flowing through the MAC chip 112 every first time length in the historical time period. For example, the first time length is less than or equal to 100 milliseconds.
[0080] In a possible implementation, the NP counts traffic flowing through the first port every first time length in the historical time period, so as to obtain traffic counting results corresponding to a plurality of counting periods respectively, and determine traffic data corresponding to at least one time respectively based on the traffic counting results corresponding to the plurality of counting periods respectively, the time length of each counting period being the first time length.
[0081] In the related art, if the traffic statistics of the first port is required, the CPU needs to periodically perform the traffic statistics of the traffic flowing through the MAC chip. However, the CPU needs to perform many other tasks in addition to the traffic statistics, in order not to affect the execution of the other tasks, the period of the CPU traffic statistics is usually greater than 100 milliseconds, thereby resulting in a low statistics frequency, and the low statistics frequency can cause the traffic change occurring in the statistics interval to be ignored, thereby being difficult to capture the information of the burst traffic.
[0082] For example, refer to FIG. 5, which is a schematic diagram of different statistics periods provided by an embodiment of the present application. As can be seen from FIG. 5, compared with the traffic statistics in milliseconds, the traffic statistics in seconds can cause the traffic change occurring in the statistics interval to be ignored, thereby being difficult to capture the information of the burst traffic, and therefore, the traffic statistics with the millisecond-level granularity can record the more real burst peak of the port. Based on this, the present embodiment does not need to perform the traffic statistics by the CPU, but performs the traffic statistics of the traffic flowing through the first port by the NP, and the CPU only needs to obtain the historical traffic data from the shared memory, thereby being able to effectively reduce the task pressure of the CPU, and since the statistics period of the NP is less than or equal to 100 milliseconds, thereby being able to implement the high-frequency traffic statistics, thereby ensuring that the historical traffic data can accurately and comprehensively reflect the traffic characteristics of the first port in the historical time period.
[0083] In a possible implementation, the interface board 01 includes a plurality of physical interface cards 11, in this case, the NP 13 is further configured to perform the traffic statistics of a plurality of ports in the historical time period and store into the shared memory, the plurality of ports are the ports included in the plurality of physical interface cards, the first port is one of the target ports, and the target port is the port to be adjusted in bandwidth. The CPU 12 can obtain the historical traffic data corresponding to the corresponding port from the shared memory according to the demand of the CPU itself.
[0084] In some embodiments, the network device is a device in a fiber communication system, in this case, the physical interface card 11 further includes an optical module, the optical module is configured to implement the conversion between the optical signal and the electrical signal, that is, the data frame in the form of the optical signal enters from the physical port 111, and the optical module converts the data frame in the form of the optical signal into the data frame in the form of the electrical signal, so as to be input into the MAC chip 112 for subsequent processing.
[0085] In a possible implementation, the physical interface card 11 further includes a traffic management (TM) chip, the TM chip is configured to forward and process the data frame.
[0086] Figure 6 is a structural diagram of another network device 200 according to an embodiment of the present application. The network device 200 can be a switch, a router or other network device that forwards packets. In this embodiment, the network device 200 includes a master board 210, an interface board 230 and an interface board 240. In the case of multiple interface boards, a switch fabric (not shown) can be included to complete data exchange between the interface boards (interface boards are also referred to as line cards or service boards).
[0087] The master board 210 is used to complete system management, device maintenance, protocol processing and other functions. The interface boards 230 and 240 are used to provide various service interfaces (e.g., POS interface, GE interface, ATM interface, etc.) and implement data flow forwarding. The master board 210 mainly has three types of functional units: system management control unit, system clock unit and system maintenance unit. The master board 210, the interface board 230 and the interface board 240 are connected through a system bus and a system backplane to achieve intercommunication. The interface board 230 includes one or more processors 231. The processor 231 is used to control and manage the interface board and communicate with the central processor 212 on the master board, and is used for data flow forwarding processing. The memory 232 on the interface board 230 is used to store forwarding table entries, and the processor 231 performs data flow forwarding by looking up the forwarding table entries stored in the memory 232.
[0088] The interface board 230 includes one or more network interfaces 233 used to receive data flows or other information sent by terminals or other network devices and process the data flows or data according to the instructions of the processor 231. The specific implementation process is not described here.
[0089] It can be understood that, as shown in Figure 6, the present embodiment includes multiple interface boards and uses a distributed forwarding mechanism. Under this mechanism, the operation of the interface board 240 is basically similar to that of the interface board 230. For brevity, it is not described here. In addition, it can be understood that the processor 231 and / or 241 in the interface board 230 in Figure 6 can be a special hardware or chip, such as a network processor or an application specific integrated circuit (ASIC), to implement the above functions. This implementation is the commonly used special hardware or chip processing mode for the forwarding plane. In another embodiment, the processor 231 and / or 241 can also use a general-purpose processor, such as a general-purpose CPU, to implement the above-described functions.
[0090] In addition, it should be noted that the master board can have one or more, and when there are multiple, it can include a master master board and a backup master board. The interface board can have one or more, and the stronger the data processing capacity of the device, the more interface boards it provides. In the case of multiple interface boards, the multiple interface boards can communicate through one or more exchange network boards, and when there are multiple, they can jointly implement load sharing and redundancy. Under the centralized forwarding architecture, the device can not need an exchange network board, and the interface board undertakes the processing function of the entire system of service data. Under the distributed forwarding architecture, the device includes multiple interface boards, and the data exchange between the multiple interface boards can be realized through the exchange network board to provide large-capacity data exchange and processing capacity. Therefore, the data access and processing capacity of the network device of the distributed architecture is greater than that of the device of the centralized architecture. Which architecture to use depends on the specific networking deployment scenario, and no limitation is made here.
[0091] In some embodiments, the memory 232 can be a read-only memory (ROM), a random access memory (RAM), an electrically erasable programmable read-only memory (EEPROM), an optical disc including a compact disc read-only memory (CD-ROM), a compressed disc, a laser disc, a digital versatile disc, a Blu-ray disc, and the like, a magnetic disc storage medium or other magnetic storage device, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited to. The memory 232 can exist independently and be connected to the processor 231 through a communication bus. The memory 232 can also be integrated with the processor 231.
[0092] In some embodiments, the network interface 233 can be a device using any transceiver, used for communication with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area network (WLAN), etc. The network interface 233 includes a wired network interface and can also include a wireless network interface. The wired network interface can be, for example, an Ethernet interface. The Ethernet interface can be an optical interface, an electrical interface, or a combination thereof. The wireless network interface can be a WLAN interface, a cellular network communication interface, or a combination thereof. When the network device is any network device in the domain, the network interface 233 is used to forward data packets to other network devices.
[0093] In some embodiments, the network device can include a plurality of processors, each of which can be a single-core processor or a multi-core processor. The processor herein can refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0094] In some embodiments, the memory 232 is configured to store program codes for implementing the solutions of the present application, and the processor 231 can execute the program codes stored in the memory 232 to cause the network device 200 to perform the processing steps of the network device in the embodiment of FIG. 7. For details, reference can be made to the detailed description of the embodiment shown in FIG. 7, which will not be repeated here.
[0095] It should be noted that the application scenarios and implementation environments described in the embodiments of the present application are for more clearly illustrating the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. It can be known by those skilled in the art that, with the evolution of technology and the appearance of new application scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.
[0096] FIG. 7 is a flowchart of a port energy-saving method provided by an embodiment of the present application, which is applied to a network device. Please refer to FIG. 7, the method includes the following steps.
[0097] Step 701: Based on historical traffic data of a first port included in the network device, a first dormancy bandwidth of the first port and a first dormancy period corresponding to the first dormancy bandwidth are determined, the historical traffic data characterizes traffic features of the first port in a historical period, and the first dormancy bandwidth is less than a maximum bandwidth of the first port.
[0098] In a possible implementation, the historical traffic data includes traffic data corresponding to at least one time point respectively, the at least one time point corresponds to at least one traffic statistical period respectively, the at least one traffic statistical period does not overlap, and the historical period includes the at least one traffic statistical period. For any one time point, the traffic data corresponding to the time point indicates traffic features of the first port in the corresponding traffic statistical period.
[0099] In some embodiments, the network device includes an NP, the NP performs statistics on the traffic flowing through the first port every first time length in the historical period to obtain traffic statistical results corresponding to a plurality of statistical periods respectively, and based on the traffic statistical results corresponding to the plurality of statistical periods respectively, traffic data corresponding to at least one time point respectively is determined to obtain the historical traffic data, and the time length of each statistical period is the first time length.
[0100] In a possible implementation, the network device further includes a processor, and after obtaining the historical traffic data, the NP can store the historical traffic data into the shared memory, and the processor can obtain the historical traffic data from the shared memory and perform step 701.
[0101] The embodiments of the present application do not need to count the traffic by the CPU, but count the traffic flowing through the first port by the NP, and the CPU only needs to obtain the historical traffic data from the shared memory, thus the task pressure of the CPU can be effectively reduced, and since the counting period of the NP is less than or equal to 100 milliseconds, thus high-frequency traffic counting can be realized, thereby ensuring that the historical traffic data can accurately and comprehensively reflect the traffic characteristics of the first port in the historical time period.
[0102] For example, the first duration is less than or equal to 100 milliseconds, and the first duration is less than or equal to the traffic counting time period.
[0103] In some embodiments, for any time point, at least one counting period in the plurality of counting periods is determined, which is in the traffic counting time period corresponding to the time point, and the traffic data corresponding to the time point is determined based on the traffic counting results respectively corresponding to the at least one counting period. In the same way, each of the at least one time point is processed, and the traffic data respectively corresponding to the at least one time point can be obtained.
[0104] In a possible implementation, the average value in the traffic counting results respectively corresponding to the at least one counting period is determined as the traffic data corresponding to the time point, or the maximum value, the minimum value or the mode in the traffic counting results respectively corresponding to the at least one counting period is determined as the traffic data corresponding to the time point.
[0105] It should be noted that the traffic counting result corresponding to each counting period is the data bit amount flowing through the first port in the counting period, or is the traffic rate of the first port in the counting period, and the traffic rate of the first port in the counting period is obtained by dividing the data bit amount flowing through the first port in the counting period by the first duration.
[0106] Next, the implementation process of determining the first dormant bandwidth of the first port and the first dormant time period corresponding to the first dormant bandwidth based on the historical traffic data of the first port included in the network device will be introduced by taking the traffic counting result as the data bit amount flowing through the first port in the counting period as an example.
[0107] Since the historical traffic data includes different contents, the implementation process of determining the first dormant bandwidth of the first port and the first dormant time period corresponding to the first dormant bandwidth based on the historical traffic data of the first port included in the network device is also different, which will be introduced respectively.
[0108] In a first case, the historical traffic data includes first traffic data corresponding to a first time point (i.e., the historical traffic data includes traffic data corresponding to one time point). At this time, the network device determines, based on the first traffic data corresponding to the first time point, a first sleep gear corresponding to the first time point from the at least one sleep gear, determines, from the correspondence between the at least one sleep gear and the sleep bandwidth, a sleep bandwidth corresponding to the first sleep gear as a first sleep bandwidth, and acquires a first sleep period based on the first time point.
[0109] In some embodiments, based on the first traffic data, a target traffic range is determined from at least one traffic range, the at least one traffic range corresponds to the at least one sleep gear one by one, the at least one traffic range does not overlap, the target traffic range is a traffic range in which the first traffic data is located, and a sleep gear corresponding to the target traffic range is determined as the first sleep gear corresponding to the first time point.
[0110] In a possible implementation, the traffic range is determined based on a maximum bandwidth of the first port, a number of sleep gears, a sleep gear corresponding to the traffic range, and a first time length. The sleep bandwidth is determined based on the maximum bandwidth of the first port, the number of sleep gears, the sleep gear corresponding to the traffic range, a number of Serdes included in the first port, and a bandwidth of each Serdes.
[0111] For example, for any traffic range corresponding to a sleep gear, an upper limit x1 of the traffic range is equal to the maximum bandwidth ÷ the number of sleep gears × (the sleep gear corresponding to the traffic range - 1) × the first time length, and a lower limit x2 of the traffic range is equal to the maximum bandwidth ÷ the number of sleep gears × the sleep gear corresponding to the traffic range × the first time length.
[0112] It should be noted that if the traffic data is a traffic rate flowing through the first port in a corresponding traffic statistical time period, the traffic range is determined based on the maximum bandwidth of the first port, the number of sleep gears, and the sleep gear corresponding to the traffic range.
[0113] For example, for any traffic range corresponding to a sleep gear, an upper limit x1 of the traffic range is equal to the maximum bandwidth ÷ the number of sleep gears × (the sleep gear corresponding to the traffic range - 1), and a lower limit x2 of the traffic range is equal to the maximum bandwidth ÷ the number of sleep gears × the sleep gear corresponding to the traffic range.
[0114] For example, the correspondence between the at least one sleep gear and the at least one traffic range is shown in Table 1.
[0115] Table 1
[0116] In the above Table 1, N is the number of sleep gears, T is the first time length, the flow range of the sleep gear 1 is greater than or equal to 0 bytes and less than or equal to (maximum bandwidth ÷ N × 1 × T) bytes, the flow range of the sleep gear 2 is greater than (maximum bandwidth ÷ N × 1 × T) bytes and less than or equal to (maximum bandwidth ÷ N × 2 × T) bytes, the flow range of the sleep gear 3 is greater than (maximum bandwidth ÷ N × 2 × T) bytes and less than or equal to (maximum bandwidth ÷ N × 3 × T) bytes, and the flow range of the sleep gear N is greater than the upper limit of the flow range corresponding to the sleep gear N-1 and less than or equal to (maximum bandwidth ÷ N × N × T) bytes.
[0117] For example, for any sleep gear, the sleep bandwidth corresponding to the sleep gear is determined based on the sleep bandwidth required by the sleep gear, the number of Serdes included in the first port, and the bandwidth of each Serdes, and the sleep bandwidth required by the sleep gear w = maximum bandwidth × (1 ÷ number of sleep gears).
[0118] Based on the number of Serdes included in the first port, the bandwidth of each Serdes, a plurality of candidate bandwidths are determined, and the candidate bandwidth in the plurality of candidate bandwidths which has the minimum difference with the sleep bandwidth required by the sleep gear and is greater than or equal to the sleep bandwidth required by the sleep gear is determined as the sleep bandwidth corresponding to the sleep gear.
[0119] In some embodiments, based on the number of Serdes included in the first port, the bandwidth of each Serdes, a plurality of candidate bandwidths can be determined according to the following formula (1).
[0120] wherein H i represents the ith candidate bandwidth, h s represents the bandwidth of the st Serdes.
[0121] It should be noted that since the number of Serdes included in the port and the bandwidth of each Serdes are limited, the number of candidate bandwidths determined based on the number of Serdes included in the port and the bandwidth of each Serdes is also limited, and in the case where the number of sleep gears is greater than the number of candidate bandwidths, the case where one sleep bandwidth corresponds to a plurality of sleep gears will occur.
[0122] For another example, based on the above Table 1, if the maximum bandwidth of the first port is 100 Gbit / s, the first time length is 3 milliseconds, the sleep gear data is 8, the number of Serdes is 4, the bandwidth of each Serdes is 25 Gbit / s, and the number of sleep gears is 8, the corresponding relationship between the 8 sleep gears, 8 flow ranges and sleep bandwidths is shown in the following Table 2.
[0123] Table 2
[0124] In the above Table 2, the flow range of the dormant gear 1 is greater than or equal to 0 bytes and less than or equal to 46875 bytes, and the dormant bandwidth is 25G bits per second; the flow range of the dormant gear 2 is greater than 46875 bytes and less than or equal to 93750 bytes, and the dormant bandwidth is 25G bits per second; the flow range of the dormant gear 3 is greater than 93750 bytes and less than or equal to 140625 bytes, and the dormant bandwidth is 50G bits per second; the flow range of the dormant gear 4 is greater than 140625 bytes and less than or equal to 187500 bytes, and the dormant bandwidth is 50G bits per second; the flow range of the dormant gear 5 is greater than 187500 bytes and less than or equal to 234375 bytes, and the dormant bandwidth is 75G bits per second; the flow range of the dormant gear 6 is greater than 234375 bytes and less than or equal to 281250 bytes, and the dormant bandwidth is 75G bits per second; the flow range of the dormant gear 7 is greater than 281250 bytes and less than or equal to 328125 bytes, and the dormant bandwidth is 100G bits per second; the flow range of the dormant gear 8 is greater than 328125 bytes and less than or equal to 375000 bytes, and the dormant bandwidth is 100G bits per second.
[0125] In some embodiments, the network device can determine the time period with the second time length and including the first time as the first dormant time period.
[0126] For example, the first time is 2 o'clock in the morning, and the second time length is 1 hour. In this case, the first dormant time period can be determined as 1 o'clock to 2 o'clock in the morning, 2 o'clock to 3 o'clock in the morning, or 1:30 to 2:30 in the morning, and the application embodiments do not limit this.
[0127] In other embodiments, the network device can also determine the flow statistical time period corresponding to the first time as the first dormant time period.
[0128] For example, the first time is 2 o'clock in the morning, and the flow statistical time period is 1 o'clock to 2 o'clock in the morning. In this case, the first dormant time period can be determined as 1 o'clock to 2 o'clock in the morning.
[0129] Since the flow data corresponding to the first time is the data bit amount flowing through the first port in the flow statistical time period, the flow data represents the flow characteristics in the flow statistical time period, and thus the flow statistical time period corresponding to the first time can be determined as the first dormant time period, so as to ensure that the determined first dormant time period conforms to the actual flow statistical time period, and effectively improve the accuracy of the first dormant time period.
[0130] In the second case, the historical traffic data includes traffic data corresponding to multiple time points. In this case, there are multiple implementation manners for determining the first sleep bandwidth of the first port and the first sleep time period corresponding to the first sleep bandwidth based on the historical traffic data of the first port included by the network device. Next, two implementation manners are introduced.
[0131] In the first implementation manner, the historical traffic data includes first traffic data corresponding to a first time point and second traffic data corresponding to a second time point (that is, the historical traffic data includes traffic data corresponding to two time points). At this time, the first sleep gear corresponding to the first time point and the second sleep gear corresponding to the second time point are determined from the at least one sleep gear based on the first traffic data corresponding to the first time point and the second traffic data corresponding to the second time point, the first sleep bandwidth is determined based on the first sleep gear corresponding to the first time point and the second sleep gear corresponding to the second time point, and the first sleep time period is obtained based on the first time point and the second time point.
[0132] The implementation process of determining the first sleep gear corresponding to the first time point and the second sleep gear corresponding to the second time point from the at least one sleep gear based on the first traffic data corresponding to the first time point and the second traffic data corresponding to the second time point includes: determining the first sleep gear corresponding to the first time point from the at least one sleep gear based on the first traffic data corresponding to the first time point, and determining the second sleep gear corresponding to the second time point from the at least one sleep gear based on the second traffic data corresponding to the second time point.
[0133] The implementation manner of determining the first sleep gear corresponding to the first time point from the at least one sleep gear based on the first traffic data corresponding to the first time point and the implementation manner of determining the second sleep gear corresponding to the second time point from the at least one sleep gear based on the second traffic data are similar to the implementation manner of determining the first sleep gear corresponding to the first time point from the at least one sleep gear based on the first traffic data in the first case, and details are referred to the related content in the foregoing description, which will not be described herein again.
[0134] The first sleep gear and the second sleep gear can be the same or different. In different cases, the implementation manner of determining the first sleep bandwidth is different, which will be introduced respectively.
[0135] If the first sleep gear and the second sleep gear are different, the sleep bandwidth corresponding to the larger gear of the first sleep gear and the second sleep gear is determined as the first sleep bandwidth from the correspondence between the at least one sleep gear and the sleep bandwidth.
[0136] If the first sleep gear and the second sleep gear are the same, the sleep bandwidth corresponding to the first sleep gear or the second sleep gear is determined as the first sleep bandwidth from the correspondence between the at least one sleep gear and the sleep bandwidth.
[0137] In some embodiments, the process of obtaining the first sleep period based on the first time and the second time comprises determining a time period corresponding to the first time and the second time as the first sleep period.
[0138] In the second implementation, based on the historical traffic data, the sleep gears corresponding to the plurality of times are determined, based on the sleep gears corresponding to the plurality of times, the at least one sleep period and the sleep gear corresponding to each sleep period in the at least one sleep period are determined, based on the sleep gear corresponding to each sleep period in the at least one sleep period, the sleep bandwidth corresponding to each sleep period in the at least one sleep period is determined, any one of the at least one sleep period is determined as the first sleep period, and the sleep gear corresponding to the first sleep period is determined as the first sleep bandwidth.
[0139] For any one of the plurality of times, the sleep gear corresponding to the time is determined from the at least one sleep gear based on the traffic data corresponding to the time, and each of the plurality of times is processed in the same way, so that the sleep gears corresponding to the plurality of times can be determined.
[0140] In the second implementation, based on the historical traffic data, the sleep gears corresponding to the plurality of times are determined, based on the sleep gears corresponding to the plurality of times, the at least one sleep period and the sleep gear corresponding to each sleep period in the at least one sleep period are determined, based on the sleep gear corresponding to each sleep period in the at least one sleep period, the sleep bandwidth corresponding to each sleep period in the at least one sleep period is determined, any one of the at least one sleep period is determined as the first sleep period, and the sleep gear corresponding to the first sleep period is determined as the first sleep bandwidth.
[0141] In some embodiments, the plurality of time instants correspond to a plurality of time periods, and the plurality of time periods do not overlap with each other. In this case, the network device determines the at least one sleep period and the sleep gear corresponding to each sleep period in the at least one sleep period based on the sleep gears corresponding to the plurality of time instants, including: setting i = 1, if the ith time instant is not the last time instant in the plurality of time instants, and the sleep gear corresponding to the ith time instant is not the highest gear, then determining a time instant from the time instants after the ith time instant, which is closest to the ith time instant and has a sleep gear different from the sleep gear corresponding to the ith time instant, to obtain an xth time instant; determining a sum of the time periods corresponding to all time instants before the xth time instant and the ith time instant as a sleep period, determining the sleep gear corresponding to the ith time instant as the sleep gear corresponding to the sleep period, setting i = x, and re-executing the step of determining a time instant from the time instants after the ith time instant, which is closest to the ith time instant and has a sleep gear different from the sleep gear corresponding to the ith time instant, to obtain an xth time instant; if the ith time instant is the last time instant in the plurality of time instants, and the sleep gear corresponding to the ith time instant is not the highest gear, then determining the time period corresponding to the ith time instant as a sleep period, and determining the sleep gear corresponding to the ith time instant as the sleep gear corresponding to the sleep period; if the sleep gear corresponding to the ith time instant is the highest gear, then setting i = i + 1, and re-executing the step of determining a time instant from the time instants after the ith time instant, which is closest to the ith time instant and has a sleep gear different from the sleep gear corresponding to the ith time instant, to obtain an xth time instant.
[0142] It should be noted that, for any time instant in the plurality of time instants, the time period corresponding to the time instant can be a time period with a third time length and including the time instant, or a traffic statistics time period corresponding to the time instant, and the embodiments of the present application do not limit this.
[0143] For example, if the historical traffic data includes traffic data corresponding to four time instants, which are traffic data corresponding to 0 o'clock, traffic data corresponding to 1 o'clock, traffic data corresponding to 2 o'clock, and traffic data corresponding to 3 o'clock; wherein the time period corresponding to 0 o'clock is 0 hours 00 minutes-0 hours 59 minutes, the time period corresponding to 1 o'clock is 1 hour 00 minutes-1 hour 59 minutes, the time period corresponding to 2 o'clock is 2 hours 00 minutes-2 hours 59 minutes, the time period corresponding to 3 o'clock is 3 hours 00 minutes-3 hours 59 minutes, the sleep gear corresponding to 0 o'clock is 1, the sleep gear corresponding to 1 o'clock is 2, the sleep gear corresponding to 2 o'clock is 2, and the sleep gear corresponding to 3 o'clock is 1.
[0144] In this case, for the first time (i.e. 0 o'clock), the time after 0 o'clock and the closest to 0 o'clock in the four times is 1 o'clock, and the sleep gear corresponding to 0 o'clock is not the same as 1 o'clock, so the time period corresponding to 0 o'clock, i.e. 0:00-0:59, is determined as a sleep time period, and the sleep gear 1 is determined as the sleep gear corresponding to the sleep time period. For the second time (i.e. 1 o'clock), the time after 1 o'clock and the closest to 1 o'clock in the four times is 3 o'clock, and the sleep gear corresponding to 1 o'clock is not the same as 3 o'clock, so the sum of the time periods corresponding to 1 o'clock and 2 o'clock, i.e. 1:00-2:59, is determined as a sleep time period, and the sleep gear 2 is determined as the sleep gear corresponding to the sleep time period. For the fourth time (i.e. 3 o'clock), since 3 o'clock is the last time in the four times, the sum of the time periods corresponding to 3 o'clock, i.e. 3:00-3:59, is determined as a sleep time period, and the sleep gear 1 is determined as the sleep gear corresponding to the sleep time period.
[0145] Step 702: adjusting the bandwidth of the first port to the first sleep bandwidth in the first sleep time period.
[0146] In some embodiments, the first port corresponds to a plurality of Serdes, and in this case, the central processor included in the network device can turn off or start the low-power mode of at least one Serdes in the plurality of Serdes according to the first sleep bandwidth and according to a relevant algorithm, so as to adjust the bandwidth of the first port to the first sleep bandwidth.
[0147] In a possible implementation, the network device further includes a MAC chip and an optical module corresponding to the first port, and the central processor included in the network device can reduce the speed of the MAC chip and split the inside of the optical module according to the first sleep bandwidth and according to a relevant algorithm, so as to ensure that the relevant hardware in the network device is adapted to the first sleep bandwidth of the first port.
[0148] In some embodiments, the network device can be directly connected with the port of another network device (for the convenience of description, the network device in which the first port is located is referred to as a first device, and the network device in which the port directly connected with the first port is located is referred to as a second device), for the first device, the ports directly connected with the second device in the first device are the first port and the fourth port, one of the first port and the fourth port is an uplink port, and the other is a downlink port, and the sleep time period corresponding to the fourth port and the sleep bandwidth corresponding to the sleep time period are the same as those of the first port. For the second device, the ports directly connected with the first device in the second device are the second port and the third port, one of the second port and the third port is an uplink port, and the other is a downlink port.
[0149] Since the bandwidths of two directly connected ports in a network device usually need to be consistent to avoid abnormal situations such as packet loss, in some embodiments, the first device can send first bandwidth negotiation information to the second device when the first sleep period is reached, the first bandwidth negotiation information indicating that the first device is to adjust the bandwidths of the first port and the fourth port to the first sleep bandwidth, the second port of the second device can receive the first bandwidth negotiation information sent by the first device, and adjust the bandwidths of the second port and the third port to the first sleep bandwidth.
[0150] In some embodiments, before the first device sends the first bandwidth negotiation information to the second device, the energy saving pre-announcement can be sent to the second device, the first value is written into the energy saving state flag bit to indicate that the first port of the first device is ready to enter the energy saving state, the sending of the data packet is stopped after y1 seconds after the first value is written into the energy saving state flag bit, and the step of sending the first bandwidth negotiation information to the second device is performed. Before the second device receives the first bandwidth negotiation information sent by the first device, the energy saving pre-announcement sent by the first device can be received, and then the second value is written into the energy saving state flag bit to indicate that the second port of the second device is ready to enter the energy saving state, and then the second device can poll to determine whether the first bandwidth negotiation information sent by the first device is received.
[0151] In some embodiments, the second device can adjust the bandwidth of the downlink port among the second port and the third port to the first sleep bandwidth when the first bandwidth negotiation information sent by the first device is received, and stop sending the data packet, and adjust the bandwidth of the uplink port among the second port and the third port to the first sleep bandwidth after y2 seconds after the sending of the data packet is stopped.
[0152] In a possible implementation, after the second device stops sending the data packet, the second device can further send second bandwidth negotiation information to the first device to indicate that the second device is to adjust the bandwidths of the second port and the third port to the first sleep bandwidth.
[0153] If the second device can further send the second bandwidth negotiation information to the first device after stopping sending the data packet, the first device can adjust the bandwidths of the first port and the fourth port to the first sleep bandwidth after receiving the second bandwidth negotiation information. If the second device does not send the second bandwidth negotiation information to the first device, the first device can poll the states of the second port and the third port included in the second device, and if the port state is down, the first device adjusts the bandwidths of the first port and the fourth port to the first sleep bandwidth.
[0154] Since the link layer discovery protocol (LLDP) is responsible for periodically detecting port information in the network, when a certain port of a network device (which may temporarily cause the state of the port to become down during bandwidth reconfiguration. Based on this polling mechanism, if the first device detects that the second port and / or the third port connected to the second device are in a down state during polling, it can determine the bandwidth of the configured port of the second device, thereby inferring that the bandwidth negotiation process between the first device and the second device has been completed, and therefore, the first device can adjust the bandwidth of the first port and the fourth port to the first dormant bandwidth.
[0155] In a possible implementation, the bandwidth negotiation information includes port identification, current port bandwidth, and port adjustment bandwidth. The port identification is used to uniquely identify a port, and in some embodiments, the port identification includes a port number and / or a port name.
[0156] In another possible implementation, the first device can write the first bandwidth negotiation information into the Payload field of an LLDP packet and send the LLDP packet to the second device to send the first bandwidth negotiation to the second device.
[0157] It should be noted that the network device can periodically perform the above steps 701-702, in which case the historical time period is the last bandwidth adjustment period, that is, the network device can determine the first dormant bandwidth of the first port and the first dormant time period corresponding to the first dormant bandwidth based on the historical traffic data of the first port. The historical traffic data represents the traffic characteristics of the first port in the last bandwidth adjustment period, and the first dormant bandwidth is less than the maximum bandwidth of the first port. In the first dormant time period of the current bandwidth adjustment period, the bandwidth of the first port is adjusted to the first dormant bandwidth.
[0158] The length of each bandwidth adjustment period is set in advance and can be adjusted according to different needs in different cases. For example, the length of the bandwidth adjustment period can be 1 day or 1 week, etc. In the case of a bandwidth adjustment period of 1 day, the length of the traffic statistics time period can be a hours, where a is a number greater than or equal to 1. In the case of a bandwidth adjustment period of 1 week, the length of the traffic statistics time period can be b days, where b is a number greater than or equal to 1. The present embodiments do not limit this.
[0159] In some embodiments, the network device is further capable of, based on traffic data of a second port included in the network device in a current time period, determining that the second port satisfies a wake-up condition, adjusting bandwidth of the second port to a maximum bandwidth, the wake-up condition representing that a sleep bandwidth corresponding to a second sleep period of the second port does not satisfy a transmission requirement of traffic in the current time period, the current time period being a time period included in the second sleep period.
[0160] In some embodiments, the network device is further capable of, based on traffic data of a second port included in the network device in a current time period, determining that the second port satisfies a wake-up condition, adjusting bandwidth of the second port to a maximum bandwidth, the wake-up condition representing that a sleep bandwidth corresponding to a second sleep period of the second port does not satisfy a transmission requirement of traffic in the current time period, the current time period being a time period included in the second sleep period.
[0161] That is, the network device is capable of monitoring the ports configured with the sleep bandwidth to determine whether the wake-up condition is triggered by the corresponding port, i.e., whether the sleep bandwidth corresponding to the port can satisfy the transmission requirement of the actual traffic. In the case where it is determined that the sleep bandwidth does not satisfy the transmission requirement of the actual traffic, the bandwidth of all the ports configured with the sleep bandwidth is adjusted to the corresponding maximum bandwidth, or the bandwidth of the port triggering the wake-up condition is adjusted to the corresponding maximum bandwidth, so that the sleep / wake-up state of the port can be dynamically adjusted, and the flexibility and adaptability of the network device are enhanced. In the case of burst traffic, the port can be quickly woken up by the wake-up mechanism to cope with the additional traffic requirement, so as to prevent network congestion or interruption, thereby improving the stability and reliability of the network.
[0162] It should be noted that, in the case where the network device is capable of periodically performing the steps 701-702, the current time period is a time period in a current bandwidth adjustment period. In the case where the network device determines that the second port satisfies the wake-up condition based on the traffic data of the second port included in the network device in the current time period, the network device is capable of adjusting the bandwidth of all the ports configured with the sleep bandwidth included in the network device to the corresponding maximum bandwidth before the end of the current time period (i.e., all the ports of the network device perform traffic transmission according to the maximum bandwidth corresponding to the port before the end of the current time period), or adjusting the bandwidth of the second port to the maximum bandwidth.
[0163] In some embodiments, the implementation process of determining that the second port satisfies the wake-up condition based on the traffic data of the second port included in the network device in the current time period includes: determining a traffic characteristic value of the second port based on the traffic data of the second port in the current time period, the traffic characteristic value representing a traffic characteristic of the second port in the current time period, and determining that the second port satisfies the wake-up condition if the traffic characteristic value of the second port is greater than or equal to a traffic characteristic value threshold corresponding to the second sleep period.
[0164] In a possible implementation, the traffic data is the amount of data bits flowing through the second port in the current time period, in which case, the traffic data of the second port in the current time period can be directly determined as the traffic feature value of the second port, or the amount of data bits flowing through the second port in the current time period is divided by the length of the current time period to obtain the traffic rate of the second port in the current time period, and the traffic rate is determined as the traffic feature value of the second port, which is not limited in the embodiments of the present application.
[0165] In some embodiments, at least one sleep gear is in a corresponding relationship with a traffic feature value threshold, and the second port is a port configured with a second sleep bandwidth and a second sleep time period corresponding to the second sleep bandwidth, in which case, the traffic feature value threshold corresponding to the second sleep time period refers to the traffic feature value threshold corresponding to the second sleep bandwidth, and the second sleep bandwidth is the sleep bandwidth corresponding to the second sleep time period.
[0166] In a possible implementation, for any one of the at least one sleep gear except the highest sleep gear, the traffic feature value threshold corresponding to the gear is based on the product of the upper limit of the traffic range corresponding to the gear and the wake-up multiple, and the wake-up multiple is a number greater than or equal to 1. The traffic feature value threshold corresponding to the highest sleep gear is the upper limit of the traffic range corresponding to the gear.
[0167] For example, the wake-up multiple is 1.2, and the number of sleep gears is 8, and the corresponding relationship between the 8 sleep gears and the traffic feature value threshold is shown in Table 3.
[0168] Table 3
[0169] In some embodiments, the network device can periodically determine whether the second port meets the wake-up condition, and in the case where the second port meets the wake-up condition, the bandwidth of the second port is adjusted to the maximum bandwidth, or the bandwidths of the ports included in the network device and configured with the sleep bandwidth are all adjusted to the maximum bandwidths corresponding to the ports.
[0170] It should be noted that in the case where the network device periodically determines whether the second port meets the wake-up condition, the current time period is the current detection period, and the length of each detection period is set in advance, which can also be adjusted as needed in different cases. For example, the length of the detection period can be 3 milliseconds.
[0171] In a possible implementation, the network device comprises an NP, and the NP is configured to process traffic flowing through a plurality of ports. In this case, the first port is one of target ports, and the target ports are ports in the plurality of ports for which bandwidths are to be adjusted. At this point, before step 701 is performed, the network device is further capable of determining the target ports from the plurality of ports.
[0172] There are various implementations of determining the target ports from the plurality of ports, three of which are introduced as follows.
[0173] In a first implementation, historical traffic data corresponding to the plurality of ports is obtained, and based on the historical traffic data corresponding to the plurality of ports, a port with smaller traffic in a historical time period is determined as a target port from the plurality of ports. That is, based on the historical traffic data corresponding to the plurality of ports, a target port is determined from the plurality of ports, and the traffic of each port in the target port in the historical time period is smaller than the traffic of other ports in the plurality of ports in the historical time period.
[0174] Based on the historical traffic data corresponding to the plurality of ports, target characteristic values corresponding to the plurality of ports are determined, and based on the target characteristic values corresponding to the plurality of ports, a port with smaller traffic in a historical time period is determined as a target port from the plurality of ports.
[0175] For any one of the plurality of ports, the historical traffic data corresponding to the port comprises at least one traffic data corresponding to at least one time. In this case, an average of the at least one traffic data can be determined as the target characteristic value corresponding to the port, or a maximum value, a minimum value, or a mode of the at least one traffic data can be determined as the target characteristic value corresponding to the port, and the embodiments of the present application do not limit this. Each of the plurality of ports is processed in the same manner, and target characteristic values corresponding to the plurality of ports can be obtained.
[0176] Based on the target characteristic values corresponding to the plurality of ports, a port with smaller traffic in a historical time period is determined as a target port from the plurality of ports, and the implementation process comprises: based on the target characteristic values corresponding to the plurality of ports, the plurality of ports are sorted to obtain a port traffic sorting result, and based on the port traffic sorting result, the target ports are determined from the plurality of ports.
[0177] In some embodiments, the plurality of ports can be sorted in descending order of the target characteristic values to obtain the port traffic sorting result. Of course, in actual applications, the plurality of ports can also be sorted in ascending order of the target characteristic values to obtain the port traffic sorting result.
[0178] In some embodiments, if the port traffic ranking result is ranked in descending order of the target feature value, the first A1 percent of the port traffic ranking result or the first B1 ports of the port traffic ranking result are determined as the target ports. If the port traffic ranking result is ranked in ascending order of the target feature value, the last A1 percent of the port traffic ranking result or the last B1 ports of the port traffic ranking result are determined as the target ports.
[0179] It should be noted that the above method of determining the target ports from the plurality of ports according to the port traffic ranking result is only one implementation manner. In other embodiments, the target ports can also be determined from the plurality of ports in other implementation manners, for example, at least one port corresponding to a target feature value greater than a target feature value threshold among the target feature values corresponding to the plurality of ports is determined as the target port.
[0180] Wherein, A1, B1 and the target feature value threshold are set in advance, and can be adjusted according to different needs in different cases. For example, A1 can be set to 10, and B1 can be set to 2.
[0181] In some embodiments, before the target ports are determined from the plurality of ports by the first implementation manner, the network device can execute the step of determining the target ports from the plurality of ports by the first implementation manner only when there is a wake-up port in the plurality of ports, the wake-up port being a port that has been woken up in the historical time period; or only when all the plurality of ports are full-bandwidth ports, the full-bandwidth port being a port that has not been configured with a sleep bandwidth in the historical time period; or only when there is a third port in the plurality of ports, the third port being a wake-up port and corresponding to a historical traffic feature value threshold and a historical sleep bandwidth in the historical time period, the historical traffic feature value threshold being the maximum value of at least one traffic feature value threshold corresponding to the historical sleep bandwidth, the greater the traffic feature value threshold, the greater the required traffic feature value when the port is woken up, i.e., the greater the traffic of the port.
[0182] If there is a wake-up port in the plurality of ports, it indicates that the traffic of the port has a burst in the historical time period, and the burst traffic exceeds the traffic transmission capability that the sleep bandwidth of the port can provide. The sleep bandwidth and the sleep period configured for the port in the historical time period are not suitable for the actual change of the traffic of the port. Therefore, the target port can be determined from the plurality of ports, so as to determine the sleep bandwidth and the sleep period corresponding to the sleep bandwidth that are more suitable for the actual situation in the subsequent time period according to the traffic data in the historical time period.
[0183] If all the plurality of ports are full-bandwidth ports, it indicates that there is no port configured with a sleep bandwidth in the plurality of ports. Therefore, the target port can be determined from the plurality of ports, so as to perform energy saving for the ports in the network device by the method of the embodiments of the present application.
[0184] Based on the above description, the plurality of sleep gears correspond to sleep bandwidths respectively, and the sleep bandwidths and the traffic characteristic value threshold also have a corresponding relationship. In this case, the sleep bandwidth and the traffic characteristic value threshold also have a corresponding relationship. Based on the above description, in the case where the number of sleep gears is greater than the number of candidate bandwidths, a sleep bandwidth can correspond to a plurality of sleep gears. Therefore, one sleep bandwidth corresponds to at least one traffic characteristic value threshold, and the maximum value in the at least one traffic characteristic value threshold is the upper limit of the traffic that the sleep bandwidth can bear.
[0185] If there is a third port in the plurality of ports, it indicates that the traffic of the third port has exceeded the upper limit of the traffic that the port can bear. The sleep bandwidth and the sleep period configured for the third port in the historical time period cannot meet the actual traffic transmission demand. Therefore, the target port can be determined from the plurality of ports, so as to determine the sleep bandwidth and the sleep period corresponding to the sleep bandwidth that are more suitable for the actual situation in the subsequent time period according to the traffic data in the historical time period.
[0186] In some other embodiments, if there is a wake-up port in the plurality of ports, but there is no third port in the wake-up port, for any one of the wake-up ports, in the third sleep period, the bandwidth of the wake-up port is adjusted to the target sleep bandwidth, the third sleep period is the sleep period in which the wake-up port is awakened, the target sleep bandwidth is the candidate bandwidth that is greater than the third sleep bandwidth and has the minimum difference with the third sleep bandwidth in the plurality of candidate bandwidths, and the third sleep bandwidth is the sleep bandwidth corresponding to the sleep period in which the wake-up port is awakened.
[0187] For example, the plurality of ports include port 1 and port 2, the sleep period corresponding to the historical time period of port 1 includes sleep period 1 and sleep period 2, wherein sleep period 1 is from 1 o'clock to 7 o'clock, the sleep bandwidth corresponding to sleep period 1 is bandwidth 1, sleep period 2 is from 15 o'clock to 16 o'clock, and the sleep bandwidth corresponding to sleep period 2 is bandwidth 2; the sleep period corresponding to the historical time period of port 2 is from 1 o'clock to 7 o'clock, the sleep bandwidth corresponding to sleep period 1 is bandwidth 1, bandwidth 1 corresponds to two traffic feature threshold values, which are threshold 1 and threshold 2, threshold 2 is greater than threshold 1, the traffic feature threshold value corresponding to sleep period 1 of port 1 is threshold 1, the traffic feature threshold value corresponding to sleep period 2 of port 1 is threshold 3, and the traffic feature threshold value corresponding to the sleep period of port 2 is threshold 1.
[0188] If port 1 is woken up in sleep period 1 and port 2 is woken up in sleep period, both port 1 and port 2 are wake-up ports, but since the traffic feature threshold value corresponding to sleep period 1 of port 1 is threshold 1 (i.e., the traffic feature threshold value corresponding to sleep period 1 of port 1 is not the maximum of threshold 1 and threshold 2), port 1 is not the third port, and since the traffic feature threshold value corresponding to the sleep period of port 2 is threshold 1 (i.e., the traffic feature threshold value corresponding to the sleep period of port 2 is not the maximum of threshold 1 and threshold 3), port 2 is also not the third port. In this case, the sleep bandwidth corresponding to sleep period 1 of port 1 is adjusted to bandwidth 2, the sleep bandwidth corresponding to sleep period 2 is kept unchanged, and the sleep bandwidth corresponding to sleep period 1 of port 2 is adjusted to bandwidth 2.
[0189] It should be noted that in the case that the network device can periodically perform the above steps 701-702, if there is a wake-up port in the plurality of ports, but there is no third port in the wake-up port, then for any one of the wake-up ports, the network device can adjust the bandwidth of the wake-up port to the target sleep bandwidth in the third sleep period of the current bandwidth adjustment period.
[0190] In a second implementation, historical traffic data corresponding to each of the full-bandwidth ports in the plurality of ports is obtained, the full-bandwidth port being a port that has not been configured with a sleep bandwidth in the historical time period; based on the historical traffic data corresponding to each of the full-bandwidth ports, a port with smaller traffic in the historical time period is determined from the full-bandwidth ports as a target port, that is, based on the historical traffic data corresponding to each of the full-bandwidth ports, a target port is determined from the full-bandwidth ports, and the traffic of each port in the target port in the historical time period is smaller than the traffic of other ports in the full-bandwidth ports in the historical time period.
[0191] The implementation process of determining the port with less traffic in the historical time period as the target port from the full-bandwidth ports based on the historical traffic data corresponding to each full-bandwidth port is similar to the implementation process of determining the port with less traffic in the historical time period as the target port from the multiple ports based on the historical traffic data corresponding to each port in the first implementation manner. For details, refer to related contents in the embodiments of the present application, which will not be described here.
[0192] In some embodiments, before the implementation of determining the target port from the multiple ports by the second implementation manner, the network device can perform the step of determining the target port from the multiple ports by the second implementation manner only when the multiple ports include at least one sleep port and at least one full-bandwidth port, and the at least one sleep port is not woken up in the target time period. The full-bandwidth port is a port that is not configured with sleep bandwidth in the historical time period. The sleep port is a port that is configured with sleep bandwidth and sleep period in the historical time period and is not woken up. The target time period includes the historical time period, and the length of the target time period is greater than or equal to the length of the historical time period.
[0193] The multiple ports including at least one sleep port and at least one full-bandwidth port means that a part of the multiple ports are sleep ports, and another part of the multiple ports are full-bandwidth ports. There is no wake-up port in the multiple ports.
[0194] If the multiple ports include at least one sleep port and at least one full-bandwidth port, and the at least one sleep port is not woken up in the target time period, it indicates that the sleep bandwidth and sleep period configured for the sleep port in the historical time period meet the actual traffic transmission requirements, and there is also a port in the network device that is not configured with sleep bandwidth. Therefore, the port with less traffic in the historical time period can be determined from the full-bandwidth ports as the target port.
[0195] It should be noted that if the multiple ports include at least one sleep port and at least one full-bandwidth port, and the at least one sleep port is not woken up in the target time period, in addition to determining the port with less traffic in the historical time period from the full-bandwidth ports as the target port, the sleep period and sleep bandwidth corresponding to each sleep port in the multiple ports can also be determined based on the historical traffic data corresponding to each sleep port in the multiple ports. Whether the sleep port in the multiple ports can be configured with lower sleep bandwidth is determined, so as to further reduce the energy consumption of the sleep port.
[0196] The third implementation manner directly determines the sleep port in the multiple ports as the target port.
[0197] In some embodiments, before the step of determining the target port from the plurality of ports by the third implementation, the network device can perform the step of determining the target port from the plurality of ports by the third implementation only when all the plurality of ports are dormant ports and none of the dormant ports are woken up in a target time period, the dormant port being a port configured with a dormant bandwidth and a dormant period in a history time period and not woken up, the target time period including the history time period and having a length greater than or equal to that of the history time period.
[0198] If all the plurality of ports are dormant ports and none of the dormant ports are woken up in the target time period, it indicates that the dormant bandwidth and the dormant period configured for the dormant ports in the history time period meet the actual traffic transmission requirements, and there is no port in the network device that is not configured with a dormant bandwidth. Therefore, the dormant ports in the plurality of ports can be directly determined as the target ports to determine whether the dormant ports in the plurality of ports can be configured with a lower dormant bandwidth to further reduce the energy consumption of the plurality of ports.
[0199] In the embodiments of the present application, by analyzing the historical traffic data of the first port, it is determined that the first port will be in a low traffic or zero traffic state within a specific time period (i.e. the first sleep period), and thus the bandwidth of the first port is adjusted to the first sleep bandwidth. This method can significantly reduce power consumption and hardware resource occupation during off-peak periods, thereby achieving the purpose of energy saving and consumption reduction. Moreover, by automatically adjusting the bandwidth of the port, more bandwidth resources can be released to the port with high traffic demand, thereby improving the transmission efficiency and response speed of the entire network. That is, the embodiments of the present application can automatically adjust the bandwidth configuration of the port based on historical traffic data analysis and prediction to adapt to the changing network environment and business needs. This flexibility and adaptability helps to reduce the cost and complexity of manual intervention, while improving the intelligent level of the system, and can also reduce unnecessary bandwidth allocation and power consumption. The embodiments of the present application do not need to count the traffic by CPU, but count the traffic flowing through the first port by NP, and CPU only needs to obtain historical traffic data from shared memory, so as to effectively reduce the task pressure of CPU, and since the statistical period of NP is less than or equal to 100 milliseconds, the high-frequency traffic statistics can be realized, thereby ensuring that the historical traffic data can accurately and comprehensively reflect the traffic characteristics of the first port in the historical time period. The embodiments of the present application can also monitor the ports configured with sleep bandwidth to determine whether the corresponding port triggers the wake-up condition, i.e. whether the sleep bandwidth corresponding to the corresponding port can meet the actual traffic transmission demand. In the case where the sleep bandwidth does not meet the actual traffic transmission demand, the bandwidth of all ports configured with sleep bandwidth is adjusted to the corresponding maximum bandwidth, or the bandwidth of the port triggering the wake-up condition is adjusted to the corresponding maximum bandwidth, so as to realize dynamic adjustment of the sleep / wake-up state of the port, and enhance the flexibility and adaptability of the network device. In the case of burst traffic, the port can be quickly awakened by the wake-up mechanism to cope with the additional traffic demand, thereby preventing network congestion or interruption, and improving the stability and reliability of the network.
[0200] FIG. 8 is a structural schematic diagram of a port energy-saving device provided by an embodiment of the present application. The port energy-saving device can be realized by software, hardware or a combination of both as part or all of a network device. Referring to FIG. 8, the device comprises a first determination module 801 and a first adjustment module 802.
[0201] The first determination module 801 is configured to determine, based on historical traffic data of a first port included in a network device, a first sleep bandwidth of the first port and a first sleep period corresponding to the first sleep bandwidth, the historical traffic data representing traffic characteristics of the first port in a historical time period, and the first sleep bandwidth being less than a maximum bandwidth of the first port. For detailed implementation process, reference can be made to the corresponding content in the above embodiments, which will not be described here again.
[0202] The first adjusting module 802 is configured to adjust the bandwidth of the first port to a first sleep bandwidth in a first sleep period. For details, refer to the corresponding content in the above embodiments, which will not be described here again.
[0203] In a possible implementation, the historical traffic data includes first traffic data corresponding to a first time point;
[0204] The first determining module 801 is specifically configured to:
[0205] determine, based on the first traffic data corresponding to the first time point, a first sleep gear corresponding to the first time point from the at least one sleep gear;
[0206] determine, from the correspondence between the at least one sleep gear and the sleep bandwidth, a sleep bandwidth corresponding to the first sleep gear as the first sleep bandwidth;
[0207] obtain the first sleep period based on the first time point.
[0208] In a possible implementation, the historical traffic data includes first traffic data corresponding to a first time point and second traffic data corresponding to a second time point;
[0209] The first determining module 801 is specifically configured to:
[0210] determine, based on the first traffic data corresponding to the first time point and the second traffic data corresponding to the second time point, a first sleep gear corresponding to the first time point and a second sleep gear corresponding to the second time point from the at least one sleep gear;
[0211] determine, from the correspondence between the at least one sleep gear and the sleep bandwidth, a sleep bandwidth corresponding to a larger gear between the first sleep gear and the second sleep gear as the first sleep bandwidth;
[0212] obtain the first sleep period based on the first time point and the second time point.
[0213] In a possible implementation, the historical traffic data includes first traffic data corresponding to a first time point and second traffic data corresponding to a second time point;
[0214] The first determining module 801 is specifically configured to:
[0215] determine, based on the first traffic data corresponding to the first time point and the second traffic data corresponding to the second time point, a first sleep gear corresponding to the first time point and a second sleep gear corresponding to the second time point from the at least one sleep gear, the first sleep gear being the same as the second sleep gear;
[0216] determine, from the correspondence between the at least one sleep gear and the sleep bandwidth, the sleep bandwidth corresponding to the first sleep gear or the second sleep gear as the first sleep bandwidth;
[0217] obtain the first sleep period based on the first time and the second time.
[0218] In a possible implementation, the apparatus further includes a second adjusting module, the second adjusting module including a determining unit and a first adjusting unit;
[0219] The determining unit is configured to determine, based on traffic data of a second port included in the network device in a current time period, that the second port satisfies a wake-up condition, the wake-up condition representing that the second port does not satisfy a transmission requirement of traffic in the current time period in a sleep bandwidth corresponding to a second sleep period, the current time period being a time period included in the second sleep period.
[0220] The first adjusting unit is configured to adjust the bandwidth of the second port to a maximum bandwidth.
[0221] In a possible implementation, the apparatus further includes a third adjusting module, the third adjusting module including a determining unit and a second adjusting unit;
[0222] The determining unit is configured to determine, based on traffic data of a second port included in the network device in a current time period, that the second port satisfies a wake-up condition, the wake-up condition representing that the second port does not satisfy a transmission requirement of traffic in the current time period in a sleep bandwidth corresponding to a second sleep period, the current time period being a time period included in the second sleep period.
[0223] The second adjusting unit is configured to adjust the bandwidth of a port included in the network device and configured with the sleep bandwidth to a maximum bandwidth corresponding to the port.
[0224] In a possible implementation, the determining unit is specifically configured to:
[0225] determine, based on the traffic data of the second port in the current time period, a traffic feature value of the second port, the traffic feature value representing a traffic feature of the second port in the current time period;
[0226] if the traffic feature value of the second port is greater than or equal to a traffic feature value threshold corresponding to the second sleep period, determine that the second port satisfies the wake-up condition.
[0227] In a possible implementation, the network device includes a network processor (NP), the NP being configured to process traffic flowing through a plurality of ports, the first port being one of target ports, the target ports being the plurality of ports whose bandwidths are to be adjusted;
[0228] The apparatus further includes:
[0229] The second determining module is configured to determine the target port from the plurality of ports.
[0230] In a possible implementation, the second determining module is specifically configured to:
[0231] If there is a wake-up port in the plurality of ports, the step of determining the target port from the plurality of ports is performed, the wake-up port being a port that has been woken up in the historical time period; or
[0232] If all the plurality of ports are full-bandwidth ports, the step of determining the target port from the plurality of ports is performed, the full-bandwidth port being a port that has not been configured with a sleep bandwidth in the historical time period; or
[0233] If there is a third port in the plurality of ports, the step of determining the target port from the plurality of ports is performed, the third port being a wake-up port and corresponding to a historical traffic feature value threshold and a historical sleep bandwidth in the historical time period, the historical traffic feature value threshold being a traffic feature value threshold corresponding to the third port when woken up, the historical traffic feature value threshold being a maximum value in at least one traffic feature value threshold corresponding to the historical sleep bandwidth, and a larger traffic feature value threshold indicating a larger traffic of the port.
[0234] In a possible implementation, the second determining module is specifically configured to:
[0235] Obtain historical traffic data corresponding to the plurality of ports respectively;
[0236] Determine, based on the historical traffic data corresponding to the plurality of ports respectively, a port with smaller traffic in the historical time period as the target port from the plurality of ports.
[0237] In a possible implementation, the second determining module is specifically configured to:
[0238] If the plurality of ports include at least one sleep port and at least one full-bandwidth port, and the at least one sleep port has not been woken up in a target time period, the step of determining the target port from the plurality of ports is performed, the full-bandwidth port being a port that has not been configured with a sleep bandwidth in the historical time period, the sleep port being a port that has been configured with a sleep bandwidth and a sleep time period in the historical time period and has not been woken up, and the target time period including the historical time period and having a time length greater than or equal to that of the historical time period.
[0239] In a possible implementation, the second determining module is specifically configured to:
[0240] Obtain historical traffic data corresponding to the full-bandwidth ports in the plurality of ports respectively, the full-bandwidth port being a port that has not been configured with a sleep bandwidth in the historical time period;
[0241] The port with less traffic in the history time period is determined as the target port from the full bandwidth ports based on historical traffic data corresponding to each full bandwidth port.
[0242] In a possible implementation, the second determining module is specifically configured to:
[0243] If the plurality of ports are all dormant ports and the dormant ports are not all woken up in the target time period, the step of determining the target port from the plurality of ports is performed, the dormant port is a port configured with a dormant bandwidth and a dormant time period in the history time period and not woken up, and the target time period includes the history time period and a length of the target time period is greater than or equal to a length of the history time period.
[0244] In a possible implementation, the second determining module is specifically configured to:
[0245] The dormant port in the plurality of ports is determined as the target port.
[0246] In the embodiments of the present application, by analyzing the historical traffic data of the first port, it is determined that the first port will be in a low traffic or zero traffic state within a specific time period (i.e. the first dormant period), and then the bandwidth of the first port is adjusted to the first dormant bandwidth. This method can significantly reduce power consumption and hardware resource occupation during off-peak periods, thereby achieving the purpose of energy saving and consumption reduction. Moreover, by automatically adjusting the bandwidth of the port, more bandwidth resources can be released to the port with high traffic demand, thereby improving the transmission efficiency and response speed of the entire network. That is, the embodiments of the present application can automatically adjust the bandwidth configuration of the port based on historical traffic data analysis and prediction to adapt to the changing network environment and business needs. This flexibility and adaptability helps to reduce the cost and complexity of manual intervention, while improving the intelligent level of the system, and can also reduce unnecessary bandwidth allocation and power consumption. The embodiments of the present application do not need to count the traffic by CPU, but count the traffic flowing through the first port by NP, and CPU only needs to obtain historical traffic data from shared memory. In this way, the task pressure of CPU can be effectively reduced, and since the NP statistical period is less than or equal to 100 milliseconds, high-frequency traffic statistics can be achieved, thereby ensuring that the historical traffic data can accurately and comprehensively reflect the traffic characteristics of the first port in the historical time period. The embodiments of the present application can also monitor the ports configured with the dormant bandwidth to determine whether the corresponding port triggers the wake-up condition, i.e. whether the dormant bandwidth corresponding to the corresponding port can meet the actual traffic transmission demand. In the case where the dormant bandwidth does not meet the actual traffic transmission demand, the bandwidth of all ports configured with the dormant bandwidth is adjusted to the corresponding maximum bandwidth, or the bandwidth of the port triggering the wake-up condition is adjusted to the corresponding maximum bandwidth. In this way, the dormant / wake-up state of the port can be dynamically adjusted, and the flexibility and adaptability of the network device are enhanced. In the case of burst traffic, the port can be quickly awakened by the wake-up mechanism to cope with the additional traffic demand, preventing network congestion or interruption, thereby improving the stability and reliability of the network.
[0247] It should be noted that the port energy-saving device provided in the above embodiments only divides the above functions into different functional modules for example, and in actual application, the above functions can be completed by different functional modules according to needs, i.e. the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the port energy-saving device and the port energy-saving method provided in the above embodiments belong to the same concept, and the specific implementation process is described in detail in the method embodiments, which will not be repeated here.
[0248] The embodiment of the present application further provides a computer readable storage medium, wherein instructions are stored in the storage medium, and when the instructions are executed on a computer or a processor, the computer or the processor performs the steps of the port energy saving method in the above embodiment.
[0249] The embodiment of the present application further provides a computer program product containing instructions, and when the instructions are executed on a computer or a processor, the computer or the processor performs the steps of the port energy saving method in the above embodiment. Alternatively, a computer program is provided, and when the computer program is executed on a computer or a processor, the computer or the processor performs the steps of the port energy saving method in the above embodiment.
[0250] In the above embodiment, the implementation can be achieved by software, hardware, firmware or any combination thereof, entirely or partially. When the implementation is achieved by software, the implementation can be achieved in the form of a computer program product, entirely or partially. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the implementation produces the flow or function described in the embodiment of the present application, entirely or partially. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transferred from one website, computer, server or data center to another website, computer, server or data center through a wired (for example: coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (for example: infrared, wireless, microwave, etc.) manner. The computer readable storage medium can be any available medium that can be accessed by a computer, or a data storage device such as a server, data center, etc. integrated with one or more available media. The available medium can be a magnetic medium (for example: floppy disk, hard disk, magnetic tape), an optical medium (for example: digital versatile disc (DVD)) or a semiconductor medium (for example: solid state disk (SSD)) and the like. It is worth noting that the computer readable storage medium mentioned in the embodiment of the present application can be a non-volatile storage medium, in other words, it can be a non-transitory storage medium.
[0251] It should be understood that the "multiple" mentioned herein refers to two or more. In the description of the embodiments of the present application, unless otherwise specified, " / " represents the meaning of or, for example, A / B can represent A or B; "and / or" herein only describes the relationship between the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent: A exists alone, A and B exist together, and B exists alone. In addition, in order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, the same items or similar items with basically the same functions and effects are distinguished by using "first", "second" and the like. The skilled in the art can understand that "first", "second" and the like do not limit the quantity and execution order, and "first", "second" and the like do not necessarily mean different.
[0252] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data for analysis, stored data, displayed data, etc.) and signals involved in the embodiments of the present application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions. For example, the historical traffic data involved in the embodiments of the present application is obtained under sufficient authorization.
[0253] The above describes the embodiments provided by the present application, and does not limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method of port energy saving, characterized by, The method is applied to a network device, and comprises: determining, based on historical traffic data of a first port included in the network device, a first dormant bandwidth of the first port and a first dormant period corresponding to the first dormant bandwidth, the historical traffic data representing traffic characteristics of the first port in a historical period, the first dormant bandwidth being less than a maximum bandwidth of the first port; adjusting, in the first dormant period, the bandwidth of the first port to the first dormant bandwidth.
2. The method of claim 1, wherein, The historical traffic data comprises first traffic data corresponding to a first time point; The method further comprises: determining, based on the first traffic data corresponding to the first time point, a first dormant gear corresponding to the first time point from at least one dormant gear; determining, from a correspondence between the at least one dormant gear and a dormant bandwidth, a dormant bandwidth corresponding to the first dormant gear as the first dormant bandwidth; determining, based on the first time point, the first dormant period.
3. The method of claim 1, wherein, The historical traffic data comprises first traffic data corresponding to a first time point and second traffic data corresponding to a second time point; The method further comprises: determining, based on the first traffic data corresponding to the first time point and the second traffic data corresponding to the second time point, a first dormant gear corresponding to the first time point and a second dormant gear corresponding to the second time point from at least one dormant gear; determining, from a correspondence between the at least one dormant gear and a dormant bandwidth, a dormant bandwidth corresponding to a larger gear between the first dormant gear and the second dormant gear as the first dormant bandwidth; determining, based on the first time point and the second time point, the first dormant period.
4. The method of claim 1, wherein, The historical traffic data comprises first traffic data corresponding to a first time point and second traffic data corresponding to a second time point; The method further comprises: determining, based on the first traffic data corresponding to the first time point and the second traffic data corresponding to the second time point, a first dormant gear corresponding to the first time point and a second dormant gear corresponding to the second time point from at least one dormant gear, the first dormant gear being the same as the second dormant gear; determining, from a correspondence between the at least one dormant gear and a dormant bandwidth, a dormant bandwidth corresponding to the first dormant gear or the second dormant gear as the first dormant bandwidth; determining, based on the first time point and the second time point, the first dormant period.
5. The method according to any one of claims 1 to 4, characterized in that, The method further comprises: determining, based on traffic data of a second port included in the network device in a current time period, that the second port satisfies a wake-up condition, the wake-up condition representing that a sleep bandwidth corresponding to a second sleep time period of the second port does not satisfy a transmission requirement of traffic in the current time period, and adjusting a bandwidth of the second port to a maximum bandwidth.
6. The method according to any one of claims 1 to 5, characterized in that, The method further comprises: determining, based on traffic data of a second port included in the network device in a current time period, that the second port satisfies a wake-up condition, the wake-up condition representing that a sleep bandwidth corresponding to a second sleep time period of the second port does not satisfy a transmission requirement of traffic in the current time period, and adjusting a bandwidth of the second port to a maximum bandwidth.
7. The method of claim 5 or 6, wherein, The method further comprises: determining, based on traffic data of a second port included in the network device in a current time period, that the second port satisfies a wake-up condition, the wake-up condition representing that a sleep bandwidth corresponding to a second sleep time period of the second port does not satisfy a transmission requirement of traffic in the current time period, and adjusting a bandwidth of the second port to a maximum bandwidth. The method further comprises:
8. The method according to any one of claims 1 to 7, characterized in that, determining, based on traffic data of a second port included in the network device in a current time period, that the second port satisfies a wake-up condition, the wake-up condition representing that a sleep bandwidth corresponding to a second sleep time period of the second port does not satisfy a transmission requirement of traffic in the current time period, and adjusting a bandwidth of the second port to a maximum bandwidth. determining a traffic feature value of the second port based on the traffic data of the second port in the current time period, the traffic feature value representing a traffic characteristic of the second port in the current time period; if the traffic feature value of the second port is greater than or equal to a traffic feature value threshold corresponding to the second sleep time period, determining that the second port satisfies the wake-up condition.
9. The method of claim 8, wherein, The network device includes a network processor (NP), and the NP is configured to process traffic flowing through a plurality of ports, the first port being one of target ports, the target ports being ports of the plurality of ports for which bandwidths are to be adjusted; The method further comprises, before determining the first sleep bandwidth of the first port and a first sleep time period corresponding to the first sleep bandwidth based on historical traffic data of the first port included in the network device: determining the target ports from the plurality of ports. The method further comprises, before determining the target ports from the plurality of ports:
10. The method of claim 8 or 9, wherein, if there is a wake-up port in the plurality of ports, performing the step of determining the target ports from the plurality of ports, the wake-up port being a port that has been woken up in the historical time period; or if all the plurality of ports are full-bandwidth ports, performing the step of determining the target ports from the plurality of ports, the full-bandwidth port being a port that has not been configured with a sleep bandwidth in the historical time period; or if there is a third port in the plurality of ports, performing the step of determining the target ports from the plurality of ports, the third port being the wake-up port and corresponding to a historical traffic feature value threshold and a historical sleep bandwidth in the historical time period, the historical traffic feature value threshold being a traffic feature value threshold corresponding to the third port when the third port is woken up, the historical traffic feature value threshold being a maximum value of at least one traffic feature value threshold corresponding to the historical sleep bandwidth, the larger the traffic feature value threshold, the larger the traffic of the port. The method further comprises, before determining the target ports from the plurality of ports: acquire historical traffic data corresponding to the plurality of ports respectively; determine a port with less traffic in the historical time period as the target port from the plurality of ports based on the historical traffic data corresponding to the plurality of ports respectively.
11. The method of claim 8 or 9, wherein, Before the step of determining the target port from the plurality of ports, the method further comprises: if the plurality of ports include at least one dormant port and at least one full-bandwidth port, and the at least one dormant port is not woken up in a target time period, then the step of determining the target port from the plurality of ports is performed, the full-bandwidth port is a port without sleep bandwidth configured in the historical time period, the dormant port is a port with sleep bandwidth and sleep period configured in the historical time period and not woken up, and the target time period includes the historical time period and has a length greater than or equal to that of the historical time period.
12. The method of claim 8 or 9, wherein, The step of determining the target port from the plurality of ports comprises: acquiring historical traffic data corresponding to full-bandwidth ports in the plurality of ports respectively, the full-bandwidth port being a port without sleep bandwidth configured in the historical time period; determining a port with less traffic in the historical time period as the target port from the full-bandwidth ports based on the historical traffic data corresponding to the full-bandwidth ports respectively.
13. The method of claim 8, wherein, Before the step of determining the target port from the plurality of ports, the method further comprises: if the plurality of ports are all dormant ports and the dormant ports are not woken up in a target time period, then the step of determining the target port from the plurality of ports is performed, the dormant port being a port with sleep bandwidth and sleep period configured in the historical time period and not woken up, and the target time period including the historical time period and having a length greater than or equal to that of the historical time period.
14. The method of claim 11 or 13, wherein, The step of determining the target port from the plurality of ports comprises: determining a dormant port in the plurality of ports as the target port.
15. A port energy saving device, characterized by, The apparatus is applied to a network device, and the apparatus comprises: a first determination module configured to determine a first sleep bandwidth of a first port included in the network device and a first sleep period corresponding to the first sleep bandwidth based on historical traffic data of the first port, the historical traffic data representing traffic characteristics of the first port in a historical time period, and the first sleep bandwidth being less than a maximum bandwidth of the first port; a first adjustment module configured to adjust the bandwidth of the first port to the first sleep bandwidth in the first sleep period.
16. The apparatus of claim 15, wherein, The historical traffic data includes first traffic data corresponding to a first time point; The first determination module is specifically configured to: determine a first sleep gear corresponding to the first time point from at least one sleep gear based on the first traffic data corresponding to the first time point; determine a sleep bandwidth corresponding to the first sleep gear as the first sleep bandwidth from a correspondence between the at least one sleep gear and sleep bandwidth; acquire the first sleep period based on the first time point.
17. The apparatus of claim 15, wherein, The historical traffic data includes first traffic data corresponding to a first time point and second traffic data corresponding to a second time point; The first determining module is specifically used for: determining, based on the first traffic data corresponding to the first time and the second traffic data corresponding to the second time, a first sleep gear corresponding to the first time and a second sleep gear corresponding to the second time from at least one sleep gear; determining, from a correspondence between the at least one sleep gear and a sleep bandwidth, a sleep bandwidth corresponding to a larger gear of the first sleep gear and the second sleep gear as the first sleep bandwidth; acquiring the first sleep time period based on the first time and the second time.
18. The apparatus of claim 15, wherein, The historical traffic data includes first traffic data corresponding to a first time and second traffic data corresponding to a second time. The first determining module is specifically used for: determining, based on the first traffic data corresponding to the first time and the second traffic data corresponding to the second time, a first sleep gear corresponding to the first time and a second sleep gear corresponding to the second time from at least one sleep gear, the first sleep gear being the same as the second sleep gear; determining, from a correspondence between the at least one sleep gear and a sleep bandwidth, a sleep bandwidth corresponding to the first sleep gear or the second sleep gear as the first sleep bandwidth; acquiring the first sleep time period based on the first time and the second time.
19. The apparatus of any one of claims 15 to 18, wherein, The apparatus further includes a second adjusting module, which includes a determining unit and a first adjusting unit. The determining unit is configured to determine, based on traffic data of a second port included in the network device in a current time period, that the second port satisfies a wake-up condition, the wake-up condition indicating that a sleep bandwidth corresponding to a second sleep time period does not meet a transmission requirement of traffic in the current time period, the current time period being a time period included in the second sleep time period. The first adjusting unit is configured to adjust a bandwidth of the second port to a maximum bandwidth.
20. The apparatus of any one of claims 15 to 19, wherein, The apparatus further includes a third adjusting module, which includes a determining unit and a second adjusting unit. The determining unit is configured to determine, based on traffic data of a second port included in the network device in a current time period, that the second port satisfies a wake-up condition, the wake-up condition indicating that a sleep bandwidth corresponding to a second sleep time period does not meet a transmission requirement of traffic in the current time period, the current time period being a time period included in the second sleep time period. The second adjusting unit is configured to adjust a bandwidth of a port included in the network device and configured with a sleep bandwidth to a maximum bandwidth corresponding to the port.
21. The apparatus of claim 19 or 20, wherein, The determining unit is specifically used for: determining, based on the traffic data of the second port in the current time period, a traffic feature value of the second port, the traffic feature value indicating a traffic feature of the second port in the current time period; if the traffic feature value of the second port is greater than or equal to a traffic feature value threshold corresponding to the second sleep time period, determining that the second port satisfies the wake-up condition.
22. The apparatus of any one of claims 15 to 21, wherein, The network device comprises a network processor (NP) configured to process traffic flowing through a plurality of ports, the first port being one of target ports, the target ports being ports of the plurality of ports to be adjusted in bandwidth; The device further comprises: A second determining module configured to determine the target ports from the plurality of ports.
23. The apparatus of claim 22, wherein, The second determining module is specifically configured to: If there is a wake-up port in the plurality of ports, the step of determining the target ports from the plurality of ports is performed, the wake-up port being a port that has been woken up in the historical time period; Or, If all the plurality of ports are full-bandwidth ports, the step of determining the target ports from the plurality of ports is performed, the full-bandwidth port being a port that has not been configured with a sleep bandwidth in the historical time period; Or, If there is a third port in the plurality of ports, the step of determining the target ports from the plurality of ports is performed, the third port being the wake-up port and corresponding to a historical traffic feature value threshold and a historical sleep bandwidth in the historical time period, the historical traffic feature value threshold being a traffic feature value threshold corresponding to the third port when woken up, the historical traffic feature value threshold being a maximum value in at least one traffic feature value threshold corresponding to the historical sleep bandwidth, the larger the traffic feature value threshold, the larger the traffic of the port.
24. The apparatus of claim 22 or 23, wherein, The second determining module is specifically configured to: Obtain historical traffic data corresponding to the plurality of ports respectively; Determine, based on the historical traffic data corresponding to the plurality of ports respectively, a port with smaller traffic in the historical time period as the target port from the plurality of ports.
25. The apparatus of claim 22 or 23, wherein, The second determining module is specifically configured to: If the plurality of ports include at least one sleep port and at least one full-bandwidth port, and the at least one sleep port has not been woken up in a target time period, the step of determining the target ports from the plurality of ports is performed, the full-bandwidth port being a port that has not been configured with a sleep bandwidth in the historical time period, the sleep port being a port that has been configured with a sleep bandwidth and a sleep period in the historical time period and has not been woken up, the target time period including the historical time period and having a time length greater than or equal to that of the historical time period.
26. The apparatus of claim 22 or 23, wherein, The second determining module is specifically configured to: Obtain historical traffic data corresponding to the full-bandwidth ports in the plurality of ports respectively, the full-bandwidth port being a port that has not been configured with a sleep bandwidth in the historical time period; Determine, based on the historical traffic data corresponding to the full-bandwidth ports respectively, a port with smaller traffic in the historical time period as the target port from the full-bandwidth ports.
27. The apparatus of claim 22, wherein, The second determining module is specifically configured to: If the plurality of ports are all dormant ports and the dormant ports are not all woken up in a target time period, a step of determining the target port from the plurality of ports is performed, the dormant ports being ports configured with a dormant bandwidth and a dormant period in the history time period and not woken up, the target time period including the history time period and a length of the target time period being greater than or equal to a length of the history time period.
28. The apparatus of claim 25 or 27, wherein, The second determining module is specifically configured to: determine a dormant port in the plurality of ports as the target port.
29. A network device, comprising: The network device includes a memory and a processor; The memory is configured to store a computer program; The processor is configured to execute the computer program to implement steps of the method in any one of claims 1 to 14.
30. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, when the computer program runs on a computer or a processor, causes the computer or the processor to execute the method in any one of claims 1 to 14.
31. A computer program product, characterised in that, The computer program product includes computer instructions, when the computer instructions are executed by a computer or a processor, causes steps of the method in any one of claims 1 to 14 to be executed.
Citation Information
Patent Citations
Logical port energy-saving realization method and device and system thereof
CN101834758A
Cell dormancy control method and electronic equipment
CN114449549A
Method and device for adjusting operation state of network equipment and related equipment
CN116668209A
Method and device for controlling dormancy of network equipment, network equipment and storage medium
CN116744410A
Network equipment energy consumption control method and device, equipment and storage medium
CN117812683A