Installation package updating method, device and system
After the terminal is turned on, it determines the target time to send a detection request to the server based on the initial update time based on the running time, which solves the server pressure problem caused by the simultaneous update of multiple terminals and improves the efficiency of installation package update.
Patent Information
- Application Number
- CN202110720458.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-28
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2041-06-28
AI Technical Summary
In the prior art, multiple terminals simultaneously send installation package detection requests to the server after booting up, resulting in a large amount of data processing by the server and low efficiency in updating the installation package.
After the terminal starts up, it obtains the current time as the initial time, updates the initial time based on its running time, obtains the target time, and sends a detection request to the server at that time.
Through different terminals, update the initial moment according to their running time, avoid multiple terminals from sending detection requests at the same time, reduce server pressure, and improve installation package update efficiency.
Smart Images

Figure CN113467792B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communications, and in particular to a method, device and system for updating an installation package. Background Art
[0002] The terminal may update the installation package of its operating system or the installation package of its installed applications through over the air (OTA) technology.
[0003] In the related art, after the terminal is turned on, it will automatically send a detection request for the installation package to the server, and the detection request carries the version number of the installation package. After receiving the detection request for the installation package, if the server determines that there is an updated version of the installation package based on the version number carried in the detection request, the updated version of the installation package will be sent to the terminal, so that the terminal can update the installation package.
[0004] However, since multiple terminals may send detection requests to the server at the same time after being turned on, the server needs to process a large amount of data, which in turn leads to low efficiency in updating the installation package. Summary of the invention
[0005] The embodiments of the present disclosure provide a method, device and system for updating an installation package, which can solve the problem of low efficiency of updating installation packages in related technologies. The technical solution is as follows:
[0006] On the one hand, a method for updating an installation package is provided, which is applied to a terminal, and the method includes:
[0007] After the terminal is powered on, obtaining the current time as the first initial time;
[0008] The first initial moment is updated based on the operation time of the terminal to obtain a first target moment, wherein the first target moment is positively correlated with the operation time and the first initial moment;
[0009] A detection request for the installation package is sent to the server at the first target time, where the detection request is used to instruct the server to detect whether there is an updated version of the installation package.
[0010] Optionally, the updating the first initial time based on the running time of the terminal to obtain a first target time includes:
[0011] updating the first initial time N times based on the running time of the terminal at N different time points to obtain a first target time point, where N is an integer greater than 1;
[0012] Among them, the size of the updated first initial moment obtained based on the running time of the terminal at the i-th moment is positively correlated with the running time of the i-th moment, i is a positive integer less than or equal to N, and the size of the first target moment is positively correlated with the size of the first initial moment after the N-th update.
[0013] Optionally, the first initial time T after the i-th update i Satisfaction: T i =(k×T i-1 +t i-1 ) s ;
[0014] Wherein, k is a prime number, and t i-1 is the running time of the terminal at the i-1th moment, and s is a positive integer.
[0015] Optionally, the first target moment h1 satisfies:
[0016] Among them, the T N is the first initial moment after the Nth update, and M is an integer greater than 1.
[0017] Optionally, the M is equal to the N.
[0018] Optionally, the method further includes:
[0019] After sending a detection request for the installation package to the server at the first target time, obtaining the current time as a second initial time;
[0020] Determine a second target time based on the second initial time and the interval duration, wherein the second target time is positively correlated with the second initial time and the interval duration;
[0021] At the second target time, the step of sending a detection request for the installation package to the server is performed again.
[0022] Optionally, the second target time h2 satisfies: h2=w+z;
[0023] Among them, the w is the second initial time, and the z is the interval duration.
[0024] On the other hand, a device for updating an installation package is provided, which is applied to a terminal, and the device includes:
[0025] An acquisition module, used for acquiring the current time as the first initial time after the terminal is powered on;
[0026] An updating module, configured to update the first initial moment based on the operation duration of the terminal to obtain a first target moment, wherein the first target moment is positively correlated with the operation duration and the first initial moment;
[0027] The sending module is used to send a detection request for the installation package to the server at the first target time, wherein the detection request is used to instruct the server to detect whether there is an updated version of the installation package.
[0028] On the other hand, a computer-readable storage medium is provided, in which instructions are stored. The instructions are loaded and executed by a processor to implement the method for updating the installation package as described in the above aspects.
[0029] On the other hand, an installation package update device is provided, the installation package update device comprising a processor and a memory, the memory storing instructions, the instructions being loaded and executed by the processor to implement the installation package update method as described in the above aspects.
[0030] On the other hand, a computer program product comprising instructions is provided, and when the computer program product is executed on the computer, the computer is enabled to execute the method for updating the installation package as described in the above aspects.
[0031] In yet another aspect, a system for updating an installation package is provided, the system comprising: a terminal and a server;
[0032] The terminal comprises the device for updating the installation package as described in the above aspect;
[0033] The server is used for detecting whether there is an updated version of the installation package based on the detection request for the installation package sent by the terminal.
[0034] The beneficial effects brought by the technical solution provided by the embodiments of the present disclosure include at least:
[0035] The disclosed embodiments provide a method, device and system for updating an installation package, wherein a terminal can update a first initial moment based on its running time to obtain a first target duration, and the size of the first target duration is positively correlated with the running time and the first initial moment. Due to differences in the performance of different terminals and the environments in which they are located (such as the temperature around the terminal), the running time and the first initial moment determined by different terminals are different, and thus the first target moments obtained by updating the first initial moment based on their running time are also different. This can prevent multiple terminals from sending detection requests for the installation package to the server at the same time, thereby effectively reducing the pressure on the server and improving the efficiency of the installation package update. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0037] Figure 1 is a schematic diagram of an installation package update system provided by an embodiment of the present disclosure;
[0038] Figure 2 is a flow chart of a method for updating an installation package provided by an embodiment of the present disclosure;
[0039] Figure 3 is a flowchart of another method for updating an installation package provided by an embodiment of the present disclosure;
[0040] Figure 4 is a block diagram of an installation package update device provided by an embodiment of the present disclosure;
[0041] Figure 5 is a block diagram of another device for updating an installation package provided by an embodiment of the present disclosure;
[0042] Figure 6 It is a schematic diagram of a terminal provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0043] In order to make the objectives, technical solutions and advantages of the present disclosure more clear, the embodiments of the present disclosure will be further described in detail below with reference to the accompanying drawings.
[0044] Figure 1 is a schematic diagram of an installation package update system provided by an embodiment of the present disclosure, such as Figure 1 As shown, the system may include a plurality of terminals 10 and a server 20 . Figure 1 Take the system including two terminals 10 as an example.
[0045] Wherein, each terminal 10 may be connected to the server 20 via a wired network or a wireless network.
[0046] The terminal 10 may be a device installed with an operating system and applications, such as a desktop computer, a vehicle-mounted terminal, a mobile terminal, a wearable device, or a smart home device. The server 20 may be a server, or a server cluster consisting of several servers, or a cloud computing service center.
[0047] Figure 2 is a flowchart of a method for updating an installation package provided by an embodiment of the present disclosure, which can be applied to Figure 1The terminal 10 shown. Figure 2 As shown, the method may include:
[0048] Step 201: After the terminal is powered on, the current time is obtained as the first initial time.
[0049] In an embodiment of the present disclosure, a first function for obtaining the current time may be pre-stored in the terminal, and the first function may be: System.currentTimeMillis(). The terminal may run the first function after booting up, and obtain the current time as the first initial time through the first function. Optionally, the statistical accuracy of the first initial time may be at the millisecond level.
[0050] Step 202: Update the first initial time based on the running time of the terminal to obtain a first target time.
[0051] After obtaining the first initial time, the terminal may update the first initial time based on the operation time of the terminal to obtain a first target time, wherein the first target time is positively correlated with the operation time and the first initial time.
[0052] Optionally, the terminal may pre-store a second function for determining the operation time of the terminal, and the operation time of the terminal determined by the second function may be the time from the moment when the terminal is powered on to the current moment. It is understandable that the operation time determined by the terminal at different moments through the second function is different. Among them, the second function may be System.nanoTime(), and the statistical accuracy of the operation time may be nanosecond level.
[0053] Step 203: Send a detection request for the installation package to the server at the first target time.
[0054] After obtaining the first target time, the terminal may send a detection request for the installation package to the server at the first target time, wherein the detection request is used to instruct the server to detect whether there is an updated version of the installation package.
[0055] Optionally, the detection request may carry the version number of the installation package and the identifier of the installation package, and the identifier of the installation package may be the name of the installation package. After receiving the detection request, the server may detect whether there is an updated version of the installation package identical to the identifier based on the identifier of the installation package and the version number of the installation package. If there is an updated version of the installation package identical to the identifier, the server may determine that there is an updated version of the installation package, and therefore may send the installation package of the updated version to the terminal so that the terminal updates the installation version. If there is no updated version of the installation package identical to the identifier, the server may determine that there is no updated version of the installation package, and therefore may send a prompt message to the terminal, and the prompt message is used to prompt the terminal that there is no updated version of the installation package.
[0056] In summary, the disclosed embodiment provides a method for updating an installation package, wherein a terminal can update a first initial moment based on its running time to obtain a first target duration, and the size of the first target duration is positively correlated with the running time and the first initial moment. Due to differences in the performance of different terminals and the environments in which they are located (such as the temperature around the terminal), the running time and the first initial moment determined by different terminals are different, and thus the first target moments obtained by updating the first initial moment based on their running time are also different. This can prevent multiple terminals from sending detection requests for the installation package to the server at the same time, thereby effectively reducing the pressure on the server and improving the efficiency of the installation package update.
[0057] Figure 3 is a flowchart of another method for updating an installation package provided by an embodiment of the present disclosure, which can be applied to Figure 1 The update system of the installation package shown. Figure 3 As shown, the method may include:
[0058] Step 301: After being powered on, the terminal obtains the current time as the first initial time.
[0059] In the embodiment of the present disclosure, a first function for obtaining the current time may be pre-stored in the terminal, and the first function may be: System.currentTimeMillis(). After the terminal is turned on, the first function may be run to obtain the current time as the first initial time, and the statistical accuracy of the first initial time may be in milliseconds.
[0060] Step 302: The terminal updates the first initial time N times based on the running time at N different time points to obtain a first target time.
[0061] The terminal may pre-store a second function for determining the operation time of the terminal, and the operation time of the terminal determined by the second function may be the time from the moment when the terminal is powered on to the current moment. It is understandable that the operation time determined by the terminal at different moments through the second function is different. Among them, the second function may be System.nanoTime(), and the statistical accuracy of the operation time may be nanosecond level.
[0062] After obtaining the first initial time, the terminal may update the first initial time based on the operation time of the terminal to obtain a first target time, wherein the first target time is positively correlated with the operation time of the terminal and the first initial time.
[0063] Optionally, the terminal may obtain the operation time of the terminal at N different time periods, and may update the first initial time period N times based on the operation time periods of the terminal at the N different time periods to obtain the first target time period.
[0064] Among them, N can be an integer greater than 1. The size of the updated first initial moment obtained based on the running time of the terminal at the i-th moment is positively correlated with the running time of the i-th moment, the i-th moment is the moment when the terminal runs the second function for the i-th time after power-on and determines the running time, and i is a positive integer less than or equal to N. The size of the first target moment is positively correlated with the size of the first initial moment after the N-th update.
[0065] Optionally, N is less than or equal to a number threshold, which is the maximum number of times the terminal can update the first initial duration based on its running duration within the duration threshold. The number threshold is positively correlated with the duration threshold.
[0066] The duration threshold is the maximum duration from the time when the terminal is powered on and the current time is taken as the first initial time to the first target time, that is, the terminal needs to send a detection request for the installation package to the server within the duration threshold from the time when the first initial time is determined. This ensures that the terminal can send a detection request for the installation package to the server in a timely manner after the terminal is powered on, thereby ensuring the reliability of the installation package update.
[0067] In the embodiment of the present disclosure, the larger the N is, the higher the reliability of the first target time determined by the terminal within the duration threshold is, and therefore the higher the discreteness of the first target time determined by different terminals within the duration threshold is.
[0068] Assuming that the server can process 10,000 requests per second, if different terminals all use the method provided in the embodiment of the present disclosure to determine the first target time for sending detection requests to the server, the server can process the detection requests sent by 20 million terminals in a timely manner within 6 hours without any downtime.
[0069] Among them, the number threshold and the duration threshold are both fixed values pre-stored in the terminal, the number threshold g=y×60×6, g and y are both integers greater than 1, and y is the duration threshold, and the statistical accuracy of y is hours, the 60 represents 60 minutes, and the 6 represents the number of times the terminal can send a detection request to the server per minute.
[0070] For example, if the duration threshold is 6 hours, that is, y is equal to 6, the number threshold g is equal to 2160, and N can be equal to the number threshold 2160.
[0071] In the embodiment of the present disclosure, the first initial time T after the i-th update i Satisfaction: T i =(k×T i-1 +t i-1 ) s . Among them, k is a prime number, and t i-1 is the running time of the terminal at the i-1th moment, and s is a positive integer. For example, k can be 97 and s can be 3.
[0072] It can be understood that T0 is the current time obtained by running the first function for the first time after the terminal is powered on, that is, the first initial time obtained for the first time after the terminal is powered on. This t0 is the running time determined by the first running of the second function by the terminal after power-on, and t0 can also be called the running time of the terminal at the 0th time.
[0073] Assuming N is 2160, k is 97, and s is 3, when i is equal to 1, the first initial time T1 after the first update satisfies: T1 = (97 × T0 + t0) 3 When i is equal to 2, the first initial time T2 after the second update satisfies: T2 = (97 × T1 + t1) 3 t1 is the running time of the terminal at the first moment. And so on, until the terminal determines the first initial moment after the Nth update.
[0074] In the embodiment of the present disclosure, the first target time h1 satisfies:
[0075] Among them, the T N is the first initial time after the Nth update, and M is an integer greater than 1. Optionally, M may be less than or equal to the number threshold. For example, if the duration threshold is 6 hours, M may be 2160.
[0076] Optionally, the M may be equal to N. For example, the M and N may both be equal to 2160.
[0077] Due to the differences in the performance and environment of different terminals (such as the temperature around the terminal), the running time determined by different terminals at each moment is different, and the size of the updated first initial moment obtained based on the running time at that moment is also different, and the first initial moment obtained after the Nth update is also different, and the first target moment finally determined must be different. Different terminals use the method provided by the embodiment of the present disclosure to effectively ensure that the first target moment when the different terminals send detection requests to the server is different, thereby effectively avoiding multiple terminals sending detection requests for the installation package to the server at the same time, effectively reducing the pressure on the server to process detection requests, and improving the efficiency of the installation package update.
[0078] Step 303: The terminal sends a detection request for the installation package to the server at the first target time.
[0079] After obtaining the first target time, the terminal may send a detection request for the installation package to the server at the first target time, wherein the detection request is used to instruct the server to detect whether there is an updated version of the installation package.
[0080] Optionally, the detection request may carry the version number of the installation package and the identifier of the installation package, and the identifier of the installation package may be the name of the installation package. After receiving the detection request, the server may detect whether there is an updated version of the installation package identical to the identifier based on the identifier of the installation package and the version number of the installation package. If there is an updated version of the installation package identical to the identifier, the server may determine that there is an updated version of the installation package, and therefore may send the installation package of the updated version to the terminal so that the terminal updates the installation version. If there is no updated version of the installation package identical to the identifier, the server may determine that there is no updated version of the installation package, and therefore may send a prompt message to the terminal, and the prompt message is used to prompt the terminal that there is no updated version of the installation package.
[0081] Step 303: The terminal obtains the current time as the second initial time.
[0082] After the terminal sends a detection request for the installation package to the server at the first target time, the terminal can obtain the current time as the second initial time. Optionally, the terminal can obtain the current time as the second initial time by running the first function.
[0083] Step 304: The terminal determines a second target time based on the second initial time and the interval duration.
[0084] After obtaining the current moment as the second initial moment, the terminal can determine the second target moment based on the second initial moment and the interval duration. The second target moment is positively correlated with the second initial moment and the interval duration, and the interval duration can be a fixed duration pre-stored in the terminal. For example, the interval duration can be 10000 milliseconds.
[0085] In the embodiment of the present disclosure, the second target moment h2 may satisfy: h2=w+z, wherein w is the second initial moment, and z is the interval duration.
[0086] Step 305: The terminal sends a detection request for the installation package to the server at the second target time.
[0087] After determining the second target time, the terminal may again send a detection request for the installation package to the server at the second target time.
[0088] In the disclosed embodiment, after the terminal sends a detection request for an installation package to the server at the first target time, if the terminal receives an updated version of the installation package sent by the server and updates the installation package, then by sending the detection request for the installation package to the server again at the second target time (the detection request carries the version number of the updated version of the installation package, that is, the detection request is a detection request for the updated installation package), it can be ensured that the updated version of the updated installation package is obtained in time when the updated version of the updated installation package exists in the server, thereby ensuring the timeliness of the update of the updated installation package. If the updated version of the installation package sent by the server is not received, by sending the detection request for the installation package to the server again at the second target time, it can be ensured that the terminal can obtain the updated version of the installation package in time, so as to ensure that the installation package is updated in time.
[0089] In the disclosed embodiment, after the terminal sends the detection request for the installation package to the server at the second target time, the above steps 304 to 306 may be repeatedly performed until a shutdown instruction for the terminal is received. Therefore, before receiving the shutdown instruction, the terminal may periodically send the detection request for the installation package to the server, thereby ensuring the timeliness and reliability of the installation package update.
[0090] In the disclosed embodiment, the terminal may update the first initial moment N times based on the running time at N different moments to obtain the first target moment. The terminal may also update the first initial moment obtained for the first time once based on its running time to obtain the first target moment. Accordingly, the above M may be 1.
[0091] It should be noted that the order of the steps of the method for updating the installation package provided in the embodiment of the present application can be appropriately adjusted, and the steps can also be deleted according to the situation. For example, the above steps 304 to 306 can be deleted according to the situation. Any technician familiar with the technical field can easily think of a method of change within the technical scope disclosed in this application, which should be included in the protection scope of this application, so it will not be repeated.
[0092] In summary, the disclosed embodiment provides a method for updating an installation package, wherein a terminal can update a first initial moment based on its running time to obtain a first target duration, and the size of the first target duration is positively correlated with the running time and the first initial moment. Due to differences in the performance of different terminals and the environments in which they are located (such as the temperature around the terminal), the running time and the first initial moment determined by different terminals are different, and thus the first target moments obtained by updating the first initial moment based on their running time are also different. This can prevent multiple terminals from sending detection requests for the installation package to the server at the same time, effectively reducing the pressure on the server and improving the efficiency of the installation package update.
[0093] Figure 4 is a block diagram of an installation package update device provided by an embodiment of the present disclosure. The device can be applied to Figure 1 The terminal 10 shown. Figure 4 As shown, the device may include:
[0094] The acquisition module 401 is used to acquire the current time as the first initial time after the terminal is powered on.
[0095] The updating module 402 is used to update the first initial time based on the operation time of the terminal to obtain a first target time, wherein the first target time is positively correlated with the operation time and the first initial time.
[0096] The sending module 403 is used to send a detection request for the installation package to the server at a first target time, where the detection request is used to instruct the server to detect whether there is an updated version of the installation package.
[0097] In summary, the disclosed embodiment provides an installation package update device, and the terminal can update the first initial moment based on its running time to obtain a first target duration, and the size of the first target duration is positively correlated with the running time and the first initial moment. Due to the differences in the performance and environment of different terminals (such as the temperature around the terminal), the running time and the first initial moment determined by different terminals are different, and thus the first target moments obtained by updating the first initial moment based on the running time of different terminals are also different. This can avoid multiple terminals sending detection requests for the installation package to the server at the same time, effectively reducing the pressure on the server and improving the efficiency of the installation package update.
[0098] The update module 402 is used to:
[0099] The first initial time is updated N times based on the running time of the terminal at N different time points to obtain a first target time point, where N is an integer greater than 1.
[0100] Among them, the size of the updated first initial moment obtained based on the running time of the terminal at the i-th moment is positively correlated with the running time at the i-th moment, the size of the first target moment is positively correlated with the size of the first initial moment after the N-th update, and i is a positive integer less than or equal to N.
[0101] Optionally, the first initial time T after the i-th update i Satisfaction: T i =(k×T i-1 +t i-1 ) s .
[0102] Where k is a prime number, t i-1 is the running time of the terminal at the i-1th moment, and s is a positive integer.
[0103] Optionally, the first target moment h1 satisfies:
[0104] Among them, T N is the first initial moment after the Nth update, and M is an integer greater than 1.
[0105] Optionally, M is equal to N.
[0106] Optionally, the acquisition module 401 is further configured to acquire the current time as the second initial time after sending a detection request for the installation package to the server at the first target time.
[0107] refer to Figure 5The device may further include: a determination module 404, configured to determine a second target moment based on the second initial moment and the interval duration, wherein the second target moment is positively correlated with the second initial moment and the interval duration.
[0108] The sending module 403 is used to execute the step of sending a detection request for the installation package to the server again at the second target time.
[0109] Optionally, the second target time h2 satisfies: h2=w+z.
[0110] Wherein, w is the second initial time, and z is the interval duration.
[0111] In summary, the disclosed embodiment provides an installation package update device, and the terminal can update the first initial moment based on its running time to obtain a first target duration, and the size of the first target duration is positively correlated with the running time and the first initial moment. Due to the differences in the performance and environment of different terminals (such as the temperature around the terminal), the running time and the first initial moment determined by different terminals are different, and thus the first target moments obtained by updating the first initial moment based on the running time of different terminals are also different. This can avoid multiple terminals sending detection requests for the installation package to the server at the same time, effectively reducing the pressure on the server and improving the efficiency of the installation package update.
[0112] The present disclosure provides a computer-readable storage medium, in which instructions are stored, and the instructions are loaded and executed by a processor to implement the method for updating the installation package as described in the above embodiment. For example, Figure 2 or Figure 3 How to update the installation package shown.
[0113] The present disclosure embodiment provides an installation package update device 50, such as Figure 6 As shown, the installation package update device 50 may include a processor 501 and a memory 502. The memory 502 stores instructions, which are loaded and executed by the processor 501 to implement the installation package update method as described in the above embodiment. For example, Figure 2 or Figure 3 How to update the installation package shown.
[0114] The present disclosure provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the method for updating the installation package of the above embodiment. Figure 2 or Figure 3 How to update the installation package shown.
[0115] The present disclosure provides an installation package update system, such as Figure 1As shown, the system may include a terminal 10 and a server 20. The terminal may include Figure 4 or Figure 5 The terminal 10 may be an update device 40 for the installation package shown. Figure 6 An update device 50 of the installation package is shown.
[0116] The server 20 is used to detect whether there is an updated version of the installation package based on the detection request for the installation package sent by the terminal 10.
[0117] In the embodiments of the present disclosure, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance. In the embodiments of the present disclosure, the term "plurality" means two or more.
[0118] The above description is only an optional embodiment of the present disclosure and is not intended to limit the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for updating an installation package, characterized in that: Applied to a terminal, the method comprises: After the terminal is powered on, obtaining the current time as the first initial time; Based on the terminal N The running time at different times is used to calculate the first initial time. N Update the first target time, N is an integer greater than 1; N is less than or equal to a number threshold, the number threshold being the maximum number of times the terminal updates the first initial time based on the running time within a time threshold; the running time is the time from the moment the terminal is powered on to the current time; wherein, based on the terminal at the first i The size of the first initial moment after the update is obtained by the running time of the first moment, and the i The running time at each moment is positively correlated. i is less than or equal to the N is a positive integer, the magnitude of the first target moment is N The size of the first initial moment after the first update is positively correlated; i The first initial moment after the update T i satisfy: ; wherein said k is a prime number, t i-1 For the terminal in i -1 moment of running time, s is a positive integer, T i-1 For the i -The first initial moment after 1 update; Sending a detection request for the installation package to the server at the first target time determined within the duration threshold, the detection request being used to instruct the server to detect whether there is an updated version of the installation package; The method further comprises: After sending a detection request for the installation package to the server at the first target time, obtaining the current time as a second initial time; Determine a second target time based on the second initial time and the interval duration, wherein the second target time is positively correlated with the second initial time and the interval duration; At the second target time, the step of sending a detection request for the installation package to the server is performed again.
2. The method according to claim 1, characterized in that The first target time h 1Satisfy: ; Among them, the T N For the N At the first initial moment after the update, the M is an integer greater than 1.
3. The method according to claim 2, characterized in that Said M With the N equal.
4. The method according to claim 1, characterized in that The second target time h 2 Satisfaction: ; Among them, the w is the second initial moment, the z is the duration of the interval.
5. An installation package update device, characterized in that: Applied to a terminal, the device comprises: An acquisition module, used for acquiring the current time as the first initial time after the terminal is powered on; An update module is used to update the terminal based on the N The running time at different times is used to calculate the first initial time. N Update the first target time, N is an integer greater than 1; N is less than or equal to a number threshold, the number threshold being the maximum number of times the terminal updates the first initial time based on the running time within a time threshold; the running time is the time from the moment the terminal is powered on to the current time; wherein, based on the terminal at the first i The size of the first initial moment after the update is obtained by the running time of the first moment, and the i The running time at each moment is positively correlated. i is less than or equal to the N is a positive integer, the magnitude of the first target moment is N The first initial moment after the ith update is positively correlated; the first initial moment after the ith update is T i satisfy: ; Wherein, k is a prime number, t i-1 is the running time of the terminal at the i-1th moment, s is a positive integer, T i-1 is the first initial moment after the i-1th update; a sending module, configured to send a detection request for the installation package to the server at the first target time determined within the duration threshold, wherein the detection request is used to instruct the server to detect whether there is an updated version of the installation package; The acquisition module is further configured to acquire the current time as the second initial time after sending a detection request for the installation package to the server at the first target time; A determination module, configured to determine a second target time based on the second initial time and the interval duration, wherein the second target time is positively correlated with the second initial time and the interval duration; A sending module is used to execute again the step of sending a detection request for the installation package to the server at the second target time.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and the instructions are loaded and executed by a processor to implement the installation package update method according to any one of claims 1 to 4.
7. An installation package update system, characterized in that: The system comprises: a terminal and a server; The terminal comprises the updating device of the installation package as claimed in claim 5; The server is used for detecting whether there is an updated version of the installation package based on the detection request for the installation package sent by the terminal.
Citation Information
Patent Citations
Network request discretization processing method
CN110609712A