Dynamic resource loading method based on prediction and electronic equipment thereof

Through the prediction model, the pre-operation area is determined and pre-loaded processing is performed, the problem of WebView resource loading delay is solved, and efficient scheduling of dynamic resources and user interaction response is achieved.

CN120256758APending Publication Date: 2025-07-04SHENZHEN FENZHUAN TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510369358.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-27
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

The existing WebView resource loading method has delayed rendering on the first screen, which cannot adapt to dynamic page content, and it is difficult to respond to user interaction in real time.

Method used

Through the prediction model, the user operation data is analyzed, the pre-operation area is determined, and the trigger event is preloaded based on the preset loading strategy, including pre-download of static resources and pre-request of dynamic resources, and resource scheduling is used to use a cross-end scheduler.

Benefits of technology

It speeds up resource loading efficiency, reduces the number of invalid requests, ensures dynamic scheduling and balance of resources, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120256758A_ABST
    Figure CN120256758A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a prediction-based dynamic resource loading method and device. The method comprises the following steps: determining operation data of a user; performing movement prediction on the operation data through a preset prediction model, and determining a corresponding pre-operation area; determining at least one linked trigger event based on the pre-operation area; and carrying out preloading processing on the trigger event based on a preset loading strategy. The method comprises the following steps: performing movement prediction on operation data of a user through a prediction model, analyzing a region of a prediction result, determining an event possibly triggered by the region, and performing preloading processing on the event possibly triggered by the region according to a loading strategy, so that the user can directly schedule after really triggering the event without performing first rendering, and the user experience is improved. The resource loading efficiency is improved, the number of invalid requests is reduced, and the dynamic scheduling balance of the resources is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing, and particularly to a prediction-based dynamic resource loading method, apparatus, electronic device and storage medium thereof. Background Art

[0002] With the rapid development of mobile Internet and front-end technologies, WebView has been widely used in mobile applications, especially in scenarios such as H5 pages, Hybrid Apps, and mini-programs.

[0003] The existing WebView resource loading method usually adopts a serial loading mode, resulting in a delay in the first-screen rendering and affecting the user experience. Traditional static preloading methods often cannot adapt to dynamic page content, leading to resource waste. The preloading strategy based on historical behavior cannot take effect in the cold start phase and is difficult to respond to user interactions in real time. Therefore, the existing resource loading methods have problems such as a delay in the first-screen rendering, inability to adapt to dynamic page content, and difficulty in responding to user interactions in real time. Summary of the Invention

[0004] Embodiments of the present invention provide a prediction-based dynamic resource loading method to solve the problems of the existing resource loading methods, such as a delay in the first-screen rendering, inability to adapt to dynamic page content, and difficulty in responding to user interactions in real time.

[0005] In a first aspect, embodiments of the present invention provide a prediction-based dynamic resource loading method, the method comprising the following steps: Determine the operation data of the user; Through a preset prediction model, perform movement prediction on the operation data to determine a corresponding pre-operation area; Based on the pre-operation area, determine at least one associated trigger event; Based on a preset loading strategy, perform preloading processing on the trigger event.

[0006] Optionally, the step of performing movement prediction on the operation data through a preset prediction model to determine a corresponding pre-operation area includes: During the detection interval, collect the click coordinates, sliding speed, and gesture type of the user, and determine the acceleration data of the current device in real time; Based on the acceleration data, perform misoperation screening and judgment processing on the click coordinates, sliding speed, and gesture type of the user to determine valid operation data.

[0007] Optionally, the step of performing movement prediction on the operation data through a preset prediction model to determine a corresponding pre-operation area includes: Through a preset prediction model, perform trajectory processing on the operation data to obtain a predicted movement trajectory; Determine the pre-operation action of the user based on the predicted movement trajectory; Determine the pre-operation area in the page based on the pre-operation action.

[0008] Optionally, the determining at least one associated trigger event based on the pre-operation area includes: Determine the DOM component structure in the pre-operation area; Based on the DOM component structure, parse out the binding elements corresponding to the trigger event, and the binding elements include hidden binding relationships; Based on the binding elements, determine the trigger operations corresponding to the trigger event; Based on the trigger operations, determine at least one associated trigger event in the pre-operation area.

[0009] Optionally, the preloading process of the trigger event based on the preset loading policy includes: Determine the type of the trigger event, and the type of the trigger event includes static resources and dynamic resources; Based on the static resources and dynamic resources, determine the corresponding loading methods; Select the corresponding loading method through a cross-terminal scheduler to perform the loading process on the trigger event that needs to be preloaded.

[0010] Optionally, the determining the corresponding loading methods based on the static resources and dynamic resources includes: If the trigger event is a static resource, determine that the loading method is pre-downloading and store it in the cache pool to obtain the first preloading event data; If the trigger event is a dynamic resource, determine that the loading method is pre-requesting and store it in the cache pool to obtain the second preloading event data.

[0011] Optionally, the loading process of the trigger event that needs to be preloaded by selecting the corresponding loading method through a cross-terminal scheduler includes: After detecting the trigger event selected by the user, match at least one corresponding first preloading event data and / or second preloading event data in the cache pool; Based on the first preloading event data and / or the second preloading event data, perform scheduling and loading directly in the cache pool through the cross-terminal scheduler.

[0012] In a second aspect, an embodiment of the present invention further provides a prediction-based dynamic resource loading device, and the prediction-based dynamic resource loading device includes: A first determination module, configured to determine the operation data of the user; A second determination module, configured to perform movement prediction on the operation data through a preset prediction model to determine a corresponding pre-operation area; A third determination module, configured to determine at least one associated trigger event based on the pre-operation area; A first processing module, configured to perform preloading processing on the trigger event based on a preset loading policy.

[0013] In a third aspect, an embodiment of the present invention provides an electronic device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the steps in the method for prediction-based dynamic resource loading provided by the embodiment of the present invention are implemented.

[0014] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the method for prediction-based dynamic resource loading provided by the embodiment of the invention are implemented.

[0015] In the embodiment of the present invention, the operation data of the user is determined; movement prediction is performed on the operation data through a preset prediction model to determine a corresponding pre-operation area; at least one associated trigger event is determined based on the pre-operation area; and preloading processing is performed on the trigger event based on a preset loading policy. Movement prediction is performed on the operation data of the user through a prediction model, the area of the prediction result is analyzed to determine the events that may be triggered, and preloading processing is performed on the events that may be triggered according to the loading policy, so that after the user actually triggers an event, it can be directly scheduled without the need for first rendering, which speeds up the resource loading efficiency, reduces the number of invalid requests, and ensures the dynamic scheduling balance of resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0017] Figure 1 is a flowchart of a method for prediction-based dynamic resource loading provided by an embodiment of the present invention; Figure 2 is a schematic structural diagram of another prediction-based dynamic resource loading device provided in the embodiment of the present invention; Figure 3 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0018] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0019] As Figure 1 shown, Figure 1 is a flowchart of a prediction-based dynamic resource loading method provided by an embodiment of the present invention. The prediction-based dynamic resource loading method includes the following steps: 101. Determine the operation data of the user.

[0020] In the embodiments of the present invention, the above prediction-based dynamic resource loading method can be applied to a prediction-based dynamic resource loading platform. The above prediction-based dynamic resource loading platform has functions such as web page resource data processing, web page resource data sending and receiving, and web page resource data memory storage, and can be built based on a server or a server cluster. The above server or server cluster can be an electronic device with web page resource data processing capabilities.

[0021] The above operation data can be various interaction behavior information reflecting the user's use or operation on the current page. Generally speaking, the current actions and corresponding intentions of the user can be reflected through the above operation data. Specifically, the operation data can include, but is not limited to, click behavior data, sliding behavior data, gesture types, scrolling behavior data, etc. for confirming the user's operation behavior.

[0022] The above click behavior data can include, but is not limited to, the coordinates of the click position, the click time, and the click frequency, etc.; the above sliding behavior data can include, but is not limited to, the start and end positions of the sliding, the sliding direction, the sliding speed, and the sliding distance; the above gesture types can include, but is not limited to, operations such as click, long press, drag, and two-finger zoom; the above scrolling behavior data can include, but is not limited to, the distance of page scrolling, the scrolling speed, and the current scrolling position, etc.

[0023] More specifically, by implanting monitoring logic in the front-end page or WebView, various operation events of the user can be obtained in real time, and then effective feature extraction is performed on various operation events to obtain the corresponding operation data. For example, after standardizing the original data such as coordinates, time, and speed, constructing a corresponding user behavior vector, the operation data of the user is obtained through behaviors such as packet capture.

[0024] In a possible embodiment, the above-mentioned prediction-based dynamic resource loading platform listens to, extracts, and constructs the user actions collected in the front end through a listening mechanism to form a user behavior feature vector, which can be used to predict the user's next operation.

[0025] 102. Perform a movement prediction on the operation data through a preset prediction model to determine the corresponding pre-operation area.

[0026] In the embodiment of the present invention, the above-mentioned preset prediction model can be any deep learning model that can analyze, learn, and predict the user's next behavior based on the user's operation data. For example, deep learning models such as Lightweight Neural Network (LiteNN), RNN, and LSTM. It can be understood that after training, the above-mentioned preset prediction model can predict the possible next visited location or operation of the user according to the trajectory and characteristics of the user's operation, and determine the pre-operation area or the possible operation data that the user may perform next.

[0027] The above-mentioned movement prediction can be a process of predicting the subsequent movement trajectory or interaction trend of the user on the page based on the current operation data of the user.

[0028] In a possible embodiment, after collecting the interaction behavior of the current user, input it into the above-mentioned preset prediction model. After encapsulating the interaction behavior, a user behavior feature vector is formed, and after parsing through the above-mentioned preset prediction model, it may output that the user may be about to visit a certain page area, that is, the pre-operation area. The above-mentioned pre-operation area can be a certain DOM area in the page (such as a product recommendation area, a comment module, etc.), or a specific position range (the middle area of the page, offsetTop 500 - 900px, etc.), or a certain component that may be triggered soon (such as a floating layer, a button, etc.).

[0029] 103. Determine at least one associated trigger event based on the pre-operation area.

[0030] In the embodiment of the present invention, the above-mentioned trigger event can be an event processing logic triggered by the user operation in the page, and usually occurs along with events such as resource loading, interface change, or data request. For example, there can be click events (such as clicking a button to trigger an API), hover events (such as hovering to load a pop-up window), scroll trigger events (such as scrolling to the bottom to load more), and page rendering events (such as automatically requesting data when the page is loaded), etc.

[0031] The above trigger event can be a dependency or chain reaction between the pre-operation area and the page logic, that is, when the user enters a certain area, a series of events may be indirectly or directly triggered. For example, when the user enters the "Guess You Like" area but has not performed a click operation, it is determined that the user may click on a card or a button.

[0032] In a possible embodiment, when the user is browsing the home page waterfall flow page, by collecting the user's operation data (such as sliding speed, sliding direction, and scrolling distance), and inputting it into a preset prediction model, it is output that the user is about to enter the "Guess You Like" area on the page, and the page structure and behavior logic in this area are parsed to determine that the following elements are included in this area: product card components, URLs on which image loading depends, etc. At this time, multiple linked trigger events can be automatically recognized in this pre-operation area, specifically, an image loading event and a product details API request event.

[0033] 104. Based on the preset loading strategy, perform preloading processing on the trigger event.

[0034] In the embodiment of the present invention, the above preset loading strategy can be a set of pre-set resource loading rules and conditional logics for guiding the preloading processing of trigger events in different scenarios. It can be understood that this preset loading strategy can dynamically adjust the corresponding loading strategy according to the current network environment and the memory size of the resources to be loaded for the trigger event, and dynamically select the most processing speed and efficient strategy to load the corresponding trigger event.

[0035] Specifically, the following resources can be determined, such as: When determining whether to perform preloading, it is judged whether the policy conditions are met (such as detecting whether it has slid to a specific area, whether it is under Wi-Fi conditions, etc.); Whether to perform cache control on the trigger event (such as storing it in a memory pool); Whether to schedule preloading, perform cache control on the trigger event, and determine the loading order, etc.

[0036] In a possible embodiment, according to the above preset loading strategy, it is dynamically judged which trigger events should be preloaded, when to load, and where to load, and the resource loading timing is controlled in combination with the user's current operation area to achieve efficient and accurate dynamic resource scheduling and cache control, thereby comprehensively improving the performance and user experience of the WebView or the page.

[0037] In an embodiment of the present invention, the operation data of the user is determined; through a preset prediction model, the operation data is predicted for movement to determine the corresponding pre-operation area; based on the pre-operation area, at least one linked trigger event is determined; and based on a preset loading strategy, pre-loading processing is performed on the trigger event. By predicting the movement of the user's operation data through the prediction model, analyzing the area of the prediction result, determining the events that may be triggered, and performing pre-loading processing on the events that may be triggered according to the loading strategy, it is possible to directly schedule after the user actually triggers an event without the need for first rendering, which speeds up the resource loading efficiency, reduces the number of invalid requests, and ensures the dynamic scheduling balance of resources.

[0038] Optionally, in the step of predicting the movement of the operation data through a preset prediction model to determine the corresponding pre-operation area, the click coordinates, sliding speed, and gesture type of the user can also be collected during the detection gap, and the acceleration data of the current device can be determined in real time; based on the acceleration data, false operation screening and judgment processing are performed on the click coordinates, sliding speed, and gesture type of the user to determine the valid operation data.

[0039] In an embodiment of the present invention, the above detection gap may refer to the time period when the system is in a non-operation high-frequency sampling state between consecutive user operations, that is, the idle time between two operation behaviors (such as sliding, clicking, dragging, etc.). It can be used to provide a low-interference, low-load window for performing auxiliary sampling tasks in the background, and additional sensing information (such as acceleration) can be collected without affecting the performance of the main thread for behavior verification. It can be understood that the above detection gap can be adjusted according to the current network environment. When the network environment is poor, the detection gap is shortened to ensure that a large amount of network resources are allocated to the main thread.

[0040] The above false operation screening and judgment processing may refer to the process of performing logical judgment and rule verification on the user operation data, identifying and eliminating "abnormal or false operation data" that does not conform to normal interaction characteristics, so as to retain the real and effective user intention behavior.

[0041] The above valid operation data may refer to the operation behavior data that has been screened and judged to confirm the real interaction intention of the user, and can be used for key logics such as behavior prediction and resource scheduling.

[0042] In a possible embodiment, sensing information is collected during the "detection gap" of the user operation, and "screening and judgment processing" is performed on the operation behavior. Finally, the "valid operation data" is screened out as the input to improve the accuracy and robustness of subsequent pre-operation area prediction and resource loading.

[0043] Specifically, it can be determined by detecting whether the current operation data of the user is consistent with the sensor data of the current device. For example, the click data and the corresponding device vibration are used to determine whether the click data is caused by accidental touch. It can also be to determine the operation speed and operation range, determine the distance that can be swiped according to the operation speed (swiping speed), and match it with the triggered area to determine whether the area range can be reached at the current operation speed. If not, it is determined as an accidental operation, etc.

[0044] Optionally, in the step of performing movement prediction on the operation data through a preset prediction model to determine the corresponding pre-operation area, it further includes performing trajectory processing on the operation data through the preset prediction model to obtain a predicted movement trajectory; determining the user's pre-operation action based on the predicted movement trajectory; and determining the pre-operation area in the page based on the pre-operation action.

[0045] In the embodiment of the present invention, the above-mentioned trajectory processing may refer to the process of serializing and modeling and path fitting of multiple consecutive operation inputs of the user (such as swipe points, displacements, directions, time, etc.) through methods such as sequence modeling, time window sliding average, two-dimensional trajectory curve fitting, and direction vector extraction to generate the movement trend trajectory on the page.

[0046] The above-mentioned pre-operation action may refer to the specific interaction behavior types that the user may perform in a short time predicted after performing trajectory processing on the user's operation data through the above-mentioned preset prediction model. For example, about to click, about to switch pages, etc.

[0047] In a possible embodiment, by performing trajectory processing on the operation data through the above-mentioned preset prediction model to generate a predicted movement trajectory, the user's pre-operation actions such as "about to stay" and "about to switch pages" can be recognized, and the pre-operation area that the user is about to focus on can be calibrated accordingly, realizing precise preloading of resources and effectively improving the page loading performance and user experience.

[0048] Specifically, continuous operation data such as the user's sliding and dragging can be collected in real time, including information such as the starting coordinates, speed, direction, and time interval. Then, these data are processed for trajectory through a preset prediction model (such as sequence modeling based on LSTM) to generate a possible predicted movement trajectory of the user. This trajectory is manifested as a sequence of spatial paths during continuous sliding. For example, when the user continuously slides down from the top of the screen at a certain speed, the system connects multiple operation points into a trend path. By analyzing its morphological features (such as linear trend, curve deflection, sliding amplitude, and speed) and combining the model judgment logic, possible pre-operation actions of the user can be analyzed. For example, "continue to slide down to browse content". Then, by combining the end point of the current trajectory with the page layout, the area where the user is about to stay is determined to be the "recommended article area" in the middle of the page. This area can also be marked as a pre-operation area and the resource preloading logic is triggered, including preloading the article titles, thumbnails, and interface data in this area in advance.

[0049] Optionally, in the step of determining at least one linked trigger event based on the pre-operation area, it further includes determining the DOM component structure in the pre-operation area; based on the DOM component structure, parsing out the bound elements corresponding to the trigger events, and the bound elements include hidden binding relationships; based on the bound elements, determining the trigger operations corresponding to the trigger events; based on the trigger operations, determining at least one linked trigger event in the pre-operation area.

[0050] In the embodiments of the present invention, the above DOM component structure can be an HTML element structure and its componentized semantic relationships presented in the form of Document Object Model, including but not limited to tag names, hierarchical relationships, style attributes, and event listening, etc. It can be used to analyze the organizational structure between components in the page, facilitating the system to accurately identify interactive nodes and their behavior dependencies.

[0051] The above bound elements can refer to DOM nodes in the page structure that are given specific event response functions or behavior logics. By interacting with these nodes, users can trigger certain corresponding trigger events. The bound elements can include but not limited to native HTML attribute bindings, JS dynamic bindings, and framework bindings.

[0052] The above hidden binding relationship can refer to an event binding relationship that is not explicitly declared in the HTML plain text but is formed through scripts, templates, or delegation mechanisms during runtime. For example, the event binding syntax of front-end frameworks such as Vue and React, and event binding code executed during JS runtime. It can also be based on event delegation. For example, binding a click event to a parent container and making a judgment when a child element is triggered.

[0053] In a possible embodiment, by parsing the DOM component structure within the pre-operation area, identifying interactive elements with explicit or hidden binding relationships, and combining their trigger operations, all possible linked trigger events are accurately identified, providing a basis with finer granularity and higher hit rate for subsequent resource preloading, and significantly optimizing page performance and user experience.

[0054] Specifically, when the user swipes on the home page, the operation data is analyzed through a preset prediction model to determine that the user is about to enter the "graphic recommendation area", which is marked as the pre-operation area. The hierarchical relationship, tag type, attributes, and event listening binding information of the DOM structure within the pre-operation area are analyzed to obtain the corresponding bound elements and hidden bound elements, and based on this, these events are registered in the resource preloading queue, and the corresponding preloading behaviors are dynamically executed according to the priority, user network, and performance strategy.

[0055] Optionally, in the step of preloading and processing the trigger event based on the preset loading strategy, it further includes determining the type of the trigger event; determining the corresponding loading method based on static resources and dynamic resources; and selecting the corresponding loading method through a cross-terminal scheduler to perform loading processing on the trigger events that need to be preloaded.

[0056] In the embodiment of the present invention, the types of the above trigger events may include but are not limited to static resources and dynamic resources. Specifically, static resources may be data content that does not change with requests in the page and can be directly cached, such as pictures, texts, JS files, etc., and dynamic resources may be data content that depends on backend interfaces for requests to generate data in real time, such as recommended product interfaces, click buttons, etc.

[0057] The above loading methods may be resource acquisition methods and strategies selected according to the resource type and operating environment, such as pre-downloading, pre-requesting, pre-caching, etc.

[0058] The above cross-terminal scheduler may refer to a scheduling control module that uniformly manages and executes resource loading operations in multiple operating environments (such as Android WebView, iOS WebView, H5 browsers, applets, etc.). It can dynamically select the most suitable loading method according to the current operating platform, device performance, network conditions, and resource type to achieve unified scheduling and compatible execution of resource preloading.

[0059] Specifically, the above cross-terminal scheduler realizes unified scheduling and fine control of resource preloading between different terminals by identifying the current operating platform, resource type, and loading capacity, which not only improves the loading performance but also enhances the cross-platform adaptability of the system.

[0060] In a possible embodiment, by identifying the types of trigger events (including static resources and dynamic resources), determining the corresponding loading methods based on their respective resource characteristics, and then combining with the cross-terminal scheduler to select the optimal loading strategy according to the running environment, the trigger events that need to be pre-loaded are efficiently processed, so as to achieve the unified loading control of accurate resource scheduling and platform compatibility, effectively improve the hit rate of resource pre-loading, reduce the user waiting time, and significantly optimize the loading performance of the WebView page and the user operation fluency.

[0061] Optionally, in the step of determining the corresponding loading methods based on static resources and dynamic resources, it further includes: if the trigger event is a static resource, determining the loading method as pre-downloading and storing it in the cache pool to obtain the first pre-loading event data; if the trigger event is a dynamic resource, determining the loading method as pre-requesting and storing it in the cache pool to obtain the second pre-loading event data.

[0062] In the embodiment of the present invention, the above cache pool can be a logical cache set or cache module constructed for unified management of various pre-loaded resources, used to store the pre-loading results of static resources and dynamic data resources, facilitating quick invocation when the user actually needs it, and avoiding repeated requests and delayed loading.

[0063] The above first pre-loading event data refers to the cache data result generated after the static resource is pulled in advance by the pre-downloading loading method when the trigger event recognized by the system is a static resource and after the loading is completed.

[0064] The above second pre-loading event data refers to the cache result data generated after the backend interface or real-time generated data is pulled by the pre-requesting (such as API call) loading method when the trigger event recognized by the system is a dynamic resource and after the request is completed.

[0065] In a possible embodiment, according to the resource types of the trigger events, the pre-downloading and pre-requesting loading methods are respectively used to generate the pre-loading event data, which are uniformly written into the cache pool for management. When the user actually enters the page, it can be quickly invoked, significantly improving the resource hit rate and the page response speed, thereby optimizing the overall user experience.

[0066] Specifically, identify the type of trigger event. For static resources, determine the loading method as pre-downloading, and create an Image object to pull the image data in advance. After the download is completed, store the image object in the local cache pool to form the first preloading event data. For dynamic resources, determine the loading method as pre-requesting, and initiate an asynchronous data request to the server in advance. After receiving the request result, store the interface data in the cache pool to form the second preloading event data. When the user actually performs the operation corresponding to the trigger event, quickly read the first and second preloading event data from the cache pool, render the image and populate the news list respectively, avoiding real-time loading latency and improving the user experience fluency.

[0067] Optionally, in the step of selecting the corresponding loading method through the cross-terminal scheduler to perform loading processing on the trigger event that needs to be preloaded, it further includes matching at least one corresponding first preloading event data and / or second preloading event data in the cache pool after detecting the trigger event selected by the user; based on the first preloading event data and / or second preloading event data, perform scheduling loading directly in the cache pool through the cross-terminal scheduler.

[0068] In the embodiment of the present invention, when the user swipes to the "Featured Recommendations" area, the system predicts that this area will become the pre-operation area and identifies multiple linked trigger events, including image loading, article data loading, and jump links. Then, based on the resource type, perform pre-downloading of static resources and pre-requesting of dynamic resources respectively, and uniformly store the obtained first preloading event data (such as images) and second preloading event data (such as JSON data returned by the article interface) in the cache pool, and load the data in the cache pool through the cross-terminal scheduler, so as to achieve delay-free loading.

[0069] Specifically, when the user actually performs an interaction operation, such as clicking on a recommended article card, the system executes the following processing flow: detect the trigger event selected by the user; match the preloading data in the cache pool; perform scheduling loading through the cross-terminal scheduler; and quickly display the page in response.

[0070] Among them, during the scheduling and loading process through the cross-terminal scheduler, the running platform is uniformly identified, the resource type is judged, the loading method is selected, the cache call is coordinated, and the resource loading logic is scheduled and executed to achieve the intelligence, platform independence, and performance optimization of the resource preloading process. For example, when coordinating resource loading in a multi-terminal platform environment (such as Android WebView, iOS WebView, H5, applets, etc.), the current running environment is automatically identified. For example, the platform to which the current device belongs is judged through User-Agent, platform interfaces, container types, etc.; according to the platform capabilities (such as whether native caching is supported, whether cross-domain requests are allowed, whether local storage permissions are available, etc.), the applicable loading method and loading path are dynamically determined; for different types of trigger events (static resources or dynamic resources), the most suitable loading method is selected across multiple platforms, and according to the corresponding preloading strategy, the direct loading logic after hitting the cache pool is used to manage the access permissions and interface encapsulation of the cache pool to achieve consistent data reading logic across platforms; in platforms such as iOS, Android, and applets, cache data is accessed or transmitted through methods such as JSBridge and platform APIs.

[0071] As Figure 2 shown in the figure, an embodiment of the present invention further provides a prediction-based dynamic resource loading device 200, and the prediction-based dynamic resource loading device 200 includes: A first determination module 201 for determining the operation data of the user; A second determination module 202 for performing movement prediction on the operation data through a preset prediction model to determine a corresponding pre-operation area; A third determination module 203 for determining at least one associated trigger event based on the pre-operation area; A first processing module 204 for performing preloading processing on the trigger event based on a preset loading strategy.

[0072] Optionally, the above device further includes: A fourth determination module for collecting the click coordinates, sliding speed, and gesture type of the user during the detection interval and real-time determining the acceleration data of the current device; A fifth determination module for performing misoperation screening and judgment processing on the click coordinates, sliding speed, and gesture type of the user based on the acceleration data to determine valid operation data.

[0073] Optionally, the above second determination module 202 includes: A first acquisition module for performing trajectory processing on the operation data through a preset prediction model to obtain a predicted movement trajectory; The first determination sub-module is configured to determine a pre-operation action of the user based on the predicted movement trajectory; The second determination sub-module is configured to determine the pre-operation area in the page based on the pre-operation action.

[0074] Optionally, the above-mentioned third determination module 203 includes: The third determination sub-module is configured to determine the DOM component structure in the pre-operation area; The parsing sub-module is configured to parse out the bound element corresponding to the trigger event based on the DOM component structure, and the bound element includes a hidden binding relationship; The fourth determination sub-module is configured to determine the trigger operation corresponding to the trigger event based on the bound element; The fifth determination sub-module is configured to determine at least one associated trigger event in the pre-operation area based on the trigger operation.

[0075] Optionally, the above-mentioned first processing module 204 includes: The sixth determination sub-module is configured to determine the type of the trigger event, and the type of the trigger event includes static resources and dynamic resources; The seventh determination sub-module is configured to determine the corresponding loading method based on the static resources and dynamic resources; The loading sub-module is configured to select the corresponding loading method through the cross-terminal scheduler to perform loading processing on the trigger event that needs to be pre-loaded.

[0076] Optionally, the above-mentioned seventh determination sub-module includes: The first determination unit is configured to, if the trigger event is a static resource, determine that the loading method is pre-downloading and store it in the cache pool to obtain the first pre-loading event data; The second determination unit is configured to, if the trigger event is a dynamic resource, determine that the loading method is pre-requesting and store it in the cache pool to obtain the second pre-loading event data.

[0077] Optionally, the above-mentioned loading sub-module further includes: The matching unit is configured to match at least one corresponding first pre-loading event data and / or second pre-loading event data in the cache pool after detecting the trigger event selected by the user; The scheduling unit is configured to perform scheduling and loading directly in the cache pool through the cross-terminal scheduler based on the first pre-loading event data and / or the second pre-loading event data.

[0078] As Figure 3 shown, an embodiment of the present invention further provides an electronic device 300, including a processor, and the above-mentioned processor can execute any one of the above-mentioned prediction-based dynamic resource loading methods.

[0079] Specifically, it includes a processor 301, a memory 302, and a computer program stored on the memory 302 and capable of running on the processor 301 to execute a prediction-based dynamic resource loading method, where: The processor 301 runs the calculator program of the prediction-based dynamic resource loading method stored in the memory 302 and executes the following steps: Determine the operation data of the user; Through a preset prediction model, perform movement prediction on the operation data to determine the corresponding pre-operation area; Based on the pre-operation area, determine at least one associated trigger event; Based on a preset loading strategy, perform preloading processing on the trigger event.

[0080] Optionally, when the processor 301 executes the step of performing movement prediction on the operation data through a preset prediction model to determine the corresponding pre-operation area, the method further includes: During the detection gap, collect the user's click coordinates, sliding speed, and gesture type, and determine the acceleration data of the current device in real time; Based on the acceleration data, perform misoperation screening and judgment processing on the user's click coordinates, sliding speed, and gesture type to determine valid operation data.

[0081] Optionally, when the processor 301 executes the step of performing movement prediction on the operation data through a preset prediction model to determine the corresponding pre-operation area, it includes: Through a preset prediction model, perform trajectory processing on the operation data to obtain a predicted movement trajectory; Based on the predicted movement trajectory, determine the user's pre-operation action; Based on the pre-operation action, determine the pre-operation area in the page.

[0082] Optionally, when the processor 301 executes the step of determining at least one associated trigger event based on the pre-operation area, it includes: Determine the DOM component structure in the pre-operation area; Based on the DOM component structure, parse out the binding elements corresponding to the trigger event, and the binding elements include hidden binding relationships; Based on the binding elements, determine the trigger operation corresponding to the trigger event; Based on the trigger operation, determine at least one associated trigger event in the pre-operation area.

[0083] Optionally, when the processor 301 executes the step of performing preloading processing on the trigger event based on a preset loading strategy, it includes: Determine the type of the trigger event, where the type of the trigger event includes static resources and dynamic resources; Based on the static resources and dynamic resources, determine the corresponding loading method; Select the corresponding loading method through a cross-terminal scheduler to perform a loading process on the trigger event that needs to be pre-loaded.

[0084] Optionally, the processor 301 also executes the determining the corresponding loading method based on the static resources and dynamic resources, including: If the trigger event is a static resource, determine that the loading method is pre-downloading and store it in the cache pool to obtain the first pre-loading event data; If the trigger event is a dynamic resource, determine that the loading method is pre-requesting and store it in the cache pool to obtain the second pre-loading event data.

[0085] Optionally, the processor 301 also executes the selecting the corresponding loading method through a cross-terminal scheduler to perform a loading process on the trigger event that needs to be pre-loaded, including: After detecting the trigger event selected by the user, match at least one corresponding first pre-loading event data and / or second pre-loading event data in the cache pool; Based on the first pre-loading event data and / or second pre-loading event data, schedule and directly perform a scheduling load in the cache pool through the cross-terminal scheduler.

[0086] The embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it realizes each process of the method for predicting-based dynamic resource loading or the method for predicting-based dynamic resource loading at the application end provided by the embodiment of the present invention, and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.

[0087] Those of ordinary skill in the art can understand that all or part of the processes of implementing the method in the above embodiments can be completed by a computer program instructing relevant hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, an optical disc, a read-only memory (ROM), or a random access memory (RAM), etc.

[0088] The above-disclosed are only the preferred embodiments of the present invention. Of course, the scope of the rights of the present invention cannot be limited thereby. Therefore, equivalent changes made according to the claims of the present invention still fall within the scope covered by the present invention.

Claims

1. A prediction-based dynamic resource loading method, characterized in that Including: Determine the operation data of the user; Perform movement prediction on the operation data through a preset prediction model to determine the corresponding pre-operation area; Based on the pre-operation area, determine at least one associated trigger event; Based on a preset loading strategy, perform preloading processing on the trigger event.

2. The prediction-based dynamic resource loading method according to claim 1, wherein For the step of performing movement prediction on the operation data through a preset prediction model to determine the corresponding pre-operation area, the method further includes: During the detection gap, collect the user's click coordinates, sliding speed, and gesture type, and determine the acceleration data of the current device in real time; Based on the acceleration data, perform misoperation screening and judgment processing on the user's click coordinates, sliding speed, and gesture type to determine valid operation data.

3. The prediction-based dynamic resource loading method according to claim 1, characterized in that, For the step of performing movement prediction on the operation data through a preset prediction model to determine the corresponding pre-operation area, it includes: Perform trajectory processing on the operation data through a preset prediction model to obtain a predicted movement trajectory; Based on the predicted movement trajectory, determine the user's pre-operation action; Based on the pre-operation action, determine the pre-operation area in the page.

4. The prediction-based dynamic resource loading method according to claim 1, wherein For the step of determining at least one associated trigger event based on the pre-operation area, it includes: Determine the DOM component structure in the pre-operation area; Based on the DOM component structure, parse out the bound elements corresponding to the trigger event, and the bound elements include hidden binding relationships; Based on the bound elements, determine the trigger operation corresponding to the trigger event; Based on the trigger operation, determine at least one associated trigger event in the pre-operation area.

5. The prediction-based dynamic resource loading method according to claim 4, wherein For the step of performing preloading processing on the trigger event based on a preset loading strategy, it includes: Determine the type of the trigger event, and the type of the trigger event includes static resources and dynamic resources; Based on the static resources and dynamic resources, determine the corresponding loading method; Select the corresponding loading method through a cross-terminal scheduler to perform loading processing on the trigger event that needs to be preloaded.

6. The prediction-based dynamic resource loading method according to claim 5, wherein For the step of determining the corresponding loading method based on the static resources and dynamic resources, it includes: If the trigger event is a static resource, determine that the loading method is pre-downloading and store it in the cache pool to obtain the first preloading event data; If the trigger event is a dynamic resource, determine that the loading method is pre-requesting and store it in the cache pool to obtain the second preloading event data.

7. The prediction-based dynamic resource loading method according to claim 5, wherein, For the step of selecting the corresponding loading method through a cross-terminal scheduler to perform loading processing on the trigger event that needs to be preloaded, it includes: After detecting the trigger event selected by the user, match at least one corresponding first preloading event data and / or second preloading event data in the cache pool; Based on the first preloading event data and / or second preloading event data, perform scheduling and loading directly in the cache pool through the cross-terminal scheduler.

8. A prediction-based dynamic resource loading device, characterized in that Including: The first determination module is used to determine the operation data of the user; The second determination module is used to perform movement prediction on the operation data through a preset prediction model to determine the corresponding pre-operation area; The third determination module is used to determine at least one associated trigger event based on the pre-operation area; A first processing module, configured to perform preloading processing on the trigger event based on a preset loading policy.

9. An electronic device, characterized in that, Including: A memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the computer program, the steps in the prediction-based dynamic resource loading method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps in the prediction-based dynamic resource loading method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Resource preloading method and device, equipment and storage medium

    CN121098931A