Method and device for preloading resources in H5 application
By building the H5 page jump relationship diagram and preloading the target page resources, the problem of slow loading speed of H5 applications is solved, and more efficient page rendering and loading performance is achieved, improving user experience.
Patent Information
- Application Number
- CN202411042928.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-12-03
AI Technical Summary
The H5 application has problems such as slow loading speed, lag, and untimely response, which has affected the user experience. Although the existing technologies such as compression and merging, lazy loading, CDN acceleration, cache, etc. have improved, there are still problems with slow loading speed. .
By constructing an H5 page jump relationship diagram based on user trajectory data, we know in advance the target page and its dependencies and preload it to improve page rendering efficiency.
Improve page loading performance, ensure fast rendering and loading efficiency of target pages, avoid resource waste, and improve user experience.
Smart Images

Figure CN119066282A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of H5 application technology, and in particular to a method and device for preloading resources in an H5 application. Background Art
[0002] With the rapid development of internet technology, HTML5 (H5) applications have gradually become an integral part of the mobile internet. H5 applications have gained widespread adoption due to their cross-platform nature, high development efficiency, and easy updates and maintenance. However, as users' expectations for application experience increase, H5 applications are experiencing loading performance issues. These issues, such as slow loading speeds, lags, and unresponsiveness, are severely impacting the user experience. Therefore, improving the loading performance of H5 applications has become a key research and development topic.
[0003] At present, technical personnel have performed compression merging, lazy loading, CDN acceleration, caching and other operations on H5 resources. Although the above technologies have improved the loading performance of H5 applications to a certain extent, in actual applications, the rendering of the page to be entered still needs to wait for the download and execution of resources. The loading of H5 pages still has the problem of slow loading speed. Summary of the Invention
[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the present application provides a method and device for preloading resources in H5 applications.
[0005] In a first aspect, the present application provides a method for preloading resources in an H5 application, which is applied to a management platform. The method includes:
[0006] Build a jump relationship diagram between H5 pages based on the trajectory data of multiple users when using H5 applications;
[0007] The jump relationship graph is sent to the H5 application, so that the H5 application determines the target page to which the current H5 page is to jump according to the jump relationship graph, and loads the target resources required by the target page according to the resources that each H5 page in the jump relationship graph depends on, wherein the target page includes at least one H5 page.
[0008] Optionally, constructing a jump relationship diagram between H5 pages based on the trajectory data of multiple users when using the H5 application includes:
[0009] Determine trajectory data of multiple users using the H5 application based on user traffic of the H5 application within a set historical period;
[0010] Selecting the first n H5 pages to be jumped to by each H5 page from the trajectory data according to the jump probability, and establishing a jump logic between the H5 page and the H5 page to be jumped to, where n is a positive integer;
[0011] Get the address of the resources that each H5 page depends on;
[0012] Based on each H5 page, the jump logic between H5 pages, and the addresses of the resources that the H5 pages depend on, a jump relationship diagram between H5 pages is constructed.
[0013] Optionally, the method further includes:
[0014] Load the pop-up window according to the specified operation in the current H5 page;
[0015] In the pop-up window, a setting page is selected as the preload page of the current H5 page, wherein the pop-up window includes a newly launched page and a historically loaded page.
[0016] Optionally, after constructing the jump relationship diagram between H5 pages, the method further includes:
[0017] According to the associated page publishing service, the address of the resource that the H5 page depends on in the jump relationship diagram is updated.
[0018] Optionally, after constructing the jump relationship diagram between H5 pages, the method further includes:
[0019] According to the operation for setting the H5 page in the jump relationship diagram, the address of at least one resource on which the setting H5 page depends is displayed.
[0020] In a second aspect, the present application provides a method for preloading resources in an H5 application, which is applied to the H5 application, and the method includes:
[0021] Obtaining a jump relationship graph between H5 pages sent by the management platform, wherein the jump relationship graph is constructed based on trajectory data of multiple users when using the H5 application;
[0022] Determine a target page to which the current H5 page is to jump according to the jump relationship graph, wherein the target page includes at least one H5 page;
[0023] According to the resources that each H5 page in the jump relationship diagram depends on, the target resources required by the target page are loaded.
[0024] Optionally, the target resources required to load the target page include:
[0025] When the current H5 page is idle, target resources required by the target page are loaded according to the lowest priority.
[0026] In a third aspect, the present application provides a system for preloading resources in an H5 application, the system comprising:
[0027] The management platform is used to build a jump relationship diagram between H5 pages based on the trajectory data of multiple users when using H5 applications;
[0028] An H5 application is connected to the management platform and is used to determine the target page to which the current H5 page is to jump based on the jump relationship diagram, and load the target resources required by the target page based on the resources that each H5 page in the jump relationship diagram depends on, wherein the target page includes at least one H5 page.
[0029] In a fourth aspect, the present application provides a device for preloading resources in an H5 application, which is applied to a management platform. The method includes:
[0030] A construction module is used to build a jump relationship diagram between H5 pages based on the trajectory data of multiple users when using H5 applications;
[0031] A sending module is used to send the jump relationship diagram to the H5 application, so that the H5 application determines the target page to which the current H5 page is to jump based on the jump relationship diagram, and loads the target resources required by the target page based on the resources that each H5 page in the jump relationship diagram depends on, wherein the target page includes at least one H5 page.
[0032] In a fifth aspect, the present application provides a device for preloading resources in an H5 application, which is applied to the H5 application. The method includes:
[0033] An acquisition module is used to acquire a jump relationship diagram between H5 pages sent by the management platform, wherein the jump relationship diagram is constructed based on the trajectory data of multiple users when using the H5 application;
[0034] A determination module, configured to determine a target page to which the current H5 page is to jump based on the jump relationship graph, wherein the target page includes at least one H5 page;
[0035] The loading module is used to load the target resources required by the target page according to the resources that each H5 page in the jump relationship diagram depends on.
[0036] In a sixth aspect, an electronic device is provided, comprising a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
[0037] Memory for storing computer programs;
[0038] The processor is configured to implement any of the above-mentioned steps of the method for preloading resources in an H5 application when executing a program stored in the memory.
[0039] In a seventh aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps for preloading resources in any of the H5 applications are implemented.
[0040] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art:
[0041] The method provided in the embodiment of the present application enables the H5 application to know in advance the target page to be jumped to from the current H5 page based on the jump relationship diagram, thereby improving the accuracy of target page prediction and preloading the resources that the target page depends on. In this way, when jumping from the current H5 page to the target page, the target page can be immediately rendered according to the pre-loaded resources, thereby improving the efficiency of target page rendering. The present application improves the loading performance of the page by improving the loading accuracy and loading efficiency of the page to be loaded. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0044] Figure 1 A schematic diagram of the hardware environment for a method of preloading resources in an H5 application provided in an embodiment of the present application;
[0045] Figure 2 This is a flowchart of a resource preloading method for an H5 application provided in an embodiment of the present application;
[0046] Figure 3 A schematic diagram of a jump relationship diagram provided in an embodiment of the present application;
[0047] Figure 4 This is a schematic diagram of a pop-up window in an embodiment of the present application;
[0048] Figure 5 A flowchart of resource preloading in an H5 application provided in an embodiment of the present application;
[0049] Figure 6A schematic diagram of the structure of a resource preloading device in an H5 application provided in an embodiment of the present application;
[0050] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0052] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of this application and have no specific meaning. Therefore, "module" and "component" can be used interchangeably.
[0053] In order to solve the problems mentioned in the background technology, according to one aspect of the embodiments of the present application, an embodiment of a method for preloading resources in an H5 application is provided.
[0054] Optionally, in an embodiment of the present application, the resource preloading method in the H5 application can be applied to Figure 1 The hardware environment shown is composed of H5 application 101 and management platform 103. Figure 1 As shown, the management platform 103 is connected to the H5 application 101 through the network and can be used to provide services for the H5 application 101. A database 105 can be set on the management platform or independently of the management platform to provide data storage services for the management platform 103. The above-mentioned network includes but is not limited to: wide area network, metropolitan area network or local area network, and the terminal 101 includes but is not limited to light application, Web App, micro site, website, etc.
[0055] In an embodiment of the present application, a method for preloading resources in an H5 application can be executed by a management platform or by an H5 application. The present application embodiment takes application to a management platform as an example to describe the present solution. Figure 2 The specific steps are as follows:
[0056] Step 201: Construct a jump relationship diagram between H5 pages based on the trajectory data of multiple users when using the H5 application.
[0057] Step 202: Send the jump relationship graph to the H5 application, so that the H5 application determines the target page to which the current H5 page is to jump based on the jump relationship graph, and loads the target resources required by the target page based on the resources that each H5 page in the jump relationship graph depends on, wherein the target page includes at least one H5 page.
[0058] H5 refers to the fifth generation of HTML (Hypertext Markup Language), and also refers to all digital products made with the H5 language. H5 is widely used. There are many product carriers based on H5, such as PPT, APP, light application, Web App, micro site, website (including PC and mobile), responsive website, etc. H5 pages can be disseminated separately, that is, H5 posters, and can also be embedded in official accounts, APPs, mini-programs, etc. This form can not only be displayed on the WeChat side, but as a page, it can also be opened on the PC side after obtaining the link.
[0059] When multiple users use H5 applications, a large amount of trajectory data is generated. The trajectory data includes the time period during which each user uses the H5 application and the trajectory path of the H5 page. For example, the trajectory path of a user using the H5 page may be: upgrade blessing page - VIP growth level benefits - VIP growth benefits FAQ, or: withdrawal page - Platinum member benefits introduction page - Star Diamond benefits upgrade promotion page.
[0060] After obtaining the trajectory data from the data source, the management platform constructs a jump relationship graph between H5 pages based on user traffic and trajectory paths. The jump relationship graph here includes some H5 pages with higher jump probabilities and discards a large number of H5 pages with low jump probabilities. That is, the jump relationship graph is the streamlined trajectory data. The management platform sends the jump relationship graph to the H5 application.
[0061] The management platform sends the jump relationship diagram to the H5 application. CDN (Content Delivery Network) or other networks can be used. CDN can avoid bottlenecks and links on the Internet that may affect data transmission speed and stability as much as possible, making content transmission faster and more stable.
[0062] The H5 application detects the current H5 page in the interface and then, based on the jump logic in the jump relationship diagram, determines the target page that the current H5 page may jump to. The target page includes at least one H5 page. The jump relationship diagram also includes the resources that each H5 page depends on. Therefore, when jumping to the target page, the rendering of the target page requires loading the corresponding resources, which takes time. Therefore, the resources of the target page can be pre-loaded when the user is on the current H5 page. This way, the user does not need to download resources when entering the target page, improving page loading performance.
[0063] The resources that page rendering depends on include but are not limited to: cript scripts and CSS style files.
[0064] For example, if the user is currently on page A and the jump logic in the jump relationship diagram is that page A jumps to page B, page C, and page D, then the H5 application will preload the resources required for page B, page C, and page D respectively. In this way, no matter which page the user instructs to jump to, the page can be rendered in time.
[0065] In this application, the H5 application knows in advance the target page that will be jumped to from the current H5 page based on the jump relationship diagram, improves the accuracy of the target page prediction, and preloads the resources that the target page depends on. In this way, when jumping from the current H5 page to the target page, the target page can be immediately rendered according to the pre-loaded resources, thereby improving the efficiency of the target page rendering. This application improves the loading performance of the page by improving the loading accuracy and loading efficiency of the page to be loaded.
[0066] In addition, by predicting the target page to be jumped to based on the trajectory data, resources can be preloaded accurately, unlike other preloading methods, which will not load a large amount of useless resources and avoid wasting network resources.
[0067] This application accurately perceives user behavior trajectories, thereby preloading resources required for the page and improving user experience.
[0068] As an optional implementation, constructing a jump relationship graph between H5 pages based on the trajectory data of multiple users when using the H5 application includes: determining the trajectory data of multiple users when using the H5 application based on the user traffic of the H5 application within a set historical period; selecting the first n H5 pages to be jumped to by each H5 page from the trajectory data according to the jump probability, and establishing a jump logic between the H5 page and the H5 page to be jumped to, where n is a positive integer; obtaining the address of the resource on which each H5 page depends; and constructing a jump relationship graph between H5 pages based on each H5 page, the jump logic between H5 pages, and the address of the resource on which the H5 page depends.
[0069] In an embodiment of the present application, it is first necessary to collect traffic data of all users in the H5 application within a set historical period. This data includes the sequence of pages visited by users, residence time, click events, etc. Through this data, the trajectory data of users when using the H5 application can be determined, that is, the complete path of users jumping from one page to another.
[0070] Next, based on the collected trajectory data, we analyze the probability of each page jumping to other pages. This involves counting the frequency of users jumping to various possible pages next when each page is used as the starting point. Based on these frequencies, we can calculate the jump probability, that is, the probability of jumping from the current page to a specific page.
[0071] For each H5 page, the top n target pages with the highest jump probability are selected from the trajectory data based on the jump probability. Here, n is a preset positive integer value, which determines that each page can have a maximum of n direct jump target pages. This step ensures the simplicity and readability of the jump relationship diagram while preserving the most important jump paths. After determining the top n jump pages for each page, the jump logic between pages can be established. This logic defines which pages a user can jump to from a page and the probability or priority of such jumps.
[0072] Each H5 page may depend on some external resources, such as CSS files, JavaScript scripts, images, or other media files. These resources are crucial for the normal display and functionality of the page. Therefore, it is necessary to obtain the addresses of the resources that each page depends on so that this information can be included in the jump relationship diagram.
[0073] With the jump logic and resource dependency information between pages, we can build a jump relationship graph between H5 pages. The jump relationship graph is a directed graph, in which nodes represent H5 pages and edges represent jump relationships between pages. The nodes can list the resource addresses that the corresponding H5 pages depend on.
[0074] Specifically, user trajectory data is always occurring. If all historical trajectory data is used to construct a jump relationship graph, the construction process will be extremely complex and time-consuming. Therefore, the trajectory data can be determined by the user traffic within a set historical period. For example, if the historical period is set to 24 hours, the user's trajectory data is determined by the traffic within the past 24 hours. This not only reduces the amount of trajectory data and improves the efficiency of constructing the jump relationship graph, but also avoids blindly wasting a large amount of user traffic. In addition, the jump relationship graph is constructed based on the latest trajectory data, which also improves the accuracy of the jump relationship graph.
[0075] In the trajectory data of all users, the H5 pages involved in the trajectory data of different users are not exactly the same. Even for the same H5 page, the next H5 page that different users want to jump to is not exactly the same. Therefore, if the trajectory data of all users are aggregated, each H5 page may jump to a different next H5 page, and each next H5 page jumped to has a corresponding jump number.
[0076] To optimize the trajectory data, we can select the top n H5 pages to which each H5 page should redirect. These top n H5 pages can be a predetermined number of pages or determined based on a ratio of the number of pages that can be redirected. For example, we can select the pages with the top 10 redirect probabilities as the redirected pages. After determining the top n H5 pages to which each H5 page should redirect, we can establish redirection logic between that H5 page and the top n H5 pages. Subsequent page redirection can be performed directly based on this redirection logic.
[0077] In addition, the rendering of each H5 page relies on dependent resources. The address of the resources that the H5 page depends on can be directly set in the jump relationship diagram. After the target page is determined according to the jump relationship diagram, the target resource can be rendered directly according to the address of the resource that the target page depends on.
[0078] In this way, the jump relationship graph is constructed. The jump relationship graph includes multiple H5 pages, the jump logic between H5 pages, and the addresses of the resources that each H5 page depends on. Subsequently, the target page to be jumped to can be determined based on the current H5 page and jump logic in the interface, and the resources can be pre-loaded according to the addresses of the resources that the target page depends on. In this way, the target page can be rendered in time when jumping to the target page, thereby improving page loading performance.
[0079] Figure 3 This is a schematic diagram of the jump relationship diagram. The arrows in the figure indicate the jump logic between H5 pages. The figure does not indicate the addresses of dependent resources.
[0080] As an optional implementation, the method also includes: loading a pop-up window according to a specified operation in the current H5 page; selecting a setting page in the pop-up window as a preloaded page for the current H5 page, wherein the pop-up window includes a newly launched page and a historically loaded page.
[0081] In the embodiment of the present application, in addition to using a jump relationship diagram to determine the preloaded page, a customized method can also be used to determine the preloaded page. Specifically, when a user clicks the "Customized Load" button on the current H5 page, a pop-up window will load the current H5 page. The pop-up window includes multiple H5 pages for the user to select as the next H5 page to be preloaded. The H5 pages for the user to select include newly launched pages and historically loaded pages.
[0082] Newly launched H5 pages often don't appear in the list of the top n preloaded pages based on automatic analysis due to a lack of sufficient traffic data. This can cause new pages to load slowly, impacting the user experience. To address this issue, the system provides a pop-up tool that allows users to manually specify newly launched pages as preloaded resources for certain H5 pages. This ensures that resources are loaded promptly, even if the new page hasn't yet accumulated sufficient visit data. Once the user specifies a newly launched page as a preloaded page in the pop-up window, the system can directly preload the resources of these newly designated pages. This manual designation mechanism ensures that new content can be presented to users quickly, helping to enhance users' first impressions of newly launched content, thereby improving user satisfaction and retention.
[0083] In addition, some pages may fall out of the top n automatically preloaded pages due to content updates or changes in user behavior. These pages may still contain important content or functions and need to be loaded first. The system also allows users to set preloading for these historically loaded pages through pop-ups, which means that users can manually adjust the preloading pages for specific situations to ensure quick access to key content. In this way, when a user visits a specific page, the system will load the resources of these historical pages in advance according to the user's settings. In this way, it can ensure that those pages that are not frequently visited but are still important are properly loaded and optimized, thereby providing a more balanced and comprehensive user experience.
[0084] By introducing a mechanism for users to manually specify preloaded pages, the system can flexibly address situations that might be missed by automatic data analysis. Whether it's a newly launched page or a historically loaded page, user intervention can achieve the necessary performance optimizations. This approach not only improves the overall performance of the H5 application but also gives users greater control, making resource preloading strategies more tailored to actual needs and specific situations.
[0085] In addition, users can also delete pages that do not need to be preloaded in the pop-up window as needed. If a certain H5 page has a high probability of jumping to the top n pages, and the user does not want to load that page, they can delete it in the pop-up window. For example, the current trajectory data shows that page A is likely to go to pages B, C, D, and E, and the technicians are about to take page E offline. To prevent the resources of page E from being preloaded, the pop-up window can be used to delete the preload of page E.
[0086] Figure 4 This is a schematic diagram of a pop-up window in an embodiment of the present application. The pop-up window can realize custom loading and deletion of H5 pages. Figure 4There is a "Add Page" button in the middle, which can be used to add H5 pages. There is a "View Currently Preloaded Pages" button on the right, which can be used to view which H5 pages are currently preloaded.
[0087] This application can realize customized loading and deletion of H5 pages according to user needs by setting a customized loading method in the management platform. On the basis of using jump relationship diagram to realize automatic loading of pages, customized operations are also used to make the loading and deletion of pages meet user expectations, and achieve more refined management of business resources. This application can also improve user experience by controlling the number of loaded pages, loading specified pages and corresponding resources.
[0088] As an optional implementation, after constructing the jump relationship graph between H5 pages, the method further includes: updating the addresses of resources that the H5 pages depend on in the jump relationship graph according to the associated page publishing service.
[0089] In the development and operation of HTML5 applications, ensuring that each page can quickly and correctly load the resources it depends on is crucial. Page publishing services and management platforms play a core role in this process.
[0090] The Page Publishing Service is responsible for maintaining and storing the addresses of the resources that each H5 page relies on, including HTML files, CSS style sheets, JavaScript scripts, and image files. When page content is updated or resource addresses change, the Page Publishing Service updates these changes in real time, ensuring that all pages reference the latest resource addresses. The Page Publishing Service also provides interfaces that allow other systems and services to query the latest status and addresses of pages and their dependent resources, ensuring information consistency across the entire ecosystem.
[0091] The management platform is closely linked to the page publishing service. It uses the interface provided by the page publishing service to obtain the latest addresses of the resources that each H5 page relies on in real time. Using the latest resource addresses obtained from the page publishing service, the management platform promptly updates the jump relationship graph. This ensures that the jump relationship graph not only reflects the jump logic between pages, but also ensures that the resource addresses pointed to by each page are up to date. By updating the jump relationship graph in real time, the management platform improves the accuracy of page jumps. This means that when a user jumps from one page to another, the resources involved will be loaded based on the latest addresses, reducing loading errors or performance degradation caused by outdated resource addresses.
[0092] The close collaboration between the page publishing service and the management platform ensures that pages in H5 applications can accurately and quickly load the required resources. This mechanism not only enhances the user experience but also optimizes application performance and stability. By updating resource addresses and jump relationship graphs in real time, it effectively responds to dynamic content changes and ensures smooth application operation. This is particularly important for maintaining large, dynamically changing H5 applications, helping to improve user satisfaction and application maintenance efficiency.
[0093] When developing and maintaining HTML5 applications, it's crucial to understand the resources each page relies on. This not only helps optimize loading times but also ensures stable application operation. To this end, it's essential to provide an intuitive and easy-to-use interface that displays page resource information.
[0094] In addition, users can directly click on a node in the jump relationship diagram for an H5 page. This action will trigger the display of detailed information for the selected page. After the user clicks on a page node, the system will display the address of at least one resource that the H5 page depends on. These resources may include CSS files, JavaScript scripts, images, and other media resources. To facilitate user understanding and analysis, the address and type of the resource will be presented in a clear manner, such as in a list or chart format, which helps users quickly identify the key resources that the page depends on.
[0095] Users can also search for an H5 page by its name in the application management interface, making it easy to find and retrieve information about a specific page. The search results will provide a list of all resources used by the H5 page. Developers can use this information to confirm whether the pre-sense loading configuration is correct and whether the resources have been updated to the latest version. By viewing the resources a page depends on, developers can analyze page loading performance bottlenecks and optimize them accordingly, such as compressing resources or optimizing the order in which resources are loaded.
[0096] By clicking a page node in the jump relationship diagram or searching for the page name in the application management interface, users can easily obtain detailed information about the resources that the H5 page depends on. This feature not only improves transparency but also gives developers greater control to ensure the timely update and effectiveness of the predictive loading strategy. In addition, it is an important tool for performance optimization and troubleshooting, helping to improve the overall quality of the application.
[0097] As an optional implementation, loading the target resources required for the target page includes: when the current H5 page is idle, loading the target resources required for the target page according to the lowest priority.
[0098] Current H5 pages enter an idle state when there is little user interaction or when they are running in the background. During this time, the page has no urgent rendering or logic processing tasks, providing a huge optimization opportunity. During these idle periods, the system can arrange to load the resources required for the target page, but the loading of these resources is given the lowest priority, which means that they will not compete with the critical resources of the current page for bandwidth and processing time. Because this process is carried out discreetly when the page is idle, users will hardly notice the loading activity in the background, which ensures the smoothness of foreground operations is not affected, while quietly preparing for future jumps.
[0099] If a preloaded resource fails to load successfully, for example due to network fluctuations or server issues, this will not have any direct impact on the current business logic. The user can still browse and operate the current page normally. The system can also be configured with a retry mechanism to attempt to reload resources when loading fails, all of which is done without the user noticing. Once network conditions improve, the system will automatically resume the preloading process.
[0100] By setting the lowest priority for preloaded resources, the system ensures that these operations don't consume excessive resources, thereby not affecting the normal functionality and performance of the page. This strategy helps balance server and network loads, avoids resource contention during peak user periods, and improves the overall efficiency and stability of the system. By preloading the target page's resources at the lowest priority during idle periods, the upcoming content can be prepared in advance without affecting the user experience. This not only improves the responsiveness of page jumps, but also enhances the robustness and reliability of the application.
[0101] The resource preloading in the H5 application of this application includes the following parts:
[0102] 1. Data source: Build a jump relationship graph based on the user's trajectory data.
[0103] 2. Server: Provides programmable control services and updates the dependent resources and jump relationships of all pages in real time.
[0104] 3. Management backend: can operate programmatic dependency product applications and publish CDN in real time.
[0105] 4. Loader: responsible for loading page resources during idle time.
[0106] Based on the same technical concept, this application also provides a schematic diagram of the overall process of resource preloading in an H5 application, including the following steps.
[0107] Step 1: The management platform determines the trajectory data of multiple users when using the H5 application based on the user traffic of the H5 application within a set historical period.
[0108] Step 2: Select the first n H5 pages to be jumped to by each H5 page from the trajectory data, and establish the jump logic between the H5 page and the H5 page to be jumped to.
[0109] Step 3: Get the addresses of the resources that each H5 page depends on.
[0110] Step 4: Build a jump relationship diagram between H5 pages based on each H5 page, the jump logic between H5 pages, and the addresses of resources that the H5 pages depend on.
[0111] Step 5: The management platform sends the jump relationship diagram to the H5 application.
[0112] Step 6: The H5 application determines the target page to which the current H5 page will jump based on the jump relationship diagram.
[0113] Step 7: Load the target resources required by the target page based on the resources that each H5 page depends on in the jump relationship diagram.
[0114] Based on the same technical concept, the present application also provides a system for preloading resources in H5 applications. The system includes a management platform and an H5 application connected through a network. The management platform constructs a jump relationship graph between H5 pages based on the trajectory data of multiple users when using the H5 application; the H5 application determines the target page to which the current H5 page is to jump based on the jump relationship graph, and loads the target resources required for the target page based on the resources that each H5 page depends on in the jump relationship graph, wherein the target page includes at least one H5 page.
[0115] Figure 5 This application provides a flowchart of resource preloading in an H5 application, such as Figure 5 As shown, the data source first analyzes user traffic over the past 24 hours. This includes the number of times users visited each page in the H5 application, the duration of their visits, and the patterns of their transitions from one page to another. This data can be used to determine the transition relationships between pages A and G. Based on this analysis, user trajectory data is generated, which records the user's actual behavioral path within the H5 application, namely, the order and frequency of transitions from one page to another.
[0116] To more effectively utilize this data, the trajectory data is streamlined to extract key jump information. This information is then converted into a jump relationship graph, which displays the main jump paths between pages and their corresponding jump probabilities. The management platform is responsible for updating this jump relationship graph in real time. As user behavior changes and new data continues to emerge, the jump relationship graph needs to be dynamically adjusted to reflect the latest user behavior patterns. The updated jump relationship graph is sent to the H5 application loader via the content delivery network (CDN). After receiving the jump relationship graph, the H5 application loader uses the information in the graph to predict the target pages that the user may jump to. The loader then begins preloading the resources required for these target pages, including HTML files, CSS style sheets, JavaScript scripts, images, and other media files. By preloading these resources, when the user actually performs a jump operation, the required resources are already located locally or on a nearby CDN node, significantly reducing load time, improving page rendering speed, and improving the overall user experience.
[0117] Based on the same technical concept, the embodiment of the present application also provides a device for preloading resources in an H5 application, which is applied to a management platform, such as Figure 6 As shown, the device includes:
[0118] Construction module 601, for constructing a jump relationship diagram between H5 pages based on the trajectory data of multiple users when using the H5 application;
[0119] Sending module 602 is used to send the jump relationship graph to the H5 application, so that the H5 application determines the target page to which the current H5 page is to jump based on the jump relationship graph, and loads the target resources required by the target page based on the resources that each H5 page in the jump relationship graph depends on, wherein the target page includes at least one H5 page.
[0120] Optionally, the building block 601 is used to:
[0121] Determine the trajectory data of multiple users using the H5 application based on the user traffic of the H5 application within a set historical period;
[0122] Select the first n H5 pages to be jumped to by each H5 page from the trajectory data according to the jump probability, and establish the jump logic between the H5 page and the H5 page to be jumped to, where n is a positive integer;
[0123] Get the address of the resources that each H5 page depends on;
[0124] Based on each H5 page, the jump logic between H5 pages, and the addresses of the resources that the H5 pages depend on, a jump relationship diagram between H5 pages is constructed.
[0125] Optionally, the device is further used to:
[0126] Load the pop-up window according to the specified operation in the current H5 page;
[0127] In the pop-up window, select the setting page as the preload page for the current H5 page. The pop-up window includes the newly launched page and the historically loaded page.
[0128] Optionally, the device is further used to:
[0129] According to the associated page publishing service, update the address of the resource that the H5 page depends on in the jump relationship diagram.
[0130] Optionally, the device is further used to:
[0131] According to the operation for setting the H5 page in the jump relationship diagram, the address of at least one resource that the H5 page depends on is displayed.
[0132] Based on the same technical concept, the present application also provides a device for preloading resources in an H5 application, which is applied to the H5 application. The device includes:
[0133] An acquisition module is used to obtain a jump relationship graph between H5 pages sent by the management platform, wherein the jump relationship graph is constructed based on the trajectory data of multiple users when using the H5 application;
[0134] A determination module, configured to determine a target page to which the current H5 page is to jump based on the jump relationship graph, wherein the target page includes at least one H5 page;
[0135] The loading module is used to load the target resources required by the target page according to the resources that each H5 page depends on in the jump relationship diagram.
[0136] Optionally, load modules for:
[0137] When the current H5 page is idle, the target resources required by the target page are loaded according to the lowest priority.
[0138] Based on the same technical concept, an embodiment of the present invention further provides an electronic device, such as Figure 7 As shown, it includes a processor 701, a communication interface 702, a memory 703 and a communication bus 704, wherein the processor 701, the communication interface 702, and the memory 703 communicate with each other through the communication bus 704.
[0139] Memory 703, for storing computer programs;
[0140] The processor 701 is configured to implement the above steps when executing the program stored in the memory 703 .
[0141] The communication bus mentioned in the electronic device mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is used in the figure, but this does not mean that there is only one bus or only one type of bus.
[0142] The communication interface is used for communication between the above electronic device and other devices.
[0143] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage. Alternatively, the memory may be at least one storage device located away from the processor.
[0144] 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, and discrete hardware components.
[0145] In another embodiment provided by the present invention, a computer-readable storage medium is also provided, which stores a computer program. When the computer program is executed by a processor, the steps of any of the above methods are implemented and applied to a management platform, including the following steps.
[0146] Build a jump relationship diagram between H5 pages based on the trajectory data of multiple users when using H5 applications;
[0147] The jump relationship graph is sent to the H5 application so that the H5 application determines the target page to which the current H5 page is to jump based on the jump relationship graph, and loads the target resources required by the target page based on the resources that each H5 page in the jump relationship graph depends on, wherein the target page includes at least one H5 page.
[0148] Optionally, constructing a jump relationship diagram between H5 pages based on trajectory data of multiple users when using the H5 application includes:
[0149] Determine the trajectory data of multiple users using the H5 application based on the user traffic of the H5 application within a set historical period;
[0150] Select the first n H5 pages to be jumped to by each H5 page from the trajectory data according to the jump probability, and establish the jump logic between the H5 page and the H5 page to be jumped to, where n is a positive integer;
[0151] Get the address of the resources that each H5 page depends on;
[0152] Based on each H5 page, the jump logic between H5 pages, and the addresses of the resources that the H5 pages depend on, a jump relationship diagram between H5 pages is constructed.
[0153] Optionally, the method further comprises:
[0154] Load the pop-up window according to the specified operation in the current H5 page;
[0155] In the pop-up window, select the setting page as the preload page for the current H5 page. The pop-up window includes the newly launched page and the historically loaded page.
[0156] Optionally, after constructing the jump relationship diagram between H5 pages, the method further includes:
[0157] According to the associated page publishing service, update the address of the resource that the H5 page depends on in the jump relationship diagram.
[0158] Optionally, after constructing the jump relationship diagram between H5 pages, the method further includes:
[0159] According to the operation for setting the H5 page in the jump relationship diagram, the address of at least one resource that the H5 page depends on is displayed.
[0160] This application provides a method for preloading resources in an H5 application, which is applied to the H5 application and includes:
[0161] Obtain the jump relationship graph between H5 pages sent by the management platform, where the jump relationship graph is constructed based on the trajectory data of multiple users when using the H5 application;
[0162] Determine the target page to which the current H5 page is to jump according to the jump relationship graph, wherein the target page includes at least one H5 page;
[0163] According to the resources that each H5 page in the jump relationship diagram depends on, load the target resources required by the target page.
[0164] Optionally, the target resources required to load the target page include:
[0165] When the current H5 page is idle, the target resources required by the target page are loaded according to the lowest priority.
[0166] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is run on a computer, the computer is enabled to execute any one of the methods in the above embodiments.
[0167] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0168] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0169] The foregoing description is intended only to provide specific embodiments of the present invention, which will enable those skilled in the art to understand and implement the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not intended to be limited to the embodiments shown herein, but is intended to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for preloading resources in H5 applications. It is characterized in that Applied to a management platform, the method includes: Build a jump relationship diagram between H5 pages based on the trajectory data of multiple users when using H5 applications; The jump relationship graph is sent to the H5 application, so that the H5 application determines the target page to which the current H5 page is to jump according to the jump relationship graph, and loads the target resources required by the target page according to the resources that each H5 page in the jump relationship graph depends on, wherein the target page includes at least one H5 page.
2. The method according to claim 1, It is characterized in that Based on the trajectory data of multiple users when using H5 applications, the jump relationship diagram between H5 pages is constructed, including: Determine the trajectory data of multiple users when using the H5 application according to the user traffic of the H5 application within a set historical period; Selecting the first n H5 pages to be jumped to by each H5 page from the trajectory data according to the jump probability, and establishing the jump logic between the H5 page and the H5 page to be jumped to, where n is a positive integer; Get the address of the resources that each H5 page depends on; According to each H5 page, the jump logic between H5 pages, and the addresses of resources that the H5 pages depend on, a jump relationship diagram between H5 pages is constructed.
3. The method according to claim 1, It is characterized in that The method further comprises: Load the pop-up window according to the specified operation in the current H5 page; In the pop-up window, a setting page is selected as a preloaded page of the current H5 page, wherein the pop-up window includes a newly launched page and a historically loaded page.
4. The method according to claim 1, It is characterized in that After constructing the jump relationship diagram between H5 pages, the method further includes: According to the associated page publishing service, the address of the resource that the H5 page depends on in the jump relationship diagram is updated.
5. The method according to claim 1, It is characterized in that After constructing the jump relationship diagram between H5 pages, the method further includes: According to the operation for setting the H5 page in the jump relationship diagram, the address of at least one resource on which the setting H5 page depends is displayed.
6. A method for preloading resources in H5 applications. It is characterized in that Applied to H5 applications, the method includes: Obtaining a jump relationship graph between H5 pages sent by the management platform, wherein the jump relationship graph is constructed based on the trajectory data of multiple users when using the H5 application; Determine the target page to which the current H5 page is to jump according to the jump relationship graph, wherein the target page includes at least one H5 page; According to the resources that each H5 page in the jump relationship diagram depends on, the target resources required by the target page are loaded.
7. The method according to claim 6, It is characterized in that The target resources required to load the target page include: When the current H5 page is idle, target resources required by the target page are loaded according to the lowest priority.
8. A system for preloading resources in H5 applications. It is characterized in that The system comprises: The management platform is used to build a jump relationship diagram between H5 pages based on the trajectory data of multiple users when using H5 applications; An H5 application is connected to the management platform and is used to determine the target page to which the current H5 page is to jump according to the jump relationship diagram, and to load the target resources required by the target page according to the resources that each H5 page in the jump relationship diagram depends on, wherein the target page includes at least one H5 page.
9. A device for preloading resources in an H5 application. It is characterized in that Applied to a management platform, the method includes: A construction module is used to construct a jump relationship diagram between H5 pages based on the trajectory data of multiple users when using H5 applications; A sending module is used to send the jump relationship diagram to the H5 application, so that the H5 application determines the target page to which the current H5 page is to jump according to the jump relationship diagram, and loads the target resources required by the target page according to the resources that each H5 page in the jump relationship diagram depends on, wherein the target page includes at least one H5 page.
10. A device for preloading resources in an H5 application. It is characterized in that Applied to H5 applications, the method includes: An acquisition module, used to acquire a jump relationship diagram between H5 pages sent by the management platform, wherein the jump relationship diagram is constructed based on the trajectory data of multiple users when using the H5 application; A determination module, used to determine a target page to which the current H5 page is to jump according to the jump relationship diagram, wherein the target page includes at least one H5 page; The loading module is used to load the target resources required by the target page according to the resources that each H5 page in the jump relationship diagram depends on.
11. An electronic device, It is characterized in that It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1-5 or 6-7 when executing a program stored in a memory.
12. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1-5 or 6-7 are implemented.
Citation Information
Patent Citations
A method and a device for pushing information
CN109949117A
Webpage processing method and device, computer equipment and storage medium
CN111241451A
Webpage resource preloading method and device, computer equipment and storage medium
CN111597480A
H5 page loading method and device based on intelligent recommendation technology, equipment and medium
CN114265976A
Webpage historical record display method and device, equipment and storage medium
CN114519153A
Cited By
Page preloading method and device, equipment, storage medium and product
CN121187665A
