An online cache scheduling method and device based on prediction information

Through the online cache scheduling method based on prediction information, the problem that scheduling decisions in CDN cache scheduling is difficult to achieve low cost. By estimating the worst competition ratio and running the preset prediction scheduling algorithm, a lower scheduling cost is achieved.

CN116320024BActive Publication Date: 2025-05-09SHENZHEN INST OF ADVANCED TECH CHINESE ACAD OF SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310283866.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-15
Publication Date
2025-05-09
Estimated Expiration
2043-03-15

AI Technical Summary

Technical Problem

In the prior art, in response to the cache scheduling problem of CDN, scheduling decisions are difficult to achieve lower scheduling costs.

Method used

The online cache scheduling method based on prediction information is adopted, and the scheduling cost information is updated by receiving the request time of the target data, and the worst competition ratio is estimated using the predicted request time. If it is less than or equal to the threshold, a preset prediction scheduling algorithm is run to obtain the optimal scheduling decision.

Benefits of technology

When the worst competition ratio is less than or equal to the preset threshold, the optimal scheduling decision is calculated through the preset prediction scheduling algorithm, which reduces the scheduling cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116320024B_ABST
    Figure CN116320024B_ABST
Patent Text Reader

Abstract

The present invention provides an online cache scheduling method and device based on prediction information, the method comprising: when receiving a first request for target data, obtaining the request time of the first request; updating the scheduling cost information of the server cluster at the request time, and obtaining the predicted arrival time corresponding to the second request for the target data; estimating the worst competition ratio of running a preset prediction scheduling algorithm based on the scheduling cost information and the predicted arrival time; if the worst competition ratio is less than or equal to a preset threshold, running the preset prediction scheduling algorithm to obtain the optimal scheduling decision. The present invention uses the predicted next arrival time of each request to obtain the worst competition ratio. When the worst competition ratio is less than or equal to the preset threshold, the preset prediction scheduling algorithm can calculate the optimal scheduling decision, thereby achieving a lower scheduling cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of cache scheduling, and in particular to an online cache scheduling method and device based on prediction information. Background Art

[0002] In today's society, mobile data services are becoming more and more widespread, and the amount of data is becoming larger and larger, so the size of mobile networks is also increasing, and data services are becoming more and more important. The most widely used data delivery network is Content Delivery Network (CDN), which maintains a cache server cluster. For client requests, it calculates the optimal cache server through a certain algorithm to provide services in order to minimize the total cost. However, the topology of the server cluster in the current CDN service is too centralized to meet some key services, and as more and more applications are deployed, CDN needs to expand more cache resources to enhance services. To meet these requirements, the expansion of traditional CDN needs to not only enhance accessibility, but also take into account service efficiency, that is, service latency.

[0003] Currently, edge computing is becoming more and more popular. Since edge networks are closer to users, if edge networks are used to expand CDN, faster and more adaptable data services can be provided to users, that is, CDN based on edge computing. In such a CDN architecture, the data cache architecture is based on TTL, so it is very necessary to design a cache structure with low service cost and transmission cost, that is, not only to reduce the total data transmission cost, but also to reduce the total service cost. And this problem is the CDN cache scheduling problem, which is very important for CDN networks based on edge computing.

[0004] However, for the current CDN cache scheduling problem, the scheduling decision still cannot achieve the lowest scheduling cost.

[0005] Therefore, the prior art has defects and needs to be improved and developed. Summary of the invention

[0006] The technical problem to be solved by the present invention is that, in view of the above-mentioned defects of the prior art, an online cache scheduling method and device based on prediction information are provided, aiming to solve the cache scheduling problem for CDN in the prior art, and the problem that the scheduling decision still cannot achieve a lower scheduling cost.

[0007] The technical solution adopted by the present invention to solve the technical problem is as follows:

[0008] An online cache scheduling method based on prediction information, the method comprising:

[0009] When receiving a first request for target data, obtaining a request time of the first request;

[0010] Update the scheduling cost information of the server cluster at the request time, and obtain the predicted arrival time corresponding to the second request for the target data;

[0011] estimating the worst competition ratio of running a preset prediction scheduling algorithm according to the scheduling cost information and the predicted arrival time;

[0012] If the worst competition ratio is less than or equal to a preset threshold, the preset prediction scheduling algorithm is run to obtain the optimal scheduling decision.

[0013] Optionally, the first request includes a target server of the request and a request time, and the predicted arrival time is obtained by predicting the arrival time of the second request on the target server by a predictor.

[0014] Optionally, estimating the worst competition ratio of running a preset prediction scheduling algorithm according to the scheduling cost information and the predicted arrival time includes:

[0015] Obtaining a time threshold range of the actual arrival time of the second request according to the predicted arrival time, the time threshold range comprising: a first time threshold range, a second time threshold range and a third time threshold range;

[0016] estimating a first competitive ratio for running a preset prediction scheduling algorithm when the actual arrival time is within the first time threshold range;

[0017] A second competitive ratio for running a preset prediction scheduling algorithm when estimating the actual arrival time is within the second time threshold range;

[0018] estimating a third competitive ratio of running a preset prediction scheduling algorithm when the actual arrival time is within the third time threshold range;

[0019] taking the maximum value among the first competition ratio, the second competition ratio and the third competition ratio as the worst competition ratio;

[0020] Among them, the first time threshold range is the time between the request time and the predicted arrival time; the second time threshold range is the time between the predicted arrival time and the constant time, the constant time is obtained by the sum of the predicted arrival time and the constant duration, the constant duration is calculated in advance, and the storage cost required to store the target data of the constant duration is equal to the transmission cost between servers; the third time threshold range is greater than the constant time.

[0021] Optionally, after estimating the worst competition ratio of running a preset prediction scheduling algorithm according to the scheduling cost information and the predicted arrival time, the method further includes:

[0022] If the worst contention ratio is greater than a preset threshold, a preset reactive caching algorithm is run.

[0023] Optionally, the scheduling cost information includes: a first total scheduling cost generated by running the preset reactive caching algorithm, a second total scheduling cost generated by running the preset predictive scheduling algorithm, and a lower bound of the scheduling cost generated by the OPT algorithm.

[0024] Optionally, the preset prediction scheduling algorithm includes: a first sub-condition scheduling strategy and a second sub-condition scheduling strategy under the first condition, and a third sub-condition scheduling strategy, a fourth sub-condition scheduling strategy and a fifth sub-condition scheduling strategy under the second condition;

[0025] The first condition is that: at the request time, the number of surviving data servers is greater than 1, and the number of surviving data servers is the number of servers in the server cluster that currently cache the target data;

[0026] The operation steps of the first sub-condition scheduling strategy include:

[0027] If the predicted arrival time is within a preset first time range, the target data is cached until the predicted arrival time is reached, and the preset first time range is the time between the request time and the constant time;

[0028] Determine the number of surviving servers for the predicted arrival time;

[0029] If the current number of surviving data servers is greater than 1, the target data is deleted and the number of surviving data servers is updated;

[0030] If the number of current data surviving servers is equal to 1, determine the cache cost number corresponding to the current server, where the cache cost number is obtained by sorting the servers in the server cluster in order of cache cost from small to large;

[0031] If the cache cost number corresponding to the current server is the first number, the third sub-condition scheduling strategy is executed;

[0032] If the cache cost number corresponding to the current server is not the first number, the fourth sub-condition scheduling strategy is executed;

[0033] The operation steps of the second sub-condition scheduling strategy include:

[0034] If the predicted arrival time is within a preset second time range, the target data is deleted and the second value is updated; the preset second time range is a time greater than the constant moment.

[0035] Optionally, the second condition is: at the request time, the number of data surviving servers is equal to 1;

[0036] The operation steps of the third sub-condition scheduling strategy include:

[0037] If the cache cost number corresponding to the current server is the first number, cache the target data until the actual arrival time of the second request is reached;

[0038] The operation steps of the fourth sub-condition scheduling strategy include:

[0039] If the cache cost number corresponding to the current server is not the first number, and the predicted arrival time is within the preset third time range, the target data is cached until the predicted arrival time is reached, and the number of servers surviving the data is monitored in real time;

[0040] If the current time is between the request time and the predicted arrival time, and the number of surviving data servers is updated to a value greater than 1, the current time is used as the new request time, and the first sub-condition scheduling strategy and the second sub-condition scheduling strategy under the first condition are executed;

[0041] If the number of data surviving servers does not change, cache the target data until the predicted arrival time is reached, and determine the number of data surviving servers at the predicted arrival time;

[0042] If the number of surviving servers for the data at the predicted arrival time is greater than 1, the target data is deleted when the predicted arrival time is reached, and the number of surviving servers for the data is updated;

[0043] If the number of surviving servers for data at the predicted arrival time is equal to 1, the target data is transmitted to the server whose cache cost number is the first number.

[0044] The preset third time range is from the request time to the threshold time, at which the cache cost of the target data in the current server cache is the same as the scheduling cost generated by transmitting to the first numbered server cache;

[0045] The operation steps of the fifth sub-condition scheduling strategy include:

[0046] If the cache cost number corresponding to the current server is not the first number, and the predicted arrival time is within a preset fourth time range, the target data is transmitted to the server whose cache cost number is the first number, and the preset fourth time range is greater than the threshold time.

[0047] The present invention also provides an online cache scheduling device based on prediction information, comprising:

[0048] A receiving module, configured to obtain a request time of a first request for target data when receiving the first request;

[0049] An acquisition module, used to update the scheduling cost information of the server cluster at the request time, and obtain the predicted arrival time corresponding to the second request for the target data;

[0050] An estimation module, configured to estimate a worst competition ratio of running a preset prediction scheduling algorithm according to the scheduling cost information and the predicted arrival time;

[0051] The decision module is used to run the preset prediction scheduling algorithm to obtain the optimal scheduling decision if the worst competition ratio is less than or equal to a preset threshold.

[0052] The present invention also provides a terminal, comprising: a memory, a processor, and an online cache scheduling program based on prediction information stored in the memory and executable on the processor, wherein the online cache scheduling program based on prediction information implements the steps of the online cache scheduling method based on prediction information as described above when executed by the processor.

[0053] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program can be executed to implement the steps of the online cache scheduling method based on prediction information as described above.

[0054] Beneficial effects of the present invention: The embodiment of the present invention obtains the request time of the first request when receiving the first request for the target data; updates the scheduling cost information of the server cluster at the request time, and obtains the predicted arrival time corresponding to the second request for the target data; estimates the worst competition ratio of running the preset prediction scheduling algorithm according to the scheduling cost information and the predicted arrival time; if the worst competition ratio is less than or equal to the preset threshold, runs the preset prediction scheduling algorithm to obtain the optimal scheduling decision. The present invention uses the predicted next arrival time of each request to obtain the worst competition ratio. When the worst competition ratio is less than or equal to the preset threshold, the preset prediction scheduling algorithm can calculate the optimal scheduling decision, thereby achieving a lower scheduling cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 It is a flow chart of a preferred embodiment of the online cache scheduling method based on prediction information in the present invention.

[0056] Figure 2 It is a schematic diagram of the scheduling problem in a preferred embodiment of the online cache scheduling method based on prediction information in the present invention.

[0057] Figure 3 It is a functional principle block diagram of a preferred embodiment of an online cache scheduling device based on prediction information in the present invention.

[0058] Figure 4 It is a functional principle block diagram of a preferred embodiment of the terminal in the present invention. DETAILED DESCRIPTION

[0059] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0060] The main disadvantage of the existing online scheduling algorithm based on prediction information is that its technology cannot be directly copied and applied to other scheduling problems. Its technical ideas are not a complete framework for a large category of scheduling problems, so it cannot be applied to other scheduling problems in a simple and convenient way. Especially when the scheduling problem becomes complicated, such as when the number of machines involved in the scheduling increases, the application of its algorithm ideas will be more difficult. Specifically, the existing technology cannot directly give the algorithm based on prediction information and its competitive ratio for CDN scheduling problems, so there is a blank in the research on CDN scheduling problems based on prediction information.

[0061] The present invention specifically targets the algorithm design problem based on prediction information for the semi-heterogeneous CDN scheduling problem, and combines the existing technical ideas to design an online algorithm for this problem, filling the gap in the design of online algorithms based on prediction information in the field of this problem. Similar to the existing technical means, the present invention combines the existing deterministic algorithm with the best competition ratio to design an online algorithm based on prediction information, and analyzes its competition ratio, proving that the competition ratio of the algorithm involved in the present invention can achieve optimal scheduling when the prediction is very accurate, and will not be worse than the aforementioned deterministic algorithm when the prediction is very poor.

[0062] Therefore, the present invention is an online algorithm design and analysis of the cache scheduling problem of a semi-heterogeneous CDN (Content Delivery Network) network based on prediction information, filling the gap in the online algorithm design and analysis of the cache scheduling problem of a semi-heterogeneous CDN network considering prediction information.

[0063] See also Figure 1The online cache scheduling method based on prediction information described in the embodiment of the present invention comprises the following steps:

[0064] Step S100: When a first request for target data is received, a request time of the first request is obtained.

[0065] The present invention obtains the request time of the first request when a certain edge server in the CDN network receives the first request for the target data. Each edge server in the CDN network can run the scheduling algorithm of the present invention to obtain the cache and transmission conditions of the entire CDN network in real time, so as to make scheduling decisions, that is, the edge server makes scheduling decisions by itself.

[0066] The request in the present invention refers to obtaining the target data d. The scheduling of this embodiment is for homogeneous data, such as a movie, which will be copied back and forth on various servers, that is, the scheduling is analyzed based on unit data.

[0067] Specifically, for the cache scheduling problem of semi-heterogeneous CDN networks, there is the following definition:

[0068] (1)P={s1,s2…s m}, refers to a set of servers, each of which can cache a data d.

[0069] (2) R = (r1, r2…r n ), refers to the request sequence. Each request is a two-tuple, namely r i =(s i ,t i ), where s i Refers to which server this request is made to, and t i It refers to the time when the request arrives, that is, the request time.

[0070] (3)θ={λ ij :1≤i≠j≤m}, which refers to the transmission cost matrix, i.e., λ ij Indicates from server s i Transfer d to s j The required cost. If λ ij =∞, it means the two servers are unreachable, otherwise it means the two servers are directly reachable.

[0071] (4)Ω={μ i :1≤i≤m}, refers to the cache cost of each server, that is, μ i Servers i The cost of caching d units of time.

[0072] (5) S refers to the schedule, which is any minimal set of buffers and transmissions that satisfies the following conditions;

[0073] (a) At any time t0≤t≤t n , there is at least one server that has cached d.

[0074] (b) At time t j ,1≤j≤n,server s j Can satisfy the request j . That is, j Either d is stored at this moment or the data can be obtained from another reachable server.

[0075] like Figure 2 The figure shows a scheduling diagram of four servers. The horizontal line represents the timeline, and each timeline corresponds to a server. The black dots represent requests, the horizontal thick black lines represent the cache time of the data on the corresponding server, and each vertical thick black line represents the data transmission during a service.

[0076] (6) C(S) is the scheduling cost. Assuming S is the schedule of n requests, we can use S i It means starting from r1 until service request r i Then, without loss of generality, we can assume that C(S1) = 0, and obtain the cost relationship C(S i )=C(S i-1 )+C(S i-1 ,S i ).

[0077] Where C(S i-1 ,S i ) indicates that at time t i-1 Complete the request i-1 The service is scheduled i-1 In the case of i Service Request i The required caching or transmission cost. Specifically, at time t i For service request i =(s i ,t i ), if s i If there is cached data, then C(S i-1 ,S i ) represents the time from time t i-1 to i The cache cost caused by all cached data servers is combined; if s i If there is no cache data, then C(S i-1 ,S i ) is equal to the cost of one transmission.

[0078] By the above definition, we can get the total cost of scheduling S is C(S n ).by Figure 2 Taking the scheduling in as an example, its scheduling cost is the sum of 4 transmission costs and the length of 4 thick black lines multiplied by the corresponding server unit time cost.

[0079] The problem of the present invention is to find the optimal schedule S * Make the scheduling cost C(S * )minimum.

[0080] According to the characteristics of the transmission cost matrix and the cache cost vector, the following different models can be obtained by changing the constraints:

[0081] (1) Consistent cost model: that is, the transmission cost matrix Θ = {λ ij =λ:1≤i≠j≤m} for all λ ij are equal to a positive constant λ, and Ω={μ i :1≤i≤m} for any μ i are all equal to a positive constant μ.

[0082] (2) Semi-heterogeneous model with consistent transmission cost: Transmission cost matrix Θ = {λ ij =λ:1≤i≠j≤m}, all λ ij are equal to a positive constant λ, and Ω={μ i :1≤i≤m} i are not all equal to a positive constant μ.

[0083] (3) Semi-heterogeneous model of consistent cache cost: Ω = {μ i :1≤i≤m} for any μ i are all equal to a positive constant μ. The transmission cost matrix Θ = {λ ij =λ:1≤i≠j≤m}, all λ ij are not all equal to a positive constant λ.

[0084] (4) Heterogeneous cost model: Ω = {μ i :1≤i≤m} for all μ i are not all equal to a positive constant μ, and the transmission cost matrix Θ = {λ ij =λ:1≤i≠j≤m}, all λ ij They are not all equal to a positive constant λ.

[0085] The problem model studied in the present invention is the semi-heterogeneous CDN network model described in (3).

[0086] like Figure 1 As shown, the online cache scheduling method based on prediction information also includes the following steps:

[0087] Step S200: Update the scheduling cost information of the server cluster at the request time, and obtain the predicted arrival time corresponding to the second request for the target data.

[0088] Specifically, the present invention adds prediction information of request time to the model, and designs a Recaching algorithm with prediction information based on the existing Reactive Caching online algorithm with a competition ratio of 2 (referred to as the Recaching algorithm for short) to achieve the expected effect, which is called the Recaching with Prediction algorithm. This algorithm combines the Reaching algorithm branch and the Prediction algorithm branch, that is, in each request r i =s j ,t i After arrival, the algorithm will receive the prediction from the predictor on the same server s j The time when the next request arrives The algorithm treats this time as the actual arrival time and makes scheduling decisions based on the existing information. If the predictor is very accurate, the competition ratio will be close to 1, and the algorithm will perform as well as the OPT algorithm. However, no matter how poorly the predictor predicts, the competition ratio will not exceed 2.

[0089] In one implementation, the first request includes a target server of the request and a request time, and the predicted arrival time is obtained by predicting the arrival time of the second request on the target server by a predictor.

[0090] In one embodiment, the scheduling cost information includes: a first total scheduling cost generated by running the preset reactive caching algorithm, a second total scheduling cost generated by running the preset predictive scheduling algorithm, and a lower bound of the scheduling cost generated by the OPT algorithm.

[0091] Specifically, the preset prediction scheduling algorithm is a Prediction algorithm, which has the following definition:

[0092] (1)n j (i) Referral and Request i =(s j ,t i ) on the same server j The next request is at the index of the request sequence, i.e., request r i =(s j ,t i )and There are two servers accessed one after the other. j Requests;

[0093] (2) Refers to the request The actual time to reach and access the server;

[0094] (3) Refers to the request given by the predictor The predicted arrival time is the time when request r i =(s j ,t i ) arrives at server s j The next access server s given by the predictor immediately afterwards j The arrival time of the request;

[0095] (4) c: represents the number of servers that still have data cached among all the servers currently. It is maintained by the algorithm and can be checked and modified at any time. It is certain that c ≥ 1, that is, at least one server has data cached.

[0096] (5)Δ j , Δ j =λ\μ j , indicating that the server s j Storage Δ j The storage cost of the time-length data is equal to the transmission cost between servers. This constant plays a pivotal role in scheduling decisions. The prediction part of the algorithm will be based on this constant and the prediction time. dataThe number of surviving servers c and the arrival time of the previous request t i The relationship between the two is used to make comprehensive scheduling decisions.

[0097] (6)T i j ,

[0098] When request r i At time t i Reach Servers j , and among all servers only s j When storing data (i.e., c = 1), the algorithm cannot directly discard the data when scheduling the data, that is, c ≥ 1 must be satisfied. Then the algorithm faces two decisions: one is to cache the data in s j Until a certain time T i To respond to all possible i ,T i j ], and the second is the request coming at time t i Transfer the data to other servers with lower cache costs for caching until time T i jThen transfer it from the server. Since the transmission cost between servers is the same, the best possible choice is to transfer it to s1 for caching. The scheduling cost generated by the two methods will be different at time t' i Therefore, the scheduling algorithm must compare the cost difference between the two methods to select the method with lower cost, that is, T i Can take a value so that (t i ,T i j ] time, cache data in s j The cost of transferring it to s1 for caching will not exceed the total cost of transferring it to s1 for caching. i To make a decision, then in s j Cache up to time t' p(i) The cost required is μ j (T i j -t i ), but choose to transfer to s1 for caching and i The cost of transmitting from s1 at time is 2λ+μ1(T i j -t i ), then at time T i j Depend on That is T i j ≤2λ\(μ j -μ1)+t i When s j Cache up to T i j The cost required is no more than the total cost of transferring it to s1 for caching, so in this case the scheduling algorithm will choose to cache data in s j Otherwise, it is transferred to s1 for cache. It is certain that T i j ≥t i +2Δ j .

[0099] like Figure 1 As shown, in one embodiment, the online cache scheduling method based on prediction information further includes the following steps:

[0100] Step S300: Estimate the worst competition ratio of running a preset prediction scheduling algorithm according to the scheduling cost information and the predicted arrival time.

[0101] In one embodiment, the step S300 specifically includes:

[0102] Obtaining a time threshold range of the actual arrival time of the second request according to the predicted arrival time, the time threshold range comprising: a first time threshold range, a second time threshold range and a third time threshold range;

[0103] estimating a first competitive ratio for running a preset prediction scheduling algorithm when the actual arrival time is within the first time threshold range;

[0104] A second competitive ratio for running a preset prediction scheduling algorithm when estimating the actual arrival time is within the second time threshold range;

[0105] estimating a third competitive ratio of running a preset prediction scheduling algorithm when the actual arrival time is within the third time threshold range;

[0106] taking the maximum value among the first competition ratio, the second competition ratio and the third competition ratio as the worst competition ratio;

[0107] The first time threshold range is the time between the request time and the predicted arrival time, that is, the actual arrival time. The second time threshold range is the time between the predicted arrival time and the constant time, that is, the actual arrival time The constant time is obtained by the sum of the predicted arrival time and the constant duration, the constant duration is calculated in advance, and the storage cost required to store the target data of the constant duration is equal to the transmission cost between servers; the third time threshold range is greater than the constant time, that is, the actual arrival time

[0108] Specifically, the core idea of ​​the present invention is that at t i The time predictor gives s j The predicted time of the next request arrival Then, the scheduling cost generated in each case in the above-mentioned Prediction scheduling strategy and the corresponding cost lower bound of the OPT algorithm are calculated, that is, according to the prediction time and actual time The relationship between the competition ratio in each case is calculated The algorithm selects the Recaching branch if the maximum value exceeds 2, otherwise it selects the Prediction branch. The following definitions are included:

[0109] (1)F, F=(f1,f2…f n ), is a set of 0-1 vectors of the same size as the request sequence vector R, where f i =0 represents request r i is scheduled by the Recaching branch, and fi =1 represents request r i It is scheduled by the Prediction branch.

[0110] (2)RC i Refers to the request i =(s j ,t i ) arrives, until t i At time t, the total scheduling cost generated when the Recaching branch is used for scheduling in the algorithm is,

[0111] (3) PC i Refers to the request i =(s j ,t i ) arrives, until t i At time t, the total scheduling cost generated when the Prediction branch is used for scheduling in the algorithm is,

[0112] (4)OPT i , in the request r i =(s j ,t i ) arrives, until t i At time t, the scheduling cost lower bound generated by the OPT algorithm.

[0113] (5) An m-dimensional vector of the same size as the server set, where E[j] represents the server s j The time when the most recent data cache expires.

[0114] In this way, the present invention judges and decides which branch to select for the next scheduling, and ensures that the contention ratio does not exceed 2.

[0115] like Figure 1 As shown, in one embodiment, the online cache scheduling method based on prediction information further includes the following steps:

[0116] Step S400: If the worst competition ratio is less than or equal to a preset threshold, the preset prediction scheduling algorithm is run to obtain an optimal scheduling decision.

[0117] Specifically, the preset threshold is set to 2, that is, to ensure that the contention ratio does not exceed 2. In the algorithm designed by the present invention, each request r i =(s j ,t i ) arrives, server s j First respond to the request, that is, data in t iThe moment must have been j (data or transmitted from other servers or in t i The moment is already in s j ), and then the predictor immediately gives the server s j Previous, next request The predicted arrival time The scheduling algorithm regards this time as the actual arrival time of the next request and Analyze the optimal scheduling decision. The algorithm will integrate c, t i as well as To schedule the data using the preset prediction scheduling algorithm.

[0118] In one embodiment, the preset prediction scheduling algorithm includes: a first sub-condition scheduling strategy and a second sub-condition scheduling strategy under the first condition, and a third sub-condition scheduling strategy, a fourth sub-condition scheduling strategy and a fifth sub-condition scheduling strategy under the second condition;

[0119] The first condition is that: at the request time, the number c of data surviving servers is greater than 1, and the number c of data surviving servers is the number of servers in the server cluster that currently cache the target data;

[0120] The operation steps of the first sub-condition scheduling strategy include:

[0121] If the predicted arrival time is within a preset first time range, the target data is cached until the predicted arrival time is reached, and the preset first time range is the time between the request time and the constant time;

[0122] Determine the number of surviving servers for the predicted arrival time;

[0123] If the current number of surviving data servers is greater than 1, the target data is deleted and the number of surviving data servers is updated;

[0124] If the number of current data surviving servers is equal to 1, determine the cache cost number corresponding to the current server, where the cache cost number is obtained by sorting the servers in the server cluster in order of cache cost from small to large;

[0125] If the cache cost number corresponding to the current server is the first number, the third sub-condition scheduling strategy is executed;

[0126] If the cache cost number corresponding to the current server is not the first number, the fourth sub-condition scheduling strategy is executed;

[0127] Specifically, in the CDN studied by the algorithm of this embodiment, the cache costs of each server may be different, but the transmission costs between them are consistent. S1 is the one with the lowest cache cost. In this embodiment, the servers can be sorted according to the cache cost, and the server with the lowest cache cost is labeled S1.

[0128] The operation steps of the second sub-condition scheduling strategy include:

[0129] If the predicted arrival time is within a preset second time range, the target data is deleted and the second value is updated; the preset second time range is a time greater than the constant moment.

[0130] Specifically, the first condition is described as follows:

[0131] Sche1, at time t i , if c>1:

[0132] A. If Save data to Then judge in The value of c at time instant.

[0133] a. If c>1, then Always discard data and set c←c-1.

[0134] b. If c = 1, then if j = 1, then t i Sche 2A will be executed, otherwise Sche 2B will be executed.

[0135] B. If Then discard data immediately and set c←c-1.

[0136] In one embodiment, the second condition is: at the request time, the number of data surviving servers is equal to 1;

[0137] The operation steps of the third sub-condition scheduling strategy include:

[0138] If the cache cost number corresponding to the current server is the first number, cache the target data until the actual arrival time of the second request is reached;

[0139] The operation steps of the fourth sub-condition scheduling strategy include:

[0140] If the cache cost number corresponding to the current server is not the first number, and the predicted arrival time is within the preset third time range, the target data is cached until the predicted arrival time is reached, and the number of servers surviving the data is monitored in real time;

[0141] If the current time is between the request time and the predicted arrival time, and the number of surviving data servers is updated to a value greater than 1, the current time is used as the new request time, and the first sub-condition scheduling strategy and the second sub-condition scheduling strategy under the first condition are executed;

[0142] If the number of data surviving servers does not change, cache the target data until the predicted arrival time is reached, and determine the number of data surviving servers at the predicted arrival time;

[0143] If the number of surviving servers for the data at the predicted arrival time is greater than 1, the target data is deleted when the predicted arrival time is reached, and the number of surviving servers for the data is updated;

[0144] If the number of surviving servers for data at the predicted arrival time is equal to 1, the target data is transmitted to the server whose cache cost number is the first number.

[0145] The preset third time range is from the request time to the threshold time, at which the cache cost of the target data in the current server cache is the same as the scheduling cost generated by transmitting to the first numbered server cache;

[0146] The operation steps of the fifth sub-condition scheduling strategy include:

[0147] If the cache cost number corresponding to the current server is not the first number, and the predicted arrival time is within a preset fourth time range, the target data is transmitted to the server whose cache cost number is the first number, and the preset fourth time range is greater than the threshold time.

[0148] Specifically, the second condition is described as follows:

[0149] Sche2, at time t i , if c=1:

[0150] A. If j = 1: cache data until the next request r i+1 The actual arrival time t i+1 If the target server of the request is not s1, the data is transferred to the server s corresponding to the request. j And discard the data.

[0151] B. If j≠1, and Try caching to moment, and then determine the change of c value every moment:

[0152] a. If There is a time t' i =ti+1 , c>1, then the algorithm will t' i As a new t i , execute the scheduling strategy of Sche1.

[0153] b. On the contrary, the algorithm will cache data to Then judge in The value of c at time. If c>1, then Discard data at any time and set c←c-1; if c=1, transfer data to s1 and cache it until Then take this moment as t of s1 i , and based on the predicted next request arrival time on s1, execute Sche 1 on s1.

[0154] C. If j≠1, and Then transfer the data to s1 and cache it until Then take this moment as t of s1 i , and based on the predicted next request arrival time on s1, execute Sche 1 on s1.

[0155] In one implementation, the step S300 further includes: if the worst competition ratio is greater than a preset threshold, running a preset reactive caching algorithm. The preset reactive caching algorithm refers to the Reactive Caching online algorithm (referred to as the Recaching algorithm). That is to say, the online algorithm based on prediction information for the semi-heterogeneous CDN network scheduling problem proposed in the present invention is intended to achieve the offline optimal result when the given prediction information is very accurate, and when the prediction deviation is large, the existing deterministic algorithm with a competition ratio of 2, namely the Recaching algorithm, is selected.

[0156] The competitive ratio of the algorithm of the present invention is

[0157] As shown in the following table, it is a pseudo code description of the Recaching with Prediction algorithm.

[0158]

[0159]

[0160] As shown in the following table, it is a pseudo code description of the Prediction algorithm.

[0161]

[0162]

[0163]

[0164]

[0165] The present invention is based on the same CDN scheduling problem. The design method of prediction information proposed by the present invention is unique and is an algorithm for this problem. For the semi-heterogeneous CDN model and the designed prediction information, the online algorithm designed by the present invention has achieved the optimal result, that is, when the prediction is accurate, the competition ratio of the algorithm continues to reach 1, that is, OPT, and when the prediction is inaccurate, it will not exceed 2. In addition, the present invention has achieved the optimal under the semi-heterogeneous CDN problem. For all algorithms for CDN scheduling problems, the framework of this algorithm can be applied to achieve the corresponding effect.

[0166] In one embodiment, if Figure 2 As shown, based on the above-mentioned online cache scheduling method based on prediction information, the present invention also provides an online cache scheduling device based on prediction information, including:

[0167] The receiving module 100 is configured to obtain a request time of a first request for target data when the first request is received;

[0168] An acquisition module 200 is used to update the scheduling cost information of the server cluster at the request time, and obtain the predicted arrival time corresponding to the second request for the target data;

[0169] An estimation module 300, configured to estimate a worst competition ratio of running a preset prediction scheduling algorithm according to the scheduling cost information and the predicted arrival time;

[0170] The decision module 400 is used to run the preset prediction scheduling algorithm to obtain the optimal scheduling decision if the worst competition ratio is less than or equal to a preset threshold.

[0171] In one embodiment, if Figure 3 As shown, based on the above-mentioned online cache scheduling method based on prediction information, the present invention also provides a terminal accordingly, including: a memory 20, a processor 10, and an online cache scheduling program 30 based on prediction information stored in the memory 20 and executable on the processor 10, wherein the online cache scheduling program 30 based on prediction information implements the steps of the online cache scheduling method based on prediction information as described above when executed by the processor 10.

[0172] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program can be executed to implement the steps of the online cache scheduling method based on prediction information as described above.

[0173] In summary, the present invention discloses an online cache scheduling method and device based on prediction information, the method comprising: when a first request for target data is received, obtaining the request time of the first request; updating the scheduling cost information of the server cluster at the request time, and obtaining the predicted arrival time corresponding to the second request for the target data; estimating the worst competition ratio of running a preset prediction scheduling algorithm based on the scheduling cost information and the predicted arrival time; if the worst competition ratio is less than or equal to a preset threshold, running the preset prediction scheduling algorithm to obtain the optimal scheduling decision. The present invention uses the predicted next arrival time of each request to obtain the worst competition ratio. When the worst competition ratio is less than or equal to the preset threshold, the preset prediction scheduling algorithm can calculate the optimal scheduling decision, thereby achieving a lower scheduling cost.

[0174] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.

Claims

1. An online cache scheduling method based on prediction information, characterized in that: The method comprises: When receiving a first request for target data, obtaining a request time of the first request; Update the scheduling cost information of the server cluster at the request time, and obtain the predicted arrival time corresponding to the second request for the target data; estimating the worst competition ratio of running a preset prediction scheduling algorithm according to the scheduling cost information and the predicted arrival time; If the worst competition ratio is less than or equal to a preset threshold, the preset prediction scheduling algorithm is run to obtain an optimal scheduling decision; The preset prediction scheduling algorithm includes: a third sub-condition scheduling strategy, a fourth sub-condition scheduling strategy and a fifth sub-condition scheduling strategy under the second condition; The second condition is: at the request time, the number of data surviving servers is equal to 1; The operation steps of the third sub-condition scheduling strategy include: If the cache cost number corresponding to the current server is the first number, cache the target data until the actual arrival time of the second request is reached; The operation steps of the fourth sub-condition scheduling strategy include: If the cache cost number corresponding to the current server is not the first number, and the predicted arrival time is within the preset third time range, the target data is cached until the predicted arrival time is reached, and the number of servers surviving the data is monitored in real time; If the current time is between the request time and the predicted arrival time, and the number of surviving data servers is updated to a value greater than 1, the current time is used as the new request time, and the first sub-condition scheduling strategy and the second sub-condition scheduling strategy under the first condition are executed; If the number of data surviving servers does not change, cache the target data until the predicted arrival time is reached, and determine the number of data surviving servers at the predicted arrival time; If the number of surviving servers for the data at the predicted arrival time is greater than 1, the target data is deleted when the predicted arrival time is reached, and the number of surviving servers for the data is updated; If the number of surviving servers for data at the predicted arrival time is equal to 1, the target data is transmitted to the server with the first cache cost number; The preset third time range is from the request time to the threshold time, at which the cache cost of the target data in the current server cache is the same as the scheduling cost generated by transmitting to the first numbered server cache; The operation steps of the fifth sub-condition scheduling strategy include: If the cache cost number corresponding to the current server is not the first number, and the predicted arrival time is within a preset fourth time range, the target data is transmitted to the server whose cache cost number is the first number, and the preset fourth time range is greater than the threshold time.

2. The online cache scheduling method based on prediction information according to claim 1, characterized in that: The first request includes a target server of the request and a request time, and the predicted arrival time is obtained by predicting the arrival time of the second request on the target server by a predictor.

3. The online cache scheduling method based on prediction information according to claim 1, characterized in that: The worst competition ratio of running a preset prediction scheduling algorithm is estimated according to the scheduling cost information and the predicted arrival time, including: Obtaining a time threshold range of the actual arrival time of the second request according to the predicted arrival time, the time threshold range comprising: a first time threshold range, a second time threshold range and a third time threshold range; estimating a first competitive ratio for running a preset prediction scheduling algorithm when the actual arrival time is within the first time threshold range; A second competitive ratio for running a preset prediction scheduling algorithm when estimating the actual arrival time is within the second time threshold range; estimating a third competitive ratio of running a preset prediction scheduling algorithm when the actual arrival time is within the third time threshold range; taking the maximum value among the first competition ratio, the second competition ratio and the third competition ratio as the worst competition ratio; Among them, the first time threshold range is the time between the request time and the predicted arrival time; the second time threshold range is the time between the predicted arrival time and the constant time, the constant time is obtained by the sum of the predicted arrival time and the constant duration, the constant duration is calculated in advance, and the storage cost required to store the target data of the constant duration is equal to the transmission cost between servers; the third time threshold range is greater than the constant time.

4. The online cache scheduling method based on prediction information according to claim 1, characterized in that: After estimating the worst competition ratio of running a preset prediction scheduling algorithm according to the scheduling cost information and the predicted arrival time, the method further includes: If the worst contention ratio is greater than a preset threshold, a preset reactive caching algorithm is run.

5. The online cache scheduling method based on prediction information according to claim 4, characterized in that: The scheduling cost information includes: a first total scheduling cost generated by running the preset reactive caching algorithm, a second total scheduling cost generated by running the preset predictive scheduling algorithm, and a lower bound of the scheduling cost generated by the OPT algorithm.

6. The online cache scheduling method based on prediction information according to claim 3, characterized in that: The preset prediction scheduling algorithm also includes: a first sub-condition scheduling strategy and a second sub-condition scheduling strategy under the first condition; The first condition is that: at the request time, the number of surviving data servers is greater than 1, and the number of surviving data servers is the number of servers in the server cluster that currently cache the target data; The operation steps of the first sub-condition scheduling strategy include: If the predicted arrival time is within a preset first duration range, the target data is cached until the predicted arrival time is reached, and the preset first duration range is the time between the request time and the constant time; Determine the number of surviving servers for the predicted arrival time; If the current number of surviving data servers is greater than 1, the target data is deleted and the number of surviving data servers is updated; If the number of current data surviving servers is equal to 1, determine the cache cost number corresponding to the current server, where the cache cost number is obtained by sorting the servers in the server cluster in order of cache cost from small to large; If the cache cost number corresponding to the current server is the first number, the third sub-condition scheduling strategy is executed; If the cache cost number corresponding to the current server is not the first number, the fourth sub-condition scheduling strategy is executed; The operation steps of the second sub-condition scheduling strategy include: If the predicted arrival time is within a preset second duration range, the target data is deleted and the second value is updated; the preset second duration range is a time greater than the constant moment.

7. An online cache scheduling device based on prediction information, characterized in that: include: A receiving module, configured to obtain a request time of a first request for target data when receiving the first request; An acquisition module, used to update the scheduling cost information of the server cluster at the request time, and obtain the predicted arrival time corresponding to the second request for the target data; An estimation module, configured to estimate a worst competition ratio of running a preset prediction scheduling algorithm according to the scheduling cost information and the predicted arrival time; A decision module, configured to run the preset prediction scheduling algorithm to obtain an optimal scheduling decision if the worst competition ratio is less than or equal to a preset threshold; The preset prediction scheduling algorithm includes: a third sub-condition scheduling strategy, a fourth sub-condition scheduling strategy and a fifth sub-condition scheduling strategy under the second condition; The second condition is: at the request time, the number of data surviving servers is equal to 1; The operation steps of the third sub-condition scheduling strategy include: If the cache cost number corresponding to the current server is the first number, cache the target data until the actual arrival time of the second request is reached; The operation steps of the fourth sub-condition scheduling strategy include: If the cache cost number corresponding to the current server is not the first number, and the predicted arrival time is within the preset third time range, the target data is cached until the predicted arrival time is reached, and the number of servers surviving the data is monitored in real time; If the current time is between the request time and the predicted arrival time, and the number of surviving data servers is updated to a value greater than 1, the current time is used as the new request time, and the first sub-condition scheduling strategy and the second sub-condition scheduling strategy under the first condition are executed; If the number of data surviving servers does not change, cache the target data until the predicted arrival time is reached, and determine the number of data surviving servers at the predicted arrival time; If the number of surviving servers for the data at the predicted arrival time is greater than 1, the target data is deleted when the predicted arrival time is reached, and the number of surviving servers for the data is updated; If the number of surviving servers for data at the predicted arrival time is equal to 1, the target data is transmitted to the server with the first cache cost number; The preset third time range is from the request time to the threshold time, at which the cache cost of the target data in the current server cache is the same as the scheduling cost generated by transmitting to the first numbered server cache; The operation steps of the fifth sub-condition scheduling strategy include: If the cache cost number corresponding to the current server is not the first number, and the predicted arrival time is within a preset fourth time range, the target data is transmitted to the server whose cache cost number is the first number, and the preset fourth time range is greater than the threshold time.

8. A terminal, characterized in that: include: A memory, a processor, and an online cache scheduling program based on prediction information stored in the memory and executable on the processor, wherein the online cache scheduling program based on prediction information, when executed by the processor, implements the steps of the online cache scheduling method based on prediction information as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program can be executed to implement the steps of the online cache scheduling method based on prediction information as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and device for scheduling cloud server resources

    CN114840341A

  • Method and system for distributing data, scheduling device, scheduling program and storage medium with scheduling program stored therein

    JP2002259260A