Small program resource loading method and device, equipment, storage medium and product
By predicting the set of pages accessed by the mini-program and scoring them to select target pages for preloading, the problem of delayed loading of mini-program resources is solved, resulting in a smoother user experience and higher loading efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-26
- Publication Date
- 2026-03-31
AI Technical Summary
The loading of existing mini-program resources lags far behind user actions, causing page loading delays and stuttering, which affects user experience and operational smoothness.
By predicting the set of next mini-program pages that users will visit, and calculating scores based on page visit frequency, popularity, user preferences, and device performance, the most likely pages to be visited are selected for preloading resources.
It effectively avoids page loading delays and lag, improves user experience and operation smoothness, achieves a prediction accuracy of 92%, controls loading time within 300ms, reduces page jump latency to below 50ms, and reduces memory usage by 40%.
Smart Images

Figure CN121764557A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of mini-program technology, and in particular to a method, apparatus, device, storage medium and product for loading mini-program resources. Background Technology
[0002] Mini-program resources refer to various files, tools, and materials used for developing, running, and maintaining WeChat mini-programs. These resources include, but are not limited to, source code, multimedia files such as images, audio, and video, as well as development documentation and technical support.
[0003] Currently, loading mini-programs typically relies on user intervention: after a user searches for a mini-program, they open a specific sub-package or page through an actual click, at which point the download of the mini-program package and the loading of page resources begin. Because resource loading lags completely behind user interaction, this approach is prone to page loading delays and even stuttering, directly impacting user experience and operational smoothness. Summary of the Invention
[0004] This application provides a method, apparatus, device, storage medium, and product for loading resources in a mini-program, in order to solve the problem that resource loading in the prior art is completely lagging behind user operation, which easily leads to page loading delays or even lag, directly affecting the user experience and operation smoothness.
[0005] To achieve the above objectives, embodiments of this application provide a method for loading resources in a mini-program, including: Based on the mini-program page currently accessed by the user, predict the set of mini-program pages the user will access next; Based on the first page information of the next mini-program page, calculate the first page score of each next mini-program page in the set of next mini-program pages; wherein, the first page information includes: page access frequency, page access popularity, user page preference and user device performance; Based on the first page rating, the most likely next mini-program page to be accessed is selected from the set of next mini-program pages as the target mini-program page; Load the resources of the target mini-program page.
[0006] As an improvement to the above solution, the step of predicting the set of next mini-program pages to be visited by the user based on the currently visited mini-program page includes: A scenario decision tree is constructed using the decision tree algorithm based on the user's historical access data; wherein, each node in the scenario decision tree includes page segmentation information; Using the scenario decision tree, the probability of the user accessing each subsequent mini-program page is obtained based on the current access time and the position of the mini-program page; wherein, the nodes of the scenario decision tree are each page in the mini-program; Based on the probabilities, select the multiple next mini-program pages with the highest probabilities to form the next mini-program page set.
[0007] As an improvement to the above solution, the page access frequency is determined based on the number of page visits; The page access popularity is determined by the number of visits to the page during the current access time period; The user page preference is determined based on at least one of page dwell time, page interaction frequency, and page favorites. The performance of the user equipment is determined based on at least one of page resource usage, page CPU utilization, and page memory utilization.
[0008] As an improvement to the above solution, loading the resources of the target mini-program page includes: Load the resources of the target mini-program page from the preset storage space; The preset storage space caches resources based on resource information, which includes at least one of the following: resource access frequency, resource update cycle, resource loading cost, and resource business importance.
[0009] As an improvement to the above solution, the preset storage space includes a first-layer storage space, a second-layer storage space, and a third-layer storage space; The preset storage space caches resources according to at least one of the following: Calculate the resource score based on the resource information; Based on the resource rating, the resources to be cached are stored in the corresponding storage space of the preset storage space.
[0010] As an improvement to the above solution, the resource access frequency is determined based on the number of resource accesses; The resource update cycle is determined based on the duration during which the resource has not been updated. The resource loading cost is determined based on the resource size and the resource loading time. The importance of a resource is determined by the criticality of the business corresponding to that resource.
[0011] As an improvement to the above solution, the importance of the resource business is obtained through the following steps: Determine the business logic corresponding to the resource to be cached; The importance of the resource business is determined based on the role-based score of the business.
[0012] As an improvement to the above solution, the step of obtaining the resource business importance based on the role-based scoring of the business includes: The basic score of the role is adjusted according to the preset business weight or business conversion contribution, and the adjusted basic score of the role is used as the importance of the resource business.
[0013] As an improvement to the above solution, the method further includes: Predict the access probability of cached resources within the preset storage space; Based on the access probability, perform soft or hard deletion on the cached resources in the preset storage space.
[0014] As an improvement to the above solution, the method further includes: If loading the resources of the target mini-program page from the preset storage space fails, the resources of the target mini-program page are loaded from the network layer.
[0015] As an improvement to the above scheme, the network layer includes a central content distribution network layer, an edge node layer, and a peer-to-peer network layer; wherein, the resources of the target mini-program page are distributed by the server to the corresponding layer in the network layer according to the user's location and network conditions.
[0016] As an improvement to the above solution, the method further includes: The page dependencies of a mini-program are represented as a weighted directed graph; where nodes represent pages, and the weights of edges are obtained from the frequency of page jumps and page dependencies. The weighted directed graph is divided into multiple communities using a community detection algorithm. The page resources of each community are distributed as a resource package to the network layer.
[0017] As an improvement to the above solution, the method further includes: The multiple communities are adjusted according to preset constraints.
[0018] As an improvement to the above solution, the method further includes: Collect information from the second page of the mini-program; the second page information includes: page access data, page user behavior data, page performance index data, and page resource loading data. Performance prediction is performed based on the information on the second page.
[0019] As an improvement to the above solution, the collection of information from the second page of the mini-program includes: Based on the information on the third page, calculate the second page score for each page of the mini-program; wherein, the third page information includes at least one of: operation frequency, business criticality, and performance impact; Based on the rating of the second page, the pages of the mini program are divided into different levels; Configure different sampling probabilities for different page levels, and collect information from the second page of the mini program based on the sampling probabilities.
[0020] As an improvement to the above scheme, the sampling probability is dynamically adjusted based on device performance, network conditions, and storage space.
[0021] As an improvement to the above solution, the operation frequency is determined based on the number of times the page is accessed; The criticality of a business is determined based on the basic role score of that business. The performance impact is determined by the memory increase and / or the time taken to load a page.
[0022] As an improvement to the above solution, the performance prediction based on the second page information includes: The information on the second page is cleaned and standardized; Feature engineering is performed on the cleaned and standardized second page information for different data types to obtain feature data; Cluster the feature data to obtain the clustering results; Performance prediction is performed based on the clustering results to obtain the performance prediction results.
[0023] As an improvement to the above solution, the method further includes: Based on the performance prediction results, adjust the resource loading strategy, resource caching strategy, or resource subpackaging strategy.
[0024] To achieve the above objectives, embodiments of this application also provide a mini-program resource loading device, including: The prediction module is used to predict the set of next mini-program pages that the user will visit based on the mini-program page that the user is currently visiting. The calculation module is used to calculate the first page score of each next mini-program page in the set of next mini-program pages based on the first page information of the next mini-program page; wherein, the first page information includes: page access frequency, page access popularity, user page preference and user device performance; The selection module is used to select the most likely next mini-program page to be accessed from the set of next mini-program pages as the target mini-program page based on the first page rating. The loading module is used to load the resources of the target mini-program page.
[0025] As an improvement to the above solution, the step of predicting the set of next mini-program pages to be visited by the user based on the currently visited mini-program page includes: A scenario decision tree is constructed using the decision tree algorithm based on the user's historical access data; wherein, each node in the scenario decision tree includes page segmentation information; Using the scenario decision tree, the probability of the user accessing each subsequent mini-program page is obtained based on the current access time and the position of the mini-program page; wherein, the nodes of the scenario decision tree are each page in the mini-program; Based on the probabilities, select the multiple next mini-program pages with the highest probabilities to form the next mini-program page set.
[0026] As an improvement to the above solution, the page access frequency is determined based on the number of page visits; The page access popularity is determined by the number of visits to the page during the current access time period; The user page preference is determined based on at least one of page dwell time, page interaction frequency, and page favorites. The performance of the user equipment is determined based on at least one of page resource usage, page CPU utilization, and page memory utilization.
[0027] To achieve the above objectives, this application also provides a mini-program resource loading device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the mini-program resource loading method as described above.
[0028] To achieve the above objectives, embodiments of this application also provide a computer-readable storage medium, the computer-readable storage medium including a stored computer program; wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute the applet resource loading method described above.
[0029] To achieve the above objectives, embodiments of this application also provide a computer program product, including a computer program / instruction, which, when executed by a processor, implements the applet resource loading method described above.
[0030] Compared with existing technologies, the present application provides a method, apparatus, device, storage medium, and product for loading resources in a mini-program. This involves predicting the set of next mini-program pages a user will visit based on the currently accessed mini-program page; calculating a first page score for each next mini-program page in the set based on first page information; wherein the first page information includes: page access frequency, page access popularity, user page preference, and user device performance; selecting the most likely next mini-program page from the set as the target mini-program page based on the first page score; and loading the resources of the target mini-program page. Therefore, by predicting the most likely next mini-program page a user will visit as the target mini-program page when accessing a mini-program page, the present application can preload mini-program resources, effectively avoiding page loading delays or even lag, and improving the user experience and operational smoothness. Attached Figure Description
[0031] Figure 1 This is a flowchart of a method for loading resources in a mini-program, as provided in an embodiment of this application. Figure 2 This is a structural block diagram of a mini-program resource loading device provided in an embodiment of this application; Figure 3 This is a structural block diagram of a mini-program resource loading device provided in an embodiment of this application. Detailed Implementation
[0032] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0033] In the description of this application, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0034] In this application description, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0035] In this application description, the terms "first," "second," etc., are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus. The term "based on" means "at least partially based on." The term "according to" means "at least partially according to." The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments." The term "and / or" means at least one of the connected objects, such as A and / or B, indicating three cases: including only A, only B, and both A and B. Unless otherwise stated, the term "multiple" means two or more.
[0036] See Figure 1 , Figure 1 This is a flowchart of a method for loading resources in a mini-program according to an embodiment of this application. The method includes: S1. Based on the mini-program page currently accessed by the user, predict the set of mini-program pages the user will access next; In this embodiment of the application, when a user accesses a mini-program, the mini-program page that may be accessed next is predicted based on the currently accessed mini-program page, and this is referred to as the next mini-program page. These next mini-program pages form a set of next mini-program pages; that is, the set of next mini-program pages includes the next mini-program pages that the user may access.
[0037] S2. Calculate the first page score of each next mini-program page in the set of next mini-program pages based on the first page information of the next mini-program page; wherein, the first page information includes: page access frequency, page access popularity, user page preference and user device performance; This application embodiment scores the next mini-program page based on the first page information of the next mini-program page, and the resulting score is called the first page score. The first page information includes: page access frequency, page access popularity, user page preferences, and user device performance.
[0038] S3. Based on the first page rating, select the most likely next mini-program page from the set of next mini-program pages as the target mini-program page; In this embodiment of the application, the higher the first page rating of the next mini-program page, the more likely the user is to visit that next mini-program page. Based on the first page rating, the most likely next mini-program page to be visited is selected from the set of next mini-program pages as the target mini-program page for loading.
[0039] S4. Load the resources of the target mini-program page.
[0040] This application's embodiments predict the next mini-program page a user is most likely to visit when accessing a mini-program page, using this prediction as the target mini-program page for resource loading. This pre-loading of mini-program resources effectively avoids page loading delays or even lag, improving user experience and operational smoothness. Actual testing shows that this application's embodiments can accurately pre-load the most likely accessed page resources before the user actually visits the page, achieving a prediction accuracy of 92%, a 45% improvement over traditional pre-loading methods.
[0041] In one optional embodiment, predicting the set of next mini-program pages the user will visit based on the currently visited mini-program page includes: A scenario decision tree is constructed using the decision tree algorithm based on the user's historical access data; wherein, each node in the scenario decision tree includes page segmentation information; Using the scenario decision tree, the probability of the user accessing each subsequent mini-program page is obtained based on the current access time and the position of the mini-program page; wherein, the nodes of the scenario decision tree are each page in the mini-program; Based on the probabilities, select the multiple next mini-program pages with the highest probabilities to form the next mini-program page set.
[0042] This application's embodiments introduce a scenario prediction engine, constructing a scenario decision tree by analyzing users' historical access data. Each node includes page segmentation information; for example, the "browsing product details" scenario requires product display segments, review system segments, and shopping cart segments. When a user enters a mini-program page, the scenario decision tree, based on the current access time and the mini-program page's position, determines the probability of the user accessing each next mini-program page. The multiple next mini-program pages with the highest probabilities are then combined into a set of next mini-program pages. When a page transition occurs, the system completes scenario prediction and segmentation scheduling within 100ms and intelligently manages the loading, caching, and release of segments in the background through ServiceWorker. Frequently accessed segments are persistently stored using IndexedDB. Actual testing shows that this solution can control the first-screen loading time to within 300ms, reduce page transition latency to below 50ms, and reduce memory usage by 40% compared to traditional solutions. Historical access data includes: historical access time, the historical mini-program pages accessed at that time, and the corresponding set of actual next mini-program pages.
[0043] Furthermore, in this embodiment, the mini-program package is divided into three layers: core base package (framework, common components), functional sub-package (business modules), and resource sub-package (images, media). Each sub-package is pre-compiled and optimized using WebAssembly technology (using TinyGo tool and Go language to compile and generate was files, then using fetch to dynamically load them, using WebAssembly.instantiate to instantiate the wasm module, accessing the functions exported by wasm, and then executing the above steps concurrently through multiple threads to achieve concurrent function parameter / return value passing and complete module loading).
[0044] Alternatively, a pre-trained page prediction model can be used to predict the set of next mini-program pages visited by the user. For example, training samples can be obtained, including several historical mini-program pages visited by the user and the corresponding set of actual next mini-program pages. These training samples can be input into a machine learning model for training, resulting in a trained page prediction model. Then, inputting the position of the currently visited mini-program page into this trained page prediction model can output the set of next mini-program pages. The machine learning model can be any type of machine learning model, such as a convolutional neural network, and is not specifically limited here.
[0045] In one optional embodiment, the page access frequency is determined based on the number of page visits; The page access popularity is determined by the number of visits to the page during the current access time period; The user page preference is determined based on at least one of page dwell time, page interaction frequency, and page favorites. The performance of the user equipment is determined based on at least one of page resource usage, page CPU utilization, and page memory utilization.
[0046] The embodiments of this application do not limit the specific calculation method of the first page score. It is only necessary to combine the page access frequency, page access popularity, user page preference and user device performance to obtain the corresponding score. For example, the first page score can be obtained by normalizing each indicator in the first page information and then weighting and summing them.
[0047] In one specific embodiment, the first page score of the next mini-program page is obtained by weighting the information of the first page; for example, page access frequency (weight 30%), page access popularity (weight 25%), user page preference (weight 25%), and user device performance (weight 20%). First page score = (Page access frequency score × 30%) + (Page access frequency score × 25%) + (User page preference score × 25%) + (User device performance score × 20%). Specific calculation methods for each dimension are as follows: Page visit frequency score (F): F = (Number of page visits / Number of most visited pages) × 100; Page visit frequency score (H): H = (Number of page visits in the current visit time period / Highest number of page visits in that time period) × 100; User page preference score (P): P = (page dwell time percentage × 40% + page interaction frequency percentage × 30% + page collection status × 30%) × 100; Device performance score (D): D = (100 - Page resource usage percentage × 100 - Page CPU utilization × 30 - Page memory utilization × 30).
[0048] Suppose there are three next-stage mini-program pages that need to be evaluated: product details page (A), shopping cart page (B), and order list page (C).
[0049] First page rating for page A: Page visit frequency: 1000 times / 1200 times = 0.833; F = 0.833 × 100 = 83.3 points; where 1000 times is the number of page visits for page A; 1200 times is the highest number of page visits, which can be obtained from historical data; Page visit frequency: 150 times / 200 times = 0.75; H = 0.75 × 100 = 75 minutes; where 150 times is the number of visits to page A in the current access time period, and 200 times is the highest number of visits in this time period, which can be obtained through historical data; User page preferences: Page dwell time: 3 minutes / 5 minutes = 0.6; Number of page interactions: 8 times / 10 times = 0.8; Page favorites status: favorited (favorited = 1, not favorited = 0); P = (0.6 × 40% + 0.8 × 30% + 1 × 30%) × 100 = 78 minutes; Here, 3 minutes is the page dwell time of page A, which can be the average dwell time of the page within the statistics window; 5 minutes is the preset upper limit of dwell time, used for normalization; 8 times is the number of page interactions of page A, which can be the average number of interactions of the page within the preset statistics window; 10 times is the preset upper limit of the number of interactions, used for normalization; Device performance: Page resource usage: 2MB / 10MB = 0.2; Page CPU usage: 15%; Page memory usage: 10%; D = 100 - (20 + 4.5 + 3) = 72.5 points; Here, 2MB is the page resource size of page A; 10MB is the preset resource limit, used for normalization.
[0050] Page A's first page rating = 83.3 × 30% + 75 × 25% + 78 × 25% + 72.5 × 20% = 24.99 + 18.75 + 19.5 + 14.5 = 77.74 points.
[0051] Page B's first-page rating: The same calculation method as for Page A's first-page rating will not be repeated. F = 75 points; H = 65 points; P = 70 points; D = 80 points; Page B's first page rating = 75 × 30% + 65 × 25% + 70 × 25% + 80 × 20% = 22.5 + 16.25 + 17.5 + 16 = 72.25 points.
[0052] Page C's first-page rating: Calculated using the same method as Page A's first-page rating, so details will not be repeated. F = 60 points; H = 55 points; P = 65 points; D = 85 points; The first page rating for page C = 60 × 30% + 55 × 25% + 65 × 25% + 85 × 20% = 18 + 13.75 + 16.25 + 17 = 65 points.
[0053] The system will then prioritize preloading page A, which has the highest score, as it is most likely to be the user's next destination. This application's embodiment comprehensively considers multiple dimensions, employs a simple and intuitive calculation method, and provides results that are easy to compare and sort. The weights mentioned above can be adjusted according to actual needs.
[0054] In one optional embodiment, loading the resources of the target mini-program page includes: Load the resources of the target mini-program page from the preset storage space; The preset storage space caches resources based on resource information, which includes at least one of the following: resource access frequency, resource update cycle, resource loading cost, and resource business importance.
[0055] It is worth noting that, by caching resources in a preset storage space in advance, the resources of the target mini-program page can be loaded from the preset storage space in the future, which can further speed up the loading efficiency and reduce the server-side cost.
[0056] Moreover, the embodiments of this application do not blindly cache all resources, but rather cache valuable resources based on multi-dimensional screening, avoiding the storage of redundant content and indirectly optimizing the memory / storage usage of the mini-program.
[0057] In one optional embodiment, the preset storage space includes a first layer of storage space, a second layer of storage space, and a third layer of storage space; The preset storage space caches resources according to at least one of the following: Calculate the resource score based on the resource information; Based on the resource rating, the resources to be cached are stored in the corresponding storage space of the preset storage space.
[0058] This application adopts a three-layer caching architecture. The first layer of storage space serves as a memory cache layer, used to store hot data and frequently accessed small resources, with a capacity limit of 15% of the device's available memory. The second layer of storage space serves as a local storage layer. The third layer of storage space serves as a cloud cache layer, used for backing up and synchronizing important data. Furthermore, the second layer of storage space is specifically divided into a high-value area, a medium-value area, and a low-value area, for example, accounting for 30%, 50%, and 20% respectively.
[0059] Resource scoring is used to characterize the storage value of resources. Based on this score, resources to be cached are stored in the corresponding storage space within a preset storage area. This enables resource migration between different caching levels, minimizing storage space usage while ensuring cache hit rate, significantly improving the response speed and offline availability of mini-programs. For example, when the access frequency of a resource suddenly increases in a short period, the system will promote it to the first-level storage space; when a resource has not been accessed for a long time, it will be downgraded to the low-value area of the second-level storage space or directly deleted.
[0060] Specifically, the resource access frequency is determined based on the number of resource accesses; The resource update cycle is determined based on the duration during which the resource has not been updated. The resource loading cost is determined based on the resource size and the resource loading time. The importance of a resource is determined by the criticality of the business corresponding to that resource.
[0061] This application does not limit the specific calculation method of resource scores. It is sufficient to obtain corresponding scores based on resource access frequency, resource update cycle, resource loading cost, and resource business importance. For example, the resource score can be obtained by normalizing the various indicators of resource information and then summing them by weight.
[0062] In one specific embodiment, a resource score is obtained by weighting resource access frequency, resource update cycle, resource loading cost, and resource business importance; for example, resource access frequency (weight 35%), resource update cycle (weight 25%), resource loading cost (weight 20%), and resource business importance (weight 20%). Resource score = (Resource access frequency score × 35%) + (Resource update cycle score × 25%) + (Resource loading cost score × 20%) + (Resource business importance score × 20%). Specific calculation methods for each dimension are as follows: Resource access frequency score = Number of resource accesses / Preset resource access limit; The preset resource access limit is used for normalization. Resource update cycle score = Duration of resource not updated / Preset time limit; the preset time limit is used for normalization. Resource loading cost score = (Resource size / Preset resource size limit) × First weight + (Resource loading time / Preset loading time limit) × Second weight. The preset resource size limit and preset loading time limit are used for normalization.
[0063] Resource business importance score = business criticality of the associated business. This business criticality can be determined by the role's base score, preset business weight, and business conversion contribution. For example, you can directly use the role's base score of the associated business as the resource's business importance. Alternatively, you can adjust the role's base score based on preset business weight or business conversion contribution, and use the adjusted role's base score as the resource's business importance. See the explanation below. Of course, you can also obtain the resource business importance score for each resource by directly setting a mapping relationship between resources and resource business importance scores.
[0064] In an optional embodiment, the method further includes: Predict the access probability of cached resources within the preset storage space; Based on the access probability, perform soft or hard deletion on the cached resources in the preset storage space.
[0065] This application provides a "progressive cleanup" strategy: when the access probability is greater than a preset probability threshold, it indicates that the resource will be accessed. For resources predicted to be accessed, a "soft deletion" method is used, specifically deleting only the resource entity while retaining its metadata. When the access probability is less than or equal to the preset probability threshold, it indicates that the resource will not be accessed. For resources predicted to be no longer needed, a "hard deletion" method is used, specifically completely clearing related data. Actual testing shows that this application improves the cache hit rate to 95% and increases storage space utilization by 40%.
[0066] In an optional embodiment, the method further includes: If loading the resources of the target mini-program page from the preset storage space fails, the resources of the target mini-program page are loaded from the network layer.
[0067] It is worth noting that if the target mini-program page is not cached in the preset storage space, the preloading of the target mini-program page's resources from the preset storage space will fail. In this case, the client can preload from the network layer, which improves the reliability of resource loading and avoids page loading failure due to pre-caching issues.
[0068] In one optional embodiment, the network layer includes a central content distribution network layer, an edge node layer, and a peer-to-peer network layer; wherein, the resources of the target mini-program page are distributed by the server to the corresponding layers in the network layer according to the user's location and network conditions.
[0069] In this embodiment, the server distributes the resources of the target mini-program page to a matching network layer based on the user's geographical location information and real-time network status. This allows the client to load the resources of the target mini-program page from the matching network layer, selecting the optimal resource acquisition path for the user. For example, under high load conditions, dynamic scheduling and load balancing of nearby nodes ensure rapid resource distribution. Especially in weak network environments, it ensures rapid resource loading, increasing the resource distribution success rate to 99.9% and reducing the average response time by 70%.
[0070] Specifically, a three-layer network architecture is implemented: a central content delivery network (CDN) layer, an edge node layer, and a peer-to-peer (P2P) network layer. By analyzing user location and network conditions in real time, the system dynamically adjusts the resource allocation ratio across each layer. For example, when a surge in requests is detected in a certain region, the system automatically preheats relevant resources on edge nodes in that region and initiates a WebRTC-based P2P distribution mechanism, effectively reducing the load on the central node. Real-world testing shows that this distribution architecture can handle three times more concurrent requests than traditional CDNs during peak periods, while reducing resource access latency by 60%.
[0071] In an optional embodiment, the method further includes: The page dependencies of a mini-program are represented as a weighted directed graph; where nodes represent pages, and the weights of edges are obtained from the frequency of page jumps and page dependencies. The weighted directed graph is divided into multiple communities using a community detection algorithm. The page resources of each community are distributed as a resource package to the network layer.
[0072] This application embodiment represents the page dependency relationship of a mini-program as a weighted directed graph; where nodes represent pages, and the weights of edges are obtained from the page jump frequency and page dependency relationship. Then, a community detection algorithm is used to divide the weighted directed graph into communities, resulting in multiple communities. Each community includes multiple pages, and each community is treated as a resource package for the aforementioned resource distribution.
[0073] Specifically, page dependencies include at least one of the following: navigation / jump dependencies, business process dependencies, resource / component dependencies, and path association dependencies.
[0074] Navigation / Jump Dependency: If page A has a "Jump to page B" button, link, or automatic redirection logic, then in the weighted directed graph there will be a directed edge from A to B: A → B.
[0075] This type of dependency means that in order to access B, a user usually needs to reach A first or be redirected via A. Therefore, there is a navigational order between A and B in the access path.
[0076] Business process dependencies (sequence / preconditions): Although some pages may not be directly linked by click, there are pre- and post-constraints in the business process. For example: You must complete the "Login Page / Authentication Page" before you can access the "Asset Overview Page"; You must first go through the "Order Form" page before you can proceed to the "Order Confirmation / Payment" page.
[0077] In this case, logically directed edges can also be established in the weighted directed graph, such as login page → asset overview page, order page → payment page, indicating that subsequent pages depend on the completion of the preceding pages in terms of business logic.
[0078] Resource / component dependency (shared resource relationship): Two pages may not have a direct jump relationship, but they share a batch of key resources or components, such as sharing the same business module, the same rendering script, or the same resource package.
[0079] In order to group highly related pages with many shared resources into the same community or subpackage during subpackaging and preloading, the system will also map such resource-level dependencies into a weighted directed graph and reflect them in a weighted manner.
[0080] For example: Page A and Page B share 80% of the resource package; an edge "A" can be added to the diagram. "B" or a higher weight on the same undirected edge indicates that they are highly coupled at the resource level.
[0081] Path association (high-frequency co-occurrence relationship): Even if there is no explicit "direct jump" in the product design, the system can discover the user's high-frequency access paths through historical access logs: A large number of sessions show an access sequence of "A → B → C"; Or, a user may frequently switch back and forth between A and B within a session.
[0082] These high-frequency co-occurrences are also abstracted into dependency edges, with the weight of the edge related to the frequency of page jumps, to support subsequent community discovery.
[0083] In other words, the page dependency relationships include navigation and navigation relationships between pages, business process pre- and post-process relationships, shared resource relationships, and high-frequency co-occurrence relationships obtained from historical access logs, which are used to characterize the strength of association between pages in terms of access paths and resource usage.
[0084] In an optional embodiment, the method further includes: The multiple communities are adjusted according to preset constraints.
[0085] This application embodiment adjusts multiple communities by setting preset constraints, so that package size, loading time, network consumption, etc. meet the preset constraints. Actual tests show that resource loading efficiency is improved by 60% and cold start time is reduced by 50%.
[0086] In an optional embodiment, the method further includes: Collect information from the second page of the mini-program; the second page information includes: page access data, page user behavior data, page performance index data, and page resource loading data. Performance prediction is performed based on the information on the second page.
[0087] It is worth noting that this embodiment of the application performs performance prediction by collecting information from the second page of the mini-program. The second page information includes: page access data, page user behavior data, page performance metric data, and page resource loading data. Specifically, page access data includes: page load time, dwell time, page access path and source, page navigation relationships, and page load success rate; user behavior data includes: clicks, swipes, and other interactive behaviors; form input and submission, key button clicks, and page scroll depth. Performance metrics data includes: first screen load time, JavaScript execution time, memory usage, and frame rate (FPS); resource loading data includes: resource loading time, loading success rate, resource size statistics, and cache hit rate.
[0088] In one optional embodiment, the collection of the second page information of the mini-program includes: Based on the information on the third page, calculate the second page score for each page of the mini-program; wherein, the third page information includes at least one of: operation frequency, business criticality, and performance impact; Based on the rating of the second page, the pages of the mini program are divided into different levels; Configure different sampling probabilities for different page levels, and collect information from the second page of the mini program based on the sampling probabilities.
[0089] This application embodiment calculates the score of each page of the mini-program using third-page information, which serves as the second-page score. The mini-program pages are divided into different levels, and different sampling probabilities are configured for each level. Data is collected based on these sampling probabilities, ensuring that the most valuable data is collected with limited resources. The sampling probability of a particular page in the mini-program refers to the probability of whether or not to collect the second-page information for that page.
[0090] Specifically, the operation frequency is determined by the number of times the page is accessed; the business criticality is determined by the basic score of the business role; and the performance impact is determined by the memory increase and / or time consumption caused by loading the page. Here, the operation frequency, business criticality, and performance impact are categorized into scores of 0 to 10 and then weighted to obtain the second page score. This application does not limit the specific calculation method of the second page score; it only needs to combine the operation frequency, business criticality, and performance impact to obtain the corresponding score. For example, the second page score can be obtained by normalizing or standardizing each indicator and then weighting and summing them.
[0091] Furthermore, the basic role score can be adjusted based on preset business weights or business conversion contributions, and the adjusted basic role score can be used as the business criticality.
[0092] For example, business criticality can be obtained through the following steps: Business role-based basic scoring: Each page's role in the business process is predefined and declared by the product / development team in the configuration, for example: Core closed-loop pages such as transaction / payment submission page, order confirmation page, and fund operation page: base score 10 points; Key intermediate pages in the order placement process (such as the address page and the discount selection page): Base score 8 points; Important information display pages (such as order list, asset overview, message center): base score 7 points; General function page or auxiliary tool page: base score 5 points; Marketing campaign pages, low-frequency operation pages, etc.: base score 3 points; Pure display or secondary traffic-driving page: 1 point.
[0093] Preset Business Weights: Allows developers to set business weight tags for pages. A weighted coefficient is applied based on the role's base score. Second label: Business criticality = Basic role score × 1.2 (not exceeding 10 points); First Tag: Business Criticality = Role Base Score × 1.0; Third label: Business criticality = Role base score × 0.8.
[0094] This approach allows developers to reflect their subjective judgment of the business while ensuring a unified and computable set of rules.
[0095] Fine-tuning based on business conversion contribution: The system can periodically obtain the "contribution" or "relevance" of a page to core business metrics (such as order conversion rate and payment success rate) from the data aggregation and analysis module. This information can be used to make minor adjustments to the business criticality, for example: If the order conversion rate in a session involving a certain page is significantly higher than the average level, the business criticality score will be increased within the range of 0 to 1. If a page rarely appears in the successful conversion path, then the business criticality score should be lowered within the range of 0 to 1.
[0096] Even after fine-tuning, the business criticality score remains between 0 and 10.
[0097] In one alternative embodiment, the sampling probability is dynamically adjusted based on device performance, network conditions, and storage space.
[0098] The embodiments of this application dynamically adjust the sampling probability based on device performance, network conditions, and storage space, ensuring that the impact of the data collection process on the performance of the mini-program is minimized.
[0099] In one specific embodiment, the pages of the mini-program are divided into four levels: Level 1 (Core Layer): A collection of pages with a second-page rating of ≥8.5; Second level (importance level): A collection of pages with a second-page rating of 6.5 to 8.4; Level 3 (Normal Level): A collection of pages with a second-page rating of 4.5 to 6.4; Level 4 (Basic Tier): A collection of pages with a second page rating of <4.5.
[0100] Correspondingly, the sampling probability is set to 100% for the first level, meaning that the second page information of the page will be collected every time a page belonging to the first level is accessed.
[0101] Setting the sampling probability to 50% for the second level means that each time a page belonging to the second level is accessed, there is a 50% probability that the second page information of that page will be collected. In other words, access to the second level page is sampled with a 50% probability, and the selected session will have its second page information collected.
[0102] Setting the sampling probability to 25% for the third level means that each time a page belonging to the third level is accessed, there is a 25% probability of collecting the second page information of that page.
[0103] Setting the sampling probability to 10% for the fourth level means that each time a page belonging to the fourth level is accessed, there is a 10% probability of collecting the second page information of that page.
[0104] For example, when the device's CPU utilization exceeds 80%, the collection probability of pages other than the first level is reduced by 50%, that is: the second level is reduced to 25%, the third level to 12.5%, the fourth level to 5%, and the first level remains at 100%.
[0105] In an optional embodiment, the performance prediction based on the second page information includes: The information on the second page is cleaned and standardized; Feature engineering is performed on the cleaned and standardized second page information for different data types to obtain feature data; Cluster the feature data to obtain the clustering results; Performance prediction is performed based on the clustering results to obtain the performance prediction results.
[0106] It is worth noting that, in this embodiment of the application, after cleaning and standardizing the information on the second page, performing feature engineering and clustering, a clustering result is obtained for performance prediction, which can realize performance anomaly warning and ensure the stable operation of the mini program and a good user experience.
[0107] In one specific embodiment, the information on the second page is first cleaned and standardized, converting data from different sources into a unified format. Next, feature engineering is performed on the cleaned and standardized second page to obtain feature data. Then, the feature data is clustered to obtain clustering results. Experimental results show that the data analysis accuracy reaches 95%, and the processing latency is controlled within 100ms.
[0108] Furthermore, feature engineering can be performed based on data type. For example: For numerical data, calculate the mean, variance, and standard deviation: First, add all the data together to get the sum. Then, divide the sum by the number of data points to get the average. Next, calculate the difference between each data point and the mean, square these differences (removing the negative sign), and calculate the average of the squared differences to get the overall variance. Take the square root of the variance to get the standard deviation. The purpose of this method is to analyze the data distribution and identify outliers and irregularities. For coarse character types, pattern matching includes: repeating sequence detection, similar segment recognition, and regularity change detection. First, a window length k is set, and a sliding window extracts all substrings of length k, counting their occurrence positions. An empty dictionary `count_dict` is initialized to count the number of occurrences of each string. Each substring `s` and its index are traversed. If `s` is not in the dictionary, `count_dict[s] = [i]`. If `s` already exists, the current index `i` is appended to `count_dict[s]`. Substrings with an occurrence count greater than 1 are filtered out as repeating items. Finally, the repeating items of all string arrays are saved to a single number, resulting in a list of repeating sequences for all data. The position of each repeating sequence within each string is traversed, and it is determined whether all repeating positions are 0. If so, the pattern is prefix repetition; if all repeating positions are at the end, the pattern is end repetition.
[0109] For different time types, perform time series analysis, such as trend analysis (rising, falling, stable) and periodic analysis (daily, weekly, monthly cyclical patterns).
[0110] In an optional embodiment, the method further includes: Based on the performance prediction results, adjust the resource loading strategy, resource caching strategy, or resource subpackaging strategy.
[0111] Based on performance prediction results, this application adjusts resource loading strategies, resource caching strategies, or resource subpackaging strategies to achieve continuous performance improvement. For example, for resource loading strategies, the weights involved in the calculation of the first page's rating are adjusted; for resource caching strategies, the weights involved in the calculation of resource ratings are adjusted.
[0112] Specifically, a closed-loop optimization mechanism of "prediction-execution-feedback" is adopted, with a core performance prediction model based on LSTM (Long Short-Term Memory) networks. This model can predict potential performance bottlenecks in advance through clustering results. When a performance problem is predicted, the system automatically triggers corresponding optimization strategies, such as resource loading strategies, resource caching strategies, or resource partitioning strategies. Practice shows that this prediction-based optimization mechanism can prevent 90% of performance problems and reduce user-perceived performance issues by 75%.
[0113] See Figure 2 , Figure 2 This is a structural block diagram of a mini-program resource loading device 10 provided in an embodiment of this application. The mini-program resource loading device 10 includes: Prediction module 11 is used to predict the set of next mini-program pages that the user will visit based on the mini-program page that the user is currently visiting. The calculation module 12 is used to calculate the first page score of each next mini-program page in the set of next mini-program pages based on the first page information of the next mini-program page; wherein the first page information includes: page access frequency, page access popularity, user page preference and user device performance; Selection module 13 is used to select the most likely next mini-program page to be accessed from the set of next mini-program pages as the target mini-program page based on the first page score. Loading module 14 is used to load the resources of the target mini-program page.
[0114] Optionally, predicting the set of next mini-program pages the user will visit based on the currently visited mini-program page includes: A scenario decision tree is constructed using the decision tree algorithm based on the user's historical access data; wherein, each node in the scenario decision tree includes page segmentation information; Using the scenario decision tree, the probability of the user accessing each subsequent mini-program page is obtained based on the current access time and the position of the mini-program page; wherein, the nodes of the scenario decision tree are each page in the mini-program; Based on the probabilities, select the multiple next mini-program pages with the highest probabilities to form the next mini-program page set.
[0115] Optionally, the page access frequency is determined based on the number of page visits; The page access popularity is determined by the number of visits to the page during the current access time period; The user page preference is determined based on at least one of page dwell time, page interaction frequency, and page favorites. The performance of the user equipment is determined based on at least one of page resource usage, page CPU utilization, and page memory utilization.
[0116] Optionally, the resources for loading the target mini-program page include: Load the resources of the target mini-program page from the preset storage space; The preset storage space caches resources based on resource information, which includes at least one of the following: resource access frequency, resource update cycle, resource loading cost, and resource business importance.
[0117] Optionally, the preset storage space includes a first layer of storage space, a second layer of storage space, and a third layer of storage space; The preset storage space caches resources according to at least one of the following: Calculate the resource score based on the resource information; Based on the resource rating, the resources to be cached are stored in the corresponding storage space of the preset storage space.
[0118] Optionally, the resource access frequency is determined based on the number of resource accesses; The resource update cycle is determined based on the duration during which the resource has not been updated. The resource loading cost is determined based on the resource size and the resource loading time. The importance of a resource is determined by the criticality of the business corresponding to that resource.
[0119] Optionally, the resource business importance can be obtained through the following steps: Determine the business logic corresponding to the resource to be cached; The importance of the resource business is determined based on the role-based score of the business.
[0120] Optionally, obtaining the resource business importance based on the role-based scoring of the business includes: The basic score of the role is adjusted according to the preset business weight or business conversion contribution, and the adjusted basic score of the role is used as the importance of the resource business.
[0121] Optionally, the device further includes: The deletion module is used to predict the access probability of cached resources in the preset storage space; and to perform soft deletion or hard deletion of cached resources in the preset storage space according to the access probability.
[0122] Optionally, the loading module 14 is further configured to: If loading the resources of the target mini-program page from the preset storage space fails, the resources of the target mini-program page are loaded from the network layer.
[0123] Optionally, the network layer includes a central content distribution network layer, an edge node layer, and a peer-to-peer network layer; wherein, the resources of the target mini-program page are distributed by the server to the corresponding layer in the network layer according to the user's location and network conditions.
[0124] Optionally, the device further includes: The resource distribution module is used to represent the page dependencies of the mini-program as a weighted directed graph; where nodes represent pages, and the weight of the edges is obtained from the page jump frequency and page dependency relationship; using a community detection algorithm, the weighted directed graph is divided into communities to obtain multiple communities; the page resources of each community are distributed as a resource package to the network layer.
[0125] Optionally, the resource distribution module is further configured to: The multiple communities are adjusted according to preset constraints.
[0126] Optionally, the device further includes: The data collection module is used to collect information from the second page of the mini-program; the second page information includes: page access data, page user behavior data, page performance index data, and page resource loading data; and performance prediction is performed based on the second page information.
[0127] Optionally, the collection of the second page information of the mini-program includes: Based on the information on the third page, calculate the second page score for each page of the mini-program; wherein, the third page information includes at least one of: operation frequency, business criticality, and performance impact; Based on the rating of the second page, the pages of the mini program are divided into different levels; Configure different sampling probabilities for different page levels, and collect information from the second page of the mini program based on the sampling probabilities.
[0128] Optionally, the sampling probability is dynamically adjusted based on device performance, network conditions, and storage space.
[0129] Optionally, the operation frequency is determined based on the number of times the page is accessed; The criticality of a business is determined based on the basic role score of that business. The performance impact is determined by the memory increase and / or the time taken to load a page.
[0130] Optionally, the performance prediction based on the second page information includes: The information on the second page is cleaned and standardized; Feature engineering is performed on the cleaned and standardized second page information for different data types to obtain feature data; Cluster the feature data to obtain the clustering results; Performance prediction is performed based on the clustering results to obtain the performance prediction results.
[0131] Optionally, the device further includes: The adjustment module is used to adjust the resource loading strategy, resource caching strategy, or resource subpackaging strategy based on the performance prediction results.
[0132] It is worth noting that the working process of each module in the mini-program resource loading device 10 described in this application embodiment can refer to the working process of the mini-program resource loading method described in the above embodiment, and will not be repeated here.
[0133] This application provides a mini-program resource loading device 10 that predicts the set of next mini-program pages a user will visit based on the currently accessed mini-program page; calculates a first page score for each next mini-program page in the set based on first page information of the next mini-program page; wherein the first page information includes: page access frequency, page access popularity, user page preference, and user device performance; selects the most likely next mini-program page to be accessed from the set of next mini-program pages as the target mini-program page based on the first page score; and loads the resources of the target mini-program page. Therefore, this application embodiment, by predicting the most likely next mini-program page a user will visit as the target mini-program page for resource loading when the user visits a mini-program page, can preload mini-program resources, effectively avoiding page loading delays or even lag, and improving the user experience and operational smoothness.
[0134] Furthermore, this application also provides a computer-readable storage medium, which includes a stored computer program; wherein, when the computer program is running, it controls the device where the computer-readable storage medium is located to execute the applet resource loading method as described in any of the above embodiments.
[0135] Furthermore, this application also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the applet resource loading method as described in any of the above embodiments.
[0136] See Figure 3 , Figure 3 This is a structural block diagram of a mini-program resource loading device 20 provided in an embodiment of this application. The mini-program resource loading device 20 includes: a processor 21, a memory 22, and a computer program stored in the memory 22 and executable on the processor 21. When the processor 21 executes the computer program, it implements the steps in the above-described mini-program resource loading method embodiments. Alternatively, when the processor 21 executes the computer program, it implements the functions of each module / unit in the above-described device embodiments.
[0137] For example, the computer program may be divided into one or more modules / units, which are stored in the memory 22 and executed by the processor 21 to complete this application. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the applet resource loading device 20.
[0138] The mini-program resource loading device 20 may include, but is not limited to, a processor 21 and a memory 22. Those skilled in the art will understand that the schematic diagram is merely an example of the mini-program resource loading device 20 and does not constitute a limitation on the mini-program resource loading device 20. It may include more or fewer components than illustrated, or combine certain components, or different components. For example, the mini-program resource loading device 20 may also include input / output devices, network access devices, buses, etc.
[0139] The processor 21 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. The processor 21 is the control center of the mini-program resource loading device 20, connecting all parts of the mini-program resource loading device 20 via various interfaces and lines.
[0140] The memory 22 can be used to store the computer programs and / or modules. The processor 21 implements various functions of the applet resource loading device 20 by running or executing the computer programs and / or modules stored in the memory 22 and calling the data stored in the memory 22. The memory 22 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory 22 may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0141] If the modules / units integrated in the mini-program resource loading device 20 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by the processor 21, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.
[0142] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided in this application, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.
[0143] The above description is the preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications are also considered to be within the scope of protection of this application.
Claims
1. A method for loading applet resources, characterized in that, The method comprises: predicting a next applet page set visited by a user according to a current applet page visited by the user; calculating a first page score of each next applet page in the next applet page set according to first page information of the next applet page; wherein the first page information comprises page visit frequency, page visit heat, user page preference and user device performance; selecting a next applet page most likely to be visited from the next applet page set as a target applet page according to the first page score; loading resources of the target applet page.
2. The applet resource loading method of claim 1, wherein, The method of predicting the next applet page set visited by the user according to the current applet page visited by the user comprises: constructing a scene decision tree according to historical visit data of the user by using a decision tree algorithm; wherein each node in the scene decision tree comprises page shard information; obtaining probabilities of the user visiting each next applet page according to current visit time and a location of the applet page by using the scene decision tree; wherein nodes of the scene decision tree are each page in the applet; selecting a plurality of next applet pages with the highest probabilities to form the next applet page set according to the probabilities.
3. The applet resource loading method of claim 1, wherein, The page visit frequency is determined according to page visit times; The page visit heat is determined according to visit volume of the page in a current visit time period; The user page preference is determined according to at least one of page dwell time, page interaction times and page collection conditions; The user device performance is determined according to at least one of page resource occupation size, page CPU occupation rate and page memory occupation rate.
4. The applet resource loading method of claim 1, wherein, The method of loading resources of the target applet page comprises: loading resources of the target applet page from a preset storage space; wherein the preset storage space performs resource caching according to resource information, and the resource information comprises at least one of resource visit frequency, resource update period, resource loading cost and resource business importance for resource caching.
5. The applet resource loading method of claim 4, wherein, The preset storage space comprises a first layer storage space, a second layer storage space and a third layer storage space; The preset storage space performs resource caching according to at least one of the following: calculating a resource score according to the resource information; storing a to-be-cached resource into a corresponding storage space in the preset storage space according to the resource score.
6. The applet resource loading method of claim 5, wherein, The resource visit frequency is determined according to resource visit times; The resource update period is determined according to a resource non-update time length; The resource loading cost is determined according to resource size and resource loading time consumption; The resource business importance is determined according to business criticality corresponding to the resource.
7. The applet resource loading method of claim 6, wherein, The resource business importance is obtained by the following steps: determining a business corresponding to a to-be-cached resource; obtaining the resource business importance according to a role basic score of the business.
8. The applet resource loading method of claim 6, wherein, The method of obtaining the resource business importance according to the role basic score of the business comprises: adjusting the role basic score according to a preset business weight or business conversion contribution degree, and taking the adjusted role basic score as the resource business importance.
9. The applet resource loading method of claim 5, wherein, The method further comprises: predict an access probability of a cached resource in the preset storage space; perform soft deletion or hard deletion on the cached resource in the preset storage space according to the access probability.
10. The applet resource loading method of claim 4, wherein, The method further comprises: if loading the resource of the target mini-program page from the preset storage space fails, loading the resource of the target mini-program page from a network layer.
11. The applet resource loading method of claim 10, wherein, The network layer comprises a central content distribution network layer, an edge node layer, and a peer-to-peer network layer; wherein the resource of the target mini-program page is distributed to a corresponding layer in the network layer by a server according to user location and network condition.
12. The applet resource loading method of claim 10, wherein, The method further comprises: representing a page dependency relationship of a mini-program as a weighted directed graph; wherein a node represents a page, and a weight of an edge is obtained from page inter-transition frequency and page dependency relationship; performing community division on the weighted directed graph by using a community discovery algorithm to obtain a plurality of communities; taking a page resource of each community as a resource package for distribution to the network layer.
13. The applet resource loading method of claim 12, wherein, The method further comprises: adjusting the plurality of communities according to a preset constraint condition.
14. The applet resource loading method of claim 1, wherein, The method further comprises: collecting second page information of the mini-program; wherein the second page information comprises page access data, page user behavior data, page performance index data, and page resource loading data; performing performance prediction according to the second page information.
15. The applet resource loading method of claim 14, wherein, The collecting of the second page information of the mini-program comprises: calculating second page scores of each page of the mini-program according to third page information; wherein the third page information comprises at least one of operation frequency, business criticality, and performance impact; dividing each page of the mini-program into different levels according to the second page scores; configuring different sampling probabilities for pages of different levels, and collecting the second page information of the mini-program based on the sampling probabilities.
16. The applet resource loading method of claim 15, wherein, The sampling probability is dynamically adjusted according to device performance, network condition, and storage space.
17. The applet resource loading method of claim 15, wherein, The operation frequency is determined according to the number of times of entering a page; The business criticality is determined according to a role-based score of a business; The performance impact is determined according to memory growth caused by loading a page and / or time consumption caused by loading a page.
18. The applet resource loading method of claim 14, wherein, The performance prediction according to the second page information comprises: cleaning and standardizing the second page information; performing feature engineering on the cleaned and standardized second page information for different data types to obtain feature data; performing clustering on the feature data to obtain a clustering result; performing performance prediction according to the clustering result to obtain a performance prediction result.
19. The applet resource loading method of claim 18, wherein, The method further comprises: adjusting a resource loading strategy, a resource caching strategy, or a resource packaging strategy according to the performance prediction result.
20. An applet resource loading apparatus characterized by comprising: The method comprises: a prediction module configured to predict a next mini-program page set accessed by a user according to a current mini-program page accessed by the user; a calculation module configured to calculate first page scores of each next mini-program page in the next mini-program page set according to first page information of the next mini-program page; wherein the first page information comprises page access frequency, page access heat, user page preference, and user device performance. The selecting module is configured to select, according to the first page score, a next applet page most likely to be accessed from the set of next applet pages as a target applet page. The loading module is configured to load resources of the target applet page.
21. The applet resource loading apparatus of claim 20, wherein, The set of next applet pages accessed by the user is predicted according to the current applet page accessed by the user, and includes: A scenario decision tree is constructed according to historical access data of the user by using a decision tree algorithm, wherein each node in the scenario decision tree includes page shard information. The probability of the user accessing each next applet page is obtained according to the current access time and the location of the applet page by using the scenario decision tree, wherein the nodes of the scenario decision tree are each page in the applet According to the probability, a plurality of next applet pages with the highest probability are selected to form the set of next applet pages.
22. The applet resource loading apparatus of claim 20, wherein, The page access frequency is determined according to the number of page accesses. The page access heat is determined according to the number of accesses of the page in the current access time period. The user page preference is determined according to at least one of the following: page dwell time, page interaction times, and page collection status. The user device performance is determined according to at least one of the following: page resource size, page CPU occupancy, and page memory occupancy.
23. An applet resource loading apparatus characterized by comprising: The computer readable storage medium includes a stored computer program; wherein the computer program, when running, controls the device where the computer readable storage medium is located to perform the applet resource loading method according to any one of claims 1-19.
24. A computer-readable storage medium, characterized in that, The computer readable storage medium includes a stored computer program; wherein the computer program, when running, controls the device where the computer readable storage medium is located to perform the applet resource loading method according to any one of claims 1-19.
25. A computer program product, characterised in that, The computer readable storage medium includes a stored computer program; wherein the computer program, when running, controls the device where the computer readable storage medium is located to perform the applet resource loading method according to any one of claims 1-19.