Front-end user behavior prediction method and device based on artificial intelligence technology
By collecting user behavior and device environment data, and using artificial intelligence models to predict the next effective behavior and preload resources, the problem of inaccurate resource preloading in existing technologies is solved, enabling rapid response and resource optimization, improving user experience and reducing server load.
Patent Information
- Application Number
- CN202511389109.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-26
- Publication Date
- 2026-01-23
AI Technical Summary
The lack of device environment prediction in existing technologies leads to inaccurate resource preloading, often resulting in 'overloading' or 'underloading', increasing the server load and causing users to wait too long.
By collecting user behavior data and device environment data, an artificial intelligence model is used to predict the next effective behavior, and resources are intelligently preloaded based on the prediction results. A lightweight neural network is used to adjust the output layer results to adapt to the device environment.
It achieves accurate prediction of user behavior, reduces user operation waiting time, avoids invalid resource loading, balances experience improvement and resource consumption, with a prediction accuracy of over 85%, shortens response time to within 100ms, reduces server bandwidth consumption by 25%-40%, and reduces front-end cache usage by over 30%.
Smart Images

Figure CN121387683A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of user behavior prediction technology, and in particular to a front-end user behavior prediction method and apparatus based on artificial intelligence technology. Background Technology
[0002] With the rapid development of internet technology, front-end applications have become the main entry point for users to interact with the internet, and their interactive experience directly affects users' acceptance of the product.
[0003] In related technologies, a small number of existing behavior prediction solutions rely on manual rules or simple statistical analysis, or are based solely on user behavior data analysis, ignoring the impact of the device environment on the prediction results and failing to capture the dynamics of user behavior. Furthermore, in traditional front-end interactions, the system usually loads resources only after the user initiates an action, resulting in excessively long waiting times for users in practical applications. Even with resource preloading, the prediction results are inaccurate due to the neglect of the device environment. Existing preloading often results in "overloading" or "underloading," which increases the server load and fails to effectively improve the user experience.
[0004] Based on the above analysis of the development status of this technology field, existing technologies lack solutions that incorporate equipment environment prediction and utilize resource preloading. Summary of the Invention
[0005] The purpose of this invention is to provide a front-end user behavior prediction method and apparatus based on artificial intelligence technology, aiming to solve the above-mentioned problems in the prior art.
[0006] According to a first aspect of the present invention, a front-end user behavior prediction method based on artificial intelligence technology is provided, comprising: Collect user behavior data generated on the front-end page and device environment data together as a dataset, perform data preprocessing on the dataset, and associate the preprocessed data with the corresponding user; The preprocessed data is input into a pre-trained artificial intelligence model, which predicts the user's next effective behavior. The artificial intelligence model uses an adapter generated based on device environment data to adjust the output layer results. Preload the corresponding resources based on the predicted next effective action.
[0007] According to a second aspect of the present invention, a front-end user behavior prediction device based on artificial intelligence technology is provided, comprising: The data acquisition and preprocessing module is used to collect user behavior data generated on the front-end page and device environment data together as a dataset, perform data preprocessing on the dataset, and associate the preprocessed data with the corresponding user. The artificial intelligence prediction module is used to input pre-processed data into a pre-trained artificial intelligence model, and predict the user's next effective behavior through the artificial intelligence model. The artificial intelligence model uses an adapter generated based on device environment data to adjust the output layer results. The resource preloading module is used to preload the corresponding resources based on the predicted next effective action.
[0008] According to a third aspect of the present invention, an electronic device is provided, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the front-end user behavior prediction method based on artificial intelligence technology provided in the first aspect of the present disclosure.
[0009] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, on which an information transmission implementation program is stored, which, when executed by a processor, implements the steps of the front-end user behavior prediction method based on artificial intelligence technology provided in the first aspect of the present disclosure.
[0010] The technical solution provided by the embodiments of the present invention has the following beneficial effects: it breaks through the traditional passive response mode, accurately predicts the user's next effective behavior through an artificial intelligence model, and realizes intelligent preloading of resources based on the accurate prediction results, reducing the user's operation waiting time, while avoiding invalid resource loading, and balancing experience improvement and resource consumption.
[0011] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0012] To more clearly illustrate the technical solutions in one or more embodiments of this specification or in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 This is a flowchart of a front-end user behavior prediction method based on artificial intelligence technology according to an embodiment of the present invention; Figure 2 This is a schematic diagram of a front-end user behavior prediction device based on artificial intelligence technology according to an embodiment of the present invention; Figure 3 This is a schematic diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0014] To enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the technical solutions in one or more embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of this document.
[0015] Method Implementation Examples According to embodiments of the present invention, a method for predicting front-end user behavior based on artificial intelligence technology is provided. Figure 1 This is a flowchart of a front-end user behavior prediction method based on artificial intelligence technology according to an embodiment of the present invention, such as... Figure 1 As shown, the front-end user behavior prediction method based on artificial intelligence technology according to an embodiment of the present invention specifically includes: In step S110, user behavior data generated on the front-end page and device environment data are collected together as a dataset. The dataset is preprocessed, and the preprocessed data is associated with the corresponding user. Specifically, this includes: Deploy the data collection script in the front-end page, and initialize and activate the data collection function in the script; Real-time capture of user behavior data: When a user clicks, the system collects the time of the click and the button's coordinates on the front-end page. When a user swipes the page, the system collects the starting point, ending point, swipe speed, and swipe duration. When a user enters content into an input box, the system collects the entered characters, the input intervals between characters, and the input box's identifier. The system also collects the time the user spends on each front-end page during clicks, swipes, and inputs, as behavioral data. Synchronously collect equipment environmental data: Obtain device information, including the model, operating system and version, and browser type and version, through the browser interface; obtain network status information, including network type, network connection speed, and network latency; and use the device information and network status information as device environment data. The collected dataset is cached in the front end. When the number of cached data exceeds the preset number or the preset time interval is reached, the data is packaged according to the preset format and transmitted to the back end server through an asynchronous request. If the request times out, it is retried.
[0016] In the backend server, preferably, the received data is checked one by one, noisy data is removed and outliers are identified using statistical methods. Time data is uniformly converted to Unix timestamp format; data from three operation types—click, page swiping, and input—are converted into numerical data using one-hot encoding; all numerical data, including data after one-hot encoding, page dwell time, and swipe distance, are normalized, with the normalization process mapping the numerical value range to between 0 and 1.
[0017] Based on the user's unique identifier, the preprocessed data is associated with the corresponding user, and all behavioral data generated by the same user in different time periods and on different pages are linked and integrated to form a complete behavioral sequence description at the user level. This facilitates the maintenance of behavioral data and the subsequent online adjustment of the parameters of the artificial intelligence model.
[0018] In step S120, the preprocessed data is input into a pre-trained artificial intelligence model to predict the user's next effective action. The artificial intelligence model uses an adapter generated based on device environment data to adjust the output layer results, specifically including: An artificial intelligence model is obtained, which uses a time series model as the main prediction model and a lightweight neural network as the adapter. The main prediction model includes a recurrent neural network or a long short-term memory network. In this embodiment of the invention, the lightweight neural network is an MLP network. The artificial intelligence model is trained using historical user data. During the training process, data from all users is used, and data that meets the length requirements is selected and divided into training and testing sets according to a certain ratio. Based on the network structure of the artificial intelligence model, the number of neurons and activation functions of the input, hidden, and output layers are set, and parameters such as the number of iterations and learning rate are set. The artificial intelligence model is trained through the backpropagation algorithm, so that the model can continuously learn the patterns and rules of user behavior. The initially trained AI model is tested using a test set to observe the model's prediction results on user behavior. The parameters of the AI model are adjusted based on evaluation metrics including accuracy and recall to comprehensively evaluate the model's predictive performance. Based on the evaluation results, analyze the reasons for the model's inaccuracy, and optimize the identified problems. If the model parameters are inappropriate, adjust parameters such as the learning rate and the number of iterations. If the training data is insufficient or biased, resulting in low prediction accuracy for specific scenarios such as user behavior at night, collect more user behavior data for that scenario, supplement it into the training set, and retrain the model until the model's prediction performance reaches the expected target.
[0019] The specific prediction process is as follows: The master prediction model outputs initial prediction results based on behavioral data, where the initial prediction results are each behavior and its corresponding probability of occurrence. The adapter adjusts the parameter vector based on device environment data output. The parameter vector is used to describe the impact of the device environment on all executable behaviors in the current front-end page, and the probability of occurrence is adjusted by adjusting the parameter vector. The initial prediction output is the most likely result under the condition that the user ignores the influence of the device environment. However, this is not the next effective action. For example, in an environment with poor network speed, it is impossible to perform an operation such as "loading video". The user is very likely to switch to "loading image" which can be performed. Or, the user has already experienced the poor network speed in the previous actions and directly chooses "loading image". In the above situations, the effective action is "loading image". Even if the user insists on "loading video", it cannot be satisfied under the current situation, and the corresponding resource cannot be loaded in the future. Adjusting the parameter vector is essentially a weight vector used to scale the probability distribution of the final prediction. For example, in a poor network environment, the probability distribution of the "loading video" category can be directly reduced. The action with the highest probability of occurrence will be the user's next effective action.
[0020] In step S130, the corresponding resources are preloaded according to the predicted next valid action, specifically including: Retrieve all resources corresponding to the next valid action, such as loading image resources corresponding to an image. Valid actions can ensure that resources are retrieved successfully. Calculate the importance ranking of all resources, preload the corresponding resources according to the order of importance, prioritize loading key resources that have a greater impact on user experience, and cache the resources in the browser cache. When the user actually performs the predicted next valid action, the preloaded resources are directly retrieved from the browser cache to quickly respond to the user's operation and reduce waiting time. During the user's operation, the user's real-time behavior is continuously monitored. If the user's actual behavior does not match the prediction result, the preloading of relevant resources is immediately stopped, and the resources are reloaded based on the new behavior data.
[0021] In summary, addressing the existing problems, this invention presents a front-end user behavior prediction method based on artificial intelligence technology. Breaking away from the traditional passive response model, it accurately predicts the user's next effective action through an AI model and intelligently preloads resources based on the accurate prediction results, reducing user operation waiting time. The AI model selects a time series model as the main prediction model and uses a lightweight neural network as an adapter for the output layer of the main prediction model. This adapter adjusts the probability distribution of the output results based on device environment data. Compared to uniformly inputting various types of data into a time series model, this method accurately describes the relationship between environment and behavior probability, avoiding invalid resource loading and balancing experience improvement with resource consumption. This invention achieves a prediction accuracy of over 85%, reducing the average response time of user operations from 1-3 seconds to less than 100ms. Especially in high-frequency interaction scenarios such as e-commerce and news, it reduces server bandwidth consumption by 25%-40% and front-end cache usage by over 30%.
[0022] Device Examples According to an embodiment of the present invention, a front-end user behavior prediction device based on artificial intelligence technology is provided. Figure 2 This is a schematic diagram of a front-end user behavior prediction device based on artificial intelligence technology according to an embodiment of the present invention, such as... Figure 2 As shown, the front-end user behavior prediction device based on artificial intelligence technology according to an embodiment of the present invention specifically includes: The data acquisition and preprocessing module 20 is used to collect user behavior data generated on the front-end page and device environment data together as a dataset. It performs data preprocessing on the dataset and associates the preprocessed data with the corresponding user. Specifically, it is used for: When a user clicks, the system collects the time of the click and the button's coordinates on the front-end page. When a user swipes the page, the system collects the starting point, ending point, swipe speed, and swipe duration. When a user enters content into an input box, the system collects the entered characters, the input intervals between characters, and the input box's identifier. The system also collects the time the user spends on each front-end page during clicks, swipes, and inputs, as behavioral data. Obtain device information, including the model, operating system and version, and browser type and version, through the browser interface; obtain network status information, including network type, network connection speed, and network latency; and use the device information and network status information as device environment data. The collected dataset is cached in the front end. When the number of cached data exceeds the preset number or the preset time interval is reached, the dataset is transmitted to the back end server through an asynchronous request.
[0023] In the backend server, time data is uniformly converted to Unix timestamp format; data from three operation types—click, page swiping, and input—are converted into numerical data using one-hot encoding; and all numerical data are normalized.
[0024] Based on the user's unique identifier, the preprocessed data is associated with the corresponding user.
[0025] The artificial intelligence prediction module 22 is used to input pre-processed data into a pre-trained artificial intelligence model, which then predicts the user's next effective action. The artificial intelligence model uses an adapter generated based on device environment data to adjust the output layer results, specifically for: Obtain an artificial intelligence model that uses a time series model as the main prediction model and a lightweight neural network as the adapter, wherein the main prediction model includes a recurrent neural network or a long short-term memory network. The artificial intelligence model is trained using historical user data. During training, parameters including the number of iterations and the learning rate are set. The model is trained using a backpropagation algorithm, and its parameters are adjusted based on evaluation metrics including accuracy and recall.
[0026] The master prediction model outputs initial prediction results based on behavioral data, where the initial prediction results are each behavior and its corresponding probability of occurrence. The adapter adjusts the parameter vector based on device environment data output. The parameter vector is used to describe the impact of the device environment on all executable behaviors in the current front-end page, and the probability of occurrence is adjusted by adjusting the parameter vector. The action with the highest probability of occurrence will be the user's next effective action.
[0027] Resource preloading module 24 is used to preload corresponding resources based on the predicted next effective action, specifically for: Retrieve all resources corresponding to the next valid action; Calculate the importance ranking of all resources and preload the corresponding resources according to the importance ranking.
[0028] In summary, addressing the existing problems, this invention presents a front-end user behavior prediction device based on artificial intelligence technology. Breaking away from the traditional passive response model, it accurately predicts the user's next effective action through an AI model and intelligently preloads resources based on the accurate prediction results, reducing user operation waiting time. The AI model selects a time series model as the main prediction model and uses a lightweight neural network as an adapter for the output layer of the main prediction model. This adapter adjusts the probability distribution of the output results based on device environment data. Compared to uniformly inputting various types of data into the time series model, this method accurately describes the relationship between environment and behavior probability, avoiding invalid resource loading and balancing experience improvement with resource consumption. This invention achieves a prediction accuracy of over 85%, reducing the average response time of user operations from 1-3 seconds to less than 100ms. Especially in high-frequency interaction scenarios such as e-commerce and news, it reduces server bandwidth consumption by 25%-40% and front-end cache usage by over 30%.
[0029] Electronic device examples Figure 3 This is a schematic diagram of an electronic device according to an embodiment of the present invention. The electronic device 300 may include at least one processor 310 and a memory 320. The processor 310 can execute instructions stored in the memory 320. The processor 310 is communicatively connected to the memory 320 via a data bus. In addition to the memory 320, the processor 310 can also be communicatively connected to an input device 330, an output device 340, and a communication device 350 via the data bus.
[0030] Processor 310 can be any conventional processor, such as a commercially available CPU. Processors may also include graphics processing units (GPUs), field-programmable gate arrays (FPGAs), systems-on-chips (SoCs), application-specific integrated circuits (ASICs), or combinations thereof.
[0031] The memory 320 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0032] In this embodiment of the present disclosure, the memory 320 stores executable instructions, and the processor 310 can read the executable instructions from the memory 320 and execute the instructions to implement all or part of the steps of any of the above exemplary embodiments of the front-end user behavior prediction method based on artificial intelligence technology.
[0033] Computer-readable storage medium embodiments In addition to the methods and apparatus described above, exemplary embodiments of this disclosure may also be a computer program product or a computer-readable storage medium storing the computer program product, the computer product including computer program instructions that can be executed by a processor to implement all or part of the steps described in any of the artificial intelligence-based front-end user behavior prediction methods in the exemplary embodiments described above.
[0034] Computer program products can be written in any combination of one or more programming languages to perform the operations of the embodiments of this application. Programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages, and scripting languages (e.g., Python). The program code can be executed entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0035] Computer-readable storage media may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example,, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media include: static random access memory (SRAM) having one or more electrically connected wires; electrically erasable programmable read-only memory (EEPROM); erasable programmable read-only memory (EPROM); programmable read-only memory (PROM); read-only memory (ROM); magnetic storage; flash memory; magnetic disk or optical disk; or any suitable combination thereof.
[0036] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A front-end user behavior prediction method based on artificial intelligence technology, characterized in that, include: Collect user behavior data generated on the front-end page and device environment data together as a dataset, perform data preprocessing on the dataset, and associate the preprocessed data with the corresponding user; The preprocessed data is input into a pre-trained artificial intelligence model, which predicts the user's next effective behavior. The artificial intelligence model uses an adapter generated based on device environment data to adjust the output layer results. Preload the corresponding resources based on the predicted next effective action.
2. The method according to claim 1, characterized in that, The dataset, which includes user behavior data generated on the front-end page and device environment data, specifically comprises: When a user clicks, the system collects the time of the click and the coordinates of the button on the front-end page. When a user swipes the page, the system collects the starting point, ending point, swipe speed, and swipe duration. When a user enters content in an input box, the system collects the entered characters, the input intervals between characters, and the input box identifier. The system also collects the time the user spends on each front-end page during the click, swipe, and input events, as behavioral data. The system obtains device information, including the model, operating system and version, and browser type and version, through the browser interface; it also obtains network status information, including network type, network connection speed, and network latency; and uses the device information and network status information as device environment data. The collected dataset is cached in the front end. When the number of cached data exceeds a preset number or a preset time interval is reached, the dataset is transmitted to the back end server via an asynchronous request.
3. The method according to claim 1, characterized in that, The data preprocessing of the dataset specifically includes: In the backend server, time data is uniformly converted into Unix timestamp format; data from three operation types—click, page swiping, and input—are converted into numerical data using one-hot encoding; and all numerical data are normalized.
4. The method according to claim 1, characterized in that, The step of associating the preprocessed data with the corresponding user specifically includes: associating the preprocessed data with the corresponding user based on the user's unique identifier.
5. The method according to claim 1, characterized in that, The step of inputting the preprocessed data into the pre-trained artificial intelligence model specifically includes: Obtain an artificial intelligence model that uses a time series model as the main prediction model and a lightweight neural network as the adapter, wherein the main prediction model includes a recurrent neural network or a long short-term memory network. The artificial intelligence model is trained using historical user data. During training, parameters including the number of iterations and the learning rate are set. The artificial intelligence model is trained using a backpropagation algorithm, and the parameters of the artificial intelligence model are adjusted according to evaluation metrics including accuracy and recall.
6. The method according to claim 5, characterized in that, The prediction of the user's next effective behavior through the artificial intelligence model specifically includes: The master prediction model outputs initial prediction results based on behavioral data, wherein the initial prediction results are each behavior and its corresponding probability of occurrence; The adapter outputs an adjustment parameter vector based on device environment data. The adjustment parameter vector describes the impact of the device environment on all executable behaviors in the current front-end page. The probability of occurrence is adjusted by the adjustment parameter vector. The action with the highest probability of occurrence will be the user's next effective action.
7. The method according to claim 1, characterized in that, The preloading of corresponding resources based on the predicted next effective action specifically includes: Obtain all resources corresponding to the next valid action; Calculate the importance ranking of all resources, and preload the corresponding resources according to the importance ranking order.
8. A front-end user behavior prediction device based on artificial intelligence technology, characterized in that, include: The data acquisition and preprocessing module is used to collect user behavior data generated on the front-end page and device environment data together as a dataset, perform data preprocessing on the dataset, and associate the preprocessed data with the corresponding user. An artificial intelligence prediction module is used to input the preprocessed data into a pre-trained artificial intelligence model and predict the user's next effective behavior through the artificial intelligence model. The artificial intelligence model uses an adapter generated based on device environment data to adjust the output layer results. The resource preloading module is used to preload the corresponding resources based on the predicted next effective action.
9. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the front-end user behavior prediction method based on any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores an information transmission implementation program, which, when executed by a processor, implements the steps of the front-end user behavior prediction method based on artificial intelligence technology as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Application click prediction method and device, electronic equipment and storage medium
CN117493680A
Dynamic front-end content loading optimization method, system and equipment based on user behavior prediction and medium
CN118276981A
Intelligent caching method and device for loading front-end resources as required, equipment and medium
CN119691305A
File loading method and apparatus
WO2025119342A1