Data processing method, device and equipment and readable storage medium
By extracting and fusing long-term and short-term features from user data interaction sequences, the problem of insufficient accuracy of interaction preferences in existing technologies is solved, and more accurate data recommendation is achieved.
Patent Information
- Application Number
- CN202411140979.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2026-03-03
AI Technical Summary
Existing sequence recommendation methods focus on learning users' interaction preferences in the most recent short period of time, resulting in low accuracy of interaction preferences and affecting the effectiveness of data recommendation.
By acquiring users' data interaction sequences, a first feature is extracted to reflect long-term interaction preferences, and a second feature is extracted to reflect short-term interaction preferences. The two are then merged to obtain more accurate fused interaction features for data recommendation.
It improves the accuracy of learning interaction preferences, optimizes data recommendation performance, and can more accurately reflect users' long-term and short-term interaction preferences, thereby enhancing user experience.
Smart Images

Figure CN121597900A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a data processing method, apparatus, device, and readable storage medium. Background Technology
[0002] Sequence recommendation methods play an important role in the recommendation field (such as purchase prediction, video recommendation, and next point of interest recommendation). They construct user interaction sequences based on the user's historical interaction behavior with different data in chronological order, then model the user's interaction preferences from the interaction sequences, and predict the next data that the user may interact with based on the user's interaction preferences, and then recommend this data to the user.
[0003] In traditional technologies, most sequence recommendation methods focus on learning users' interaction preferences in a relatively short period of time. While this approach can quickly learn users' interaction preferences and perform data recommendation processing, the learned interaction preferences may not represent the users' true interaction preferences. In other words, interaction preferences learned in a relatively short period of time may not be very accurate, and data recommendation processing based on these interaction preferences may not achieve good results. Summary of the Invention
[0004] This application provides a data processing method, apparatus, device, and readable storage medium that can improve the accuracy of learning interaction preferences to optimize data recommendation performance.
[0005] One embodiment of this application provides a data processing method, including:
[0006] Obtain the data interaction sequence of the object; the data interaction sequence includes N data points of interaction behavior generated by the object within a historical time period, where N is a positive integer;
[0007] The data interaction sequence is processed by first feature extraction to obtain the first interaction feature of the object. The first interaction feature is used to characterize the interaction preference characteristics of the object within a first duration, where the first duration is less than or equal to the historical time period.
[0008] The data interaction sequence is processed by second feature extraction to obtain the second interaction feature of the object. The second interaction feature is used to characterize the interaction preference characteristics of the object in a second time period, which is shorter than the first time period.
[0009] The first interaction feature and the second interaction feature are fused together to obtain the object's fused interaction feature, and the object is then used for data recommendation processing based on the object's fused interaction feature.
[0010] One embodiment of this application provides a data processing apparatus, including:
[0011] The sequence acquisition module is used to acquire the data interaction sequence of an object; the data interaction sequence includes N data points of interaction behavior generated by the object within a historical time period, where N is a positive integer;
[0012] The first feature processing module is used to perform first feature extraction processing on the data interaction sequence to obtain the first interaction feature of the object. The first interaction feature is used to characterize the interaction preference characteristics of the object within a first duration, where the first duration is less than or equal to the historical time period.
[0013] The second feature processing module is used to perform second feature extraction processing on the data interaction sequence to obtain the second interaction feature of the object. The second interaction feature is used to characterize the interaction preference characteristics of the object in a second duration, which is shorter than the first duration.
[0014] The data recommendation module is used to fuse the first interaction feature and the second interaction feature to obtain the fused interaction feature of the object, and to perform data recommendation processing on the object based on the fused interaction feature of the object.
[0015] In one embodiment, the first feature processing module performs first feature extraction processing on the data interaction sequence to obtain the first interaction feature of the object. The specific implementation includes:
[0016] Invoke the memory model; the memory model includes a feature embedding layer and a matrix memory component;
[0017] Each data point in the data interaction sequence is processed by feature embedding layer to obtain the first embedded representation feature corresponding to each data point.
[0018] The N first embedding representation features are sorted according to the order of the data interaction sequence to obtain the first representation feature sequence;
[0019] According to the arrangement order of the first representation feature sequence, the first hidden state representation feature of each first embedding representation feature is calculated sequentially through the matrix memory component;
[0020] The first interaction feature of the object is determined based on the first hidden state representation feature of each first embedding representation feature.
[0021] In one embodiment, the matrix memory component includes a matrix memory gate;
[0022] The first feature processing module, according to the arrangement order of the first representation feature sequence, sequentially calculates the specific implementation method of the first hidden state representation feature of each first embedded representation feature through the matrix memory component, including:
[0023] Any one of the N first embedding representation features is determined as the first target embedding representation feature, and the first embedding representation feature preceding the first target embedding representation feature in the first representation feature sequence is determined as the first reference embedding representation feature;
[0024] The retrieval vector corresponding to the first target embedding representation feature is obtained by performing retrieval vector calculation on the first target embedding representation feature.
[0025] Obtain the first memory state vector and the first normalized state vector of the first reference embedding representation features;
[0026] The matrix memory gate is used to process the first memory state vector of the first reference embedding representation feature, the first normalized state vector of the first reference embedding representation feature, and the retrieval vector corresponding to the first target embedding representation feature to obtain the first hidden state representation feature of the first target embedding representation feature.
[0027] In one embodiment, the specific implementation of the first feature processing module using a matrix memory gate to process the first memory state vector of the first reference embedding representation feature, the first normalized state vector of the first reference embedding representation feature, and the retrieval vector corresponding to the first target embedding representation feature includes:
[0028] A matrix memory gate is used to perform memory state calculation on the first memory state vector of the first reference embedding representation feature and the retrieval vector corresponding to the first target embedding representation feature to obtain the first memory state vector of the first target embedding representation feature.
[0029] The matrix memory gate is used to perform normalization state calculation on the first normalized state vector of the first reference embedding representation feature and the retrieval vector corresponding to the first target embedding representation feature, so as to obtain the first normalized state vector of the first target embedding representation feature.
[0030] The first hidden state representation feature of the first target embedding representation feature is obtained by using a matrix memory gate to perform hidden state calculation on the first memory state vector and the first normalized state vector.
[0031] In one embodiment, the second feature processing module performs second feature extraction processing on the data interaction sequence to obtain the second interaction features of the object. The specific implementation includes:
[0032] Invoke the memory model; the memory model includes a sequence pruning component, a feature embedding layer, and a hybrid memory component;
[0033] The data interaction sequence is processed by a sequence trimming component to obtain a trimmed sequence; the trimmed sequence consists of the last K data items in the data interaction sequence; K is a positive integer less than N;
[0034] Each data point in the cropped sequence is processed by feature embedding layer to obtain the second embedded representation feature corresponding to each data point.
[0035] The K second embedding representation features are sorted according to the order of the pruning sequence to obtain the second representation feature sequence;
[0036] According to the arrangement order of the second representation feature sequence, the second hidden state representation feature of each second embedding representation feature is calculated sequentially through the hybrid memory component;
[0037] The second interaction features of the object are determined based on the second hidden state representation features of each second embedding representation feature.
[0038] In one embodiment, the hybrid memory component includes a hybrid memory gate;
[0039] The second feature processing module, according to the arrangement order of the second representation feature sequence, sequentially calculates the specific implementation method of the second hidden state representation feature of each second embedded representation feature through the hybrid memory component, including:
[0040] Any one of the K second embedding representation features is determined as the second target embedding representation feature, and the second embedding representation feature preceding the second target embedding representation feature in the second representation feature sequence is determined as the second reference embedding representation feature;
[0041] Obtain the second memory state vector, the second normalized state vector, and the second hidden state representation features of the second reference embedding representation features;
[0042] The second hidden state representation feature of the second target embedding representation feature is obtained by using a hybrid memory gate to process the second memory state vector of the second reference embedding representation feature, the second normalized state vector of the second reference embedding representation feature, and the second hidden state representation feature of the second target embedding representation feature.
[0043] In one embodiment, the second feature processing module uses a matrix memory gate to process the second target embedding representation feature, the second memory state vector of the second reference embedding representation feature, and the second normalized state vector of the second reference embedding representation feature to obtain the second hidden state representation feature of the second target embedding representation feature. The specific implementation of this method includes:
[0044] A hybrid memory gate is used to process the memory state of the second target embedding representation feature and the second memory state vector of the second reference embedding representation feature to obtain the second memory state vector of the second target embedding representation feature.
[0045] A hybrid memory gate is used to perform normalization state calculation on the second target embedding representation feature and the second normalized state vector of the second reference embedding representation feature to obtain the second normalized state vector of the second target embedding representation feature.
[0046] The second hidden state representation features of the second target embedding representation features are obtained by using a hybrid memory gate to perform hidden state calculation on the second memory state vector and the second normalized state vector.
[0047] The data recommendation module fuses the first interaction feature with the second interaction feature to obtain the specific implementation of the fused interaction feature of the object, including:
[0048] Obtain the first fusion weight corresponding to the first interaction feature and the second fusion weight corresponding to the second interaction feature;
[0049] The first fusion weight and the first interaction feature are processed to obtain the first operational interaction feature;
[0050] The second fusion weight and the second interaction feature are processed to obtain the second operational interaction feature;
[0051] The first and second operational interaction features are summed to obtain the object's fused interaction features.
[0052] The data recommendation module obtains the first fusion weight corresponding to the first interaction feature and the second fusion weight corresponding to the second interaction feature through specific implementation methods, including:
[0053] Obtain the weight calculation function; the weight calculation function contains learnable parameters;
[0054] The learnable parameters, the first interaction feature, and the second interaction feature are processed by a weight calculation function to obtain the first fusion weight corresponding to the first interaction feature.
[0055] The difference between the unit value and the first fusion weight is determined, and the difference between the unit value and the first fusion weight is determined as the second fusion weight corresponding to the second interactive feature.
[0056] In one embodiment, the specific implementation of the data recommendation module performing data recommendation processing on objects based on their fusion interaction characteristics includes:
[0057] Obtain the candidate data set; the candidate data set contains one or more candidate data items to be recommended to the object.
[0058] The interaction features are fused and each candidate data is processed with probability calculation to obtain the interaction prediction probability corresponding to each candidate data; the interaction prediction probability corresponding to each candidate data refers to the probability that the object will perform an interaction behavior on the candidate data.
[0059] Recommended data for an object is selected from the candidate data set based on the interactive prediction probability corresponding to each candidate data, and the recommended data is pushed to the object.
[0060] One embodiment of this application provides a computer device, including: a processor and a memory;
[0061] The memory stores a computer program, which, when executed by a processor, causes the processor to perform the methods described in the embodiments of this application.
[0062] One aspect of this application provides a computer-readable storage medium storing a computer program, which includes program instructions. When executed by a processor, the program instructions perform the methods described in this application.
[0063] One aspect of this application provides a computer program product comprising a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform the method provided in one aspect of the embodiments of this application.
[0064] This application provides a data recommendation scheme that can improve the accuracy of learning interaction preferences and optimize the data recommendation effect. Specifically, after obtaining a data interaction sequence of an object (such as a user) (including N data points showing that the object has interacted within a historical time period), the application can perform a first feature extraction process on the data interaction sequence to obtain a first interaction feature of the object. This first interaction feature characterizes the object's interaction preference characteristics within a first time period (less than or equal to the historical time period). Thus, the first interaction feature reflects the object's interaction preferences for data over a relatively long period. Simultaneously, the application can perform a second feature extraction process on the data interaction sequence to obtain a second interaction feature of the object. This second interaction feature characterizes the object's interaction preference characteristics within a second time period (less than the first time period). Thus, the second interaction feature reflects the object's interaction preferences for data over a relatively short period. Subsequently, the first and second interaction features are fused to obtain the object's fused interaction features. These fused interaction features reflect the object's interaction preferences not only over a longer period but also over a shorter period. Therefore, the reflected interaction preferences are more accurate, and the data recommendations based on these fused interaction preferences are more accurate and reasonable, thus optimizing the data recommendation effect. In summary, this application can improve the accuracy of learning interaction preferences and optimize the data recommendation effect. Attached Figure Description
[0065] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0066] Figure 1 This is a schematic diagram of the architecture of a data recommendation system provided by an exemplary embodiment of this application;
[0067] Figure 2 This is a schematic diagram of a scenario provided in an embodiment of this application;
[0068] Figure 3 This is a flowchart illustrating a data processing method provided in an exemplary embodiment of this application;
[0069] Figure 4 This is a schematic diagram of the logical architecture of a data recommendation scheme provided in an embodiment of this application;
[0070] Figure 5This is a schematic diagram of a process for learning long-term interaction preference representations provided in an embodiment of this application;
[0071] Figure 6 This is a schematic diagram of a process for learning short-term interaction preference representations provided in an embodiment of this application;
[0072] Figure 7 This is a schematic diagram of an experimental comparison provided in an embodiment of this application;
[0073] Figure 8 This is a schematic diagram of an ablation experiment result provided in an embodiment of this application;
[0074] Figure 9 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application;
[0075] Figure 10 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0076] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0077] The embodiments of this application involve sequence recommendation and related technologies. For ease of understanding, the following will first briefly explain sequence recommendation and related technical terms and concepts.
[0078] Sequence Recommendation
[0079] The goal of sequence recommendation is to predict the next data a user might interact with, based on a sequence of user interactions ordered chronologically. This data can include, but is not limited to, products (such as foundation, face masks, cameras, clothing, and televisions) and media data (such as video, image, and audio data). The process involves collecting user interaction data, sorting it chronologically to obtain an interaction sequence, predicting the next data the user might interact with based on this sequence, and then recommending this predicted data to the user.
[0080] Lifetime long sequence recommendation
[0081] Lifetime long-sequence recommendation is an emerging sequence recommendation task that focuses on users' data interaction sequences over a relatively long period. Because the data interaction sequence is collected over a long period, it is called a long-term interaction sequence. Due to the long collection period, this sequence contains a large amount of user-interacted data, and typically, the sequence length (i.e., the number of interacted data points) exceeds a certain threshold (e.g., 1000). The goal of lifetime long-sequence recommendation is to learn users' long-term interaction preferences (i.e., the characteristics of the data users have interacted with over a long period) from their long-term interaction sequences, predict the next data the user is likely to interact with based on these preferences, and then recommend this predicted data to the user.
[0082] In practical applications, sequence recommendation is an important branch of recommendation systems. Existing sequence recommendation methods primarily focus on learning users' short-term interaction preferences over a relatively short period, then predicting the next data the user might interact with based on these short-term preferences, and then recommending that data to the user. For example, in e-commerce item recommendation scenarios or news recommendation scenarios, an artificial intelligence model (such as the Tranformer model) is used to learn and analyze users' short-term interaction preferences, and then recommends items or news that the user might interact with based on these short-term interaction preferences. However, as the data that users interact with in different application scenarios becomes increasingly complex and abundant, traditional sequence recommendation can no longer accurately analyze users' interaction preferences. It is necessary to analyze data on users' interactions over a longer historical period to obtain a more accurate analysis of users' interaction preferences; this is what is known as lifetime long-sequence recommendation. In other words, existing sequence recommendation methods have limitations to varying degrees. For example, the Tranformer model is better at handling shorter sequences and is suitable for analyzing users' short-term interaction preferences, but it is not suitable for handling longer interaction sequences to obtain users' long-term interaction preferences. It is evident that traditional sequence recommendation methods focus on learning users' interaction preferences over a relatively short period of time. While this approach can quickly learn users' interaction preferences and rapidly process data recommendations, the interaction preferences learned based on the interaction sequence over a relatively short period of time may not represent the user's true interaction preferences, resulting in low accuracy. Consequently, the data recommended based on these interaction preferences may not meet the user's interaction needs, leading to poor data recommendation processing performance.
[0083] Based on this, in order to improve the accuracy of the learned user interaction preferences and optimize the data recommendation effect, this application provides a data recommendation scheme that can simultaneously learn the user's long-term and short-term interaction preferences, and perform data recommendation processing on the user based on the long-term and short-term interaction preferences, thereby optimizing the data recommendation effect. The data recommendation scheme involved in this application may include at least the following four consecutive steps: 1. First, obtain the object to be processed for data recommendation (such as a user, intelligent robot, etc.), and obtain multiple (N examples, where N is a positive integer) instances of interaction behavior that the object has generated during a historical time period (usually, this historical time period should be a relatively long period, for example, the historical time period should be greater than or equal to a duration threshold, which can be specifically set based on actual business needs, and can be a large duration, for example, two weeks, one month, one year, etc.). The data consists of two parts: 1) Integer data (where the data and interaction behaviors are determined based on the recommendation scenario; for example, if the recommendation scenario is video recommendation, then the interaction behaviors could be playback / like / comment / share, etc., and the data of the object that has interacted with the data could be videos that have been played / liked / commented / shared). Based on the interaction time of each interacted data point, the interacted data can be sorted (e.g., sorted from earliest to latest time), thus obtaining an interaction data sequence; 2) After obtaining the object's data interaction sequence, the data can be exchanged... The interaction sequence is subjected to a first feature extraction process to obtain the first interaction feature of the object. In this application, the first feature extraction process can refer to performing long-term dependency analysis on the data interaction sequence to obtain the object's interaction preference over a relatively long historical period. That is, the first interaction feature obtained through the first feature extraction process can reflect the object's interaction preference characteristics within a first duration. The first duration is the duration indicated by the historical period, which may be slightly shorter than the historical period, but generally, the first duration should be equal to the historical period. 3. Simultaneously, after obtaining the object's data interaction sequence, a second feature extraction process can also be performed on the data interaction sequence to obtain the object's second interaction feature. In this application, the second feature extraction process can refer to performing short-term dependency analysis on the data interaction sequence to obtain the object's interaction preference within a recent period in the historical period. That is, the second interaction feature obtained through the second feature extraction process can reflect the object's interaction preference characteristics within a second duration. The second duration can be a later period in the historical period, and the second duration will be shorter than the first duration.4. Since the first interaction feature reflects the object's interaction preferences over a relatively long period, and the second interaction feature reflects the object's interaction preferences over a relatively short period, the first interaction feature can be considered a feature reflecting the object's long-term interaction preferences (referred to as the long-term interaction preference feature), and the second interaction feature can be considered a feature reflecting the object's short-term interaction preferences (referred to as the short-term interaction preference feature). This application can obtain a fused interaction feature that accurately reflects the object's long-term and short-term interaction preferences by fusing the first and second interaction features. Thus, data recommendation processing can be performed on the object by fusing the interaction features.
[0084] Therefore, in the process of recommending data to different objects, the embodiments of this application can adopt a lifetime long-sequence recommendation method. In this method, the application extracts a first interaction feature within a first time period and a second interaction feature within a second time period based on the object's data interaction sequence over a historical time period. This analysis determines the object's long-term interaction preference characteristics over a longer period and its short-term interaction preference characteristics over a shorter period. By fusing the first and second interaction features to obtain a fused interaction feature, the object's interaction preferences can be more accurately interpreted. Thus, based on the accurate fused interaction feature, data that better matches the object's interaction preferences can be recommended to the user, increasing the likelihood that the object will interact with the recommended data, thereby improving user experience and optimizing the data recommendation effect.
[0085] The data recommendation scheme provided in this application embodiment can be applied to any application scenario that requires data recommendation, including but not limited to: short video push scenarios, advertising scenarios, and product purchase scenarios. Wherein:
[0086] Short video push scenarios refer to situations where video data is continuously pushed to users. Users can request updates to display the next video by performing operations such as fetching video data (e.g., swiping the video display interface on the terminal device). Therefore, in short video push scenarios, users can continuously refresh and browse different video data by repeatedly performing these fetching operations.
[0087] Advertising scenarios can refer to scenarios where different advertising data is delivered to users. Users can click on the advertising data delivered to them, query and purchase products in the advertising data.
[0088] The product purchase scenario can refer to the scenario where a user browses and purchases products on a shopping platform.
[0089] In summary, the data recommendation scheme provided in this application can accurately analyze users' long-term and short-term interaction preferences based on their historical interaction behavior over a historical period, optimize the data recommendation effect, and effectively improve business coverage to a certain extent (such as expanding applicable scenarios).
[0090] It should be noted that the application scenarios given above are merely examples and do not limit the application scenarios to which the data recommendation scheme provided in this application is applicable.
[0091] Furthermore, the data recommendation scheme provided in this application embodiment can be executed by a computer device, which may include a terminal or a server, and may also include both a terminal and a server. To facilitate understanding of the data recommendation scheme provided in this application embodiment, the following is in conjunction with… Figure 1 The data recommendation system shown illustrates the application scenarios involved in the embodiments of this application; wherein, Figure 1 This is a schematic diagram of the architecture of a data recommendation system provided by an exemplary embodiment of this application, such as... Figure 1 As shown, the system includes a terminal 101 and a server 102; wherein:
[0092] 1) Terminal 101 may include the terminal device used by the user. Of course, depending on the application scenario and field in which this solution is applied, the terminal provided in this application embodiment may vary. Terminal devices may include, but are not limited to: smartphones (such as smartphones running the Android system, or smartphones running the Internetworking Operating System (IOS), tablet computers, portable personal computers, mobile Internet devices (MIDs), in-vehicle devices, head-mounted smart home devices, and smart voice interaction devices, etc. This application embodiment does not limit the type of terminal device, which is stated here.
[0093] For example, in a short video push scenario, the terminal device can be a smartphone; that is, in this implementation, the solution provided in this application embodiment can be deployed on the smartphone; when a user uses a smartphone to use a short video push application, the smartphone obtains the time point when the user is currently playing video data, and then obtains the historical time period of that time point. Then, the smartphone can obtain video data of the user's interactive behaviors (such as clicks, playback, comments, sharing, etc.) within the historical time period. Based on the time of the user's interaction with each video data, these interacted video data can be sorted, thereby obtaining a video interaction sequence; then, the smartphone can... The video interaction sequence is processed by a first feature extraction process to obtain a first interaction feature that reflects the user's interaction preferences within a first duration (e.g., what types of video data the user prefers to view, what types of video content the user dislikes seeing, etc.); and by a second feature extraction process to obtain a second interaction feature that reflects the user's interaction preferences within a second duration. After the smartphone merges the first and second interaction features to obtain a fused interaction feature, it can predict the video data that the user may interact with based on the fused interaction feature and push the video data to the user. Thus, the user can view the video data after performing a video retrieval operation. For example, in a smart vehicle scenario, an application deploying the solution provided in this application embodiment is an in-vehicle application; the type of the in-vehicle application may include, but is not limited to, music, video, or games.
[0094] An application can refer to a computer program designed to perform one or more specific tasks. Classifying applications according to different dimensions (such as how they run and their functions) can yield different types of the same application. For example, based on how they run, applications can include, but are not limited to: clients installed on a terminal, small programs that can be used without downloading and installation (as subroutines of the client), and World Wide Web (Web) applications opened through a browser. Another example is based on their functional type, which can include, but is not limited to: instant messaging (IM) applications, interactive content applications, audio applications, or video applications. Instant messaging applications refer to applications that facilitate instant communication and social interaction over the internet, and can include, but are not limited to: applications with communication functions, map applications with interactive functions, and game applications. Interactive content applications are applications capable of content interaction, such as sharing platforms, personal spaces, and news applications. Audio applications are applications that implement audio functions over the internet, and can include, but are not limited to: music applications with music playback and editing capabilities, radio applications with radio playback capabilities, or live streaming applications with live streaming capabilities. A video application is an application that can play videos. Video applications can include, but are not limited to, applications that have short videos (videos are often short in length, such as a few seconds or a few minutes) (such as short video push applications), applications that have long videos (such as videos with a longer playback time, such as movies or TV series), and so on.
[0095] Of course, the solutions provided in this application can be deployed directly on a device (such as a smartphone) or outside of an application, as described above, or they can be deployed on a device or application in the form of a plugin. This application does not limit the carrier of the deployment solution.
[0096] 2) Server 102 can be a server corresponding to the terminal, used to interact with the terminal to provide computing and application service support. Specifically, this server is a backend server corresponding to the application deployed in the terminal, used to interact with the terminal to provide computing and application services for the application. Server 102 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0097] The terminal 101 and the server 102 can be directly or indirectly connected via wired or wireless communication, and this application does not impose any limitations on this. Furthermore, this application does not limit the number of terminals and servers; Figure 1 The number of terminals 101 and servers 102 is only a single example. In actual applications, multiple servers may be distributed in a distributed manner. This is just a brief explanation.
[0098] The following is combined with Figure 1The system described here outlines the general process of a data recommendation scheme in an application scenario. Taking an ad push scenario as an example, in its specific implementation, firstly, when a user uses an application (such as a game application) on a terminal, the server corresponding to the terminal can organize multiple ad data that will be pushed to the user into a candidate ad set. Then, the server can collect ad data of the user's interactive behaviors (such as clicks, purchases of advertised items, etc.) within the game application over a historical period. Based on the interaction time of these ad data, an ad interaction sequence can be obtained. Further, the server can perform a first feature extraction process on the ad interaction sequence to obtain the user's first interaction feature, which can be used to reflect the user's ad interaction preference characteristics over a relatively long historical period (ad interaction preference characteristics, such as what type of ad data they tend to click on, what type of goods they tend to purchase, etc.). The server can also perform a second feature extraction process on the ad interaction sequence to obtain the user's second interaction feature, which can be used to reflect the user's ad interaction preference characteristics over a recent period. Then, the server can fuse the first interaction feature with the second interaction feature to obtain a fused interaction feature that can accurately reflect the user's long-term and short-term interaction preferences. Based on the fused interaction feature, the server can select the advertisement from the candidate advertisement set that the user may interact with. The server can return the advertisement to the terminal, so that the terminal can push the advertisement to the user in the game application.
[0099] Based on the above-described solution and system architecture, the following points should also be noted:
[0100] ①The embodiments of this application mentioned above Figure 1 The system shown is for the purpose of more clearly illustrating the technical solutions of the embodiments of this application and does not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will understand that with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems. For example, the above description uses the example of the execution subject "computer device" of this application including a terminal and a server, that is, the terminal and server jointly executing the solution provided by the embodiments of this application, to introduce one application scenario of this solution; it should be understood that in practical applications, the computer device can also be a terminal or a server, that is, it supports the terminal or server alone executing the solution provided by the embodiments of this application.
[0101] ② The data collection and processing in this application embodiment should strictly comply with the requirements of relevant laws and regulations. Obtaining personal information requires the knowledge or consent of the individual (or a legal basis for information acquisition), and subsequent data use and processing should be carried out within the scope of laws, regulations, and the authorization of the personal information subject. For example, when this application embodiment is applied to specific products or technologies, such as obtaining data on user interactions within a historical time period (e.g., video data, advertising data, etc.) and performing data recommendation processing for users, the user's permission or consent must be obtained. Furthermore, the collection, use, and processing of related data (e.g., data recommendation processing based on historical interaction data) must comply with the relevant laws, regulations, and standards of the relevant regions.
[0102] Based on the solution described above, please refer to [link / reference needed] for a better understanding of its application scenarios. Figure 2 , Figure 2 This is a schematic diagram of a scenario provided in an embodiment of this application. Wherein, as... Figure 2 The scenario shown is an example of recommending videos to users. Figure 2 As shown, when user A uses a short video push application deployed on their terminal, the application continuously pushes new video data to user A. User A can request the display of new video data by performing an operation to retrieve the video data. Figure 2 As shown, in the video display interface 2001 of the terminal, the video data currently exposed to the user is video data 200a (that is, the video data currently being played by user a is video data 200a, the creator of video data 200a is an object named "Lala Loves Dancing", and the video text of video data 200a is "Teach you a dance in three minutes"). The video display interface 2001 displays like, comment, and share controls, which can be used by user a to like, comment on, and share video data 200a. In addition, user a can request a refresh of the video display interface 2001 by performing a swipe operation to display new video data (video data that user a has not played or is currently playing).
[0103] It's worth noting that in practical applications, the backend server of short video push applications can pre-select multiple videos with similar themes or content (e.g., videos with themes like "pets," "cooking," "restaurant reviews," and "relationship counseling") from the database based on the videos the user is currently playing or has played. These videos are then transcoded, and the terminal pre-loads the transcoded video data. After the user performs the action of retrieving video data, the terminal can push these downloaded transcoded video data to the user sequentially for browsing and viewing.
[0104] In this application, when the backend server searches for video data to be pushed to the user from the database, it can adopt the solution provided in this application. Based on the video data that the user has played and watched in the historical time period, it can accurately analyze the user's long-term viewing preferences and short-term viewing preferences to obtain a first interaction feature and a second interaction feature that can reflect the user's long-term viewing preferences and short-term viewing preferences. Then, the backend server can fuse the first interaction feature and the second interaction feature to obtain a fused interaction feature. After that, the backend server can find multiple video data that match the fused interaction feature from the database based on the fused interaction feature and use them as video data to be pushed to the user. The backend server can transcode these video data and send them to the terminal, where the terminal preloads them and pushes them to the user in sequence.
[0105] For example, in such Figure 2 In the scenario shown, when user A watches video data 200a, the server can analyze user A's long-term and short-term viewing preferences based on user A's historical video playback data. Then, based on the user's viewing preferences, the server can retrieve 5 video data sets from the database to be pushed to user A. These 5 video data sets can be sorted according to a certain sorting rule (such as random sorting), thus obtaining a video data sequence. The server can then transcode each video data set in this sequence. It is worth noting that these 5 video data sets will be sequentially exposed and played to the user after the user repeatedly performs the operation of fetching video data.
[0106] For example, such as Figure 2 As shown, assume that the video data sequence to be pushed to user a by the server is {video data 200b, video data 200c, video data 200d, video data 200e, video data 200f}, and user a performs a swipe operation in the video display interface 2001 (the swipe direction is as follows). Figure 2 (As indicated by the arrow shown), the terminal can respond to this sliding operation and update the video data displayed in the video display interface 2001 to the transcoded video data 200b (the creator of video data 200b is an object named "Meimei Makes Delicious Food", and the video text of video data 200b is "Buy crucian carp and cook it this way, the aroma is irresistible!"). If user a performs another sliding operation in the video display interface 2001 (the sliding direction is as shown by the arrow shown), the terminal can respond to this sliding operation and update the video data displayed in the video display interface 2001 to the transcoded video data 200b (the creator of video data 200b is an object named "Meimei Makes Delicious Food", and the video text of video data 200b is "Buy crucian carp and cook it this way, the aroma is irresistible!"). Figure 2If the direction indicated by the arrow is as shown, then the terminal can respond to this sliding operation and update the video data displayed in the video display interface 2001 to video data 200c... In other words, the user can request to update the display of new video data by continuously performing sliding operations. When user a plays and browses video data 200f, the server can use the solution provided in this application to predict a new batch of video data and sort it as a sequence of video data to be pushed to user a.
[0107] Based on the above-described scheme and application scenarios, this application proposes a more detailed data recommendation method. The data recommendation method proposed in this application will be described in detail below with reference to the accompanying drawings.
[0108] Please see Figure 3 , Figure 3 This is a flowchart illustrating a data processing method provided in an exemplary embodiment of this application. The flowchart may refer to the data recommendation scheme provided in the embodiments of this application. This data processing method (data recommendation method) can be executed by a computer device in the aforementioned system, such as a terminal and / or a server; the data processing method may include at least the following steps S301-S304:
[0109] Step S301: Obtain the data interaction sequence of the object; the data interaction sequence includes N data points of interaction behavior generated by the object within a historical time period, where N is a positive integer.
[0110] In this application, the object can refer to a user (or an intelligent robot). In a data recommendation scenario, this application can collect multiple (here, N) data points showing that the object has interacted with the data over a historical time period. Based on the time the object interacts with each data point, these interacted data points can be sorted, thus obtaining a data interaction sequence. The data used to generate interactive behaviors by the object can vary depending on the data recommendation scenario. For example, in a video recommendation scenario, the data could refer to video data; in an ad push scenario, the data could refer to ad data; and in a product recommendation scenario, the data could refer to products. As the recommendation scenario and the interactive data differ, the interactive behaviors generated by the object in this application will also differ. For example, in a video recommendation scenario, the object's interactive behaviors with video data can include playback, liking, commenting, sharing, and reporting; similarly, in an ad push scenario, the object's interactive behaviors with ad data can include clicking, purchasing products in the ad (which can be understood as ad conversion), closing the ad, and reporting.
[0111] In general, in different data recommendation scenarios, the data interaction sequence of an object can be understood as a sequence determined based on the object's historical behavior within a historical time period. Specifically, it is a sequence obtained by sorting N data points of interaction behavior generated by the object within a historical time period in chronological order (e.g., from morning to night). The historical time period can be set based on actual business needs; for example, in a video recommendation scenario, the historical time period can be set to 7 days, 10 days, etc. It is worth noting that this application uses lifetime long sequence recommendation for data recommendation. Therefore, in order to make the data interaction sequence long enough and include a sufficient amount of interacting data, the historical time period in this application needs to be set to a relatively long value (e.g., one month, two months, one year, etc.). This way, a sufficient amount of data on the object's interaction behavior can be collected over a sufficiently long period to form a long data interaction sequence, and then data recommendation processing can be performed on the object based on this long data interaction sequence.
[0112] Step S302: Perform first feature extraction processing on the data interaction sequence to obtain the first interaction feature of the object. The first interaction feature is used to characterize the interaction preference characteristics of the object within a first duration, where the first duration is less than or equal to the historical time period.
[0113] In this application, a memory model can be invoked to perform feature extraction processing on the data interaction sequence (referred to as first feature extraction processing) to obtain the first interaction features of the object. The memory model in this application is preferably an Extended Long Short-Term Memory (xLSTM) network, which is an improved extension of the traditional Long Short-Term Memory network. It improves the gating mechanism and memory structure of the traditional Long Short-Term Memory network by introducing an exponential gating mechanism, providing dynamic information filtering capabilities. Specifically, the Extended Long Short-Term Memory network proposes two unit variants: Scalar Long Short-Term Memory (sLSTM) and Matrix Long Short-Term Memory (mLSTM), aiming to address some inherent limitations of the traditional Long Short-Term Memory network and improve performance. The Scalar Long Short-Term Memory unit introduces exponential gating and a scalar update mechanism to improve the robustness of long sequence modeling; while the Matrix Long Short-Term Memory unit introduces exponential gating, matrix memory, covariance update rules, and parallel training, extending vector operations to matrix operations and improving the storage capacity of long-term dependent information. These units are integrated through layer stacking and residual connections to form a novel xLSTM model architecture. The embodiments of this application can propose a data recommendation scheme suitable for lifelong long sequence recommendation tasks based on the extended long short-term memory network model architecture.
[0114] Specifically, after obtaining the data interaction sequence of the object, this application can use matrix long short-term memory units to perform feature learning on the data interaction sequence to obtain the object's long-term interaction preferences, and use hybrid long short-term memory units (scalar long short-term memory units) to perform feature learning on the data interaction sequence to obtain the object's short-term interaction preferences. In other words, the first feature extraction processing of the data interaction sequence in this application can be implemented by matrix long short-term memory units in the memory model, which this application may refer to as matrix memory components. Because matrix long short-term memory units (i.e., matrix memory components) are suitable for long-distance transmission of memories, they can meet the requirements of long-term recommendation tasks that require transmitting early interaction preferences of an object over long distances. Therefore, by using matrix long short-term memory units to extract features from long interaction sequences over a historical period, we can obtain a first interaction feature that characterizes the object's interaction preferences over a relatively long initial time period. This interaction preference feature can reflect the data types, data content, data titles, etc., that the object tends to interact with over a long period, as well as the data types and data content that the object exhibits a negative attitude towards. Since the initial time period is long, this interaction preference feature can be called a long-term interaction preference feature (in other words, this first interaction feature is a representation of the object's long-term interaction preferences over a relatively long historical period). The specific implementation process of extracting the first feature from the data interaction sequence to obtain the object's first interaction feature will be detailed later. Figure 5 The relevant descriptions in the corresponding embodiments.
[0115] Step S303: Perform second feature extraction processing on the data interaction sequence to obtain the second interaction feature of the object. The second interaction feature is used to characterize the interaction preference characteristics of the object in the second time period, which is shorter than the first time period.
[0116] In this application, the aforementioned memory model can be invoked to perform feature extraction processing (referred to as second feature extraction processing) on the data interaction sequence to obtain the second interaction features of the object. Based on the description in step S302 above, the memory model in this application is preferably an Extended Long Short-Term Memory (ESLM) network. The Scalar ESM in the ESM network introduces exponential gating and scalar update mechanisms. The Scalar ESM overcomes the limitations of traditional ESM networks in correcting memory decision-making problems by changing the input gate and forget gate to exponential activation functions, summing the product of the input gate and the future forget gate as the normalized state, and using exponential gates to achieve memory mixing. Based on the characteristics of the Scalar ESM, it is suitable for discovering the connections between behaviors in an object's behavior sequence. In data recommendation scenarios, the object's short-term behavioral preferences focus more on the connections between recent behaviors. Therefore, this application uses a scalar ESM (hybrid ESM) to perform feature learning on the data interaction sequence to obtain the object's short-term interaction preferences. In other words, the second feature extraction processing of the data interaction sequence in this application can be implemented by a hybrid long short-term memory unit in the memory model, which can be referred to as a hybrid memory component in this application. By performing feature extraction processing on the interaction sequence within a historical time period using the hybrid long short-term memory unit, a second interaction feature can be obtained to characterize the interaction preference of the object on the data within a relatively short second time period. This interaction preference feature can reflect the data types, data content, data titles, etc., that the object tends to interact with in a relatively short period of time, and can also reflect the data types and data content that the object has a negative attitude towards. Since the second time period is relatively long, this interaction preference feature can be called a short-term interaction preference feature (in other words, the second interaction feature is a short-term interaction preference representation of the object in a relatively short period of recent history). For the specific implementation process of performing the second feature extraction processing on the data interaction sequence to obtain the object's second interaction feature, please refer to the following. Figure 6 The relevant descriptions in the corresponding embodiments.
[0117] Step S304: The first interaction feature and the second interaction feature are fused to obtain the fused interaction feature of the object, and the object is recommended based on the fused interaction feature.
[0118] In this application, after obtaining the first interaction feature and the second interaction feature, the first interaction feature and the second interaction feature can be fused to obtain a fused interaction feature that can represent long-term interaction preference characteristics and short-term interaction preference characteristics. The specific implementation process of fusing the first interaction feature and the second interaction feature to obtain the fused interaction feature of the object can include at least the following: First, a first fusion weight corresponding to the first interaction feature and a second fusion weight corresponding to the second interaction feature can be obtained; then, the first fusion weight and the first interaction feature can be processed to obtain a first operational interaction feature; alternatively, the second fusion weight and the second interaction feature can be processed to obtain a second operational interaction feature; finally, the first operational interaction feature and the second operational interaction feature can be summed to obtain the fused interaction feature of the object.
[0119] The specific implementation process for obtaining the first fusion weight corresponding to the first interaction feature and the second fusion weight corresponding to the second interaction feature may include, but is not limited to, the following: First, a weight calculation function may be obtained, which may contain learnable parameters; then, the weight calculation function may be used to perform calculations on the learnable parameters, the first interaction feature, and the second interaction feature to obtain a calculation result, which may be the first fusion weight corresponding to the first interaction feature; further, the difference between the unit value and the first fusion weight may be determined, where the unit value may refer to the numerical value 1. The difference between the unit value and the first fusion weight may be determined as the second fusion weight corresponding to the second interaction feature.
[0120] It should be understood that in this application, the proportion of long-term interaction preferences and short-term interaction preferences in the overall interaction preferences of the object can be adaptively adjusted through a gating network. That is to say, the weight calculation function in this application can refer to the gating function in the gating network. Through this gating function, the proportion of the first interaction feature (representation of long-term interaction preferences) and the second interaction feature (representation of short-term interaction preferences) in the overall interaction preference representation of the object (i.e., the fused interaction features) can be calculated. The first fused weight can be understood as the proportion of the first interaction feature in the fused interaction features, and the second fused weight can be understood as the proportion of the second interaction feature in the fused interaction features. The method of calculating the first fused weight through the weight calculation function can be as shown in formula (1):
[0121] α=σ(W l u l +W s u s +b l ) Formula (1)
[0122] Among them, W, as shown in formula (1) l W s b l It can be used to characterize the learnable parameters in this weight calculation function; u l It can be used to characterize the first interaction feature; u s It can be used to characterize the second interactive feature; α can be used to characterize the first fusion weight.
[0123] After determining the first fusion weight, the overall interaction preference representation of the object (i.e., the fusion interaction feature) can be expressed by formula (2), as shown in formula (2):
[0124] u f =α·u l +(1-α)u s Formula (2)
[0125] Among them, α, as shown in formula (2), can be used to characterize the first fusion weight; u l It can be used to characterize the first interaction feature; u s It can be used to characterize the second interaction feature; (1-α) can be used to characterize the second fusion weight; u f It can be used to characterize fusion interaction features.
[0126] It should be understood that by employing gating networks, the long-term and short-term interaction preference representations of an object can be adaptively fused to obtain the overall interaction preference representation of the object. Through gating networks, the proportion of long-term and short-term interaction preference representations of an object on different datasets can be adaptively adjusted. Based on the user's historical behavior sequence (such as the data interaction sequence within a historical time period) and immediate needs, the information flow can be dynamically adjusted, thereby better exploring the impact of long-term interaction preferences on users and adapting to the frequently changing short-term interaction preferences of users.
[0127] In practical applications, after obtaining the fused interaction features that reflect the overall interaction preferences of an object, data recommendation processing can be performed on that object based on these fused interaction features. The specific implementation methods may include, but are not limited to, the following: First, a candidate data set can be obtained, containing one or more candidate data to be recommended to the object. This candidate data set can be specifically set according to different recommendation scenarios. For example, in a video recommendation scenario, the candidate data set may refer to a candidate video set containing multiple candidate videos; in an advertising recommendation scenario, the candidate data set may refer to a candidate ad set containing multiple candidate ads. Then, the aforementioned fused interaction features and each candidate data can be subjected to probability calculation processing to obtain the interaction prediction probability corresponding to each candidate data (the interaction prediction probability corresponding to each candidate data refers to the probability that the object will interact with the candidate data).
[0128] The specific method for calculating the interactive prediction probability corresponding to a certain candidate data can be shown in formula (3):
[0129]
[0130] Among them, u, as shown in formula (3) f It can be used to characterize fusion interaction features; It can be used to characterize the embedding representation features corresponding to a candidate data in a candidate dataset, and these embedding representation features can be obtained through a feature embedding layer; P(v i |u f This can be used to characterize the interaction prediction probability corresponding to a certain candidate data. In other words, when calculating the interaction prediction probability corresponding to a certain candidate data, it is necessary to find the embedded representation feature corresponding to the candidate data through the feature embedding layer, and then perform calculation processing based on the embedded representation feature and the fused interaction feature.
[0131] Notably, this application can use a feature embedding layer (e.g., an embedding layer) to pre-maintain an embedding representation matrix for all data in the dataset. In this embedding representation matrix, the high-dimensional one-hot encoded representation of each data can be projected onto a low-dimensional dense representation. In this way, the embedding representation matrix can contain the embedding representation features corresponding to each data in the dataset. Based on this, after obtaining the data interaction sequence of the object, for each data in the data interaction sequence, the embedding representation features corresponding to each data can be found from the embedding representation matrix through a lookup operation. In other words, this application can pre-maintain an embedding representation matrix for all data in a dataset through a feature embedding layer. This dataset contains embedding representation features of various data (such as individual video data) in a data recommendation scenario (such as a video recommendation scenario). Thus, when data recommendation processing (such as video recommendation processing) is needed for a certain object in this data recommendation scenario, after obtaining the data interaction sequence (such as a video interaction sequence) in which the object has generated interactive behavior in this data recommendation scenario, the embedding representation features corresponding to each data in these data interaction sequences can be directly obtained from the embedding representation matrix maintained by the feature embedding layer through a lookup operation. This eliminates the need for real-time feature embedding processing through the feature embedding layer, thereby significantly improving feature processing efficiency and consequently, subsequent data recommendation efficiency. Based on this, when calculating the interaction prediction probability corresponding to a candidate data, this candidate data actually belongs to a certain data in the data recommendation scenario, so the corresponding embedding representation features can be directly obtained from the feature embedding layer through a lookup operation.
[0132] After obtaining the interaction prediction probability corresponding to each candidate data point, recommended data for the object can be selected from the candidate data set based on the interaction prediction probability of each candidate data point, and the recommended data can be recommended to the object. For example, the largest interaction prediction probability (called the maximum interaction prediction probability) can be obtained, and the candidate data corresponding to the maximum interaction prediction probability can be used as recommended data and pushed to the object. Of course, in some application scenarios, when recommending data to an object, the number of recommendations may not be just one. In this case, after obtaining the interaction prediction probability corresponding to each candidate data point, the interaction prediction probabilities can be sorted in ascending order to obtain a probability sequence. Then, the last K (K can be set based on the actual recommendation needs) interaction prediction probabilities in the probability sequence can be selected, and the K candidate data corresponding to the last K interaction prediction probabilities can be used as recommended data and pushed to the object.
[0133] As can be seen from the above, in data recommendation scenarios, the embedded representation features of each candidate data and the fusion interaction features of the objects are quite important, as they determine the interaction prediction probability of each candidate data. Therefore, in order to improve the accuracy of the calculated interaction prediction probability of each candidate data, this application can optimize and train the gating network and the feature embedding layer to gradually optimize their parameters (e.g., the learnable parameter W in formula (1)). l W s b lThis allows the fusion interaction features calculated by the gating network to be more accurate and reasonable, and the embedding representation features of each data maintained by the feature embedding layer to be more accurate and reasonable. Specifically, the parameter training of the gating network and the feature embedding layer in this application may include at least the following three steps: 1. First, sample objects for parameter training can be obtained. These sample objects can refer to objects that have interacted with different data in the data recommendation scenario. Then, one or more data of the sample objects that have interacted with the sample objects in the first sample historical time period (the first sample historical time period may be earlier than the above historical time period) can be obtained. These data can be called sample data. After sorting them according to the order of time, a sample data interaction sequence of the sample objects can be obtained; 2. Determine the sample fusion interaction features of the sample objects based on the sample data interaction sequence of the sample objects. Specifically, after obtaining the sample data interaction sequence of the sample object, according to the scheme provided in this application, a matrix memory component can be used to perform a first feature extraction process on the sample data interaction sequence, thereby obtaining the first sample interaction feature of the sample object. This first sample interaction feature can reflect the interaction preference characteristics of the sample object within a first sample duration (less than or equal to the first sample historical time period; typically, the first sample duration should be equal to the first sample historical time period). Similarly, a hybrid memory component can be used to perform a second feature extraction process on the sample data interaction sequence, thereby obtaining the second sample interaction feature of the sample object. This second sample interaction feature can reflect the interaction preference characteristics of the sample object within a second sample duration (the second sample duration is less than the first sample duration). Then, the first sample interaction feature and the second sample interaction feature can be fused to obtain a sample fused interaction feature. 3. Perform feature embedding processing on all data in the dataset under the data recommendation scenario through the feature embedding layer to obtain the embedding representation feature corresponding to each data. After obtaining the sample data interaction sequence corresponding to the sample object, the embedding representation feature corresponding to each sample data in the sample data interaction sequence can be found from the feature embedding layer (which can be called the sample embedding representation feature); 4. Obtain the candidate data set in the data recommendation scenario, and then obtain the sample embedding representation feature corresponding to each candidate data. In the way expressed by the above formula (3), the sample fusion interaction feature and the sample embedding representation feature corresponding to each candidate data can be calculated and processed to obtain the sample interaction prediction probability corresponding to each candidate data; 5. Select the recommended data of the sample object from the candidate dataset based on the sample interaction prediction probability corresponding to each candidate data.
[0134] It is worth noting that the candidate data set in a certain data recommendation scenario can refer to a unified set, or different sets can be set for different objects. This can be set based on actual business needs. After determining the recommendation data of the sample object, this application can use cross-entropy loss to train the gating network and the feature embedding layer. Specifically, this application can obtain the data of the actual interaction behavior generated by the sample object in the second sample historical time period (later than the first sample historical time period, earlier than the historical time period). This data can be used as the real label data of the sample object. For the real label data of the sample object, the embedding representation features corresponding to the real label data can also be determined by the feature embedding layer. Then, the cross-entropy loss function can be used to calculate the embedding representation features corresponding to the real label data, the sample embedding representation features corresponding to each candidate data, and the sample fusion representation features to calculate a cross-entropy loss value. The network parameters of the gating network (including W in the above formula (1)) can be adjusted by the cross-entropy loss value. l W s b l The computational parameters of the feature embedding layer are continuously trained and optimized.
[0135] The specific method for calculating the cross-entropy loss value used for parameter training can be shown in Equation (4):
[0136]
[0137] Among them, u, as shown in formula (4) f Sample fusion interaction features that can be used during the parameter training phase; e g It can be used to characterize the embedding representation features of real labeled data; The cross-entropy loss value can be used to characterize the embedded representation features of a candidate data point (which can be directly obtained from the feature embedding layer through a lookup operation); V can be used to characterize the total number of candidate data points contained in the candidate dataset. Through this cross-entropy loss value, the learnable parameters in the gating network and the feature embedding layer can be continuously trained and optimized to reach their optimal state. The fusion weights calculated by the weight calculation function (such as the first fusion weight) can be more accurate. This allows for a more reasonable coordination when adjusting the proportion of long-term and short-term interaction preference representations in the overall interaction preference representation, resulting in increasingly accurate and reasonable fused interaction features. When training ends, the learnable parameters in the gating network can be used to calculate the fused interaction features of a specific object, and the feature embedding layer can provide the embedded representation features of each data point.
[0138] This application provides a lifetime long-sequence recommendation scheme based on a matrix and hybrid mechanism dual-stream long short-term memory (LSM) unit. This scheme enhances the ability to learn long-term historical behaviors. Based on the characteristics of lifetime long-sequence recommendation tasks, this scheme improves the layer stacking method of the extended long short-term memory network, effectively improving the learning accuracy of interaction preferences, enhancing data recommendation performance, and optimizing data recommendation results. Specifically, after obtaining the data interaction sequence of an object (such as a user) (including N data points showing interactions the object has generated within a historical time period), this application, guided by the extended long short-term memory network, uses matrix LSM units to learn the object's long-term interaction preference representation; simultaneously, it uses hybrid LSM units to learn the object's short-term interaction preference representation. This scheme uses a gating network to adaptively fuse the long-term and short-term interaction preference representations to obtain a fused interaction feature. This fused interaction feature reflects the object's overall interaction preferences, thus reflecting more accurate object interaction preferences. Data recommendations based on this fused interaction preference are also more accurate and reasonable, optimizing data recommendation results. In summary, this application can improve the learning accuracy of interaction preferences and optimize data recommendation results.
[0139] Furthermore, to facilitate understanding of the overall logical flow of the solution provided in this application, please also refer to... Figure 4 , Figure 4 This is a schematic diagram of the logical architecture of a data recommendation scheme provided in an embodiment of this application. For example... Figure 4 As shown, this logical architecture may include at least the following components: a data embedding representation layer, a long-term preference learning component, a short-term preference learning component, a gating network, a data prediction component, and a data recommendation component. For ease of understanding, the functions implemented by each component will be briefly described below:
[0140] Data Embedding Representation Layer: The data embedding representation layer can be understood as the feature embedding layer described above. It pre-maintains an embedding representation matrix for all data in a dataset. This matrix contains the embedding representation features corresponding to each data point in a specific dataset within a data recommendation scenario. Based on this, after obtaining the data interaction sequence of an object, the embedding representation feature corresponding to each data point in the sequence can be found in the embedding representation matrix through a lookup operation.
[0141] Long-term preference learning component: The long-term preference learning component can be used to perform first feature extraction processing on the representation feature sequence corresponding to the data interaction sequence to obtain the long-term interaction preference representation of the object (such as the first interaction feature).
[0142] Short-term preference learning component: The long-term preference learning component can be used to perform second feature extraction processing on the representation feature sequence corresponding to the data interaction sequence to obtain the short-term interaction preference representation of the object (such as the second interaction feature).
[0143] Gated networks: Gated networks can be used to adaptively fuse long-term interaction preference representations with short-term interaction preference representations to obtain an overall interaction preference representation (such as fused interaction features).
[0144] Data Prediction Component: The data prediction component can be used to calculate the interaction prediction probability of each candidate data based on the fused interaction features and the embedded representation features of each candidate data, and determine the candidate data that the next object may generate interactive behavior through the interaction prediction probability of each candidate data.
[0145] Data recommendation component: The data recommendation component can be used to recommend candidate data identified by the data prediction component to objects.
[0146] For the functions implemented by each component, please refer to the relevant descriptions in the corresponding embodiments above, which will not be repeated here.
[0147] Furthermore, to facilitate understanding of the specific process of learning the long-term interaction preference representations of objects in this application, please also refer to... Figure 5 , Figure 5 This is a schematic diagram of a process for learning long-term interaction preference representations provided in an embodiment of this application. This process can correspond to the above. Figure 3 The corresponding embodiment describes the process of extracting the first feature of the data interaction sequence to obtain the first interaction feature of the object. For example... Figure 5 As shown, the process may include at least the following steps S501-S505:
[0148] Step S501: Invoke the memory model; the memory model includes a feature embedding layer and a matrix memory component.
[0149] For details, please refer to the previous text. Figure 3 As can be seen from the relevant descriptions in the corresponding embodiments, the memory model in this application can refer to an extended long short-term memory network, which may include matrix long short-term memory units (which can be called matrix memory components). In addition to including matrix memory components, the memory model may also include a feature embedding layer (which can be understood as an embedding layer).
[0150] Step S502: Perform feature embedding processing on each data in the data interaction sequence through the feature embedding layer to obtain the first embedded representation feature corresponding to each data.
[0151] Specifically, this feature embedding layer can preferentially perform feature embedding processing on each data point in the data interaction sequence to obtain an embedding representation feature corresponding to each data point (here, for ease of distinction from subsequent descriptions, the embedding representation features corresponding to each data point can be referred to as the first embedding representation feature). It is worth noting that, as described above, the feature embedding layer of this application can be pre-trained to maintain an embedding representation matrix for all data in a dataset. This embedding representation matrix can project the high-dimensional one-hot encoded representation of each data point onto a low-dimensional dense representation. Thus, the embedding representation matrix contains the embedding representation features corresponding to each data point in the dataset. Based on this, after obtaining the data interaction sequence of the object, for each data point in the data interaction sequence, the embedding representation feature corresponding to each data point can be found from the embedding representation matrix through a lookup operation. In other words, this application can pre-maintain an embedding representation matrix for all data in a dataset through a feature embedding layer. This dataset contains embedding representation features of various data (such as individual video data) in a data recommendation scenario (such as a video recommendation scenario). Thus, when data recommendation processing (such as video recommendation processing) is needed for a certain object in this data recommendation scenario, after obtaining the data interaction sequence (such as a video interaction sequence) in which the object has generated interactive behavior in this data recommendation scenario, the embedding representation features corresponding to each data in these data interaction sequences can be directly obtained from the embedding representation matrix maintained by the feature embedding layer through a lookup operation. This eliminates the need for real-time feature embedding processing through the feature embedding layer, significantly improving feature processing efficiency and consequently, subsequent data recommendation efficiency. The embedding representation features of each data in the data interaction sequence obtained from the feature embedding layer can be referred to as the first embedding representation features of the data.
[0152] Step S503: Sort the N first embedding representation features according to the order of the data interaction sequence to obtain the first representation feature sequence.
[0153] Specifically, after obtaining the first embedding representation features of each data in the data interaction sequence, since there are N data, N first embedding representation features can be obtained. The N first embedding representation features can be sorted according to the arrangement order of the data interaction sequence, thereby obtaining a representation feature sequence, which can be called the first representation feature sequence.
[0154] It should be understood that in some optional embodiments, the embedding representation features corresponding to each data may be in different spaces, which may result in some embedding representation features being larger and others being smaller. This makes it inconvenient to perform subsequent calculations or other processing on each embedding representation feature. Based on this, after obtaining the first embedding representation features corresponding to each data in the data interaction sequence, they can be subjected to layer normalization so that each first embedding representation feature is in the same space, which facilitates feature calculation. In order to enhance robustness and prevent overfitting, this application can introduce an embedding discarding method. For the first embedding representation features after layer normalization, embedding discarding can be performed on them by embedding discarding function to improve robustness. In summary, this application can determine the first embedding representation features corresponding to each data in the data interaction sequence through the feature embedding layer. Then, according to the arrangement order of each data in the data interaction sequence, each first embedding representation feature can be sorted. The resulting sequence can be called the first representation feature sequence. Further, for each first embedding representation feature in the first representation feature sequence, layer normalization and embedding discarding can be performed on it to obtain the final sequence representation. Its specific implementation method is shown in formula (5):
[0155]
[0156] Among them, E, as shown in formula (5) n It can be used to characterize the sequence of representation features composed of the embedding representation features of each data (such as the first representation feature sequence); LayerNorm() can be used to characterize the layer normalization function; Dropout() can be used to characterize the embedding dropout function. It can be used for characterization layer normalization and sequence representation after embedding dropout. In subsequent computational processing, E can be used. n To perform the calculation, you can also use To perform the calculations.
[0157] Step S504: According to the arrangement order of the first representation feature sequence, the first hidden state representation feature of each first embedded representation feature is calculated sequentially through the matrix memory component.
[0158] Based on the above, the memory model in this application may include a matrix memory component, which can be a matrix long short-term memory unit in an extended long short-term memory network. In practical applications, this matrix long short-term memory unit may include an input gate, a forget gate, and an output gate. Specifically, in the matrix long short-term memory unit, for a data point t in a received sequence, a pair of vectors (containing a key vector and a value vector) is stored. For the t+1th data point in the sequence, its value vector is retrieved using a query vector. In the matrix long short-term memory unit, the forget gate corresponds to the decay rate, the input gate corresponds to the learning rate, and the output gate adjusts the retrieved vector. In other words, the matrix memory component needs to use the input gate, forget gate, and output gate to sequentially calculate the key-value pairs of each first embedding representation feature to obtain a hidden state representation feature (which can be called the first hidden state representation feature) for each first embedding representation feature.
[0159] The input gate, forget gate, and output gate contained in the matrix long short-term memory unit can be collectively referred to as matrix memory gates. The specific implementation method for calculating the first hidden state representation feature of each first embedded representation feature sequentially through the matrix memory component according to the arrangement order of the first representation feature sequence may include, but is not limited to, the following: First, taking the calculation of the first hidden state representation feature of any first embedded representation feature as an example, any one of the N first embedded representation features can be determined as the first target embedded representation feature, and the first embedded representation feature preceding the first target embedded representation feature in the first representation feature sequence can be determined as the first reference embedded representation feature. Then, the first target embedded representation feature can be processed by retrieval vector calculation to obtain the retrieval vector corresponding to the first target embedded representation feature. The retrieval vector calculation process in this application can refer to the processing of calculating the key vector using a key vector calculation function, the processing of calculating the value vector using a value vector calculation function, and the processing of calculating the query vector using a query vector calculation function. In other words, the retrieval vector calculated in this application will contain the retrieval vector, key vector, and value vector corresponding to the first target embedded representation feature.
[0160] The specific method for calculating the retrieval vector is shown in formula (6):
[0161]
[0162] Among them, q as shown in formula (6) t It can be used to characterize a certain data v t The corresponding retrieval vector; It can be used to characterize this data v t The corresponding embedding representation features (such as the first target embedding representation features); W q b qIt can be used to characterize learnable parameters.
[0163] The specific method for calculating the key vector is shown in formula (7):
[0164]
[0165] Among them, k, as shown in formula (7) t It can be used to characterize a certain data v t The corresponding key vector; It can be used to characterize this data v t The corresponding embedding representation features (such as the first target embedding representation features); W k b k , d can be used to characterize learnable parameters.
[0166] The specific method for calculating the value vector is shown in formula (8):
[0167]
[0168] Among them, v as shown in formula (8) t ′ can be used to characterize a certain data v t The corresponding value vector; It can be used to characterize this data v t The corresponding embedding representation features (such as the first target embedding representation features); W v b v It can be used to characterize learnable parameters.
[0169] After obtaining the retrieval vector corresponding to the first target embedding representation feature, the first memory state vector and the first normalized state vector of the first reference embedding representation feature can be obtained. Since the matrix memory component calculates the first hidden state representation features corresponding to each first embedding representation feature in sequence, when calculating the first hidden state representation feature of the first target embedding representation feature, the first hidden state representation feature of the previous first embedding representation feature (i.e., the first reference embedding representation feature) has already been calculated. Therefore, the first memory state vector and the first normalized state vector of the first reference embedding representation feature can be directly obtained. For the method of calculating the first memory state vector and the first normalized state vector of a certain first embedding representation feature, please refer to the relevant description of calculating the first memory state vector and the first normalized state vector of the first target embedding representation feature later.
[0170] After obtaining the first memory state vector and the first normalized state vector of the first reference embedding representation feature, a matrix memory gate can be used to process the first memory state vector, the first normalized state vector, and the retrieval vector corresponding to the first target embedding representation feature to obtain the first hidden state representation feature of the first target embedding representation feature. Specifically, the implementation process may include at least the following: First, a matrix memory gate can be used to perform memory state calculation processing on the first memory state vector of the first reference embedding representation feature and the retrieval vector corresponding to the first target embedding representation feature to obtain the first memory state vector of the first target embedding representation feature. It should be understood that the matrix memory gate includes an input gate, a forget gate, and an output gate. This application can first calculate the gate representations of the first target embedding representation feature for the input gate, forget gate, and output gate, and then use the gate representations of the input gate, forget gate, and output gate to calculate the first memory state vector of the first target embedding representation feature.
[0171] The specific method for calculating the gate representation of a certain embedding representation feature for the input gate in the matrix memory component can be shown in formula (9):
[0172]
[0173] Among them, i as shown in formula (9) t It can be used to characterize a certain data v t Gate representation for the input gates in a matrix memory component; It can be used to characterize this data v t The corresponding embedding representation features (such as the first target embedding representation features); w i b i It can be used to characterize learnable parameters.
[0174] The specific method for calculating the gate representation of the forget gate in the matrix memory component for a certain embedding representation feature can be shown in formula (10):
[0175]
[0176] Among them, f, as shown in formula (10) t It can be used to characterize a certain data v t Gate representation for forget gates in matrix memory components; It can be used to characterize this data v t The corresponding embedding representation features (such as the first target embedding representation features); w f b f It can be used to characterize learnable parameters.
[0177] The specific method for calculating the gate representation of the output gate in the matrix memory component for a certain embedding representation feature can be shown in formula (11):
[0178]
[0179] Among them, o as shown in formula (11) t It can be used to characterize a certain data v t Gate representation for the output gates in a matrix memory component; It can be used to characterize this data v t The corresponding embedding representation features (such as the first target embedding representation features); w o b o It can be used to characterize learnable parameters.
[0180] It should be understood that an exponential activation function exists in the matrix memory component, which may lead to excessively large values and thus overflow. In order to stabilize the exponential input gate and forget gate of the matrix long short-term memory network, stabilization techniques are used to adjust the input gate and forget gate. After calculating the corresponding gate representation of the input gate and the gate representation of the forget gate, the gate representation of the input gate and the gate representation of the forget gate can be stabilized. The specific method of stabilizing the gate representation of the input gate for a certain embedding representation feature is shown in formula (12):
[0181] i′ t =exp(log(i t )-m t ) Formula (12)
[0182] Among them, as shown in formula (12) i t It can be used to characterize a certain data v t Gate representation for the input gate; i′ t It can be used to characterize the gate representation of the stabilized and adjusted input gate; m t This state parameter, m, can be used to characterize a stable technical process. t It can be represented as shown in formula (13):
[0183] m t =max(log(f) t )+m t-1 ,log(i t )) Formula (13)
[0184] Among them, as shown in formula (13) i t It can be used to characterize a certain data v t Gate representation for input gates; f t It can be used to characterize a certain data v t Gate representation for forget gates; mt-1 The previous state parameter (data v) can be used to characterize the stabilization process. t The previous data v t-1 (Corresponding state parameters).
[0185] The specific method for stabilizing and adjusting the gate representation of a certain embedding representation feature for the forget gate can be shown in Equation (14):
[0186] f′ t =exp(log(f t )+m t-1 -m t ) Formula (14)
[0187] Among them, f, as shown in formula (14) t It can be used to characterize a certain data v t Gate representation for forget gates; m t It can be used to characterize the state parameters of a stabilizing process; m t -1 can be used to characterize the previous state parameter (data v) of a stabilizing process. t The previous data v t-1 (Corresponding state parameters).
[0188] Using the implementation methods indicated by the above formulas, the gate representations of the first target embedding feature for the input gate, forget gate, and output gate can be calculated. The query vector, key vector, and value vector corresponding to the first target embedding feature can also be calculated. Based on the gate representations of the first target embedding feature for the input gate and forget gate, the memory state calculation processing can be performed on the first memory state vector of the first reference embedding representation feature and the key and value vectors corresponding to the first target embedding representation feature, thereby obtaining the first memory state vector of the first target embedding representation feature. The specific implementation method is shown in formula (15):
[0189]
[0190] Among them, C t The first memory state vector that can be used to characterize the embedding representation features of the first target; C t-1 The first memory state vector can be used to characterize the features of the first reference embedding representation; for f t i t v t ′、k t The meaning represented can be found in the relevant explanations of the formulas mentioned above, and will not be repeated here. It can be used to characterize k t The transpose of .
[0191] Based on the first normalized state vector of the first reference embedding representation feature, a matrix memory gate can be used to perform normalized state calculation processing on the first normalized state vector of the first reference embedding representation feature and the retrieval vector corresponding to the first target embedding representation feature, so as to obtain the first normalized state vector of the first target embedding representation feature. Specifically, this application adopts the implementation method indicated by the above formulas, and can calculate the gate representation of the first target embedding feature for the input gate, forget gate and output gate in the matrix memory component, and can also calculate the query vector, key vector and value vector corresponding to the first target embedding feature. According to the gate representation of the first target embedding feature for the input gate and forget gate, the first normalized state vector of the first reference embedding representation feature and the key vector corresponding to the first target embedding representation feature can be normalized state calculated, thereby obtaining the first normalized state vector of the first target embedding representation feature. The specific implementation method is as shown in formula (16):
[0192] n t =f t n t-1 +i t k t Formula (16)
[0193] Where, n t The first normalized state vector that can be used to characterize the embedding representation features of the first target; n t -1 can be used to characterize the first normalized state vector representing the features of the first reference embedding representation; for f t i t k t The meaning represented can be found in the relevant explanations of the formulas mentioned above, and will not be repeated here.
[0194] After determining the first memory state vector and the first normalized state vector of the target embedding representation feature, the matrix memory gate can be used to perform hidden state calculation on the first memory state vector and the first normalized state vector of the first target embedding representation feature to obtain the first hidden state representation feature of the first target embedding representation feature. Specifically, the first memory state vector and the first normalized state vector of the first target embedding representation feature can be used to perform hidden state calculation on the gate representation of the output gate in the matrix memory component, and the specific implementation method is shown in formula (17):
[0195]
[0196] Among them, h t The first hidden state representation feature can be used to characterize the first target embedding representation feature; C t q t n tThe meaning represented can be found in the relevant explanations of the formulas mentioned above, and will not be repeated here.
[0197] Step S505: Determine the first interaction feature of the object based on the first hidden state representation feature of each first embedded representation feature.
[0198] Specifically, using the above method, the first hidden state representation feature of each first embedded representation feature in the first representation feature sequence can be calculated sequentially. Since the first hidden state representation feature of each first embedded representation feature contains relevant information from the preceding first embedded representation features, this application can directly use the first hidden state representation feature corresponding to the first embedded representation feature at the end of the sequence as the first interaction feature of the object. Alternatively, the first hidden state representation features of each first embedded representation feature can be concatenated, and the concatenated feature can be used as the first interaction feature of the object.
[0199] In this embodiment, a matrix long short-term memory unit is used to learn the long-term interaction preference representation of an object, which enhances memory capacity and significantly alleviates the long-term dependency problem. Compared with traditional long short-term memory networks, the matrix long short-term memory network uses stabilization techniques to achieve parallelization, further improving training and inference efficiency.
[0200] Furthermore, to facilitate understanding of the specific process by which this application learns the short-term interaction preference representation of objects, please also refer to... Figure 6 , Figure 6 This is a schematic diagram of a process for learning short-term interaction preference representations provided in an embodiment of this application. This process can correspond to the above. Figure 3 The process of extracting the second feature of the data interaction sequence to obtain the second interaction feature of the object in the corresponding embodiment. For example... Figure 6 As shown, the process may include at least the following steps S601-S606:
[0201] Step S601: Invoke the memory model; the memory model includes a sequence pruning component, a feature embedding layer, and a hybrid memory component.
[0202] For details, please refer to the previous text. Figure 3As can be seen from the relevant descriptions in the corresponding embodiments, the memory model in this application can refer to an extended long short-term memory network. This extended long short-term memory network can include matrix long short-term memory units (which can be called matrix memory components) and hybrid long short-term memory units (hybrid memory matrices). In addition to including matrix memory components and hybrid memory components, the memory model can also include a feature embedding layer (which can be understood as an embedding layer). Furthermore, the memory model can also include a sequence pruning component, which is used to prune longer sequences to obtain a more recent and shorter sequence.
[0203] Step S602: Perform sequence pruning on the data interaction sequence using the sequence pruning component to obtain a pruned sequence; the pruned sequence consists of the last K data items in the data interaction sequence; K is a positive integer less than N.
[0204] Specifically, the sequence trimming component can be used to trim data interaction sequences to obtain trimmed sequences. Specifically, the sequence trimming component can extract the last K (K is a positive integer less than N, which can be set based on actual business needs) data from the data interaction sequence. These K data points, arranged at the end of the sequence, indicate that the object's interaction behavior occurred only recently. Therefore, a shorter, more recent sequence can be formed using these last K data points; this sequence can be called the trimmed sequence.
[0205] Step S603: Perform feature embedding processing on each data in the cropped sequence through the feature embedding layer to obtain the second embedded representation feature corresponding to each data.
[0206] Specifically, after obtaining the cropped sequence, feature embedding processing can be performed on each data point in the cropped sequence through a feature embedding layer to obtain the second embedding representation feature corresponding to each data point. As mentioned above, the feature embedding layer maintains the embedding representation features corresponding to each data point. Therefore, the embedding representation feature corresponding to each data point in each cropped sequence (which can be referred to as the second embedding representation feature for easy distinction) can be found from the feature embedding layer.
[0207] Step S604: Sort the K second embedding representation features according to the order of the pruning sequence to obtain the second representation feature sequence.
[0208] Specifically, according to the order of the K data in the pruning sequence, the second embedding representation features of the K data can be sorted, thereby obtaining the second representation feature sequence.
[0209] Step S605: According to the arrangement order of the second representation feature sequence, the second hidden state representation feature of each second embedded representation feature is calculated sequentially through the hybrid memory component.
[0210] Specifically, the hybrid memory component can sequentially calculate the second hidden state representation features of each second embedded representation feature according to the arrangement order of each second embedded representation feature in the second representation feature sequence. Similarly, the hybrid memory component in this application can also include an input gate, a forget gate, and an output gate. The hybrid memory component changes the input gate and the forget gate to exponential activation functions, and uses the sum of the product of the input gate and the future forget gate as the normalized state, thereby achieving memory mixing through the exponential gate. The input gate, forget gate, and output gate contained in the hybrid long short-term memory unit can be collectively referred to as the hybrid memory gate. Taking the calculation of the second hidden state representation feature of any second embedding representation feature as an example, its specific implementation process may include at least, but is not limited to, the following: First, any one of the K second embedding representation features can be determined as the second target embedding representation feature, and the second embedding representation feature preceding the second target embedding representation feature in the second representation feature sequence can be determined as the second reference embedding representation feature. Then, the second memory state vector, the second normalized state vector, and the second hidden state representation feature of the second reference embedding representation feature can be obtained. Here, the hybrid memory component calculates the second hidden state representation feature of each second embedding representation feature in sequence. Therefore, when calculating the second hidden state representation feature of the second target embedding representation feature, the hybrid memory component has already calculated the second hidden state representation feature of the preceding second embedding representation feature (i.e., the second reference embedding representation feature), and has also calculated a memory state vector (the one calculated by the hybrid memory component is called the second memory state vector) and a normalized state vector (the one calculated by the hybrid memory component is called the second normalized state vector) of the second reference embedding representation feature, so it can be obtained directly.
[0211] After obtaining the second memory state vector and the second normalized state vector of the second reference embedding representation feature, a hybrid memory gate can be used to process the second target embedding representation feature, the second memory state vector of the second reference embedding representation feature, and the second normalized state vector of the second reference embedding representation feature to obtain the second hidden state representation feature of the second target embedding representation feature. Specifically, firstly, a hybrid memory gate can be used to process the memory state of the second target embedding representation feature and the second memory state vector of the second reference embedding representation feature to obtain the second memory state vector of the second target embedding representation feature. It should be understood that the hybrid memory gate includes an input gate, a forget gate, and an output gate. This application can first calculate the gate representations of the second target embedding representation feature for the input gate, forget gate, and output gate in the hybrid memory component, and then use the gate representations of the input gate, forget gate, and output gate to calculate the first memory state vector of the second target embedding representation feature.
[0212] The specific method for calculating the gate representation of a certain embedded representation feature for the input gate in the hybrid memory component can be shown in formula (18):
[0213]
[0214] Among them, as shown in formula (18) in t It can be used to characterize a certain data v t Gate representation for input gates in a hybrid memory component; It can be used to characterize this data v t The corresponding embedding representation features (such as the second target embedding representation features); w i r i b i It can be used to characterize learnable parameters; h t-1 A second hidden state representation feature that can be used to characterize a previous embedding representation feature (such as a second reference embedding representation feature).
[0215] The specific method for calculating the gate representation of a forget gate in a hybrid memory component for a certain embedding representation feature can be shown in formula (19):
[0216]
[0217] Among them, fo as shown in formula (19) t It can be used to characterize a certain data v t Gate representation for forget gates in hybrid memory components; It can be used to characterize this data v t The corresponding embedding representation features (such as the second target embedding representation features); w f r f b f It can be used to characterize learnable parameters; h t-1 A second hidden state representation feature that can be used to characterize a previous embedding representation feature (such as a second reference embedding representation feature).
[0218] The specific method for calculating the gate representation of the output gate in the hybrid memory component for a certain embedded representation feature can be shown in formula (20):
[0219]
[0220] Among them, ou as shown in formula (20) t It can be used to characterize a certain data v t Gate representation for output gates in a hybrid memory component; It can be used to characterize this data v t The corresponding embedding representation features (such as the second target embedding representation features); w o ro b o It can be used to characterize learnable parameters; h t-1 A second hidden state representation feature that can be used to characterize a previous embedding representation feature (such as a second reference embedding representation feature).
[0221] After obtaining the gate representations for each gate in the hybrid memory component, the second memory state vectors of the second target embedding representation features and the second reference embedding representation features can be processed by using the gate representations for the forget gate and the gate representations for the input gate to calculate the memory state, thereby obtaining the second memory state vector of the second target embedding representation features. The specific implementation method is shown in formula (21):
[0222]
[0223] Among them, C′ as shown in formula (21) t It can be used for a certain data v t The second memory state vector of the embedding representation features (such as the second target embedding representation features); C′ t-1 A second memory state vector that can be used to characterize the previous embedding representation feature (such as the second reference embedding representation feature); It can be used to characterize a certain data v t The embedded representation features are the input features after computational processing, and the computation process can be shown in formula (22):
[0224]
[0225] in, It can be used to characterize a certain data v t The embedded representation features are the input features after computational processing; w c r c b c It can be used to characterize learnable parameters; h t-1 A second hidden state representation feature that can be used to characterize a previous embedding representation feature (such as a second reference embedding representation feature).
[0226] Based on the second normalized state vector of the second reference embedding representation feature, a hybrid memory gate can be used to perform normalization state calculation processing on the second target embedding representation feature and the second normalized state vector of the second reference embedding representation feature to obtain the second normalized state vector of the second target embedding representation feature. Specifically, this application can use the above formulas (18)-(20) to calculate the gate representation of the second target embedding representation feature for the forget gate in the hybrid memory component and the gate representation for the input gate. Based on the gate representation of the second target embedding representation feature for the forget gate in the hybrid memory component and the gate representation for the input gate, the second normalized state vector of the second reference embedding representation feature can be normalized state calculated to obtain the second normalized state vector of the second target embedding representation feature. The specific implementation method is shown in formula (23):
[0227] n′ t =fo t ·n t-1 ′+in t Formula (23)
[0228] Among them, n′ as shown in formula (23) t It can be used for a certain data v t The second normalized state vector of the embedding representation features (such as the second target embedding representation features); n t-1 ' can be used to characterize the second normalized state vector of the previous embedding representation feature (such as the second reference embedding representation feature); fo t with in t The meanings represented can be found in the relevant descriptions in formulas (18)-(19), and will not be repeated here.
[0229] It should be understood that after calculating the second normalized state vector and the second memory state vector of the second target embedding representation feature using the method described above, a hybrid memory gate can be used to perform hidden state calculation on the second memory state vector and the second normalized state vector of the second target embedding representation feature to obtain the second hidden state representation feature of the second target embedding representation feature. Specifically, the second target embedding representation feature can be used to perform hidden state calculation on the second memory state vector and the second normalized state vector of the second target embedding representation feature based on the gate representation of the output gate in the hybrid memory component. The specific implementation method is shown in formula (24):
[0230]
[0231] Among them, h, as shown in formula (24) t ′ can be used to characterize the second hidden state representation features of the second target embedding representation features; C t ′、out n′ t The meaning represented can be found in the relevant explanations in formulas (20), (21) and (23) above, and will not be repeated here.
[0232] Step S606: Determine the second interaction feature of the object based on the second hidden state representation feature of each second embedding representation feature.
[0233] Specifically, using the above method, the second hidden state representation feature of each second embedded representation feature in the second representation feature sequence can be calculated sequentially. Since the second hidden state representation feature of each second embedded representation feature contains relevant information from the preceding second embedded representation features, this application can directly use the second hidden state representation feature corresponding to the second embedded representation feature at the end of the sequence as the object's second interaction feature. Alternatively, the second hidden state representation features of each second embedded representation feature can be concatenated, and the concatenated feature can be used as the object's second interaction feature.
[0234] In this embodiment, a hybrid long short-term memory (LSTM) network is used to learn the short-term interaction preference representation of an object, thereby enhancing the ability to correct memory decisions. Compared to traditional LSTM networks, the hybrid LSTM network enhances the ability to learn short-term interaction preferences.
[0235] In summary, this application can use matrix long short-term memory units to calculate the historical behavior sequence of an object (such as the data interaction sequence within the historical time period in this application). It can sequentially analyze the relevant data features of each interacting data to obtain the hidden state features of that data. Furthermore, the data features of each data point can be passed to the next data point. By sequentially passing features, the hidden state features of the last data point can be obtained. These hidden state features can contain the relevant data features of each data point, accurately reflecting the long-term interaction preference of the object within the historical time period. Similarly, by using hybrid long short-term memory units to calculate the recent pruned sequence (such as the pruned sequence of the data interaction sequence in this application) of an object's historical behavior sequence, it can sequentially analyze the relevant data features of each recently interacted data to obtain the hidden state features of that data. Furthermore, the data features of each data point can be passed to the next data point. By sequentially passing features, the hidden state features of the last data point can be obtained. These hidden state features can contain the relevant data features of each data point, accurately reflecting the short-term interaction preference of the object within a recent period. By fusing long-term and short-term interaction preferences through a gating network, a fused interaction feature that accurately reflects the overall interaction preferences of an object can be obtained. Data recommendation based on this fused interaction feature can achieve better recommendation results.
[0236] Furthermore, to facilitate understanding of the beneficial effects of the data recommendation scheme provided in this application, the following figures illustrate the beneficial effects of this scheme. Please refer to them as well. Figure 7 , Figure 7 This is a schematic diagram of an experimental comparison provided in an embodiment of this application, such as... Figure 7 The experiment shown compares the efficiency of our proposed method with recommendation methods based on Transformer models and those based on recurrent neural network variants. Figure 7 As shown, the self-attention recommendation method in the Transformer model can refer to the SASREC method, which is a sequence recommendation model that effectively captures dependencies in users' historical behavior through a self-attention mechanism. The bidirectional attention recommendation method in the Transformer model can refer to the BERT4Rec method, which is a method that uses a bidirectional self-attention mechanism and a cloze test task to capture rich contextual information in users' behavior sequences for sequence recommendation. The gated recurrent recommendation method in the recurrent neural network can refer to the GRU4Rec method, which is a sequence recommendation model based on a Gated Recurrent Unit (GRU). By learning the state transition patterns in users' historical behavior sequences, it uses the gating mechanism of the GRU to remember and forget information, thereby achieving personalized recommendations. This model can effectively process users' behavior sequence data and can handle sparse data, making it suitable for various recommendation scenarios.
[0237] This application allows for experimentation on several publicly available datasets, including: the 100K and 1M subsets of the MovieLens sequence recommendation dataset; the Pantry and Books subsets of the Amazon Review dataset; and the lifetime long sequence recommendation datasets LFM-1b and KuaiRand. The MovieLens dataset is a publicly available dataset widely used for research and evaluation of recommendation algorithms. Its 100K subset contains tens of thousands of user ratings for thousands of movies, each record including user ID, movie ID, rating, and timestamp. The Amazon Review dataset is a multi-dimensional, large-scale resource of user reviews, widely used in recommender system research. It records detailed user ratings, textual reviews, and suggested ratings for various products on public websites, covering multiple product categories from books to electronic products. The Pantry and Books subsets are category subsets of the Amazon Review dataset. The LFM-1b dataset is a massive dataset containing over 1 billion music listening events, comprising the listening history of over 120,000 users over nearly 10 years. Each event records the user ID, artist, album, track name, and timestamp, along with the user's demographic information and mainstream score, the latter measuring the overlap between a user's personal listening history and the listening history of all users. The LFM-1b dataset has an average sequence length of 9043, providing an important reference for lifetime long sequence recommendations. The KuaiRand dataset is an unbiased sequence recommendation dataset collected by a public video sharing application. It contains millions of user interaction records of randomly exposed videos, along with 12 user feedback signals, such as clicks, likes, and viewing duration.
[0238] For each dataset, interaction records can be extracted according to the user dimension, and then a data interaction sequence arranged in chronological order can be generated for each user. Through experimental analysis, the two recommendation methods of the Transformer model have high training efficiency and can also achieve parallel computing, but their inference efficiency is poor. Compared with the recommendation method of the Transformer model, this solution improves the inference efficiency. Moreover, compared with sequence recommendation methods based on Transformer models (such as SASRec and BERT4Rec), the performance across different datasets shows certain patterns: in most cases, the proposed data recommendation method outperforms Transformer-based methods. On long-term sequence recommendation tasks, the proposed method significantly outperforms SASRec and BERT4Rec on the LFM-1b and KuaiRand datasets in terms of the NDCG metric (an evaluation metric used to measure ranking quality in information retrieval and recommender systems), indicating stronger ranking capabilities for long-term sequence recommendation tasks. Furthermore, sequence recommendation methods based on Transformer models require significantly more GPU memory during model training than this proposed method. Overall, the proposed method efficiently models both long-term and short-term user preferences simultaneously and then adaptively fuses them. It demonstrates a significant efficiency advantage over Transformer-based methods in modeling long-term sequence tasks and exhibits excellent performance on sequence recommendation datasets. Considering both performance and efficiency, it shows a significant advantage over Transformer-based methods.
[0239] Traditional recurrent neural networks (RNNs) suffer from low training efficiency and cannot achieve parallel computation. Compared to traditional RNNs, this approach improves training efficiency. Furthermore, compared to sequence recommendation methods based on traditional RNNs (such as GRU4Rec), this approach has significant advantages on both sequence recommendation datasets and lifetime long sequence recommendation datasets. This is because, firstly, the matrix-based long short-term memory (LSTM) enhances memory capacity and memory transfer, significantly alleviating the long-term dependency problem in user behavior sequences and addressing, to some extent, the limitations of RNN-based architectures (such as information forgetting and gradient vanishing). Secondly, the hybrid LSTM enhances the mixing and transfer of memory data from various interactions within user behavior sequences, improving the ability to learn short-term user preferences.
[0240] It is worth noting that, since recommendation methods based on large language models have many problems such as input length limitations, lack of collaborative knowledge, and low efficiency when solving long-sequence recommendation tasks, this application does not compare them with recommendation methods based on large language models.
[0241] In summary, the data recommendation scheme provided in this application can not only improve the accuracy and optimize the data recommendation effect in solving the lifelong long sequence recommendation task, but also improve training efficiency and inference efficiency.
[0242] Furthermore, to demonstrate the impact of each component in this scheme (such as the adaptive fusion component using a gating network and the component employing matrix long short-term memory units for long-term interaction preference representation), this application provides an ablation experiment to analyze the degree of influence of each component. Please refer to [link to relevant documentation]. Figure 8 , Figure 8 This is a schematic diagram of an ablation experiment result provided in an embodiment of this application. For example... Figure 8 As shown, this experiment can be conducted using the ML-1M and LFM-1b datasets respectively. Here, "Xlstm-LSR" represents the method provided in this application; "w / o GN" represents replacing the adaptive fusion of long-term and short-term preferences in the gating network with equal-weight fusion; "w / o MTX" represents replacing the matrix long short-term memory units in the method with a traditional long short-term memory network; "w / o MIX" represents replacing the hybrid long short-term memory units in the method with a traditional long short-term memory network; "w / o MTXE" represents replacing the exponential gate of the stabilization technique in the matrix long short-term memory network with a sigmoid gate; "w / o MIXE" represents replacing the exponential gate of the stabilization technique in the hybrid long short-term memory unit with a sigmoid gate; and "w / o LN" represents removing layer normalization and Dropout operations.
[0243] Experimental results based on the "w / o GN" method demonstrate the necessity of using gated networks to fuse users' long-term and short-term preferences, as the performance of simple weighted fusion models significantly decreases across different datasets. Experimental results based on the "w / o MTX" method highlight the necessity of using matrix long short-term memory units (LSMs) for learning users' long-term preferences. Experimental results based on the "w / o MIX" method demonstrate the necessity of using hybrid LSMs for learning users' short-term preferences. Experimental results based on the "w / o MTXE" and "w / o MIXE" methods show that the model using exponential gates with stabilization techniques significantly outperforms models that use sigmoid gates. The gating mechanism controls the flow of information, and the exponential gate with stabilization techniques alleviates the gradient vanishing or exploding problem to some extent. Experimental results based on the "w / o LN" method show that removing layer normalization and embedding dropout operations significantly decreases model performance, highlighting the importance of layer normalization and embedding dropout processing, which mitigates overfitting and improves model robustness to some extent.
[0244] Further, please see Figure 9 , Figure 9This is a schematic diagram of the structure of a data processing apparatus provided in an embodiment of this application. The data processing apparatus can be a computer program (including program code) running on a computer device; for example, the data processing apparatus is an application software. The data processing apparatus can be used to execute... Figure 3 The method shown. (As illustrated) Figure 9 As shown, the data processing device 1 may include: a sequence acquisition module 11, a first feature processing module 12, a second feature processing module 13, and a data recommendation module 14.
[0245] The sequence acquisition module 11 is used to acquire the data interaction sequence of the object; the data interaction sequence includes N data points of interaction behavior generated by the object within a historical time period, where N is a positive integer;
[0246] The first feature processing module 12 is used to perform first feature extraction processing on the data interaction sequence to obtain the first interaction feature of the object. The first interaction feature is used to characterize the interaction preference characteristics of the object within a first duration, where the first duration is less than or equal to the historical time period.
[0247] The second feature processing module 13 is used to perform second feature extraction processing on the data interaction sequence to obtain the second interaction feature of the object. The second interaction feature is used to characterize the interaction preference characteristics of the object in a second duration, which is shorter than the first duration.
[0248] The data recommendation module 14 is used to fuse the first interaction feature and the second interaction feature to obtain the fused interaction feature of the object, and to perform data recommendation processing on the object based on the fused interaction feature of the object.
[0249] The specific implementation methods of the sequence acquisition module 11, the first feature processing module 12, the second feature processing module 13, and the data recommendation module 14 can be found in the above description. Figure 3 The descriptions of steps S301-S304 in the corresponding embodiments will not be repeated here.
[0250] In one embodiment, the first feature processing module 12 performs first feature extraction processing on the data interaction sequence to obtain the first interaction feature of the object. The specific implementation includes:
[0251] Invoke the memory model; the memory model includes a feature embedding layer and a matrix memory component;
[0252] Each data point in the data interaction sequence is processed by feature embedding layer to obtain the first embedded representation feature corresponding to each data point.
[0253] The N first embedding representation features are sorted according to the order of the data interaction sequence to obtain the first representation feature sequence;
[0254] According to the arrangement order of the first representation feature sequence, the first hidden state representation feature of each first embedding representation feature is calculated sequentially through the matrix memory component;
[0255] The first interaction feature of the object is determined based on the first hidden state representation feature of each first embedding representation feature.
[0256] In one embodiment, the matrix memory component includes a matrix memory gate;
[0257] The first feature processing module 12 calculates the specific implementation of the first hidden state representation feature of each first embedded representation feature sequentially through the matrix memory component, according to the arrangement order of the first representation feature sequence, including:
[0258] Any one of the N first embedding representation features is determined as the first target embedding representation feature, and the first embedding representation feature preceding the first target embedding representation feature in the first representation feature sequence is determined as the first reference embedding representation feature;
[0259] The retrieval vector corresponding to the first target embedding representation feature is obtained by performing retrieval vector calculation on the first target embedding representation feature.
[0260] Obtain the first memory state vector and the first normalized state vector of the first reference embedding representation features;
[0261] The matrix memory gate is used to process the first memory state vector of the first reference embedding representation feature, the first normalized state vector of the first reference embedding representation feature, and the retrieval vector corresponding to the first target embedding representation feature to obtain the first hidden state representation feature of the first target embedding representation feature.
[0262] In one embodiment, the specific implementation of the first feature processing module 12 using a matrix memory gate to process the first memory state vector of the first reference embedding representation feature, the first normalized state vector of the first reference embedding representation feature, and the retrieval vector corresponding to the first target embedding representation feature includes:
[0263] A matrix memory gate is used to perform memory state calculation on the first memory state vector of the first reference embedding representation feature and the retrieval vector corresponding to the first target embedding representation feature to obtain the first memory state vector of the first target embedding representation feature.
[0264] The matrix memory gate is used to perform normalization state calculation on the first normalized state vector of the first reference embedding representation feature and the retrieval vector corresponding to the first target embedding representation feature, so as to obtain the first normalized state vector of the first target embedding representation feature.
[0265] The first hidden state representation feature of the first target embedding representation feature is obtained by using a matrix memory gate to perform hidden state calculation on the first memory state vector and the first normalized state vector.
[0266] In one embodiment, the second feature processing module 13 performs second feature extraction processing on the data interaction sequence to obtain the second interaction features of the object. The specific implementation includes:
[0267] Invoke the memory model; the memory model includes a sequence pruning component, a feature embedding layer, and a hybrid memory component;
[0268] The data interaction sequence is processed by a sequence trimming component to obtain a trimmed sequence; the trimmed sequence consists of the last K data items in the data interaction sequence; K is a positive integer less than N;
[0269] Each data point in the cropped sequence is processed by feature embedding layer to obtain the second embedded representation feature corresponding to each data point.
[0270] The K second embedding representation features are sorted according to the order of the pruning sequence to obtain the second representation feature sequence;
[0271] According to the arrangement order of the second representation feature sequence, the second hidden state representation feature of each second embedding representation feature is calculated sequentially through the hybrid memory component;
[0272] The second interaction features of the object are determined based on the second hidden state representation features of each second embedding representation feature.
[0273] In one embodiment, the hybrid memory component includes a hybrid memory gate;
[0274] The second feature processing module 13 calculates the specific implementation of the second hidden state representation feature of each second embedded representation feature sequentially through the hybrid memory component, according to the arrangement order of the second representation feature sequence, including:
[0275] Any one of the K second embedding representation features is determined as the second target embedding representation feature, and the second embedding representation feature preceding the second target embedding representation feature in the second representation feature sequence is determined as the second reference embedding representation feature;
[0276] Obtain the second memory state vector, the second normalized state vector, and the second hidden state representation features of the second reference embedding representation features;
[0277] The second hidden state representation feature of the second target embedding representation feature is obtained by using a hybrid memory gate to process the second memory state vector of the second reference embedding representation feature, the second normalized state vector of the second reference embedding representation feature, and the second hidden state representation feature of the second target embedding representation feature.
[0278] In one embodiment, the second feature processing module 13 uses a matrix memory gate to process the second target embedding representation feature, the second memory state vector of the second reference embedding representation feature, and the second normalized state vector of the second reference embedding representation feature to obtain the second hidden state representation feature of the second target embedding representation feature. The specific implementation of this method includes:
[0279] A hybrid memory gate is used to process the memory state of the second target embedding representation feature and the second memory state vector of the second reference embedding representation feature to obtain the second memory state vector of the second target embedding representation feature.
[0280] A hybrid memory gate is used to perform normalization state calculation on the second target embedding representation feature and the second normalized state vector of the second reference embedding representation feature to obtain the second normalized state vector of the second target embedding representation feature.
[0281] The second hidden state representation features of the second target embedding representation features are obtained by using a hybrid memory gate to perform hidden state calculation on the second memory state vector and the second normalized state vector.
[0282] The data recommendation module 14 fuses the first interaction feature and the second interaction feature to obtain the specific implementation of the fused interaction feature of the object, including:
[0283] Obtain the first fusion weight corresponding to the first interaction feature and the second fusion weight corresponding to the second interaction feature;
[0284] The first fusion weight and the first interaction feature are processed to obtain the first operational interaction feature;
[0285] The second fusion weight and the second interaction feature are processed to obtain the second operational interaction feature;
[0286] The first and second operational interaction features are summed to obtain the object's fused interaction features.
[0287] The data recommendation module 14 obtains the first fusion weight corresponding to the first interaction feature and the second fusion weight corresponding to the second interaction feature through specific implementation methods, including:
[0288] Obtain the weight calculation function; the weight calculation function contains learnable parameters;
[0289] The learnable parameters, the first interaction feature, and the second interaction feature are processed by a weight calculation function to obtain the first fusion weight corresponding to the first interaction feature.
[0290] The difference between the unit value and the first fusion weight is determined, and the difference between the unit value and the first fusion weight is determined as the second fusion weight corresponding to the second interactive feature.
[0291] In one embodiment, the specific implementation of the data recommendation module 14 in performing data recommendation processing on objects based on their fusion interaction features includes:
[0292] Obtain the candidate data set; the candidate data set contains one or more candidate data items to be recommended to the object.
[0293] The interaction features are fused and each candidate data is processed with probability calculation to obtain the interaction prediction probability corresponding to each candidate data; the interaction prediction probability corresponding to each candidate data refers to the probability that the object will perform an interaction behavior on the candidate data.
[0294] Recommended data for an object is selected from the candidate data set based on the interactive prediction probability corresponding to each candidate data, and the recommended data is pushed to the object.
[0295] This application provides a lifetime long-sequence recommendation scheme based on a matrix and hybrid mechanism dual-stream long short-term memory (LSM) unit. This scheme enhances the ability to learn long-term historical behaviors. Based on the characteristics of lifetime long-sequence recommendation tasks, this scheme improves the layer stacking method of the extended long short-term memory network, effectively improving the learning accuracy of interaction preferences, enhancing data recommendation performance, and optimizing data recommendation results. Specifically, after obtaining the data interaction sequence of an object (such as a user) (including N data points showing interactions the object has generated within a historical time period), this application, guided by the extended long short-term memory network, uses matrix LSM units to learn the object's long-term interaction preference representation; simultaneously, it uses hybrid LSM units to learn the object's short-term interaction preference representation. This scheme uses a gating network to adaptively fuse the long-term and short-term interaction preference representations to obtain a fused interaction feature. This fused interaction feature reflects the object's overall interaction preferences, thus reflecting more accurate object interaction preferences. Data recommendations based on this fused interaction preference are also more accurate and reasonable, optimizing data recommendation results. In summary, this application can improve the learning accuracy of interaction preferences and optimize data recommendation results.
[0296] Further, please see Figure 10 , Figure 10 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Figure 10As shown, the aforementioned computer device 8000 may include: a processor 8001, a network interface 8004, and a memory 8005. Furthermore, the computer device 8000 also includes: a user interface 8003, and at least one communication bus 8002. The communication bus 8002 is used to enable communication between these components. The user interface 8003 may include a display screen and a keyboard; optionally, the user interface 8003 may also include a standard wired interface or a wireless interface. The network interface 8004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 8005 may be high-speed RAM or non-volatile memory, such as at least one disk storage device. Optionally, the memory 8005 may also be at least one storage device located remotely from the aforementioned processor 8001. Figure 10 As shown, the memory 8005, which is a computer-readable storage medium, may include an operating system, a network communication module, a user interface module, and a device control application program.
[0297] exist Figure 10 In the computer device 8000 shown, the network interface 8004 provides network communication functionality; the user interface 8003 is mainly used to provide an input interface for the user; and the processor 8001 can be used to call the device control application program stored in the memory 8005 to achieve:
[0298] Obtain the data interaction sequence of the object; the data interaction sequence includes N data points of interaction behavior generated by the object within a historical time period, where N is a positive integer;
[0299] The data interaction sequence is processed by first feature extraction to obtain the first interaction feature of the object. The first interaction feature is used to characterize the interaction preference characteristics of the object within a first duration, where the first duration is less than or equal to the historical time period.
[0300] The data interaction sequence is processed by second feature extraction to obtain the second interaction feature of the object. The second interaction feature is used to characterize the interaction preference characteristics of the object in a second time period, which is shorter than the first time period.
[0301] The first interaction feature and the second interaction feature are fused together to obtain the object's fused interaction feature, and the object is then used for data recommendation processing based on the object's fused interaction feature.
[0302] It should be understood that the computer device 8000 described in the embodiments of this application can execute the foregoing text. Figures 3 to 6 The description of the data processing method in the corresponding embodiment can also be performed as described above. Figure 9The description of the data processing apparatus 1 in the corresponding embodiments will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated here.
[0303] Furthermore, it should be noted that this application embodiment also provides a computer-readable storage medium, which stores a computer program executed by the aforementioned data processing computer device 8000. The computer program includes program instructions, and when the processor executes the program instructions, it can execute the aforementioned... Figures 3 to 6 The description of the data processing method in the corresponding embodiments is already provided and will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the computer-readable storage medium embodiments related to this application, please refer to the description of the method embodiments of this application.
[0304] The aforementioned computer-readable storage medium can be an internal storage unit of the data processing apparatus or computer device provided in any of the foregoing embodiments, such as a hard disk or memory of the computer device. The computer-readable storage medium can also be an external storage device of the computer device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided on the computer device. Furthermore, the computer-readable storage medium can include both internal and external storage units of the computer device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.
[0305] One aspect of this application provides a computer program product comprising a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform the method provided in one aspect of the embodiments of this application.
[0306] The terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the term "comprising," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other step units inherent to these processes, methods, apparatuses, products, or devices.
[0307] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0308] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.
[0309] The methods and related apparatuses provided in this application are described with reference to the method flowcharts and / or structural diagrams provided in this application. Specifically, each block of the method flowchart and / or structural diagram, as well as combinations of blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to create a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing device, generate instructions for implementing the process. Figure 1 A schematic diagram of one or more processes and / or structures. Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 A schematic diagram of one or more processes and / or structures. Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1A process or multiple processes and / or structures illustrate the steps of the functions specified in one or more boxes.
[0310] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.
Claims
1. A data processing method, characterized in that, The method includes: Obtain the data interaction sequence of the object; the data interaction sequence includes N data points of interaction behavior generated by the object within a historical time period, where N is a positive integer; The data interaction sequence is subjected to a first feature extraction process to obtain the first interaction feature of the object. The first interaction feature is used to characterize the interaction preference characteristics of the object within a first duration, where the first duration is less than or equal to the historical time period. The data interaction sequence is subjected to a second feature extraction process to obtain the second interaction feature of the object. The second interaction feature is used to characterize the interaction preference characteristics of the object within a second duration, where the second duration is shorter than the first duration. The first interaction feature and the second interaction feature are fused together to obtain the fused interaction feature of the object, and data recommendation processing is performed on the object based on the fused interaction feature of the object.
2. The method according to claim 1, characterized in that, The first feature extraction process of the data interaction sequence to obtain the first interaction feature of the object includes: Invoke the memory model; the memory model includes a feature embedding layer and a matrix memory component; The feature embedding layer performs feature embedding processing on each of the data in the data interaction sequence to obtain the first embedded representation feature corresponding to each of the data. The N first embedding representation features are sorted according to the arrangement order of the data interaction sequence to obtain the first representation feature sequence; According to the arrangement order of the first representation feature sequence, the first hidden state representation feature of each of the first embedded representation features is calculated sequentially through the matrix memory component; The first interaction feature of the object is determined based on the first hidden state representation feature of each of the first embedded representation features.
3. The method according to claim 2, characterized in that, The matrix memory component includes a matrix memory gate; The step of sequentially calculating the first hidden state representation feature of each of the first embedded representation features according to the arrangement order of the first representation feature sequence through the matrix memory component includes: Any one of the N first embedding representation features is determined as the first target embedding representation feature, and the first embedding representation feature preceding the first target embedding representation feature in the first representation feature sequence is determined as the first reference embedding representation feature; The first target embedding representation feature is processed to calculate the retrieval vector, thereby obtaining the retrieval vector corresponding to the first target embedding representation feature. Obtain the first memory state vector and the first normalized state vector of the first reference embedded representation features; The matrix memory gate is used to process the first memory state vector of the first reference embedding representation feature, the first normalized state vector of the first reference embedding representation feature, and the retrieval vector corresponding to the first target embedding representation feature to obtain the first hidden state representation feature of the first target embedding representation feature.
4. The method according to claim 3, characterized in that, The step of using the matrix memory gate to process the first memory state vector of the first reference embedding representation feature, the first normalized state vector of the first reference embedding representation feature, and the retrieval vector corresponding to the first target embedding representation feature includes: The matrix memory gate is used to perform memory state calculation on the first memory state vector of the first reference embedding representation feature and the retrieval vector corresponding to the first target embedding representation feature to obtain the first memory state vector of the first target embedding representation feature. The matrix memory gate is used to perform normalized state calculation processing on the first normalized state vector of the first reference embedding representation feature and the retrieval vector corresponding to the first target embedding representation feature to obtain the first normalized state vector of the first target embedding representation feature. The matrix memory gate is used to perform hidden state calculation on the first memory state vector and the first normalized state vector of the first target embedding representation feature to obtain the first hidden state representation feature of the first target embedding representation feature.
5. The method according to claim 1, characterized in that, The second feature extraction process on the data interaction sequence to obtain the second interaction feature of the object includes: Invoke the memory model; the memory model includes a sequence pruning component, a feature embedding layer, and a hybrid memory component; The data interaction sequence is processed by the sequence trimming component to obtain a trimmed sequence; the trimmed sequence consists of the last K data items in the data interaction sequence; K is a positive integer less than N; The feature embedding layer performs feature embedding processing on each data in the cropped sequence to obtain the second embedded representation feature corresponding to each data; The K second embedding representation features are sorted according to the order of the cropping sequence to obtain the second representation feature sequence; According to the arrangement order of the second representation feature sequence, the second hidden state representation feature of each of the second embedded representation features is calculated sequentially by the hybrid memory component; The second interaction feature of the object is determined based on the second hidden state representation feature of each second embedding representation feature.
6. The method according to claim 5, characterized in that, The hybrid memory component includes a hybrid memory gate; The step of sequentially calculating the second hidden state representation feature for each of the second embedded representation features according to the arrangement order of the second representation feature sequence through the hybrid memory component includes: Any one of the K second embedding representation features is determined as the second target embedding representation feature, and the second embedding representation feature preceding the second target embedding representation feature in the second representation feature sequence is determined as the second reference embedding representation feature; Obtain the second memory state vector, the second normalized state vector, and the second hidden state representation features of the second reference embedding representation features; The hybrid memory gate is used to process the second target embedding representation feature, the second memory state vector of the second reference embedding representation feature, and the second normalized state vector of the second reference embedding representation feature to obtain the second hidden state representation feature of the second target embedding representation feature.
7. The method according to claim 6, characterized in that, The step of using the matrix memory gate to process the second target embedding representation feature, the second memory state vector of the second reference embedding representation feature, and the second normalized state vector of the second reference embedding representation feature to obtain the second hidden state representation feature of the second target embedding representation feature includes: The hybrid memory gate is used to perform memory state calculation processing on the second memory state vector of the second target embedding representation feature and the second memory state vector of the second reference embedding representation feature to obtain the second memory state vector of the second target embedding representation feature. The hybrid memory gate is used to perform normalized state calculation processing on the second target embedding representation feature and the second normalized state vector of the second reference embedding representation feature to obtain the second normalized state vector of the second target embedding representation feature; The hybrid memory gate is used to perform hidden state calculation on the second memory state vector and the second normalized state vector of the second target embedding representation feature to obtain the second hidden state representation feature of the second target embedding representation feature.
8. The method according to claim 1, characterized in that, The step of fusing the first interaction feature and the second interaction feature to obtain the fused interaction feature of the object includes: Obtain the first fusion weight corresponding to the first interaction feature and the second fusion weight corresponding to the second interaction feature; The first fusion weight and the first interaction feature are processed to obtain the first operational interaction feature; The second fusion weight and the second interaction feature are processed to obtain the second computational interaction feature; The first operational interaction feature and the second operational interaction feature are summed to obtain the fused interaction feature of the object.
9. The method according to claim 8, characterized in that, The step of obtaining the first fusion weight corresponding to the first interaction feature and the second fusion weight corresponding to the second interaction feature includes: Obtain the weight calculation function; the weight calculation function contains learnable parameters; The learnable parameter, the first interaction feature, and the second interaction feature are processed using the weight calculation function to obtain the first fusion weight corresponding to the first interaction feature. The difference between the unit value and the first fusion weight is determined, and the difference between the unit value and the first fusion weight is determined as the second fusion weight corresponding to the second interaction feature.
10. The method according to claim 1, characterized in that, The step of performing data recommendation processing on the object based on the object's fusion interaction features includes: Obtain a candidate data set; the candidate data set contains one or more candidate data to be recommended to the object; The fused interaction features are combined with each candidate data point for probability calculation to obtain the interaction prediction probability corresponding to each candidate data point; the interaction prediction probability corresponding to each candidate data point refers to the probability that the object will perform an interaction behavior on the candidate data point. Recommended data for the object is selected from the candidate data set based on the interaction prediction probability corresponding to each candidate data, and the recommended data is pushed to the object.
11. A data processing apparatus, characterized in that, The device includes: The sequence acquisition module is used to acquire the data interaction sequence of an object; the data interaction sequence includes N data points of interaction behavior generated by the object within a historical time period, where N is a positive integer; The first feature processing module is used to perform a first feature extraction process on the data interaction sequence to obtain the first interaction feature of the object. The first interaction feature is used to characterize the interaction preference characteristics of the object within a first duration, where the first duration is less than or equal to the historical time period. The second feature processing module is used to perform second feature extraction processing on the data interaction sequence to obtain the second interaction feature of the object. The second interaction feature is used to characterize the interaction preference characteristics of the object in a second duration, where the second duration is shorter than the first duration. The data recommendation module is used to fuse the first interaction feature and the second interaction feature to obtain the fused interaction feature of the object, and to perform data recommendation processing on the object based on the fused interaction feature of the object.
12. A computer device, characterized in that, include: Processor, memory, and network interface; The processor is connected to the memory and the network interface, wherein the network interface is used to provide network communication functions, the memory is used to store computer programs, and the processor is used to call the computer programs to cause the computer device to execute the method according to any one of claims 1-10.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted to be loaded by a processor and to execute the method according to any one of claims 1-10.
14. A computer program product, characterized in that, The computer program product includes a computer program stored in a computer-readable storage medium, the computer program being adapted to be read and executed by a processor to cause a computer device having the processor to perform the method of any one of claims 1-10.