WO2021135301A1 - 一种应用升级的方法和计算机设备 - Google Patents

一种应用升级的方法和计算机设备 Download PDF

Info

Publication number
WO2021135301A1
WO2021135301A1 PCT/CN2020/111319 CN2020111319W WO2021135301A1 WO 2021135301 A1 WO2021135301 A1 WO 2021135301A1 CN 2020111319 W CN2020111319 W CN 2020111319W WO 2021135301 A1 WO2021135301 A1 WO 2021135301A1
Authority
WO
WIPO (PCT)
Prior art keywords
bandwidth
download
occupied
terminal
threshold
Prior art date
Application number
PCT/CN2020/111319
Other languages
English (en)
French (fr)
Inventor
陈贻斌
Original Assignee
深圳Tcl新技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳Tcl新技术有限公司 filed Critical 深圳Tcl新技术有限公司
Publication of WO2021135301A1 publication Critical patent/WO2021135301A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating

Definitions

  • the present disclosure relates to the field of Internet application technology, and in particular to an application upgrade method and computer equipment.
  • Traffic is a kind of transmission quantity, specifically refers to the amount of data transmitted through the network.
  • Peak bandwidth refers to the maximum value of the instantaneous traffic allowed by the site.
  • the Internet channel has been used as the core channel for the application of smart terminal products, and a large number of users pass through the network. Obtaining the upgrade file, the traffic cost brought by it is an important element that Internet companies need to consider.
  • CDN Content Delivery Network
  • the technical problem to be solved by the present disclosure is to provide an application upgrade method and computer equipment.
  • the number of concurrent downloads is limited by occupying the bandwidth, so as to reduce the bandwidth and peak value occupied by the terminal that downloads the application upgrade file at the same time.
  • the gap between the bandwidth so that manufacturers can more accurately limit the current.
  • an embodiment of the present disclosure provides an application upgrade method, which is applied to a server in an application upgrade system, the application upgrade system further includes a terminal, and the method includes:
  • the download request is added to the waiting queue, and a waiting instruction is sent to the terminal to monitor the bandwidth occupied by the terminal downloading the upgrade file and several candidate download requests in the waiting queue When the sum of the corresponding bandwidths is less than or equal to the threshold, a download instruction is sent to the terminal, wherein the upgrade sequence of the candidate download request precedes the upgrade sequence of the download request.
  • the obtaining the bandwidth to be downloaded corresponding to the download request includes:
  • the occupied bandwidth is determined according to the respective download speeds of the respective terminals in the downloading state.
  • the obtaining occupied bandwidth according to the download request includes:
  • the download request includes a test download speed; the obtaining the bandwidth to be downloaded corresponding to the download request includes:
  • the bandwidth to be downloaded is determined according to the test download speed.
  • the judging whether the occupied bandwidth is less than a preset threshold specifically includes:
  • adding the download request to the waiting queue includes:
  • the download request is added to the last bit of the waiting queue.
  • the sum of the bandwidth occupied by the terminal that is downloading the upgrade file and the bandwidth corresponding to a number of candidate download requests in the waiting queue is monitored.
  • the download instruction is sent to The terminal includes:
  • the sum of the bandwidth occupied by the terminal that is downloading the upgrade file and the bandwidth corresponding to a number of candidate download requests in the waiting queue is monitored.
  • the download instruction is sent to The terminal includes:
  • the sum of the bandwidth occupied by the terminal downloading the upgrade file and the bandwidth corresponding to several candidate download requests in the waiting queue is monitored, and when the sum is less than or equal to the threshold, a download instruction is sent to the Terminal, including:
  • the method further includes:
  • the pending download request is deleted from the waiting queue.
  • embodiments of the present disclosure provide an application upgrade method, which is applied to a terminal in an application upgrade system, the application upgrade system further includes a server, and the method includes:
  • Receive an instruction including the server when the occupied bandwidth is less than or equal to the threshold, or when the sum of the bandwidth occupied by the terminal downloading the upgrade file and the bandwidth corresponding to several candidate download requests in the waiting queue is less than Or a download instruction sent when the threshold is equal to, and a waiting instruction sent by the server when the occupied bandwidth is greater than the threshold.
  • the method further includes:
  • the download speed of the download upgrade file is sent to the server every preset time interval, so that the server can determine the terminal that is downloading the upgrade file according to the download speed of the download upgrade file The occupied bandwidth to get the updated occupied bandwidth.
  • an embodiment of the present disclosure provides an application upgrade system, the system including a terminal and a server;
  • the terminal is configured to send a download request to the server, so that the server obtains the occupied bandwidth according to the download request, and determines whether the occupied bandwidth is less than a preset threshold, wherein the occupied bandwidth is downloading an upgrade
  • the bandwidth occupied by the terminal of the file if the occupied bandwidth is less than the threshold, then receive a download instruction sent by the server; if the occupied bandwidth is greater than or equal to the threshold, receive a waiting instruction sent by the server;
  • the server is configured to receive a download request and obtain the occupied bandwidth according to the download request, where the occupied bandwidth is the bandwidth occupied by the terminal that is downloading the upgrade file; determine whether the occupied bandwidth is less than a preset threshold; If the occupied bandwidth is less than or equal to the threshold, a download instruction is sent to the terminal so that the terminal downloads the upgrade file according to the download instruction; if the occupied bandwidth is greater than the threshold, the download The request is added to the waiting queue, and the waiting instruction is sent to the terminal.
  • an embodiment of the present disclosure provides a computer device, including a memory and a processor, the memory stores a computer program, and the processor implements the following steps when the computer program is executed:
  • the download request is added to the waiting queue, and a waiting instruction is sent to the terminal to monitor the bandwidth occupied by the terminal downloading the upgrade file and several candidate download requests in the waiting queue When the sum of the corresponding bandwidths is less than or equal to the threshold, sending a download instruction to the terminal, wherein the upgrade sequence of the candidate download request precedes the upgrade sequence of the download request;
  • Receive an instruction including the server when the occupied bandwidth is less than or equal to the threshold, or when the sum of the bandwidth occupied by the terminal downloading the upgrade file and the bandwidth corresponding to several candidate download requests in the waiting queue is less than Or a download instruction sent when the threshold is equal to, and a waiting instruction sent by the server when the occupied bandwidth is greater than the threshold.
  • embodiments of the present disclosure provide a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
  • the download request is added to the waiting queue, and a waiting instruction is sent to the terminal to monitor the bandwidth occupied by the terminal downloading the upgrade file and several candidate download requests in the waiting queue When the sum of the corresponding bandwidths is less than or equal to the threshold, sending a download instruction to the terminal, wherein the upgrade sequence of the candidate download request precedes the upgrade sequence of the download request;
  • Receive an instruction including the server when the occupied bandwidth is less than or equal to the threshold, or when the sum of the bandwidth occupied by the terminal downloading the upgrade file and the bandwidth corresponding to several candidate download requests in the waiting queue is less than Or a download instruction sent when the threshold is equal to, and a waiting instruction sent by the server when the occupied bandwidth is greater than the threshold.
  • the terminal sends a download request to the server, the server receives the download request, and obtains the occupied bandwidth according to the download request, where the occupied bandwidth is the bandwidth occupied by the terminal that is downloading the upgrade file; Whether the occupied bandwidth is less than a preset threshold; if the occupied bandwidth is less than or equal to the threshold, a download instruction is sent to the terminal; if the occupied bandwidth is greater than the threshold, the download request is added to the waiting queue , And send a waiting instruction to the terminal, monitor the sum of the bandwidth occupied by the terminal downloading the upgrade file and the bandwidth corresponding to several candidate download requests in the waiting queue, and when the sum is less than or equal to the threshold, send the download Command to the terminal, wherein the upgrade sequence of the candidate download request is earlier than the upgrade sequence of the download request.
  • the present disclosure uses bandwidth to determine when a download request is responded to.
  • the download instruction When receiving a download request, if the occupied bandwidth is less than or equal to the threshold, the download instruction will be responded immediately, and if the occupied bandwidth is greater than the threshold, the download instruction will be placed in the waiting queue, and then Monitor the bandwidth occupied by the upgrade file being downloaded and the bandwidth of the pending download instruction in the waiting queue, and then determine the time to respond to the download instruction.
  • the number of terminals that download the upgrade file in parallel through the bandwidth limit is used to reduce the simultaneous download of the upgrade
  • the gap between the bandwidth occupied by the file and the threshold so that manufacturers can limit the current more accurately, in order to achieve the greatest possible cost savings.
  • FIG. 1 is a schematic flowchart of an application upgrade method in an embodiment of the disclosure
  • FIG. 2 is a schematic diagram of another process of an application upgrade method in an embodiment of the present disclosure
  • Fig. 3 is an internal structure diagram of a computer device in an embodiment of the disclosure.
  • the terminal sends a download request to the server, the server receives the download request, and obtains the occupied bandwidth according to the download request, where the occupied bandwidth is occupied by the terminal downloading the upgrade file Bandwidth; determine whether the occupied bandwidth is less than a preset threshold; if the occupied bandwidth is less than or equal to the threshold, send a download instruction to the terminal; if the occupied bandwidth is greater than the threshold, download the The request is added to the waiting queue, and a waiting instruction is sent to the terminal to monitor the sum of the bandwidth occupied by the terminal downloading the upgrade file and the bandwidth corresponding to several candidate download requests in the waiting queue. When the sum is less than or equal to the When the threshold is set, a download instruction is sent to the terminal, wherein the upgrade sequence of the candidate download request is earlier than the upgrade sequence of the download request.
  • the present disclosure uses bandwidth to determine when a download request is responded to.
  • bandwidth determines when a download request is responded to.
  • the download instruction When receiving a download request, if the occupied bandwidth is less than or equal to the threshold, the download instruction will be responded immediately, and if the occupied bandwidth is greater than the threshold, the download instruction will be placed in the waiting queue, and then Monitor the bandwidth occupied by the upgrade file being downloaded and the bandwidth of the pending download instruction in the waiting queue, and then determine the time to respond to the download instruction.
  • the number of terminals that download the upgrade file in parallel is limited by the bandwidth to reduce the number of simultaneous downloads of the upgrade file
  • the gap between the occupied bandwidth and the threshold so that manufacturers can more accurately limit the current, in order to achieve the greatest degree of cost savings.
  • the application upgrade method provided by the present disclosure can be applied to an application upgrade system.
  • the application upgrade system includes a terminal and a server.
  • the terminal can be, but is not limited to, a computer, a notebook computer, or a mobile phone that needs to be upgraded. , Tablet PCs, On-board computers, TVs, On-board computers, portable wearable devices.
  • an application upgrade method in an embodiment of the present disclosure is shown.
  • the method may include the following steps, for example:
  • the terminal sends a download request to the server.
  • the terminal that sends the download request is a terminal that needs to perform an application upgrade
  • the server provides an upgrade file distribution service
  • the download request is used to request the server to download the application upgrade file.
  • the server receives the download request, and obtains the occupied bandwidth according to the download request, where the occupied bandwidth is the bandwidth occupied by the terminal that is downloading the upgrade file.
  • the bandwidth is the abbreviation of frequency bandwidth, which refers to the amount of data that can be transmitted in a unit time in the network.
  • the terminal that is downloading the upgrade file will occupy the bandwidth of the server.
  • obtaining the occupied bandwidth means obtaining the bandwidth occupied by downloading the upgrade file.
  • the server obtains the download speed of each terminal in the downloading state (terminal downloading the upgrade file), and determines the bandwidth of each terminal in the downloading state according to the download speed of each terminal in the downloading state, and then determines the occupied bandwidth. The specific steps for obtaining the occupied bandwidth will be explained in detail later.
  • the server determines whether the occupied bandwidth is less than a preset threshold.
  • the threshold may be the peak bandwidth; in order to ensure that the bandwidth occupied by downloading the upgrade file in a unit time will not exceed the bandwidth quota and at the same time reserve space to deal with emergencies, the threshold may be 80% of the peak bandwidth.
  • the server sends a download instruction to the terminal, so that the terminal downloads the upgrade file according to the download instruction.
  • the server can also provide bandwidth for downloading upgrade files, and then sends a download instruction to the terminal; if the occupied bandwidth is equal to the threshold, it indicates the current occupied bandwidth of the server The threshold is just met. Since the threshold can be 80% of the peak bandwidth, the download instruction can also be sent to the terminal immediately, so that the terminal can start downloading the upgrade file.
  • the server adds the download request to the waiting queue, and sends a waiting instruction to the terminal, and monitors the bandwidth occupied by the terminal downloading the upgrade file and the number in the waiting queue.
  • the server adds the download request to the waiting queue, and sends a waiting instruction to the terminal, and monitors the bandwidth occupied by the terminal downloading the upgrade file and the number in the waiting queue.
  • the terminal sending the download request cannot download the upgrade file immediately, and the server adds the download request to the waiting queue. Then, the server monitors the occupied bandwidth, the threshold, and candidates in the waiting queue. The bandwidth corresponding to the download request.
  • the server adds the download request to the waiting queue, and the waiting queue includes at least one download request to be processed.
  • the candidate download request is in the waiting queue, and the upgrade order is before the waiting queue of the download request.
  • the processed download request if the download request ranks first in the upgrade order in the waiting queue, there is no candidate request.
  • the upgrade order in the waiting queue may be determined according to the priority of the download request to be processed, and the upgrade order of the download request with a higher priority is higher than the upgrade order of the download request with a lower priority.
  • the stack controls the download requests to be processed in a first-in, first-out manner.
  • the server puts the download request into the waiting queue, it puts the download request on the top of the stack, and the server first sends a download instruction to the terminal corresponding to the pending download request at the bottom of the stack.
  • the terminal receives an instruction, where the instruction includes the bandwidth occupied by the server when the occupied bandwidth is less than or equal to the threshold, or the bandwidth occupied by the terminal downloading the upgrade file and the bandwidth corresponding to several candidate download requests in the waiting queue A download instruction sent when the sum of is less than or equal to the threshold, and a waiting instruction sent by the server when the occupied bandwidth is greater than the threshold.
  • the download instruction includes a download address
  • the terminal receives the download instruction and downloads the upgrade file from the server according to the download address; the terminal receives the waiting instruction to learn that the current server cannot provide the download service.
  • the bandwidth is used to determine the time when a download request is responded to.
  • the download instruction When receiving a download request, if the occupied bandwidth is less than or equal to the threshold, the download instruction will be responded to immediately, and if the occupied bandwidth is greater than the threshold, the download instruction will be placed in a wait Queue, and then monitor the bandwidth occupied by the downloading upgrade file and the bandwidth of the download instruction waiting in the queue to determine the time to respond to the download instruction.
  • the number of terminals that download the upgrade file in parallel is limited by bandwidth to reduce the number of simultaneous download instructions.
  • the gap between the bandwidth occupied by downloading the upgrade file and the threshold so that manufacturers can limit the current more accurately to achieve the greatest cost savings.
  • step S2 includes:
  • the server obtains the respective download speeds corresponding to the respective terminals in the downloading state.
  • the server when receiving a download request, notifies each terminal in the downloading state to report its download speed, and each terminal in the downloading state can measure the download speed through a third-party speed measurement server and send it to the server.
  • the server determines the occupied bandwidth according to the respective download speeds corresponding to the respective terminals in the downloading state.
  • the bandwidth corresponding to each terminal in the downloading state is first calculated, and there is a conversion relationship between the bandwidth and the download speed.
  • the download speed of a 20M bandwidth can reach 20Mbit/s.
  • the download speed corresponding to the broadband is: 256KB/s (that is, 2048Kb/s); calculate the sum of the bandwidth corresponding to each terminal in the downloading state to obtain the occupied bandwidth.
  • step S2 further includes:
  • the server obtains the bandwidth to be downloaded corresponding to the download request.
  • the download request includes a test download speed; the obtaining the bandwidth to be downloaded corresponding to the download request includes: determining the bandwidth to be downloaded according to the test download speed.
  • the download request includes the test download speed of the terminal, so that the server can learn the bandwidth corresponding to the download request according to the test download speed.
  • the terminal Before the terminal sends the download request, the terminal has obtained the test download speed.
  • the test download speed may be obtained by the terminal through a third-party speed measurement server.
  • the terminal Before sending the download request, the terminal sends a speed measurement request to the speed measurement server to obtain the test download speed.
  • the terminal before the terminal sends a download request to the server, the terminal sends a speed measurement request to the speed measurement server, the speed measurement server sends a speed measurement address to the terminal according to the speed measurement request, and the terminal according to the tester
  • the test file is downloaded from the address, the transmission speed of the test file is the test download speed of the terminal, and the terminal receives the test download speed fed back by the test server.
  • a download request including the test download speed is sent to the server.
  • the bandwidth to be downloaded corresponding to the download request is obtained according to the test download speed.
  • the sum of the bandwidth to be downloaded and the occupied bandwidth is used as the updated occupied bandwidth, so that it is determined in step S3 whether the occupied bandwidth is less than a preset threshold, which is equivalent to judging that the upgrade file is being downloaded. Whether the sum of the bandwidth of and the bandwidth to be downloaded corresponding to the download request is less than the threshold, that is, it is determined whether the difference between the bandwidth occupied by the downloading upgrade file and the threshold is sufficient to provide download services for the terminal corresponding to the download request. In this implementation manner, the bandwidth occupied when the server provides the download service will not be greater than the threshold.
  • step S3 includes:
  • the server judges whether there is a download request to be processed in the waiting queue.
  • the server when there is a download request to be processed in the server, it means that before the download request is received in step S2, the server has received other download requests, and the server does not have free bandwidth to provide the terminal corresponding to the partial download request Download service. Therefore, in theory, download service should be provided to the terminal corresponding to the download request with the earlier sending time, or the terminal corresponding to the download request with high priority should be provided with the download service. Therefore, it cannot pass the waiting queue to be processed.
  • the download request is directly determined whether the terminal corresponding to the download request received in step S2 can be provided with a download service.
  • the server adds the download request to the waiting queue, and sends a waiting instruction to the terminal.
  • the server sends a download request to the waiting queue and sends a waiting instruction to the terminal to inform the terminal that the server cannot currently provide the download service. If the server determines the upgrade sequence of the download request to be processed by the first-in first-out stack, the server puts the download request to the last place in the waiting queue.
  • step S5 monitor the sum of the bandwidth occupied by the terminal downloading the upgrade file and the bandwidth corresponding to several candidate download requests in the waiting queue, and when the sum is less than or equal to the threshold, send a download instruction to the terminal.
  • the bandwidth occupied by the server changes, and the bandwidth occupied by the terminal that is downloading the upgrade file is obtained.
  • Update the occupied bandwidth For example, if at t1, there are 10 first terminals downloading application upgrade files, at this time, the occupied bandwidth is the bandwidth occupied by 10 terminals downloading upgrade files, and at t2, one terminal completes the download, then t2 The bandwidth occupied by the eight terminals that are downloading the application upgrade file at any time is the updated bandwidth.
  • the download request that is upgraded before the received download request is recorded as a candidate download request, and the candidate download request includes the test of the corresponding terminal.
  • Download speed determine the candidate bandwidth according to the test download speed of the terminal corresponding to the candidate download request.
  • the pending download requests are sorted according to their priority, and get: f1, f2, f3, f4, f5, f6, suppose f4 is For the download request received in step S2, f1, f2, and f3 are candidate download requests, and the candidate bandwidth h1 corresponding to f1, the candidate bandwidth h2 corresponding to f2, and the candidate bandwidth h3 corresponding to f3 are determined.
  • S53a If the sum of the updated occupied bandwidth and each candidate bandwidth is less than or equal to the threshold, send a download instruction to the terminal.
  • the terminal is the terminal corresponding to the download request received in step S2. If the sum of each candidate bandwidth and the updated occupied bandwidth is less than or equal to the threshold, each candidate download request and the download request respectively correspond All terminals can download the upgrade file. For example, update the occupied bandwidth to H, the threshold is G, determine whether h1+h2+h3+H is less than or equal to G, if h1+h2+h3+H is less than or equal to G, send the download instruction to f1, f2, f3 , f4 respectively correspond to the terminal, where f4 is the download request received in step S2.
  • h1+h2+h3+H is less than or equal to G
  • the download instruction is sent to the terminals corresponding to f1, f2, f3, and f4
  • the threshold can be set to 80% of the peak bandwidth, it does not affect the normal operation of the server.
  • the download instruction is sent to the terminal (the terminal corresponding to the download request), and at the same time, the download instruction is sent to the terminal corresponding to each candidate download request; the bandwidth to be downloaded is a step The bandwidth corresponding to the download request received in S2.
  • step S51a if the sum of the updated occupied bandwidth and each candidate bandwidth is greater than the threshold, at least one target download request is selected from each candidate download request, and a download instruction is sent to the at least one target download request.
  • selecting at least one target download request from each candidate download request includes: calculating the difference between the updated occupied bandwidth and the threshold; and selecting M from each candidate download request according to the difference and each bandwidth to be processed.
  • Target download requests where the total candidate bandwidth corresponding to the M target download requests is less than or equal to the difference, and M is a positive integer.
  • the updated occupied bandwidth occupied by the server is H
  • the threshold is G
  • the difference is obtained according to the updated occupied bandwidth and the threshold.
  • the difference represents the current bandwidth that can be increased.
  • the difference j is calculated by calculating GH
  • the candidate download request includes f1, f2, f3, and the upgrade sequence is that the upgrade sequence of f1 is earlier than the upgrade sequence of f2, the upgrade sequence of f2 is earlier than the upgrade sequence of f3, f1, f2,
  • the candidate bandwidths of f3 are h1, h2, h3. First, compare the difference j and the size of the candidate bandwidth h1.
  • h1 is less than or equal to j
  • h3 is greater than j-h1-h2, the candidate request f3 corresponding to h3 cannot be used as the target download request ;
  • the target download requests obtained in each candidate download request are f1 and f2.
  • step S5 since the download speed of the terminal in the downloading state is not fixed, that is, the bandwidth occupied by the terminal in the downloading state is not fixed, and it is in the downloading state when no terminal is monitored to complete the download.
  • the bandwidth occupied by the terminal may also be less than the threshold, and the server may provide a download service for the terminal corresponding to the download request to be processed in the waiting queue; in order to improve the download efficiency, step S5 includes:
  • S51b Obtain the bandwidth occupied by the terminal downloading the upgrade file every preset time interval to obtain the updated occupied bandwidth.
  • each terminal in the downloading state reports its own download speed
  • the server determines the bandwidth occupied by the terminal in the downloading state according to the download speed reported by each terminal in the downloading state, To get the updated occupied bandwidth.
  • the download request that is upgraded before the received download request is recorded as a candidate download request, and the candidate download request includes the test of the corresponding terminal.
  • Download speed determine the candidate bandwidth according to the test download speed of the terminal corresponding to the candidate download request.
  • the pending download requests are sorted according to their priority, and get: f1, f2, f3, f4, f5, f6, where f4 is For the download request received in step S2, f1, f2, and f3 are candidate download requests, and it is determined that the candidate bandwidth corresponding to f1 is h1, the candidate bandwidth corresponding to f2 is h2, and the candidate bandwidth corresponding to f3 is h3.
  • Step S52b is the same as step S52a.
  • the terminal is the terminal corresponding to the download request received in step S2. If the sum of each candidate bandwidth and the updated occupied bandwidth is less than or equal to the threshold, each candidate download request and the download request respectively correspond All terminals can download the upgrade file. For example, if the occupied bandwidth is updated to H, the threshold is G, and the sum of the candidate bandwidths is less than or equal to the threshold, it is determined whether h1+h2+h3+H is less than or equal to G, if h1+h2+h3+H is less than If it is equal to G, the download instruction is sent to the terminals corresponding to f1, f2, f3, and f4, where f4 is the download request received in step S2.
  • h1+h2+h3+H is less than or equal to G
  • the download instruction is sent to the terminals corresponding to f1, f2, f3, and f4
  • the threshold can be set to 80% of the peak bandwidth, it does not affect the normal operation of the server.
  • the server for a pending download request in the waiting queue, after the server provides a download service for any terminal corresponding to the pending download request, the pending download request is deleted from the waiting queue.
  • the download instruction is sent to the terminal (the terminal corresponding to the download request), and at the same time, the download instruction is sent to the terminal corresponding to each candidate download request; the bandwidth to be downloaded is a step The bandwidth corresponding to the download request received in S2.
  • step S51b if the sum of the updated occupied bandwidth and each candidate bandwidth is greater than the threshold, at least one target download request is selected from each candidate download request, and a download instruction is sent to the at least one target download request.
  • Step S53b is the same as step S53a.
  • the method for application upgrade provided by the embodiment of the present disclosure also include:
  • the download speed may be measured by a third-party speed measurement server, and the terminal in the downloading state sends a speed measurement instruction to the speed measurement server at intervals of the time interval, and the speed measurement server feeds back the first download speed to the first download speed according to the speed measurement instruction.
  • a terminal the first terminal sends the received first download speed to the server for distributing the application upgrade file.
  • the time interval may be 1 second, that is, the server obtains the real-time download speed of each first terminal every second.
  • the server can cancel the download task of the terminal that has not completed the download of the upgrade file for a long time. Specifically, obtain the status of the terminal that is downloading the upgrade file. Download duration; start counting from the receipt of the download instruction, and get the downloaded duration. When any terminal that is downloading the upgrade file is longer than the preset time period, the download task of the terminal is cancelled.
  • the preset duration can be set to 30 minutes. If the download duration of a terminal that is downloading the upgrade file reaches the preset duration and the download has not been completed, the download task of the terminal is cancelled to release the The bandwidth occupied by the terminal.
  • the application upgrade method may further include:
  • the terminal sends a speed measurement instruction to the speed measurement server.
  • the terminal includes a terminal that has not sent a download request and a terminal that is downloading an upgrade file.
  • the speed measurement server feeds back the test download speed to the terminal that has not sent the download request, and sends the download speed to the terminal that is downloading the upgrade file.
  • the terminal sends a download request to the server, and the download request includes a test download speed.
  • the server obtains the occupied bandwidth, where the occupied bandwidth is the bandwidth occupied by the terminal that is downloading the upgrade file, and the bandwidth to be downloaded is calculated according to the test download speed.
  • the server judges whether the occupied bandwidth is less than a preset threshold, if yes, then enter a6, if not, then enter a7.
  • the server sends a download instruction to the terminal, so that the terminal downloads the upgrade file according to the download instruction.
  • the terminal in the downloading state sends the download speed of downloading the upgrade file.
  • a9. Determine whether the sum is less than or equal to the threshold, if yes, go to a10, and if not, go to a8.
  • the sum is less than or equal to the threshold, and the server sends a download instruction to the terminal.
  • the terminal downloads the application upgrade file according to the received download instruction.
  • the present disclosure uses bandwidth to determine when a download request is responded to.
  • bandwidth determines when a download request is responded to.
  • the download instruction When receiving a download request, if the occupied bandwidth is less than or equal to the threshold, the download instruction will be responded immediately, and if the occupied bandwidth is greater than the threshold, the download instruction will be placed in the waiting queue, and then Monitor the bandwidth occupied by the upgrade file being downloaded and the bandwidth of the pending download instruction in the waiting queue, and then determine the time to respond to the download instruction.
  • the number of terminals that download the upgrade file in parallel is limited by the bandwidth to reduce the number of simultaneous downloads of the upgrade file
  • the gap between the occupied bandwidth and the threshold so that manufacturers can more accurately limit the current, in order to achieve the greatest degree of cost savings.
  • the embodiment of the present disclosure also provides an application upgrade system, the system including a terminal and a server;
  • the terminal is configured to send a download request to the server, so that the server obtains the occupied bandwidth according to the download request, and determines whether the occupied bandwidth is less than a preset threshold, wherein the occupied bandwidth is downloading an upgrade
  • the bandwidth occupied by the terminal of the file if the occupied bandwidth is less than the threshold, then receive a download instruction sent by the server; if the occupied bandwidth is greater than or equal to the threshold, receive a waiting instruction sent by the server;
  • the server is configured to receive a download request and obtain the occupied bandwidth according to the download request, where the occupied bandwidth is the bandwidth occupied by the terminal that is downloading the upgrade file; determine whether the occupied bandwidth is less than a preset threshold; If the occupied bandwidth is less than or equal to the threshold, a download instruction is sent to the terminal so that the terminal downloads the upgrade file according to the download instruction; if the occupied bandwidth is greater than the threshold, the download The request is added to the waiting queue, and the waiting instruction is sent to the terminal.
  • the embodiment of the present disclosure also provides a computer device, which may be a terminal, and the internal structure is shown in FIG. 3.
  • the computer equipment includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus.
  • the processor of the computer device is used to provide calculation and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system and a computer program.
  • the internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an application upgrade method is realized.
  • the display screen of the computer device can be a liquid crystal display or an electronic ink display screen
  • the input device of the computer device can be a touch layer covered on the display screen, or it can be a button, trackball or touchpad set on the computer device shell , It can also be an external keyboard, touchpad, or mouse.
  • FIG. 3 is only a partial structure related to the solution of the present disclosure, and does not constitute a limitation on the computer equipment to which the solution of the present disclosure is applied. More or fewer components are shown in, or some components are combined, or have different component arrangements.
  • a computer device including a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
  • the download request is added to the waiting queue, and a waiting instruction is sent to the terminal to monitor the bandwidth occupied by the terminal downloading the upgrade file and several candidate download requests in the waiting queue When the sum of the corresponding bandwidths is less than or equal to the threshold, sending a download instruction to the terminal, wherein the upgrade sequence of the candidate download request precedes the upgrade sequence of the download request;
  • Receive an instruction including the server when the occupied bandwidth is less than or equal to the threshold, or when the sum of the bandwidth occupied by the terminal downloading the upgrade file and the bandwidth corresponding to several candidate download requests in the waiting queue is less than Or a download instruction sent when the threshold is equal to, and a waiting instruction sent by the server when the occupied bandwidth is greater than the threshold.
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
  • the download request is added to the waiting queue, and a waiting instruction is sent to the terminal to monitor the bandwidth occupied by the terminal downloading the upgrade file and several candidate download requests in the waiting queue When the sum of the corresponding bandwidths is less than or equal to the threshold, sending a download instruction to the terminal, wherein the upgrade sequence of the candidate download request precedes the upgrade sequence of the download request;
  • Receive an instruction including the server when the occupied bandwidth is less than or equal to the threshold, or when the sum of the bandwidth occupied by the terminal downloading the upgrade file and the bandwidth corresponding to several candidate download requests in the waiting queue is less than Or a download instruction sent when the threshold is equal to, and a waiting instruction sent by the server when the occupied bandwidth is greater than the threshold.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

一种应用升级的方法和计算机设备,所述方法通过带宽确定下载请求被响应的时机,在接收下载请求时,若占用带宽小于或等于阈值,则立即响应该下载指令,若占用带宽大于阈值,则将该下载指令放入等待队列,再监听正在下载升级文件所占用的带宽,以及等待队列中的待处理下载指令的带宽,进而确定响应该下载指令的时机,这样,通过带宽限制并行下载升级文件的终端数量,以缩小同时下载升级文件所占用的带宽与阈值之间的差距,这样,厂商可以更准确地限流,以实现在最大程度上节约成本。

Description

一种应用升级的方法和计算机设备
优先权
本公开要求申请日为2019年12月30日提交中国专利局、申请号为“201911404640.8”、申请名称为“一种应用升级的方法和计算机设备”的中国专利申请的优先权,其全部内容通过引用结合在本公开中。
技术领域
本公开涉及互联网应用技术领域,特别是涉及一种应用升级的方法和计算机设备。
背景技术
流量是一种传输数量,特指通过网络传输数据的数量,峰值带宽是指被允许的站点瞬间流量的最大值;目前已经将互联网通道作为智能终端产品的应用发布的核心途径,海量用户通过网络获取升级文件,因此带来的流量费用称为互联网企业需要考虑的一个重要元素。
当前用于文件分发的技术通常是使用内容分发网络(Content Delivery Network,CDN)进行的,CDN的收费机制决定了,当一个厂商使用CDN时,在用户访问量稳定的情况下,按使用峰值带宽收费要比按使用流量收费的成本低很多,因此,绝大部分厂商会按峰值计费的方式使用CDN。在按峰值计费的模式下,不同的峰值阈值,会对应不同的收费标准,为了控制成本,厂商需要控制用户并发访问时产生的访问带宽。
目前,通常是采用限制并发用户数量的方式来进行的,但是,由于每个用户在下载升级文件时的占用的带宽不同,单纯的通过用户量进行下载流量的控制,并不能很精准的计算出当前被占用的瞬时带宽,这样,实际限流的效果可能不在当前的计费标准内,没有在最大程度的利用峰值带宽。
因此,现有技术有待改进。
公开内容
本公开所要解决的技术问题是,提供一种应用升级的方法和计算机设备,在进行应用升级时,通过占用带宽来限制并发下载的数量,以缩小同时下载应用升级文件的终端占用的带宽与峰值带宽之间的差距,以使得厂商可以更准确地限流。
一方面,本公开实施例提供了一种应用升级的方法,应用于应用升级系统中的服务器,所述应用升级系统还包括终端,所述方法包括:
接收下载请求,并根据所述下载请求获取占用带宽,其中,所述占用带宽为正在下载升级文件的终端所占用的带宽;
判断所述占用带宽是否小于预设的阈值;
若所述占用带宽小于或等于所述阈值,则发送下载指令到所述终端,以使得所述终端根据所述下载指令下载升级文件;
若所述占用带宽大于所述阈值,则将所述下载请求添加到等待队列,并发送等待指令到所述终端,监听正在下载升级文件的终端所占用的带宽与等待队列中若干个候选下载请求对应的带宽的和,当所述和小于或等于所述阈值时,发送下载指令到所述终端,其中,所述候选下载请求的升级顺序先于所述下载请求的升级顺序。
在一个实施例中,所述获取所述下载请求对应的待下载带宽,包括:
获取处于下载状态的各终端分别对应的各下载速度;
根据处于下载状态的各终端分别对应的各下载速度确定占用带宽。
在一个实施例中,所述根据所述下载请求获取占用带宽,包括:
获取所述下载请求对应的待下载带宽;
计算所述待下载带宽与所述占用带宽的和,并将待下载带宽与所述占用带宽的和作为更新后的占用带宽。
在一个实施例中,所述下载请求中包括测试下载速度;所述获取所述下载请求对应的待下载带宽,包括:
根据所述测试下载速度确定所述待下载带宽。
在一个实施例中,所述判断所述占用带宽是否小于预设的阈值具体包括:
判断等待队列中是否有待处理的下载请求;
若所述等待队列中有待处理的下载请求,则将所述下载请求添加到所述等待队列,并发送等待指令到所述终端;
若所述等待队列中没有待处理的下载请求,则判断所述占用带宽是否小于预设的阈值。
在一个实施例中,所述若所述占用带宽大于所述阈值,则将所述下载请求添加到等待队列,包括:
若所述占用带宽大于所述阈值,则将所述下载请求添加到所述等待队列的最后一位。
在一个实施例中,所述监听正在下载升级文件的终端所占用的带宽与等待队列中若干个候选下载请求对应的带宽的和,当所述和小于或等于所述阈值时,发送下载指令到所述终端,包括:
监听到任一正在下载升级文件的终端完成下载时,获取正在下载升级文件的终端所占用的带宽,以得到更新占用带宽;
获取等待队列中若干个候选下载请求分别对应的各候选带宽;
若所述更新占用带宽和各候选带宽的和小于或等于所述阈值,则发送下载指令到所述终端。
在一个实施例中,所述监听正在下载升级文件的终端所占用的带宽与等待队列中若干个候选下载请求对应的带宽的和,当所述和小于或等于所述阈值时,发送下载指令到所述终端,包括:
监听到任一正在下载升级文件的终端完成下载时,获取正在下载升级文件的终端所占用的带宽,以得到更新占用带宽;
获取等待队列中若干个候选下载请求分别对应的各候选带宽;
若所述更新占用带宽、所述待下载带宽和各候选带宽的和小于或等于所述阈值,则发送下载指令到所述终端。
在一个实施例中,监听正在下载升级文件的终端所占用的带宽与等待队列中若干个候选下载请求对应的带宽的和,当所述和小于或等于所述阈值时,发送下载指令到所述终端,包括:
每隔预设的时间间隔,获取正在下载升级文件的终端所占用的带宽,以得到更新占用带宽;
获取等待队列中若干个候选下载请求分别对应的各候选带宽;
若所述更新占用带宽和各候选带宽的和小于或等于所述阈值,则发送下载指 令到所述终端。
在一个实施例中,所述方法还包括:
对于等待队列中的任一待处理的下载请求,所述待处理的下载请求对应的终端完成下载后,将所述待处理的下载请求从等待队列中删除。
第二方面,本公开实施例提供了一种应用升级的方法,应用于应用升级系统中的终端,所述应用升级系统还包括服务器,所述方法包括:
发送下载请求到所述服务器,以便于所述服务器根据所述下载请求获取占用带宽,判断所述占用带宽是否小于预设的阈值,其中,所述占用带宽为正在下载升级文件的终端所占用的带宽;
接收指令,所述指令包括所述服务器在所述占用带宽小于或等于所述阈值时,或者在正在下载升级文件的终端所占用的带宽与等待队列中若干个候选下载请求对应的带宽的和小于或等于所述阈值时发送的下载指令,以及所述服务器在占用带宽大于所述阈值时发送的等待指令。
在一个实施例中,所述方法还包括:
若处于下载升级文件的状态,每隔预设的时间间隔,将下载升级文件的下载速度向所述服务器发送,以便于所述服务器根据所述下载升级文件的下载速度确定正在下载升级文件的终端所占用的带宽,以得到更新占用带宽。
第三方面,本公开实施例提供了一种应用升级系统,所述系统包括终端和服务器;
所述终端,用于发送下载请求到所述服务器,以便于所述服务器根据所述下载请求获取占用带宽,判断所述占用带宽是否小于预设的阈值,其中,所述占用带宽为正在下载升级文件的终端所占用的带宽;若所述占用带宽小于所述阈值,则接收所述服务器发送的下载指令;若所述占用带宽大于或等于所述阈值,则接收所述服务器发送的等待指令;
所述服务器,用于接收下载请求,并根据所述下载请求获取占用带宽,其中,所述占用带宽为正在下载升级文件的终端所占用的带宽;判断所述占用带宽是否小于预设的阈值;若所述占用带宽小于或等于所述阈值,则发送下载指令到所述终端,以使得所述终端根据所述下载指令下载升级文件;若所述占用带宽大于所述阈值,则将所述下载请求添加到等待队列,并发送等待指令到所述终端。
第四方面,本公开实施例提供了一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现以下步骤:
接收下载请求,并根据所述下载请求获取占用带宽,其中,所述占用带宽为正在下载升级文件的终端所占用的带宽;
判断所述占用带宽是否小于预设的阈值;
若所述占用带宽小于或等于所述阈值,则发送下载指令到所述终端,以使得所述终端根据所述下载指令下载升级文件;
若所述占用带宽大于所述阈值,则将所述下载请求添加到等待队列,并发送等待指令到所述终端,监听正在下载升级文件的终端所占用的带宽与等待队列中若干个候选下载请求对应的带宽的和,当所述和小于或等于所述阈值时,发送下载指令到所述终端,其中,所述候选下载请求的升级顺序先于所述下载请求的升级顺序;
或者,发送下载请求到所述服务器,以便于所述服务器根据所述下载请求获取占用带宽,判断所述占用带宽是否小于预设的阈值,其中,所述占用带宽为正在下载升级文件的终端所占用的带宽;
接收指令,所述指令包括所述服务器在所述占用带宽小于或等于所述阈值时,或者在正在下载升级文件的终端所占用的带宽与等待队列中若干个候选下载请求对应的带宽的和小于或等于所述阈值时发送的下载指令,以及所述服务器在占用带宽大于所述阈值时发送的等待指令。
第五方面,本公开实施例提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以下步骤:
接收下载请求,并根据所述下载请求获取占用带宽,其中,所述占用带宽为正在下载升级文件的终端所占用的带宽;
判断所述占用带宽是否小于预设的阈值;
若所述占用带宽小于或等于所述阈值,则发送下载指令到所述终端,以使得所述终端根据所述下载指令下载升级文件;
若所述占用带宽大于所述阈值,则将所述下载请求添加到等待队列,并发送等待指令到所述终端,监听正在下载升级文件的终端所占用的带宽与等待队列中若干个候选下载请求对应的带宽的和,当所述和小于或等于所述阈值时,发送下 载指令到所述终端,其中,所述候选下载请求的升级顺序先于所述下载请求的升级顺序;
或者,发送下载请求到所述服务器,以便于所述服务器根据所述下载请求获取占用带宽,判断所述占用带宽是否小于预设的阈值,其中,所述占用带宽为正在下载升级文件的终端所占用的带宽;
接收指令,所述指令包括所述服务器在所述占用带宽小于或等于所述阈值时,或者在正在下载升级文件的终端所占用的带宽与等待队列中若干个候选下载请求对应的带宽的和小于或等于所述阈值时发送的下载指令,以及所述服务器在占用带宽大于所述阈值时发送的等待指令。
与现有技术相比,本公开实施例具有以下优点:
在本公开实施例中,终端发送下载请求到服务器,服务器接收下载请求,并根据所述下载请求获取占用带宽,其中,所述占用带宽为正在下载升级文件的终端所占用的带宽;判断所述占用带宽是否小于预设的阈值;若所述占用带宽小于或等于所述阈值,则发送下载指令到所述终端;若所述占用带宽大于所述阈值,则将所述下载请求添加到等待队列,并发送等待指令到所述终端,监听正在下载升级文件的终端所占用的带宽与等待队列中若干个候选下载请求对应的带宽的和,当所述和小于或等于所述阈值时,发送下载指令到所述终端,其中,所述候选下载请求的升级顺序先于所述下载请求的升级顺序。
本公开通过带宽确定下载请求被响应的时机,在接收下载请求时,若占用带宽小于或等于阈值,则立即响应该下载指令,若占用带宽大于阈值,则将该下载指令放入等待队列,再监听正在下载升级文件所占用的带宽,以及等待队列中的待处理下载指令的带宽,进而确定响应该下载指令的时机,这样,通过带宽限制并行下载升级文件的终端的数量,以缩小同时下载升级文件所占用的带宽与阈值之间的差距,这样,厂商可以更准确地限流,以实现在最大程度上节约成本。
附图说明
为了更清楚地说明本公开实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本公开中记载的一些实施例,对于本领域普通技术人员来讲,在不付 出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本公开实施例中一种应用升级的方法的流程示意图;
图2为本公开实施例中应用升级方法的另一种流程示意图;
图3为本公开实施例中计算机设备的内部结构图。
具体实施方式
为了使本技术领域的人员更好地理解本公开方案,下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本公开一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。
经研究发现,目前厂商控制用户并发访问时产生的访问带宽,是采用限制并发用户数量的方式来进行的,但是由于每个用户在下载升级文件时的占用的带宽不同,单纯通过用户量进行下载流量的控制,并不能很精准的计算出当前被占用的瞬时带宽,这样,实际的限流效果可能不在当前的计费标准内,没有最大程度利用峰值带宽。
为了解决上述问题,在本公开实施例中,终端发送下载请求到服务器,服务器接收下载请求,并根据所述下载请求获取占用带宽,其中,所述占用带宽为正在下载升级文件的终端所占用的带宽;判断所述占用带宽是否小于预设的阈值;若所述占用带宽小于或等于所述阈值,则发送下载指令到所述终端;若所述占用带宽大于所述阈值,则将所述下载请求添加到等待队列,并发送等待指令到所述终端,监听正在下载升级文件的终端所占用的带宽与等待队列中若干个候选下载请求对应的带宽的和,当所述和小于或等于所述阈值时,发送下载指令到所述终端,其中,所述候选下载请求的升级顺序先于所述下载请求的升级顺序。
本公开通过带宽确定下载请求被响应的时机,在接收下载请求时,若占用带宽小于或等于阈值,则立即响应该下载指令,若占用带宽大于阈值,则将该下载指令放入等待队列,再监听正在下载升级文件所占用的带宽,以及等待队列中的待处理下载指令的带宽,进而确定响应该下载指令的时机,这样,通过带宽限制并行下载升级文件的终端数量,以缩小同时下载升级文件所占用的带宽与阈值 之间的差距,这样,厂商可以更准确地限流,以实现在最大程度上节约成本。
下面结合附图,详细说明本公开的各种非限制性实施方式。
本公开提供的一种应用升级的方法,可以应用于应用升级系统中,所述应用升级系统包括终端和服务器,其中,所述终端可以但不限于是需要进行应用升级的计算机、笔记本电脑、手机、平板电脑、车载电脑、电视、车载电脑便携式可穿戴设备。
参见图1,示出了本公开实施例中的一种应用升级的方法。在本实施例中,所述方法例如可以包括以下步骤:
S1、终端发送下载请求到所述服务器。
本公开实施例中,发送下载请求的终端是需要进行应用升级的终端,所述服务器提供升级文件的分发服务,所述下载请求用于向服务器请求下载应用升级文件。
S2、服务器接收下载请求,并根据所述下载请求获取占用带宽,其中,所述占用带宽为正在下载升级文件的终端所占用的带宽。
本公开实施例中,所述带宽是频带宽度的简称,在网络中是指在单位时间内能传输的数据量,带宽越大,通行能力越强。正在下载升级文件的终端会占用服务器的带宽,服务器接收下载请求时,获取占用带宽即获取提供下载升级文件被占用的带宽。具体的,服务器获取各个处于下载状态的终端(正在下载升级文件的终端)的下载速度,根据各个处于下载状态的终端的下载速度确定各个处于下载状态的终端的带宽,进而确定占用带宽。关于获取占用带宽的具体步骤,在后文会详细解释。
S3、服务器判断所述占用带宽是否小于预设的阈值。
本公开实施例中,需要预先设置用于指定单位时间内,允许进行下载升级文件的所占用的带宽,若处于下载状态的终端的占用带宽等于带宽峰值,则可以最大程度节约成本,因此,所述阈值可以为带宽峰值;为了保证单位时间内下载升级文件所占用的带宽不会超过带宽配额,同时预留以应对突发情况的空间,所述阈值可以为带宽峰值的80%。
S4、若所述占用带宽小于或等于所述阈值,则服务器发送下载指令到所述终端,以使得所述终端根据所述下载指令下载升级文件。
本公开实施例中,若所述占用带宽小于所述阈值,表示服务器还可以提供下载升级文件的带宽,则发送下载指令到终端;若所述占用带宽等于所述阈值,表示服务器目前的占用带宽正好满足阈值,由于,所述阈值可以是带宽峰值的80%,因此,同样可以立即发送下载指令到终端,以便于所述该终端开始下载升级文件。
S5、若所述占用带宽大于所述阈值,则服务器端将所述下载请求添加到等待队列,并发送等待指令到所述终端,监听正在下载升级文件的终端所占用的带宽与等待队列中若干个候选下载请求对应的带宽的和,当所述和小于或等于所述阈值时,发送下载指令到所述终端,其中,所述候选下载请求的升级顺序先于所述下载请求的升级顺序。
本公开实施例中,若占用带宽大于所述阈值,则发送下载请求的终端不能立即下载升级文件,服务器将该下载请求加入等待队列,接着,服务器监听被占用的带宽、阈值以及等待队列中候选下载请求对应的带宽。
本公开实施例中,服务器将所述下载请求添加到等待队列,则等待队列中包括至少一个待处理的下载请求,所述候选下载请求为等待队列中,升级顺序先于所述下载请求的待处理的下载请求;若所述下载请求在等待队列中的升级顺序排在第一位,则不存在候选请求。
本公开实施例中,等待队列中的升级顺序可以是根据待处理的下载请求的优先级确定,优先级高的待处理的下载请求的升级顺序先于优先级低的待处理的下载请求的升级顺序;或者在时间轴上,发送时间早的下载请求排列在发送时间晚的下载请求之前,可以通过堆栈的形式控制待处理的下载请求,堆栈以先进先出的方式控制待处理的下载请求的升级顺序,服务器在将下载请求放入等待队列时,将下载请求放在栈顶,服务器首先给栈底的待处理的下载请求对应的终端发送下载指令。
关于监听正在下载升级文件的终端所占用的带宽与等待队列中若干个候选下载请求对应的带宽的和,当所述和小于或等于所述阈值时,发送下载指令到所述终端的具体过程,在后文会详细解释。
S6、终端接收指令,所述指令包括所述服务器在所述占用带宽小于或等于所述阈值时,或者在正在下载升级文件的终端所占用的带宽与等待队列中若干个候选下载请求对应的带宽的和小于或等于所述阈值时发送的下载指令,以及所述服 务器在占用带宽大于所述阈值时发送的等待指令。
本公开实施例中,所述下载指令中包括下载地址,终端接收到下载指令,则根据所述下载地址从服务器中下载升级文件;终端接收到等待指令,以得知当前服务器无法提供下载服务。
本公开实施例,通过带宽确定下载请求被响应的时机,在接收下载请求时,若占用带宽小于或等于阈值,则立即响应该下载指令,若占用带宽大于阈值,则将该下载指令放入等待队列,再监听正在下载升级文件所占用的带宽,以及等待队列中待处理的下载指令的带宽,进而确定响应该下载指令的时机,这样,通过带宽限制并行下载升级文件的终端数量,以缩小同时下载升级文件所占用的带宽与阈值之间的差距,这样,厂商可以更准确地限流,以实现在最大程度上节约成本。
接下来具体介绍获取占用带宽的详细内容,服务器获取各个处于下载状态的终端(正在下载升级文件的终端)的下载速度,根据各个处于下载状态的终端的下载速度确定各个处于下载状态的终端的带宽,进而确定占用带宽。具体的,步骤S2包括:
S21、服务器获取处于下载状态的各终端分别对应的各下载速度。
本公开实施例中,服务器在接收下载请求时,通知处于下载状态的各终端上报各自的下载速度,处于下载状态的各终端可以通过第三方的测速服务器测得下载速度,并发送到服务器。
S22、服务器根据处于下载状态的各终端分别对应的各下载速度确定占用带宽。
本公开实施例中,首先计算处于下载状态的各终端分别对应的带宽,带宽和下载速度之间存在换算关系,例如,20M带宽的下载速度能达到20Mbit/s,理论上,2M(即2Mb/s)宽带对应的下载速度是:256KB/s(即2048Kb/s);计算各处于下载状态的各终端分别对应的带宽的和,以得到占用带宽。
在另一种实现方式中,为了使服务器提供下载服务时被占用的带宽不大于阈值,步骤S2还包括:
S23、服务器获取所述下载请求对应的待下载带宽。
本公开实施例中,所述下载请求中包括测试下载速度;所述获取所述下载请 求对应的待下载带宽,包括:根据所述测试下载速度确定所述待下载带宽。
本公开实施例中,所述下载请求中包括终端的测试下载速度,以便于服务器根据测试下载速度得知所述下载请求对应的带宽。在终端发送下载请求之前,所述终端已经获取了测试下载速度。所述测试下载速度可以是终端通过第三方的测速服务器得到的,终端在发送下载请求之前,发送测速请求到测速服务器,以得到测试下载速度。
本公开实施例中,在终端发送下载请求到所述服务器之前,所述终端发送测速请求到测速服务器,测速服务器根据所述测速请求发送测速地址到所述终端,所述终端根据所述测试仪地址下载测试文件,传输测试文件的速度即该终端的测试下载速度,所述终端接收测试服务器反馈的测试下载速度。在终端进行应用升级时,将包括测试下载速度的下载请求发送到服务器。根据测试下载速度得到所述下载请求对应的待下载带宽。
S24、计算所述待下载带宽与所述占用带宽的和,并将待下载带宽与所述占用带宽的和作为更新后的占用带宽。
本公开实施例中,将待下载带宽与所述占用带宽的和作为更新后的占用带宽,进而使得步骤S3中判断所述占用带宽是否小于预设的阈值,等同于判断正在下载升级文件所占用的带宽与所述下载请求对应的待下载带宽的和是否小于阈值,即判断正在下载升级文件所占用的带宽和阈值之间的差值,是否足够为所述下载请求对应的终端提供下载服务。在此实现方式中,服务器提供下载服务时被占用的带宽不会大于阈值。
接下来,介绍判断所述占用带宽是否小于预设的阈值的具体过程,具体的,步骤S3包括:
S31、服务器判断等待队列中是否有待处理的下载请求。
本公开实施例中,当服务器中有待处理的下载请求时,表示步骤S2中接收到下载请求之前,服务器已经接收了其他的下载请求,且服务器还没有空闲的带宽为部分下载请求对应的终端提供下载服务,因此,在理论上,应该先为发送时间在前的下载请求对应的终端提供下载服务,或者为优先级高的下载请求对应的终端提供下载服务,因此,不能越过等待队列中待处理的下载请求,直接判断是否可以为步骤S2中接收到的下载请求对应的终端提供下载服务。
S32、若所述等待队列中有待处理的下载请求,则服务器将所述下载请求添加到所述等待队列,并发送等待指令到所述终端。
本公开实施例中,服务器将下载请求发送到等待队列中,并发送等待指令到终端,以告知所述终端,服务器当前无法提供下载服务。若服务器以先进先出的堆栈确定待处理的下载请求的升级顺序,则服务器将下载请求放到所述等待队列中的最后一位。
S33、若所述等待队列中没有待处理的下载请求,则判断所述占用带宽是否小于预设的阈值。
本公开实施例中,当等待队列中没有待处理的下载请求时,可以直接判断是否为步骤S2中接收的下载指令对应的终端提供下载服务。
接下来,介绍:监听正在下载升级文件的终端所占用的带宽与等待队列中若干个候选下载请求对应的带宽的和,当所述和小于或等于所述阈值时,发送下载指令到所述终端的具体过程,具体的,步骤S5包括:
S51a、监听到任一正在下载升级文件的终端完成下载时,获取正在下载升级文件的终端所占用的带宽,以得到更新占用带宽。
本公开实施例中,当等待队列中有待处理的下载请求时,若任一正在下载文件的终端完成下载,则服务器被占用的带宽生变化,获取正在下载升级文件的终端所占用的带宽,得到更新占用带宽。例如,若t1时刻,正在下载应用升级文件的第一终端有10个,此时,占用带宽为10个正在下载升级文件的终端所占用的带宽,t2时刻,有1个终端完成下载,则t2时刻正在下载应用升级文件的8个终端所占用的带宽为更新占用带宽。
S52a、获取等待队列中若干个候选下载请求分别对应的各候选带宽。
本公开实施例中,对于等待队列中待处理的下载请求,将升级顺序先于接收的下载请求之前的待处理的下载请求,记为候选下载请求,候选下载请求中包括其对应的终端的测试下载速度,根据候选下载请求对应的终端的测试下载速度,确定候选带宽。例如,在监听到正在下载升级文件的某一终端完成下载时,等待队列中,各待处理的下载请求根据优先级进行排序,得到:f1,f2,f3,f4,f5,f6,假设f4是步骤S2中接收的下载请求,则f1,f2,f3为候选下载请求,确定f1对应的候选带宽h1、f2对应的候选带宽h2、f3对应的候选带宽h3。
S53a、若所述更新占用带宽和各候选带宽的和小于或等于所述阈值,则发送下载指令到所述终端。
本公开实施例中,所述终端为步骤S2中接收的下载请求对应的终端,若各候选带宽与更新占用带宽的和小于或等于所述阈值,则各候选下载请求和所述下载请求分别对应的终端均可以下载升级文件。例如,更新占用带宽为H,所述阈值为G,判断h1+h2+h3+H是否小于等于G,若h1+h2+h3+H小于或等于G,则发送下载指令到f1,f2,f3,f4分别对应的终端,其中,f4为步骤S2中接收的下载请求。可知,本公开实施例中,由于h1+h2+h3+H小于或等于G,发送下载指令到f1,f2,f3,f4分别对应的终端,则可能出现服务器的被占用的带宽大于阈值的情况,由于阈值可以设置为带宽峰值的80%,因此不影响服务器正常工作。
在另一种实现方式中,为了保证服务器的被占用带宽不超过阈值,可以判断更新占用带宽、各候选带宽和待下载带宽的和是否小于或等于所述阈值,若更新占用带宽、各候选带宽和待下载带宽的和小于或等于阈值,则发送下载指令到所述终端(所述下载请求对应的终端),同时,发送下载指令到各候选下载请求对应的终端;所述待下载带宽为步骤S2中接收的下载请求对应的带宽。
在另一种实现方式中,若所述更新占用带宽和各候选带宽的和大于所述阈值,则在各候选下载请求中选取至少一个目标下载请求,发送下载指令到所述至少一个目标下载请求分别对应的终端,继续执行步骤S51a直至所述更新占用带宽和各候选带宽的和小于或等于所述阈值,以实现所述下载请求对应的终端可以下载升级文件。
具体的,在各候选下载请求中选取至少一个目标下载请求包括:计算所述更新占用带宽和所述阈值的差值;根据所述差值和各待处理带宽,从各候选下载请求中选取M个目标下载请求,其中,M个目标下载请求对应的总候选带宽小于或等于所述差值,M为正整数。
在本公开实施例中,在监听到任一正在下载升级文件的终端完成下载时,服务器被占用的更新占用带宽为H,阈值为G,根据所述更新占用带宽和阈值得到差值,所述差值表示当前还可以增加的带宽。具体的,计算G-H得到差值j,候选下载请求包括f1,f2,f3,且升级顺序为f1的升级顺序先于f2的升级顺序,f2的升级顺序先于f3的升级顺序,f1,f2,f3的候选带宽分别为h1,h2,h3,首先比较 差值j和候选带宽h1的大小,若h1小于或等于j,则将所述f1作为目标下载请求;进一步比较差值j和候选带宽h1的差值与候选带宽h2之间的大小,即比较j-h1与h2的大小,若h2小于或等于j-h,则将h2对应的候选请求f2作为目标下载请求;进一步,比较差值j和候选带宽h1、候选带宽h2的差值与候选带宽h3之间的大小,即比较j-h1-h2与h3大小,若h3大于j-h1-h2,则h3对应的候选请求f3不能作为目标下载请求;在各候选下载请求中获取的目标下载请求为f1和f2。
在另一种实现方式中,由于处于下载状态的终端的下载速度不是固定的,即处于下载状态的终端占用的带宽也不是固定不变的,在没有监听到有终端完成下载时,处于下载状态的终端所占用的带宽也可能小于阈值,服务器可以为等待队列中待处理的下载请求对应的终端提供下载服务;为了提高下载效率,步骤S5包括:
S51b、每隔预设的时间间隔,获取正在下载升级文件的终端所占用的带宽,以得到更新占用带宽。
在本公开实施例中,每隔预设的时间间隔,处于下载状态的各终端上报自身的下载速度,服务器根据处于下载状态的各终端上报的下载速度确定处于下载状态的终端所占用的带宽,以得到更新占用带宽。
S52b、获取等待队列中若干个候选下载请求分别对应的各候选带宽。
本公开实施例中,对于等待队列中待处理的下载请求,将升级顺序先于接收的下载请求之前的待处理的下载请求,记为候选下载请求,候选下载请求中包括其对应的终端的测试下载速度,根据候选下载请求对应的终端的测试下载速度,确定候选带宽。例如,在监听到正在下载升级文件的某一终端完成下载时,等待队列中,各待处理的下载请求根据优先级进行排序,得到:f1,f2,f3,f4,f5,f6,其中f4是步骤S2中接收的下载请求,则f1,f2,f3为候选下载请求,确定f1对应的候选带宽为h1、f2对应的候选带宽为h2、f3对应的候选带宽为h3。
步骤S52b和步骤S52a相同。
S53b、若所述更新占用带宽和各候选带宽的和小于或等于所述阈值,则发送下载指令到所述终端。
本公开实施例中,所述终端为步骤S2中接收的下载请求对应的终端,若各 候选带宽与更新占用带宽的和小于或等于所述阈值,则各候选下载请求和所述下载请求分别对应的终端均可以下载升级文件。例如,更新占用带宽为H,所述阈值为G,各候选带宽的和小于或等于所述阈值,即判断h1+h2+h3+H是否小于或等于G,若h1+h2+h3+H小于或等于G,则发送下载指令到f1,f2,f3,f4分别对应的终端,其中,f4为步骤S2中接收的下载请求。可知,本公开实施例中,由于h1+h2+h3+H小于或等于G,发送下载指令到f1,f2,f3,f4分别对应的终端,则可能出现服务器的被占用的带宽大于阈值的情况,由于阈值可以设置为带宽峰值的80%,因此不影响服务器正常工作。
本公开实施例中,对于等待队列中的待处理的下载请求,服务器为任一待处理的下载请求对应的终端提供下载服务后,将该待处理的下载请求从等待队列中删除。
在另一种实现方式中,为了保证服务器的被占用带宽不超过阈值,可以判断更新占用带宽、各候选带宽和待下载带宽的和是否小于或等于所述阈值,若更新占用带宽、各候选带宽和待下载带宽的和小于或等于阈值,则发送下载指令到所述终端(所述下载请求对应的终端),同时,发送下载指令到各候选下载请求对应的终端;所述待下载带宽为步骤S2中接收的下载请求对应的带宽。
在另一种实现方式中,若所述更新占用带宽和各候选带宽的和大于所述阈值,则在各候选下载请求中选取至少一个目标下载请求,发送下载指令到所述至少一个目标下载请求分别对应的终端,继续执行步骤S51b直至所述更新占用带宽和各候选带宽的和小于或等于所述阈值,以实现所述下载请求对应的终端可以下载升级文件。
步骤S53b和步骤S53a相同。
为了使服务器每隔预设的时间间隔,获取正在下载升级文件的终端所占用的带宽,以得到更新占用带宽,对于处于下载状态的各终端,本公开实施例提供的一种应用升级的方法还包括:
K、若处于下载升级文件的状态,每隔预设的时间间隔,将所述下载文件的下载速度向所述服务器发送,以便于所述服务器根据所述下载文件的下载速度确定正在下载升级文件的终端所占用的带宽,以得到更新占用带宽。
本公开实施例中,所述下载速度可以由第三方的测速服务器测得,处于下载 状态的终端每隔所述时间间隔发送测速指令到测速服务器,测速服务器根据测速指令反馈第一下载速度到第一终端,第一终端将接收到的第一下载速度发送到用于分发应用升级文件的服务器。时间间隔可以是1秒,即服务器每隔一秒获取各第一终端的实时下载速度。
在另一种实现方式中,为了进一步提高下载效率,对于正在下载升级文件的终端,服务器可以取消长时间未完成升级文件下载的终端的下载任务,具体的,获取正在下载升级文件的终端的已下载时长;从接收到下载指令开始计数,得到已下载时长。当任一正在下载升级文件的终端大于预设时长时,取消该终端的下载任务。
在本公开实施例中,可以设置预设时长为30分钟,若某一正在下载升级文件的终端的下载时长达到预设时长,且还未完成下载,则取消该终端的下载任务,以释放该终端的占用的带宽。
在另一种实现方式中,参见图2,所述应用升级的方法还可以包括:
a1、终端发送测速指令到测速服务器,所述终端包括还未发送下载请求的终端,以及正在下载升级文件的终端。
a2、测速服务器反馈测试下载速度到还未发送下载请求的终端,发送下载速度到正在下载升级文件的终端。
a3、终端发送下载请求到服务器,所述下载请求包括测试下载速度。
a4、服务器获取占用带宽,所述占用带宽为正在下载升级文件的终端所占用的带宽,所述待下载带宽为根据所述测试下载速度计算的。
a5、服务器判断占用带宽是否小于预设的阈值,若是,则进入a6,若否,则进入a7。
a6、若所述占用带宽小于或等于所述阈值,则服务器发送下载指令到所述终端,以使得所述终端根据所述下载指令下载升级文件。
a7、若所述占用带宽大于所述阈值,则将所述下载请求添加到等待队列。
r、每间隔预设的时间间隔,处于下载状态的终端,发送下载升级文件的下载速度。
a8、监听正在下载升级文件的终端所占用的带宽与等待队列中若干个候选下载请求对应的带宽的和。
a9、判断所述和是否小于或等于所述阈值,若是则进入a10,若否则进入a8。
a10、所述和小于或等于所述阈值,服务器发送下载指令到所述终端。
a11、终端根据接收的下载指令下载应用升级文件。
本公开通过带宽确定下载请求被响应的时机,在接收下载请求时,若占用带宽小于或等于阈值,则立即响应该下载指令,若占用带宽大于阈值,则将该下载指令放入等待队列,再监听正在下载升级文件所占用的带宽,以及等待队列中的待处理下载指令的带宽,进而确定响应该下载指令的时机,这样,通过带宽限制并行下载升级文件的终端数量,以缩小同时下载升级文件所占用的带宽和阈值之间的差距,这样,厂商可以更准确地限流,以实现在最大程度上节约成本。
本公开实施例还提供了一种应用升级系统,所述系统包括终端和服务器;
所述终端,用于发送下载请求到所述服务器,以便于所述服务器根据所述下载请求获取占用带宽,判断所述占用带宽是否小于预设的阈值,其中,所述占用带宽为正在下载升级文件的终端所占用的带宽;若所述占用带宽小于所述阈值,则接收所述服务器发送的下载指令;若所述占用带宽大于或等于所述阈值,则接收所述服务器发送的等待指令;
所述服务器,用于接收下载请求,并根据所述下载请求获取占用带宽,其中,所述占用带宽为正在下载升级文件的终端所占用的带宽;判断所述占用带宽是否小于预设的阈值;若所述占用带宽小于或等于所述阈值,则发送下载指令到所述终端,以使得所述终端根据所述下载指令下载升级文件;若所述占用带宽大于所述阈值,则将所述下载请求添加到等待队列,并发送等待指令到所述终端。
本公开实施例还提供了一种计算机设备,该设备可以是终端,内部结构如图3所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口、显示屏和输入装置。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种应用升级的方法。该计算机设备的显示屏可以是液晶显示屏或者电子墨水显示屏,该计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球 或触控板,还可以是外接的键盘、触控板或鼠标等。
本领域技术人员可以理解,图3所示的仅仅是与本公开方案相关的部分结构的框图,并不构成对本公开方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
在一个实施例中,提供了一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现以下步骤:
接收下载请求,并根据所述下载请求获取占用带宽,其中,所述占用带宽为正在下载升级文件的终端所占用的带宽;
判断所述占用带宽是否小于预设的阈值;
若所述占用带宽小于或等于所述阈值,则发送下载指令到所述终端,以使得所述终端根据所述下载指令下载升级文件;
若所述占用带宽大于所述阈值,则将所述下载请求添加到等待队列,并发送等待指令到所述终端,监听正在下载升级文件的终端所占用的带宽与等待队列中若干个候选下载请求对应的带宽的和,当所述和小于或等于所述阈值时,发送下载指令到所述终端,其中,所述候选下载请求的升级顺序先于所述下载请求的升级顺序;
或者,发送下载请求到所述服务器,以便于所述服务器根据所述下载请求获取占用带宽,判断所述占用带宽是否小于预设的阈值,其中,所述占用带宽为正在下载升级文件的终端所占用的带宽;
接收指令,所述指令包括所述服务器在所述占用带宽小于或等于所述阈值时,或者在正在下载升级文件的终端所占用的带宽与等待队列中若干个候选下载请求对应的带宽的和小于或等于所述阈值时发送的下载指令,以及所述服务器在占用带宽大于所述阈值时发送的等待指令。
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以下步骤:
接收下载请求,并根据所述下载请求获取占用带宽,其中,所述占用带宽为正在下载升级文件的终端所占用的带宽;
判断所述占用带宽是否小于预设的阈值;
若所述占用带宽小于或等于所述阈值,则发送下载指令到所述终端,以使得所述终端根据所述下载指令下载升级文件;
若所述占用带宽大于所述阈值,则将所述下载请求添加到等待队列,并发送等待指令到所述终端,监听正在下载升级文件的终端所占用的带宽与等待队列中若干个候选下载请求对应的带宽的和,当所述和小于或等于所述阈值时,发送下载指令到所述终端,其中,所述候选下载请求的升级顺序先于所述下载请求的升级顺序;
或者,发送下载请求到所述服务器,以便于所述服务器根据所述下载请求获取占用带宽,判断所述占用带宽是否小于预设的阈值,其中,所述占用带宽为正在下载升级文件的终端所占用的带宽;
接收指令,所述指令包括所述服务器在所述占用带宽小于或等于所述阈值时,或者在正在下载升级文件的终端所占用的带宽与等待队列中若干个候选下载请求对应的带宽的和小于或等于所述阈值时发送的下载指令,以及所述服务器在占用带宽大于所述阈值时发送的等待指令。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。

Claims (15)

  1. 一种应用升级的方法,其中,应用于应用升级系统中的服务器,所述应用升级系统还包括终端,所述方法包括:
    接收下载请求,并根据所述下载请求获取占用带宽,其中,所述占用带宽为正在下载升级文件的终端所占用的带宽;
    判断所述占用带宽是否小于预设的阈值;
    若所述占用带宽小于或等于所述阈值,则发送下载指令到所述终端,以使得所述终端根据所述下载指令下载升级文件;
    若所述占用带宽大于所述阈值,则将所述下载请求添加到等待队列,并发送等待指令到所述终端,监听正在下载升级文件的终端所占用的带宽与等待队列中若干个候选下载请求对应的带宽的和,当所述和小于或等于所述阈值时,发送下载指令到所述终端,其中,所述候选下载请求的升级顺序先于所述下载请求的升级顺序。
  2. 根据权利要求1所述的方法,其中,所述获取所述下载请求对应的待下载带宽,包括:
    获取处于下载状态的各终端分别对应的各下载速度;
    根据处于下载状态的各终端分别对应的各下载速度确定占用带宽。
  3. 根据权利要求2所述的方法,其中,所述根据所述下载请求获取占用带宽,包括:
    获取所述下载请求对应的待下载带宽;
    计算所述待下载带宽与所述占用带宽的和,并将待下载带宽与所述占用带宽的和作为更新后的占用带宽。
  4. 根据权利要求3所述的方法,其中,所述下载请求中包括测试下载速度;所述获取所述下载请求对应的待下载带宽,包括:
    根据所述测试下载速度确定所述待下载带宽。
  5. 根据权利要求1所述的方法,其中,所述判断所述占用带宽是否小于预设的阈值具体包括:
    判断等待队列中是否有待处理的下载请求;
    若所述等待队列中有待处理的下载请求,则将所述下载请求添加到所述等待队列,并发送等待指令到所述终端;
    若所述等待队列中没有待处理的下载请求,则判断所述占用带宽是否小于预设的阈值。
  6. 根据权利要求1中所述的方法,其中,所述若所述占用带宽大于所述阈值,则将所述下载请求添加到等待队列,包括:
    若所述占用带宽大于所述阈值,则将所述下载请求添加到所述等待队列的最后一位。
  7. 根据权利要求1-6中任一项所述的方法,其中,所述监听正在下载升级文件的终端所占用的带宽与等待队列中若干个候选下载请求对应的带宽的和,当所述和小于或等于所述阈值时,发送下载指令到所述终端,包括:
    监听到任一正在下载升级文件的终端完成下载时,获取正在下载升级文件的终端所占用的带宽,以得到更新占用带宽;
    获取等待队列中若干个候选下载请求分别对应的各候选带宽;
    若所述更新占用带宽和各候选带宽的和小于或等于所述阈值,则发送下载指令到所述终端。
  8. 根据权利要求1-6中任一项所述的方法,其中,所述监听正在下载升级文件的终端所占用的带宽与等待队列中若干个候选下载请求对应的带宽的和,当所述和小于或等于所述阈值时,发送下载指令到所述终端,包括:
    监听到任一正在下载升级文件的终端完成下载时,获取正在下载升级文件的终端所占用的带宽,以得到更新占用带宽;
    获取等待队列中若干个候选下载请求分别对应的各候选带宽;
    若所述更新占用带宽、所述待下载带宽和各候选带宽的和小于或等于所述阈值,则发送下载指令到所述终端。
  9. 根据权利要求1-6中任一项所述的方法,其中,监听正在下载升级文件的终端所占用的带宽与等待队列中若干个候选下载请求对应的带宽的和,当所述和小于或等于所述阈值时,发送下载指令到所述终端,包括:
    每隔预设的时间间隔,获取正在下载升级文件的终端所占用的带宽,以得到更新占用带宽;
    获取等待队列中若干个候选下载请求分别对应的各候选带宽;
    若所述更新占用带宽和各候选带宽的和小于或等于所述阈值,则发送下载指令到所述终端。
  10. 根据权利要求要求1所述的方法,其中,所述方法还包括:
    对于等待队列中的任一待处理的下载请求,所述待处理的下载请求对应的终端完成下载后,将所述待处理的下载请求从等待队列中删除。
  11. 一种应用升级的方法,其中,应用于应用升级系统中的终端,所述应用升级系统还包括服务器,所述方法包括:
    发送下载请求到所述服务器,以便于所述服务器根据所述下载请求获取占用带宽,判断所述占用带宽是否小于预设的阈值,其中,所述占用带宽为正在下载升级文件的终端所占用的带宽;
    接收指令,所述指令包括所述服务器在所述占用带宽小于或等于所述阈值时,或者在正在下载升级文件的终端所占用的带宽与等待队列中若干个候选下载请求对应的带宽的和小于或等于所述阈值时发送的下载指令,以及所述服务器在占用带宽大于所述阈值时发送的等待指令。
  12. 根据权利要求11所述的方法,其中,所述方法还包括:
    若处于下载升级文件的状态,每隔预设的时间间隔,将下载升级文件的下载速度向所述服务器发送,以便于所述服务器根据所述下载升级文件的下载速度确定正在下载升级文件的终端所占用的带宽,以得到更新占用带宽。
  13. 一种应用升级系统,其中,所述系统包括终端和服务器;
    所述终端,用于发送下载请求到所述服务器,以便于所述服务器根据所述下载请求获取占用带宽,判断所述占用带宽是否小于预设的阈值,其中,所述占用带宽为正在下载升级文件的终端所占用的带宽;若所述占用带宽小于所述阈值,则接收所述服务器发送的下载指令;若所述占用带宽大于或等于所述阈值,则接收所述服务器发送的等待指令;
    所述服务器,用于接收下载请求,并根据所述下载请求获取占用带宽,其中,所述占用带宽为正在下载升级文件的终端所占用的带宽;判断所述占用带宽是否小于预设的阈值;若所述占用带宽小于或等于所述阈值,则发送下载指令到所述终端,以使得所述终端根据所述下载指令下载升级文件;若所述占用带宽大于所述阈值,则将所述下载请求添加到等待队列,并发送等待指令到所述终端。
  14. 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,其中,所述处理器执行所述计算机程序时实现权利要求1至10中的任一项所述方法的步骤。
  15. 一种计算机可读存储介质,其上存储有计算机程序,其中,所述计算机程序被处理器执行时实现权利要求1至10中的任一项所述的方法的步骤。
PCT/CN2020/111319 2019-12-30 2020-08-26 一种应用升级的方法和计算机设备 WO2021135301A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911404640.8A CN113127021B (zh) 2019-12-30 2019-12-30 一种应用升级的方法和计算机设备
CN201911404640.8 2019-12-30

Publications (1)

Publication Number Publication Date
WO2021135301A1 true WO2021135301A1 (zh) 2021-07-08

Family

ID=76687074

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/111319 WO2021135301A1 (zh) 2019-12-30 2020-08-26 一种应用升级的方法和计算机设备

Country Status (2)

Country Link
CN (1) CN113127021B (zh)
WO (1) WO2021135301A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114338533A (zh) * 2021-12-30 2022-04-12 广东明创软件科技有限公司 一种调整方法、电子设备及计算机存储介质
CN115941316A (zh) * 2022-12-05 2023-04-07 广州力麒智能科技有限公司 一种智能自助终端中间件调用方法及装置

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115811413B (zh) * 2022-07-15 2023-07-25 北京金朗维科技有限公司 一种用于无线扫码设备的在线升级方法和装置
CN115733833A (zh) * 2022-10-31 2023-03-03 成都赛力斯科技有限公司 文件分时下载方法、装置、计算机设备和存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103259672A (zh) * 2012-02-17 2013-08-21 阿里巴巴集团控股有限公司 软件升级方法和系统
WO2014123898A1 (en) * 2013-02-05 2014-08-14 Apple Inc. Automatic updating of applications
CN104978335A (zh) * 2014-04-04 2015-10-14 阿里巴巴集团控股有限公司 数据访问控制方法和装置
CN105323106A (zh) * 2014-08-04 2016-02-10 中兴通讯股份有限公司 一种软件升级管理方法、设备及系统
CN106550044A (zh) * 2016-11-24 2017-03-29 腾讯科技(深圳)有限公司 应用下载方法、下载服务器、下载客户端和应用下载系统
CN108599997A (zh) * 2018-04-04 2018-09-28 北京奇艺世纪科技有限公司 升级控制方法和装置

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW576045B (en) * 2002-09-20 2004-02-11 Ind Tech Res Inst System for controlling network flow by monitoring download bandwidth
CN105681073A (zh) * 2015-12-25 2016-06-15 北京奇虎科技有限公司 一种更新应用程序的方法及装置
CN110022364B (zh) * 2019-04-04 2022-05-24 密信(北京)数字科技有限公司 一种文件下载方法及服务器

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103259672A (zh) * 2012-02-17 2013-08-21 阿里巴巴集团控股有限公司 软件升级方法和系统
WO2014123898A1 (en) * 2013-02-05 2014-08-14 Apple Inc. Automatic updating of applications
CN104978335A (zh) * 2014-04-04 2015-10-14 阿里巴巴集团控股有限公司 数据访问控制方法和装置
CN105323106A (zh) * 2014-08-04 2016-02-10 中兴通讯股份有限公司 一种软件升级管理方法、设备及系统
CN106550044A (zh) * 2016-11-24 2017-03-29 腾讯科技(深圳)有限公司 应用下载方法、下载服务器、下载客户端和应用下载系统
CN108599997A (zh) * 2018-04-04 2018-09-28 北京奇艺世纪科技有限公司 升级控制方法和装置

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114338533A (zh) * 2021-12-30 2022-04-12 广东明创软件科技有限公司 一种调整方法、电子设备及计算机存储介质
CN114338533B (zh) * 2021-12-30 2024-05-28 广东明创软件科技有限公司 一种调整方法、电子设备及计算机存储介质
CN115941316A (zh) * 2022-12-05 2023-04-07 广州力麒智能科技有限公司 一种智能自助终端中间件调用方法及装置
CN115941316B (zh) * 2022-12-05 2023-08-08 广州力麒智能科技有限公司 一种智能自助终端中间件调用方法及装置

Also Published As

Publication number Publication date
CN113127021B (zh) 2023-06-23
CN113127021A (zh) 2021-07-16

Similar Documents

Publication Publication Date Title
WO2021135301A1 (zh) 一种应用升级的方法和计算机设备
US8230061B2 (en) Network resource management with prediction
US8036227B2 (en) Quality of service support for A/V streams
CN112165691B (zh) 内容分发网络调度方法、装置、服务器和介质
CN108845816A (zh) 应用程序更新方法、系统、计算机设备及存储介质
CN110365752A (zh) 业务数据的处理方法、装置、电子设备和存储介质
WO2021139383A1 (zh) 直播间礼物资源更新方法、装置、介质及电子设备
CN108415772B (zh) 一种基于容器的资源调整方法、装置和介质
CN109428839B (zh) 一种cdn调度方法、设备及系统
US10555145B1 (en) Learned configuration of modification policies for program execution capacity
EP3923549A1 (en) Data downloading method and related apparatus
CN105024947A (zh) 用于监控网络业务量的方法和装置
US20170033980A1 (en) Agent manager for distributed transaction monitoring system
US20130305263A1 (en) Communications management
US20220124172A1 (en) Service Deployment Method and Scheduling Apparatus
US20180249017A1 (en) Data Usage Based Data Transfer Determination
CN110874314B (zh) 压测方法、装置、设备和介质
US8745681B2 (en) Set top box resource allocation for executing a widget
TWI539273B (zh) 用於減少電力消耗之並行網路應用程式排程技術
CN111625344B (zh) 应用系统中的资源调度系统、方法及装置
JP2008077281A (ja) スーパースケジューラ、処理依頼方法、およびスーパースケジューラプログラム
CN109218259B (zh) 许可管理方法及装置、applm功能实体及计算机可读存储介质
CN111836221A (zh) 计费管理方法、设备及系统
CN113986658A (zh) 基于计算管理平台的计费方法、装置、设备和介质
CN108512864B (zh) 一种网络请求调度的方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20909640

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20909640

Country of ref document: EP

Kind code of ref document: A1