User portrait and demand prediction generation method, electronic device, medium and product

By improving the differential privacy algorithm and the hybrid prediction model, the accuracy issues of user profiling and demand prediction were resolved, enabling efficient use of user data while protecting privacy, and improving the accuracy of user profiling and demand prediction.

CN122114997APending Publication Date: 2026-05-29CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD
Filing Date
2026-04-27
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing technologies are unable to accurately build user profiles and predict demand, especially with the exponential growth of user data, resulting in low data utilization efficiency and insufficient user satisfaction and loyalty.

Method used

By improving the differential privacy algorithm, perturbations are added to sensitive features in user behavior data to generate perturbed sensitive features. Then, a hybrid prediction model combining LSTM, Transformer, and fully connected layers is used to generate user feature labels and time series data, and demand prediction is performed using external influencing factors.

Benefits of technology

While protecting personal privacy, the statistical characteristics of the original data are preserved to the greatest extent, improving the accuracy of user profiles and adaptability to market changes, and enhancing the accuracy of demand forecasting and user satisfaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122114997A_ABST
    Figure CN122114997A_ABST
Patent Text Reader

Abstract

The present disclosure provides a user portrait and demand prediction generation method, electronic equipment, medium and product, wherein the method comprises: collecting user behavior data, adding perturbation to sensitive features extracted from the user behavior data by improving a differential privacy algorithm to obtain perturbed sensitive features; dividing the user behavior data into multiple time periods, and generating user feature labels based on the user behavior data of each time period and the corresponding perturbed sensitive features; the user feature labels include at least one of the following: sentiment orientation labels, evaluation preference labels, behavior labels, and static attribute labels; setting label weights for the user feature labels of each time period, arranging the user feature labels of each time period and the label weights in chronological order to generate time series data of the user portrait; obtaining external influencing factors, and inputting the time series data and the external influencing factors into a hybrid prediction model to obtain a demand prediction result of the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of artificial intelligence, and more specifically, to a method, electronic device, medium, and product for generating user profiles and demand forecasts. Background Technology

[0002] With the rapid development of mobile internet and digital technologies, the data scale and product variety of various platforms have grown rapidly. However, users' demands for products are becoming increasingly rich and diverse. Therefore, for platforms, accurately grasping users' real needs and efficiently utilizing massive data resources pose a huge challenge. Building accurate user profile models, transforming complex user information into quantifiable indicators, not only helps users accurately locate their personal needs in the vast ocean of information, but also enables timely responses to user expectations, significantly enhancing user satisfaction and loyalty to the platform and products.

[0003] Existing technologies for demand forecasting based on user profiles include time series forecasting, cluster analysis, factorization machines, and matrix factorization. However, with the exponential growth of user data, these existing technologies cannot accurately construct user profiles and forecast demand. Summary of the Invention

[0004] This disclosure provides at least one method, electronic device, medium, and product for generating user profiles and demand forecasts.

[0005] In a first aspect, embodiments of this disclosure provide a method for generating user profiles and demand predictions, including: Collect user behavior data, and add perturbation to the sensitive features extracted from the user behavior data by improving the differential privacy algorithm to obtain the perturbation sensitive features; The user behavior data is divided into multiple time periods, and user feature tags are generated based on the user behavior data of each time period and the corresponding perturbed sensitive features; wherein, the user feature tags include at least one of the following: sentiment tendency tags, evaluation preference tags, behavior tags, and static attribute tags; Set label weights for user feature labels for each time period, arrange the user feature labels and label weights for each time period in chronological order, and generate time series data of user profiles; External influencing factors are acquired, and the time series data and the external influencing factors are input into a hybrid prediction model to obtain the user demand prediction results.

[0006] In one optional implementation, the step of adding perturbations to the sensitive features extracted from the user behavior data using an improved differential privacy algorithm to obtain perturbed sensitive features includes: Determine the sensitivity of each of the sensitive features on neighboring datasets; Based on the sensitivity and the preset privacy budget, noise is added multiple times to each of the sensitive features to obtain multiple noise-enhanced results for each of the sensitive features; The mean is calculated for multiple noise reduction results of each of the sensitive features, and the perturbed sensitive features are determined based on the mean calculated sensitive features.

[0007] In one optional implementation, determining the perturbed sensitive features based on the sensitive features after mean calculation includes: The sensitive features after mean calculation are grouped to obtain multiple sensitive feature groups; Determine the sensitivity of each of the sensitive feature groups, wherein the sensitivity of each of the sensitive feature groups is the sum of the sensitivities of all sensitive features within that sensitive feature group; Based on the sensitivity corresponding to each of the sensitive feature groups and the preset privacy budget, noise is added to each of the sensitive feature groups, and the sensitive features after adding noise are summed to obtain the perturbed sensitive features.

[0008] In one optional implementation, the hybrid prediction model includes an LSTM layer, a Transformer layer, and a fully connected layer connected in sequence.

[0009] In one optional implementation, the step of inputting the time series data and the external influencing factors into a hybrid prediction model to obtain the user's demand prediction results includes: The time series data and external influencing factors are processed by an LSTM layer to output a first intermediate feature; The first intermediate feature is processed by the Transformer layer to output the second intermediate feature; The label weights are converted into vector form through an embedding layer; The second intermediate feature is fused with the vector form to obtain the fused feature; The fused features are input into a fully connected layer, and the output demand prediction results are used to characterize the probability that a user will purchase the target product at a future time.

[0010] In one optional implementation, the step of inputting the fused features into a fully connected layer and outputting a demand prediction result includes: Extract time-series neighbor sequences and time-series periodic sequences from the time-series data; An attention network is used to aggregate the temporal proximity sequence and the temporal periodic sequence to generate short-term dynamic feature representation and periodic feature representation, respectively; and the short-term dynamic feature representation and the periodic feature representation are concatenated to form a query vector. Calculate the attention weight between the query vector and each key vector in the time memory pool, and based on the attention weight, select at least one target key vector from the time memory pool that is most relevant to the query vector, and determine the target value vector corresponding to the target key vector; The target value vector is weighted and summed according to the attention weights to generate a cue vector. The cue vector is then concatenated with the fused features and input into the fully connected layer for prediction to obtain the demand prediction result.

[0011] In an optional implementation, the method further includes training the hybrid prediction model through the following steps: Define a hyperparameter space, which includes the number of LSTM units, the number of hidden layers, the number of Transformer attention heads, the number of encoder layers, the learning rate, the batch size, and the time window size; Multiple sets of hyperparameter configurations are randomly selected from the hyperparameter space using a random search algorithm, and the performance of each set of hyperparameter configurations is evaluated using K-fold cross-validation. At least one set of target hyperparameter configurations with the best performance is then selected. Bayesian optimization is performed in the neighborhood of the at least one set of target hyperparameter configurations to search for the globally optimal hyperparameter configuration among the at least one set of target hyperparameter configurations, which is the final hyperparameter configuration of the hybrid prediction model.

[0012] Secondly, embodiments of this disclosure also provide an electronic device, including: a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and when the machine-readable instructions are executed by the processor, the steps of the first aspect above, or any possible implementation of the first aspect, are performed.

[0013] Thirdly, embodiments of this disclosure also provide a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of the first aspect or any possible implementation of the first aspect.

[0014] Fourthly, embodiments of this disclosure also provide a computer program product, including a computer program that, when executed by a processor, implements the steps of the first aspect or any possible implementation of the first aspect.

[0015] This disclosure provides a method, electronic device, medium, and product for generating user profiles and demand prediction. In the embodiments of this application, firstly, user behavior data is collected, and a perturbation is added to sensitive features extracted from the user behavior data using an improved differential privacy algorithm to obtain perturbed sensitive features; then, the user behavior data is divided into multiple time periods, and user feature tags are generated based on the user behavior data and corresponding perturbed sensitive features for each time period; wherein, the user feature tags include at least one of the following: sentiment tendency tags, evaluation preference tags, behavioral tags, and static attribute tags; next, tag weights are set for the user feature tags of each time period, and the user feature tags and tag weights of each time period are arranged in chronological order to generate time series data of the user profile; finally, external influencing factors are obtained, and the time series data and the external influencing factors are input into a hybrid prediction model to obtain the user demand prediction results.

[0016] In the above implementation, when processing user behavior data, a perturbation is added to sensitive features using an improved differential privacy algorithm. This processing method utilizes a rigorous mathematical mechanism to ensure that even the addition or deletion of individual user behavior data will not significantly affect the analysis results. This effectively protects personal privacy while maximizing the preservation of the statistical characteristics of the original data, avoiding data distortion caused by excessive obfuscation, and providing a reliable data foundation for the subsequent construction of high-precision user profiles. By generating user feature labels for each time period and innovatively setting label weights for each time period, time-series data is generated based on the user feature labels and label weights. This time-series data characterizes the user's features and quantifies the importance of these features at different times, significantly enhancing the adaptability of user profiles to market changes and the diversity of user behavior, providing more accurate input features for subsequent demand forecasting.

[0017] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0018] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the embodiments will be briefly described below. These drawings are incorporated in and constitute a part of this specification. They illustrate embodiments conforming to this disclosure and, together with the specification, serve to explain the technical solutions of this disclosure. It should be understood that the following drawings only show some embodiments of this disclosure and should not be considered as limiting the scope. Those skilled in the art can obtain other related drawings based on these drawings without creative effort.

[0019] Figure 1 A flowchart illustrating a method for generating user profiles and demand predictions according to an embodiment of this disclosure is shown; Figure 2 A schematic diagram of the structure of a hybrid optimization model provided in an embodiment of this disclosure is shown; Figure 3 A schematic diagram of a user profile and demand prediction generation apparatus provided in an embodiment of this disclosure is shown; Figure 4 A schematic diagram of an electronic device provided in an embodiment of the present disclosure is shown. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure 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 disclosure, and not all of them. The components of the embodiments of this disclosure described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed disclosure, but merely represents selected embodiments of this disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure.

[0021] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0022] In this document, the term "and / or" merely describes a relationship, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.

[0023] With the rapid development of mobile internet and digital technologies, the data scale and product variety of various platforms have grown rapidly. However, users' demands for products are becoming increasingly rich and diverse. Therefore, for platforms, accurately grasping users' real needs and efficiently utilizing massive data resources pose a huge challenge. Building accurate user profile models, transforming complex user information into quantifiable indicators, not only helps users accurately locate their personal needs in the vast ocean of information, but also enables timely responses to user expectations, significantly enhancing user satisfaction and loyalty to the platform and products.

[0024] Existing technologies for demand forecasting based on user profiles include time series forecasting, cluster analysis, factorization machines, and matrix factorization. However, with the exponential growth of user data, these existing technologies cannot accurately construct user profiles and forecast demand.

[0025] Based on the above research, this disclosure provides a method, electronic device, medium, and product for generating user profiles and demand prediction. In the embodiments of this application, firstly, user behavior data is collected, and a perturbation is added to the sensitive features extracted from the user behavior data using an improved differential privacy algorithm to obtain perturbed sensitive features; then, the user behavior data is divided into multiple time periods, and user feature labels are generated based on the user behavior data and corresponding perturbed sensitive features for each time period; wherein, the user feature labels include at least one of the following: sentiment tendency labels, evaluation preference labels, behavioral labels, and static attribute labels; next, label weights are set for the user feature labels of each time period, and the user feature labels and label weights of each time period are arranged in chronological order to generate time series data of the user profile; finally, external influencing factors are obtained, and the time series data and the external influencing factors are input into a hybrid prediction model to obtain the user demand prediction results.

[0026] In the above implementation, when processing user behavior data, a perturbation is added to sensitive features using an improved differential privacy algorithm. This processing method utilizes a rigorous mathematical mechanism to ensure that even the addition or deletion of individual user behavior data will not significantly affect the analysis results. This effectively protects personal privacy while maximizing the preservation of the statistical characteristics of the original data, avoiding data distortion caused by excessive obfuscation, and providing a reliable data foundation for the subsequent construction of high-precision user profiles. By generating user feature labels for each time period and innovatively setting label weights for each time period, time-series data is generated based on the user feature labels and label weights. This time-series data characterizes the user's features and quantifies the importance of these features at different times, significantly enhancing the adaptability of user profiles to market changes and the diversity of user behavior, providing more accurate input features for subsequent demand forecasting.

[0027] To facilitate understanding of this embodiment, a method for generating user profiles and demand forecasts disclosed in this disclosure will first be described in detail. The execution entity of this method is generally an electronic device with a certain computing power. In some possible implementations, this method can be implemented by a processor calling computer-readable instructions stored in memory.

[0028] See Figure 1 The diagram shows a flowchart of a method for generating user profiles and demand predictions according to an embodiment of this disclosure. The method includes steps S101 to S104, wherein: S101: Collect user behavior data, and add perturbations to the sensitive features extracted from the user behavior data by improving the differential privacy algorithm to obtain the perturbated sensitive features.

[0029] In this embodiment, the Flink architecture can be used to extract user behavior data from various dimensions in real time, while the Hive component is used to periodically acquire user behavior data, forming an offline data warehouse. This allows user behavior information, user feedback data, user preference information, and other data to be aggregated from multiple channels into a centralized data warehouse.

[0030] For example, the Flink architecture can be used to obtain user behavior records on websites or apps from application platforms, including but not limited to user browsing, searching, clicking, purchasing, collecting, and rating data; or, it can be used to connect to social or commercial platforms through API interfaces to collect user interaction information on these platforms, such as forwarding, liking, and commenting data; or, it can be used to obtain user device information (such as operating system, browser type), geographical location, and access time when accessing the platform through log analysis; or, it can obtain data such as direct feedback and suggestions from users in channels such as customer service, community forums, and product review sections.

[0031] After obtaining user behavior data, sensitive features can be extracted from the user behavior data. Then, by improving the differential privacy algorithm, perturbation is added to the sensitive features to obtain the perturbed sensitive features.

[0032] S102: Divide user behavior data into multiple time periods, and generate user feature labels based on user behavior data in each time period and corresponding sensitive features after perturbation; wherein, user feature labels include at least one of the following: sentiment tendency label, evaluation preference label, behavior label, static attribute label.

[0033] Here, sentiment tags are used to indicate the user's emotional bias towards product feedback; for example, the sentiment tag could be a positive preference, a neutral preference, or a negative preference. Feedback preference tags are used to indicate keywords that appear repeatedly in user feedback. Behavioral tags are used to indicate user actions related to the product. Static attribute tags are used to indicate the user's static attribute data, where static attribute tags can be age tags, gender tags, or geographic location tags.

[0034] S103: Set label weights for user feature labels for each time period, arrange the user feature labels and label weights for each time period in chronological order, and generate time series data of user profiles.

[0035] After generating user feature tags for user behavior data in each time period, a tag weight can be set for each user feature tag. The tag weight can be dynamically adjusted based on changes in user behavior across different time periods.

[0036] After obtaining the label weights, the user feature labels and label weights for each time period can be arranged in chronological order to obtain the time series data of the user profile.

[0037] S104: Obtain external influencing factors and input the time series data and external influencing factors into the hybrid forecasting model to obtain the user demand forecast results.

[0038] External influencing factors are those factors that can affect the generation of user feature tags. For example, external influencing factors can be positive factors, promotional activities, etc.

[0039] The hybrid prediction model comprises a sequentially connected LSTM layer, a Transformer layer, and a fully connected layer. After acquiring external influencing factors, time-series data and these factors are input into the sequentially connected LSTM, Transformer, and fully connected layers for processing, thereby obtaining the user demand prediction result. The demand prediction result can be a probability value, generated based on the dynamic changes in the label weights of each time period in the user profile time-series data, representing the likelihood of a user purchasing the target product within a preset future time window.

[0040] In the above implementation, when processing user behavior data, a perturbation is added to sensitive features using an improved differential privacy algorithm. This processing method utilizes a rigorous mathematical mechanism to ensure that even the addition or deletion of individual user behavior data will not significantly affect the analysis results. This effectively protects personal privacy while maximizing the preservation of the statistical characteristics of the original data, avoiding data distortion caused by excessive obfuscation, and providing a reliable data foundation for the subsequent construction of high-precision user profiles. By generating user feature labels for each time period and innovatively setting label weights for each time period, time-series data is generated based on the user feature labels and label weights. This time-series data characterizes the user's features and quantifies the importance of these features at different times, significantly enhancing the adaptability of user profiles to market changes and the diversity of user behavior, providing more accurate input features for subsequent demand forecasting.

[0041] In this embodiment, step S102 above adds perturbation to the sensitive features extracted from the user behavior data by improving the differential privacy algorithm to obtain the perturbated sensitive features, specifically including the following steps: S10211: Determine the sensitivity of each sensitive feature on neighboring datasets; S10212: Based on sensitivity and a preset privacy budget, noise is added multiple times to each sensitive feature to obtain multiple noise-enhanced results for each sensitive feature; S10213: Perform a mean operation on multiple noise reduction results for each sensitive feature, and determine the perturbed sensitive feature based on the mean-operated sensitive feature.

[0042] First, determine an appropriate privacy budget (ε), which is a key parameter for measuring the strength of privacy protection. A smaller ε value means stronger privacy protection, but it may also lead to a decrease in the accuracy of the analysis results. In user profile prediction scenarios, ε=1 is usually chosen, which is a relatively balanced choice that provides a certain degree of privacy protection while retaining the usefulness of the model's predictions.

[0043] For aggregate queries involved in user profile prediction (such as statistical information like user age distribution, gender distribution, and geographic location), the Laplace mechanism is used as a noise addition strategy. The Laplace mechanism is suitable for privacy protection of both discrete and continuous data, and is mathematically easy to understand and implement. Its working principle is as follows: First, determine the sensitivity of the query function f. This refers to the maximum difference in the calculated results of f across all adjacent databases (i.e., databases that differ by at most one record). Sensitivity reflects how sensitive a query is, that is, the maximum possible change in the result caused by a single data point.

[0044] Then, noise can be added to each sensitive feature based on sensitivity and privacy budget. To protect privacy, random noise from a Laplace distribution is added to the query results. The magnitude of the noise depends on the chosen privacy parameter ε and the query sensitivity. Relevant. Specifically, for a real-valued query, the added noise Y comes from a source with a mean of 0 and a scale (or standard deviation) of 0. The Laplace distribution is used. The scaling parameter determines the magnitude of the noise; the smaller the ε, the greater the added noise, resulting in stronger privacy protection, but at the same time, the accuracy of the query will decrease.

[0045] In this embodiment, for each sensitive feature, random noise with a Laplace distribution can be added multiple times to obtain multiple noise-enhanced results. Next, the average of the multiple noise-enhanced results for each sensitive feature can be calculated to obtain the perturbed sensitive feature, mathematically represented as follows: ;in, , K represents the true value of the sensitive feature, and K represents the total number of times noise was added. These are sensitive features after perturbation.

[0046] The original differential privacy processing directly adds Laplace noise to each query result, which may lead to low data accuracy, especially in cases of high noise levels. In this embodiment, by adding noise multiple times to the same sensitive feature and averaging the results, the impact of individual noise is reduced, and the accuracy of the overall results is improved.

[0047] In this embodiment of the application, after averaging the multiple noise results of each sensitive feature to obtain the mean-averaged sensitive feature, the mean-averaged sensitive feature can be directly determined as the perturbed sensitive feature.

[0048] Alternatively, the above-mentioned step S10213, which determines the perturbed sensitive features based on the sensitive features after mean calculation, further includes the following steps: S11, The sensitive features after the mean calculation are grouped to obtain multiple sensitive feature groups; S12, determine the sensitivity of each sensitive feature group, wherein the sensitivity of each sensitive feature group is the sum of the sensitivities of all sensitive features within that sensitive feature group; S13. Based on the sensitivity and preset privacy budget corresponding to each sensitive feature group, noise is added to each sensitive feature group in the sensitive feature group, and the sensitive features after adding noise are summed to obtain the perturbed sensitive features.

[0049] The sensitive features after the mean calculation are grouped according to the type of sensitive features, resulting in multiple sensitive feature groups. Each sensitive feature group corresponds to one or more types of sensitive features.

[0050] Next, the sensitivity of each sensitive feature group can be determined. Then, based on the sensitivity and privacy budget, noise is added to each sensitive feature group within each sensitive feature group. Finally, the sensitive features with added noise are summed to obtain the perturbed sensitive features, mathematically represented as follows: ;in, , Let m represent the query function for the j-th sensitive feature group, and m represent the total number of sensitive feature groups. This indicates the sensitive features after the disturbance.

[0051] By grouping sensitive features, adding noise to each group separately, and then combining the results, the distribution of noise can be controlled more precisely, reducing its impact on individual features. This reduces the influence of noise and improves data accuracy.

[0052] It's important to note that different privacy budgets can be set for each query function. The pre-set total privacy budget is allocated across different query functions, and this allocation can be based on the importance and sensitivity of the features, thereby optimizing the overall privacy protection and data accuracy. The allocation of privacy budgets to different query functions can be represented as follows: in, This represents the privacy budget allocated to the query function for the j-th sensitive feature group. This represents the query weight of the j-th sensitive feature group. This indicates the relative importance of the k-th query function in the overall privacy budget allocation.

[0053] Traditional differential privacy processing typically uses the same privacy budget (ε) for all query results, which may lead to excessively high or low noise for some features, affecting overall data quality. In this embodiment, the privacy budget (ε) is allocated reasonably based on the importance and sensitivity of the features, optimizing the accuracy of each feature while ensuring privacy protection. For example, larger ε values ​​are assigned to more important features to reduce the impact of noise. Furthermore, this embodiment performs multiple noise additions and averaging processes, which more smoothly reflect the distribution of real data, improving model stability and predictive performance. It can also be flexibly adjusted according to specific application scenarios to adapt to different data characteristics and needs, improving practicality.

[0054] After perturbing the sensitive features extracted from the user behavior data using an improved differential privacy algorithm, the user behavior data can be divided into multiple time periods. Based on the user behavior data and the corresponding perturbed sensitive features for each time period, user feature labels are generated. The specific process is described below: (1) Emotional tendency label.

[0055] Here, user behavior data for each time period (such as user feedback and reviews of products) can be preprocessed into the RoBERTa model, and then RoBERTa can be used for sentiment analysis. The RoBERTa model understands the contextual semantics of the text and outputs the sentiment tendency (e.g., positive, negative, neutral) for each review. Based on the review analysis results, labels such as "positive review preference" and "negative review preference" can be generated for users.

[0056] (2) Evaluation preference labels.

[0057] Here, keyword extraction technology can be used to identify keywords that are repeatedly mentioned in user comments, and preference tags can be generated based on these keywords.

[0058] (3) Behavioral tags.

[0059] Here, user behavior data for each time period (such as app browsing frequency, purchase history, etc.) can be converted into time series data, and RoBERTa can be used to analyze user behavior patterns. Based on this behavior pattern analysis, tags are then generated.

[0060] (4) Static attribute tags.

[0061] After obtaining the user feature tags described above, the generated user feature tags can be integrated, redundancy removed, and a complete time-series user profile tag system can be formed.

[0062] After generating user feature tags, a tag weight can be set for each user feature tag. The tag weight can be adjusted based on changes in user behavior over different time periods. Specific methods for adjusting the tag weight include: Frequency-based adjustment: If a user's frequency of a specific behavior (such as purchasing) is significantly higher than the average in a given week, the weight of the corresponding tag is increased. For example, if a user's purchasing behavior increases, the tag weight of the behavior tag will be appropriately increased.

[0063] Based on trends: If the value of a user characteristic tag shows an upward trend over several consecutive weeks, it indicates that the tag has a greater impact on the user's current needs, and its weight should be increased accordingly. For example, if a user has been using a certain keyword to comment for several weeks, the weight of the evaluation preference tag can be appropriately increased.

[0064] After determining the label weights for each user feature label, the label weights of all user feature labels are normalized to ensure that the sum of all label weights is 1, which facilitates comparison and subsequent model input.

[0065] Next, the calculated tag weights for each time period are serialized to form time-series data of the user profile, reflecting changes in user needs and interests over time. This process not only captures specific behavioral characteristics of users in different time periods but also reflects the dynamic changes in user needs and interests over time through weight adjustments, providing strong support for subsequent precise data operations and model predictions.

[0066] In this embodiment of the application, step S104 inputs the time series data and the external influencing factors into the hybrid prediction model to obtain the user demand prediction result, which specifically includes the following steps: Step S1041: Process the time series data and the external influencing factors through an LSTM layer to output the first intermediate feature; Step S1042: Process the first intermediate feature through the Transformer layer to output the second intermediate feature; Step S1043: Convert the label weights into vector form through the embedding layer; Step S1044: Perform feature fusion between the second intermediate feature and the vector form to obtain the fused feature; Step S1045: Input the fused features into the fully connected layer and output the demand prediction result, wherein the demand prediction result is used to characterize the probability that a user will purchase the target product at a future time.

[0067] Here, we can use the time series data of the generated user profiles and external influencing factors to build a Prompt-LSTM-Transformer hybrid prediction model for demand prediction using a deep learning model. The expected goal of demand prediction is set as a binary classification problem, such as whether or not a certain product will be purchased. At the same time, considering the dynamic nature of user profiles, user tag weights are used as input features to improve the accuracy of prediction.

[0068] In this embodiment, an LSTM-Transformer hybrid prediction model can be pre-built, wherein, for example... Figure 2 As shown, the hybrid prediction model consists of an LSTM layer, a Transformer layer, and a fully connected layer connected in sequence.

[0069] In practice, the time series data and external influencing factors are first input into the LSTM layer for processing to obtain the first intermediate feature. For example, the generated user profile time series data u(t) (including user profile labels and their weights changing over time), seasonal factors S(t) (such as month, day of the week, and holiday markers), and discount activity information p(t) are used as input layers, where t represents a time point.

[0070] LSTM units capture long-term dependencies in time-series data. They are an RNN model, an improvement on simple recurrent neural networks to avoid the vanishing gradient problem and allow for longer memory. For each time step, an LSTM contains: (1) Forget Gate: Determines which information from the previous time step to forget; (2) Input gate: determines which of the new information is worth storing; (3) Cellular state: Integrating forgotten and input information to update long-term memory; (4) Output gate: Determines what information to output at the current time step based on the cell state.

[0071] The output of the LSTM at each time step i to n can be represented as: ;in, It is the parameter set of LSTM.

[0072] Next, the first intermediate feature is input into the Transformer layer for processing, and the second intermediate feature is output.

[0073] The Transformer is a deep learning model for natural language processing that focuses on global dependencies in sequences. It introduces a self-attention mechanism, allowing the model to pay parallel and global attention to all positions in a sequence when processing sequential data. This helps the model understand long-range dependencies in the input sequence without requiring a recursive structure. The Transformer layer includes: (1) Self-attention: Allows the model to weigh the importance of different parts of the input sequence; (2) Multi-head attention: Extends the self-attention mechanism, enabling the model to learn information from different representative subspaces; (3) Feedforward Neural Network (FFN): performs further nonlinear transformation on the features output by the attention layer.

[0074] This can be expressed as: .here, These represent the parameters of the Transformer layer.

[0075] Next, the label weights are converted into vector form through the embedding layer. Then, it is fused with the second intermediate feature to obtain the fused feature, which is represented as: ;in, It is the final layer output of the Transformer or the output after aggregation (i.e., fused features).

[0076] The final prediction needs to be completed through a fully connected layer. At this point, the fused features can be input into the fully connected layer, and the output is the desired prediction result y, which can be mathematically represented as: ;in, It is an activation function. These are the parameters of the fully connected layer.

[0077] In this embodiment, step S1045 inputs the fused features into the fully connected layer and outputs the demand prediction result, specifically including the following steps: Step S10451: Extract time-series neighbor sequences and time-series periodic sequences from the time-series data; Step S10452: An attention network is used to aggregate the temporal neighbor sequence and the temporal periodic sequence to generate short-term dynamic feature representation and periodic feature representation respectively; and the short-term dynamic feature representation and the periodic feature representation are concatenated as a query vector. Step S10453: Calculate the attention weight between the query vector and each key vector in the time memory pool, and select at least one target key vector with the highest relevance to the query vector from the time memory pool according to the attention weight, and determine the target value vector corresponding to the target key vector; Step S10454: The target value vector is weighted and summed according to the attention weights to generate a cue vector, and the cue vector is concatenated with the fused features and input into the fully connected layer for prediction to obtain the demand prediction result.

[0078] While the model constructed using the methods described in steps S1041 to S1045 above already possesses strong predictive capabilities, its capture of certain characteristics of time-series sequences remains insufficient. Furthermore, the model's generalization ability with zero or few samples, or even across scenarios (such as predicting other categories of commercial ordering demand), heavily relies on large-scale, multi-business scenario datasets. Large-scale datasets require significant training costs, such as computational resources and training parameter costs. To address this, this embodiment introduces an adaptive dynamic prompt generation learning strategy based on a time memory pool.

[0079] Time series data have two characteristics: Temporal proximity: Recent trends can influence future outcomes, demonstrating a temporal dependency. For example, if the same product was ordered in the past few days, it is also likely that the same product will be ordered in the next few days.

[0080] Time-series patterns exhibit a certain periodicity. For example, product sales may show similar trends during specific time periods within a week.

[0081] Based on this, we can first extract temporal neighbor sequences and temporal periodic sequences from the time series data; then, we can aggregate the temporal neighbor sequences using a first attention network to obtain short-term dynamic feature representations. The mathematical representation of the temporal neighbor sequences is as follows: The mathematical representation of short-term dynamic features is as follows: and ;in, The temporally adjacent sequences are used as the basis, and the temporally periodic sequences are aggregated through a second attention network to obtain a periodic feature representation, mathematically represented as: ,in, It is a time-series periodic sequence.

[0082] Next, the short-term dynamic feature representation and the periodic feature representation are concatenated to form the query vector. This query vector is then compared with the key vectors in the memory pool. By calculating the attention weights between the query vector and the key vectors, the most relevant key vector is selected as the target key vector. Based on the target key vector, the corresponding value vectors are extracted from the memory pool and weighted and summed to generate the final cue vector. Finally, the cue vector is concatenated with the fused features and input into the fully connected layer for prediction, yielding the demand prediction value.

[0083] Among them, the memory pool is defined as ;in, These are learnable parameters.

[0084] In the above implementation, by learning the spatiotemporal features in the memory pool, the model can more flexibly adapt to different types of datasets. This flexibility allows the model to better utilize learned knowledge for generalization when facing new spatiotemporal prediction tasks. Cue-based learning allows the model to quickly adapt to new tasks or data distributions through prompts, working effectively even with limited data, thus improving data utilization efficiency. Since the prompts are dynamically generated based on spatiotemporal attributes, rather than being fixed, this approach reduces the risk of overfitting the model to specific datasets. Through a shared memory pool, different tasks can benefit from jointly learned spatiotemporal knowledge, simplifying the multi-task learning process.

[0085] In this embodiment, the hybrid prediction model can be trained through the following steps: First, define the hyperparameter space, which includes the number of LSTM units, the number of hidden layers, the number of Transformer attention heads, the number of encoder layers, the learning rate, the batch size, and the time window size. Secondly, multiple sets of hyperparameter configurations are randomly selected from the hyperparameter space using a random search algorithm, and the performance of each set of hyperparameter configurations is evaluated using K-fold cross-validation, so as to select at least one set of target hyperparameter configurations with the best performance. Next, Bayesian optimization is performed in the neighborhood of the at least one set of target hyperparameter configurations to search for the globally optimal hyperparameter configuration among the at least one set of target hyperparameter configurations, which serves as the final hyperparameter configuration of the hybrid prediction model.

[0086] During the training phase of the hybrid optimization model, a pre-set test set can be used for hyperparameter configuration training. The hyperparameter tuning process is as follows: First, define the hyperparameter space.

[0087] Hyperparameters related to LSTM: number of units, number of hidden layers, and activation function selection for input gate, forget gate, and output gate.

[0088] Transformer-related hyperparameters: number of attention heads (num_heads), number of encoder / decoder layers (num_layers), and word embedding dimension (embedding_dim).

[0089] Shared hyperparameters include: learning rate, batch size, optimizer type and parameters (e.g., Adam's β1, β2), regularization factor, etc.

[0090] Hyperparameters specific to time series: Time window size (window_size) is used for the length of the input sequence to LSTM, and whether to use a sliding window, etc.

[0091] Next, set the number of explorations, for example, 100, and define a reasonable range of values ​​for each hyperparameter. For each search, randomly select a set of hyperparameter configurations. Train and evaluate the model on the training set using K-fold cross-validation (RMSE as the evaluation metric), recording the hyperparameter combinations and their corresponding performance metrics for each attempt. Then, identify the top-performing hyperparameter configurations during the random search process, analyze each configuration, and determine the hyperparameter configurations that have a significant impact on the performance of the hybrid optimization model.

[0092] In the relatively optimal regions discovered through random search, Bayesian optimization is used to further refine the search for the global optimum. First, based on the best result from the random search, a Gaussian Process Regression (GPR) model is initialized as a surrogate model, which learns the relationship between hyperparameter configuration and performance. A sampling function, Expected Improvement (E), is chosen, which measures the potential benefit of sampling at a given point. The next most worthwhile hyperparameter configuration to explore is determined based on the GPR model and the sampling function. The model is then trained and evaluated, with new data points added to the historical dataset to update the GPR model. These steps are repeated until a preset stopping condition is met (e.g., budget exhaustion, insignificant performance improvement, or reaching a preset maximum number of iterations). Subsequently, the optimization progress is checked after each iteration. If slow performance improvement is observed, the parameters of the Bayesian optimization are adjusted, such as by increasing exploration noise or changing the sampling function. Finally, the hyperparameter configuration with the best performance during the Bayesian optimization process is selected as the final model configuration.

[0093] This technical approach enables the efficient generation of user profiles, accurate prediction of user needs, and strict protection of user privacy. It combines the powerful data processing and learning capabilities of deep learning models with the security of improved differential privacy technology, providing robust technical support for personalized services and precision marketing on big data products and social media platforms. It also serves as a model for privacy protection and data analysis for other industries that rely on user data. In the future, with continuous technological advancements, this method is expected to mature further and better serve various industries undergoing digital transformation.

[0094] As described above, the technical solution of this application introduces an improved differential privacy technique when processing user data. By adding random noise to the dataset, it ensures that the addition or deletion of individual user data will not significantly affect the analysis results, thereby effectively protecting personal privacy and making up for the shortcomings of existing technologies that do not explicitly address user data privacy and security issues.

[0095] The technical solution presented in this application calculates the weight of each tag over different time periods, reflecting the changes in user needs and interests over time, and implements a dynamic adjustment mechanism. This enhances the model's timeliness and predictive accuracy, enabling it to better adapt to market changes and the diversity of user behavior.

[0096] This application proposes a Prompt-LSTM-Transformer hybrid model, which innovatively combines the advantages of LSTM models in capturing long-term dependencies in time series data with the ability of Transformer models to process global contextual information. At the same time, it introduces a temporal memory pool to construct dynamic adaptive prompts, which greatly improves the model's generalization learning ability, reduces the risk of overfitting to specific tasks, and strengthens the ability to capture changes in user behavior patterns and business needs. Compared with the previously used multi-layer deep CNN models, it solves their limitations in processing complex semantic and sequence data.

[0097] This application's technical solution integrates random search and Bayesian optimization for hyperparameter tuning, ensuring both optimized model performance and generalization ability. This method not only finds the optimal hyperparameter configuration through extensive exploration and precise tuning, but also guarantees model stability and effectiveness through a rigorous model evaluation process and continuous monitoring. Compared to existing technologies, this application's model optimization strategy is more systematic and efficient.

[0098] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0099] Based on the same inventive concept, this disclosure also provides a user profile and demand prediction generation device corresponding to the user profile and demand prediction generation method. Since the principle of the device in this disclosure for solving the problem is similar to the user profile and demand prediction generation method described above in this disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.

[0100] Reference Figure 3 The diagram shown is a schematic of a user profile and demand prediction generation device provided in an embodiment of this disclosure. The device includes: a feature perturbation unit 10, a tag generation unit 20, a weight setting unit 30, and a demand prediction unit 40; wherein, The feature perturbation unit 10 is used to collect user behavior data and add perturbation to the sensitive features extracted from the user behavior data through an improved differential privacy algorithm to obtain the perturbated sensitive features. The tag generation unit 20 is used to divide the user behavior data into multiple time periods, and generate user feature tags based on the user behavior data of each time period and the corresponding perturbed sensitive features; wherein, the user feature tags include at least one of the following: sentiment tendency tags, evaluation preference tags, behavior tags, and static attribute tags; The weight setting unit 30 is used to set label weights for user feature labels in each time period, and to arrange the user feature labels and label weights in each time period in chronological order to generate time series data of user profiles. The demand forecasting unit 40 is used to acquire external influencing factors and input the time series data and the external influencing factors into the hybrid forecasting model to obtain the user's demand forecasting results.

[0101] In one possible implementation, the feature perturbation unit 10 is used for: Determine the sensitivity of each of the sensitive features on neighboring datasets; Based on the sensitivity and the preset privacy budget, noise is added multiple times to each of the sensitive features to obtain multiple noise-enhanced results for each of the sensitive features; The mean is calculated for multiple noise reduction results of each of the sensitive features, and the perturbed sensitive features are determined based on the mean calculated sensitive features.

[0102] In one possible implementation, the feature perturbation unit 10 is used for: The sensitive features after mean calculation are grouped to obtain multiple sensitive feature groups; Determine the sensitivity of each of the sensitive feature groups, wherein the sensitivity of each of the sensitive feature groups is the sum of the sensitivities of all sensitive features within that sensitive feature group; Based on the sensitivity corresponding to each of the sensitive feature groups and the preset privacy budget, noise is added to each of the sensitive feature groups, and the sensitive features after adding noise are summed to obtain the perturbed sensitive features.

[0103] In one possible implementation, the hybrid prediction model includes an LSTM layer, a Transformer layer, and a fully connected layer connected in sequence.

[0104] In one possible implementation, the demand forecasting unit 40 is used for: The time series data and external influencing factors are processed by an LSTM layer to output a first intermediate feature; The first intermediate feature is processed by the Transformer layer to output the second intermediate feature; The label weights are converted into vector form through an embedding layer; The second intermediate feature is fused with the vector form to obtain the fused feature; The fused features are input into a fully connected layer, and the output demand prediction results are used to characterize the probability that a user will purchase the target product at a future time.

[0105] In one possible implementation, the demand forecasting unit 40 is used for: Extract time-series neighbor sequences and time-series periodic sequences from the time-series data; An attention network is used to aggregate the temporal proximity sequence and the temporal periodic sequence to generate short-term dynamic feature representation and periodic feature representation, respectively; and the short-term dynamic feature representation and the periodic feature representation are concatenated to form a query vector. Calculate the attention weight between the query vector and each key vector in the time memory pool, and based on the attention weight, select at least one target key vector from the time memory pool that is most relevant to the query vector, and determine the target value vector corresponding to the target key vector; The target value vector is weighted and summed according to the attention weights to generate a cue vector. The cue vector is then concatenated with the fused features and input into the fully connected layer for prediction to obtain the demand prediction result.

[0106] In one possible implementation, the device is also used for: Define a hyperparameter space, which includes the number of LSTM units, the number of hidden layers, the number of Transformer attention heads, the number of encoder layers, the learning rate, the batch size, and the time window size; Multiple sets of hyperparameter configurations are randomly selected from the hyperparameter space using a random search algorithm, and the performance of each set of hyperparameter configurations is evaluated using K-fold cross-validation. At least one set of target hyperparameter configurations with the best performance is then selected. Bayesian optimization is performed in the neighborhood of the at least one set of target hyperparameter configurations to search for the globally optimal hyperparameter configuration among the at least one set of target hyperparameter configurations, which is the final hyperparameter configuration of the hybrid prediction model.

[0107] The processing flow of each module in the device and the interaction flow between each module can be referred to the relevant descriptions in the above method embodiments, and will not be detailed here.

[0108] Corresponding to Figure 1 In addition to the method for generating user profiles and demand predictions, this disclosure also provides an electronic device 400, such as... Figure 4 The diagram shown is a structural schematic of an electronic device 400 provided in an embodiment of this disclosure, including: The system includes a processor 41, a memory 42, and a bus 43. The memory 42 stores execution instructions and includes main memory 421 and external memory 422. The main memory 421, also called internal memory, temporarily stores the computational data in the processor 41, as well as data exchanged with external memory such as a hard disk. The processor 41 exchanges data with the external memory 422 through the main memory 421. When the electronic device 400 is running, the processor 41 communicates with the memory 42 through the bus 43, causing the processor 41 to execute the following instructions: Collect user behavior data, and add perturbation to the sensitive features extracted from the user behavior data by improving the differential privacy algorithm to obtain the perturbation sensitive features; The user behavior data is divided into multiple time periods, and user feature tags are generated based on the user behavior data of each time period and the corresponding perturbed sensitive features; wherein, the user feature tags include at least one of the following: sentiment tendency tags, evaluation preference tags, behavior tags, and static attribute tags; Set label weights for user feature labels for each time period, arrange the user feature labels and label weights for each time period in chronological order, and generate time series data of user profiles; External influencing factors are acquired, and the time series data and the external influencing factors are input into a hybrid prediction model to obtain the user demand prediction results.

[0109] This disclosure also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program performs the steps of the user profile and demand prediction generation method described in the above-described method embodiments. The storage medium can be a volatile or non-volatile computer-readable storage medium.

[0110] This disclosure also provides a computer program product carrying program code. The program code includes instructions that can be used to execute the steps of the user profile and demand prediction generation method described in the above method embodiments. For details, please refer to the above method embodiments, which will not be repeated here.

[0111] The aforementioned computer program product can be implemented through hardware, software, or a combination thereof. In one optional embodiment, the computer program product is specifically embodied in a computer storage medium; in another optional embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.

[0112] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. In the several embodiments provided in this disclosure, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division; in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection may be through some communication interfaces; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.

[0113] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0114] In addition, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0115] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0116] Finally, it should be noted that the above-described embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.

Claims

1. A method for generating user profiles and demand forecasting, characterized in that, include: Collect user behavior data, and add perturbation to the sensitive features extracted from the user behavior data by improving the differential privacy algorithm to obtain the perturbation sensitive features; The user behavior data is divided into multiple time periods, and user feature tags are generated based on the user behavior data of each time period and the corresponding perturbed sensitive features; wherein, the user feature tags include at least one of the following: sentiment tendency tags, evaluation preference tags, behavior tags, and static attribute tags; Set label weights for user feature labels for each time period, arrange the user feature labels and label weights for each time period in chronological order, and generate time series data of user profiles; External influencing factors are acquired, and the time series data and the external influencing factors are input into a hybrid prediction model to obtain the user demand prediction results.

2. The method according to claim 1, characterized in that, The step of adding perturbations to sensitive features extracted from user behavior data using an improved differential privacy algorithm to obtain perturbed sensitive features includes: Determine the sensitivity of each of the sensitive features on neighboring datasets; Based on the sensitivity and the preset privacy budget, noise is added multiple times to each of the sensitive features to obtain multiple noise-enhanced results for each of the sensitive features; The mean is calculated for multiple noise reduction results of each of the sensitive features, and the perturbed sensitive features are determined based on the mean calculated sensitive features.

3. The method according to claim 2, characterized in that, The determination of the perturbed sensitive features based on the sensitive features after mean calculation includes: The sensitive features after mean calculation are grouped to obtain multiple sensitive feature groups; Determine the sensitivity of each of the sensitive feature groups, wherein the sensitivity of each of the sensitive feature groups is the sum of the sensitivities of all sensitive features within that sensitive feature group; Based on the sensitivity corresponding to each of the sensitive feature groups and the preset privacy budget, noise is added to each of the sensitive feature groups, and the sensitive features after adding noise are summed to obtain the perturbed sensitive features.

4. The method according to claim 1, characterized in that, The hybrid prediction model comprises an LSTM layer, a Transformer layer, and a fully connected layer connected in sequence.

5. The method according to claim 4, characterized in that, The step of inputting the time series data and the external influencing factors into a hybrid prediction model to obtain the user's demand prediction results includes: The time series data and external influencing factors are processed by an LSTM layer to output a first intermediate feature; The first intermediate feature is processed by the Transformer layer to output the second intermediate feature; The label weights are converted into vector form through an embedding layer; The second intermediate feature is fused with the vector form to obtain the fused feature; The fused features are input into a fully connected layer, and the output demand prediction results are used to characterize the probability that a user will purchase the target product at a future time.

6. The method according to claim 5, characterized in that, The step of inputting the fused features into the fully connected layer and outputting the demand prediction result includes: Extract time-series neighbor sequences and time-series periodic sequences from the time-series data; An attention network is used to aggregate the temporal proximity sequence and the temporal periodic sequence to generate short-term dynamic feature representation and periodic feature representation, respectively; and the short-term dynamic feature representation and the periodic feature representation are concatenated to form a query vector. Calculate the attention weight between the query vector and each key vector in the time memory pool, and based on the attention weight, select at least one target key vector from the time memory pool that is most relevant to the query vector, and determine the target value vector corresponding to the target key vector; The target value vector is weighted and summed according to the attention weights to generate a cue vector. The cue vector is then concatenated with the fused features and input into the fully connected layer for prediction to obtain the demand prediction result.

7. The method according to claim 4, characterized in that, The method further includes training the hybrid prediction model through the following steps: Define a hyperparameter space, which includes the number of LSTM units, the number of hidden layers, the number of Transformer attention heads, the number of encoder layers, the learning rate, the batch size, and the time window size; Multiple sets of hyperparameter configurations are randomly selected from the hyperparameter space using a random search algorithm, and the performance of each set of hyperparameter configurations is evaluated using K-fold cross-validation. At least one set of target hyperparameter configurations with the best performance is then selected. Bayesian optimization is performed in the neighborhood of the at least one set of target hyperparameter configurations to search for the globally optimal hyperparameter configuration among the at least one set of target hyperparameter configurations, which is the final hyperparameter configuration of the hybrid prediction model.

8. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, they perform the steps of the user profile and demand prediction generation method as described in any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the user profile and demand prediction generation method as described in any one of claims 1 to 7.

10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of the method for generating user profiles and demand forecasts as described in any one of claims 1 to 7.