A dynamic component loading system based on a React framework

By using a dynamic component loading system based on the React framework, combined with data analysis and optimization techniques, the inefficiency and poor user experience of traditional component loading methods are solved, enabling fast loading and intelligent decision-making, thereby improving the performance and user experience of web front-end applications.

CN119536836BActive Publication Date: 2025-11-11INSPUR YUNZHOU (SHANDONG) IND INTERNET CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411340888.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2025-11-11
Estimated Expiration
2044-09-25

AI Technical Summary

Technical Problem

In existing technologies, dynamic component loading methods result in excessive HTTP requests and large resource file sizes, leading to long page loading times and poor user experience. In particular, the system performance cannot effectively cope with large-scale concurrent requests.

Method used

A dynamic component loading system based on the React framework is adopted, including a server-side, a user-side, and a backend control-side. Through data acquisition units, front-end component management units, resource preloading units, cache management units, and component loading optimization units, the system realizes component preloading, caching, and optimized loading. Genetic algorithm optimization model is used, combined with logistic regression and clustering algorithms for user behavior analysis and resource prediction.

Benefits of technology

It significantly improves page loading and response speed, optimizes system performance, enhances user experience, improves resource utilization, and provides flexibility and scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119536836B_ABST
    Figure CN119536836B_ABST
Patent Text Reader

Abstract

This invention relates to the field of information technology. It provides a dynamic component loading system based on the React framework, comprising a server, a user terminal, and a backend control terminal. Component preloading and caching are achieved through data interaction and analysis. The invention includes units for data acquisition, front-end component management, resource preloading, cache management, and component loading optimization. The front-end component management unit optimizes loading configurations through simulation and comparison; the resource preloading unit trains a model to predict user behavior; the cache management unit clusters and analyzes frequently accessed data for caching; and the component loading optimization unit uses a genetic algorithm to optimize model predictions, thereby improving loading efficiency. This invention effectively solves the problem of low loading efficiency in traditional component loading systems, improving web front-end loading speed and user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information technology processing, and in particular to a dynamic component loading system based on the React framework. Background Technology

[0002] In the field of web development, with the continuous expansion and increasing complexity of applications, dynamic component loading technology has gradually become an important means to improve application performance and user experience. As one of the mainstream choices for front-end development, the development of React's dynamic component loading system is particularly noteworthy. By introducing the `React.lazy()` function and the `Suspense` component, React provides developers with an elegant way to implement on-demand component loading. This technology not only reduces the initial loading time of applications but also improves application responsiveness and overall performance. With the continuous improvement of the React ecosystem, dynamic component loading technology is also constantly evolving, providing developers with a more flexible and powerful toolset.

[0003] Dynamic component loading is a crucial technique in current web front-end development. However, with the continuous development of information technology, when a page needs to dynamically load multiple components, each component may contain multiple resource files, such as JavaScript, CSS, and images. These resource files typically need to be retrieved from the server via HTTP requests. Excessive HTTP requests significantly increase network latency, and the size of resource files also gradually increases. For example, uncompressed JavaScript files and high-resolution images consume significant bandwidth and download time. The excessive number of HTTP requests and the large size of resource files lead to inefficiencies in traditional component loading methods, resulting in longer page loading times and a poor user experience. Especially when handling large-scale concurrent requests, existing technologies cannot effectively cope, further impacting system performance. Therefore, a new component loading system is urgently needed to improve the loading speed and system performance of web front-ends. Summary of the Invention

[0004] To address the shortcomings of existing technologies, this invention provides a dynamic component loading system based on the React framework. This system solves the problems of inefficiency caused by excessive HTTP requests and large resource file sizes in traditional component loading methods, resulting in long page loading times and poor user experience.

[0005] To solve the above-mentioned technical problems, the specific technical solution of the present invention is as follows:

[0006] This invention provides a dynamic component loading system based on the React framework, including: a server, a user, and a backend control terminal. The server establishes a communication connection with the user and the backend control terminal. During the data flow process, the server, the user, and the backend control terminal generate interactive data. The server analyzes the interactive data and performs pre-loading and pre-caching of components.

[0007] The data acquisition unit acquires component metadata, resource file data, configuration data, runtime error data, and status information, and stores the acquired data in the database to obtain the component loading system data set.

[0008] The front-end component management unit receives component requirement information, matches the corresponding components in the preset knowledge base according to the component requirement information, obtains the knowledge base component matching results, performs data analysis on the knowledge base component matching results, and obtains the real-time component loading configuration.

[0009] The resource preloading unit acquires user interaction data, user preference data, performance data, device and environment data, user feedback data, and business-related data. It preprocesses the data acquired by the resource preloading unit, trains the model with the preprocessed data, and deploys the trained model to the production environment. The model processes the data acquired by the resource preloading unit in real time and outputs real-time user behavior analysis results. The user behavior analysis results include preloaded component information. Based on the preloaded component information, the resource preloading unit completes component preloading.

[0010] The cache management unit retrieves user interaction data from the resource preloading unit and the component loading system data set from the data acquisition unit. It performs cluster analysis on the user interaction data, including cluster analysis results on the frequency of data access. The top 35% of the data in the frequency of data access cluster results are set as pre-cached data, and the cache management unit caches the pre-cached data.

[0011] The component loading optimization unit parses the component requirement information received from the front-end component management unit to obtain the component information that the user needs to load. The component information that the user needs to load is matched with the components that have completed component preloading in the resource preloading unit. If the match is unsuccessful, the model is optimized using a genetic algorithm based on the data in the component loading system dataset and the data obtained from the resource preloading unit to obtain the optimized model. The optimized model is then deployed for user behavior analysis.

[0012] Furthermore, the data acquisition unit of the dynamic component loading system based on the React framework provided by the present invention includes:

[0013] Component metadata includes component identification information and component dependencies. Component identification information includes identifier, name and version. Component identification information is used to accurately locate and identify components during dynamic loading. Component dependencies are used to express the relationship between a component and other components or libraries.

[0014] Resource file data includes JavaScript code for dynamic components, CSS stylesheets, audio files, images, and videos;

[0015] Configuration data includes environment variables and user preference settings. Environment variables include different configuration data loaded for each component, and user preference settings include dynamically adjusting the behavior or style of components based on user preferences.

[0016] Operational data includes API response data and cached data;

[0017] Error data includes network request failures and data format errors, while status information includes the component's loading status.

[0018] Furthermore, the front-end component management unit of the dynamic component loading system based on the React framework provided by the present invention includes:

[0019] The specific steps for data analysis of the knowledge base component matching results are as follows: The knowledge base component matching results include the components that need to be loaded corresponding to the component requirement information; obtain the configuration and architecture information of the front-end component management unit; establish a mirrored front-end component management unit; the mirrored front-end component management unit includes a first front-end component simulation management unit, a second front-end component simulation management unit, and a third front-end component simulation management unit; and the knowledge base component matching results are loaded into the first front-end component simulation management unit, the second front-end component simulation management unit, and the third front-end component simulation management unit in sequence.

[0020] Furthermore, the front-end component management unit of the dynamic component loading system based on the React framework provided by the present invention includes:

[0021] Monitor the loading speed of knowledge base component matching in the first front-end component simulation management unit, the second front-end component simulation management unit, and the third front-end component simulation management unit;

[0022] The loading speed of the knowledge base component matching of the first front-end component simulation management unit, the second front-end component simulation management unit, and the third front-end component simulation management unit is compared to obtain the loading speed comparison results of the front-end component simulation management units.

[0023] Extract the component loading configuration of the front-end component simulation management unit that ranks first in the comparison results of front-end component simulation management unit loading speed, and use it as the real-time component loading configuration.

[0024] Furthermore, the front-end component management unit of the dynamic component loading system based on the React framework provided by the present invention includes:

[0025] First front-end component simulates the loading method of the management unit:

[0026] Upon receiving the matching result from the knowledge base component, the first front-end component simulates the management unit and loads the component synchronously. Before the component is fully loaded, other parts of the page will not continue to render or execute.

[0027] During the loading process, no caching mechanism is used to simulate the experience of a first-time user.

[0028] Record various performance metrics during the loading process, including loading time and resource consumption, for subsequent analysis and comparison.

[0029] The second front-end component simulates the loading method of the management unit:

[0030] After receiving the matching result of the knowledge base component, the component is loaded asynchronously. Before the component is fully loaded, other parts of the page are allowed to continue rendering and executing during the component loading process. When the component enters the viewport or meets specific conditions, the component loading process is triggered. During the component loading process, the cache management unit is used to reduce the component network requests and component loading time.

[0031] Third front-end component simulation management unit loading method:

[0032] Based on the user behavior analysis results obtained from the resource preloading unit, the third front-end component simulation management unit preloads components that the user may soon access;

[0033] Using code splitting technology, large components are broken down into chunks, and these chunks are dynamically loaded as needed. The loading process is prioritized based on the importance of the components and the urgency of user needs.

[0034] Furthermore, the front-end component management unit of the dynamic component loading system based on the React framework provided by this invention also includes:

[0035] Configure the first front-end component simulation management unit, the second front-end component simulation management unit, and the third front-end component simulation management unit with the same network environment, and send the same component requirement information to the first front-end component simulation management unit, the second front-end component simulation management unit, and the third front-end component simulation management unit respectively;

[0036] Record the total time for each simulation management unit from receiving component requirement information to completing component loading;

[0037] The system collects performance metrics during the component loading process of the first, second, and third front-end component simulation management units. These performance metrics include network request time, resource processing time, and rendering time.

[0038] Furthermore, the resource preloading unit of the dynamic component loading system based on the React framework provided by this invention includes:

[0039] We choose logistic regression as the training model, use the preprocessed data as the training set to train the model, and then deploy the trained model to the production environment.

[0040] After the trained model is deployed to the production environment, it is tested. During the test, computing resources and storage capacity are monitored. If computing resources and storage capacity are lower than the preset stable value, an early warning message indicating insufficient model running space is generated.

[0041] Furthermore, the dynamic component loading system based on the React framework provided by this invention includes a cache management unit, comprising:

[0042] User interaction data is retrieved from the resource preloading unit, and the component loading system data set is retrieved from the data acquisition unit. Data preprocessing is performed, and different data clusters are obtained through clustering algorithms.

[0043] Analyze each data cluster, calculate the frequency of data access, and sort the clustering results according to the frequency of data access.

[0044] Select the top 35% of data clusters in the sorting, which are considered to be frequently accessed data, and set the frequently accessed data as pre-cached data.

[0045] When a user requests data, the cache management unit first checks whether the data exists in the pre-cached data.

[0046] If the data exists, it is returned directly from the cache to the user, and the pre-cached data is updated periodically.

[0047] Furthermore, the component loading optimization unit of the dynamic component loading system based on the React framework provided by this invention includes:

[0048] The component loading optimization unit parses the component requirement information received from the front-end component management unit to obtain the component information that the user needs to load. The component information that the user needs to load is matched with the components that have completed component preloading in the resource preloading unit. If the match is unsuccessful, the model is optimized using a genetic algorithm based on the data in the component loading system dataset and the data obtained from the resource preloading unit to obtain the optimized model. The optimized model is then deployed for user behavior analysis.

[0049] If a match is found, the component that has completed component preloading in the resource preloading unit will be used.

[0050] Furthermore, the component loading optimization unit of the dynamic component loading system based on the React framework provided by the present invention includes:

[0051] When a match fails, the component loading optimization unit optimizes the existing model using a genetic algorithm based on the data in the component loading system dataset and the data obtained by the resource preloading unit.

[0052] Define a fitness function, randomly generate a set of model parameter configurations, each configuration represents an individual in the genetic algorithm, train the model using the parameter configurations in the initial population, evaluate its performance through the fitness function, select excellent individuals based on fitness values, and perform crossover operations to generate new parameter configurations;

[0053] Repeated training, evaluation, and genetic operations until a preset number of iterations or fitness threshold is reached, thus completing the optimization of the genetic algorithm;

[0054] After optimization using a genetic algorithm, an optimized model is obtained. This optimized model is then deployed to the production environment for real-time processing and analysis of user behavior data.

[0055] The beneficial effects of this invention;

[0056] Improving page load speed: By using dynamic component loading and preloading mechanisms, unnecessary HTTP requests and component loading time are reduced, significantly improving the initial page load speed and response speed. This is of great significance for improving user experience and enhancing user engagement.

[0057] Optimizing system performance: The cache management unit reduces the server load and improves data access efficiency by pre-caching frequently accessed data, thereby optimizing the overall system performance. This is especially important for handling large-scale concurrent requests and dealing with high-load scenarios.

[0058] Enhanced user experience: Real-time user behavior analysis allows the system to intelligently predict and preload based on users' actual usage habits and needs, enabling users to access the components and information they need more quickly, thereby improving the user experience.

[0059] Improve resource utilization: Through simulation and optimization of various loading strategies in the component management unit, as well as continuous optimization and iteration of the model, the system can utilize computing and network resources more efficiently, avoiding resource waste.

[0060] Flexibility and scalability: Built on the React framework, this system fully leverages React's ecosystem and toolset, enabling developers to easily develop and maintain components. Furthermore, the loose coupling between system units facilitates subsequent feature expansion and upgrades.

[0061] Intelligent decision support: By using advanced data analysis and optimization technologies such as genetic algorithms, the system can make more intelligent and accurate decisions based on a large amount of data, thereby further improving the system's performance and user experience.

[0062] In summary, this invention, through a dynamic component loading system based on the React framework, effectively solves the problems of low efficiency, long page loading time, and poor user experience of traditional component loading methods, significantly improving the performance and user experience of web front-end applications, and has important practical application value and promotion significance. Attached Figure Description

[0063] To more clearly illustrate the technical solution of the present invention, the drawings used in the embodiments will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0064] Figure 1 This is a schematic diagram of the system architecture provided for an embodiment of the present invention. Detailed Implementation

[0065] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention. The technical solutions provided by various embodiments of this invention will be described in detail below with reference to the accompanying drawings.

[0066] To better understand the purpose of this invention, the invention will be described in further detail below.

[0067] This invention provides a dynamic component loading system based on the React framework, including: a server, a user, and a backend control terminal. The server establishes a communication connection with the user and the backend control terminal. During the data flow process, the server, the user, and the backend control terminal generate interactive data. The server analyzes the interactive data and preloads and pre-caches components.

[0068] The data acquisition unit acquires component metadata, resource file data, configuration data, runtime error data, and status information, and stores the acquired data in the database to obtain the component loading system data set.

[0069] The data acquisition unit collects data from multiple channels, including but not limited to component metadata, resource file data, configuration data, runtime data, error data, and status information.

[0070] Component metadata includes component identification information (such as identifier, name, and version) and dependencies, which are used to accurately locate and identify components and their dependencies during dynamic loading.

[0071] The resource file data covers the resource files required by dynamic components, such as JavaScript code, CSS stylesheets, audio files, images, and videos.

[0072] Configuration data includes environment variables and user preference settings, which are used to dynamically adjust component behavior based on different environments and user preferences.

[0073] The system records API responses and caching data to provide a basis for performance analysis and optimization.

[0074] Error data logs contain information such as network request failures and data format errors, which are used for troubleshooting and error handling.

[0075] Status information reflects the loading status of components, helping to monitor system health and user experience.

[0076] Data processing: After collecting these data, the data acquisition unit performs necessary preprocessing and cleaning to ensure data quality and consistency.

[0077] Preprocessing steps may include data formatting, deduplication, and outlier handling. The processed data is stored in the database, forming a data set for the component loading system, which can then be called and analyzed by other units.

[0078] The data acquisition unit provides rich data support for the entire system, enabling other units to make more accurate and intelligent decisions based on this data. For example, the resource preloading unit needs user interaction data to predict user behavior, the cache management unit needs access frequency data to determine caching strategies, and the component loading optimization unit needs various runtime data and user feedback to optimize the loading model.

[0079] By collecting operational and error data, the data acquisition unit helps the server monitor application performance and stability in real time. When performance bottlenecks or errors are detected, the server can take timely measures to optimize and adjust.

[0080] The data provided by the data acquisition unit is a crucial basis for server-side decision support. By analyzing this data, the server can understand changes in user habits and needs, thereby adjusting strategies to adapt to market changes.

[0081] The data acquisition unit helps the server to promptly identify and resolve performance issues through real-time monitoring and data analysis, thereby improving the overall system's response speed and stability.

[0082] Based on rich user interaction data and user preference settings, the data acquisition unit supports the server side in providing more personalized and accurate component loading and service experience, thereby improving user satisfaction and stickiness.

[0083] The data acquisition unit provides powerful data support capabilities to the server, enabling the server to make more intelligent and accurate decisions based on large amounts of data in order to cope with the complex and ever-changing market environment.

[0084] The front-end component management unit receives component requirement information, matches the corresponding components in a preset knowledge base based on the component requirement information, and obtains the knowledge base component matching result. The knowledge base component matching result includes the components that need to be loaded according to the component requirement information. It obtains the front-end component management unit configuration and architecture information, and establishes a mirror front-end component management unit. The mirror front-end component management unit includes a first front-end component simulation management unit, a second front-end component simulation management unit, and a third front-end component simulation management unit. The knowledge base component matching result is loaded into the first front-end component simulation management unit, the second front-end component simulation management unit, and the third front-end component simulation management unit in sequence. The loading speed of the first front-end component simulation management unit, the second front-end component simulation management unit, and the third front-end component simulation management unit are compared to obtain the front-end component simulation management unit loading speed comparison result. The component loading configuration of the front-end component simulation management unit ranked first in the front-end component simulation management unit loading speed comparison result is extracted as the real-time component loading configuration.

[0085] The front-end component management unit receives component request information from the user, including the components explicitly requested by the user. After receiving the request information, the front-end component management unit matches the corresponding components in the preset knowledge base and obtains the knowledge base component matching results.

[0086] To optimize component loading strategies, the front-end component management unit establishes multiple mirror front-end component management units, including the first front-end component simulation management unit, the second front-end component simulation management unit, and the third front-end component simulation management unit. Each mirror unit uses a different loading strategy to load components, allowing for subsequent comparison and selection of the optimal strategy.

[0087] The knowledge base component matching results are sequentially loaded into each mirror front-end component management unit, and the loading speed and performance metrics (such as loading time and resource consumption) of each unit are recorded. By comparing the loading speed and performance metrics of different units, the best-performing loading configuration is extracted as the real-time component loading configuration.

[0088] For large components, the front-end component management unit uses code splitting technology to break them down into multiple smaller chunks and dynamically loads these chunks as needed. The loading process is prioritized based on the importance of the components and the urgency of user needs, ensuring that critical components are loaded first.

[0089] By establishing multiple mirrored front-end component management units and comparing their loading speed and performance metrics, the front-end component management unit can find the optimal component loading strategy, thereby improving component loading efficiency. Faster component loading speeds can significantly improve user experience, reduce user waiting time, and increase user satisfaction and engagement.

[0090] The front-end component management unit works closely with the resource preloading unit to support component preloading based on user behavior prediction. This allows the system to preload components that users are likely to access, further enhancing the user experience.

[0091] By optimizing component loading strategies and using code splitting techniques, the front-end component management unit significantly improves component loading efficiency and reduces user waiting time.

[0092] The fast component loading speed and intelligent predictive preloading function significantly improve the user experience, increasing user satisfaction and loyalty.

[0093] The efficient component loading strategy reduces the server load, lowers network latency and resource consumption, thereby enhancing the overall system performance and stability.

[0094] The resource preloading unit acquires user interaction data, user preference data, performance data, device and environment data, user feedback data, and business-related data. It preprocesses the data acquired by the resource preloading unit, trains the model with the preprocessed data, and deploys the trained model to the production environment. The model processes the data acquired by the resource preloading unit in real time and outputs real-time user behavior analysis results. The user behavior analysis results include preloaded component information. Based on the preloaded component information, the resource preloading unit completes component preloading.

[0095] The resource preloading unit collects user interaction data, user preference data, performance data, device and environment data, user feedback data, and business-related data from multiple channels. It preprocesses the data, including data cleaning, format conversion, and feature extraction, for subsequent analysis.

[0096] Choose a suitable machine learning model (such as logistic regression) for user behavior analysis. Use preprocessed data as a training set to train the model to learn the correlation between user behavior and resource access.

[0097] The trained model is deployed to the production environment to receive and process data from the user in real time.

[0098] The model outputs real-time user behavior analysis results, including information on components that the user may be about to access.

[0099] Based on the preloaded component information output by the model, the resource preloading unit loads these components and their dependent resource files (such as JavaScript code, CSS stylesheets, images, etc.) from the server in advance.

[0100] Storing preloaded components in the client cache ensures a fast response when a user actually accesses them.

[0101] By preloading components that users are likely to access, the resource preloading unit significantly reduces the waiting time for users when they actually access these components.

[0102] Fast response times and a smooth interactive experience enhance user satisfaction and loyalty to the application. A preloading strategy based on user behavior analysis allows the system to allocate resources more efficiently, prioritizing the loading of components users are most likely to access, thereby improving resource utilization.

[0103] The resource preloading unit significantly reduces the overall page load time by preloading key components and resource files. Faster component loading speeds allow applications to respond to user requests more quickly, improving responsiveness and interactivity. Optimized resource allocation and loading strategies reduce server load, lower network latency and resource consumption, thereby improving the overall system performance and stability.

[0104] The cache management unit retrieves user interaction data from the resource preloading unit and the component loading system data set from the data acquisition unit. It performs cluster analysis on the user interaction data, including cluster analysis results on the frequency of data access. The top 35% of the data in the frequency of data access cluster results are set as pre-cached data, and the cache management unit caches the pre-cached data.

[0105] The component loading optimization unit parses the component requirement information received from the front-end component management unit to obtain the component information that the user needs to load. The component information that the user needs to load is matched with the components that have completed component preloading in the resource preloading unit. If the match is unsuccessful, the model is optimized using a genetic algorithm based on the data in the component loading system dataset and the data obtained from the resource preloading unit to obtain the optimized model. The optimized model is then deployed for user behavior analysis.

[0106] Data preparation and preprocessing: Collect component metadata, resource file data, configuration data, runtime data, error data, and status information from the component loading system data set.

[0107] User interaction data, user preference data, performance data, device and environment data, user feedback data, and business-related data are obtained from the resource preloading unit. These data are preprocessed, including data cleaning, formatting, and feature extraction, for subsequent genetic algorithm processing.

[0108] Define the fitness function: The fitness function is crucial for evaluating the quality of individuals in a genetic algorithm. In this invention, the fitness function can be designed based on the degree of match between the model's prediction of the components a user will soon visit and the actual user behavior.

[0109] The fitness function can also consider multiple factors such as component loading efficiency, user satisfaction, and system resource consumption to comprehensively evaluate the model's performance.

[0110] Population initialization: Based on the current model parameters and the possible parameter space, a set of initial model parameter configurations is randomly generated as the initial population for the genetic algorithm. Each individual represents a specific set of model parameter configurations that will be used to generate a model predicting user behavior.

[0111] Model Training and Evaluation: The model is trained using each individual from the initial population (i.e., each set of model parameters) and then evaluated. The evaluation process involves applying the model to preprocessed data, observing the model's performance in predicting user behavior, and calculating the fitness value for each individual based on the fitness function.

[0112] Selection operation: Based on the fitness values ​​of individuals, select a subset of high-performing individuals to serve as parents for the next generation. Common selection methods include roulette wheel selection and tournament selection, which tend to select individuals with higher fitness.

[0113] Crossover (hybridization) operation: A crossover operation is performed between selected parent individuals, exchanging some of their genetic information (i.e., a portion of the model parameters). Crossover helps generate new individuals with the desirable traits of both parents, increasing population diversity.

[0114] Mutation: Mutating certain genetic information (model parameters) in the new individuals generated after crossover with a certain probability. Mutation introduces new genetic information by randomly changing the values ​​of model parameters, which helps to escape local optima and explore a wider solution space.

[0115] Generate a new population: New individuals generated through selection, crossover, and mutation operations will replace a portion of the current population, forming a new generation. Repeat the model training, evaluation, selection, crossover, and mutation operations until stopping conditions are met (such as reaching the maximum number of iterations, fitness reaching a preset threshold, etc.).

[0116] Model selection and deployment optimization: During multiple generations of evolution, the genetic algorithm will gradually converge to a relatively optimal model parameter configuration. The individual with the highest fitness in the final generation is selected as the optimized model parameter configuration. The model is then retrained using this optimized set of parameters and deployed to the production environment.

[0117] Real-time user behavior analysis and component preloading: The deployed optimization model will receive user behavior data from the resource preloading unit in real time. By analyzing this data, the model predicts which components users may need in the future and guides the resource preloading unit to load these components in advance, thereby improving application responsiveness and user experience.

[0118] In the scenario based on this invention, the genetic algorithm effectively utilizes the data obtained from the component loading system dataset and the resource preloading unit to optimize the prediction model, achieving more accurate user behavior prediction and a more efficient component loading strategy.

[0119] Specifically, the data acquisition unit of the dynamic component loading system based on the React framework provided by this invention includes:

[0120] Component metadata includes component identification information and component dependencies. Component identification information includes identifier, name and version. Component identification information is used to accurately locate and identify components during dynamic loading. Component dependencies are used to express the relationship between a component and other components or libraries.

[0121] Resource file data includes JavaScript code for dynamic components, CSS stylesheets, audio files, images, and videos;

[0122] Configuration data includes environment variables and user preference settings. Environment variables include different configuration data loaded for each component, and user preference settings include dynamically adjusting the behavior or style of components based on user preferences.

[0123] Operational data includes API response data and cached data;

[0124] Error data includes network request failures and data format errors, while status information includes the component's loading status.

[0125] Specifically, the dynamic component loading system based on the React framework provided by this invention includes a front-end component management unit, comprising:

[0126] First front-end component simulates the loading method of the management unit:

[0127] Upon receiving the matching result from the knowledge base component, the first front-end component simulates the management unit and loads the component synchronously. Before the component is fully loaded, other parts of the page will not continue to render or execute.

[0128] During the loading process, no caching mechanism is used to simulate the experience of a first-time user.

[0129] Record various performance metrics during the loading process, including loading time and resource consumption, for subsequent analysis and comparison.

[0130] The second front-end component simulates the loading method of the management unit:

[0131] After receiving the matching result of the knowledge base component, the component is loaded asynchronously. Before the component is fully loaded, other parts of the page are allowed to continue rendering and executing during the component loading process. When the component enters the viewport or meets specific conditions, the component loading process is triggered. During the component loading process, the cache management unit is used to reduce the component network requests and component loading time.

[0132] Third front-end component simulation management unit loading method:

[0133] Based on the user behavior analysis results obtained from the resource preloading unit, the third front-end component simulation management unit preloads components that the user may soon access;

[0134] Using code splitting technology, large components are broken down into chunks, and these chunks are dynamically loaded as needed. The loading process is prioritized based on the importance of the components and the urgency of user needs.

[0135] Specifically, the dynamic component loading system based on the React framework and the front-end component management unit provided by this invention further include:

[0136] Configure the first front-end component simulation management unit, the second front-end component simulation management unit, and the third front-end component simulation management unit with the same network environment, and send the same component requirement information to the first front-end component simulation management unit, the second front-end component simulation management unit, and the third front-end component simulation management unit respectively;

[0137] Record the total time for each simulation management unit from receiving component requirement information to completing component loading;

[0138] The performance metrics collected during the component loading process of the first front-end component simulation management unit, the second front-end component simulation management unit, and the third front-end component simulation management unit include network request time, resource processing time, and rendering time.

[0139] Based on the comparison results, optimize the poorly performing simulation management unit by repeating the steps within the front-end component management unit until the front-end component simulation management unit is set to the optimal component loading configuration.

[0140] Specifically, the dynamic component loading system based on the React framework provided by this invention includes a resource preloading unit, comprising:

[0141] We choose logistic regression as the training model, use the preprocessed data as the training set to train the model, and then deploy the trained model to the production environment.

[0142] After the trained model is deployed to the production environment, it is tested. During the test, computing resources and storage capacity are monitored. If computing resources and storage capacity are lower than the preset stable value, an early warning message indicating insufficient model running space is generated.

[0143] Specifically, the dynamic component loading system based on the React framework provided by this invention includes a cache management unit, comprising:

[0144] User interaction data is retrieved from the resource preloading unit, and the component loading system data set is retrieved from the data acquisition unit. Data preprocessing is performed, and different data clusters are obtained through clustering algorithms.

[0145] Analyze each data cluster, calculate the frequency of data access, and sort the clustering results according to the frequency of data access.

[0146] Select the top 35% of data clusters in the sorting, which are considered to be frequently accessed data, and set the frequently accessed data as pre-cached data.

[0147] When a user requests data, the cache management unit first checks whether the data exists in the pre-cached data.

[0148] If the data exists, it is returned directly from the cache to the user, and the pre-cached data is updated periodically.

[0149] Specifically, the component loading optimization unit of the dynamic component loading system based on the React framework provided by this invention includes:

[0150] The component loading optimization unit parses the component requirement information received from the front-end component management unit to obtain the component information that the user needs to load. The component information that the user needs to load is matched with the components that have completed component preloading in the resource preloading unit. If the match is unsuccessful, the model is optimized using a genetic algorithm based on the data in the component loading system dataset and the data obtained from the resource preloading unit to obtain the optimized model. The optimized model is then deployed for user behavior analysis.

[0151] If a match is found, the component that has completed component preloading in the resource preloading unit will be used;

[0152] When a match fails, the component loading optimization unit optimizes the existing model using a genetic algorithm based on the data in the component loading system dataset and the data obtained by the resource preloading unit.

[0153] Define a fitness function, randomly generate a set of model parameter configurations, each configuration represents an individual in the genetic algorithm, train the model using the parameter configurations in the initial population, evaluate its performance through the fitness function, select excellent individuals based on fitness values, and perform crossover operations to generate new parameter configurations;

[0154] Repeated training, evaluation, and genetic operations until a preset number of iterations or fitness threshold is reached, thus completing the optimization of the genetic algorithm;

[0155] After optimization using a genetic algorithm, an optimized model is obtained. This optimized model is then deployed to the production environment for real-time processing and analysis of user behavior data.

[0156] The deployed optimization model receives and processes user behavior data from the resource preloading unit in real time. By analyzing this data, the model can predict which components users might need in the future and preload them in advance.

[0157] This invention solves the problems of inefficiency, long page loading time, and poor user experience caused by excessive HTTP requests and large resource file sizes in traditional component loading methods through the following key technologies and methods:

[0158] Dynamic component loading and preloading: This invention enables on-demand loading of components, reducing the amount of resources that need to be downloaded during initial loading and improving the application's response speed.

[0159] The resource preloading unit analyzes user behavior data to predict which components a user may access and preloads them in advance. When the user actually needs these components, they have already been loaded into the client, thereby reducing the user's waiting time.

[0160] Component caching mechanism: The cache management unit analyzes user interaction data to identify frequently accessed data and pre-caches it. When a user requests this data again, it can be retrieved directly from the cache, reducing server load and network latency. This caching mechanism applies not only to the component itself but also to resource files that the component depends on, such as JavaScript code and CSS stylesheets, further improving loading efficiency.

[0161] Component loading strategy optimization: The front-end component management unit establishes a mirror front-end component management unit, including various loading strategies such as synchronous loading, asynchronous loading, and preloading based on user behavior prediction, and compares and optimizes these strategies to find the best component loading configuration.

[0162] The component loading optimization unit uses a genetic algorithm to optimize the existing model. Based on a large amount of user behavior data, it continuously adjusts the component loading strategy to adapt to the usage habits and scenario needs of different users.

[0163] Code splitting and resource optimization: For large components, code splitting techniques are used to break them down into multiple smaller chunks, and these chunks are dynamically loaded as needed, further reducing initial loading time and improving application responsiveness.

[0164] Optimize resource files, such as compressing JavaScript code and optimizing image and video resources, to reduce file size and download time.

[0165] Real-time user behavior analysis: By analyzing user behavior data in real time, the model can predict which components a user might need in the future and preload them in advance. This intelligent decision support mechanism enables the system to more accurately meet user needs and improves the user experience.

[0166] In summary, this invention effectively solves the problem of low efficiency in traditional component loading methods caused by excessive HTTP requests and large resource file sizes by using a variety of technologies and methods, such as dynamic component loading, component caching, loading strategy optimization, code splitting and resource optimization, and real-time user behavior analysis. This significantly improves page loading speed and user experience.

[0167] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations. The above-described embodiments of this invention do not constitute a limitation on the scope of protection of this invention.

Claims

1. A dynamic component loading system based on the React framework, characterized in that, include: The server, user, and backend control are connected. The server establishes communication connections with the user and backend control. During the data flow, the server, user, and backend control generate interactive data. The server analyzes the interactive data and preloads and caches components. The data acquisition unit acquires component metadata, resource file data, configuration data, runtime data, error data, and status information, and stores the acquired data in the database to obtain the component loading system data set. The front-end component management unit receives component requirement information, matches the corresponding components in the preset knowledge base according to the component requirement information, obtains the knowledge base component matching result, loads the knowledge base component matching result into multiple mirror front-end component management units with different loading strategies, finds the optimal component loading strategy, and uses it as the real-time component loading configuration. The resource preloading unit acquires user interaction data, user preference data, performance data, device and environment data, user feedback data, and business-related data. It preprocesses the data acquired by the resource preloading unit, trains the model with the preprocessed data, and deploys the trained model to the production environment. The model processes the data acquired by the resource preloading unit in real time and outputs real-time user behavior analysis results. The user behavior analysis results include preloaded component information. Based on the preloaded component information, the resource preloading unit completes component preloading. The cache management unit retrieves user interaction data from the resource preloading unit and the component loading system data set from the data acquisition unit. It performs cluster analysis on the user interaction data, including cluster analysis results on the frequency of data access. The top 35% of the data in the frequency of data access cluster results are set as pre-cached data, and the cache management unit caches the pre-cached data. The component loading optimization unit parses the component requirement information received from the front-end component management unit to obtain the component information that the user needs to load. The component information that the user needs to load is matched with the components that have completed component preloading in the resource preloading unit. If the match is unsuccessful, the model is optimized using a genetic algorithm based on the data in the component loading system dataset and the data obtained from the resource preloading unit to obtain the optimized model. The optimized model is then deployed for user behavior analysis.

2. The dynamic component loading system based on the React framework as described in claim 1, characterized in that, The data acquisition unit includes: Component metadata includes component identification information and component dependencies. Component identification information includes identifier, name and version. Component identification information is used to accurately locate and identify components during dynamic loading. Component dependencies are used to express the relationship between a component and other components or libraries. Resource file data includes JavaScript code for dynamic components, CSS stylesheets, audio files, images, and videos; Configuration data includes environment variables and user preference settings. Environment variables include different configuration data loaded for each component, and user preference settings include dynamically adjusting the behavior or style of components based on user preferences. Operational data includes API response data and cached data; Error data includes network request failures and data format errors, while status information includes the component's loading status.

3. The dynamic component loading system based on the React framework as described in claim 1, characterized in that, The front-end component management unit includes: The specific steps for data analysis of the knowledge base component matching results are as follows: The knowledge base component matching results include the components that need to be loaded corresponding to the component requirement information; obtain the configuration and architecture information of the front-end component management unit; establish a mirrored front-end component management unit; the mirrored front-end component management unit includes a first front-end component simulation management unit, a second front-end component simulation management unit, and a third front-end component simulation management unit; and the knowledge base component matching results are loaded into the first front-end component simulation management unit, the second front-end component simulation management unit, and the third front-end component simulation management unit in sequence.

4. The dynamic component loading system based on the React framework as described in claim 3, characterized in that, The front-end component management unit includes: Monitor the loading speed of knowledge base component matching in the first front-end component simulation management unit, the second front-end component simulation management unit, and the third front-end component simulation management unit; The loading speed of the knowledge base component matching of the first front-end component simulation management unit, the second front-end component simulation management unit, and the third front-end component simulation management unit is compared to obtain the loading speed comparison results of the front-end component simulation management units. Extract the component loading configuration of the front-end component simulation management unit that ranks first in the comparison results of front-end component simulation management unit loading speed, and use it as the real-time component loading configuration.

5. The dynamic component loading system based on the React framework as described in claim 4, characterized in that, The front-end component management unit includes: First front-end component simulates the loading method of the management unit: Upon receiving the matching result from the knowledge base component, the first front-end component simulates the management unit and loads the component synchronously. Before the component is fully loaded, other parts of the page will not continue to render or execute. During the loading process, no caching mechanism is used to simulate the experience of a first-time user. Record various performance metrics during the loading process, including loading time and resource consumption, for subsequent analysis and comparison. The second front-end component simulates the loading method of the management unit: After receiving the matching result of the knowledge base component, the component is loaded asynchronously. Before the component is fully loaded, other parts of the page are allowed to continue rendering and executing during the component loading process. When the component enters the viewport or meets specific conditions, the component loading process is triggered. During the component loading process, the cache management unit is used to reduce the component network requests and component loading time. Third front-end component simulation management unit loading method: Based on the user behavior analysis results obtained from the resource preloading unit, the third front-end component simulation management unit preloads components that the user may soon access; Using code splitting technology, large components are broken down into chunks, and these chunks are dynamically loaded as needed. The loading process is prioritized based on the importance of the components and the urgency of user needs.

6. The dynamic component loading system based on the React framework as described in claim 1, characterized in that, The front-end component management unit also includes: Configure the first front-end component simulation management unit, the second front-end component simulation management unit, and the third front-end component simulation management unit with the same network environment, and send the same component requirement information to the first front-end component simulation management unit, the second front-end component simulation management unit, and the third front-end component simulation management unit respectively; Record the total time for each simulation management unit from receiving component requirement information to completing component loading; The system collects performance metrics during the component loading process of the first, second, and third front-end component simulation management units. These performance metrics include network request time, resource processing time, and rendering time.

7. The dynamic component loading system based on the React framework as described in claim 1, characterized in that, Resource preloading unit, including: We choose logistic regression as the training model, use the preprocessed data as the training set to train the model, and then deploy the trained model to the production environment. After the trained model is deployed to the production environment, it is tested. During the test, computing resources and storage capacity are monitored. If computing resources and storage capacity are lower than the preset stable value, an early warning message indicating insufficient model running space is generated.

8. The dynamic component loading system based on the React framework as described in claim 1, characterized in that, The cache management unit includes: User interaction data is retrieved from the resource preloading unit, and the component loading system data set is retrieved from the data acquisition unit. Data preprocessing is performed, and different data clusters are obtained through clustering algorithms. Analyze each data cluster, calculate the frequency of data access, and sort the clustering results according to the frequency of data access. Select the top 35% of data clusters in the sorting, which are considered to be frequently accessed data, and set the frequently accessed data as pre-cached data. When a user requests data, the cache management unit first checks whether the data exists in the pre-cached data. If the data exists, it is returned directly from the cache to the user, and the pre-cached data is updated periodically.

9. The dynamic component loading system based on the React framework as described in claim 1, characterized in that, The component loading optimization unit includes: If a match is found, the component that has completed component preloading in the resource preloading unit will be used.

10. The dynamic component loading system based on the React framework as described in claim 1, characterized in that, The component loading optimization unit includes: When a match fails, the component loading optimization unit optimizes the existing model using a genetic algorithm based on the data in the component loading system dataset and the data obtained by the resource preloading unit. Define a fitness function, randomly generate a set of model parameter configurations, each configuration represents an individual in the genetic algorithm, train the model using the parameter configurations in the initial population, evaluate its performance through the fitness function, select excellent individuals based on fitness values, and perform crossover operations to generate new parameter configurations; Repeated training, evaluation, and genetic operations until a preset number of iterations or fitness threshold is reached, thus completing the optimization of the genetic algorithm; After optimization using a genetic algorithm, an optimized model is obtained. This optimized model is then deployed to the production environment for real-time processing and analysis of user behavior data.

Citation Information

Patent Citations

  • Method and device for optimizing life cycle control of front-end assembly

    CN116991501A

  • Dynamic front-end content loading optimization method, system and equipment based on user behavior prediction and medium

    CN118276981A