Switch bandwidth adjusting method based on content distribution network and related device
By using PID algorithm to adjust the bandwidth of the switch in the content distribution network, the problem of inflexible adjustment methods in the prior art is solved, and faster and more effective bandwidth adjustment is achieved.
Patent Information
- Application Number
- CN202411766319.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-03-07
AI Technical Summary
The method of adjusting the switch bandwidth in the prior art is not flexible enough to meet the actual bandwidth adjustment requirements of the switch, resulting in poor adjustment results.
The switch bandwidth adjustment method based on the content distribution network is adopted, and the PID algorithm is used to determine the reduction ratio based on the actual bandwidth of the switch and the bandwidth threshold, and the actual bandwidth of the switch is flexibly adjusted.
It realizes a more flexible determination of the reduction ratio based on the operation of the switch, avoiding the rigid adjustment method caused by the fixed reduction ratio, and improving the adjustment speed and effect of the actual bandwidth of the switch.
Smart Images

Figure CN119583477A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of switch control, and in particular to a method, device, equipment and storage medium for adjusting switch bandwidth based on a content distribution network. Background Art
[0002] Content Delivery Network (CDN) is a network service designed to improve the loading speed and performance of websites or applications by caching content on servers closer to users. CDN includes multiple edge nodes. Edge nodes store copies of static and dynamic content from the source station so that when users request these contents through clients, they can be quickly served from the nearest edge node without having to obtain them from the source station every time, thereby reducing data transmission latency and bandwidth consumption.
[0003] The user's client and edge node are usually connected through a switch. The switch supports high-density network connections and traffic management. The bandwidth of the switch is limited. The bandwidth threshold is set for the switch in advance, and the actual bandwidth of the switch is detected. If the actual bandwidth of the switch exceeds the bandwidth threshold, the actual bandwidth of the switch is controlled to be reduced to avoid the actual bandwidth of the switch being too large, which affects the normal operation of the switch and network performance.
[0004] Currently, in CDN, the method of adjusting the switch bandwidth is not flexible enough and there is a problem that it cannot meet the demand for adjusting the actual bandwidth. Summary of the invention
[0005] In view of this, the present application provides a CDN-based switch bandwidth adjustment method, apparatus, device and storage medium, which can flexibly adjust the actual bandwidth of the switch in the CDN to meet the adjustment requirements of the actual bandwidth of the switch.
[0006] The technical solutions provided by this application are as follows:
[0007] In a first aspect, the present application provides a method for adjusting switch bandwidth based on a content distribution network, the method being applied to a control device included in the content distribution network, the control device being connected to a switch and an edge node, the switch being connected to the edge node and a client, respectively, the method comprising:
[0008] Get the actual bandwidth of the switch;
[0009] If it is determined that the actual bandwidth of the switch is greater than the bandwidth threshold, a proportional-integral-differential (PID) algorithm is used to determine a reduction ratio according to the actual bandwidth of the switch and the bandwidth threshold;
[0010] Using the reduction ratio, the actual bandwidth of the switch is adjusted
[0011] In a second aspect, the present application provides a switch bandwidth adjustment device based on a content distribution network, the device is applied to a control device included in the content distribution network, the control device is connected to a switch and an edge node, the switch is respectively connected to the edge node and the client, and the device includes:
[0012] A first acquisition unit, used to acquire the actual bandwidth of the switch;
[0013] A first determining unit is configured to determine a reduction ratio according to the actual bandwidth of the switch and the bandwidth threshold by using a proportional-integral-differential (PID) algorithm if it is determined that the actual bandwidth of the switch is greater than the bandwidth threshold;
[0014] The adjusting unit is used to adjust the actual bandwidth of the switch by using the reduction ratio.
[0015] In a third aspect, the present application provides an electronic device, including:
[0016] one or more processors;
[0017] A storage device having one or more programs stored thereon, when the one or more programs are executed by the one or more processors, the one or more processors implement any method as described in the first aspect.
[0018] In a fourth aspect, the present application provides a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method described in any one of the first aspects is implemented.
[0019] It can be seen that this application has the following beneficial effects:
[0020] The present application provides a switch bandwidth adjustment method, device, equipment and storage medium based on CDN. In this method, a control device obtains the actual bandwidth of a switch in the CDN, and compares the actual bandwidth of the switch with a bandwidth threshold. If it is determined that the actual bandwidth of the switch is greater than the bandwidth threshold, it means that the actual bandwidth of the switch is too high and needs to be adjusted down. The control device uses a PID algorithm to process the actual bandwidth and bandwidth threshold of the switch to obtain a reduction ratio. The PID algorithm can be used to adjust the actual bandwidth of the switch so that the actual bandwidth of the switch reaches the bandwidth threshold. In this way, it is possible to more flexibly determine the reduction ratio according to the operating conditions of the switch in the current CDN, avoiding the problem of rigid adjustment methods caused by the use of a fixed reduction ratio. The reduction ratio determined by the PID algorithm meets the requirements of the actual bandwidth adjustment of the switch, and can obtain a better adjustment effect of the actual bandwidth of the switch. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 A schematic diagram of the structure of a CDN provided in an embodiment of the present application;
[0022] Figure 2 A schematic diagram of a framework of an exemplary application scenario provided in an embodiment of the present application;
[0023] Figure 3 A flow chart of a CDN-based switch bandwidth adjustment method provided in an embodiment of the present application;
[0024] Figure 4 A flow chart of a method for determining a reduction ratio provided in an embodiment of the present application;
[0025] Figure 5 A schematic diagram of using a PID algorithm to adjust the actual bandwidth of a switch provided in an embodiment of the present application;
[0026] Figure 6 A flowchart of another switch bandwidth adjustment method provided in an embodiment of the present application;
[0027] Figure 7 A schematic diagram of the structure of a CDN-based switch bandwidth adjustment device provided in an embodiment of the present application;
[0028] Figure 8 A schematic diagram of the basic structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] In order to facilitate the understanding and explanation of the technical solutions provided by the embodiments of the present application, the background technology of the present application will be described below.
[0030] CDN mainly includes the source station and multiple edge nodes. The source station is a server that stores original content, such as a server for a website or application. The source station is used to generate or store content that needs to be distributed to the client. The edge node is a server that is closer to the user. The edge node caches the content that needs to be distributed stored in the source station. When a user requests content through the client, the CDN will select the best edge node based on the user's geographic location and other factors through the Domain Name System (DNS) resolution service, and redirect the request to the nearest edge node. The edge node can quickly respond to the user's request and provide content.
[0031] See also Figure 1As shown, this figure is a schematic diagram of the structure of a CDN provided by an embodiment of the present application. The source station is connected to the edge node. The edge node and the client are connected through a switch. The switch ensures that the data packet can be transmitted quickly and accurately in the CDN, and supports fast content distribution and high availability through efficient data packet forwarding and traffic management. The following takes a client request as an example to illustrate the interaction process between the client, the switch and the edge node. The user initiates a request on the client device, such as requesting to access a web page. The client first performs a DNS query to resolve the requested domain name to the corresponding Internet Protocol (IP) address. DNS resolution redirects the client to the edge node of the CDN. This edge node is usually geographically closest to the user. The client's request is routed to the nearest edge node through the switch. The switch forwards the request according to the routing table and traffic management policy. After receiving the request, the edge node will check whether there is the requested content in the local cache. If so, the edge node provides the content to the client from the local cache. If there is no requested content in the local cache of the edge node, the edge node will initiate a request to the source station to obtain the content. After receiving the request from the edge node, the source station will provide the required content to the edge node. After receiving the content from the origin, the edge node caches it in local storage so that future requests can be directly obtained from the cache. The edge node sends the content back to the client. Since the edge node is usually closer to the client than the origin, this process of client-edge node interaction can reduce latency. After the client receives the content, it starts rendering the web page. During the interaction, the edge node and the switch will record logs. The generated logs are used to analyze traffic patterns, optimize performance, and ensure security.
[0032] During the operation of CDN, the bandwidth of the switch will be limited to prevent the actual bandwidth of the switch from being too large, which will affect the normal operation of the switch and the network performance of CDN. Usually, a bandwidth threshold is set in advance. In addition, the actual bandwidth of the switch is detected. If the actual bandwidth of the switch is greater than the bandwidth threshold, the actual bandwidth of the switch is controlled to decrease. At present, a fixed reduction ratio is set in advance. For example, the reduction ratio is 10%, 20%, 40%, 80% and 100%. The reduction ratio is executed in order. When it is detected that the actual bandwidth of the switch is greater than the bandwidth threshold, the reduction strategy is first executed according to the reduction ratio of 10%. After the reduction strategy is executed according to the reduction ratio of 10%, the actual bandwidth of the switch is detected again. It can be understood that the execution of the reduction strategy can achieve a theoretical bandwidth reduction. The theoretical bandwidth reduction is not equivalent to the actual bandwidth reduction of the switch during the actual operation. If the actual bandwidth of the switch is still greater than the bandwidth threshold, the reduction strategy is executed according to the next reduction ratio of 10%, that is, 20%. After the reduction strategy is executed according to the reduction ratio of 20%, the actual bandwidth of the switch is detected again. If the actual bandwidth of the switch is still greater than the bandwidth threshold, the reduction strategy is executed according to the next reduction ratio of 20%, that is, 40%, and so on, until the actual bandwidth of the switch is less than the bandwidth threshold.
[0033] The above-mentioned method of adjusting the actual bandwidth of the switch by a fixed reduction ratio is relatively rigid and cannot meet the adjustment requirements of the actual bandwidth of the switch. For example, it may take multiple adjustments to reduce the actual bandwidth of the switch to below the bandwidth threshold, and there is a problem of slow reduction speed. For another example, the actual bandwidth of the switch may be adjusted too much, and the available bandwidth resources provided by the switch cannot be fully utilized. The method of adjusting the actual bandwidth of the switch by a fixed reduction ratio results in poor effect in adjusting the actual bandwidth of the switch.
[0034] Based on this, an embodiment of the present application provides a switch bandwidth adjustment method based on a content distribution network. The method is applied to a control device connecting edge nodes and switches in a CDN. The control device obtains the actual bandwidth of the switch and compares the actual bandwidth of the switch with the bandwidth threshold. If it is determined that the actual bandwidth of the switch is greater than the bandwidth threshold, it means that the actual bandwidth of the switch is too high and needs to be adjusted down. The control device uses the PID algorithm to process the actual bandwidth and bandwidth threshold of the switch to obtain a reduction ratio. The PID algorithm can be used to adjust the actual bandwidth of the switch so that the actual bandwidth of the switch reaches the bandwidth threshold. In this way, it is possible to more flexibly determine the reduction ratio according to the current operating conditions of the switch, avoid the problem of rigid adjustment methods caused by the use of a fixed reduction ratio, and the determined reduction ratio meets the actual bandwidth adjustment requirements of the switch, thereby achieving the speed of adjusting the actual bandwidth of the switch on the basis of reasonable use of the bandwidth resources of the switch.
[0035] In order to facilitate understanding of a method for adjusting the bandwidth of a switch based on a content distribution network provided in an embodiment of the present application, the following describes a method for adjusting the bandwidth of a switch based on a content distribution network provided in an embodiment of the present application in conjunction with the accompanying drawings. Figure 2 As shown, this figure is a framework diagram of an exemplary application scenario provided in an embodiment of the present application.
[0036] In the CDN, the control device 201 is connected to the switch 202 and the edge node 203 respectively. The switch 202 and the edge node 203 are connected to multiple clients 204. The multiple clients 204 send requests to the edge node 203 through the switch 202. The switch 202 and the edge node 203 record logs to analyze bandwidth.
[0037] The control device 201 supports log service. The control device 201 obtains the log of the switch from the switch 202. The log includes a timestamp and the amount of data requested. The log whose timestamp belongs to the bandwidth detection period is used as the target log. The amount of data requested by the target log is counted to obtain the actual bandwidth of the switch. The control device 201 determines the size relationship between the actual bandwidth of the switch and the bandwidth threshold. If the actual bandwidth of the switch is greater than the bandwidth threshold, it means that the actual bandwidth of the switch needs to be adjusted downward. The control device 201 uses the proportional-integral-derivative (PID) algorithm to process the actual bandwidth and bandwidth threshold of the switch to determine the reduction ratio. Using the PID algorithm, the reduction ratio can be determined more flexibly, and the reduction ratio suitable for the current actual bandwidth adjustment demand can be determined. By adjusting the actual bandwidth of the switch using the reduction ratio determined by the PID algorithm, the actual bandwidth of the switch can be flexibly adjusted based on actual needs to achieve effective bandwidth control.
[0038] To facilitate understanding of the technical solution provided by the embodiment of the present application, the switch bandwidth adjustment method based on the content distribution network provided by the embodiment of the present application is described below with reference to the accompanying drawings.
[0039] First of all, it should be noted that the switch bandwidth adjustment method based on the content distribution network provided in the embodiment of the present application can be applied to the control devices connected to the switch and the edge node in the CDN, for example Figure 2 The control device 201 shown in FIG. 201 can be an independent device or a functional module integrated in the system. The present application embodiment does not limit this.
[0040] See also Figure 3 As shown in FIG. 1 , the figure is a flow chart of a method for adjusting switch bandwidth based on a content distribution network provided in an embodiment of the present application, such as Figure 3 As shown, the method may include S301-S303:
[0041] S301: The control device obtains the actual bandwidth of the switch.
[0042] The actual bandwidth of a switch is the bandwidth actually used by the switch to transmit data.
[0043] The actual bandwidth of the switch can be determined by the log generated by the switch forwarding the client's request in the CDN. In one possible implementation, the control device supports the log service. The control device can process the log of the switch. The control device obtains the first log from the switch. The first log is generated based on the request of the client forwarded by the switch, and is used to record information related to the request of the client forwarded by the switch. The first log includes a timestamp and a data volume. The first log whose timestamp belongs to the bandwidth detection period is taken as the target first log. The actual bandwidth of the switch is determined based on the sum of the request amounts of the target first log and the bandwidth detection period. Among them, the bandwidth detection period can be set in advance according to the needs of bandwidth detection. In another possible implementation, other devices supporting the log service determine the actual bandwidth of the switch based on the log of the switch, and send the actual bandwidth of the switch to the control device.
[0044] The above method of determining the actual bandwidth of the switch through the log of the switch is only an example, and the embodiment of the present application does not limit the implementation method of the control device obtaining the log of the switch.
[0045] S302: If it is determined that the actual bandwidth of the switch is greater than the bandwidth threshold, the control device uses a proportional-integral-differential PID algorithm to determine a reduction ratio according to the actual bandwidth of the switch and the bandwidth threshold.
[0046] The bandwidth threshold is a pre-set value, which is the minimum value that triggers the adjustment of the actual bandwidth of the switch. Setting the bandwidth threshold is used to prevent the actual bandwidth of the switch from being too large, so as to adjust the actual bandwidth of the larger switch in time. The bandwidth threshold can be set according to the adjustment requirements of the actual bandwidth of the switch. As an example, the bandwidth threshold can be set according to the maximum bandwidth that the switch can support. For example, the bandwidth threshold is 90% of the maximum bandwidth that the switch can support. As another example, the bandwidth threshold can be set based on experience according to the operation of the CDN. In addition, the bandwidth threshold can be a fixed value or a variable value. For example, different time periods correspond to different bandwidth thresholds. The bandwidth threshold can be set flexibly, and the embodiments of the present application do not limit this.
[0047] After the actual bandwidth of the switch is obtained, the actual bandwidth of the switch is compared with the bandwidth threshold.
[0048] If the actual bandwidth of the switch is less than or equal to the bandwidth threshold, it means that the actual bandwidth of the current switch is small and there is no need to adjust the actual bandwidth of the switch. If the actual bandwidth of the switch is greater than the bandwidth threshold, it means that the actual bandwidth of the current switch is large and there is a need to adjust the actual bandwidth of the switch.
[0049] The PID algorithm is used to process the actual bandwidth and bandwidth threshold of the switch to obtain the reduction ratio. The PID algorithm is a feedback control algorithm that adjusts the actual bandwidth of the switch that is greater than the bandwidth threshold by calculating three different terms, including proportional term, integral term and differential term, to achieve the goal of the actual bandwidth of the switch that is less than or equal to the bandwidth threshold.
[0050] The PID algorithm involves three hyperparameters, namely, the proportional term coefficient, the integral term coefficient, and the differential term coefficient. The three hyperparameters affect the control process of the PID algorithm, such as convergence speed, oscillation frequency, etc. The three hyperparameters of the PID algorithm are predetermined. The embodiment of the present application does not limit the method for determining the values of the three hyperparameters. As an example, the hyperparameters are determined by real-time adjustment. Specifically, one or two of the three hyperparameters are fixed, and the other hyperparameters are adjusted according to the control results of the PID algorithm until the control results of the PID algorithm meet the control requirements. As another example, the tuning algorithm of the PID algorithm is used to determine the values of the hyperparameters. As another example, the simulated annealing (SA) algorithm is used to determine the values of the hyperparameters. In the process of determining the three hyperparameters, one or more of the actual bandwidth of the historical switch and the test values of the bandwidth set manually can be used as simulation data.
[0051] As an example, a possible implementation method of the control device using the proportional-integral-differential PID algorithm to determine the reduction ratio according to the actual bandwidth and bandwidth threshold of the switch is described below. Figure 4 As shown, it includes the following three steps S401-S403:
[0052] S401: The control device processes the actual bandwidth and bandwidth threshold of the switch by using the PID algorithm to obtain the expected uplink bandwidth of the client.
[0053] It should be noted that the actual bandwidth of the switch in the CDN is adjusted mainly by controlling the request sent by the client to the switch. The actual bandwidth and bandwidth threshold of the switch are processed using the PID algorithm to obtain the client's expected upstream bandwidth. The client's expected upstream bandwidth is more in line with the adjustment requirements, so that a more appropriate reduction ratio can be further determined based on the client's expected upstream bandwidth, thereby achieving accurate adjustment of the actual bandwidth of the switch.
[0054] Furthermore, as an example, an embodiment of the present application provides an implementation method for determining an expected uplink bandwidth of a client.
[0055] A switch bandwidth difference between an actual bandwidth of the switch and an expected bandwidth of the switch at a current adjustment time is determined.
[0056] The actual bandwidth of the switch obtained in step S301 is the actual bandwidth of the switch at the current adjustment moment.
[0057] The expected bandwidth of the switch at the current adjustment moment is the bandwidth that the actual bandwidth of the switch is theoretically expected to reach. The expected bandwidth of the switch at the current adjustment moment is determined according to the bandwidth threshold. In one possible implementation, the current adjustment moment is the initial moment of adjusting the actual bandwidth of the switch this time. The expected bandwidth of the switch at the current adjustment moment is the bandwidth threshold. In another possible implementation, the current adjustment moment is not the initial moment of adjusting the actual bandwidth of the switch this time, that is, the actual bandwidth of the switch has been adjusted using the PID algorithm. The expected bandwidth of the switch at the current adjustment moment is the sum of the bandwidth threshold and the control bandwidth difference at the last adjustment moment. The control bandwidth difference at the last adjustment moment is obtained by processing the switch bandwidth difference at the last adjustment moment by the PID algorithm. The method for determining the control bandwidth difference is described below.
[0058] The switch bandwidth difference between the actual bandwidth of the switch and the expected bandwidth of the switch at the current adjustment moment is the difference in the actual bandwidth of the adjusted switch to be achieved in theory.
[0059] For example, see Figure 5As shown, this figure is a schematic diagram of using a PID algorithm to adjust the actual bandwidth of a switch provided in an embodiment of the present application.
[0060] The current adjustment time is t. The actual bandwidth of the switch in the CDN is observedBW t The expected bandwidth of the switch at the current adjustment time is expressed as expectBW. t express.
[0061] The switch bandwidth difference e(t) at the current adjustment time is shown in formula (1):
[0062] e(t)=expectBW t -observeBW t (1)
[0063] The PID algorithm is used to process the switch bandwidth difference to obtain the control bandwidth difference at the current adjustment moment. Figure 5 Where P is the adjustment process of the proportional term, I is the adjustment process of the integral term, and D is the adjustment process of the differential term. The adjustment process of the proportional term adjusts the deviation so that the deviation gradually converges. The adjustment process of the integral term is used to control the stability of the PID algorithm to ensure that the disturbance in the process of convergence to the expected bandwidth of the switch is minimized. The adjustment process of the differential term controls the timeliness of the PID algorithm and improves the parameter tuning speed.
[0064] The control bandwidth difference u(t) at the current adjustment time is shown in formula (2):
[0065]
[0066] Among them, K p K is the proportional term coefficient of the PID algorithm. i K is the integral term coefficient of the PID algorithm. d It is the differential term coefficient of PID algorithm.
[0067] In the process of calculation, for the differential term, only the data of M adjustment moments that are closest to the current adjustment moment can be used for calculation. M is a positive integer. As an example, the value of M is 2. That is, the data of the current adjustment moment and the previous adjustment moment are used for calculation. The above formula (2) can be simplified to formula (3).
[0068]
[0069] This can simplify the calculation process, improve the calculation speed of the PID algorithm, thereby speeding up the adjustment of the actual bandwidth of the switch, saving computing resources and reducing computing costs.
[0070] The PID algorithm can be used to determine the control bandwidth difference that is more suitable for the actual bandwidth adjustment needs of the switch, and then the control bandwidth difference can be used to determine the reduction ratio, thereby achieving flexible adjustment of the bandwidth of the switch in the CDN.
[0071] Determine the sum of the bandwidth threshold and the control bandwidth difference to obtain the expected bandwidth of the switch at the next adjustment time, that is, expectBW t+1 .
[0072] When the CDN operates normally, the actual bandwidth of the switch is linearly related to the actual uplink bandwidth of the client. The linear relationship can be expressed as formula (4).
[0073] observeBW=cdnBW×logRate (4)
[0074] cdnBW is the actual uplink bandwidth of the client connected to the switch in the CDN. logRate is the retransmission coefficient. logRate is determined by the network status of the CDN, such as congestion timeout and packet loss.
[0075] The expected uplink bandwidth of the client is determined by using the expected bandwidth of the switch at the next adjustment time and the retransmission coefficient. In this way, a more accurate expected uplink bandwidth of the client can be determined based on the linear relationship between the actual bandwidth of the switch and the actual uplink bandwidth of the client.
[0076] The expected uplink bandwidth cdnBW of the client is shown in formula (5):
[0077] cdnBW=expectBW t+1 / logRate (5)
[0078] The retransmission coefficient in formula (5) is determined according to the network status of the CDN. As an example, an embodiment of the present application provides a possible implementation method for determining the retransmission coefficient.
[0079] The actual bandwidth of the switch and the actual uplink bandwidth of the client at the collection time within the historical collection time are obtained. The historical collection time is the time close to the current adjustment time. As an example, the historical collection time is n seconds before the current adjustment time. n is a positive number. The time length of the historical collection time and the distance from the current adjustment time can be set according to the need to determine the retransmission coefficient. The historical collection time includes one or more collection moments. The interval between the collection moments can be determined according to the preset collection frequency.
[0080] The actual bandwidth of the switch at the time of collection and the actual uplink bandwidth of the client are obtained. The method for obtaining the actual bandwidth of the switch can be the same as the implementation method for obtaining the actual bandwidth of the switch in the above S301, which will not be repeated here. The actual uplink bandwidth of the client can be determined by the log generated by the edge node for the request of the client. In one possible implementation, the control device supports log service. The control device can process the second log of the edge node. The control device obtains the second log sent by the edge node. The second log is generated based on the request of the client responded by the edge node, and is used to record the relevant information of the request of the client processed by the edge node. The second log includes a timestamp and a data volume. The second log whose timestamp belongs to the bandwidth detection period is used as the target second log. According to the sum of the request amount of the target second log and the bandwidth detection period, the actual uplink bandwidth of the client is determined. Among them, the bandwidth detection period can be set in advance according to the needs of bandwidth detection. In another possible implementation, other devices supporting log service determine the actual uplink bandwidth of the client according to the log of the edge device, and send the actual uplink bandwidth of the client to the control device.
[0081] For the collection time, the ratio of the actual bandwidth of the switch to the actual uplink bandwidth of the client is determined, that is, the retransmission coefficient corresponding to the collection time is determined. The retransmission coefficient is determined using the ratio of the collection time, that is, the retransmission coefficient corresponding to the collection time.
[0082] In a possible implementation, the number of collection moments involved in the calculation is one, and the retransmission coefficient corresponding to the collection moment is used to determine the retransmission coefficient.
[0083] In another possible implementation, there are multiple collection moments involved in the calculation, and statistical values of retransmission coefficients corresponding to the multiple collection moments are determined to obtain the retransmission coefficient.
[0084] In another possible implementation, the number of collection moments involved in the calculation is multiple, and the retransmission coefficients corresponding to the multiple collection moments are fitted to obtain the retransmission coefficient. The embodiment of the present application does not limit the method of fitting the retransmission coefficient. For example, a fitting algorithm can be used to fit the retransmission coefficient corresponding to each collection moment to obtain the retransmission coefficient in formula (5). The retransmission coefficient obtained by fitting can more accurately reflect the current state of the CDN, and the expected uplink bandwidth of the client determined by the retransmission coefficient is more accurate. As another example, the collection moment included in the historical collection duration is the current moment. That is, the retransmission coefficient is determined using the actual bandwidth of the switch obtained at the current moment and the actual uplink bandwidth of the client.
[0085] S402: The control device determines a client uplink bandwidth difference between an expected uplink bandwidth of the client and an actual uplink bandwidth of the client.
[0086] After determining the expected uplink bandwidth of the client, determine the difference between the expected uplink bandwidth of the client and the actual uplink bandwidth of the client to obtain the client uplink bandwidth difference. As an example, the method for determining the actual uplink bandwidth of the client refers to the method for determining the actual uplink bandwidth of the client introduced in the retransmission coefficient of the above formula (5).
[0087] S403: The control device determines a ratio of the client uplink bandwidth difference to the client's actual uplink bandwidth to obtain a reduction ratio.
[0088] The method for determining the reduction ratio ratio is shown in formula (6):
[0089]
[0090] Among them, realcdnBW indicates the actual uplink bandwidth of the client, and cdnBW indicates the expected uplink bandwidth of the client.
[0091] The following is an example of adjusting the actual bandwidth of the switch twice. Figure 4 The method of calculating the reduction ratio is explained below.
[0092] The maximum bandwidth supported by the switch is 100 Gigabytes (G). The control line ratio of the switch bandwidth is 95%, that is, the bandwidth threshold is 95G. The actual bandwidth of the switch at the current moment is 98G. 98G is greater than 95G, and the actual bandwidth of the switch needs to be controlled. The current moment is the 0th adjustment moment. The switch bandwidth difference at the 0th adjustment moment is e(0) = 95G-98G = -3G. For the sake of convenience, assume that K p , K i and K d The values of are all 1. The PID algorithm is used to process the switch bandwidth difference at the 0th adjustment time to obtain the control bandwidth difference u(0) at the 0th adjustment time. u(0) = K p ×e(0)+K i ×0+K d ×0=-3. The expected bandwidth of the switch at the first adjustment time is expectBW 1 =95G+(-3)=92G. The actual uplink bandwidth of the client at the current moment is 90G. The retransmission coefficient logRate=98 / 90=1.09 is determined by using the actual bandwidth of the switch at the current moment and the actual uplink bandwidth of the client. cdnBW 1 =expectBW 1 / logRate = 85G. Reduction ratio = realcdnBW - cdnBW 1 / realcdnBW=90-85 / 90=0.06=6%. The actual bandwidth of the switch is adjusted according to the reduction ratio of 6%.
[0093] The actual bandwidth of the switch after adjustment is 96G, which is still greater than 95G. The actual bandwidth of the switch needs to be controlled. The current moment is the first adjustment moment. The switch bandwidth difference at the first adjustment moment is e(0) = 95G - 96G = -1G. The switch bandwidth difference at the first adjustment moment is processed using the PID algorithm to obtain the control bandwidth difference u(1) at the first adjustment moment. The expected bandwidth of the switch at the second adjustment time is expectBW 2 =95G+(-4)=91G. The actual uplink bandwidth of the client at the current moment is 87G. The retransmission coefficient logRate=96 / 87=1.1 is determined by using the actual bandwidth of the switch at the current moment and the actual uplink bandwidth of the client. cdnBW 2 =expectBW 2 / logRate = 83G. Reduction ratio = realcdnBW - cdnBW 2 / realcdnBW=87-83 / 87=0.046=4.6%. The actual bandwidth of the switch is adjusted according to the reduction ratio of 4.6%.
[0094] It should be noted that the above Figure 4 The method of using the PID algorithm to determine the expected uplink bandwidth of the client and then determining the reduction ratio is only an example, and the embodiment of the present application does not limit this. The PID algorithm can also be used to determine other parameters and then determine the reduction ratio.
[0095] S303: The control device adjusts the actual bandwidth of the switch by using the reduction ratio.
[0096] The actual bandwidth of the switch is adjusted using the reduction ratio determined by the PID algorithm.
[0097] As an example, some requests are redirected to other switches according to the reduction ratio. For example, if the reduction ratio is 40%, 40% of the requests are redirected to other switches. As another example, according to the reduction ratio, some requests are subject to 429 speed limit. Hypertext Transfer Protocol (HTTP) status code 429, namely "TooMany Requests", means that the client has sent too many requests in a given time, exceeding the rate limit set by the switch. 429 speed limit is usually to prevent abuse, reduce switch load or protect resources from overuse. Status code 429 is fed back for 40% of the requests. The client adjusts the request strategy based on the status code 429 obtained, such as reducing the request frequency or batching requests.
[0098] The actual bandwidth of the switch adjusted according to the reduction ratio may still be greater than the bandwidth threshold. S301 and subsequent steps may be performed again until the actual bandwidth of the switch is less than or equal to the bandwidth threshold.
[0099] Based on the above S301-S303 related contents, it can be known that the use of the PID algorithm to determine the reduction ratio can, on the one hand, more flexibly determine the reduction ratio and avoid the problem of rigidity in the process of adjusting the actual bandwidth of the switch caused by a fixed reduction ratio; on the other hand, it can determine the reduction ratio suitable for the current bandwidth adjustment demand, thereby improving the speed of adjusting the actual bandwidth of the switch on the basis of effectively utilizing bandwidth resources.
[0100] Further, in some possible implementations, see Figure 6 As shown, this figure is a flow chart of another method for adjusting switch bandwidth based on a content distribution network provided by an embodiment of the present application. In addition to the above steps S301-S303, before using the PID algorithm to determine the reduction ratio according to the actual bandwidth and bandwidth threshold of the switch, steps S304 and S305 are also included.
[0101] S304: The control device obtains network operation parameters of the content distribution network.
[0102] The network operation parameters of the CDN can reflect the operation status of the CDN. The embodiment of the present application does not limit the parameter type of the network operation parameters. As an example, the network operation parameters include packet loss rate, delay, retransmission rate and error rate. S305: The control device determines that the content distribution network is operating normally according to the network operation parameters.
[0103] Based on the obtained network operation parameters, determine that the CDN is in a normal operating state. This ensures that the switch can be adjusted under the normal state of the CDN. When the CDN is in an abnormal state, the actual bandwidth of the switch obtained and the adjustment method of the actual bandwidth of the switch may be invalid. Prioritize eliminating the abnormality, and adjust the actual bandwidth of the switch after the CDN is running normally, to avoid invalid adjustment of the bandwidth of the switch when the CDN is abnormal, which wastes adjustment resources.
[0104] In a possible implementation, the network operation parameter is the packet loss rate of the switch. The packet loss rate of the switch refers to the proportion of data packets received by the switch that are not successfully transmitted to the edge node within a certain period of time. The packet loss rate of the switch can reflect the operation status of the CDN. Obtain the packet loss rate of the switch. The packet loss rate of the switch can be detected based on the network monitoring tool.
[0105] If the packet loss rate of the switch is less than the packet loss rate threshold, it is determined that the CDN is running normally. The packet loss rate threshold is the highest packet loss rate of the switch when no abnormality occurs in the CDN.
[0106] Compare the obtained packet loss rate of the switch and the packet loss rate threshold. If the packet loss rate of the switch is less than the packet loss rate threshold, it means that the current CDN operation is in a normal state, and the subsequent adjustment of the actual bandwidth of the switch can continue. If the packet loss rate of the switch is greater than or equal to the packet loss rate threshold, it means that the current CDN operation is abnormal, and the abnormality should be eliminated first. After the CDN runs normally, the actual bandwidth of the switch can be adjusted. In this way, when the CDN operation is in an abnormal state, the invalid adjustment of the actual bandwidth of the switch can be stopped to reduce resource waste.
[0107] Based on the switch bandwidth adjustment method based on a content distribution network provided by the above method embodiment, the embodiment of the present application also provides a switch bandwidth adjustment device based on a content distribution network. The switch bandwidth adjustment device based on a content distribution network will be described below in conjunction with the accompanying drawings.
[0108] See also Figure 7 As shown, this figure is a schematic diagram of the structure of a switch bandwidth adjustment device based on a content distribution network provided by an embodiment of the present application. The switch bandwidth adjustment device based on a content distribution network is applied to a control device included in the content distribution network, the control device is connected to a switch and an edge node, and the switch is respectively connected to the edge node and the client, such as Figure 7 As shown, the switch bandwidth adjustment device based on the content distribution network includes:
[0109] A first acquisition unit 701 is used to acquire the actual bandwidth of the switch;
[0110] The first determining unit 702 is configured to determine a reduction ratio according to the actual bandwidth of the switch and the bandwidth threshold by using a proportional-integral-derivative (PID) algorithm if it is determined that the actual bandwidth of the switch is greater than the bandwidth threshold;
[0111] The adjusting unit 703 is configured to adjust the actual bandwidth of the switch by using the reduction ratio.
[0112] In a possible implementation, the first determining unit 702 is configured to determine the reduction ratio according to the actual bandwidth of the switch and the bandwidth threshold by using a proportional-integral-differential (PID) algorithm, including:
[0113] The first determination unit 702 is used to obtain the expected uplink bandwidth of the client according to the actual bandwidth of the switch and the bandwidth threshold by using the PID algorithm; determine the client uplink bandwidth difference between the expected uplink bandwidth of the client and the actual uplink bandwidth of the client; determine the ratio of the client uplink bandwidth difference to the actual uplink bandwidth of the client to obtain the reduction ratio.
[0114] In a possible implementation, the first determining unit 702 is configured to determine the expected uplink bandwidth of the client according to the actual bandwidth of the switch and the bandwidth threshold by using a PID algorithm, including:
[0115] The first determining unit 702 is configured to determine a switch bandwidth difference between an actual bandwidth of the switch and an expected bandwidth of the switch at a current adjustment moment, wherein the expected bandwidth of the switch at the current adjustment moment is determined according to the bandwidth threshold; process the switch bandwidth difference by using the PID algorithm to obtain a control bandwidth difference at the current adjustment moment; determine a sum of the bandwidth threshold and the control bandwidth difference at the current adjustment moment to obtain an expected bandwidth of the switch at a next adjustment moment; and determine an expected uplink bandwidth of the client by using the expected bandwidth of the switch at the next adjustment moment and a retransmission coefficient.
[0116] In a possible implementation manner, the retransmission coefficient is obtained in the following manner:
[0117] Obtain the actual bandwidth of the switch and the actual uplink bandwidth of the client at the collection time within the historical collection period;
[0118] Determine, at the acquisition time, a ratio of an actual bandwidth of the switch to an actual uplink bandwidth of the client;
[0119] The retransmission coefficient is determined using the ratio.
[0120] In a possible implementation manner, the ratio is multiple, and the determining the retransmission coefficient by using the ratio includes:
[0121] The retransmission coefficient is obtained by fitting a plurality of the ratios.
[0122] In a possible implementation manner, the device further includes:
[0123] A second acquisition unit, configured to acquire network operation parameters of the content distribution network;
[0124] The second determining unit is configured to determine, according to the network operating parameters, whether the content distribution network is operating normally.
[0125] In a possible implementation manner, the network operation parameter is a packet loss rate of the switch, and determining that the content distribution network operates normally according to the network operation parameter includes:
[0126] It is determined that the packet loss rate of the switch is less than a packet loss rate threshold.
[0127] Based on the switch bandwidth adjustment method based on a content distribution network provided by the above method embodiment, the present application also provides an electronic device, including: one or more processors; a storage device, on which one or more programs are stored, when the one or more programs are executed by the one or more processors, the one or more processors implement the switch bandwidth adjustment method based on a content distribution network as described in any of the above embodiments.
[0128] Reference below Figure 8 , which shows a schematic diagram of the structure of an electronic device 800 suitable for implementing the embodiment of the present application. The terminal device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (portable android devices), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs (televisions), desktop computers, etc. Figure 8 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0129] like Figure 8As shown, the electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0130] Typically, the following devices may be connected to the I / O interface 805: input devices 808 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 808 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 809. The communication device 809 may allow the electronic device 800 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 8 The electronic device 800 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0131] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 809, or installed from the storage device 808, or installed from the ROM 802. When the computer program is executed by the processing device 801, the above-mentioned functions defined in the method of the embodiment of the present application are executed.
[0132] The electronic device provided in the embodiment of the present application and the switch bandwidth adjustment method based on the content distribution network provided in the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0133] Based on the switch bandwidth adjustment method based on a content distribution network provided in the above method embodiment, an embodiment of the present application provides a computer storage medium on which a computer program is stored, wherein when the program is executed by a processor, the switch bandwidth adjustment method based on a content distribution network as described in any of the above embodiments is implemented.
[0134] It should be noted that the computer-readable medium mentioned above in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0135] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (Hyper Text Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0136] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0137] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the switch bandwidth adjustment method based on the content distribution network.
[0138] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0139] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0140] The units involved in the embodiments described in this application may be implemented by software or hardware. The name of a unit / module does not limit the unit itself in some cases. For example, a voice data acquisition module may also be described as a "data acquisition module".
[0141] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0142] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0143] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the system or device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0144] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0145] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0146] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for adjusting switch bandwidth based on a content distribution network, characterized in that: The method is applied to a control device included in a content distribution network, the control device is connected to a switch and an edge node, the switch is respectively connected to the edge node and a client, and the method includes: Get the actual bandwidth of the switch; If it is determined that the actual bandwidth of the switch is greater than the bandwidth threshold, a proportional-integral-derivative (PID) algorithm is used to determine a reduction ratio according to the actual bandwidth of the switch and the bandwidth threshold; The actual bandwidth of the switch is adjusted using the reduction ratio.
2. The method according to claim 1, characterized in that The method of using a proportional-integral-differential (PID) algorithm to determine the reduction ratio according to the actual bandwidth of the switch and the bandwidth threshold comprises: Obtaining the expected uplink bandwidth of the client according to the actual bandwidth of the switch and the bandwidth threshold by using a PID algorithm; Determine a client uplink bandwidth difference between an expected uplink bandwidth of the client and an actual uplink bandwidth of the client; The ratio of the client uplink bandwidth difference to the actual uplink bandwidth of the client is determined to obtain a reduction ratio.
3. The method according to claim 2, characterized in that The method of using the PID algorithm to determine the expected uplink bandwidth of the client according to the actual bandwidth of the switch and the bandwidth threshold includes: Determine a switch bandwidth difference between an actual bandwidth of the switch and an expected bandwidth of the switch at a current adjustment time, wherein the expected bandwidth of the switch at the current adjustment time is determined according to the bandwidth threshold; Processing the switch bandwidth difference by using the PID algorithm to obtain a control bandwidth difference at a current adjustment time; Determine the sum of the bandwidth threshold and the control bandwidth difference at the current adjustment time to obtain the expected bandwidth of the switch at the next adjustment time; The expected uplink bandwidth of the client is determined by using the expected bandwidth of the switch at the next adjustment time and the retransmission coefficient.
4. The method according to claim 3, characterized in that The retransmission coefficient is obtained in the following manner: Obtain the actual bandwidth of the switch and the actual uplink bandwidth of the client at the collection time within the historical collection period; Determine, at the acquisition time, a ratio of an actual bandwidth of the switch to an actual uplink bandwidth of the client; The retransmission coefficient is determined using the ratio.
5. The method according to claim 4, characterized in that The ratio is multiple, and the determining the retransmission coefficient by using the ratio includes: The retransmission coefficient is obtained by fitting a plurality of the ratios.
6. The method according to any one of claims 1 to 5, characterized in that: Before determining the reduction ratio according to the actual bandwidth of the switch and the bandwidth threshold by using the proportional-integral-differential (PID) algorithm, the method further includes: Obtaining network operation parameters of the content distribution network; It is determined according to the network operation parameters that the content distribution network operates normally.
7. The method according to claim 6, characterized in that The network operation parameter is a packet loss rate of the switch, and determining that the content distribution network operates normally according to the network operation parameter includes: It is determined that the packet loss rate of the switch is less than a packet loss rate threshold.
8. A switch bandwidth adjustment device based on a content distribution network, characterized in that: The device is applied to a control device included in a content distribution network, the control device is connected to a switch and an edge node, the switch is connected to the edge node and a client, respectively, and the device includes: A first acquisition unit, used to acquire the actual bandwidth of the switch; A first determining unit is configured to determine a reduction ratio according to the actual bandwidth of the switch and the bandwidth threshold by using a proportional-integral-differential (PID) algorithm if it is determined that the actual bandwidth of the switch is greater than the bandwidth threshold; The adjusting unit is used to adjust the actual bandwidth of the switch by using the reduction ratio.
9. An electronic device, characterized in that: include: one or more processors; A storage device having one or more programs stored thereon, when the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1-7.
10. A computer-readable medium, characterized in that A computer program is stored thereon, wherein when the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.