WO2021223658A1 - Mini program update - Google Patents
Mini program update Download PDFInfo
- Publication number
- WO2021223658A1 WO2021223658A1 PCT/CN2021/091068 CN2021091068W WO2021223658A1 WO 2021223658 A1 WO2021223658 A1 WO 2021223658A1 CN 2021091068 W CN2021091068 W CN 2021091068W WO 2021223658 A1 WO2021223658 A1 WO 2021223658A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- applet
- update
- file package
- judgment result
- time
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
Definitions
- This application relates to the field of computer technology, especially to the update of small programs.
- Mini Program is an application that can be used without downloading and installing.
- the biggest feature of small programs is that they are easy to use and do not need to be manually installed in the operating system.
- small programs rely on large-scale applications as a carrier for use. For users, small programs can save time and cost of use and storage space of mobile terminals; for developers, small programs can save development and promotion costs. Therefore, as an important part of large-scale Internet platform products, small programs will have a broader development prospect in the future.
- Mini programs are independent programs that rely on the main application installed on the user terminal to run, and can be easily acquired and disseminated, providing terminal users with a better user experience. Based on the continuous development of small programs, small programs often need to be updated to present users with different data content or better and better application experience. In view of this, it is necessary to provide a corresponding small program update program.
- the embodiments of the present application provide a method, device, device, and computer readable medium for updating an applet, which are used to meet the update requirements of an applet while saving user traffic and improving user experience.
- An update method of an applet includes: obtaining a start instruction for the applet; in response to the start instruction, displaying the page of the applet; obtaining the first current time; judging the applet Whether the update time interval of the file package of the applet is greater than the first preset update period, the first judgment result is obtained, where the update time interval represents the time between the time stamp corresponding to the file package of the applet and the first current time Interval; if the first judgment result is yes, download the update file package of the applet for updating the applet when the applet is started next time.
- An update device for a small program includes: an instruction acquisition module for acquiring a startup instruction for the applet; a page display module for displaying the page of the applet in response to the startup instruction Time acquisition module, used to acquire the first current time; Judgment module, used to determine whether the update time interval of the file package of the applet is greater than the first preset update period to obtain the first determination result, wherein the update The time interval represents the time interval between the time stamp corresponding to the file package of the small program and the first current time; the download module is configured to download the update file package of the small program if the first judgment result is yes To update the applet when the applet is started next time.
- An electronic device includes: at least one processor; and a memory communicatively connected with the at least one processor.
- the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can: obtain a startup instruction for the applet; and respond; In the start instruction, the page of the applet is displayed; the first current time is obtained; it is judged whether the update time interval of the file package of the applet is greater than the first preset update period, and the first judgment result is obtained.
- the update time interval represents the time interval between the time stamp corresponding to the file package of the applet and the first current time; if the first judgment result is yes, download the update file package of the applet to use The applet is updated when the applet is started next time.
- An embodiment of this specification provides a computer-readable medium having computer-readable instructions stored thereon, and the computer-readable instructions can be executed by a processor to implement the method for updating the applet described in any of the foregoing embodiments.
- the page of the small program is provided to the user first, and then it is judged whether the update interval of the file package of the small program exceeds the preset
- the update cycle in the case of exceeding, downloads the file package of the applet for updating the applet when the applet is started next time.
- the applet page is provided to the user first, and then the asynchronous update is performed, the user does not need to wait for the update process of the applet, and the user experience is good.
- the file package of the updated applet will be queried and downloaded, and if it is not greater than, the query and download will not be performed. That is, not every time you open the applet, you will send a network request to inquire whether you need to update, which can save users' traffic.
- FIG. 1 is a schematic flowchart of a method for updating a small program provided by an embodiment of this specification
- FIG. 2 shows a schematic flowchart of an update method of an asynchronous update-based applet provided by an embodiment of this specification
- FIG. 3 shows a schematic flowchart of an update method of a small program that combines asynchronous update and synchronous update provided by an embodiment of this specification
- FIG. 4 is a schematic structural diagram of an update device corresponding to the applet of FIG. 1 provided by an embodiment of this specification;
- FIG. 5 is a schematic structural diagram of the electronic device corresponding to FIG. 2 provided by an embodiment of the specification.
- One way to update the applet is to query and download a new version of the applet offline package through the network request every time the main application is started. In this way, under normal network conditions, it can be obtained every time the application is started. The latest version of the small program package.
- the startup efficiency of the application will be affected, and the startup performance of the application will be affected. It is a big challenge; and, usually, the application is launched more frequently, but the frequency of update of the applet is not so frequent. If every time the application is started, it is requested to query and download a new version of the applet offline Packets, which will cause a lot of useless network requests and consume user traffic.
- Another way to update the applet is to request to query and download a new version of the applet offline package through the network every time the applet is started. Since the update frequency of the mini program is not as high as the start frequency of the mini program, every time the mini program is started, a network request is sent to check whether there is the latest version, which will consume a lot of invalid traffic, especially if the mini program is used more frequently. In this case, a large number of invalid network requests will be issued, consuming a large amount of user traffic.
- the concept of an update cycle of the applet is introduced ,
- the query will be initiated only when a certain update cycle is reached, thereby saving user traffic to a certain extent; in addition, the embodiment of the present application can perform asynchronous updates in the background while opening the applet, so that the applet’s The update will not increase the user's waiting time and improve the user's experience.
- FIG. 1 is a schematic flowchart of a method for updating a small program provided by an embodiment of this specification.
- the execution subject of the process may be a program carried on an application client, specifically, it may be a main application, that is, it may be a host application of an applet.
- the process can include the following steps:
- Step 102 Obtain a start instruction for the applet.
- applets are micro-applications that run in the main application, have independent operating logic, and consist of a series of executable codes and resources.
- the main application program is an application program deployed in the user terminal, and can also be called the host program of the applet.
- User terminals can include any type of terminal equipment such as smart phones, tablet computers, personal computers, desktops, all-in-ones, smart watches, smart robots, and so on.
- the start instruction for the applet may be an instruction generated based on the user's triggering operation of the control used to display the applet page.
- the control used to display the page of the applet may include an icon of the applet, a sharing link of the applet, etc., and is not limited thereto.
- the applet page may be any page in the applet, including the start page or other pages.
- the user can start the applet by clicking the icon of the applet, or by clicking the link of any page in the shared applet, or by scanning the graphic code (e.g., QR code or barcode). Etc.) to open the applet, the method and application scenario for the user to start the applet are not limited to this.
- Step 104 In response to the start instruction, display the page of the applet.
- the displayed page of the applet is a page corresponding to the opening instruction of the applet.
- the startup instruction for the applet is generated based on the user's operation on the icon of the applet
- the start page of the applet is displayed to the user;
- the opening instruction can display the start page of the applet or the shared page to the user.
- Step 106 Obtain the first current time.
- first, second, etc. are used to describe various periods, results, times, etc., but these periods, results, and times should not be limited by these terms. These terms are used to distinguish one period, result, and time from another period, result, and time.
- the acquiring the first current time may be acquiring the current system time of the user terminal.
- Step 108 Determine whether the update time interval of the file package of the small program is greater than the first preset update period, and obtain a first judgment result, where the update time interval represents the time stamp and the corresponding time stamp of the file package of the small program. The time interval of the first current time.
- the update time interval of the applet file package refers to the time interval between the time stamp corresponding to the applet file package currently stored by the user terminal and the current time of the user terminal.
- the time stamp corresponding to the currently stored small program file package indicates the update time of the currently stored small program, that is, the last update time of the file package corresponding to the small program.
- step 108 it may further include: obtaining a time stamp corresponding to the file package of the applet; calculating the difference between the time stamp and the first current time as the update time of the file package of the applet interval.
- the first current time refers to the system time of the user terminal obtained before the step of calculating the update time interval is performed.
- the update time interval can be used to characterize how long the file package of the currently used applet has not been updated, so that it can be based on whether the update time interval exceeds a preset threshold (ie, the first preset update period) , To decide whether to update the applet.
- the applet regardless of whether the applet is updated, the applet will be opened for the user first, that is, the page of the applet will be displayed to the user.
- the judgment step and the subsequent update step can be performed asynchronously through another thread in the background. Therefore, the first preset update period can also be referred to as The asynchronous update cycle, the scheme for updating the applet in Figure 1, can also be referred to as the asynchronous update scheme.
- the asynchronous update period can be set to 30 minutes. If the asynchronous update period exceeds 30 minutes after the last update, an asynchronous update request will be initiated when the applet is opened at this time (step 110).
- Step 110 If the first judgment result is yes, download the update file package of the applet for updating the applet when the applet is started next time.
- step 108 Based on the judgment operation in step 108, if the first judgment result indicates that the update time interval of the file package of the applet is greater than the first preset update period, that is, the update time interval is greater than the preset threshold, then a new file is downloaded Package, update the existing file package. After the file package of the applet is updated, when the user's instruction to start the applet is received next time, the page of the applet can be displayed to the user based on the updated applet file package.
- step 108 Based on the judgment operation in step 108, if the first judgment result indicates that the update time interval of the file package of the applet is equal to or less than the first preset update period, that is, the update time interval is equal to or less than the preset threshold, then Do not download new file packages, nor update existing file packages.
- the small program service code can be constructed as a compressed package and stored on a content delivery network (Content Delivery Network, CDN), and the small program container of the user terminal can request to download the compressed package through the network and store it locally.
- CDN Content Delivery Network
- the update of the applet refers to the update of a series of executable codes and resource packages of the applet, that is, the update of the file package of the applet, which is also referred to as the update of the applet in the following Package update.
- the update of the applet is triggered when the applet is started instead of when the main application is started, which will not affect the startup performance of the application.
- the file package used by the user when opening the applet this time is the file package updated last time, and the applet file package (if updated) used this time is used.
- the applet is updated when the applet is launched next time, so that every time the user starts the applet, there is no need to wait for the process of querying and updating the applet for the new version of the applet, and the user experience is good.
- the update file package of the applet be inquired (and downloaded), instead of sending a network request every time the applet is opened to check whether there is an update.
- the file package enables users to save traffic on the premise of ensuring that users use the newer version, especially when users open small programs more frequently, the effect of saving traffic for users is more significant.
- downloading the update file package of the applet may specifically include: if the first judgment result is yes, then obtaining the latest version information of the applet ; Determine whether the current version information of the applet is consistent with the latest version information, and obtain a second judgment result; if the second judgment result is no, download the latest version of the file package of the applet.
- the current version information of the applet is consistent with the latest version information. Specifically, it can be judged whether the latest version of the file package of the applet is newer than the current version. If the latest version is newer than the current version, Download the latest version of the file package; otherwise, do not download, and the process ends.
- the download address information of the file package of the small program of the latest version may also be obtained.
- the download address information of the file package of the applet may also be acquired as described above.
- downloading the file package of the latest version of the applet may specifically include: if the second judgment result is no, then according to the download address Information, download the file package of the latest version of the applet. If the fourth judgment result is yes, it means that the applet on the server has not been updated during the period when the user has not opened the applet, and the process ends.
- the download address information of the latest version of the small program package can be obtained, for example, the specific location information of the small program package on the CDN, so as to facilitate subsequent follow-up Download the small program package by obtaining the download address information.
- the timestamp means the latest time to query the new version of the applet. Therefore, the time interval calculated based on the timestamp indicates the time interval from the last query of the latest version.
- the embodiments of the present application since it is determined that the time interval exceeds the update period, the latest version information is obtained, and then the time stamp information is updated. Version information and update timestamp information, thereby saving user traffic. In other words, regardless of whether there is a new version of the mini program in the future, and regardless of whether the subsequent download step is triggered, the embodiments of the present application can achieve the technical effect of saving user traffic.
- step 108 it may further include: obtaining the first preset update period of the applet from the back end.
- the first preset update period may be set by the maintenance personnel of the applet.
- the first preset update period dynamically configured by the applet maintainer can be obtained from the applet server or the applet commercial service platform (for example, the SaaS platform).
- the dynamic configuration data can be issued through the dynamic configuration service to dynamically control the preset update cycle, so as to make adjustments in the strategy.
- the preset update cycle according to the actual frequency of the update of the applet version by the applet developer.
- the preset update period can be set to be larger, thereby reducing the traffic consumption of users frequently sending network query requests for the new version of the applet package.
- the preset update period can be set to be smaller, so that the user can use the newer version of the applet in time and improve the user experience.
- the update period that can be dynamically configured includes the first preset update period above and the second preset update period below.
- FIG. 2 shows a schematic flowchart of an update method of an asynchronous update-based applet provided in an embodiment of this specification.
- Step 200 the user terminal receives the user's instruction for opening the mini program
- Step 202 Open the applet, that is, show the applet page to the user;
- Step 204 Query the time when the mini program was last updated
- Step 206 Obtain the asynchronous update period, and compare the time of the last update of the applet with the current time;
- Step 208 Determine whether the current time interval from the last update of the applet exceeds the asynchronous update period; if so, continue to step 210, if not, the process ends;
- Step 210 Asynchronously query and obtain the latest applet information, for example, applet version information, and applet download address information;
- Step 212 Update the time information of the local applet
- Step 214 Determine whether there is a new version of the applet according to the query result; if yes, proceed to step 216; if not, the process ends;
- Step 216 Download the new version of the applet.
- the small program update solution that introduces an asynchronous update mechanism in the embodiment of the present application
- the small program can be opened as soon as possible to prevent the user from waiting too long.
- the applet is started, if the asynchronous update cycle is reached, while opening the locally existing applet package, the background asynchronous task is started to check whether there is a new version of the applet package, if there is a new version, the new version is downloaded asynchronously Bag.
- the solution of the embodiment of the present application solves the technical problems in the prior art that the applet update affects the application startup performance, and the applet update consumes too much user traffic, causes the user to wait and causes the user experience to be poor, and other technical problems.
- querying the version information of the applet when starting the applet avoids affecting the startup performance of the main application; through the asynchronous update mechanism, the query frequency is reduced, user traffic is saved, and user experience is improved.
- the solution of the foregoing embodiment when the frequency of users opening the applet is high, the technical effect of saving user traffic and the technical effect of improving user experience will be more prominent.
- the embodiment of this application introduces a synchronous update mechanism to change It is combined with the asynchronous update mechanism, so that while saving user traffic and improving user experience, it can also ensure that users always use the newer version of the applet.
- the method may further include: obtaining a third current time; judging whether the update time interval of the file package of the applet is greater than the second preset update period, and obtaining a third judgment As a result, the update time interval represents the time interval between the time stamp corresponding to the file package of the applet and the third current time; if the third judgment result is yes, download the update of the applet File package, and display the page of the applet according to the update file package, and the process ends.
- step 104 may specifically include: if the third judgment result is no, in response to the start instruction, displaying the page of the applet, and the process continues.
- the second preset update period is a synchronous update period, and the second preset update period is greater than the first preset update period, that is, the synchronous update period is greater than an asynchronous update period.
- the synchronous update period may be, for example, 7 days, and the asynchronous update period may be, for example, 1 hour.
- the synchronous update scheme is executed without performing steps 106 to 110; if the third judgment result is no, the steps 106 to 110 are continued to execute the asynchronous update scheme.
- a synchronization update request is initiated to query whether there is a new applet version, if If there is a new version, download the small program package synchronously and open it. In this way, it can be ensured that if a user has not opened a small program for a long time, he can experience the latest version when opening it again, ensuring user experience.
- the mini program When the user opens the mini program, if the time period since the last update of the mini program data does not exceed the synchronization update period, for example, less than 7 days, the mini program will be opened for the user first. At the same time, if the time period since the last update of the mini program data The period of time exceeds the asynchronous update period. For example, if it exceeds 30 minutes, an asynchronous update request will be initiated to check whether there is a new applet version. If there is a new version, the applet package will be downloaded asynchronously for the next time the applet is opened. . In this way, while ensuring that the user can experience the newer version of the applet, it can reduce invalid network access traffic for the user, and reduce the time for the user to wait for the update of the applet, and the overall user experience can be improved.
- the method may further include: obtaining a timestamp corresponding to the file package of the small program; and calculating the The difference between the time stamp and the third current time is used as the update time interval of the file package of the applet.
- the third time refers to the system time of the user terminal obtained before the step of calculating the difference between the time stamp and the third current time is performed.
- the method may further include: obtaining the second preset update period of the applet from the backend, wherein, the second preset update period may be set by the maintenance personnel of the applet.
- the second preset update period dynamically configured by the maintainer of the applet can be obtained from the server of the applet or the applet commercial service platform (for example, the SaaS platform).
- downloading the update file package of the applet may specifically include: if the third judgment result is yes, then obtaining the update file package of the applet Latest version information; judge whether the current version information of the applet is consistent with the latest version information, and obtain a fourth judgment result; if the fourth judgment result is no, download the latest version of the applet File package. If the fourth judgment result is yes, it means that the applet on the server side has not been updated during the period when the user has not opened the applet, and the applet is directly opened.
- the download address information of the file package of the small program of the latest version may also be obtained. That is, when acquiring the latest version information of the applet, the download address information of the file package of the applet of the latest version may also be acquired. The download address information can be fed back to the terminal device together with the latest version information of the applet.
- downloading the file package of the latest version of the applet may specifically include: if the fourth judgment result is no, then according to the download address Information, download the file package of the latest version of the applet.
- the timestamp means the latest time to query the new version of the applet. Therefore, the time interval calculated based on the timestamp indicates the time interval from the last query of the latest version.
- the embodiments of the present application after judging that the time interval exceeds the update period, the latest version information is obtained, and then the time stamp information is updated. Version information and update timestamp information, thereby saving user traffic. In other words, regardless of whether there is a new version of the mini program in the future, and regardless of whether the subsequent download step is triggered, the embodiments of the present application can achieve the technical effect of saving user traffic.
- FIG. 3 shows a schematic flowchart of an update method of a small program that combines asynchronous update and synchronous update provided in an embodiment of this specification.
- Step 300 The user terminal receives the user's instruction for opening the applet
- Step 302 Query the time when the mini program was last updated
- Step 304 Obtain the synchronization update period, and compare the time of the last update of the applet with the current time;
- Step 306 Determine whether the current time interval from the last update of the applet exceeds the synchronization update period (obtaining the third determination result described above); if yes, proceed to step 308; if not, skip to step 316;
- Step 308 Synchronously query and obtain the latest mini program information, for example, mini program version information, and mini program download address information;
- Step 310 Update the time information of the locally stored applet
- Step 312 Determine whether there is a new version of the applet according to the query result, if yes, proceed to step 314; if not, skip to step 316;
- Step 314 Download the new version of the applet
- Step 316 Open the applet, that is, show the applet page to the user;
- Step 318 Obtain the asynchronous update period, and compare the time of the last update of the applet with the current time;
- Step 320 Determine whether the current time interval from the last update of the applet exceeds the asynchronous update period (obtain the first determination result described above); if so, continue to step 322; if not, the process ends;
- Step 322 Asynchronously query and obtain the latest applet information, for example, applet version information, and applet download address information;
- Step 324 Update the time information of the local applet
- Step 326 Determine whether there is a new version of the applet according to the query result; if yes, proceed to step 328; if not, the process ends;
- Step 328 Download the new version of the applet.
- the applet is updated first and then displayed to the user; if the actual update time interval is not greater than the preset synchronization update period, but If it is greater than the preset asynchronous update period, the applet will be displayed to the user first and then asynchronously updated; if the actual update time interval is not greater than the asynchronous update period, only the display to the user will be performed without updating the applet.
- users basically do not need to wait for downloading synchronously, unless the mini program is not opened for a long time, the synchronous waiting will be triggered.
- the concept of an update cycle is introduced, and the query is performed only after a certain update cycle is reached, that is, the query is performed on demand, which reduces a large number of invalid queries and saves traffic for users.
- the synchronous update mechanism ensures that users can use the latest version of the applet even if the applet has not been opened for a long time.
- the asynchronous update mechanism makes the client local When a small program package already exists, the small program can be opened for the user as soon as possible, reducing the user's waiting time and improving the user experience.
- the combined mode of asynchronous update and synchronous update ensures that users basically use the latest version, while avoiding too frequent synchronous network requests that cause users to wait synchronously and consume too much user traffic.
- the solution of the embodiment of the present application can comprehensively improve the user experience.
- the applet developer can dynamically adjust the synchronous update cycle and the asynchronous update cycle according to the actual update frequency of the applet, that is, the update cycle of the applet can always be at a better value, and the above optimization can be maximized.
- the technical effect of the solution is that it can further ensure that users can use the newer version of the applet, while at the same time it can save user traffic to a greater extent and improve user experience.
- it is possible to dynamically control the period of asynchronous and synchronous update of the small program package, and to formulate a reasonable strategy based on the average update period of the small program developer to further improve the update rate of the small program package. Accuracy further reduces the user's data consumption.
- the traffic consumption caused by the user to query the update information of the applet can be reduced by more than 50%.
- the mechanism of asynchronous update and synchronous update can ensure that users experience the latest version of the applet, and reduce the user's waiting for the download of the applet package due to synchronous update by more than 90%.
- FIG. 4 is a schematic structural diagram of an update device corresponding to the small program of FIG. 1 provided by an embodiment of this specification.
- the device may include:
- the instruction acquisition module 402 is used to acquire a start instruction for the applet
- the page display module 404 is configured to display the page of the applet in response to the start instruction
- the time obtaining module 406 is used to obtain the first current time
- the judging module 408 is configured to judge whether the update time interval of the file package of the applet is greater than the first preset update period to obtain the first judgment result, wherein the update time interval represents the file package corresponding to the applet The time interval between the time stamp and the first current time;
- the download module 410 is configured to download the update file package of the applet if the first judgment result is yes, so as to update the applet when the applet is started next time.
- the device may further include: an update time interval calculation module, configured to obtain the file package of the applet before determining whether the update time interval of the file package of the applet is greater than a first preset update period Corresponding time stamp; calculating the difference between the time stamp and the first current time as the update time interval of the file package of the applet.
- an update time interval calculation module configured to obtain the file package of the applet before determining whether the update time interval of the file package of the applet is greater than a first preset update period Corresponding time stamp; calculating the difference between the time stamp and the first current time as the update time interval of the file package of the applet.
- the device may further include: a preset update period obtaining module, configured to obtain the first update period of the applet before determining whether the update time interval of the file package of the applet is greater than the first preset update period.
- a preset update period configured to obtain the first update period of the applet before determining whether the update time interval of the file package of the applet is greater than the first preset update period.
- a preset update period wherein the first preset update period is set by the maintenance personnel of the applet.
- the download module 410 may include: an information obtaining unit, configured to obtain the latest version information of the applet if the first judgment result is yes; and a judging unit, configured to judge the status of the applet If the current version information is consistent with the latest version information, a second judgment result is obtained; the download unit is configured to download the latest version of the small program file package if the second judgment result is no.
- the information obtaining unit may be further configured to: if the first judgment result is yes, obtain download address information of the file package of the latest version of the applet.
- the download unit may be configured to: if the second judgment result is no, download the file package of the latest version of the applet according to the download address information.
- the device may further include a time update module, which can be used to update the time stamp corresponding to the file package of the applet according to the time after the latest version information is obtained after the latest version information of the applet is acquired.
- a time update module which can be used to update the time stamp corresponding to the file package of the applet according to the time after the latest version information is obtained after the latest version information of the applet is acquired.
- the time obtaining module 406 may also be used to obtain a third current time; the determining module 408 may also be used to determine the Whether the update time interval of the file package of the applet is greater than the second preset update period, a third judgment result is obtained, where the update time interval represents the time between the time stamp corresponding to the file package of the applet and the third current time interval.
- the second preset update period is greater than the first preset update period.
- the page display module 404 is specifically configured to, if the third judgment result is yes, download the update file package of the applet, and display the page of the applet according to the update file package, The process ends; if the third judgment result is no, in response to the start instruction, the page of the applet is displayed, and the process continues.
- the update time interval calculation module may also be used to obtain the time stamp corresponding to the file package of the applet before judging whether the update time interval of the file package of the applet is greater than a second preset update period; The difference between the time stamp and the third current time is used as the update time interval of the file package of the applet.
- the preset update period obtaining module may also be used to obtain the second preset update period of the applet before judging whether the update time interval of the file package of the applet is greater than the second preset update period, wherein: The second preset update period is set by the maintenance personnel of the applet.
- the information acquisition unit may be further configured to, if the third determination result is yes, acquire the latest version information of the applet; the determination unit may also be configured to: It is judged whether the current version information of the applet is consistent with the latest version information, and a fourth judgment result is obtained; the download unit may also be configured to download all the latest version of the applet if the fourth judgment result is no.
- the file package of the small program may be further configured to, if the third determination result is yes, acquire the latest version information of the applet; the determination unit may also be configured to: It is judged whether the current version information of the applet is consistent with the latest version information, and a fourth judgment result is obtained; the download unit may also be configured to download all the latest version of the applet if the fourth judgment result is no.
- the information obtaining unit may be further configured to: if the third judgment result is yes, obtain download address information of the file package of the latest version of the applet.
- the download unit may be further configured to: if the fourth judgment result is no, download the file package of the latest version of the applet according to the download address information.
- the time update module may be further configured to, after obtaining the latest version information of the applet, update the time stamp corresponding to the file package of the applet according to the time after the latest version information is obtained.
- modules refer to computer programs or program segments, which are used to perform one or more specific functions.
- the distinction between the above-mentioned modules does not mean that the actual program codes must also be separated.
- the embodiment of this specification also provides a device corresponding to the above method.
- FIG. 5 is a schematic structural diagram of an electronic device corresponding to FIG. 2 provided by an embodiment of this specification. As shown in FIG. 5, the device 500 may include: at least one processor 510; and a memory 530 communicatively connected with the at least one processor.
- the memory 530 stores instructions 520 that can be executed by the at least one processor 510, and the instructions are executed by the at least one processor 510, so that the at least one processor 510 can: In response to the start instruction, display the page of the applet; obtain the first current time; determine whether the update time interval of the applet file package is greater than the first preset update period, and obtain the first judgment As a result, the update time interval represents the time interval between the time stamp corresponding to the file package of the applet and the first current time; if the first judgment result is yes, download the update of the applet The file package is used to update the applet when the applet is started next time.
- the page of the applet may further include: obtaining a third current time; judging whether the update time interval of the file package of the applet is greater than a second preset update period, and obtaining a third judgment As a result, the update time interval represents the time interval between the time stamp corresponding to the file package of the applet and the third current time; if the third judgment result is yes, download the update of the applet File package, and display the page of the applet according to the update file package, and the process ends.
- the displaying the page of the applet in response to the start instruction may specifically include: if the third judgment result is no, in response to the start instruction, displaying the page of the applet, and the process continues.
- the embodiments of this specification also provide a computer-readable medium corresponding to the above method, on which computer-readable instructions are stored, and the computer-readable instructions can be executed by a processor to implement any of the above embodiments.
- the devices, equipment, and methods provided in the embodiments of this specification are corresponding. Therefore, the devices and equipment also have beneficial technical effects similar to the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, they will not be omitted here. To repeat the beneficial technical effects of corresponding devices and equipment.
- the improvement of a technology can be clearly distinguished between hardware improvements (for example, improvements in circuit structures such as diodes, transistors, switches, etc.) or software improvements (improvements in method flow).
- hardware improvements for example, improvements in circuit structures such as diodes, transistors, switches, etc.
- software improvements improvements in method flow.
- the improvement of many methods and processes of today can be regarded as a direct improvement of the hardware circuit structure.
- Designers almost always get the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be realized by the hardware entity module.
- a programmable logic device for example, a Field Programmable Gate Array (Field Programmable Gate Array, FPGA)
- PLD Programmable Logic Device
- FPGA Field Programmable Gate Array
- HDL Hardware Description Language
- ABEL Advanced Boolean Expression Language
- AHDL Altera Hardware Description Language
- HDCal JHDL
- Lava Lava
- Lola MyHDL
- PALASM RHDL
- VHDL Very-High-Speed Integrated Circuit Hardware Description Language
- Verilog Verilog
- the controller can be implemented in any suitable manner.
- the controller can take the form of, for example, a microprocessor or a processor and a computer-readable medium storing computer-readable program codes (such as software or firmware) executable by the (micro)processor. , Logic gates, switches, application specific integrated circuits (ASICs), programmable logic controllers and embedded microcontrollers. Examples of controllers include but are not limited to the following microcontrollers: ARC625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicon Labs C8051F320, the memory controller can also be implemented as part of the memory control logic.
- controllers in addition to implementing the controller in a purely computer-readable program code manner, it is entirely possible to program the method steps to make the controller use logic gates, switches, application specific integrated circuits, programmable logic controllers, and embedded logic.
- the same function can be realized in the form of a microcontroller or the like. Therefore, such a controller can be regarded as a hardware component, and the devices included in it for realizing various functions can also be regarded as a structure within the hardware component. Or even, a device for realizing various functions can be regarded as both a software module for realizing the method and a structure within a hardware component.
- a typical implementation device is a computer.
- the computer may be, for example, a personal computer, a laptop computer, a cell phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or Any combination of these devices.
- the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
- computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
- These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
- the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
- These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
- the instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
- the computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
- processors CPUs
- input/output interfaces network interfaces
- memory volatile and non-volatile memory
- the memory may include non-permanent memory in computer readable media, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer readable media.
- RAM random access memory
- ROM read-only memory
- flash RAM flash memory
- Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology.
- the information can be computer-readable instructions, data structures, program modules, or other data.
- Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cartridges, magnetic tape storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
- This application may be described in the general context of computer-executable instructions executed by a computer, such as a program module.
- program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types.
- This application can also be practiced in distributed computing environments. In these distributed computing environments, tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
Abstract
A method and apparatus for updating a mini program, and a device and a computer-readable medium. The solution comprises: acquiring a starting instruction for a mini program (102); in response to the starting instruction, displaying a page of the mini program (104); acquiring a first current time (106); determining whether an update time interval of a file package of the mini program is greater than a first preset update period (108), so as to obtain a first determination result, wherein the update time interval represents a time interval between a timestamp corresponding to the file package of the mini program and the first current time; and if the first determination result is yes, downloading an update file package of the mini program, so as to update the mini program when the mini program is started the next time (110).
Description
本申请涉及计算机技术领域,尤其涉及小程序的更新。This application relates to the field of computer technology, especially to the update of small programs.
小程序(Mini Program),是一种不需要下载安装即可使用的应用程序。小程序的最大特点是使用便捷,无需手动在操作系统中安装,通常小程序依托于大型应用作为载体进行使用。对于用户来说,小程序能够节约使用时间成本和移动终端的存储空间;对于开发者来说,小程序能够节约开发和推广成本。因此,小程序作为大型互联网平台类产品的重要组成部分,未来将有较为广阔的发展前景。Mini Program is an application that can be used without downloading and installing. The biggest feature of small programs is that they are easy to use and do not need to be manually installed in the operating system. Usually small programs rely on large-scale applications as a carrier for use. For users, small programs can save time and cost of use and storage space of mobile terminals; for developers, small programs can save development and promotion costs. Therefore, as an important part of large-scale Internet platform products, small programs will have a broader development prospect in the future.
小程序是依托于用户终端上安装的主应用程序来运行的独立程序,可以被便捷地获取和传播,为终端用户提供更好的用户体验。在小程序不断发展的基础上,小程序经常需要更新,以呈现给用户不同的数据内容或者越来越好的应用体验。鉴于此,需要提供相应的小程序更新方案。Mini programs are independent programs that rely on the main application installed on the user terminal to run, and can be easily acquired and disseminated, providing terminal users with a better user experience. Based on the continuous development of small programs, small programs often need to be updated to present users with different data content or better and better application experience. In view of this, it is necessary to provide a corresponding small program update program.
发明内容Summary of the invention
有鉴于此,本申请实施例提供了一种小程序的更新方法、装置、设备及计算机可读介质,用于在满足小程序更新需求的同时节省用户流量、提升用户体验。In view of this, the embodiments of the present application provide a method, device, device, and computer readable medium for updating an applet, which are used to meet the update requirements of an applet while saving user traffic and improving user experience.
为解决上述技术问题,本说明书实施例是这样实现的:In order to solve the above technical problems, the embodiments of this specification are implemented as follows:
本说明书实施例提供的一种小程序的更新方法,包括:获取对于小程序的启动指令;响应于所述启动指令,显示所述小程序的页面;获取第一当前时间;判断所述小程序的文件包的更新时间间隔是否大于第一预设更新周期,得到第一判断结果,其中,所述更新时间间隔表示所述小程序的文件包对应的时间戳与所述第一当前时间的时间间隔;若所述第一判断结果为是,则下载所述小程序的更新文件包,以用于下次启动小程序时对所述小程序进行更新。An update method of an applet provided by an embodiment of this specification includes: obtaining a start instruction for the applet; in response to the start instruction, displaying the page of the applet; obtaining the first current time; judging the applet Whether the update time interval of the file package of the applet is greater than the first preset update period, the first judgment result is obtained, where the update time interval represents the time between the time stamp corresponding to the file package of the applet and the first current time Interval; if the first judgment result is yes, download the update file package of the applet for updating the applet when the applet is started next time.
本说明书实施例提供的一种小程序的更新装置,包括:指令获取模块,用于获取对于小程序的启动指令;页面显示模块,用于响应于所述启动指令,显示所述小程序的页面;时间获取模块,用于获取第一当前时间;判断模块,用于判断所述小程序的文件包的更新时间间隔是否大于第一预设更新周期,得到第一判断结果,其中,所述更新时间间隔表示所述小程序的文件包对应的时间戳与所述第一当前时间的时间间隔;下载模块, 用于若所述第一判断结果为是,则下载所述小程序的更新文件包,以用于下次启动小程序时对所述小程序进行更新。An update device for a small program provided by an embodiment of this specification includes: an instruction acquisition module for acquiring a startup instruction for the applet; a page display module for displaying the page of the applet in response to the startup instruction Time acquisition module, used to acquire the first current time; Judgment module, used to determine whether the update time interval of the file package of the applet is greater than the first preset update period to obtain the first determination result, wherein the update The time interval represents the time interval between the time stamp corresponding to the file package of the small program and the first current time; the download module is configured to download the update file package of the small program if the first judgment result is yes To update the applet when the applet is started next time.
本说明书实施例提供的一种电子设备,包括:至少一个处理器;以及,与所述至少一个处理器通信连接的存储器。其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够:获取对于小程序的启动指令;响应于所述启动指令,显示所述小程序的页面;获取第一当前时间;判断所述小程序的文件包的更新时间间隔是否大于第一预设更新周期,得到第一判断结果,其中,所述更新时间间隔表示所述小程序的文件包对应的时间戳与所述第一当前时间的时间间隔;若所述第一判断结果为是,则下载所述小程序的更新文件包,以用于下次启动小程序时对所述小程序进行更新。An electronic device provided by an embodiment of this specification includes: at least one processor; and a memory communicatively connected with the at least one processor. Wherein, the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can: obtain a startup instruction for the applet; and respond; In the start instruction, the page of the applet is displayed; the first current time is obtained; it is judged whether the update time interval of the file package of the applet is greater than the first preset update period, and the first judgment result is obtained. The update time interval represents the time interval between the time stamp corresponding to the file package of the applet and the first current time; if the first judgment result is yes, download the update file package of the applet to use The applet is updated when the applet is started next time.
本说明书实施例提供的一种计算机可读介质,其上存储有计算机可读指令,所述计算机可读指令可被处理器执行以实现前述任一实施例所述的小程序的更新方法。An embodiment of this specification provides a computer-readable medium having computer-readable instructions stored thereon, and the computer-readable instructions can be executed by a processor to implement the method for updating the applet described in any of the foregoing embodiments.
本说明书实施例采用的上述至少一个技术方案能够达到以下有益效果:The above-mentioned at least one technical solution adopted in the embodiment of this specification can achieve the following beneficial effects:
提供了一种小程序的更新方法,具体地,获取用户指示打开小程序页面的指令后,先向用户提供该小程序的页面,然后判断小程序的文件包的更新时间间隔是否超过了预设更新周期,在超过的情况下,下载小程序的文件包,以用于下次启动小程序时对所述小程序进行更新。该方案中,由于先向用户提供小程序页面,再进行异步更新,用户无需等待小程序更新的过程,用户体验好。此外,只有当小程序的实际更新时间间隔大于预设周期的时候,才会查询和下载更新的小程序的文件包,若不大于,则不去查询和下载。即,不是每次打开小程序都发出网络请求查询是否需要更新,可以为用户节省流量。Provides a method for updating a small program. Specifically, after obtaining an instruction from the user to open the page of the small program, the page of the small program is provided to the user first, and then it is judged whether the update interval of the file package of the small program exceeds the preset The update cycle, in the case of exceeding, downloads the file package of the applet for updating the applet when the applet is started next time. In this solution, since the applet page is provided to the user first, and then the asynchronous update is performed, the user does not need to wait for the update process of the applet, and the user experience is good. In addition, only when the actual update time interval of the applet is greater than the preset period, the file package of the updated applet will be queried and downloaded, and if it is not greater than, the query and download will not be performed. That is, not every time you open the applet, you will send a network request to inquire whether you need to update, which can save users' traffic.
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described here are used to provide a further understanding of the application and constitute a part of the application. The exemplary embodiments and descriptions of the application are used to explain the application, and do not constitute an improper limitation of the application. In the attached picture:
图1为本说明书实施例提供的小程序的更新方法的流程示意图;FIG. 1 is a schematic flowchart of a method for updating a small program provided by an embodiment of this specification;
图2示出了本说明书实施例提供的基于异步更新的小程序的更新方法的流程示意图;FIG. 2 shows a schematic flowchart of an update method of an asynchronous update-based applet provided by an embodiment of this specification;
图3示出了本说明书实施例提供的异步更新与同步更新相结合的小程序的更新方法的流程示意图;FIG. 3 shows a schematic flowchart of an update method of a small program that combines asynchronous update and synchronous update provided by an embodiment of this specification;
图4为本说明书实施例提供的对应于图1的小程序的更新装置的结构示意图;FIG. 4 is a schematic structural diagram of an update device corresponding to the applet of FIG. 1 provided by an embodiment of this specification;
图5为本说明书实施例提供的对应于图2的电子设备的结构示意图。FIG. 5 is a schematic structural diagram of the electronic device corresponding to FIG. 2 provided by an embodiment of the specification.
基于各种实际需求,例如为了给用户呈现不同的数据内容或者给用户提供越来越好的使用体验,经常需要对小程序进行更新。Based on various actual needs, for example, in order to present users with different data content or provide users with a better and better experience, it is often necessary to update the mini programs.
一种更新小程序的方法是,在每次启动主应用程序时,通过网络请求查询并下载新版本的小程序离线包,如此,在网络情况正常的条件下,每次应用启动都能获取到最新版本的小程序包。然而,由于应用程序启动时,需要做很多初始化的工作,如果在此时发起应用程序中相关小程序更新的网络请求并触发多个下载任务,影响应用程序的启动效率,对应用程序的启动性能是一个较大的挑战;并且,通常,应用程序启动的频次较多,而小程序更新的频率并不会如此频繁,如果每次启动应用程序都通过网络请求查询并下载新版本的小程序离线包,这会导致大量无用的网络请求,消耗用户的流量。One way to update the applet is to query and download a new version of the applet offline package through the network request every time the main application is started. In this way, under normal network conditions, it can be obtained every time the application is started. The latest version of the small program package. However, due to the need to do a lot of initialization work when the application is started, if a network request for the update of the relevant applet in the application is initiated at this time and multiple download tasks are triggered, the startup efficiency of the application will be affected, and the startup performance of the application will be affected. It is a big challenge; and, usually, the application is launched more frequently, but the frequency of update of the applet is not so frequent. If every time the application is started, it is requested to query and download a new version of the applet offline Packets, which will cause a lot of useless network requests and consume user traffic.
另一种更新小程序的方法是,在每次启动小程序时,通过网络请求查询并下载新版本的小程序离线包。由于小程序的更新频次不会如小程序的启动频次那么高,每次启动小程序时都发送网络请求查询是否有最新版本,会消耗大量无效流量,尤其是该小程序的使用频率较高的情况下,将会有大量无效的网络请求发出,消耗用户大量流量。并且,若查询到有新版本的小程序包就通过网络下载最新版本的小程序包,会让用户等待小程序的下载过程,即小程序每次的更新,都会让用户等待一段时间,用户体验较差。Another way to update the applet is to request to query and download a new version of the applet offline package through the network every time the applet is started. Since the update frequency of the mini program is not as high as the start frequency of the mini program, every time the mini program is started, a network request is sent to check whether there is the latest version, which will consume a lot of invalid traffic, especially if the mini program is used more frequently. In this case, a large number of invalid network requests will be issued, consuming a large amount of user traffic. Moreover, if a new version of the small program package is found, download the latest version of the small program package through the Internet, which will make the user wait for the download process of the small program, that is, every time the small program is updated, the user will wait for a period of time. Poor.
鉴于现有技术中存在的上述问题,由于启动主应用程序时查询所有的小程序包是否有更新会导致主应用程序的启动性能变差,所以在本申请的实施例中在启动小程序本身时进行查询;而如果每次启动小程序时都进行查询,则会消耗大量用户流量,且影响用户使用小程序的体验,为此,在本申请的实施例中,引入了小程序更新周期的概念,只有当达到一定的更新周期之后,才会发起查询,由此在一定程度上节省了用户流量;此外,本申请的实施例可以在打开小程序的同时在后台进行异步更新,使得小程序的更新不会增加用户的等待时间,提升用户的使用体验。In view of the above-mentioned problems in the prior art, since querying whether all the small program packages are updated when the main application is started, the startup performance of the main application will deteriorate. Therefore, in the embodiment of the present application, when starting the small program itself Inquiry; and if the inquiry is carried out every time the applet is started, a large amount of user traffic will be consumed and the user experience of using the applet will be affected. For this reason, in the embodiment of this application, the concept of an update cycle of the applet is introduced , The query will be initiated only when a certain update cycle is reached, thereby saving user traffic to a certain extent; in addition, the embodiment of the present application can perform asynchronous updates in the background while opening the applet, so that the applet’s The update will not increase the user's waiting time and improve the user's experience.
为使本申请的目的、技术方案和优点更加清楚,下面将结合本申请具体实施例及相应的附图对本申请技术方案进行清楚、完整地描述。显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be described clearly and completely in conjunction with specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of this application.
以下结合附图,详细说明本申请各实施例提供的技术方案。The technical solutions provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
图1为本说明书实施例提供的一种小程序的更新方法的流程示意图。从程序角度而言,流程的执行主体可以为搭载于应用客户端的程序,具体地,可以为主应用程序,即, 可以为小程序的宿主应用程序。FIG. 1 is a schematic flowchart of a method for updating a small program provided by an embodiment of this specification. From a program perspective, the execution subject of the process may be a program carried on an application client, specifically, it may be a main application, that is, it may be a host application of an applet.
如图1所示,该流程可以包括以下步骤:As shown in Figure 1, the process can include the following steps:
步骤102:获取对于小程序的启动指令。Step 102: Obtain a start instruction for the applet.
其中,小程序是在主应用程序中运行的微应用,具有独立的运行逻辑,由一系列可执行的代码和资源组成。主应用程序是部署在用户终端中的应用程序,也可称为小程序的宿主程序。用户终端可以包括智能手机、平板电脑、个人电脑、台式机、一体机、智能手表、智能机器人等任何类型的终端设备。Among them, applets are micro-applications that run in the main application, have independent operating logic, and consist of a series of executable codes and resources. The main application program is an application program deployed in the user terminal, and can also be called the host program of the applet. User terminals can include any type of terminal equipment such as smart phones, tablet computers, personal computers, desktops, all-in-ones, smart watches, smart robots, and so on.
对于小程序的启动指令可是,基于用户对用于显示小程序页面的控件的触发操作而生成的指令。所述用于显示小程序页面的控件可包括小程序的图标、小程序的分享链接等,不限于此。所述小程序页面可是小程序中的任意页面,包括起始页面或其他页面。The start instruction for the applet may be an instruction generated based on the user's triggering operation of the control used to display the applet page. The control used to display the page of the applet may include an icon of the applet, a sharing link of the applet, etc., and is not limited thereto. The applet page may be any page in the applet, including the start page or other pages.
作为示例,用户可以通过点击小程序的图标来启动小程序,也可以通过点击被分享的小程序中的任意页面的链接来启动小程序,还可以通过扫描图形码(例如,二维码或条形码等)来打开小程序,用户启动小程序的方法和应用场景不限于此。As an example, the user can start the applet by clicking the icon of the applet, or by clicking the link of any page in the shared applet, or by scanning the graphic code (e.g., QR code or barcode). Etc.) to open the applet, the method and application scenario for the user to start the applet are not limited to this.
步骤104:响应于所述启动指令,显示所述小程序的页面。Step 104: In response to the start instruction, display the page of the applet.
具体地,显示的所述小程序的该页面,是与小程序的所述打开指令相对应的页面。作为示例,若基于用户对小程序的图标的操作生成对于小程序的启动指令,则向用户显示小程序的起始页面;若基于用户对小程序的分享链接的图标的操作生成对于小程序的打开指令,可以向用户显示小程序的起始页面或被分享的页面。Specifically, the displayed page of the applet is a page corresponding to the opening instruction of the applet. As an example, if the startup instruction for the applet is generated based on the user's operation on the icon of the applet, the start page of the applet is displayed to the user; The opening instruction can display the start page of the applet or the shared page to the user.
步骤106:获取第一当前时间。Step 106: Obtain the first current time.
在本申请的说明书中,使用了术语第一、第二等来描述各种周期、结果、时间等,但是这些周期、结果、时间不应受这些术语的限制。这些术语用来将一个周期、结果、时间与另一周期、结果、时间区分开。In the specification of this application, the terms first, second, etc. are used to describe various periods, results, times, etc., but these periods, results, and times should not be limited by these terms. These terms are used to distinguish one period, result, and time from another period, result, and time.
具体地,所述获取第一当前时间可以是获取用户终端当前的系统时间。Specifically, the acquiring the first current time may be acquiring the current system time of the user terminal.
步骤108:判断所述小程序的文件包的更新时间间隔是否大于第一预设更新周期,得到第一判断结果,其中,所述更新时间间隔表示所述小程序的文件包对应的时间戳与所述第一当前时间的时间间隔。Step 108: Determine whether the update time interval of the file package of the small program is greater than the first preset update period, and obtain a first judgment result, where the update time interval represents the time stamp and the corresponding time stamp of the file package of the small program. The time interval of the first current time.
小程序的文件包的更新时间间隔指的是用户终端当前存储的小程序文件包对应的时间戳与用户终端的当前时间的时间间隔。当前存储的小程序文件包对应的时间戳表示该当前存储的小程序的更新时间,也就是所述小程序对应的文件包的最后一次更新的时间。The update time interval of the applet file package refers to the time interval between the time stamp corresponding to the applet file package currently stored by the user terminal and the current time of the user terminal. The time stamp corresponding to the currently stored small program file package indicates the update time of the currently stored small program, that is, the last update time of the file package corresponding to the small program.
步骤108之前,还可以包括:获取所述小程序的文件包对应的时间戳;计算所述时间戳与所述第一当前时间之间的差值,作为所述小程序的文件包的更新时间间隔。其中,所述第一当前时间指的是执行计算更新时间间隔这一步骤之前,获取的用户终端的系统时间。所述更新时间间隔可以用于表征当前使用的小程序的文件包有多长的时间未进行更新,从而,可以根据该更新时间间隔是否超过预设的阈值(即,第一预设更新周期),来决定是否要对小程序进行更新。Before step 108, it may further include: obtaining a time stamp corresponding to the file package of the applet; calculating the difference between the time stamp and the first current time as the update time of the file package of the applet interval. Wherein, the first current time refers to the system time of the user terminal obtained before the step of calculating the update time interval is performed. The update time interval can be used to characterize how long the file package of the currently used applet has not been updated, so that it can be based on whether the update time interval exceeds a preset threshold (ie, the first preset update period) , To decide whether to update the applet.
在该方案中,无论是否进行小程序的更新,均会先为用户打开小程序,即向用户展示小程序的页面。在实际应用中,可以在向用户展示小程序页面的同时,在后台通过另外的线程来异步执行所述判断步骤以及后续的更新步骤,由此,该第一预设更新周期,又可以称为异步更新周期,图1中的对小程序进行更新的方案,又可称为异步更新方案。In this solution, regardless of whether the applet is updated, the applet will be opened for the user first, that is, the page of the applet will be displayed to the user. In practical applications, while displaying the applet page to the user, the judgment step and the subsequent update step can be performed asynchronously through another thread in the background. Therefore, the first preset update period can also be referred to as The asynchronous update cycle, the scheme for updating the applet in Figure 1, can also be referred to as the asynchronous update scheme.
例如,可以设置异步更新周期为30分钟,若距离上次更新超过30分钟之后,超过了异步更新周期,此时打开小程序,便会发起异步更新请求(步骤110)。For example, the asynchronous update period can be set to 30 minutes. If the asynchronous update period exceeds 30 minutes after the last update, an asynchronous update request will be initiated when the applet is opened at this time (step 110).
步骤110:若所述第一判断结果为是,则下载所述小程序的更新文件包,以用于下次启动小程序时对所述小程序进行更新。Step 110: If the first judgment result is yes, download the update file package of the applet for updating the applet when the applet is started next time.
基于步骤108中的判断操作,若所述第一判断结果表示所述小程序的文件包的更新时间间隔大于第一预设更新周期,即,更新时间间隔大于预设阈值,则下载新的文件包,对现存的文件包进行更新。对小程序的文件包进行更新后,当下次接收到用户的启动小程序的指令时,则可以基于更新后的小程序文件包来向用户展示小程序的页面。Based on the judgment operation in step 108, if the first judgment result indicates that the update time interval of the file package of the applet is greater than the first preset update period, that is, the update time interval is greater than the preset threshold, then a new file is downloaded Package, update the existing file package. After the file package of the applet is updated, when the user's instruction to start the applet is received next time, the page of the applet can be displayed to the user based on the updated applet file package.
基于步骤108中的判断操作,若所述第一判断结果表示所述小程序的文件包的更新时间间隔等于或小于第一预设更新周期,即,更新时间间隔等于或小于预设阈值,则不去下载新的文件包,也不对现存的文件包进行更新。Based on the judgment operation in step 108, if the first judgment result indicates that the update time interval of the file package of the applet is equal to or less than the first preset update period, that is, the update time interval is equal to or less than the preset threshold, then Do not download new file packages, nor update existing file packages.
在实际应用中,可将小程序业务代码构建为压缩包存放于内容分发网络(Content Delivery Network,CDN)上,用户终端的小程序容器可通过网络请求下载该压缩包并存储到本地。在本申请的实施例中,小程序的更新指的是对小程序的一系列可执行的代码和资源包的更新,即对小程序的文件包的更新,在下文中,也称为对小程序包的更新。In practical applications, the small program service code can be constructed as a compressed package and stored on a content delivery network (Content Delivery Network, CDN), and the small program container of the user terminal can request to download the compressed package through the network and store it locally. In the embodiments of the present application, the update of the applet refers to the update of a series of executable codes and resource packages of the applet, that is, the update of the file package of the applet, which is also referred to as the update of the applet in the following Package update.
根据图1提供的方法,获取用户指示打开小程序页面的指令后,先向用户提供该小程序页面,然后判断小程序的文件包的更新时间间隔是否超过了预设更新周期,在超过的情况下,下载小程序的文件包,以用于下次启动小程序时对所述小程序进行更新。According to the method provided in Figure 1, after obtaining the user's instruction to open the applet page, first provide the applet page to the user, and then determine whether the update time interval of the applet file package exceeds the preset update period. Next, download the file package of the applet for updating the applet when the applet is started next time.
在图1的方案中,首先,在启动小程序时而非启动主应用程序时触发对小程序的更新,不会影响应用程序的启动性能。并且,由于响应于用户指令便直接向用户提供小程 序页面,用户本次打开小程序时使用的文件包是上次更新的文件包,本次更新的小程序文件包(如果进行更新)则用于下次启动小程序时对所述小程序进行更新,使得,用户每次启动小程序时,无需等待对小程序的新版本进行查询和更新小程序的过程,用户体验好。再者,只有当小程序的实际更新时间间隔大于预设周期的时候,才会查询(和下载)小程序的更新的文件包,而不是每次打开小程序都发出网络请求查询是否有更新的文件包,使得,在确保用户使用到较新版本的前提下,可以为用户节省流量,尤其是,当用户打开小程序的频次较高时,为用户节省流量的效果就更加显著。In the solution in FIG. 1, first, the update of the applet is triggered when the applet is started instead of when the main application is started, which will not affect the startup performance of the application. In addition, since the applet page is directly provided to the user in response to the user's instruction, the file package used by the user when opening the applet this time is the file package updated last time, and the applet file package (if updated) used this time is used The applet is updated when the applet is launched next time, so that every time the user starts the applet, there is no need to wait for the process of querying and updating the applet for the new version of the applet, and the user experience is good. Furthermore, only when the actual update time interval of the applet is greater than the preset period, will the update file package of the applet be inquired (and downloaded), instead of sending a network request every time the applet is opened to check whether there is an update. The file package enables users to save traffic on the premise of ensuring that users use the newer version, especially when users open small programs more frequently, the effect of saving traffic for users is more significant.
应当理解,本说明书一个或多个实施例所述的方法其中部分步骤的顺序可以根据实际需要相互交换,或者其中的部分步骤也可以省略或删除。It should be understood that the order of some of the steps of the method described in one or more embodiments of this specification can be exchanged according to actual needs, or some of the steps can also be omitted or deleted.
本说明书实施例还提供了图1所示方法的一些具体实施方案,下面进行说明。The examples of this specification also provide some specific implementations of the method shown in FIG. 1, which are described below.
在步骤110中,若所述第一判断结果为是,则下载所述小程序的更新文件包,具体可以包括:若所述第一判断结果为是,则获取所述小程序的最新版本信息;判断所述小程序的当前版本信息与所述最新版本信息是否一致,得到第二判断结果;若所述第二判断结果为否,则下载所述最新版本的所述小程序的文件包。In step 110, if the first judgment result is yes, downloading the update file package of the applet may specifically include: if the first judgment result is yes, then obtaining the latest version information of the applet ; Determine whether the current version information of the applet is consistent with the latest version information, and obtain a second judgment result; if the second judgment result is no, download the latest version of the file package of the applet.
在上述实施例中,得到第一判断结果之前,不会发送网络请求来查询是否有新版本的小程序包信息。只有当小程序的文件包的更新时间间隔大于第一预设更新周期的情况下,才会发送网络请求获取小程序包的最新版本信息,而不是每次启动小程序都查询是否有最新版本的小程序包,这减少了用户的流量消耗。In the foregoing embodiment, before the first judgment result is obtained, no network request is sent to query whether there is a new version of the small program package information. Only when the update interval of the file package of the applet is greater than the first preset update period, will a network request be sent to obtain the latest version information of the applet, instead of checking whether there is the latest version of the applet every time the applet is started Small package, which reduces the user's data consumption.
在上述实施例中,判断所述小程序的当前版本信息与所述最新版本信息是否一致,具体可以是判断小程序的文件包的最新版本是否新于当前版本,若最新版本新于当前版本,则下载最新版本的文件包;否则,不下载,流程结束。In the above embodiment, it is judged whether the current version information of the applet is consistent with the latest version information. Specifically, it can be judged whether the latest version of the file package of the applet is newer than the current version. If the latest version is newer than the current version, Download the latest version of the file package; otherwise, do not download, and the process ends.
可选地,若所述第一判断结果为是,还可以获取所述最新版本的所述小程序的文件包的下载地址信息。例如,上述在获取所述小程序的最新版本信息的同时,也可以获取所述小程序的文件包的下载地址信息。相应地,所述若所述第二判断结果为否,则下载所述最新版本的所述小程序的文件包,具体可以包括:若所述第二判断结果为否,则根据所述下载地址信息,下载所述最新版本的所述小程序的文件包。若所述第四判断结果为是,说明在用户未打开小程序的这段时间内,服务端的小程序未被更新,则流程结束。Optionally, if the first judgment result is yes, the download address information of the file package of the small program of the latest version may also be obtained. For example, while acquiring the latest version information of the applet, the download address information of the file package of the applet may also be acquired as described above. Correspondingly, if the second judgment result is no, downloading the file package of the latest version of the applet may specifically include: if the second judgment result is no, then according to the download address Information, download the file package of the latest version of the applet. If the fourth judgment result is yes, it means that the applet on the server has not been updated during the period when the user has not opened the applet, and the process ends.
在该实施例中,当获取小程序包的最新版本信息的同时,可以获取该最新版本小程序包的下载地址信息,例如,该小程序包在CDN上的具体位置信息,以便于后续根据该获取的下载地址信息来下载小程序包。In this embodiment, when the latest version information of the small program package is obtained, the download address information of the latest version of the small program package can be obtained, for example, the specific location information of the small program package on the CDN, so as to facilitate subsequent follow-up Download the small program package by obtaining the download address information.
在上述获取所述小程序的最新版本信息之后,还可以包括:根据获取到最新版本信息后的时间对所述小程序的文件包对应的时间戳进行更新。在实际应用中,当访问服务器并获取到最新版本信息之后,无论该实际获取的最新版本信息是否新于当前的本地版本,即,无论是否后续下载新版本的小程序文件包(如果有新版本,则下载;如果没有新版本,则不下载),都可以对本地的小程序文件包对应的时间戳进行更新。由此,该时间戳意味着最新一次对小程序新版本进行查询的时间,因此,基于时间戳计算得到的时间间隔,表示的是距离上次进行最新版本查询的时间间隔。After acquiring the latest version information of the applet, it may further include: updating the timestamp corresponding to the file package of the applet according to the time after the latest version information is acquired. In actual applications, after accessing the server and obtaining the latest version information, no matter whether the latest version information actually obtained is newer than the current local version, that is, no matter whether the new version of the applet file package is subsequently downloaded (if there is a new version) , Then download; if there is no new version, do not download), you can update the time stamp corresponding to the local applet file package. Therefore, the timestamp means the latest time to query the new version of the applet. Therefore, the time interval calculated based on the timestamp indicates the time interval from the last query of the latest version.
在本申请的实施例中,由于在判断了时间间隔超出更新周期之后,获取最新版本信息,进而更新时间戳信息,也就是说,并不是每次打开小程序都发出网络请求来查询是否有最新版本信息并更新时间戳信息,由此,节省了用户流量。换句话说,无论后续是否有新版本的小程序,无论是否触发后续的下载步骤,本申请的实施例均可以实现节省用户流量的技术效果。In the embodiment of the present application, since it is determined that the time interval exceeds the update period, the latest version information is obtained, and then the time stamp information is updated. Version information and update timestamp information, thereby saving user traffic. In other words, regardless of whether there is a new version of the mini program in the future, and regardless of whether the subsequent download step is triggered, the embodiments of the present application can achieve the technical effect of saving user traffic.
在步骤108之前,还可以包括:从后端获取所述小程序的第一预设更新周期。其中,所述第一预设更新周期是可以是由小程序的维护人员设定的。例如,可以从小程序的服务器或小程序商业化服务平台(例如,SaaS平台)来获取由小程序维护人员动态配置的第一预设更新周期。Before step 108, it may further include: obtaining the first preset update period of the applet from the back end. Wherein, the first preset update period may be set by the maintenance personnel of the applet. For example, the first preset update period dynamically configured by the applet maintainer can be obtained from the applet server or the applet commercial service platform (for example, the SaaS platform).
也就是说,可以通过动态配置服务下发动态配置数据,以动态地控制预设更新周期,从而在策略上做调整。由此使得,可以根据小程序开发者更新小程序版本的实际频次来动态调控预设更新周期。在一些情况下,若小程序版本的实际更新频次需要降低,则可以将预设更新周期设置为更大,从而,可以降低用户频繁发送针对新版本小程序包的网络查询请求的流量消耗。在一些情况下,若小程序版本的实际更新频次需要升高,则可以将预设更新周期设置为更小,从而,可以使用户能够及时地使用到较新版本的小程序,提升用户体验。可以动态配置的更新周期包括上文中的第一预设更新周期以及下文中的第二预设更新周期。That is to say, the dynamic configuration data can be issued through the dynamic configuration service to dynamically control the preset update cycle, so as to make adjustments in the strategy. As a result, it is possible to dynamically control the preset update cycle according to the actual frequency of the update of the applet version by the applet developer. In some cases, if the actual update frequency of the applet version needs to be reduced, the preset update period can be set to be larger, thereby reducing the traffic consumption of users frequently sending network query requests for the new version of the applet package. In some cases, if the actual update frequency of the applet version needs to be increased, the preset update period can be set to be smaller, so that the user can use the newer version of the applet in time and improve the user experience. The update period that can be dynamically configured includes the first preset update period above and the second preset update period below.
基于前述描述的具体实施方案,图2示出了本说明书实施例提供的一种基于异步更新的小程序的更新方法的流程示意图。Based on the specific implementation described above, FIG. 2 shows a schematic flowchart of an update method of an asynchronous update-based applet provided in an embodiment of this specification.
如图2中所示,包括以下步骤。As shown in Figure 2, the following steps are included.
步骤200:用户终端接收用户的用于打开小程序的指令;Step 200: the user terminal receives the user's instruction for opening the mini program;
步骤202:打开小程序,即,向用户展示小程序页面;Step 202: Open the applet, that is, show the applet page to the user;
步骤204:查询上次更新小程序的时间;Step 204: Query the time when the mini program was last updated;
步骤206:获取异步更新周期,并将上次更新小程序的时间与当前时间进行比较;Step 206: Obtain the asynchronous update period, and compare the time of the last update of the applet with the current time;
步骤208:判断当前距离上次更新小程序的时间间隔是否超过所述异步更新周期;若是,继续步骤210,若否,流程结束;Step 208: Determine whether the current time interval from the last update of the applet exceeds the asynchronous update period; if so, continue to step 210, if not, the process ends;
步骤210:异步查询并获取最新的小程序信息,例如,小程序版本信息,小程序下载地址信息;Step 210: Asynchronously query and obtain the latest applet information, for example, applet version information, and applet download address information;
步骤212:更新本地的小程序时间信息;Step 212: Update the time information of the local applet;
步骤214:根据查询结果,判断是否有新版本的小程序;若是,继续步骤216;若否,流程结束;Step 214: Determine whether there is a new version of the applet according to the query result; if yes, proceed to step 216; if not, the process ends;
步骤216:下载新版本的小程序。Step 216: Download the new version of the applet.
本申请实施例的引入异步更新机制的小程序更新方案中,当客户端本地已经存在小程序包时,能够尽快打开小程序,避免用户等待的时间过长。当启动小程序时,如果达到异步更新周期,则在打开本地已经存在的小程序包的同时,开启后台异步任务查询是否有新版本的小程序包,如果存在新版本,则异步下载新的离线包。In the small program update solution that introduces an asynchronous update mechanism in the embodiment of the present application, when a small program package already exists locally on the client, the small program can be opened as soon as possible to prevent the user from waiting too long. When the applet is started, if the asynchronous update cycle is reached, while opening the locally existing applet package, the background asynchronous task is started to check whether there is a new version of the applet package, if there is a new version, the new version is downloaded asynchronously Bag.
本申请的实施例的方案,解决了现有技术中小程序更新影响应用启动性能的技术问题,以及小程序更新对用户流量消耗过多、使用户等待导致用户体验较差等技术问题。具体地,在启动小程序时查询该小程序的版本信息,避免了影响主应用程序的启动性能;通过异步更新机制,降低了查询频率,节省了用户流量,提升了用户体验。上述实施例的方案,在用户打开小程序的频率较高的情况下,对于用户流量节省的技术效果、以及对用户使用体验提升的技术效果,将表现的更加突出。The solution of the embodiment of the present application solves the technical problems in the prior art that the applet update affects the application startup performance, and the applet update consumes too much user traffic, causes the user to wait and causes the user experience to be poor, and other technical problems. Specifically, querying the version information of the applet when starting the applet avoids affecting the startup performance of the main application; through the asynchronous update mechanism, the query frequency is reduced, user traffic is saved, and user experience is improved. The solution of the foregoing embodiment, when the frequency of users opening the applet is high, the technical effect of saving user traffic and the technical effect of improving user experience will be more prominent.
在实际应用中,如果一个小程序的打开频率非常低,那么,用户再次打开小程序的时候,为了避免用户仍然使用过低版本的小程序,本申请的实施例又引入了同步更新机制,将其与异步更新机制相结合,使得,在节省用户流量、提升用户体验的同时,又能保证用户始终使用到较新版本的小程序。下面进行具体说明。In practical applications, if the opening frequency of a small program is very low, then when the user opens the small program again, in order to avoid the user still using the low version of the small program, the embodiment of this application introduces a synchronous update mechanism to change It is combined with the asynchronous update mechanism, so that while saving user traffic and improving user experience, it can also ensure that users always use the newer version of the applet. A specific description will be given below.
在上述实施例的基础上,在所述步骤104之前,还可包括:获取第三当前时间;判断所述小程序的文件包的更新时间间隔是否大于第二预设更新周期,得到第三判断结果,其中,所述更新时间间隔表示所述小程序的文件包对应的时间戳与所述第三当前时间的时间间隔;若所述第三判断结果为是,则下载所述小程序的更新文件包,并根据所述更新文件包显示所述小程序的页面,流程结束。相应地,步骤104具体可包括:若所述第三判断结果为否,则响应于所述启动指令,显示所述小程序的页面,流程继续。On the basis of the foregoing embodiment, before the step 104, the method may further include: obtaining a third current time; judging whether the update time interval of the file package of the applet is greater than the second preset update period, and obtaining a third judgment As a result, the update time interval represents the time interval between the time stamp corresponding to the file package of the applet and the third current time; if the third judgment result is yes, download the update of the applet File package, and display the page of the applet according to the update file package, and the process ends. Correspondingly, step 104 may specifically include: if the third judgment result is no, in response to the start instruction, displaying the page of the applet, and the process continues.
其中,所述第二预设更新周期即同步更新周期,所述第二预设更新周期大于所述第 一预设更新周期,即,同步更新周期大于异步更新周期。作为示例,同步更新周期可以为例如7天,异步更新周期可以为例如1小时。Wherein, the second preset update period is a synchronous update period, and the second preset update period is greater than the first preset update period, that is, the synchronous update period is greater than an asynchronous update period. As an example, the synchronous update period may be, for example, 7 days, and the asynchronous update period may be, for example, 1 hour.
在该方案中,在向用户显示小程序的页面之前,需要判断小程序的文件包的更新时间间隔是否大于同步更新周期,若判断结果表示更新时间间隔超过同步更新周期,则表示当前的小程序包较长时间未进行更新,需要先进行更新再向用户展示。In this solution, before displaying the page of the applet to the user, it is necessary to determine whether the update time interval of the applet file package is greater than the synchronization update period. If the judgment result indicates that the update time interval exceeds the synchronization update period, it means the current applet The package has not been updated for a long time and needs to be updated before being displayed to users.
在实际应用中,若第三判断结果为是,执行同步更新方案,而无需再执行步骤106至110;若第三判断结果为否,继续步骤106至110,执行异步更新方案。In practical applications, if the third judgment result is yes, the synchronous update scheme is executed without performing steps 106 to 110; if the third judgment result is no, the steps 106 to 110 are continued to execute the asynchronous update scheme.
根据该实施例的方案,当用户打开小程序时,如果距离上次更新小程序数据的时间周期超过同步更新周期,例如超过7天,则发起同步更新请求查询是否有新的小程序版本,如果有新的版本,则同步下载小程序包并打开。如此,能够保证如果用户长时间未打开某个小程序,再次打开时也能体验到最新的版本,保障用户体验。According to the solution of this embodiment, when the user opens the applet, if the time period since the last update of the applet data exceeds the synchronization update period, for example, more than 7 days, a synchronization update request is initiated to query whether there is a new applet version, if If there is a new version, download the small program package synchronously and open it. In this way, it can be ensured that if a user has not opened a small program for a long time, he can experience the latest version when opening it again, ensuring user experience.
当用户打开小程序时,如果距离上次更新小程序数据的时间周期未超过同步更新周期,例如未超过7天,则先为用户打开小程序,与此同时,如果距离上次更新小程序数据的时间周期超过异步更新周期,例如,超过30分钟,则发起异步更新请求查询是否有新的小程序版本,如果有新的版本,则异步下载小程序包,以供下次打开小程序时使用。如此,在确保用户能够体验到较新版本的小程序的同时,能够为用户减少无效的网络访问流量,且减少用户等待小程序更新的时间,整体可以提升用户的使用体验。When the user opens the mini program, if the time period since the last update of the mini program data does not exceed the synchronization update period, for example, less than 7 days, the mini program will be opened for the user first. At the same time, if the time period since the last update of the mini program data The period of time exceeds the asynchronous update period. For example, if it exceeds 30 minutes, an asynchronous update request will be initiated to check whether there is a new applet version. If there is a new version, the applet package will be downloaded asynchronously for the next time the applet is opened. . In this way, while ensuring that the user can experience the newer version of the applet, it can reduce invalid network access traffic for the user, and reduce the time for the user to wait for the update of the applet, and the overall user experience can be improved.
在上述实施例中,所述判断所述小程序的文件包的更新时间间隔是否大于第二预设更新周期之前,还可以包括:获取所述小程序的文件包对应的时间戳;计算所述时间戳与所述第三当前时间之间的差值,作为所述小程序的文件包的更新时间间隔。其中,所述第三时间指的是执行计算所述时间戳与所述第三当前时间之间的差值这一步骤前,获取的用户终端的系统时间。In the foregoing embodiment, before determining whether the update time interval of the file package of the small program is greater than the second preset update period, the method may further include: obtaining a timestamp corresponding to the file package of the small program; and calculating the The difference between the time stamp and the third current time is used as the update time interval of the file package of the applet. Wherein, the third time refers to the system time of the user terminal obtained before the step of calculating the difference between the time stamp and the third current time is performed.
在上述实施例中,所述判断所述小程序的文件包的更新时间间隔是否大于第二预设更新周期之前,还可以包括:从后端获取所述小程序的第二预设更新周期,其中,所述第二预设更新周期可以是由小程序的维护人员设定的。例如,可以从小程序的服务器或小程序商业化服务平台(例如,SaaS平台)来获取由小程序的维护人员动态配置的所述第二预设更新周期。In the above embodiment, before determining whether the update time interval of the file package of the applet is greater than the second preset update period, the method may further include: obtaining the second preset update period of the applet from the backend, Wherein, the second preset update period may be set by the maintenance personnel of the applet. For example, the second preset update period dynamically configured by the maintainer of the applet can be obtained from the server of the applet or the applet commercial service platform (for example, the SaaS platform).
在上述实施例中,所述若所述第三判断结果为是,则下载所述小程序的更新文件包,具体可包括:若所述第三判断结果为是,则获取所述小程序的最新版本信息;判断所述小程序的当前版本信息与所述最新版本信息是否一致,得到第四判断结果;若所述第四判断结果为否,则下载所述最新版本的所述小程序的文件包。若所述第四判断结果为是, 说明在用户未打开小程序的这段时间内,服务端的小程序未被更新,则直接打开小程序。In the above-mentioned embodiment, if the third judgment result is yes, downloading the update file package of the applet may specifically include: if the third judgment result is yes, then obtaining the update file package of the applet Latest version information; judge whether the current version information of the applet is consistent with the latest version information, and obtain a fourth judgment result; if the fourth judgment result is no, download the latest version of the applet File package. If the fourth judgment result is yes, it means that the applet on the server side has not been updated during the period when the user has not opened the applet, and the applet is directly opened.
可选地,所述若所述第三判断结果为是,还可以获取所述最新版本的所述小程序的文件包的下载地址信息。即,在获取所述小程序的最新版本信息时,也可以获取所述最新版本的所述小程序的文件包的下载地址信息。所述下载地址信息可以与所述小程序的最新版本信息一同被反馈至终端设备。相应地,所述若所述第四判断结果为否,则下载所述最新版本的所述小程序的文件包,具体可以包括:若所述第四判断结果为否,则根据所述下载地址信息,下载所述最新版本的所述小程序的文件包。Optionally, if the third judgment result is yes, the download address information of the file package of the small program of the latest version may also be obtained. That is, when acquiring the latest version information of the applet, the download address information of the file package of the applet of the latest version may also be acquired. The download address information can be fed back to the terminal device together with the latest version information of the applet. Correspondingly, if the fourth judgment result is no, downloading the file package of the latest version of the applet may specifically include: if the fourth judgment result is no, then according to the download address Information, download the file package of the latest version of the applet.
在上述获取所述小程序的最新版本信息之后,还可以包括:根据获取到最新版本信息后的时间对所述小程序的文件包对应的时间戳进行更新。在实际应用中,当访问服务器并获取到最新版本信息之后,无论该实际获取的最新版本信息是否新于当前的本地版本,即,无论是否后续下载新版本的小程序文件包(如果有新版本,则下载;如果没有新版本,则不下载),都可以对本地的小程序文件包对应的时间戳进行更新。由此,该时间戳意味着最新一次对小程序新版本进行查询的时间,因此,基于时间戳计算得到的时间间隔,表示的是距离上次进行最新版本查询的时间间隔。After acquiring the latest version information of the applet, it may further include: updating the timestamp corresponding to the file package of the applet according to the time after the latest version information is acquired. In actual applications, after accessing the server and obtaining the latest version information, no matter whether the latest version information actually obtained is newer than the current local version, that is, no matter whether the new version of the applet file package is subsequently downloaded (if there is a new version) , Then download; if there is no new version, do not download), you can update the time stamp corresponding to the local applet file package. Therefore, the timestamp means the latest time to query the new version of the applet. Therefore, the time interval calculated based on the timestamp indicates the time interval from the last query of the latest version.
在本申请的实施例中,由于在判断了时间间隔超出更新周期之后,获取最新版本信息,进而更新时间戳信息,也就是说,并不是每次打开小程序都发出网络请求来查询是否有最新版本信息并更新时间戳信息,由此,节省了用户流量。换句话说,无论后续是否有新版本的小程序,无论是否触发后续的下载步骤,本申请的实施例均可以实现节省用户流量的技术效果。In the embodiment of the present application, after judging that the time interval exceeds the update period, the latest version information is obtained, and then the time stamp information is updated. Version information and update timestamp information, thereby saving user traffic. In other words, regardless of whether there is a new version of the mini program in the future, and regardless of whether the subsequent download step is triggered, the embodiments of the present application can achieve the technical effect of saving user traffic.
基于前述描述的具体实施方案,图3示出了本说明书实施例提供的一种异步更新与同步更新相结合的小程序的更新方法的流程示意图。Based on the specific implementation described above, FIG. 3 shows a schematic flowchart of an update method of a small program that combines asynchronous update and synchronous update provided in an embodiment of this specification.
如图3所示,可以包括以下步骤。As shown in Figure 3, the following steps can be included.
步骤300:用户终端接收用户的用于打开小程序的指令;Step 300: The user terminal receives the user's instruction for opening the applet;
步骤302:查询上次更新小程序的时间;Step 302: Query the time when the mini program was last updated;
步骤304:获取同步更新周期,并将上次更新小程序的时间与当前时间比较;Step 304: Obtain the synchronization update period, and compare the time of the last update of the applet with the current time;
步骤306:判断当前距离上次更新小程序的时间间隔是否超过所述同步更新周期(得到上文所述的第三判断结果);若是,继续步骤308;若否,跳至步骤316;Step 306: Determine whether the current time interval from the last update of the applet exceeds the synchronization update period (obtaining the third determination result described above); if yes, proceed to step 308; if not, skip to step 316;
步骤308:同步查询并获取最新的小程序信息,例如,小程序版本信息,小程序下载地址信息;Step 308: Synchronously query and obtain the latest mini program information, for example, mini program version information, and mini program download address information;
步骤310:更新本地存储的小程序时间信息;Step 310: Update the time information of the locally stored applet;
步骤312:根据查询结果,判断是否有新版本的小程序,若是,继续步骤314;若否,跳至步骤316;Step 312: Determine whether there is a new version of the applet according to the query result, if yes, proceed to step 314; if not, skip to step 316;
步骤314:下载新版本的小程序;Step 314: Download the new version of the applet;
步骤316:打开小程序,即,向用户展示小程序页面;Step 316: Open the applet, that is, show the applet page to the user;
步骤318:获取异步更新周期,并将上次更新小程序的时间与当前时间比较;Step 318: Obtain the asynchronous update period, and compare the time of the last update of the applet with the current time;
步骤320:判断当前距离上次更新小程序的时间间隔是否超过所述异步更新周期(得到上文所述的第一判断结果);若是,继续步骤322;若否,流程结束;Step 320: Determine whether the current time interval from the last update of the applet exceeds the asynchronous update period (obtain the first determination result described above); if so, continue to step 322; if not, the process ends;
步骤322:异步查询并获取最新的小程序信息,例如,小程序版本信息,小程序下载地址信息;Step 322: Asynchronously query and obtain the latest applet information, for example, applet version information, and applet download address information;
步骤324:更新本地的小程序时间信息;Step 324: Update the time information of the local applet;
步骤326:根据查询结果,判断是否有新版本的小程序;若是,继续步骤328;若否,流程结束;Step 326: Determine whether there is a new version of the applet according to the query result; if yes, proceed to step 328; if not, the process ends;
步骤328:下载新版本的小程序。Step 328: Download the new version of the applet.
根据上述实施例,在实际应用中,若实际的更新时间间隔大于预设的同步更新周期,则先更新小程序再向用户展示;若实际的更新时间间隔不大于预设的同步更新周期,但是大于预设的异步更新周期,则先向用户展示再异步更新小程序;若实际的更新时间间隔不大于异步更新周期,则只执行向用户展示而不进行小程序更新。在实际使用中,用户基本不需要同步等待下载,除非遇到长时间不打开小程序才会触发同步等待。According to the above embodiment, in practical applications, if the actual update time interval is greater than the preset synchronization update period, the applet is updated first and then displayed to the user; if the actual update time interval is not greater than the preset synchronization update period, but If it is greater than the preset asynchronous update period, the applet will be displayed to the user first and then asynchronously updated; if the actual update time interval is not greater than the asynchronous update period, only the display to the user will be performed without updating the applet. In actual use, users basically do not need to wait for downloading synchronously, unless the mini program is not opened for a long time, the synchronous waiting will be triggered.
在本申请提供的技术方案中,引入了更新周期的概念,只有达到一定的更新周期之后,才进行查询,即,按需进行查询,减少了大量无效的查询,为用户节省了流量。具体地,提供了将异步更新与同步更新相结合的技术方案,通过同步更新机制确保了用户即便长时间未打开小程序也能够使用到最新版本的小程序,通过异步更新机制使得当客户端本地已经存在小程序包的时候,可以为用户尽快打开小程序,减少用户的等待时间,提升用户体验。异步更新及同步更新结合的模式,保障用户基本使用到最新的版本,同时又避免太频繁的同步网络请求导致用户需要同步等待以及消耗过多用户流量的情况。在实际应用中,无论用户打开小程序的频率高还是低,本申请的实施例的方案均能够综合地提升用户的使用体验。In the technical solution provided by this application, the concept of an update cycle is introduced, and the query is performed only after a certain update cycle is reached, that is, the query is performed on demand, which reduces a large number of invalid queries and saves traffic for users. Specifically, it provides a technical solution that combines asynchronous and synchronous updates. The synchronous update mechanism ensures that users can use the latest version of the applet even if the applet has not been opened for a long time. The asynchronous update mechanism makes the client local When a small program package already exists, the small program can be opened for the user as soon as possible, reducing the user's waiting time and improving the user experience. The combined mode of asynchronous update and synchronous update ensures that users basically use the latest version, while avoiding too frequent synchronous network requests that cause users to wait synchronously and consume too much user traffic. In actual applications, regardless of whether the frequency of the user opening the mini program is high or low, the solution of the embodiment of the present application can comprehensively improve the user experience.
此外,由于小程序开发人员可以根据实际上小程序的更新频次来动态地调整同步更新周期和异步更新周期,即,可以使得小程序的更新周期始终处于较优的值,能够最大化地优化上述方案的技术效果,即,能够进一步地确保用户能够用到较新版本的小程序, 同时又能更大程度地节省用户流量,提升用户体验。具体地,通过动态配置下发的方式,可以动态控制小程序包的异步更新和同步更新的周期时长,可以根据小程序开发者的平均更新周期来制定合理的策略,进一步提升小程序包更新的精准性,进一步降低用户的流量消耗。In addition, because the applet developer can dynamically adjust the synchronous update cycle and the asynchronous update cycle according to the actual update frequency of the applet, that is, the update cycle of the applet can always be at a better value, and the above optimization can be maximized. The technical effect of the solution is that it can further ensure that users can use the newer version of the applet, while at the same time it can save user traffic to a greater extent and improve user experience. Specifically, through the way of dynamic configuration and delivery, it is possible to dynamically control the period of asynchronous and synchronous update of the small program package, and to formulate a reasonable strategy based on the average update period of the small program developer to further improve the update rate of the small program package. Accuracy further reduces the user's data consumption.
采用本申请中的实施例的方案,预期可以降低用户因查询小程序更新信息导致的流量消耗50%以上。采用异步更新和同步更新的机制,可以保证用户在体验到最新版本小程序的前提下,减少用户因同步更新而等待小程序包下载场景90%以上。By adopting the solution of the embodiment of the present application, it is expected that the traffic consumption caused by the user to query the update information of the applet can be reduced by more than 50%. The mechanism of asynchronous update and synchronous update can ensure that users experience the latest version of the applet, and reduce the user's waiting for the download of the applet package due to synchronous update by more than 90%.
基于同样的思路,本说明书实施例还提供了上述方法对应的装置。图4为本说明书实施例提供的对应于图1的一种小程序的更新装置的结构示意图。Based on the same idea, the embodiment of this specification also provides a device corresponding to the above method. FIG. 4 is a schematic structural diagram of an update device corresponding to the small program of FIG. 1 provided by an embodiment of this specification.
如图4所示,该装置可以包括:As shown in Figure 4, the device may include:
指令获取模块402,用于获取对于小程序的启动指令;The instruction acquisition module 402 is used to acquire a start instruction for the applet;
页面显示模块404,用于响应于所述启动指令,显示所述小程序的页面;The page display module 404 is configured to display the page of the applet in response to the start instruction;
时间获取模块406,用于获取第一当前时间;The time obtaining module 406 is used to obtain the first current time;
判断模块408,用于判断所述小程序的文件包的更新时间间隔是否大于第一预设更新周期,得到第一判断结果,其中,所述更新时间间隔表示所述小程序的文件包对应的时间戳与所述第一当前时间的时间间隔;The judging module 408 is configured to judge whether the update time interval of the file package of the applet is greater than the first preset update period to obtain the first judgment result, wherein the update time interval represents the file package corresponding to the applet The time interval between the time stamp and the first current time;
下载模块410,用于若所述第一判断结果为是,则下载所述小程序的更新文件包,以用于下次启动小程序时对所述小程序进行更新。The download module 410 is configured to download the update file package of the applet if the first judgment result is yes, so as to update the applet when the applet is started next time.
根据实施例,所述装置还可以包括:更新时间间隔计算模块,用于在判断所述小程序的文件包的更新时间间隔是否大于第一预设更新周期之前,获取所述小程序的文件包对应的时间戳;计算所述时间戳与所述第一当前时间之间的差值,作为所述小程序的文件包的更新时间间隔。According to an embodiment, the device may further include: an update time interval calculation module, configured to obtain the file package of the applet before determining whether the update time interval of the file package of the applet is greater than a first preset update period Corresponding time stamp; calculating the difference between the time stamp and the first current time as the update time interval of the file package of the applet.
根据实施例,所述装置还可以包括:预设更新周期获取模块,用于在判断所述小程序的文件包的更新时间间隔是否大于第一预设更新周期之前,获取所述小程序的第一预设更新周期,其中,所述第一预设更新周期是由小程序的维护人员设定的。According to an embodiment, the device may further include: a preset update period obtaining module, configured to obtain the first update period of the applet before determining whether the update time interval of the file package of the applet is greater than the first preset update period. A preset update period, wherein the first preset update period is set by the maintenance personnel of the applet.
根据实施例,所述下载模块410可包括:信息获取单元,用于若所述第一判断结果为是,则获取所述小程序的最新版本信息;判断单元,用于判断所述小程序的当前版本信息与所述最新版本信息是否一致,得到第二判断结果;下载单元,用于若所述第二判断结果为否,则下载所述最新版本的所述小程序的文件包。According to an embodiment, the download module 410 may include: an information obtaining unit, configured to obtain the latest version information of the applet if the first judgment result is yes; and a judging unit, configured to judge the status of the applet If the current version information is consistent with the latest version information, a second judgment result is obtained; the download unit is configured to download the latest version of the small program file package if the second judgment result is no.
其中,所述信息获取单元还可用于:若所述第一判断结果为是,则获取所述最新版本的所述小程序的文件包的下载地址信息。相应地,所述下载单元可用于:若所述第二判断结果为否,则根据所述下载地址信息,下载所述最新版本的所述小程序的文件包。Wherein, the information obtaining unit may be further configured to: if the first judgment result is yes, obtain download address information of the file package of the latest version of the applet. Correspondingly, the download unit may be configured to: if the second judgment result is no, download the file package of the latest version of the applet according to the download address information.
所述装置还可包括时间更新模块,可以用于当获取所述小程序的最新版本信息之后,根据获取到最新版本信息后的时间对所述小程序的文件包对应的时间戳进行更新。The device may further include a time update module, which can be used to update the time stamp corresponding to the file package of the applet according to the time after the latest version information is obtained after the latest version information of the applet is acquired.
在可选的实施例中,所述时间获取模块406,还可以用于,获取第三当前时间;所述判断模块408,还可以用于,在显示所述小程序的页面之前,判断所述小程序的文件包的更新时间间隔是否大于第二预设更新周期,得到第三判断结果,其中,所述更新时间间隔表示所述小程序的文件包对应的时间戳与第三当前时间的时间间隔。其中,所述第二预设更新周期大于所述第一预设更新周期。相应地,所述页面显示模块404,具体用于,若所述第三判断结果为是,则下载所述小程序的更新文件包,并根据所述更新文件包显示所述小程序的页面,流程结束;若所述第三判断结果为否,则响应于所述启动指令,显示所述小程序的页面,流程继续。In an alternative embodiment, the time obtaining module 406 may also be used to obtain a third current time; the determining module 408 may also be used to determine the Whether the update time interval of the file package of the applet is greater than the second preset update period, a third judgment result is obtained, where the update time interval represents the time between the time stamp corresponding to the file package of the applet and the third current time interval. Wherein, the second preset update period is greater than the first preset update period. Correspondingly, the page display module 404 is specifically configured to, if the third judgment result is yes, download the update file package of the applet, and display the page of the applet according to the update file package, The process ends; if the third judgment result is no, in response to the start instruction, the page of the applet is displayed, and the process continues.
所述更新时间间隔计算模块还可用于,在判断所述小程序的文件包的更新时间间隔是否大于第二预设更新周期之前,获取所述小程序的文件包对应的时间戳;计算所述时间戳与所述第三当前时间之间的差值,作为所述小程序的文件包的更新时间间隔。The update time interval calculation module may also be used to obtain the time stamp corresponding to the file package of the applet before judging whether the update time interval of the file package of the applet is greater than a second preset update period; The difference between the time stamp and the third current time is used as the update time interval of the file package of the applet.
所述预设更新周期获取模块还可用于,在判断所述小程序的文件包的更新时间间隔是否大于第二预设更新周期之前,获取所述小程序的第二预设更新周期,其中,所述第二预设更新周期是由小程序的维护人员设定的。The preset update period obtaining module may also be used to obtain the second preset update period of the applet before judging whether the update time interval of the file package of the applet is greater than the second preset update period, wherein: The second preset update period is set by the maintenance personnel of the applet.
根据实施例,所述下载模块410中:所述信息获取单元还可以用于,若所述第三判断结果为是,获取所述小程序的最新版本信息;所述判断单元还可以用于,判断所述小程序的当前版本信息与所述最新版本信息是否一致,得到第四判断结果;所述下载单元还可以用于,若所述第四判断结果为否,下载所述最新版本的所述小程序的文件包。According to an embodiment, in the download module 410: the information acquisition unit may be further configured to, if the third determination result is yes, acquire the latest version information of the applet; the determination unit may also be configured to: It is judged whether the current version information of the applet is consistent with the latest version information, and a fourth judgment result is obtained; the download unit may also be configured to download all the latest version of the applet if the fourth judgment result is no. The file package of the small program.
其中,所述信息获取单元还可用于:若所述第三判断结果为是,则获取所述最新版本的所述小程序的文件包的下载地址信息。相应地,所述下载单元还可用于:若所述第四判断结果为否,则根据所述下载地址信息,下载所述最新版本的所述小程序的文件包。Wherein, the information obtaining unit may be further configured to: if the third judgment result is yes, obtain download address information of the file package of the latest version of the applet. Correspondingly, the download unit may be further configured to: if the fourth judgment result is no, download the file package of the latest version of the applet according to the download address information.
根据实施例,所述时间更新模块还可以用于,当获取所述小程序的最新版本信息之后,根据获取到最新版本信息后的时间对所述小程序的文件包对应的时间戳进行更新。According to an embodiment, the time update module may be further configured to, after obtaining the latest version information of the applet, update the time stamp corresponding to the file package of the applet according to the time after the latest version information is obtained.
可以理解,上述的各模块是指计算机程序或者程序段,用于执行某一项或多项特定的功能。此外,上述各模块的区分并不代表实际的程序代码也必须是分开的。It can be understood that the aforementioned modules refer to computer programs or program segments, which are used to perform one or more specific functions. In addition, the distinction between the above-mentioned modules does not mean that the actual program codes must also be separated.
基于同样的思路,本说明书实施例还提供了上述方法对应的设备。Based on the same idea, the embodiment of this specification also provides a device corresponding to the above method.
图5为本说明书实施例提供的对应于图2的一种电子设备的结构示意图。如图5所示,设备500可以包括:至少一个处理器510;以及,与所述至少一个处理器通信连接的存储器530。其中,所述存储器530存储有可被所述至少一个处理器510执行的指令520,所述指令被所述至少一个处理器510执行,以使所述至少一个处理器510能够:获取对于小程序的启动指令;响应于所述启动指令,显示所述小程序的页面;获取第一当前时间;判断所述小程序的文件包的更新时间间隔是否大于第一预设更新周期,得到第一判断结果,其中,所述更新时间间隔表示所述小程序的文件包对应的时间戳与所述第一当前时间的时间间隔;若所述第一判断结果为是,则下载所述小程序的更新文件包,以用于下次启动小程序时对所述小程序进行更新。FIG. 5 is a schematic structural diagram of an electronic device corresponding to FIG. 2 provided by an embodiment of this specification. As shown in FIG. 5, the device 500 may include: at least one processor 510; and a memory 530 communicatively connected with the at least one processor. Wherein, the memory 530 stores instructions 520 that can be executed by the at least one processor 510, and the instructions are executed by the at least one processor 510, so that the at least one processor 510 can: In response to the start instruction, display the page of the applet; obtain the first current time; determine whether the update time interval of the applet file package is greater than the first preset update period, and obtain the first judgment As a result, the update time interval represents the time interval between the time stamp corresponding to the file package of the applet and the first current time; if the first judgment result is yes, download the update of the applet The file package is used to update the applet when the applet is started next time.
可选地,所述显示所述小程序的页面之前,还可以包括:获取第三当前时间;判断所述小程序的文件包的更新时间间隔是否大于第二预设更新周期,得到第三判断结果,其中,所述更新时间间隔表示所述小程序的文件包对应的时间戳与所述第三当前时间的时间间隔;若所述第三判断结果为是,则下载所述小程序的更新文件包,并根据所述更新文件包显示所述小程序的页面,流程结束。所述响应于所述启动指令,显示所述小程序的页面,具体可以包括:若所述第三判断结果为否,则响应于所述启动指令,显示所述小程序的页面,流程继续。Optionally, before displaying the page of the applet, it may further include: obtaining a third current time; judging whether the update time interval of the file package of the applet is greater than a second preset update period, and obtaining a third judgment As a result, the update time interval represents the time interval between the time stamp corresponding to the file package of the applet and the third current time; if the third judgment result is yes, download the update of the applet File package, and display the page of the applet according to the update file package, and the process ends. The displaying the page of the applet in response to the start instruction may specifically include: if the third judgment result is no, in response to the start instruction, displaying the page of the applet, and the process continues.
基于同样的思路,本说明书实施例还提供了上述方法对应的一种计算机可读介质,其上存储有计算机可读指令,所述计算机可读指令可被处理器执行以实现上面任一实施例中所述的小程序的更新方法。Based on the same idea, the embodiments of this specification also provide a computer-readable medium corresponding to the above method, on which computer-readable instructions are stored, and the computer-readable instructions can be executed by a processor to implement any of the above embodiments. The update method of the applet described in.
上述对本说明书特定实施例进行了描述,在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。The foregoing describes specific embodiments of this specification. In some cases, the actions or steps described in the claims can be performed in a different order from the embodiments and still achieve desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or sequential order shown in order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置、设备实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the difference from other embodiments. In particular, for the device and equipment embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for related parts, please refer to the part of the description of the method embodiments.
本说明书实施例提供的装置、设备与方法是对应的,因此,装置、设备也具有与对应方法类似的有益技术效果,由于上面已经对方法的有益技术效果进行了详细说明,因此,这里不再赘述对应装置、设备的有益技术效果。The devices, equipment, and methods provided in the embodiments of this specification are corresponding. Therefore, the devices and equipment also have beneficial technical effects similar to the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, they will not be omitted here. To repeat the beneficial technical effects of corresponding devices and equipment.
在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable Gate Array,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字系统“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language)等,目前最普遍使用的是VHDL(Very-High-Speed Integrated Circuit Hardware Description Language)与Verilog。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。In the 1990s, the improvement of a technology can be clearly distinguished between hardware improvements (for example, improvements in circuit structures such as diodes, transistors, switches, etc.) or software improvements (improvements in method flow). However, with the development of technology, the improvement of many methods and processes of today can be regarded as a direct improvement of the hardware circuit structure. Designers almost always get the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be realized by the hardware entity module. For example, a programmable logic device (Programmable Logic Device, PLD) (for example, a Field Programmable Gate Array (Field Programmable Gate Array, FPGA)) is such an integrated circuit whose logic function is determined by the user's programming of the device. It is programmed by the designer to "integrate" a digital system on a piece of PLD, without requiring chip manufacturers to design and manufacture dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly realized with "logic compiler" software, which is similar to the software compiler used in program development and writing, but before compilation The original code must also be written in a specific programming language, which is called Hardware Description Language (HDL), and there is not only one type of HDL, but many types, such as ABEL (Advanced Boolean Expression Language) , AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description), etc., currently most commonly used It is VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. It should also be clear to those skilled in the art that just a little bit of logic programming of the method flow in the above-mentioned hardware description languages and programming into an integrated circuit can easily obtain the hardware circuit that implements the logic method flow.
控制器可以按任何适当的方式实现,例如,控制器可采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式,控制器的例子包括但不限于以下微控制器:ARC 625D、Atmel AT91SAM、Microchip PIC18F26K20以及Silicone Labs C8051F320,存储器控制器还可以被实现为存储器的控制逻辑的一部分。本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全可以通过将方法步骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同功能。因此这种控制器可以被认为是一种硬件部件,而对其内包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结构。The controller can be implemented in any suitable manner. For example, the controller can take the form of, for example, a microprocessor or a processor and a computer-readable medium storing computer-readable program codes (such as software or firmware) executable by the (micro)processor. , Logic gates, switches, application specific integrated circuits (ASICs), programmable logic controllers and embedded microcontrollers. Examples of controllers include but are not limited to the following microcontrollers: ARC625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicon Labs C8051F320, the memory controller can also be implemented as part of the memory control logic. Those skilled in the art also know that, in addition to implementing the controller in a purely computer-readable program code manner, it is entirely possible to program the method steps to make the controller use logic gates, switches, application specific integrated circuits, programmable logic controllers, and embedded logic. The same function can be realized in the form of a microcontroller or the like. Therefore, such a controller can be regarded as a hardware component, and the devices included in it for realizing various functions can also be regarded as a structure within the hardware component. Or even, a device for realizing various functions can be regarded as both a software module for realizing the method and a structure within a hardware component.
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机。具体的,计算 机例如可以为个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。The systems, devices, modules, or units illustrated in the above embodiments may be specifically implemented by computer chips or entities, or implemented by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cell phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or Any combination of these devices.
为了描述的方便,描述以上装置时以功能分为各种单元分别描述。当然,在实施本申请时可以把各单元的功能在同一个或多个软件和/或硬件中实现。For the convenience of description, when describing the above device, the functions are divided into various units and described separately. Of course, when implementing this application, the functions of each unit can be implemented in the same or multiple software and/or hardware.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowcharts and/or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and/or block in the flowchart and/or block diagram, and the combination of processes and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing equipment to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing equipment are used to generate It is a device that realizes the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device. The device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment. The instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, the computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。The memory may include non-permanent memory in computer readable media, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer readable media.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带式磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cartridges, magnetic tape storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or equipment including a series of elements not only includes those elements, but also includes Other elements that are not explicitly listed, or also include elements inherent to such processes, methods, commodities, or equipment. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, method, commodity, or equipment that includes the element.
本申请可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本申请,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。This application may be described in the general context of computer-executable instructions executed by a computer, such as a program module. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments. In these distributed computing environments, tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
以上所述仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。The above descriptions are only examples of the present application, and are not used to limit the present application. For those skilled in the art, this application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included in the scope of the claims of this application.
Claims (20)
- 一种小程序的更新方法,包括:A method for updating small programs, including:获取对于小程序的启动指令;Obtain the start instruction for the applet;响应于所述启动指令,显示所述小程序的页面;In response to the start instruction, display the page of the applet;获取第一当前时间;Get the first current time;判断所述小程序的文件包的更新时间间隔是否大于第一预设更新周期,得到第一判断结果,其中,所述更新时间间隔表示所述小程序的文件包对应的时间戳与所述第一当前时间的时间间隔;It is judged whether the update time interval of the file package of the applet is greater than the first preset update period, and the first judgment result is obtained, wherein the update time interval represents the time stamp corresponding to the file package of the applet and the first A time interval of the current time;若所述第一判断结果为是,则下载所述小程序的更新文件包,以用于下次启动小程序时对所述小程序进行更新。If the first judgment result is yes, download the update file package of the applet for updating the applet when the applet is started next time.
- 如权利要求1所述的方法,所述判断所述小程序的文件包的更新时间间隔是否大于第一预设更新周期之前,还包括:The method according to claim 1, wherein the determining whether the update time interval of the file package of the applet is greater than the first preset update period, further comprises:获取所述小程序的文件包对应的时间戳;Obtaining the timestamp corresponding to the file package of the applet;计算所述时间戳与所述第一当前时间之间的差值,作为所述小程序的文件包的更新时间间隔。The difference between the time stamp and the first current time is calculated as the update time interval of the file package of the applet.
- 如权利要求1所述的方法,所述判断所述小程序的文件包的更新时间间隔是否大于第一预设更新周期之前,还包括:The method according to claim 1, wherein the determining whether the update time interval of the file package of the applet is greater than the first preset update period, further comprises:获取所述小程序的第一预设更新周期,其中,所述第一预设更新周期是由小程序的维护人员设定的。Obtain a first preset update period of the applet, where the first preset update period is set by a maintainer of the applet.
- 如权利要求1所述的方法,所述若所述第一判断结果为是,则下载所述小程序的更新文件包,具体包括:The method according to claim 1, wherein if the first judgment result is yes, downloading the update file package of the applet specifically includes:若所述第一判断结果为是,则获取所述小程序的最新版本信息;If the first judgment result is yes, obtain the latest version information of the applet;判断所述小程序的当前版本信息与所述最新版本信息是否一致,得到第二判断结果;Judging whether the current version information of the applet is consistent with the latest version information, and obtaining a second judgment result;若所述第二判断结果为否,则下载所述最新版本的所述小程序的文件包。If the second judgment result is no, download the file package of the latest version of the applet.
- 如权利要求4所述的方法,还包括:若所述第一判断结果为是,则获取所述最新版本的所述小程序的文件包的下载地址信息;5. The method according to claim 4, further comprising: if the first judgment result is yes, obtaining download address information of the file package of the latest version of the applet;所述下载所述最新版本的所述小程序的文件包,具体包括:The downloading of the file package of the latest version of the applet specifically includes:根据所述下载地址信息,下载所述最新版本的所述小程序的文件包。According to the download address information, download the file package of the latest version of the applet.
- 如权利要求4所述的方法,所述获取所述小程序的最新版本信息之后,还包括:The method according to claim 4, after obtaining the latest version information of the applet, further comprising:根据获取到最新版本信息后的时间对所述小程序的文件包对应的时间戳进行更新。The time stamp corresponding to the file package of the applet is updated according to the time after the latest version information is obtained.
- 如权利要求1所述的方法,所述显示所述小程序的页面之前,还包括:The method according to claim 1, before said displaying the page of the applet, further comprising:获取第三当前时间;Get the third current time;判断所述小程序的文件包的更新时间间隔是否大于第二预设更新周期,得到第三判 断结果,其中,所述更新时间间隔表示所述小程序的文件包对应的时间戳与所述第三当前时间的时间间隔;其中,所述第二预设更新周期大于所述第一预设更新周期;It is determined whether the update time interval of the file package of the applet is greater than the second preset update period, and a third judgment result is obtained. 3. The time interval of the current time; wherein the second preset update period is greater than the first preset update period;若所述第三判断结果为是,则下载所述小程序的更新文件包,并根据所述更新文件包显示所述小程序的页面,流程结束;If the third judgment result is yes, download the update file package of the applet, and display the page of the applet according to the update file package, and the process ends;所述响应于所述启动指令,显示所述小程序的页面,具体包括:The displaying of the page of the applet in response to the start instruction specifically includes:若所述第三判断结果为否,则响应于所述启动指令,显示所述小程序的页面,流程继续。If the third judgment result is no, in response to the start instruction, the page of the applet is displayed, and the process continues.
- 如权利要求7所述的方法,所述判断所述小程序的文件包的更新时间间隔是否大于第二预设更新周期之前,还包括:8. The method according to claim 7, wherein the determining whether the update time interval of the file package of the applet is greater than the second preset update period, further comprises:获取所述小程序的文件包对应的时间戳;Obtaining the timestamp corresponding to the file package of the applet;计算所述时间戳与所述第三当前时间之间的差值,作为所述小程序的文件包的更新时间间隔。The difference between the time stamp and the third current time is calculated as the update time interval of the file package of the applet.
- 如权利要求7所述的方法,所述判断所述小程序的文件包的更新时间间隔是否大于第二预设更新周期之前,还包括:8. The method according to claim 7, wherein the determining whether the update time interval of the file package of the applet is greater than the second preset update period, further comprises:获取所述小程序的第二预设更新周期,其中,所述第二预设更新周期是由小程序的维护人员设定的。Acquire a second preset update period of the applet, where the second preset update period is set by a maintainer of the applet.
- 如权利要求7所述的方法,所述若所述第三判断结果为是,则下载所述小程序的更新文件包,具体包括:8. The method of claim 7, wherein if the third judgment result is yes, downloading the update file package of the applet specifically includes:若所述第三判断结果为是,则获取所述小程序的最新版本信息;If the third judgment result is yes, obtain the latest version information of the applet;判断所述小程序的当前版本信息与所述最新版本信息是否一致,得到第四判断结果;Judging whether the current version information of the applet is consistent with the latest version information, and obtaining a fourth judgment result;若所述第四判断结果为否,则下载所述最新版本的所述小程序的文件包。If the fourth judgment result is no, download the file package of the latest version of the applet.
- 如权利要求10所述的方法,所述获取所述小程序的最新版本信息之后,还包括:The method according to claim 10, after obtaining the latest version information of the applet, further comprising:根据获取到最新版本信息后的时间对所述小程序的文件包对应的时间戳进行更新。The time stamp corresponding to the file package of the applet is updated according to the time after the latest version information is obtained.
- 一种小程序的更新装置,包括:A device for updating small programs, including:指令获取模块,用于获取对于小程序的启动指令;The instruction acquisition module is used to acquire the start instruction for the applet;页面显示模块,用于响应于所述启动指令,显示所述小程序的页面;The page display module is configured to display the page of the applet in response to the start instruction;时间获取模块,用于获取第一当前时间;Time acquisition module for acquiring the first current time;判断模块,用于判断所述小程序的文件包的更新时间间隔是否大于第一预设更新周期,得到第一判断结果,其中,所述更新时间间隔表示所述小程序的文件包对应的时间戳与所述第一当前时间的时间间隔;The judging module is used to judge whether the update time interval of the file package of the applet is greater than the first preset update period to obtain the first judgment result, wherein the update time interval represents the time corresponding to the file package of the applet The time interval between the stamp and the first current time;下载模块,用于若所述第一判断结果为是,则下载所述小程序的更新文件包,以用于下次启动小程序时对所述小程序进行更新。The download module is configured to download the update file package of the applet if the first judgment result is yes, so as to update the applet when the applet is started next time.
- 如权利要求12所述的装置,所述装置还包括:更新时间间隔计算模块,用于,在判断所述小程序的文件包的更新时间间隔是否大于第一预设更新周期之前:The device according to claim 12, further comprising: an update time interval calculation module, configured to, before determining whether the update time interval of the file package of the applet is greater than a first preset update period:获取所述小程序的文件包对应的时间戳;Obtaining the timestamp corresponding to the file package of the applet;计算所述时间戳与所述第一当前时间之间的差值,作为所述小程序的文件包的更新时间间隔。The difference between the time stamp and the first current time is calculated as the update time interval of the file package of the applet.
- 如权利要求12所述的装置,所述装置还包括预设更新周期获取模块,用于,在判断所述小程序的文件包的更新时间间隔是否大于第一预设更新周期之前:The device according to claim 12, further comprising a preset update period obtaining module, configured to determine whether the update time interval of the file package of the applet is greater than the first preset update period:获取所述小程序的第一预设更新周期,其中,所述第一预设更新周期是由小程序的维护人员设定的。Obtain a first preset update period of the applet, where the first preset update period is set by a maintainer of the applet.
- 如权利要求12所述的装置,所述下载模块,具体包括:The device according to claim 12, the download module specifically includes:信息获取单元,用于若所述第一判断结果为是,则获取所述小程序的最新版本信息;An information obtaining unit, configured to obtain the latest version information of the applet if the first judgment result is yes;判断单元,用于判断所述小程序的当前版本信息与所述最新版本信息是否一致,得到第二判断结果;A judging unit, configured to judge whether the current version information of the applet is consistent with the latest version information, and obtain a second judgment result;下载单元,用于若所述第二判断结果为否,则下载所述最新版本的所述小程序的文件包。The downloading unit is configured to download the file package of the latest version of the small program if the second judgment result is no.
- 如权利要求15所述的装置,所述信息获取单元,还用于:The device according to claim 15, wherein the information acquisition unit is further configured to:若所述第一判断结果为是,则获取所述最新版本的所述小程序的文件包的下载地址信息;If the first judgment result is yes, obtain the download address information of the file package of the latest version of the applet;所述下载单元,具体用于:The download unit is specifically used for:若所述第二判断结果为否,则根据所述下载地址信息,下载所述最新版本的所述小程序的文件包。If the second judgment result is no, download the file package of the latest version of the applet according to the download address information.
- 如权利要求15所述的装置,所述装置还包括时间更新模块,用于,当获取所述小程序的最新版本信息之后,根据获取到最新版本信息后的时间对所述小程序的文件包对应的时间戳进行更新。The device according to claim 15, wherein the device further comprises a time update module, configured to: after obtaining the latest version information of the applet, check the file package of the applet according to the time after the latest version information is obtained. The corresponding timestamp is updated.
- 如权利要求12所述的装置,其中:The device of claim 12, wherein:所述时间获取模块,还用于,获取第三当前时间;The time obtaining module is also used to obtain the third current time;所述判断模块,还用于,在显示所述小程序的页面之前,判断所述小程序的文件包的更新时间间隔是否大于第二预设更新周期,得到第三判断结果,其中,所述更新时间间隔表示所述小程序的文件包对应的时间戳与所述第三当前时间的时间间隔;其中,所述第二预设更新周期大于所述第一预设更新周期;The judgment module is further configured to judge whether the update time interval of the file package of the applet is greater than a second preset update period before displaying the page of the applet, and obtain a third judgment result, wherein the The update time interval represents the time interval between the time stamp corresponding to the file package of the applet and the third current time; wherein, the second preset update period is greater than the first preset update period;所述页面显示模块,具体用于:The page display module is specifically used for:若所述第三判断结果为是,则下载所述小程序的更新文件包,并根据所述更新文件包显示所述小程序的页面,流程结束;If the third judgment result is yes, download the update file package of the applet, and display the page of the applet according to the update file package, and the process ends;若所述第三判断结果为否,则响应于所述启动指令,显示所述小程序的页面,流程继续。If the third judgment result is no, in response to the start instruction, the page of the applet is displayed, and the process continues.
- 一种电子设备,包括:An electronic device including:至少一个处理器;以及,At least one processor; and,与所述至少一个处理器通信连接的存储器;其中,A memory communicatively connected with the at least one processor; wherein,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够:The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can:获取对于小程序的启动指令;Obtain the start instruction for the applet;响应于所述启动指令,显示所述小程序的页面;In response to the start instruction, display the page of the applet;获取第一当前时间;Get the first current time;判断所述小程序的文件包的更新时间间隔是否大于第一预设更新周期,得到第一判断结果,其中,所述更新时间间隔表示所述小程序的文件包对应的时间戳与所述第一当前时间的时间间隔;It is judged whether the update time interval of the file package of the applet is greater than the first preset update period, and the first judgment result is obtained, wherein the update time interval represents the time stamp corresponding to the file package of the applet and the first A time interval of the current time;若所述第一判断结果为是,则下载所述小程序的更新文件包,以用于下次启动小程序时对所述小程序进行更新。If the first judgment result is yes, download the update file package of the applet for updating the applet when the applet is started next time.
- 一种计算机可读介质,其上存储有计算机可读指令,所述计算机可读指令可被处理器执行以实现权利要求1至11中任一项所述的小程序的更新方法。A computer-readable medium having computer-readable instructions stored thereon, and the computer-readable instructions can be executed by a processor to implement the method for updating a small program according to any one of claims 1 to 11.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010379620.6 | 2020-05-07 | ||
CN202010379620.6A CN111488167B (en) | 2020-05-07 | 2020-05-07 | Applet updating method, device, equipment and computer readable medium |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021223658A1 true WO2021223658A1 (en) | 2021-11-11 |
Family
ID=71795736
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2021/091068 WO2021223658A1 (en) | 2020-05-07 | 2021-04-29 | Mini program update |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN111488167B (en) |
WO (1) | WO2021223658A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114879991A (en) * | 2022-04-25 | 2022-08-09 | 杭州振华仪表有限公司 | Software upgrading method, system and storage medium |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111488167B (en) * | 2020-05-07 | 2022-01-28 | 支付宝(杭州)信息技术有限公司 | Applet updating method, device, equipment and computer readable medium |
CN112416402B (en) * | 2020-11-23 | 2024-08-02 | 百度在线网络技术(北京)有限公司 | Applet updating method, device, electronic equipment and storage medium |
CN112631651A (en) * | 2020-12-29 | 2021-04-09 | 福州智永信息科技有限公司 | Version updating method and terminal for small application |
CN112698884A (en) * | 2020-12-30 | 2021-04-23 | 北京达佳互联信息技术有限公司 | Program starting method, device, system, equipment and storage medium |
CN113641274B (en) * | 2021-08-16 | 2024-08-27 | 卡奥斯数字科技(青岛)有限公司 | Page display method, device and equipment for micro-applications |
CN114691269B (en) * | 2022-03-29 | 2024-05-14 | 广东万和新电气股份有限公司 | Page updating method, device, system and storage medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105094919A (en) * | 2015-08-13 | 2015-11-25 | 海信集团有限公司 | Application program starting method |
WO2015176454A1 (en) * | 2014-05-19 | 2015-11-26 | 中兴通讯股份有限公司 | Method and device for upgrading software |
CN106990988A (en) * | 2017-04-05 | 2017-07-28 | 深圳天珑无线科技有限公司 | The method and device that a kind of program updates |
WO2017193640A1 (en) * | 2016-05-07 | 2017-11-16 | 腾讯科技(深圳)有限公司 | Application updating method and device |
CN108600382A (en) * | 2018-04-28 | 2018-09-28 | 广州联欣信息科技有限公司 | A kind of method and computer readable storage medium of the APP content cachings in internet off-line |
CN110427225A (en) * | 2019-07-29 | 2019-11-08 | 阿里巴巴集团控股有限公司 | A kind of method and apparatus starting small routine |
CN110569050A (en) * | 2019-08-01 | 2019-12-13 | 阿里巴巴集团控股有限公司 | Applet updating method and device |
CN111488167A (en) * | 2020-05-07 | 2020-08-04 | 支付宝(杭州)信息技术有限公司 | Applet updating method, device, equipment and computer readable medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110659057B (en) * | 2019-09-24 | 2021-10-22 | 腾讯科技(深圳)有限公司 | Application program hot updating method and device, storage medium and computer equipment |
-
2020
- 2020-05-07 CN CN202010379620.6A patent/CN111488167B/en active Active
-
2021
- 2021-04-29 WO PCT/CN2021/091068 patent/WO2021223658A1/en active Application Filing
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2015176454A1 (en) * | 2014-05-19 | 2015-11-26 | 中兴通讯股份有限公司 | Method and device for upgrading software |
CN105094919A (en) * | 2015-08-13 | 2015-11-25 | 海信集团有限公司 | Application program starting method |
WO2017193640A1 (en) * | 2016-05-07 | 2017-11-16 | 腾讯科技(深圳)有限公司 | Application updating method and device |
CN106990988A (en) * | 2017-04-05 | 2017-07-28 | 深圳天珑无线科技有限公司 | The method and device that a kind of program updates |
CN108600382A (en) * | 2018-04-28 | 2018-09-28 | 广州联欣信息科技有限公司 | A kind of method and computer readable storage medium of the APP content cachings in internet off-line |
CN110427225A (en) * | 2019-07-29 | 2019-11-08 | 阿里巴巴集团控股有限公司 | A kind of method and apparatus starting small routine |
CN110569050A (en) * | 2019-08-01 | 2019-12-13 | 阿里巴巴集团控股有限公司 | Applet updating method and device |
CN111488167A (en) * | 2020-05-07 | 2020-08-04 | 支付宝(杭州)信息技术有限公司 | Applet updating method, device, equipment and computer readable medium |
Non-Patent Citations (1)
Title |
---|
LITTLE FAIRIES: "Network Authentication. Automatic Updating Method of Wechat Applet Version", 3 December 2018 (2018-12-03), CN, pages 1 - 5, XP009531597, Retrieved from the Internet <URL:https://www.jianshu.com/p/4f5e3faaf483> * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114879991A (en) * | 2022-04-25 | 2022-08-09 | 杭州振华仪表有限公司 | Software upgrading method, system and storage medium |
CN114879991B (en) * | 2022-04-25 | 2023-05-02 | 杭州振华仪表有限公司 | Software upgrading method, system and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111488167A (en) | 2020-08-04 |
CN111488167B (en) | 2022-01-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021223658A1 (en) | Mini program update | |
US10649935B2 (en) | Deferred inter-processor interrupts | |
US20200057660A1 (en) | Method and system for rendering user interfaces | |
US8935293B2 (en) | Framework for dynamically generating tuple and page classes | |
CN112540806B (en) | Method and device for rendering small program page, electronic equipment and storage medium | |
US8458585B1 (en) | Delayed code parsing for reduced startup latency | |
TWI767106B (en) | Method, device and device for configuring payment process and executing payment process | |
US20150002522A1 (en) | Mid command buffer preemption for graphics workloads | |
US10402223B1 (en) | Scheduling hardware resources for offloading functions in a heterogeneous computing system | |
WO2019179243A1 (en) | Information display method, apparatus and device | |
JP2017538212A (en) | Improved function callback mechanism between central processing unit (CPU) and auxiliary processor | |
CN106990979A (en) | A kind of configuration information update method, system, client and server | |
WO2013083486A1 (en) | Hidden automated data mirroring for native interfaces in distributed virtual machines | |
US8725800B1 (en) | Mobile photo application migration to cloud computing platform | |
CN108549562A (en) | A kind of method and device of image load | |
US20110219373A1 (en) | Virtual machine management apparatus and virtualization method for virtualization-supporting terminal platform | |
WO2016110202A1 (en) | Method, client and device for displaying page | |
WO2021164368A1 (en) | Container application starting method, system, and apparatus, and electronic device | |
WO2019114158A1 (en) | Real-time animation display method and device, electronic terminal, and readable storage medium | |
CN110955503B (en) | Task scheduling method and device | |
CN115269025A (en) | Kernel quick starting method and device, electronic equipment and storage medium | |
CN114936173A (en) | Read-write method, device, equipment and storage medium of eMMC device | |
JP7482223B2 (en) | APPLET PAGE RENDERING METHOD, DEVICE, ELECTRONIC DEVICE, AND STORAGE MEDIUM | |
CN102540953A (en) | Programmable logic controller and data processing method thereof | |
WO2019028977A1 (en) | Data preloading method and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21799579 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 21799579 Country of ref document: EP Kind code of ref document: A1 |