A visual large-screen component recommendation method based on a Transformer model
By using a Transformer-based approach combined with a user interest-guided sparse attention mechanism, user features are dynamically filtered and modeled. This addresses the issues of insufficient user feature fusion and lack of personalization in existing visualization dashboard component recommendations, enabling efficient and personalized component recommendations.
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-07
- Publication Date
- 2026-07-21
AI Technical Summary
Existing methods for recommending components for large-screen visualization suffer from insufficient user feature fusion, inadequate attention to user relevance in recommendation models, and insufficient personalization and dynamic adaptability of component libraries, resulting in recommendation results that lack specificity and are inefficient.
We employ a Transformer-based approach, which involves collecting and preprocessing multidimensional feature data of users and components, introducing a user interest-guided sparse attention mechanism, dynamically filtering highly relevant component feature vectors, performing deep semantic modeling and similarity calculation, and generating personalized component recommendations.
It improves the accuracy and efficiency of component recommendations, accurately captures users' real-time interests, achieves logically coherent and design-coordinated component recommendations, reduces computational complexity and memory consumption, and supports dynamic updates of personalized component libraries.
Smart Images

Figure CN122432693A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of big data modeling technology, and in particular to a method for recommending visual large-screen components based on the Transformer model. Background Technology
[0002] With the rapid development of data visualization technology, visualization dashboards, as an intuitive and efficient data display tool, are widely used in many fields such as finance, transportation, energy, and government affairs. Users can quickly build visualization dashboards that meet their own needs by dragging and dropping predefined components (such as charts, tables, indicators, maps, etc.), which greatly reduces the technical threshold for dashboard development.
[0003] Visual dashboard component recommendation refers to intelligently filtering, sorting and recommending the most suitable visual components such as charts, controls, and layout templates from a massive and complex dashboard design component library based on the needs of specific users or specific business scenarios, so as to efficiently and personally assist users in building data visualization dashboards. Existing methods for recommending components for large-screen visualizations generally suffer from the following shortcomings: Insufficient integration of user features: Traditional component recommendations often rely on the component's own attributes (such as type, tags, and function descriptions) or simple user behavior statistics (such as click volume and usage frequency). This results in recommendations that are often untargeted and fail to accurately capture users' real needs in specific scenarios. For example, the needs of users in the financial industry and users in the manufacturing industry for data monitoring components differ greatly, but existing systems may not be able to distinguish these differences.
[0004] Recommendation models do not pay enough attention to user relevance: When processing a large set of candidate components, recommendation models pay equal attention to the feature vectors of all components, which is computationally intensive and easily introduces redundant information. They cannot efficiently focus on component information that is highly relevant to the current user's features, resulting in limited recommendation accuracy and efficiency. User relevance refers to the degree of matching and fit between the visual dashboard components generated by the recommendation system and the individual needs, interests, intentions, and current state of the target user in a specific context and at a specific time.
[0005] The component library lacks personalization and dynamic adaptability: Most existing component libraries are general presets. If users need to use specific domain or personalized components, they often need to find, download, import and perform complex configuration and customization, which is cumbersome and inefficient. Summary of the Invention
[0006] To address the shortcomings of component libraries in terms of personalization and dynamic adaptability—most existing component libraries are general presets, requiring users to manually search, download, import, and perform complex configurations and modifications for specific domains or personalized components, a process that is cumbersome and inefficient—this invention adopts the following technical solution: One aspect of the present invention provides a method for recommending visualization components for large screens based on the Transformer model, comprising the following steps: Collect multidimensional feature data of users, including user identity attributes, historical interaction behavior data, business domain tags and preference settings, and preprocess the multidimensional feature data of users to obtain a structured user feature set. Collect multidimensional feature data of components in the visualization screen system, including component function description, metadata information, historical usage statistics and associated tags, and preprocess the multidimensional feature data of components to obtain a structured component feature set. Each feature in the user feature set and the component feature set is vectorized and represented respectively. A nonlinear fusion module is constructed to interact and fuse the vectorized features of the user with the vectorized features of the corresponding component to generate a user-enhanced component feature vector containing the user's personalized information imprint. Multiple user-enhanced component feature vectors are generated as input sequences to an improved Transformer model encoder to obtain the deep feature representation of the components output by the improved Transformer model encoder. In the attention layer of the improved Transformer model encoder, a user interest-guided sparse attention mechanism is introduced. This mechanism dynamically selects a subset of component feature vectors with high correlation by calculating the correlation between each user-enhanced component feature vector and the user's deep interest representation, and only calculates and assigns attention weights to this subset to highlight component information that is highly related to user features. The improved Transformer model encoder performs deep semantic modeling on the feature vectors processed by the sparse attention mechanism and outputs a deep feature representation of the components that contains the user's personalized interests. Calculate the similarity between the deep feature representation of the user's current demand context or historical preference components and the deep feature representation of each component in the output, and make component recommendations based on the similarity score.
[0007] Another aspect of the present invention provides a visualization large-screen component recommendation system based on the Transformer model, comprising: Data acquisition and preprocessing module: It is configured to collect multidimensional feature data of users and multidimensional feature data of visualization screen components, and perform preprocessing operations such as cleaning, normalization and feature extraction on the collected data to build structured user feature sets and component feature sets respectively. User-component feature fusion module: configured to receive user feature set and component feature set from the data acquisition and preprocessing module, deeply fuse user feature data and component feature data, and generate user-enhanced component feature vector that incorporates user feature information; The improved Transformer recommendation model module is configured to receive the user-enhanced component feature vector as input. The improved Transformer recommendation model module introduces a sparse attention mechanism to focus on learning the parts of the user-enhanced component feature vector that are highly related to the user's interests, and outputs deep feature vectors of large-screen components that are associated with the user and of interest to the user. Component recommendation generation module: configured to receive deep feature vectors of components output from the improved Transformer recommendation model module, sort the components by calculating the similarity between the deep feature vectors of the components, or the similarity with the user's current needs / historical preferences, and generate a personalized component recommendation list; Model training and update module: It is configured to construct training samples using user feedback data of the recommendation components, jointly train the parameters of the user-component feature fusion module and the improved Transformer recommendation model module through a set loss function, and update the model parameters periodically or in real time based on new user interaction data and new component data.
[0008] In another aspect, the present invention provides an electronic device comprising: At least one memory stores computer-executable instructions non-transiently; At least one processor, configured to run the computer-executable instructions, The computer-executable instructions are implemented by the processor at runtime according to the above-described method for recommending visual large-screen components based on the Transformer model.
[0009] In another aspect, the present invention provides a computer-readable storage medium storing computer-executable instructions that, when executed by at least one processor, implement the above-described method for recommending visual large-screen components based on a Transformer model.
[0010] Effects of this invention: It not only collects basic attributes of users and components but also incorporates multi-source heterogeneous data such as historical interaction behavior, business domain tags, functional description text, and usage statistics. This constitutes a very rich feature space. It can understand users (who they are, what they do, what they like) and components (what they are, how they are used, who uses them) from multiple perspectives, laying a solid foundation for subsequent accurate matching. For new users or new components, even in the absence of direct interaction data, it can make preliminary recommendations through static features such as identity attributes, business tags, and functional descriptions, effectively alleviating the cold start problem of recommendation systems. The semantic information of business domain tags and functional descriptions enables the model to recommend to components in related business domains or with similar functions.
[0011] Deep interaction is achieved through a non-linear fusion module. Its core is to "inject" the user's personalized imprint into the component representation, forming a "component view customized for the current user." This initial personalized fusion is completed before entering the complex Transformer modeling stage. This ensures that each component vector processed by the subsequent model carries its own user context, greatly focusing the learning objective. This vector directly encodes the initial matching degree of the "user-component" pair, capturing subtle interaction preferences more effectively than processing user and component vectors separately.
[0012] The standard Transformer's self-attention mechanism computes pairwise relationships between all inputs, resulting in high complexity and potential noise introduction. This approach uses deep user interests as a guide for dynamic filtering, achieving sparse attention. Attention is calculated only on a subset of highly relevant components, significantly reducing computational complexity and memory usage. This allows the model to handle longer candidate component sequences, making it more suitable for real-world applications. It avoids diverting the model's attention to components unrelated to or weakly related to user interests, enabling the model to focus resources on uncovering deep relationships between core components that the user is truly likely interested in. Transformers excel at capturing long-distance dependencies and complex patterns. It understands the compositional logic and design intent behind a sequence of components (such as a large screen previously built by the user), thus recommending components that are logically and stylistically coherent. It adapts to the user's behavioral input sequence, capturing real-time shifts in user interest.
[0013] In deep feature space, similarity calculation can capture implicit associations such as "similar functions but different names," "same data applicability," and "similar design patterns," resulting in more accurate and intelligent recommendations. Based on historical preferences, components similar to the user's past preferences are directly recommended. Based on the current context, when the user has already selected some components to begin building, the system can recommend the "next" component that is logically coherent and design-coordinated, achieving context-aware sequence recommendation, which is a necessity for large-screen building scenarios. Attached Figure Description
[0014] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of a visualization large screen component recommendation method based on the Transformer model provided in Embodiment 1 of the present invention; Figure 2 This is a framework for a visualization large-screen component recommendation system based on the Transformer model provided in Embodiment 3 of the present invention; Figure 3 This is a block diagram of the electronic device provided in Embodiment 4 of the present invention; Figure 4 This is a block diagram of a computer-readable storage medium provided in Embodiment 4 of the present invention. Detailed Implementation
[0015] The technical solutions of the present invention will now be described with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.
[0016] Hereinafter, the terms "first," "second," etc., are used for descriptive convenience only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined with "first," "second," etc., may explicitly or implicitly include one or more of that feature. In the description of this invention, unless otherwise stated, "a plurality of" means two or more.
[0017] In this invention, unless otherwise explicitly specified and limited, the term "connection" should be interpreted broadly. For example, "connection" can be a fixed mechanical connection, a detachable mechanical connection, or an integral part; or, "connection" can be a direct connection or an indirect connection through an intermediate medium. Furthermore, unless otherwise explicitly specified and limited, the term "coupling" should be interpreted broadly. For example, "coupling" can be a direct electrical connection, such as physical contact and electrical conduction between two components; it can also be understood as an electrical connection between different components in a circuit structure through physical lines capable of transmitting electrical signals, such as copper foil or wires on a printed circuit board (PCB), to transmit electrical signals; or, "coupling" can be an indirect electrical connection between two components through an intermediate medium; or, "coupling" can be an electrical connection between two components in a non-contact manner, such as an electrical connection between two components using capacitive coupling to transmit electrical signals.
[0018] In this embodiment of the invention, directional terms such as "up," "down," "left," and "right" may be defined relative to the orientation in which the components are schematically placed in the accompanying drawings. It should be understood that these directional terms can be relative concepts, used for relative description and clarification, and can change accordingly depending on the orientation in which the components are placed in the accompanying drawings.
[0019] Example 1 like Figure 1 As shown, this embodiment of the invention provides a method for recommending visualization components for large screens based on the Transformer model, comprising the following steps: Step S100: Collect multidimensional feature data of users, including user identity attributes, historical interaction behavior data, business domain tags and preference settings, and preprocess the multidimensional feature data of users to obtain a structured user feature set. Collect multidimensional feature data of components in the visualization screen system, including component function description, metadata information, historical usage statistics and associated tags, and preprocess the multidimensional feature data of components to obtain a structured component feature set. Step S200: Vectorize each feature in the user feature set and the component feature set respectively, construct a nonlinear fusion module, and interact and fuse the vectorized features of the user with the vectorized features of the corresponding component to generate a user-enhanced component feature vector containing the user's personalized information imprint. Step S300: The generated multiple user-enhanced component feature vectors are used as the input sequence of the improved Transformer model encoder to obtain the deep feature representation of the components output by the improved Transformer model encoder; wherein, in the attention layer of the improved Transformer model encoder, a user interest-guided sparse attention mechanism is introduced. This mechanism dynamically selects a subset of component feature vectors with high correlation by calculating the correlation between each user-enhanced component feature vector and the user's deep interest representation, and only calculates and assigns attention weights to this subset to highlight component information that is highly related to user features. The improved Transformer model encoder performs deep semantic modeling on the feature vectors processed by the sparse attention mechanism and outputs a deep feature representation of the components containing the user's personalized interests. Step S400: Calculate the similarity between the deep feature representation of the user's current demand context or historical preference components and the output deep feature representation of each component, and recommend components based on the similarity score.
[0020] In the above embodiments, a loss function is constructed based on user feedback data such as actual selections, clicks, dwell time, or favorites of recommended components as supervision signals. The parameters of the user-component feature fusion encoder and the improved Transformer recommendation model are jointly trained and optimized. The model parameters are periodically or in real-time updated online based on newly collected user behavior data and newly added component data to maintain the timeliness and accuracy of recommendations. The large-screen components are improved in two ways to enhance the accuracy of recommendation results: 1. Optimizing the similarity algorithm to improve the accuracy of large-screen component recommendations; 2. Improving the Transformer model by adding feature vectors obtained from the similarity algorithm to the Transformer model encoder and introducing a sparse attention mechanism to simplify algorithm calculations and improve the accuracy of recommended components.
[0021] Example 2 In the technical aspect of Embodiment 1, the user's identity attributes include user ID, industry, and job level; the historical interaction behavior data includes component click records, drag records, usage duration, modification frequency, and component combination preferences; the business domain tags include data types and business scenarios that the user frequently handles; and the preference settings include the user's preferences for component styles and color themes.
[0022] Specifically, the functional description of the component includes the component's purpose, supported data dimensions, and interaction methods; the metadata information includes the component ID, type, size, and developer information; and the historical usage statistics include the component's total usage count, average rating, and usage distribution among different user groups. When vectorizing user features and component features, embedding techniques are used for categorical features, standardization or normalization is used for numerical features, and pre-trained language models or TF-IDF are used to encode text features. The nonlinear fusion module is implemented in at least one of the following ways: attention mechanism weighted fusion, sequence fusion of gated recurrent units or long short-term memory networks, and nonlinear transformation fusion of multilayer perceptrons.
[0023] The sparse attention mechanism for user interest guidance is specifically implemented as follows: Utilize the user's vectorized features or variations thereof as query vectors; Use the feature vector of each user-enhanced component in the input sequence as the key vector; Calculate the similarity score between the query vector and each key vector, as a measure of relevance; Set a threshold or select the positions corresponding to the top-K key vectors with the highest similarity scores, and calculate the attention weight only for the user-enhanced component feature vectors at these positions, while setting the attention weight for the remaining positions to zero or a minimum value.
[0024] Specifically, the improved Transformer model encoder may include multiple cascaded Transformer coding layers, each of which includes the user interest-guided sparse attention sublayer and a feedforward neural network sublayer. The similarity calculation uses at least one of cosine similarity, Euclidean distance, or Mahalanobis distance. The loss function employs at least one of cross-entropy loss, Bayesian personalized ranking loss, or contrastive loss. Personalized components that users frequently use or rate highly can be automatically or semi-automatically added to the user's exclusive personalized component sub-library after the user authorizes them, and then participate in the subsequent recommendation process in collaboration with the system's public component library.
[0025] In the above embodiments, the similarity algorithm is improved as follows: Large screens have diverse use cases and a wide variety of components to choose from. A key focus is accurately matching users' needs among these numerous components and recommending those that interest them. We can collect data from the user's historical search data in the database, as well as content viewed by similar users, and collect pages with long dwell times to construct feature vectors between the user and components. These vectors are then input into a convolutional neural network to obtain feature component vectors containing the user's information. Finally, a similarity algorithm is used to calculate the SIM value between the user and the components to be recommended.
[0026] The feature vector expression for the similarity algorithm is as follows:
[0027] In the formula, E represents the integration of user and component vectors obtained after passing through the convolutional neural network; W1(l) and W2(l) are learnable parameter matrices; This means that each node incorporates its own information, multiplies it with the initial embedding matrix, and aggregates user and component information; This indicates that user characteristics have been incorporated into the relevance of components.
[0028] Furthermore, during component vector calculation, insufficient component data for a particular feature dimension may occur, leading to inaccurate feature vector values. To improve accuracy in this case, data from other dimensions can be injected into the calculation for that feature dimension. When selecting other dimensions, a similarity algorithm is also needed: generating corresponding vectors based on the attributes of different dimensions, and then using a similarity algorithm to obtain the similarity between the two feature dimensions. The similarity calculation method is shown in the following formula:
[0029] Here, a and b represent two different dimensions, and ai and bi represent the vectors of the i-th component within dimensions a and b, respectively.
[0030] After calculating the similarity of components, the data of dimensions with close similarity are superimposed for calculation and used to generate the feature vector of that dimension. After the data density is increased, the problem of inaccurate recommendation results caused by data sparsity in some dimensions can be effectively solved.
[0031] Improvements to the Transformer model: The components we obtain based on the similarity algorithm are components with user information features. We fuse the obtained feature vectors with the component vectors and input them into the encoder of the Transformer model to generate more accurate recommended components.
[0032] The specific steps are as follows: Step 1: Construct a training set. The input data consists of pre-trained components, including common components, public components, and special components. Step 2: Constructing the Transformer model. The Transformer consists of an encoder and a decoder, containing multiple layers of encoders and decoders. Each layer comprises multiple attention mechanism modules and feedforward neural network modules. Since multi-head attention mechanisms project the query vector, key vector, and value vector into multiple subspaces and then calculate the attention in each subspace, the computation is quite cumbersome. Therefore, we improve the Transformer model by introducing a sparse encoder to encode the input sequence into a high-dimensional feature vector representation, and a decoder to decode this vector representation into the target sequence. Residual connections and layer normalization are also used in the Transformer model to accelerate model convergence and improve model performance. Step 3: Improve the Transformer model. We use the user-featured data obtained from the convolutional neural network as feature vector values, assign certain weights, and connect them to the Transformer model as input. To reduce computational complexity and improve model interpretability, we improve the Transformer model by introducing a sparse attention mechanism. Through weighted and linear transformations, we learn the mapping relationship between input components and target output components, reducing computational load and iterating continuously to make the generated components more user-featured and the recommendations more accurate. The specific implementation is as follows: We connect a convolutional neural network (CNN) to a Transformer model, using the output of the CNN as the input to the Transformer model. The Transformer model does not use an RNN structure but instead utilizes global information, employing a multi-head attention mechanism (self-attention) to process multiple input sequences and fuse them into a single output sequence. Since self-attention ignores positional information, we need to add additional positional encoding information. The input formula is as follows:
[0033] Where T represents the input to the Transformer model, This represents the output obtained by the convolutional neural network, where pos represents the position of the recommendation component within the entire component set, d represents the positional dimension information, i represents the i-th position in the component set, 2i represents even-numbered dimensions, and 2i+1 represents odd-numbered dimensions. Thus, we obtain the input to the Transformer model.
[0034] The Transformer model previously used a multi-head attention mechanism, an improved attention mechanism that maps a query vector and a set of key-value pairs to an output vector. Unlike single-head attention, it projects the query vector, key vector, and value vector into multiple subspaces, then computes the attention in each subspace. Finally, it concatenates the attention outputs from all subspaces to obtain the final output vector. This process is computationally complex and time-consuming, resulting in long training times.
[0035] Therefore, we introduce sparse attention, an optimized attention mechanism that maps a query vector and a set of key-value pairs to an output vector. Unlike single-head and multi-head attention, it doesn't calculate the similarity between the query vector and all key vectors; instead, it only calculates the similarity between the query vector and a subset of key vectors, thus reducing computational cost and memory consumption. We employ top-k selection to degenerate attention into sparse attention, retaining the most attention-grabbing parts and removing irrelevant information. This method effectively preserves important information and eliminates noise. The formula is as follows: (1) in This represents the index of the i-th time slice in the prediction. It is a two-dimensional matrix consisting of 0s and 1s, where a position of 1 indicates that the pixel at that position participates in the self-attention calculation. (2) (3) (4) in , as well as These are the weight matrices used to calculate the Query, Key, and Value vectors. The Sparse Transformer reduces computation by applying the join pattern to... Up, thereby reducing Q The complexity is as follows. As shown in equation (3), for the input of the i-th time slice, we first multiply the input features by the weight matrices of Key and Value to obtain K and V. Then we combine the connection patterns... Applying this to K and V yields sparse characteristics. and Then, the sparse feature is used to obtain the result of the i-th time slice, as shown in Equation (2). Finally, the results of the n time slices are combined to obtain the final result Attend(X,P), as shown in Equation (1).
[0036] The structure of a decoder is similar to that of an encoder, but there are two differences between a decoder and an encoder: 1) The structure initially includes an additional Masked-Multihead. Masked-Multihead adds a mask, and when calculating the self-attention of the word at position i, it only calculates with words at positions less than i, ensuring that future information is not encountered when predicting the i-th position.
[0037] 2) The input data for the Multihead are different for the two. The query, key, and value inputs of the Multihead in the encoder part come from the output of the previous encoder layer, while the key and value inputs of the Multihead in the decoder part come from the final output of the encoder, and the query comes from the output of the Masked-Multihead.
[0038] Example 3 like Figure 2 As shown in Example 2, this embodiment of the invention provides a visualization large-screen component recommendation system based on the Transformer model, including: Data acquisition and preprocessing module: It is configured to collect multidimensional feature data of users and multidimensional feature data of visualization screen components, and perform preprocessing operations such as cleaning, normalization and feature extraction on the collected data to build structured user feature sets and component feature sets respectively. User-component feature fusion module: configured to receive user feature set and component feature set from the data acquisition and preprocessing module, deeply fuse user feature data and component feature data, and generate user-enhanced component feature vector that incorporates user feature information; The improved Transformer recommendation model module is configured to receive the user-enhanced component feature vector as input. The improved Transformer recommendation model module introduces a sparse attention mechanism to focus on learning the parts of the user-enhanced component feature vector that are highly related to the user's interests, and outputs deep feature vectors of large-screen components that are associated with the user and of interest to the user. Component recommendation generation module: configured to receive deep feature vectors of components output from the improved Transformer recommendation model module, sort the components by calculating the similarity between the deep feature vectors of the components, or the similarity with the user's current needs / historical preferences, and generate a personalized component recommendation list; Model training and update module: It is configured to construct training samples using user feedback data of the recommendation components, jointly train the parameters of the user-component feature fusion module and the improved Transformer recommendation model module through a set loss function, and update the model parameters periodically or in real time based on new user interaction data and new component data.
[0039] In the above embodiments, the user multidimensional feature data collected by the data acquisition and preprocessing module includes user identity attributes, historical interaction behavior data, business domain tags and preference settings; the component multidimensional feature data includes component function description, metadata information, historical usage statistics and associated tags.
[0040] The user identity attributes include user ID, industry, and job level; the historical interaction behavior data includes component click records, drag records, usage duration, modification frequency, and component combination preferences; the business domain tags include data types and business scenarios that users frequently handle; and the preference settings include user preferences for component styles and color themes.
[0041] The component function description includes the component's purpose, supported data dimensions, and interaction methods; the metadata information includes the component ID, type, size, and developer information; the historical usage statistics include the component's total usage count, average rating, and usage distribution among different user groups.
[0042] The user-component feature fusion module includes a feature vectorization unit and a nonlinear fusion unit. The feature vectorization unit vectorizes user features and component features, uses embedding technology for categorical features, standardizes or normalizes numerical features, and encodes text features using a pre-trained language model or TF-IDF. The nonlinear fusion unit uses at least one of the following methods to deeply fuse user vectorized features and component vectorized features: attention-based weighted fusion, gated recurrent unit (GRU), long short-term memory network (LSTM), or multilayer perceptron (MLP).
[0043] The sparse attention mechanism in the improved Transformer recommendation model module is configured as follows: based on the user's deep interest representation as guidance, the correlation between each element in the user-enhanced component feature vector and the user's interest is dynamically calculated, and a subset of features with high correlation is selected according to the correlation. Attention weights are only calculated and assigned to this subset to reduce attention to irrelevant or low-correlation information.
[0044] The sparse attention mechanism is implemented as follows: a certain mapping representation of user features is used as a query, the user-enhanced component feature vector is used as a key and a value, the similarity score between the query and each key is calculated, and the key-value pairs participating in the attention calculation are selected according to a preset threshold or a Top-K strategy.
[0045] In the component recommendation generation module, similarity calculation uses at least one of cosine similarity, Euclidean distance, or Mahalanobis distance. The loss function used in the model training and update module includes at least one of cross-entropy loss, Bayesian Personalized Ranking (BPR) loss, or contrastive loss. A personalized component library management module is also included, configured to receive a personalized component recommendation list from the component recommendation generation module, and organize, store, and display these components in a user-exclusive personalized component library for direct drag-and-drop use by the user.
[0046] Example 4 Figure 3 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present invention is shown.
[0047] The electronic device may include a central processing unit / microprocessor / main control chip, etc. 4; and a storage medium 5, coupled to the central processing unit / microprocessor / main control chip, etc. 4, and storing computer-executable instructions therein for performing the steps of various methods of embodiments of the present invention when executed by the processor.
[0048] The central processing unit / microprocessor / main control chip, etc., can include, for example, one or more processors or microprocessors.
[0049] Storage medium 5 may include, for example, random access memory (RAM), read-only memory (ROM), flash memory, EPROM memory, EEPROM memory, registers, computer storage media (e.g., hard disk, floppy disk, solid-state drive, removable disk, CD-ROM, DVD-ROM, Blu-ray disc, etc.).
[0050] In addition, the electronic device may also include (but is not limited to) a data bus 6, an input / output bus / external bus / device bus 7, a display 8, and input / output devices 9 (e.g., keyboard, mouse, speaker, etc.).
[0051] The central processing unit / microprocessor / main control chip, etc. 4 can communicate with external devices (8, 9, etc.) via I / O bus 7 through wired or wireless network (not shown).
[0052] The storage medium 5 may also store at least one computer-executable instruction for performing the steps of various functions and / or methods in the embodiments described herein when the central processing unit / microprocessor / main control chip, etc., 4 is running.
[0053] In one embodiment, the at least one computer-executable instruction may also be compiled into or comprise a software product, wherein one or more computer-executable instructions are executed by a processor to perform the steps of the various functions and / or methods in the embodiments described herein.
[0054] Figure 4 A schematic diagram of a computer-readable storage medium according to an embodiment of the present invention is shown.
[0055] like Figure 4 As shown, the non-transitory computer-readable storage medium 11 stores instructions, such as computer-readable instructions 10. When the computer-readable instructions 10 are executed by a processor, the various methods described above can be performed. The non-transitory computer-readable storage medium includes, for example, volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Non-transitory non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. For example, the non-transitory computer-readable storage medium 11 can be connected to a computing device such as a computer, and then, when the computing device executes the computer-readable instructions 10 stored on the computer-readable storage medium 11, the various methods described above can be performed.
[0056] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0057] 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, depending on actual needs.
[0058] Furthermore, the functional units in the various embodiments of the present invention 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. The integrated unit can be implemented in hardware or as a software functional unit.
[0059] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, in essence, or the part that contributes to the prior art, or all or part 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 for executing all or part of the steps of the methods of the various embodiments of this invention through a computer device (which may be a personal computer, server, or network device, etc.). The aforementioned storage medium includes: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media capable of storing program code.
[0060] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. 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 of the technical features. Such modifications 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 the present invention.
Claims
1. A method for recommending visual large-screen components based on the Transformer model, characterized in that, Includes the following steps: Collect multidimensional feature data of users, including user identity attributes, historical interaction behavior data, business domain tags and preference settings, and preprocess the multidimensional feature data of users to obtain a structured user feature set. Collect multidimensional feature data of components in the visualization screen system, including component function description, metadata information, historical usage statistics and associated tags, and preprocess the multidimensional feature data of components to obtain a structured component feature set. Each feature in the user feature set and the component feature set is vectorized and represented respectively. A nonlinear fusion module is constructed to interact and fuse the vectorized features of the user with the vectorized features of the corresponding component to generate a user-enhanced component feature vector containing the user's personalized information imprint. Multiple user-enhanced component feature vectors are generated as input sequences to an improved Transformer model encoder to obtain the deep feature representation of the components output by the improved Transformer model encoder. In the attention layer of the improved Transformer model encoder, a user interest-guided sparse attention mechanism is introduced. This mechanism dynamically selects a subset of component feature vectors with high correlation by calculating the correlation between each user-enhanced component feature vector and the user's deep interest representation, and only calculates and assigns attention weights to this subset. The improved Transformer model encoder performs deep semantic modeling on the feature vectors processed by the sparse attention mechanism to output a deep feature representation of the components that contains the user's personalized interests. Calculate the similarity between the deep feature representation of the user's current demand context or historical preference components and the deep feature representation of each component in the output, and make component recommendations based on the similarity score.
2. The method for recommending visual large-screen components based on the Transformer model as described in claim 1, characterized in that, The user's identity attributes include user ID, industry, and job level; the historical interaction behavior data includes component click records, drag records, usage duration, modification frequency, and component combination preferences; the business domain tags include data types and business scenarios that the user frequently handles; and the preference settings include the user's preferences for component styles and color themes.
3. The method for recommending visual large-screen components based on the Transformer model as described in claim 1, characterized in that, The component's functional description includes its purpose, supported data dimensions, and interaction methods; the metadata information includes the component ID, type, size, and developer information; the historical usage statistics include the component's total usage count, average rating, and usage distribution among different user groups. When vectorizing user features and component features, embedding techniques are used for categorical features, standardization or normalization is used for numerical features, and pre-trained language models or TF-IDF are used to encode text features. The nonlinear fusion module is implemented in at least one of the following ways: attention mechanism weighted fusion, sequence fusion of gated recurrent units or long short-term memory networks, and nonlinear transformation fusion of multilayer perceptrons.
4. The method for recommending visual large-screen components based on the Transformer model as described in claim 1, characterized in that, The multidimensional feature data is preprocessed based on the user's historical search data in the database and the content followed by users of similar categories. Pages with long dwell times are collected to construct feature vectors between the user and the component. The constructed vectors are then input into a convolutional neural network to obtain feature component vectors containing the user's information. Finally, the similarity SIM value between the user and the component to be recommended is calculated using a similarity algorithm. The feature vector expression for the similarity algorithm is as follows: In the formula, E represents the integration of user and component vectors obtained after passing through the convolutional neural network; W1(l) and W2(l) are learnable parameter matrices; This means that each node incorporates its own information, multiplies it with the initial embedding matrix, and aggregates user and component information; This indicates that user characteristics have been incorporated into the relevance of components; Vectors are generated based on attributes of different dimensions, and then a similarity algorithm is used to obtain the similarity between two feature dimensions. The similarity calculation method is shown in the following formula: Here, a and b represent two different dimensions. and Let represent the vectors of the i-th component in dimensions a and b, respectively. After calculating the similarity of the components, the data of dimensions with close similarity are superimposed and used to generate the feature vector of that dimension.
5. The method for recommending visual large-screen components based on the Transformer model as described in claim 1, characterized in that, The input to the Transformer model encoder connects a convolutional neural network (CNN) to the Transformer model, and uses the output of the CNN as the input to the Transformer model. The Transformer model does not use an RNN structure but instead utilizes global information, employing a multi-head attention mechanism (self-attention) to process multiple input sequences and fuse them into a single output sequence. Since self-attention ignores positional information, we need to add additional positional encoding information. The input formula is as follows: Where T represents the input to the Transformer model, This represents the output obtained by the convolutional neural network, pos represents the position of the recommendation component in the whole component, d represents the position dimension information, i represents the i-th position in the component, 2i represents even dimension, 2i+1 represents odd dimension, and the input of the Transformer model is obtained. Using top-k selection, attention degenerates into sparse attention, retaining the attention-grabbing parts and removing other irrelevant information, thus preserving important information and eliminating noise. The formula is as follows: in This represents the index of the i-th time slice in the prediction. It is a two-dimensional matrix consisting of 0s and 1s, where a position of 1 indicates that the pixel at that position participates in the self-attention calculation. in , as well as These are the weight matrices used to calculate the three vectors: Query, Key, and Value. The Sparse Transformer reduces computation by applying the join pattern to... Up, thereby reducing Q The complexity is as follows: for the input of the i-th time slice, first multiply the input features by the weight matrices of Key and Value to obtain K and V, then combine the connection patterns... Applying this to K and V yields sparse characteristics. and .
6. The method for recommending visualization components based on the Transformer model as described in claim 1, characterized in that, The sparse attention mechanism for user interest guidance is specifically implemented as follows: Utilize the user's vectorized features or variations thereof as query vectors; Use the feature vector of each user-enhanced component in the input sequence as the key vector; Calculate the similarity score between the query vector and each key vector, as a measure of relevance; Set a threshold or select the positions corresponding to the top-K key vectors with the highest similarity scores, and calculate the attention weight only for the user-enhanced component feature vectors at these positions, while setting the attention weight for the remaining positions to zero or a minimum value.
7. The method for recommending visualization components for large screens based on the Transformer model as described in claim 1, characterized in that, The improved Transformer model encoder may contain multiple cascaded Transformer coding layers, each of which contains a user interest-guided sparse attention sublayer and a feedforward neural network sublayer. The similarity calculation uses at least one of cosine similarity, Euclidean distance, or Mahalanobis distance. A loss function is constructed to jointly train and optimize the parameters of the user-component feature fusion encoder and the improved Transformer model; the loss function adopts at least one of cross-entropy loss, Bayesian personalized ranking loss, or contrastive loss. Personalized components that users frequently use or rate highly can be automatically or semi-automatically added to the user's exclusive personalized component sub-library after the user authorizes them, and then participate in the subsequent recommendation process in collaboration with the system's public component library.
8. A visualization large-screen component recommendation system based on the Transformer model, as described in any one of claims 1 to 7, characterized in that... include: Data acquisition and preprocessing module: It is configured to collect multidimensional feature data of users and multidimensional feature data of visualization screen components, and perform preprocessing operations such as cleaning, normalization and feature extraction on the collected data to build structured user feature sets and component feature sets respectively. User-component feature fusion module: configured to receive user feature set and component feature set from the data acquisition and preprocessing module, deeply fuse user feature data and component feature data, and generate user-enhanced component feature vector that incorporates user feature information; The improved Transformer recommendation model module is configured to receive the user-enhanced component feature vector as input. The improved Transformer recommendation model module introduces a sparse attention mechanism to focus on learning the parts of the user-enhanced component feature vector that are highly related to the user's interests, and outputs deep feature vectors of large-screen components that are associated with the user and of interest to the user. Component recommendation generation module: configured to receive deep feature vectors of components output from the improved Transformer recommendation model module, sort the components by calculating the similarity between the deep feature vectors of the components, or the similarity with the user's current needs / historical preferences, and generate a personalized component recommendation list; Model training and update module: It is configured to construct training samples using user feedback data of the recommendation components, jointly train the parameters of the user-component feature fusion module and the improved Transformer recommendation model module through a set loss function, and update the model parameters periodically or in real time based on new user interaction data and new component data.
9. An electronic device, comprising: At least one memory stores computer-executable instructions non-transiently; At least one processor, configured to run the computer-executable instructions, The computer-executable instructions are implemented by the processor at runtime according to any one of claims 1-7, which describes a method for recommending visual large-screen components based on the Transformer model.
10. A computer-readable storage medium, wherein, The computer-readable storage medium stores computer-executable instructions, which, when executed by at least one processor, implement a method for recommending visual large-screen components based on the Transformer model according to any one of claims 1-7.