A dynamic loading method, system, device and storage medium for Internet applet

By dynamically loading the next -level access page of the applet, it is estimated that the user stays and pre -loaded according to the network conditions, which solves the problem of unstable loading of mini -programs when network fluctuations, and avoids the problem of local data storage occupation of memory. Realize a smooth user experience.

CN117421069BActive Publication Date: 2025-01-28JIU MU BEN (HAI NAN) KE JI GU FEN YOU XIAN GONG SI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311580061.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-24
Publication Date
2025-01-28
Estimated Expiration
2043-11-24

AI Technical Summary

Technical Problem

The data loading of existing Internet mini programs is unstable when the network environment fluctuates, resulting in a long response time for web pages; placing data locally will cause a large amount of memory to be occupied by mobile phone devices, affecting user experience.

Method used

By obtaining the page path of the applet and the current access page information, the user stays length range, and determines the pre -load duration of the next level of access page according to the network transmission speed and resource volume. The next -level access page with a pre -loading duration is less than the estimated stoppage range as the target page, and the pre -load is pre -loaded based on its weight until the page switch instruction is received.

Benefits of technology

Realize the smooth access experience for users in various network environments, avoiding the impact of network fluctuations on loading speed without occupying a large amount of memory.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117421069B_ABST
    Figure CN117421069B_ABST
Patent Text Reader

Abstract

The present invention relates to a dynamic loading method, system, device and storage medium of an Internet applet, which determines the next-level access page that a user may visit next by using the page path and current page information. It also determines the estimated stay time range of the user on the current page, and then determines the loading time required for the next-level access page by the required amount of resources for the next-level access page and the current network speed. If the loading time is less than the lower limit of the estimated stay time range, the next-level access page is used as the target page, so that the target page can be preloaded within the time when the user browses the current page. The present application predicts the page to be switched subsequently, and when the subsequent switched page is consistent with the preloaded page, the page is directly loaded from the local. Since the preloaded data is in the local cache, it does not need to occupy a large amount of memory. At the same time, it can provide users with a smooth access experience in various network environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Internet technology, and in particular to a method, system, device and storage medium for dynamically loading an Internet applet. Background Art

[0002] Many existing Internet shopping malls are promoted and applied in the form of mini programs, which have the advantages of flexible channels and easy promotion. However, Internet mini programs generally put the code on the front end, while a large amount of data is stored in the server. When users use the mini program, they load the required data from the server according to the current page.

[0003] However, this loading method has the problem of unstable data loading when the network environment fluctuates. This leads to long web page response time and long user waiting time. However, if the data is placed locally, although it can effectively improve the loading speed, it will cause a large amount of memory in the mobile device to be occupied. For users, the above two methods have a poor user experience. Summary of the invention

[0004] In view of this, the purpose of the present invention is to provide a dynamic loading method, system, device and storage medium for an Internet mini-program, so as to solve the problem in the prior art that program data loaded from a server is easily affected by network fluctuations, and loading program data from a local computer will cause a large amount of terminal memory to be occupied.

[0005] In order to achieve the above object, the present invention adopts the following technical solutions:

[0006] A method for dynamically loading an Internet applet of the present invention comprises:

[0007] Obtaining the page path of the mini-program, the currently visited page information of the mini-program, the estimated stay time range of the currently visited page, and the network transmission speed at the current time, wherein the estimated stay time range of the currently visited page is determined based on the historical stay time of the current user and other users on the currently visited page;

[0008] Based on the page path of the mini-program and the currently visited page information of the mini-program, determining one or more next-level visited pages of the currently visited page;

[0009] When there are multiple next-level access pages, determining the preloading time of each next-level access page based on the current network transmission speed and the resource amount of each next-level access page;

[0010] Taking the next-level access page whose preloading time is less than the lower limit of the estimated stay time range as the target page, and preloading the target page into the local cache based on the weight of each target page, wherein the weight of the target page is determined based on the number of visits to each page by the current user and other users;

[0011] When a page switching instruction is received from the user, the page information in the page switching instruction is compared with the target page that has been preloaded, and when the page information in the page switching instruction is consistent with the target page that has been preloaded, the required resources of the corresponding page are loaded locally.

[0012] In an embodiment of the present application, obtaining the estimated stay time range of the currently visited page includes:

[0013] Get the number of times the current user has stayed on the current page n and the duration of each stay T i , and obtain the historical number of times other users have stayed on the current page and the duration of each stay T′ i ;

[0014] Calculate the duration of stay T i The average value T A and standard deviation σ, calculate the residence time T′ i The average value T′ A and standard deviation σ′;

[0015] Determine the average estimated stay time T of the currently visited page AP and standard deviation σ p ,in,

[0016] T AP =w 1 ×T A +w 2 ×T′ A

[0017] σ p =w 1 ×σ+w 2 ×σ′

[0018]

[0019]

[0020] In the formula, w 1 is the first weight, w 2 is the second weight, α is the preset ratio;

[0021] Based on the average value T of the estimated stay time of the currently visited page 0 and standard deviation σ0 Construct the estimated stay time distribution range (T AP -σ p , T AP +σ p ).

[0022] In an embodiment of the present application, obtaining the network transmission speed at the current time includes:

[0023] At time point T 0 Send x test packets to the server, where each test packet is N bytes in size, at time T 0 Within the unit time before the current time point;

[0024] When receiving a return data packet from the server, record the return time T of each return data packet j , wherein the return data packet is generated based on the test data packet, and the size of the return data packet is the same as the size of the test data packet;

[0025] Calculate the average return time of the returned packets and based on the average return time Calculate the current network transmission speed S, the current network transmission speed

[0026] In one embodiment of the present application, the preloading time length T of the next level access page is next The mathematical expression is:

[0027]

[0028] Where D is the resource amount of the next level access page.

[0029] In an embodiment of the present application, preloading a target page into a local cache based on the weight of each target page includes:

[0030] Request the required resources of one or more target pages from the server in descending order of weight, and cache them locally until receiving a page switching instruction from the user.

[0031] In one embodiment of the present application, the weight of the target page is determined based on the following method:

[0032] Get the historical number of visits to each page of the mini program by the current user A k , and obtain the historical number of visits A′ by other users to each page of the mini program k ;

[0033] Determine the historical access frequency P of the target page corresponding to the current user1 , P 1 =A G / ∑A k , and the historical access frequency P of the target page corresponding to other users 2 , P 2 =A′ G / ∑A′ k , where A G is the historical number of visits to the target page corresponding to the current user, A′ k The historical number of visits to the target page corresponding to other users;

[0034] Based on the historical access frequency P 1 and the historical access frequency P 2 Determine the weight w of the target page G , w G The mathematical expression is:

[0035] w G =P 1 × 3 +P 2 × 4

[0036]

[0037]

[0038] In the formula, w 3 is the third weight, w 4 is the fourth weight, and α is the preset ratio.

[0039] In one embodiment of the present application, it also includes:

[0040] When the number of next-level access pages is one, the required resources of the next-level access page are requested from the server and cached in the local cache.

[0041] The present application also provides a dynamic loading system for an Internet applet, including:

[0042] An acquisition module, used to acquire the page path of the mini-program, the currently visited page information of the mini-program, the estimated stay time range of the currently visited page, and the network transmission speed at the current time, wherein the estimated stay time range of the currently visited page is determined based on the historical stay time of the current user and other users on the currently visited page;

[0043] A target determination module, used to determine one or more next-level visited pages of the currently visited page based on the page path of the mini-program and the currently visited page information of the mini-program;

[0044] A duration determination module, for determining the preloading duration of each next-level access page based on the network transmission speed at the current time and the resource amount of each next-level access page when there are multiple next-level access pages;

[0045] A preloading module, used to take the next-level access page whose preloading time is less than the lower limit of the estimated stay time range as the target page, and preload the target page into the local cache based on the weight of each target page, wherein the weight of each access page is determined based on the historical total access data of the corresponding access page and the historical access data of the current user;

[0046] The loading module is used to compare the page information in the page switching instruction with the target page that has been preloaded when receiving a page switching instruction from the user, and to load the required resources of the corresponding page from the local when the page information in the page switching instruction is consistent with the target page that has been preloaded.

[0047] The present application also provides an electronic device, the electronic device comprising:

[0048] one or more processors;

[0049] The storage device is used to store one or more programs. When the one or more programs are executed by the one or more processors, the electronic device implements a data risk assessment method as described above.

[0050] The present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor of a computer, the computer is enabled to execute a data risk assessment method as described above.

[0051] The beneficial effects of the present invention are as follows: a method, system, device and storage medium for dynamically loading an Internet applet of the present invention, when any page of the applet is in an accessed state, determines the next level access page that the user may visit next by using the page path and the current page information. And determines the estimated range of the user's possible stay time on the current page, and then determines the loading time required for the next level access page by the required amount of resources for the next level access page and the current network speed. If the loading time is less than the lower limit of the estimated stay time range, the next level access page is used as the target page, so that the target page can be preloaded within the time when the user browses the current page. Then, multiple target pages are sequentially preloaded based on the weight of the target page. The present application predicts the page to be switched subsequently, and when the subsequent switching page is consistent with the preloaded page, the page is directly loaded from the local. Since the preloaded data is in the local cache, it does not need to occupy a large amount of memory. At the same time, a smooth access experience can be provided to users in various network environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] The present invention will be further described below in conjunction with the accompanying drawings and embodiments:

[0053] Figure 1 It is an application scenario diagram of a dynamic loading method of an Internet applet shown in an embodiment of the present application;

[0054] Figure 2 A flowchart of a method for dynamically loading an Internet applet in one embodiment of the present invention;

[0055] Figure 3 The present invention is a structural diagram of a dynamic loading system for an Internet applet in one embodiment of the present invention. DETAILED DESCRIPTION

[0056] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0057] It should be noted that the illustrations provided in the following embodiments are only used to schematically illustrate the basic concept of the present invention. Therefore, the drawings only show the layers related to the present invention rather than being drawn according to the number, shape and size of the layers in actual implementation. In actual implementation, the shape, quantity and proportion of each layer may be changed arbitrarily, and the layer layout may also be more complicated.

[0058] In the following description, numerous details are discussed to provide a more thorough explanation of embodiments of the present invention; however, it is apparent to one skilled in the art that embodiments of the present invention may be practiced without these specific details.

[0059] Figure 1 This is an application scenario diagram of a dynamic loading method of an Internet applet shown in an embodiment of the present application, such as Figure 1 As shown, the mini program in this application runs on the mobile phone and obtains the images, videos, text and other resources required for each page of the mini program through the server. The local cache on the mobile phone will preload some page resources based on the historical access data of the mini program and user habits, thereby avoiding the influence of the network environment to a large extent, providing users with a smooth browsing experience, and not taking up too much memory.

[0060] Figure 2is a flow chart of a method for dynamically loading an Internet applet shown in an embodiment of the present application. Figure 2 As shown, this application includes:

[0061] S210, obtaining the page path of the mini program, the currently visited page information of the mini program, the estimated stay time range of the currently visited page, and the network transmission speed at the current time, wherein the estimated stay time range of the currently visited page is determined based on the historical stay time of the current user and other users on the currently visited page;

[0062] Among them, the mini program framework system in this application is divided into two parts: the logic layer (App Service) and the view layer (View).

[0063] In a mini program, the page path is used to identify the unique address of different pages of the mini program. Each page has a corresponding path. The page path usually includes a path and parameters. The path specifies the relative position of the page in the mini program, and the parameters are optional and are used to pass additional parameters or parameters to the page.

[0064] The currently visited page information refers to the location of the page that the user is currently visiting.

[0065] The above parameters can be obtained directly through the mini program.

[0066] The estimated dwell time range of the currently visited page and the current network transmission speed are pre-determined parameters in this embodiment, and the specific determination method is as follows:

[0067] In an embodiment of the present application, obtaining the estimated stay time range of the currently visited page includes:

[0068] S2101, obtaining the number of historical stays n of the current user on the currently visited page and the duration T of each stay i , and obtain the historical number of times other users have stayed on the current page and the duration of each stay T′ i ;

[0069] Among them, other users refer to all users who have used the mini program except the current user. If the user sample is large enough, other users can also be all users who have used the mini program. In this embodiment, the estimated stay time range of the currently visited page is predicted by collecting the historical number of stays of the current user and other users on each page and the stay time of each stay.

[0070] S2102, calculate the stay time T i The average value T A and standard deviation σ, calculate the residence time T′ iThe average value T′ A and standard deviation σ′;

[0071] Among them, the length of stay T i The average value T A The and standard deviation σ can reflect the distribution characteristics of the duration of stay of the current user when browsing the currently visited page. However, in general, the data samples of a single user are small, and it is difficult to reflect the regularity of the current user when browsing the currently visited page.

[0072] In order to avoid the average value T caused by the small number of current user data samples A The problem that the standard deviation σ cannot reflect the regularity. This application also extracts the corresponding stay time T′ of other users i The average value T′ A , using a large amount of data to reflect the regularity of the length of stay when browsing the page. In some embodiments, in order to more accurately reflect the regularity, the identity characteristics of the current user, such as age and gender, can also be obtained. Users of the same gender and age group as the current user are regarded as other users, so as to more accurately approximate the regularity of the length of stay when browsing the page of the current user.

[0073] S2103, determining the average value T of the estimated stay time of the currently visited page AP and standard deviation σ p ,in,

[0074] T AP =w 1 ×T A +w 2 ×T′ A

[0075] σ p =w 1 ×σ+w 2 ×σ′

[0076]

[0077]

[0078] In the formula, w 1 is the first weight, w 2 is the second weight, α is the preset ratio;

[0079] S2104: based on the average value T of the estimated stay time of the currently visited page 0 and standard deviation σ 0 Construct the estimated stay time distribution range (T AP -σ p , T AP +σ p).

[0080] Among them, this application sets the first weight w 1 and the second weight w 2 To integrate the historical access data of the user and the historical access data of other users. Among them, the first weight w 1 and the second weight w 2 The value of is determined based on the amount of data samples of each user. However, since the amount of data samples of the current user is generally small, the present application also sets a preset magnification α to amplify the effect of the data samples of the current user. Specifically, The larger the data sample size of the current user, the larger n is, and the larger w is. 1 The larger the w 2 The value of α is related to the total number of users of the mini program, and is generally 0.1-0.5 of the total number of users.

[0081] In an embodiment of the present application, obtaining the network transmission speed at the current time includes:

[0082] S2111, at time point T 0 Send x test packets to the server, where each test packet is N bytes in size, at time T 0 Within the unit time before the current time point;

[0083] S2112, when receiving a return data packet from the server, record the return time T of each return data packet j , wherein the return data packet is generated based on the test data packet, and the size of the return data packet is the same as the size of the test data packet;

[0084] S2113, calculate the average return time of the returned data packets and based on the average return time Calculate the current network transmission speed S, the current network transmission speed

[0085] In this embodiment, a method of sending data packets is adopted to test the network transmission speed, and an average value is taken through multiple tests to reduce the impact of network fluctuations.

[0086] S220, determining one or more next-level visited pages of the currently visited page based on the page path of the mini-program and the currently visited page information of the mini-program;

[0087] Among them, the next level access page refers to the page that has not been loaded yet and the user may visit next. It does not include the previous level page that has been loaded. The mini program in this application caches the previous level page that has been loaded locally, and the user can return quickly.

[0088] S230, when there are multiple next-level access pages, determining a preloading duration of each next-level access page based on the current network transmission speed and the resource amount of each next-level access page;

[0089] In one embodiment of the present application, the preloading time length T of the next level access page is next The mathematical expression is:

[0090]

[0091] Where D is the resource amount of the next level access page.

[0092] When the number of next-level access pages is one, the required resources of the next-level access page are requested from the server and cached in the local cache.

[0093] S240, taking the next-level access page whose preloading time is less than the lower limit of the estimated stay time range as the target page, and preloading the target page into the local cache based on the weight of each target page, wherein the weight of the target page is determined based on the number of visits to each page by the current user and other users;

[0094] The next-level access page whose preloading duration is less than the lower limit of the estimated stay duration range is a target page that can be preloaded before the user switches pages.

[0095] When there are multiple pages to visit at the next level, since it is not possible to preload all target pages within the estimated stay time, they need to be loaded in a specific order. In this application, sorting is performed based on the weights of multiple target pages, and this weight is determined based on the number of visits to the multiple target pages. The number of visits here includes both the number of visits by all users and the number of visits by the current user. This can not only be close to the access habits of the current user, but also solve the problem of insufficient data volume for the current user.

[0096] In an embodiment of the present application, preloading a target page into a local cache based on the weight of each target page includes:

[0097] Request the required resources of one or more target pages from the server in descending order of weight, and cache them locally until receiving a page switching instruction from the user.

[0098] In one embodiment of the present application, the weight of the target page is determined based on the following method:

[0099] S241, obtain the historical number of visits A of each page of the mini program visited by the current user k, and obtain the historical number of visits A′ by other users to each page of the mini program k ;

[0100] S242, determining the historical access frequency P of the target page corresponding to the current user 1 , P 1 =A G / ∑A k , and the historical access frequency P of the target page corresponding to other users 2 , P 2 =A′ G / ∑A′ k , where A G is the historical number of visits to the target page corresponding to the current user, A′ k The historical number of visits to the target page corresponding to other users;

[0101] S243, based on the historical access frequency P 1 and the historical access frequency P 2 Determine the weight w of the target page G , w G The mathematical expression is:

[0102] w G =P 1 × 3 +P 2 × 4

[0103]

[0104]

[0105] In the formula, w 3 is the third weight, w 4 is the fourth weight, and α is the preset ratio.

[0106] The weight of the target page is similar to the method for determining the estimated stay duration range. This application uses historical data to calculate the historical access frequency P of the target page corresponding to the current user. 1 , and the historical access frequency P of the target page corresponding to other users 2 , and then fuse them through weights, so that the corresponding weights can not only reflect the current user's usage habits, but also avoid the problem of inaccurate weights caused by the small number of current user data samples. In addition, if the current user data is collected more, the weights determined later can better reflect the user's preferences when switching pages.

[0107] S250, when receiving a page switching instruction from the user, compare the page information in the page switching instruction with the target page that has been preloaded, and when the page information in the page switching instruction is consistent with the target page that has been preloaded, load the required resources of the corresponding page from the local.

[0108] The pages preloaded in this application are determined based on the big data of all users and the habits of the current users, and have a relatively accurate prediction rate. Therefore, when a page switching instruction is received from the user, there is a high probability that the page information in the page switching instruction will be consistent with the target page for preloading. Then, it is loaded directly from the local cache, making the loading process smooth and greatly reducing the loading waiting time caused by network fluctuations. At the same time, since the preloaded data is in the local cache, it is automatically cleared after closing the applet, and will not take up the user's memory space.

[0109] A dynamic loading method for an Internet applet of the present invention, when any page of the applet is in an accessed state, determines the next level access page that the user may visit next by using the page path and the current page information. And determines the estimated stay time range of the user on the current page, and then determines the loading time required for the next level access page by the required amount of resources of the next level access page and the current network speed. If the loading time is less than the lower limit of the estimated stay time range, the next level access page is used as the target page, so that the target page can be preloaded within the time when the user browses the current page. Then, multiple target pages are sequentially preloaded based on the weight of the target page. The present application predicts the page to be switched subsequently, and when the subsequent switching page is consistent with the preloaded page, the page is directly loaded from the local. Since the preloaded data is in the local cache, it does not need to occupy a large amount of memory. At the same time, a smooth access experience can be provided to users in various network environments.

[0110] The present application also provides a dynamic loading system for an Internet applet, including:

[0111] An acquisition module, used to acquire the page path of the mini-program, the currently visited page information of the mini-program, the estimated stay time range of the currently visited page, and the network transmission speed at the current time, wherein the estimated stay time range of the currently visited page is determined based on the historical stay time of the current user and other users on the currently visited page;

[0112] A target determination module, used to determine one or more next-level visited pages of the currently visited page based on the page path of the mini-program and the currently visited page information of the mini-program;

[0113] A duration determination module, for determining the preloading duration of each next-level access page based on the network transmission speed at the current time and the resource amount of each next-level access page when there are multiple next-level access pages;

[0114] A preloading module, used to take the next-level access page whose preloading time is less than the lower limit of the estimated stay time range as the target page, and preload the target page into the local cache based on the weight of each target page, wherein the weight of each access page is determined based on the historical total access data of the corresponding access page and the historical access data of the current user;

[0115] The loading module is used to compare the page information in the page switching instruction with the target page that has been preloaded when receiving a page switching instruction from the user, and to load the required resources of the corresponding page from the local when the page information in the page switching instruction is consistent with the target page that has been preloaded.

[0116] A dynamic loading system for an Internet applet of the present invention determines the next level access page that the user may visit next time through the page path and the current page information when any page of the applet is in an accessed state. And determine the estimated stay time range of the user on the current page, and then determine the loading time required for the next level access page through the required resource amount of the next level access page and the current network speed. If the loading time is less than the lower limit of the estimated stay time range, the next level access page is used as the target page, so that the target page can be preloaded within the time when the user browses the current page. Then, multiple target pages are sequentially preloaded based on the weight of the target page. The present application predicts the page to be switched subsequently, and when the subsequent switching page is consistent with the preloaded page, the page is directly loaded from the local. Since the preloaded data is in the local cache, it does not need to occupy a large amount of memory. At the same time, a smooth access experience can be provided to users in various network environments.

[0117] This embodiment further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, any method in this embodiment is implemented, wherein the method is the execution logic of this system.

[0118] This embodiment also provides an electronic terminal, including: a processor and a memory;

[0119] The memory is used to store computer programs, and the processor is used to execute the computer programs stored in the memory, so that the terminal executes any one of the methods in this embodiment.

[0120] The computer-readable storage medium in this embodiment can be understood by ordinary technicians in this field: all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to the computer program. The aforementioned computer program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other media that can store program codes.

[0121] The electronic terminal provided in this embodiment includes a processor, a memory, a transceiver and a communication interface. The memory and the communication interface are connected to the processor and the transceiver and complete communication with each other. The memory is used to store computer programs, the communication interface is used to communicate, and the processor and the transceiver are used to run computer programs so that the electronic terminal executes each step of the above method.

[0122] In this embodiment, the memory may include a random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0123] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0124] In the above-mentioned embodiments, although the present invention has been described in conjunction with the specific embodiments of the present invention, many replacements, modifications and variations of these embodiments will be apparent to those of ordinary skill in the art based on the foregoing description. The embodiments of the present invention are intended to cover all such replacements, modifications and variations falling within the broad scope of the appended claims.

[0125] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.

Claims

1. A method for dynamically loading an Internet applet, characterized in that: Includes steps: Obtain the page path of the mini-program, the currently visited page information of the mini-program, the estimated stay time range of the currently visited page, and the current network transmission speed, wherein the estimated stay time range of the currently visited page is determined based on the historical stay time of the current user and other users on the currently visited page; Obtain the estimated stay time range of the currently visited page, including: obtaining the historical stay times of the current user on the currently visited page and the duration of each stop , and obtain the historical number of times other users have stayed on the currently visited page and the duration of each stop ; Calculate the duration of stay The average and standard deviation , calculate the length of stay The average and standard deviation ; Determine the average estimated duration of stay of the currently visited page and standard deviation ,in, In the formula, is the first weight, is the second weight, is a preset multiple; based on the average value of the estimated stay time of the currently visited page and standard deviation Construct the estimated duration distribution range of the currently visited page ; Based on the page path of the mini-program and the currently visited page information of the mini-program, determining multiple next-level visited pages of the currently visited page; When there are multiple next-level access pages, determining the preloading time of each next-level access page based on the current network transmission speed and the resource amount of each next-level access page; The next-level access page whose preloading time is less than the lower limit of the estimated stay time range is taken as the target page, and the target page is preloaded into the local cache based on the weight of each target page, wherein the weight of the target page is determined based on the number of visits to each page by the current user and other users; the target page is preloaded into the local cache based on the weight of each target page, including: requesting the required resources of one or more target pages from the server in order from large to small weights, and caching them locally until a page switching instruction is received from the user; the weight of the target page is determined based on the following method: obtaining the historical number of visits to each page of the mini program by the current user , and obtain the historical visit count of other users visiting each page of the mini program ; Determine the historical visit frequency of the target page corresponding to the current user , , and the historical visit frequency of the target page corresponding to other users , ,in, is the historical number of visits to the target page corresponding to the current user, The historical number of visits to the target page corresponding to other users; based on the historical visit frequency and the historical access frequency Determine the target page's authority , The mathematical expression is: In the formula, is the third weight, is the fourth weight, is the preset magnification; When a page switching instruction is received from the user, the page information in the page switching instruction is compared with the target page that has been preloaded, and when the page information in the page switching instruction is consistent with the target page that has been preloaded, the required resources of the corresponding page are loaded locally.

2. According to the method for dynamically loading an Internet applet in claim 1, it is characterized in that: Getting the current network transmission speed includes: At the point in time Send to server test data packets, where the size of each test data packet is Bytes, time point Within the unit time before the current time point; When receiving a return data packet from the server, record the return time of each return data packet , wherein the return data packet is generated based on the test data packet, and the size of the return data packet is the same as the size of the test data packet; Calculate the average return time of the returned packets , and based on the average return time Calculate the current network transmission speed , the network transmission speed at the current time .

3. According to claim 2, a method for dynamically loading an Internet applet is characterized in that: The preload duration of the next level access page The mathematical expression is: In the formula, The amount of resources for the next level of access to the page.

4. A dynamic loading system for Internet applets, characterized in that: include: An acquisition module is used to acquire the page path of the mini-program, the currently visited page information of the mini-program, the estimated stay time range of the currently visited page, and the network transmission speed at the current time, wherein the estimated stay time range of the currently visited page is determined based on the historical stay time of the current user and other users on the currently visited page; acquiring the estimated stay time range of the currently visited page includes: acquiring the historical stay times of the current user on the currently visited page and the duration of each stop , and obtain the historical number of times other users have stayed on the currently visited page and the duration of each stop ; Calculate the duration of stay The average and standard deviation , calculate the duration of stay The average and standard deviation ; Determine the average estimated duration of stay of the currently visited page and standard deviation ,in, In the formula, is the first weight, is the second weight, is a preset multiple; based on the average value of the estimated stay time of the currently visited page and standard deviation Construct the estimated duration distribution range of the currently visited page ; A target determination module, used to determine multiple next-level access pages of the currently accessed page based on the page path of the mini-program and the currently accessed page information of the mini-program; A duration determination module, for determining the preloading duration of each next-level access page based on the network transmission speed at the current time and the resource amount of each next-level access page when there are multiple next-level access pages; A preloading module is used to take the next-level access page whose preloading time is less than the lower limit of the estimated stay time range as the target page, and preload the target page into the local cache based on the weight of each target page, wherein the weight of the target page is determined based on the number of visits to each page by the current user and other users; preloading the target page into the local cache based on the weight of each target page, including: requesting the required resources of one or more target pages from the server in order from large to small weights, and caching them locally until a page switching instruction is received from the user; the weight of the target page is determined based on the following method: obtaining the historical number of visits to each page of the mini program by the current user , and obtain the historical visit count of other users visiting each page of the mini program ; Determine the historical visit frequency of the target page corresponding to the current user , , and the historical visit frequency of the target page corresponding to other users , ,in, is the historical number of visits to the target page corresponding to the current user, The historical number of visits to the target page corresponding to other users; based on the historical visit frequency and the historical access frequency Determine the target page's authority , The mathematical expression is: In the formula, is the third weight, is the fourth weight, is the preset magnification; The loading module is used to compare the page information in the page switching instruction with the target page that has been preloaded when receiving a page switching instruction from the user, and to load the required resources of the corresponding page from the local when the page information in the page switching instruction is consistent with the target page that has been preloaded.

5. An electronic device, characterized in that: The electronic device comprises: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement a dynamic loading method for an Internet applet as described in any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute a method for dynamically loading an Internet applet as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Picture loading method and device, and readable storage medium

    CN112272226A

  • Method and device for preloading data and electronic equipment

    CN115599478A