Application download control method and server
By judging on the server side whether the traffic requested by the application update is allowed within the preset time period, and adopting the peak-shaving and valley-filling strategy, the problem of high CDN costs during application updates is solved, and the traffic is stabilized and the cost is reduced.
Patent Information
- Application Number
- CN202110555339.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-21
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2041-05-21
AI Technical Summary
When users update their applications, application providers need to pay expensive CDN fees because the existing daily peak and monthly average billing model causes CDN traffic peaks, resulting in high fees.
By receiving the application update request on the server side, it determines whether the target traffic is allowed to be used within the preset time period. If it exceeds, it will feedback that there is no updated version. If it does not exceed, it will push the updated version. The peak-shaving and valley-filling strategy is used to stabilize the CDN traffic. Reduce daily peak value.
It effectively reduces CDN costs, saves bandwidth traffic by smoothing CDN traffic, and ensures that applications are updated in a timely manner.
Smart Images

Figure CN113296808B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of electronic equipment, and specifically relates to a download control method and server for an application program. Background Art
[0002] When a user's electronic device updates an application (APP), the APP provider needs to pay the corresponding CDN fee to the Content Delivery Network (CDN) manufacturer. In related technologies, CDN manufacturers use a daily peak monthly average algorithm for billing, that is, taking the average of the peak CDN traffic of each day of the month, calculating the total traffic and then multiplying it by the unit price for billing.
[0003] If every user updates the app immediately after a new version is released, there will be a peak in CDN traffic, while the CDN traffic will be very low or even close to zero during the period when there is no version update. Under the above billing model, the APP provider needs to pay expensive CDN fees. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a download control method and server for an application program, which can solve the problem in the related art that the provider of the APP needs to pay expensive CDN fees when performing software updates and upgrades.
[0005] In a first aspect, an embodiment of the present application provides a method for controlling downloading of an application program, the method comprising:
[0006] Receiving a version update request of an application sent by a first electronic device;
[0007] In response to the version update request, if an updated version of the application exists, determining a target flow required to download the updated version;
[0008] When the target traffic is less than or equal to the traffic allowed to be used within a preset time period, the update version is pushed to the first electronic device.
[0009] In a second aspect, an embodiment of the present application provides a server, the server comprising:
[0010] A receiving module, configured to receive a version update request of an application sent by a first electronic device;
[0011] an acquisition module, for responding to a version update request and determining a target flow required for downloading an updated version if an updated version of the application exists;
[0012] The push module is used to push the update version to the first electronic device when the target flow rate is less than or equal to the flow rate allowed to be used within a preset time period.
[0013] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, and when the program or instruction is executed by the processor, the steps of the download control method of the first aspect are implemented.
[0014] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the download control method of the first aspect are implemented.
[0015] In a fifth aspect, an embodiment of the present application provides a chip, the chip including a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the download control method as in the first aspect.
[0016] In an embodiment of the present application, when the second electronic device (such as a server) receives a version update request of an application sent by the first electronic device, it determines that the first electronic device needs to update the application version. In this case, it is determined whether the application has an updated version. If there is an updated version, it is necessary to determine whether the target flow of the first electronic device downloading the updated version exceeds the allowed flow within the preset time period. If the target flow exceeds the allowed flow within the preset time period, the information that there is no updated version is fed back to the first electronic device; if the target flow does not exceed the allowed flow within the preset time period, the updated version is pushed to the first electronic device so that the first electronic device downloads the updated version, thereby updating the application version. In the above manner, the idea of shaving peaks and filling valleys is adopted, and only updated versions that do not exceed the flow control setting value (i.e., allowed flow) are allowed to be downloaded within the preset time period, thereby controlling the CDN flow per unit time, avoiding the situation of spikes in the CDN flow waveform, and making the original CDN flow waveform that fluctuates between high and low become stable. After the daily peak value is reduced, according to the billing rules, the cost of CDN is also reduced accordingly, and the corresponding saved bandwidth flow can also be used by other users, fully achieving the purpose of saving flow and reducing fees. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 This is one of the flowcharts of the download control method of the application program according to the embodiment of the present application;
[0018] Figure 2 This is a second flow chart of the download control method of the application program according to the embodiment of the present application;
[0019] Figure 3A schematic diagram of a configuration rate problem that is twice that of an embodiment of the present application;
[0020] Figure 4 is a schematic diagram of window movement in an embodiment of the present application;
[0021] Figure 5 This is an interactive schematic diagram of configuring the total usage flow within a certain time period in an embodiment of the present application;
[0022] Figure 6 is a schematic block diagram of a server in an embodiment of the present application;
[0023] Figure 7 It is one of the schematic block diagrams of the electronic device according to the embodiment of the present application;
[0024] Figure 8 This is the second schematic block diagram of the electronic device according to the embodiment of the present application. DETAILED DESCRIPTION
[0025] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0026] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here. In addition, the "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally represents that the objects associated with each other are in an "or" relationship.
[0027] The following, in conjunction with the accompanying drawings, describes in detail the application download control method, server, electronic device and readable storage medium provided in the embodiments of the present application through specific embodiments and their application scenarios.
[0028] The present application embodiment provides a method for controlling the download of an application program, such as Figure 1 As shown, the download control method includes:
[0029] Step 102, receiving a version update request for an application sent by a first electronic device;
[0030] Step 104, in response to the version update request, if an updated version of the application exists, determining a target flow required to download the updated version;
[0031] Step 106: When the target traffic is less than or equal to the traffic allowed within a preset time period, push the updated version to the first electronic device.
[0032] The first electronic device may be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a wearable device or the like.
[0033] In this embodiment, when the second electronic device (such as a server) receives a version update request for an application sent by the first electronic device, it determines that the first electronic device needs to update the application version. In this case, it is determined whether there is an updated version of the application. If there is an updated version, it is necessary to determine whether the target traffic required for the first electronic device to download the updated version exceeds the allowed traffic within a preset time period (such as the current time period). If the target traffic exceeds the allowed traffic within the preset time period, the information that there is no updated version is fed back to the first electronic device; if the target traffic does not exceed the allowed traffic within the preset time period, the updated version is pushed to the first electronic device so that the first electronic device downloads the updated version, thereby updating the application version.
[0034] Through the above method, the idea of shaving peaks and filling valleys is adopted, and only updated versions that do not exceed the flow control setting value (that is, the allowed flow) are allowed to be downloaded within the preset time period, thereby controlling the CDN flow per unit time, avoiding spikes in the CDN flow waveform, and making the original fluctuating CDN flow waveform smooth. After the daily peak value is reduced, according to the billing rules, the CDN fee will also be reduced, and the corresponding saved bandwidth flow can also be used by other users, fully achieving the purpose of saving flow and reducing fees.
[0035] It should be noted that, if a vulnerability problem occurs in the application of the first electronic device and needs to be repaired in a timely manner, it is necessary to control the specific version of the APP not to perform traffic control, so that users can upgrade the program in a timely manner without performing traffic control. Specifically, the version update request carries the current version number of the application, and determines whether the application needs to be upgraded or repaired based on the current version number, and then performs traffic control when performing a version upgrade, and does not perform traffic control when performing a version repair.
[0036] Furthermore, in one embodiment of the present application, after determining the target traffic required for downloading the updated version, it also includes: determining the traffic allowed to be used within the preset time period based on the total traffic used and the used traffic within the preset time period.
[0037] In this embodiment, a method for determining the allowed flow rate within a preset time period is defined.
[0038] First, determine the total traffic used within the preset time period. Specifically, the larger the CDN bandwidth, the faster the APP will be upgraded. According to the CDN fee calculation rules, that is, the daily peak and the monthly average, the cost will be higher. You need to make a compromise between the two dimensions of time and cost to determine how much bandwidth (that is, the total traffic used) to use within a certain period of time, such as calculating the total download traffic allowed per second (Mbps). Assuming that the result of the current calculation is 5000Mbps, a total of 5000M is allowed to be downloaded in one second. Calculated as 1Mb equals 1 token, there are 5000 tokens per second. Of course, if you want more fine-grained control, you can also calculate it as 1Kb or 1b equals 1 token.
[0039] After determining 5,000 tokens per second, it is necessary to issue 5,000 tokens per second in the system as a backup. 5,000 tokens are issued at the current time (for example, 19:46:48 on March 26, 2021), and 5,000 tokens are issued again in the next second (19:46:49 on March 26, 2021).
[0040] Because multiple applications may be downloaded within a certain period of time, part of the traffic may have been used to download other applications before the application currently to be downloaded. Therefore, it is necessary to further determine the used traffic within the preset time period. By calculating the difference between the total used traffic and the used traffic, the allowed traffic within the preset time period is obtained.
[0041] In this embodiment, an implementable process of the download control method of the application program of the embodiment of the present application is as follows: Figure 2 As shown, including:
[0042] Step 202: The client APP initiates a version update request at regular intervals;
[0043] Step 204, the server detects whether there is an updated version of the APP, if not, proceeds to step 206, if yes, proceeds to step 208;
[0044] Step 206, feeding back to the client information that there is no updated version;
[0045] Step 208, determining whether the tokens in the current time period are sufficient to download the updated version, if sufficient, proceeding to step 210, if not sufficient, proceeding to step 206;
[0046] Step 210, updating the number of currently consumed tokens;
[0047] Step 212, feeding back the download address of the updated version to the client;
[0048] Step 214: The client downloads the updated version and updates the APP version.
[0049] In this embodiment, the APP of the client (i.e., the first electronic device) needs to set a timer to periodically send version update requests to the service end (i.e., the server), such as a request once every 1 minute, and the request needs to carry the current version number of the APP. After receiving the version update request, the server compares the current version number carried therein with the latest version number to determine whether the client's APP needs to be updated. If no update is required, the information that there is no updated version is returned; if an update is required, the size of the updated version of the APP to be downloaded is obtained, and then rounded up. For example, if the size of the updated version is 17.5M, then 18M is taken, and according to 1M=1 token, it is determined that 18 tokens are required for this download.
[0050] Furthermore, it is determined how many of the 5,000 tokens issued at the current time (for example, 19:46:48 on March 26, 2021) are still available for use, and then it is determined whether the remaining tokens minus 18 are greater than zero. If they are less than zero, it means that the tokens have been exceeded and cannot be downloaded, and the process ends. Otherwise, 18 is subtracted from the remaining tokens, and the download address of the updated version is fed back to the client. After receiving the download address, the client initiates the download of the updated version and then installs it. At this point, the APP update is complete.
[0051] Through the above method, the idea of shaving peaks and filling valleys is adopted to control the amount of traffic available for download within a certain period of time, thereby reducing the CDN fees to be paid.
[0052] Furthermore, in one embodiment of the present application, determining the traffic usage allowed within a preset time period includes: when there are multiple applications, determining the traffic usage allowed within the preset time period corresponding to the application according to the order of the reception time of the version update request.
[0053] In this embodiment, in actual use, a first electronic device may download and update multiple applications at the same time, and multiple first electronic devices may also update an application at the same time, which will be more complicated, so concurrency control is required. Specifically, the queue processing is performed according to the order of the version update request to prevent errors in the calculation of the allowed traffic. For example, the size of the application corresponding to the version update request received first is 15M, and the size of the application corresponding to the version update request received later is 18M. Then, when deducting, 15 tokens need to be deducted first, and then 18 tokens need to be deducted to obtain the allowed traffic of the application corresponding to the version update request received later.
[0054] Through the above method, the accuracy of calculating the allowed traffic usage for downloading applications is improved, thereby ensuring the accuracy of the judgment on whether to download the application, so as to achieve the purpose of saving traffic and reducing fees.
[0055] Further, in one embodiment of the present application, before receiving the version update request of the application sent by the first electronic device, it also includes: dividing the preset time period into a preset number of sub-time periods, and setting a corresponding sub-flow for each sub-time period according to the total flow used in the preset time period; after determining the target flow required for downloading the updated version, it also includes: determining a first sub-time period corresponding to the reception time of the version update request, the first sub-time period being one of the preset number of sub-time periods; when the first sub-time period is the first sub-time period of the preset time period, the sub-allowed flow corresponding to the first sub-time period is used as the flow allowed in the preset time period; when the first sub-time period is the Nth sub-time period of the preset time period, the sub-allowed flow corresponding to the second sub-time period is accumulated to the first sub-time period, and the sub-allowed flow corresponding to the first sub-time period is used as the flow allowed in the preset time period; wherein N is a positive integer greater than 1, the second sub-time period is the N-1 sub-time periods before the first sub-time period in the preset time period, the sub-allowed flow of the first sub-time period is the unused flow in the sub-flow of the first sub-time period, and the sub-allowed flow of the second sub-time period is the unused flow in the sub-flow of the second sub-time period.
[0056] In this embodiment, another method of determining the allowed flow rate within a preset time period is defined.
[0057] It should be noted that the above embodiment limits the number of tokens generated per second, and there is no relationship between the previous second and the next second. This control method is called a fixed window token generation strategy. If the current token generation rule is set to 1000 tokens per second, Figure 3As shown, in the last 100ms of the first second and the first 100ms of the second second, the APP that the first electronic device requests to update uses 1000 tokens, so it will appear that the CDN traffic corresponding to 2000 tokens needs to be downloaded in this 200ms cycle. Because of the network communication delay, this will lead to a problem of twice the configuration rate in the second second, that is, all the traffic of the first and second seconds is used in the second second. Or, in the last 100ms of the first second and the second to last 100ms, the APP that the first electronic device requests to update uses 100 tokens, so it will appear that the CDN traffic corresponding to 200 tokens needs to be downloaded in this 200ms cycle. Because of the network communication delay, this will lead to a problem of twice the configuration rate in the last 100ms of the first second, that is, all the traffic of the second to last 100ms and the last 100ms is used in the last 100ms.
[0058] In the embodiment of the present application, a sliding window token generation strategy is used to control the CDN bandwidth, thereby improving the token dynamic generation service to solve the above-mentioned problem.
[0059] Specifically, the preset time period is divided into a preset number of sub-time periods, and a corresponding sub-flow is set for each sub-time period according to the total traffic usage within the preset time period. For example, the original window (i.e., the preset time period) is divided into several equal small windows (i.e., sub-time periods), each small window corresponds to a different time point, and has an independent counter, and each small window corresponds to a certain number of tokens. When the receiving time point of the version update request is greater than the maximum time point of the current window, the window is shifted forward by one small window (the data of the first small window is discarded, the second small window becomes the first small window, and the current version update request is placed in the last small window). It is worth noting that the sum of all requests in the entire window cannot be greater than the configured total number of tokens generated per second.
[0060] Further, the first sub-time period corresponding to the time when the version update request is received is determined, and when the first sub-time period is the first sub-time period of the preset time period, the sub-allowed traffic volume of the first sub-time period is used as the allowed traffic volume within the preset time period. It should be noted that the sub-allowed traffic volume of the first sub-time period is the unused traffic volume of the sub-traffic of the first sub-time period. If the first sub-time period is not used, all the sub-traffic of the first sub-time period is the sub-allowed traffic volume of the first sub-time period.
[0061] In the case where the first sub-time period is the Nth sub-time period of the preset time period, the sub-allowed traffic corresponding to the N-1 sub-time periods before the first sub-time period in the preset time period is accumulated to the first sub-time period. It should be noted that the sub-allowed traffic corresponding to the N-1 sub-time periods is the unused part of the sub-traffic corresponding to each sub-time period in the N-1 sub-time periods.
[0062] At this time, the sub-allowed flow rate corresponding to the first sub-time period includes the sub-allowed flow rate of the first sub-time period itself, and also includes the sub-allowed flow rate corresponding to the N-1 sub-time periods before the first sub-time period. The sub-allowed flow rate corresponding to the first sub-time period at this time is used as the allowed flow rate in the preset time period.
[0063] like Figure 4 As shown in the figure, the one-second window is divided into 6 small windows, each window occupies 1 / 6 second. When the user request exceeds the first 1 / 6 second, the small window will slide forward. It is worth noting that it is necessary to control Figure 4 After each slide, the size of the token in a 1-second window cannot exceed the total number of tokens generated per second.
[0064] The time span of the small window can be set arbitrarily, ranging from 1 millisecond to 1000 milliseconds.
[0065] For example, if the size of the small window is set to 1 millisecond, and the token generation rule is set to 1,000 tokens per second, then one small window corresponds to 1 token. If the current user requests to download an 18M application, 18 tokens are required. If the number of tokens accumulated in the current small window is only 1, then not enough tokens can be obtained and the download fails.
[0066] If the next user makes a request at the time of the 18th small window, and the small window slides forward 17 times, the 18th small window will accumulate 18 tokens, which just meets the user's need for tokens, so the download is allowed, and the corresponding number of tokens is deducted, and the accumulated tokens of the next small window will start from 1. If the current small window has accumulated 18 tokens, and the user requests to download a 15M application, the user is allowed to download, 15 tokens are deducted, and the excess tokens are passed to the next small window, then the accumulated number of tokens in the next small window is 4 (3+1, 3 is left over from the previous small window, and 1 is for this small window itself). It should be noted that the number of tokens accumulated in the next small window cannot exceed the total number of tokens in 1 second, that is, it cannot exceed 1000 tokens. If it exceeds, it will be cleared directly.
[0067] The embodiment of the present application improves the generation of allowed traffic through the idea of a sliding window, accumulates the traffic to the sub-time period corresponding to the reception time of the version update request, and can provide it for the use of updated version download in a timely manner, thereby solving the problem of twice the configured rate within a certain second that may occur.
[0068] Furthermore, in one embodiment of the present application, the download control method of the application also includes: determining the total traffic usage within the preset time period based on the historical download times of the first electronic device within the preset time period; wherein the preset time period corresponds to the preset time period, and the more historical download times, the greater the total traffic usage.
[0069] In this embodiment, the total traffic usage within a preset time period can be a fixed value. For example, the total traffic usage per second is calculated based on the total CDN amount required for a day divided by 24×3600. Once the total traffic usage within a certain time period is set in this implementation method, it will no longer change. However, this implementation method cannot achieve refined control. In actual applications, the number of downloads may vary in different time periods of the day. For example, the peak period for user downloads may be from 19:00 to 24:00, and other times are low-peak download periods. For example, during holidays, the number of user downloads will also be higher than usual. Therefore, the embodiment of the present application proposes a function of dynamically adjusting the total traffic usage within a certain time period based on the historical number of downloads.
[0070] Specifically, a configuration service is needed that can configure the total traffic usage within a certain period of time according to a specific time interval.
[0071] It should be noted that the configuration personnel can adjust the size of the total traffic usage in a certain time period within a large cycle at any time according to the development of the business. For example, the total traffic usage per second is set according to the granularity of one hour, that is, the same total traffic usage is issued every second within this hour. For example, if the download volume from 00:00 to 01:00 is small, the issuance of 500 tokens per second (that is, the total traffic usage per second) within this hour is limited, and if the download volume from 20:00 to 21:00 is large, then the number of tokens is increased, and the issuance of 1500 tokens per second (that is, the total traffic usage per second) within this hour is limited.
[0072] If you want to perform more fine-grained control, you can support granularity down to the minute level. You can also optimize based on actual conditions, such as controlling at a granularity of 3 or 4 hours to optimize the workload of the configuration.
[0073] According to the rules configured by the configuration personnel in the configuration service, the number of tokens per second is generated in real time for the APP update service to use. Figure 5As shown, the configuration personnel configures the size of the number of tokens for each time period to the configuration service. The token dynamic generation service obtains the configuration data and generates the number of tokens per second. The client (i.e., the first electronic device) sends a version update request to the APP update service. The APP update service requests the token size for the preset time period from the token dynamic generation service, determines whether the number of tokens is allowed to be downloaded, and updates the number of consumed tokens. When downloading is allowed, the APP update service returns the download address of the APP to the client, and the client downloads and installs it.
[0074] Among them, the configuration service, token dynamic generation service and APP update service are the service side (ie server).
[0075] Through the above method, by adding configuration services and token dynamic generation services, the bandwidth usage of CDN can be controlled in a more fine-grained manner, and the total usage traffic can be adjusted according to different time periods to achieve the purpose of flexibly controlling the total usage traffic within a certain period of time.
[0076] The present application also provides a server, such as Figure 6 As shown, the server 600 includes:
[0077] The receiving module 602 is used to receive a version update request of an application sent by a first electronic device;
[0078] An acquisition module 604 is used to determine, in response to a version update request, a target flow required to download an updated version of the application program if an updated version exists;
[0079] The push module 606 is used to push the update version to the first electronic device when the target traffic is less than or equal to the traffic allowed to be used within a preset time period.
[0080] In this embodiment, when the server receives a version update request for an application sent by the first electronic device, it determines that the first electronic device needs to update the application version. In this case, it is determined whether there is an updated version of the application. If there is an updated version, it is necessary to determine whether the target traffic for the first electronic device to download the updated version exceeds the allowed traffic within the preset time period. If the target traffic exceeds the allowed traffic within the preset time period, information that there is no updated version is fed back to the first electronic device; if the target traffic does not exceed the allowed traffic within the preset time period, the updated version is pushed to the first electronic device so that the first electronic device downloads the updated version, thereby updating the application version.
[0081] Through the above method, the idea of shaving peaks and filling valleys is adopted, and only updated versions that do not exceed the flow control setting value (that is, the allowed flow) are allowed to be downloaded within the preset time period, thereby controlling the CDN flow per unit time, avoiding spikes in the CDN flow waveform, and making the original fluctuating CDN flow waveform smooth. After the daily peak value is reduced, according to the billing rules, the CDN fee will also be reduced, and the corresponding saved bandwidth flow can also be used by other users, fully achieving the purpose of saving flow and reducing fees.
[0082] Furthermore, in one embodiment of the present application, the server 600 further includes: a first determination module, configured to determine the traffic allowed to be used within a preset time period according to the total traffic used and the used traffic within the preset time period.
[0083] Furthermore, in one embodiment of the present application, the first determination module is specifically used to determine the traffic allowed to be used within a preset time period corresponding to the application according to the order of receiving the version update request when there are multiple applications.
[0084] Further, in one embodiment of the present application, the server 600 also includes: a division module, which is used to divide the preset time period into a preset number of sub-time periods, and set a corresponding sub-flow for each sub-time period according to the total flow used in the preset time period; a second determination module, which is used to: determine a first sub-time period corresponding to the reception time of the version update request, the first sub-time period being one of the preset number of sub-time periods; when the first sub-time period is the first sub-time period of the preset time period, the sub-allowed flow corresponding to the first sub-time period is used as the allowed flow in the preset time period; when the first sub-time period is the Nth sub-time period of the preset time period, the sub-allowed flow corresponding to the second sub-time period is accumulated to the first sub-time period, and the sub-allowed flow corresponding to the first sub-time period is used as the allowed flow in the preset time period; wherein N is a positive integer greater than 1, the second sub-time period is the N-1 sub-time periods before the first sub-time period in the preset time period, the sub-allowed flow of the first sub-time period is the unused flow in the sub-flow of the first sub-time period, and the sub-allowed flow of the second sub-time period is the unused flow in the sub-flow of the second sub-time period.
[0085] Furthermore, in one embodiment of the present application, the server 600 also includes: a third determination module, used to determine the total traffic usage within a preset time period based on the number of historical downloads of the first electronic device within the preset time period; wherein the preset time period corresponds to the preset time period, and the more historical download times, the greater the total traffic usage.
[0086] The first electronic device in the embodiment of the present application may be a device, or a component, integrated circuit or chip in a terminal. The first electronic device may be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device may be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), etc., and the non-mobile electronic device may be a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0087] The first electronic device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0088] The server 600 provided in the embodiment of the present application can realize Figures 1 to 5 To avoid repetition, the various processes implemented in the method embodiment are not described here.
[0089] Optional, such as Figure 7 As shown, an embodiment of the present application further provides an electronic device 700, which is the server in the above embodiment. The electronic device 700 includes a processor 702, a memory 704, and a program or instruction stored in the memory 704 and executable on the processor 702. When the program or instruction is executed by the processor 702, each process of the above application download control method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0090] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
[0091] Figure 8 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.
[0092] The electronic device 800 includes but is not limited to components such as a radio frequency unit 802 , a network module 804 , an audio output unit 806 , an input unit 808 , a sensor 810 , a display unit 812 , a user input unit 814 , an interface unit 816 , a memory 818 , and a processor 820 .
[0093] Those skilled in the art will appreciate that the electronic device 800 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 820 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 8 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0094] In an embodiment of the present application, the electronic device 800 is the server in the above embodiment, wherein the radio frequency unit 802 is used to receive a version update request for an application sent by a first electronic device; the processor 820 is used to respond to the version update request and, when an updated version of the application exists, determine the target traffic required to download the updated version; the radio frequency unit 802 is also used to push the updated version to the first electronic device when the target traffic is less than or equal to the traffic allowed to be used within a preset time period.
[0095] In this embodiment, when the second electronic device receives the version update request of the application sent by the first electronic device, it determines that the first electronic device needs to update the application version. In this case, it is determined whether there is an updated version of the application. If there is an updated version, it is necessary to determine whether the target traffic for the first electronic device to download the updated version exceeds the allowed traffic within the preset time period. If the target traffic exceeds the allowed traffic within the preset time period, the information that there is no updated version is fed back to the first electronic device; if the target traffic does not exceed the allowed traffic within the preset time period, the updated version is pushed to the first electronic device so that the first electronic device downloads the updated version, thereby updating the application version.
[0096] Through the above method, the idea of shaving peaks and filling valleys is adopted, and only updated versions that do not exceed the flow control setting value (that is, the allowed flow) are allowed to be downloaded within the preset time period, thereby controlling the CDN flow per unit time, avoiding spikes in the CDN flow waveform, and making the original fluctuating CDN flow waveform smooth. After the daily peak value is reduced, according to the billing rules, the CDN fee will also be reduced, and the corresponding saved bandwidth flow can also be used by other users, fully achieving the purpose of saving flow and reducing fees.
[0097] Furthermore, the processor 820 is further configured to determine the traffic allowed to be used within the preset time period according to the total traffic used and the used traffic within the preset time period.
[0098] Furthermore, in one embodiment of the present application, the processor 820 is specifically configured to determine, when there are multiple applications, the traffic usage allowed within a preset time period corresponding to the application according to the order of receiving the version update request.
[0099] Further, in one embodiment of the present application, the processor 820 is also used to: divide the preset time period into a preset number of sub-time periods, and set a corresponding sub-flow for each sub-time period according to the total flow used in the preset time period; determine the first sub-time period corresponding to the reception time of the version update request, the first sub-time period is one of the preset number of sub-time periods; when the first sub-time period is the first sub-time period of the preset time period, the sub-allowed flow corresponding to the first sub-time period is used as the allowed flow in the preset time period; when the first sub-time period is the Nth sub-time period of the preset time period, the sub-allowed flow corresponding to the second sub-time period is accumulated to the first sub-time period, and the sub-allowed flow corresponding to the first sub-time period is used as the allowed flow in the preset time period; wherein N is a positive integer greater than 1, the second sub-time period is the N-1 sub-time periods before the first sub-time period in the preset time period, the sub-allowed flow of the first sub-time period is the unused flow in the sub-flow of the first sub-time period, and the sub-allowed flow of the second sub-time period is the unused flow in the sub-flow of the second sub-time period.
[0100] Furthermore, in one embodiment of the present application, the processor 820 is also used to determine the total traffic usage within a preset time period based on the number of historical downloads of the first electronic device within the preset time period; wherein the preset time period corresponds to the preset time period, and the more historical download times, the greater the total traffic usage.
[0101] It should be understood that in the embodiment of the present application, the radio frequency unit 802 can be used to send and receive information or send and receive signals during a call, specifically, receive downlink data from a base station or send uplink data to a base station. The radio frequency unit 802 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc.
[0102] The network module 804 provides users with wireless broadband Internet access, such as helping users to send and receive emails, browse web pages, and access streaming media.
[0103] The audio output unit 806 can convert the audio data received by the RF unit 802 or the network module 804 or stored in the memory 818 into an audio signal and output it as sound. In addition, the audio output unit 806 can also provide audio output related to a specific function performed by the electronic device 800 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 806 includes a speaker, a buzzer, a receiver, etc.
[0104] The input unit 808 is used to receive audio or video signals. The input unit 808 may include a graphics processing unit (GPU) 8082 and a microphone 8084. The graphics processor 8082 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frame can be displayed on the display unit 812, or stored in the memory 818 (or other storage medium), or sent via the radio frequency unit 802 or the network module 804. The microphone 8084 can receive sound and can process the sound into audio data. The processed audio data can be converted into a format output that can be sent to a mobile communication base station via the radio frequency unit 802 in the case of a telephone call mode.
[0105] The electronic device 800 also includes at least one sensor 810, such as a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, a light sensor, a motion sensor, and other sensors.
[0106] The display unit 812 is used to display information input by the user or information provided to the user. The display unit 812 may include a display panel 8122, which may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like.
[0107] The user input unit 814 can be used to receive input digital or character information, and to generate key signal input related to user settings and function control of the electronic device. Specifically, the user input unit 814 includes a touch panel 8142 and other input devices 8144. The touch panel 8142 is also called a touch screen, which can collect the user's touch operations on or near it. The touch panel 8142 may include a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, and converts it into contact coordinates, and then sends it to the processor 820, receives the command sent by the processor 820 and executes it. Other input devices 8144 may include but are not limited to physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which will not be repeated here.
[0108] Furthermore, the touch panel 8142 may be overlaid on the display panel 8122. When the touch panel 8142 detects a touch operation on or near it, it is transmitted to the processor 820 to determine the type of the touch event, and then the processor 820 provides a corresponding visual output on the display panel 8122 according to the type of the touch event. The touch panel 8142 and the display panel 8122 may be two independent components or integrated into one component.
[0109] The interface unit 816 is an interface for connecting an external device to the electronic device 800. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 816 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic device 800 or may be used to transmit data between the electronic device 800 and an external device.
[0110] The memory 818 can be used to store software programs and various data. The memory 818 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile terminal (such as audio data, a phone book, etc.), etc. In addition, the memory 818 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0111] The processor 820 performs various functions of the electronic device 800 and processes data by running or executing software programs and / or modules stored in the memory 818 and calling data stored in the memory 818, thereby monitoring the electronic device 800 as a whole. The processor 820 may include one or more processing units; preferably, the processor 820 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications.
[0112] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned application download control embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0113] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0114] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned application download control embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0115] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0116] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0117] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0118] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A method for controlling the download of an application, characterized in that: include: Receiving a version update request of an application sent by a first electronic device; In response to the version update request, if an updated version of the application exists, determining a target flow required to download the updated version; When the target flow rate is less than or equal to the flow rate allowed within a preset time period, pushing the updated version to the first electronic device; Before receiving the version update request of the application sent by the first electronic device, the method further includes: Divide the preset time period into a preset number of sub-time periods, and set a corresponding sub-flow rate for each of the sub-time periods according to the total flow rate used in the preset time period; After determining the target flow required for downloading the updated version, the method further includes: Determine a first sub-time period corresponding to the time when the version update request is received, where the first sub-time period is one of the preset number of sub-time periods; In the case where the first sub-time period is the first sub-time period of the preset time period, the sub-allowed flow rate corresponding to the first sub-time period is used as the allowed flow rate within the preset time period; In the case where the first sub-time period is the Nth sub-time period of the preset time period, the sub-allowed flow rate corresponding to the second sub-time period is accumulated to the first sub-time period, and the sub-allowed flow rate corresponding to the first sub-time period is used as the allowed flow rate in the preset time period; Among them, N is a positive integer greater than 1, the second sub-time period is the N-1 sub-time periods before the first sub-time period in the preset time period, the sub-allowed flow rate of the first sub-time period is the unused flow rate in the sub-flow rate of the first sub-time period, and the sub-allowed flow rate of the second sub-time period is the unused flow rate in the sub-flow rate of the second sub-time period.
2. The download control method of application according to claim 1, characterized in that: In the case that there are multiple applications, the traffic usage allowed within the preset time period corresponding to the application is determined according to the order of the reception time of the version update request.
3. The download control method of an application according to claim 1 or 2, characterized in that: Also includes: Determine the total traffic usage within the preset time period according to the historical download times of the first electronic device within the preset time period; The more the historical download times are, the greater the total traffic usage is.
4. A server, characterized in that: include: A receiving module, configured to receive a version update request of an application sent by a first electronic device; an acquisition module, configured to, in response to the version update request, determine a target flow required for downloading an updated version if an updated version of the application exists; A push module, configured to push the updated version to the first electronic device when the target flow rate is less than or equal to the flow rate allowed to be used within a preset time period; A division module, used to divide the preset time period into a preset number of sub-time periods, and set a corresponding sub-flow for each of the sub-time periods according to the total flow used in the preset time period; The second determination module is used for: Determine a first sub-time period corresponding to the time when the version update request is received, where the first sub-time period is one of the preset number of sub-time periods; In the case where the first sub-time period is the first sub-time period of the preset time period, the sub-allowed flow rate corresponding to the first sub-time period is used as the allowed flow rate within the preset time period; In the case where the first sub-time period is the Nth sub-time period of the preset time period, the sub-allowed flow rate corresponding to the second sub-time period is accumulated to the first sub-time period, and the sub-allowed flow rate corresponding to the first sub-time period is used as the allowed flow rate in the preset time period; Among them, N is a positive integer greater than 1, the second sub-time period is the N-1 sub-time periods before the first sub-time period in the preset time period, the sub-allowed flow rate of the first sub-time period is the unused flow rate in the sub-flow rate of the first sub-time period, and the sub-allowed flow rate of the second sub-time period is the unused flow rate in the sub-flow rate of the second sub-time period.
5. The server according to claim 4, characterized in that: In the case that there are multiple applications, the traffic usage allowed within the preset time period corresponding to the application is determined according to the order of the reception time of the version update request.
6. The server according to claim 4 or 5, characterized in that: Also includes: A third determining module, configured to determine the total traffic usage within the preset time period according to the number of historical downloads of the first electronic device within the preset time period; The more the historical download times are, the greater the total traffic usage is.
Citation Information
Patent Citations
Terminal application program updating method and system based on Web page
CN103023941A
OTA data packet issuing traffic control method and device, and server
CN111970132A
