Course resource recommendation method and device based on improved state space model, equipment and storage medium
By improving the state-space model to process course feature sequences, removing noise and modeling user interests, the high computational cost and noise interference problems of traditional course recommendation methods in long sequence processing are solved, and efficient and accurate course resource recommendations are achieved.
Patent Information
- Application Number
- CN202511197310.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-26
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-08-26
AI Technical Summary
Traditional course recommendation methods have high computational costs when processing long sequences, and user behavior noise interferes with true preference learning, affecting recommendation accuracy.
An improved state space model is used to process the course feature sequence through the frequency domain filtering module, Mamba module and optimization module to remove noise and model user interests. The candidate course resources are matched and a recommendation list is generated.
It reduces computational complexity, improves the efficiency and accuracy of course resource recommendations, and provides personalized and timely recommendation services.
Smart Images

Figure CN120744242A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of learning resource recommendation, and in particular to a course resource recommendation method, device, equipment and storage medium based on an improved state space model. Background Art
[0002] Traditional course recommendation methods often use models based on the Transformer architecture, such as SASRec and BERT4Rec. These models effectively model short-term and long-term dependencies between user behaviors through a multi-head self-attention mechanism, capturing sequential correlations and thus obtaining corresponding course resource information. However, the self-attention calculation in traditional Transformer models involves similarity dot products between all items. This leads to a sharp increase in model training and inference costs when processing long sequences, making it difficult to efficiently deploy in large-scale online systems. Furthermore, user behavior sequences inevitably contain a large amount of noise, such as temporary clicks, test browsing, and negative feedback, which do not reflect the user's true interests. However, the traditional Transformer model assigns non-zero weights to all past items in the self-attention mechanism, causing this noise to interfere with the learning of true preferences, thereby affecting recommendation accuracy. Therefore, a course resource recommendation method is urgently needed to improve the efficiency and accuracy of course resource recommendations. Summary of the Invention
[0003] The main purpose of this application is to provide a course resource recommendation method, device, equipment and storage medium based on an improved state space model, aiming to solve the technical problem of how to improve the efficiency and accuracy of course resource recommendation.
[0004] To achieve the above objectives, this application proposes a course resource recommendation method based on an improved state space model, including: Collect users' course resource data; Processing the course resource data through time-series grouping and splicing to obtain a course resource interaction sequence; Performing data preprocessing on the course resource interaction sequence to obtain a user interaction sequence; Mapping the user interaction sequence to a low-dimensional vector space to obtain a target course feature sequence; Inputting the target course feature sequence into a preset improved state space model to obtain a target interest course, wherein the preset improved state space model includes a frequency domain filtering module, a Mamba module and an optimization module, the frequency domain filtering module is used to perform Fourier transform on the target course feature sequence to obtain a time domain signal, the Mamba module is used to perform state space modeling on the time domain signal, and the optimization module includes a normalization layer and a feedforward network layer; Matching the target interest course with a candidate course resource set to obtain a recommendation score, wherein the candidate course resource set is obtained by filtering out qualified candidate course resources from the total course resource set according to preset filtering rules; The recommended courses are output based on the recommendation scores to generate a course recommendation list.
[0005] In one embodiment, the step of processing the course resource data by time-sequential grouping and splicing to obtain a course resource interaction sequence includes: Extracting user behavior data based on the course resource data, wherein the user behavior data includes click data, browsing data, collection data, and learning time data; Grouping and aggregating the user behavior data by user ID to generate initial interaction records; Performing a deletion operation on the initial interaction record to obtain a deleted interaction record; Segmenting the interaction records after elimination according to a preset time window to generate multiple interaction subsequences; Deduplication is performed on the plurality of interaction subsequences according to the course resource ID to obtain a target interaction subsequence; The target interaction subsequences are spliced in chronological order to obtain a course resource interaction sequence.
[0006] In one embodiment, the step of mapping the user interaction sequence to a low-dimensional vector space to obtain a target course feature sequence includes: Construct an embedding table for the course resources, where each row in the embedding table corresponds to a low-dimensional embedding vector of a course resource; Search the embedding table according to the course resource ID in the user interaction sequence to obtain the corresponding low-dimensional embedding vector; Arranging the low-dimensional embedding vectors in the order of the user interaction sequence to form an initial course feature sequence; Normalizing the initial course feature sequence to obtain a normalized initial course feature sequence; Applying regularization processing to the normalized initial course feature sequence to obtain a regularized initial course feature sequence; Performing denoising on the regularized initial course feature sequence to obtain a denoised initial course feature sequence; The denoised initial course feature sequence is used as the target course feature sequence.
[0007] In one embodiment, the step of inputting the target course feature sequence into a preset improved state space model to obtain the target interest course includes: Input the target course feature sequence into a frequency domain filtering module in a preset improved state space model for processing to obtain a course feature sequence after frequency domain filtering; Inputting the course feature sequence after frequency domain filtering into the Mamba module in the preset improved state space model to perform sequence modeling using the selective state space mechanism to obtain sequence dependency features; By alternately stacking a plurality of frequency domain filtering modules and Mamba modules, a plurality of frequency domain filtered course feature sequences and a plurality of sequence dependency features are obtained respectively; Fusing the sequence dependency feature with the course feature sequence after frequency domain filtering to obtain an enhanced course feature; The enhanced course features are normalized and converted into a feedforward network to obtain target interest courses.
[0008] In one embodiment, the step of inputting the frequency-domain filtered course feature sequence into the Mamba module in the preset improved state space model and performing sequence modeling using a selective state space mechanism to obtain sequence dependency features includes: Initialize the state parameters of the Mamba module, which include an initial state vector and a state transfer matrix. The initial state vector is determined based on the course feature sequence after frequency domain filtering, and the state transfer matrix is used to describe the dynamic change relationship between states. Processing the course feature sequence after frequency domain filtering and the initial state vector through the Mamba module to obtain a current state vector; Performing a linear transformation on the current state vector using the state transfer matrix to obtain an intermediate state vector; Processing the intermediate state vector through a nonlinear activation function to obtain an updated state vector; The updated state vector is mapped to a sequence-dependent feature through an output equation, where the output equation is obtained based on a combination of a control input matrix and an observation matrix, where the control input matrix is used to adjust the influence of the input state vector, and the observation matrix is used to map the state vector to a sequence-dependent feature.
[0009] In one embodiment, the step of matching the target interest course with the candidate course resource set to obtain a recommendation score includes: Obtaining the embedding vector of each course resource in the candidate course resource set to form a candidate course resource embedding matrix; Obtaining a target interest course feature vector according to the target interest course; Performing a vector dot product operation on the target interest course feature vector and the candidate course resource embedding vector to obtain an original matching score vector for each candidate course resource; Performing a numerical conversion operation on the original matching score vector to obtain a standardized recommendation score; The candidate course resources are sorted in descending order according to the standardized recommendation scores to obtain recommendation scores.
[0010] In one embodiment, the step of outputting the recommended courses based on the recommendation scores to generate a course recommendation list includes: Obtain user historical interaction data; Globally sorting all candidate course resources from high to low according to the recommendation scores to obtain a sorted course resource list; Selecting a preset number of recommended course resources with the highest scores from the sorted course resource list to generate an initial recommendation set; Filtering the course resources that the user has studied or confirmed to be uninterested in based on the user's historical interaction data and the initial recommendation set to obtain an optimized recommendation set; Reordering the course resources in the optimized recommendation set according to the recommendation scores to obtain a target recommendation sequence; The course resource information in the target recommendation sequence is formatted to generate a course recommendation list.
[0011] In addition, to achieve the above-mentioned purpose, the present application also proposes a course resource recommendation device based on an improved state space model, wherein the course resource recommendation device based on the improved state space model comprises: Collection module, used to collect users' course resource data; An acquisition module, configured to process the course resource data by time-series grouping and splicing to obtain a course resource interaction sequence; A processing module, configured to perform data preprocessing on the course resource interaction sequence to obtain a user interaction sequence; A sequence acquisition module is used to map the user interaction sequence into a low-dimensional vector space to obtain a target course feature sequence; A feature extraction module is used to input the target course feature sequence into a preset improved state space model to obtain a target interest course, wherein the preset improved state space model includes a frequency domain filtering module, a Mamba module and an optimization module, the frequency domain filtering module is used to perform Fourier transform on the target course feature sequence to obtain a time domain signal, the Mamba module is used to perform state space modeling on the time domain signal, and the optimization module includes a normalization layer and a feedforward network layer; A matching module is used to match the target interest course with a candidate course resource set to obtain a recommendation score, wherein the candidate course resource set is obtained by filtering out qualified candidate course resources from the total course resource set according to preset filtering rules; The result module is used to output the recommended courses based on the recommendation scores and generate a course recommendation list.
[0012] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the course resource recommendation method based on the improved state space model as described above are implemented.
[0013] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the course resource recommendation method based on the improved state space model as described above.
[0014] This application collects user course resource data, obtains interaction sequences and performs preprocessing, maps user interaction sequences into a low-dimensional vector space, inputs the improved state space model, obtains target interest courses, and then matches them with the candidate course resource set, calculates recommendation scores and generates a recommendation list, reducing computational complexity and accurately capturing user interests, thereby improving the efficiency and accuracy of course resource recommendations. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0016] Figure 1 This is a flowchart of the first embodiment of the course resource recommendation method based on the improved state space model of this application; Figure 2 This is a preset improved state space model framework diagram of the first embodiment of the course resource recommendation method based on the improved state space model of this application; Figure 3 This is a flow chart of the second embodiment of the course resource recommendation method based on the improved state space model of this application; Figure 4 This is a flowchart of the third embodiment of the course resource recommendation method based on the improved state space model of this application; Figure 5 This is a schematic diagram of the module structure of a course resource recommendation device based on an improved state space model according to the first embodiment of the course resource recommendation method based on an improved state space model of the present application; Figure 6 This is a schematic diagram of the device structure of the hardware operating environment involved in the course resource recommendation method based on the improved state space model in the embodiment of the present application.
[0017] The purpose, features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0018] It should be understood that the specific embodiments described herein are merely used to explain the technical solutions of the present application and are not intended to limit the present application.
[0019] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0020] Traditional course recommendation methods often use models based on the Transformer architecture, such as SASRec and BERT4Rec. These models effectively model short-term and long-term dependencies between user behaviors through a multi-head self-attention mechanism, capturing sequential correlations and thus obtaining corresponding course resource information. However, the self-attention calculation of traditional Transformer models involves the dot product of similarities between all items, resulting in a time and space complexity of O(L²), where L is the sequence length. This leads to a sharp increase in the training and inference costs of the model when processing long sequences, making it difficult to efficiently deploy in large-scale online systems. Furthermore, user behavior sequences are inevitably intertwined with a large amount of noise, such as temporary clicks, test browsing, and negative feedback, which do not reflect the user's true interests. However, the traditional Transformer model assigns non-zero weights to all past items in the self-attention mechanism, causing this noise information to interfere with the learning of true preferences, thereby affecting recommendation accuracy.
[0021] Therefore, the present application proposes a course resource recommendation method based on an improved state space model to solve the above problems. The main solution of the embodiment of the present application is: collecting the user's course resource data; obtaining a course resource interaction sequence based on the course resource data; performing data preprocessing on the course resource interaction sequence to obtain a user interaction sequence; mapping the user interaction sequence to a low-dimensional vector space to obtain a target course feature sequence; inputting the target course feature sequence into a preset improved state space model to obtain a target interest course, wherein the preset improved state space model includes a frequency domain filtering module, a Mamba module and an optimization module, the frequency domain filtering module is used to perform Fourier transform on the initial course feature to obtain a time domain signal, and the Mamba module is used to perform state space modeling on the time domain signal; matching the target interest course with the candidate course resource set to obtain a recommendation score, wherein the candidate course resource set is obtained by filtering out qualified candidate course resources from the total course resource set through preset filtering rules; outputting the recommended courses based on the recommendation score to generate a course recommendation list.
[0022] Based on the above, the embodiment of the present application also provides a course resource recommendation method based on an improved state space model, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the course resource recommendation method based on the improved state space model of this application. In this embodiment, the course resource recommendation method based on the improved state space model includes steps S10 to S70: Step S10: Collect the user's course resource data.
[0023] It should be noted that the collected course resource data covers the interaction between users and various course resources, such as the number of clicks, viewing time, collection behavior, comment content, etc. of users on specific courses. These interactive behavior data can help the system gain a deep understanding of users' interest in and learning needs for different courses. By analyzing this data, it is possible to construct a user's behavioral profile, and then explore the user's potential interests and learning goals. For example, if a user frequently browses and studies courses in a certain field and spends a lot of time in related courses, then it can be judged that the user has a high interest in this field and may want to further study in depth.
[0024] Furthermore, to ensure data quality and usability, the collected course resource data is preprocessed. This preprocessing process includes operations such as data cleaning, denoising, and normalization to remove invalid or erroneous data records, eliminate noise interference, and convert the data into a format suitable for subsequent processing. For example, user learning time data is normalized to a uniform range to facilitate comparison and analysis with other data. Through these preprocessing steps, the system can obtain high-quality user interaction sequence data, providing a reliable data foundation for subsequent recommendation model training and recommendation result generation. At the same time, time series analysis is performed on user behavior data to capture the dynamic changes in user interests. For example, by analyzing the frequency of users' visits and dwell time on course resources over different time periods, short-term fluctuations and long-term trends in user interests can be identified. This time series analysis helps the system promptly adjust recommendations to adapt to changes in user interests, thereby providing more timely and personalized recommendation services.
[0025] Step S20: Processing the course resource data by time-series grouping and splicing to obtain a course resource interaction sequence.
[0026] It should be noted that step S20 specifically includes extracting user behavior data based on the course resource data. Specifically, the user's course resource data is obtained from the learning platform. This data covers the user's behavior data on the platform, including click data, browsing data, favorite data, and study time data. For example, click data can reflect the user's interest in the course, browsing data can indicate the depth of the user's exploration of the course content, favorite data indicates the user's long-term interest in the course, and study time data directly reflects the user's investment in the course content. Next, the user behavior data is grouped and aggregated by user ID to generate initial interaction records. Specifically, this user behavior data is grouped and aggregated by user ID to generate initial interaction records for each user. The initial interaction record is the original record of the user's interaction with the course resources, containing information such as clicks, browsing, favorites, and study time for different courses. Next, the initial interaction record is subjected to a pruning operation to obtain a pruned interaction record. Specifically, the initial interaction record is pruned. This pruning operation includes removing invalid data, abnormal data (such as extremely short browsing time or repeated clicks), and incomplete records. For example, if a user's browsing time is too short, it may simply be an accidental click, and such records will be removed to ensure the accuracy and reliability of the interaction record. The removed interaction records are then segmented according to preset time windows to generate multiple interaction subsequences. Specifically, the time windows can be determined based on the user's learning habits and platform usage patterns. For example, a day's interactions can be divided into several time periods, with each time period as an interaction subsequence. This segmentation approach better captures the user's behavioral patterns and interest changes over different time periods. Multiple interaction subsequences are then deduplicated based on the course resource ID to obtain the target interaction subsequence. Specifically, deduplication aims to remove duplicate records for the same course across different time periods and retain the user's most recent interaction with the course. For example, if a user browses the same course multiple times in a day, only the last browse record will be retained to prevent duplicate information from affecting subsequent recommendation algorithms. Finally, the target interaction subsequences are concatenated in chronological order to obtain the course resource interaction sequence. Specifically, the deduplicated interaction subsequences are concatenated in chronological order to obtain a complete course resource interaction sequence. This sequence not only preserves the chronological order of user behavior but also reflects the user's interest changes and learning paths over different time periods. Through this processing method, the system can generate high-quality course resource interaction sequences, providing accurate, complete and time-series input for subsequent recommendation algorithms.
[0027] Through the above steps, we can extract high-quality course resource interaction sequences from complex course resource data. This data not only clearly reflects user behavior patterns and interest preferences, but also provides rich contextual information for the recommendation system, thereby achieving more personalized and accurate course recommendation services.
[0028] Step S30: pre-process the course resource interaction sequence to obtain a user interaction sequence.
[0029] It's important to note that the collected course resource interaction sequences undergo data cleaning. This process includes removing duplicate interaction records, filtering out invalid or anomalous data points (such as extremely short browsing time or unusually high ratings), and filling in missing values. For example, if a user's course browsing time is zero, this data will be considered invalid and removed. If a user's rating for a course falls outside the normal range, the system will mark it as anomalous data and process it accordingly.
[0030] Next, the cleaned data is normalized. Normalization is the process of converting data with different features to a common scale, which is crucial for subsequent model training and recommendation calculations. For example, learning times can range from seconds to hours, while ratings can range from 1 to 5. Through normalization, these features are converted to a uniform range (such as 0 to 1), making it easier for the model to process and compare these data.
[0031] The system also extracts and enhances features from the normalized data. For example, the system may extract new features based on user behavior frequency, course categories, study duration, and other information to enrich the data's expressiveness. Furthermore, the system performs time series analysis on user behavior data to capture dynamic changes in user interests. For example, by analyzing user interactions over different time periods, the system can identify short-term fluctuations and long-term trends in user interests.
[0032] Finally, the preprocessed data is organized into user interaction sequences. Each user interaction sequence contains the user's interactions with the course resources over different time periods. These interactions are arranged in chronological order to form a complete time series. User interaction sequences not only preserve the temporal order of user behaviors but also reflect the user's interests, preferences, and learning paths over different time periods.
[0033] Through the above preprocessing steps, the original course resource interaction sequence can be converted into a high-quality user interaction sequence, providing reliable, accurate and time series characteristic input data for the subsequent recommendation algorithm.
[0034] Step S40: Map the user interaction sequence to a low-dimensional vector space to obtain a target course feature sequence.
[0035] It should be noted that the specific steps are: At this stage, each course resource is assigned a unique ID, and this process is usually completed by the embedding layer. The embedding layer is not a pre-trained model, but is dynamically updated during the model training process. This means that the low-dimensional vectors in the embedding layer will continue to adjust as the training progresses to better capture the characteristics and preferences of user behavior. The embedding layer assigns an initial random low-dimensional vector to each course resource, and these vectors are unoptimized at the beginning of training. As the model is trained, the vectors in the embedding layer are updated according to the gradient of the loss function through the backpropagation algorithm. This update mechanism enables the vector to gradually learn richer feature representations, thereby more accurately reflecting the user's preferences for different course resources, and constructing an embedding table for the course resources. Each row in the embedding table corresponds to a low-dimensional embedding vector of a course resource. These vectors can not only capture the essential characteristics of the course content, but also reflect the similarities or differences between different courses to a certain extent. Then, according to the user interaction sequence The course resource ID in the embedding table is searched to obtain the corresponding low-dimensional embedding vector. This process is actually a table lookup operation, which is specifically expressed as: in, For table lookup operations, the matrix Each row corresponds to a course resource ID dimensional embedding vector, which converts the user's actual interaction behavior into a form that can be understood by the machine learning model. Next, the low-dimensional embedding vectors are arranged in the order of the user interaction sequence to form the initial course feature sequence. After finding all corresponding embedding vectors, they are arranged in the chronological order of user interactions to form the initial course feature sequence. The initial course feature sequence is then normalized to obtain the normalized initial course feature sequence. Regularization is then applied to the normalized initial course feature sequence to obtain the regularized initial course feature sequence, which is specifically expressed as: Dropout is a dropout operation that randomly sets the elements of the matrix E to zero with probability p (p < 1), which facilitates learning of the neural network model. LayerNorm is a layer normalization operation that normalizes features across all dimensions within each time step (i.e., within each row vector), eliminating numerical scale differences between dimensions, accelerating convergence, and improving training robustness. The dropout and layer normalization operations yield a robust representation of the user-course interaction sequence. Finally, the regularized initial course feature sequence is subjected to denoising to obtain a denoised initial course feature sequence, which is then used as the target course feature sequence. Specifically, denoising aims to remove outliers or noise points from the feature sequence. These noise points may arise from abnormal user behavior or data collection errors. For example, smoothing algorithms or anomaly detection algorithms can be used to identify and remove these noise points, resulting in a more robust feature sequence. Finally, the denoised initial course feature sequence is used as the target course feature sequence. This sequence not only preserves the temporal order of the user interaction sequence but also enhances the feature representation through a low-dimensional embedding vector. Each vector in the target course feature sequence contains rich semantic information and can more accurately reflect the user's interests and preferences for the course.
[0036] Step S50: Input the target course feature sequence into the preset improved state space model to obtain the target interest course.
[0037] It should be noted that if Figure 2The framework diagram of the preset improved state-space model is shown. This preset improved state-space model includes a frequency domain filtering module, a Mamba module, and an optimization module. It effectively processes course feature sequences and accurately captures user interests. The frequency domain filtering module performs a Fourier transform on the initial course features to obtain a time domain signal. The target course feature sequence is then input into the frequency domain filtering module. This layer performs a Fourier transform on the initial course features, converting the time domain signal into a frequency domain signal. The Fourier transform decomposes complex time domain signals into sinusoidal components of varying frequencies, revealing the signal's frequency characteristics. In the frequency domain, high-frequency components of a signal typically correspond to rapidly changing details, while low-frequency components correspond to the signal's underlying trends. By analyzing the frequency domain signal, the main components and noise components within the signal can be more clearly identified. Furthermore, in the frequency domain filtering module, the system filters the frequency domain signal using learnable frequency domain filter weights. These filter weights are automatically learned through training to adapt to different data characteristics and noise patterns. The filter suppresses high-frequency noise components while preserving low-frequency signal components. This removes random noise and outliers from user behavior data, improving signal quality and stability. After frequency-domain filtering, the signal is converted back to the time domain, yielding a filtered time-domain signal. This process is called an inverse Fourier transform (IFT). The IFT reconstructs the frequency-domain signal into a time-domain signal, preserving the characteristics of the filtered signal. At this point, the time-domain signal has been freed of most noise interference, more accurately reflecting the user's behavior patterns and interests.
[0038] Secondly, the Mamba module is used to perform state-space modeling on time-domain signals. A sequence modeling module based on the state-space model is used to perform state-space modeling on time-domain signals. A state-space model is a mathematical model used to describe the dynamic changes in system states. In the Mamba module, the system state is updated using discretized state update equations, which can capture long-term dependencies in the sequence. Leveraging the properties of the state-space model, the Mamba module models user behavior sequences, thereby extracting the dynamic changes in user interests. In the Mamba module, the state update at each time step is based on the current input signal and the state at the previous time step. The state update equation combines the transition matrix and the control input matrix to effectively capture the time dependencies and dynamic changes in the sequence. In this way, the Mamba module can model the evolution of user interests, providing a more accurate basis for subsequent recommendations.
[0039] Finally, the output of the Mamba module enters the optimization module, which includes a normalization layer and a feedforward network layer. The optimization module further processes the output of the Mamba module to generate the final target interest courses. The optimization module typically includes an activation function and an output mapping function to convert the output of the Mamba module into a representation of the target interest courses. The activation function can be nonlinear, such as ReLU or sigmoid functions, to introduce nonlinear characteristics and enhance the expressive power of the model. The output mapping function maps the processed signal into a score or probability distribution of the target interest courses, thereby determining the courses that the user is most interested in.
[0040] Step S60: Match the target interest course with the candidate course resource set to obtain a recommendation score.
[0041] It should be noted that the above-mentioned candidate course resource set is obtained by filtering out qualified candidate course resources from the total course resource set through preset filtering rules. This process is completed through preset filtering rules, and the above-mentioned preset filtering rules can be set according to various factors such as course category, difficulty level, user rating, course duration, etc. For example, if the target interest course belongs to the "Computer Science" category and the difficulty is "Intermediate", the system may filter out courses of the same category and difficulty level that match it as candidate resources. In addition, high-quality courses can be further screened out based on indicators such as user ratings and completion rates of courses to ensure the quality of the candidate course resource set.
[0042] Next, the target course of interest is matched with a collection of candidate course resources. This matching process is based on the target course's feature vector and the embedding vectors of the candidate course resources. Specifically, the system calculates the similarity between the target course's feature vector and the embedding vector of each candidate course resource, typically using methods such as dot product or cosine similarity. For example, dot product calculations can measure the correlation between two vectors, while cosine similarity measures the angular difference between two vectors, reflecting their degree of similarity.
[0043] To further optimize the matching results, the matching scores are normalized. Normalization adjusts the scores to a uniform range (e.g., 0-1) for easier comparison and sorting, resulting in a recommendation score. The normalized scores more intuitively reflect the degree of match between the candidate courses and the target course of interest. For example, a candidate course with a score of 0.9 may be more in line with the user's interests than one with a score of 0.6. This step ensures the diversity and relevance of the recommendation results, while providing users with the course options that best suit their interests.
[0044] Step S70: Output the recommended courses based on the recommendation scores and generate a course recommendation list.
[0045] It's important to note that all candidate courses are ranked based on their calculated recommendation scores. These scores are derived by matching the target course with the candidate course resource set, reflecting each candidate course's relevance to the user's interests. A higher score indicates a more consistent match between the candidate course and the user's preferences. The system sorts candidate courses from highest to lowest recommendation score, ensuring that the top of the recommendation list contains the courses that the user is most likely to be interested in.
[0046] Furthermore, step S70 includes: first, obtaining user historical interaction data, which includes the user's past course browsing history, learning time, ratings, collection behavior, etc., reflecting the user's learning habits and interest preferences. Then, all candidate course resources are globally sorted from high to low according to the recommendation score to obtain a sorted course resource list, and then a preset number of recommended course resources with the highest scores are selected from the sorted course resource list to generate an initial recommendation set. The preset number of recommendations can be adjusted according to actual needs and user experience to balance the diversity and accuracy of the recommendations. Subsequently, based on the user's historical interaction data and the initial recommendation set, the course resources that the user has learned or confirmed to be uninterested are filtered to obtain an optimized recommendation set. Specifically, the course resources that the user has completed or clearly marked as uninterested are automatically eliminated to avoid repeated recommendations or invalid interruptions, thereby generating an optimized recommendation set. The course resources in the optimized recommendation set are then reordered according to their recommendation scores to create a target recommendation sequence. This reordering ensures that the optimized recommendation results remain highly relevant while removing duplicate or irrelevant recommendations. Finally, the course resource information in the target recommendation sequence is formatted to generate a course recommendation list. Specifically, formatting involves extracting basic course information (such as course title, description, and duration) and presenting it to the user in a user-friendly manner. For example, on a learning platform, the recommendation list can be displayed on the user's personal homepage or learning path page, allowing users to quickly access and select courses of interest.
[0047] To further enhance the user experience, recommended courses are personalized and presented. Each recommended course not only displays basic information about the course (such as course name, course description, course duration, etc.), but also comes with a reason for the recommendation. Reasons for recommendation can be generated based on the user's interest preferences, learning history, or the unique selling points of the course. For example, if a user shows a strong interest in the field of "data analysis," the reason for recommendation may emphasize the course's advantages in improving data analysis skills. In addition, the recommendation list will be dynamically adjusted based on user feedback. If a user clicks, collects, or rates a recommended course, this feedback information will be incorporated into the subsequent recommendation model to further optimize the recommendation results. This dynamic adjustment mechanism ensures that the recommendation system continues to adapt to changes in user interests over time and provides more accurate recommendations.
[0048] Finally, the generated course recommendation list is output in a user-friendly format. This list can be presented to the user via a webpage, mobile app interface, or email. For example, on a learning platform, the recommendation list can be displayed on the user's personal homepage or learning path page, allowing the user to quickly access and select courses of interest.
[0049] This implementation collects user course resource data, generates interaction sequences, performs preprocessing, maps these interaction sequences into a low-dimensional vector space, and inputs them into an improved state-space model to identify target courses of interest. This is then matched against a set of candidate course resources, and recommendation scores are calculated to generate a recommendation list. This method effectively filters out noise, reduces computational complexity, and improves the efficiency and accuracy of course resource recommendations.
[0050] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above embodiment 1 can be referred to the above introduction and will not be described in detail later. Figure 3 The course resource recommendation method based on the improved state space model, step S50, further includes steps S201 to S205: Step S201: Input the target course feature sequence into the frequency domain filtering module in the preset improved state space model for processing to obtain the course feature sequence after frequency domain filtering.
[0051] It should be noted that the frequency domain filtering module, as a key component of the improved state-space model, processes the target course feature sequence, effectively removing noise and enhancing signal stability. The core operation of the frequency domain filtering module is the Fourier transform, which converts the time domain signal into a frequency domain signal. The Fourier transform decomposes complex time domain signals into sinusoidal components of different frequencies, thereby revealing the signal's frequency characteristics. In the frequency domain, the high-frequency portion of a signal typically corresponds to rapidly changing details, while the low-frequency portion corresponds to the signal's underlying trends. By analyzing the frequency domain signal, the main components and noise components within the signal can be more clearly identified.
[0052] Furthermore, step S201 includes: performing a frequency domain conversion on the target course feature sequence using a Fourier transform to obtain original frequency domain features. Specifically, the target course feature sequence is subjected to a Fourier transform. The Fourier transform is a mathematical method for converting a time domain signal into a frequency domain signal, capable of decomposing a complex time domain signal into sinusoidal components of different frequencies. This process reveals the frequency characteristics of the signal, allowing the separation of high-frequency noise and low-frequency signal components. In the frequency domain, the high-frequency portion generally corresponds to rapidly changing details, while the low-frequency portion corresponds to the basic trend of the signal. Through the Fourier transform, the target course feature sequence is converted into original frequency domain features. Then, the original frequency domain features are weighted based on complex filter weights to obtain filtered frequency domain features. Specifically, weighting is performed based on the original frequency domain features. This process uses learnable complex filter weights to weight the frequency domain signal to suppress high-frequency noise components and retain low-frequency signal components. The complex filter weights can be automatically learned through a training process to adapt to different data characteristics and noise patterns. The filter weights are adjusted based on the frequency distribution of the frequency domain features, giving lower weights to high-frequency components and higher weights to low-frequency components. This approach effectively removes random noise and outliers from user behavior data, improving signal quality and stability. For example, if a user's behavior sequence contains brief, unrelated clicks, these behaviors often appear as high-frequency noise in the frequency domain. Complex filter weights can effectively suppress these noises. Finally, the filtered frequency domain features are restored to the time domain using an inverse Fourier transform, yielding a frequency-domain filtered course feature sequence. Specifically, after weighting, the filtered frequency domain features are restored to a time domain signal using an inverse Fourier transform. The inverse Fourier transform reconstructs the frequency domain signal into a time domain signal, preserving the characteristics of the filtered signal. This time domain signal has now been freed of most noise interference and more accurately reflects the user's behavior patterns and interests. The inverse Fourier transformed time domain signal is the frequency-domain filtered course feature sequence. This sequence not only preserves the temporal order of the user interaction sequence but also enhances the expressiveness and stability of the features through frequency-domain filtering. Ultimately, the system obtains a frequency-domain filtered course feature sequence. Each vector in this sequence contains rich semantic information, more accurately reflecting the user's interests and preferences for courses. Frequency-domain filtering not only removes noise but also preserves the key characteristics of user behavior, enabling subsequent modeling and recommendation to more accurately capture the dynamic changes in user interests.
[0053] Step S202: Input the course feature sequence after frequency domain filtering into the Mamba module in the preset improved state space model to perform sequence modeling using the selective state space mechanism to obtain sequence dependency features.
[0054] It should be noted that the specific steps are as follows: First, the state parameters of the Mamba module are initialized. These state parameters include an initial state vector and a state transition matrix. The initial state vector is determined based on the frequency-domain filtered course feature sequence. The state transition matrix is used to describe the dynamic relationship between states. It is a learnable parameter matrix that can capture the temporal dependencies in the sequence. During model training, the state transition matrix automatically adjusts based on the data to better adapt to user behavior patterns. Next, the Mamba module processes the frequency-domain filtered course feature sequence and the initial state vector to obtain the current state vector. Specifically, the Mamba module receives the frequency-domain filtered course feature sequence as input and processes it in conjunction with the initial state vector. At each time step, the Mamba module updates the current state vector based on the current input feature vector and the state vector from the previous time step. This process is implemented using a state update equation that combines the input feature vector and the previous state vector to dynamically reflect changes in user interests. Subsequently, the current state vector is linearly transformed using the state transition matrix to obtain an intermediate state vector. Specifically, at each time step, the Mamba module uses a state transition matrix to perform a linear transformation on the current state vector to obtain an intermediate state vector. The state transition matrix maps the current state vector to a new state space, thereby capturing the dynamic changes between states. This linear transformation process is the core of the state space model and can effectively model long-term dependencies in a sequence. The intermediate state vector is then processed using a nonlinear activation function to obtain an updated state vector. Specifically, the Mamba module applies a nonlinear activation function to the intermediate state vector. Common nonlinear activation functions include ReLU, Sigmoid, or Tanh. Nonlinear activation functions introduce nonlinear characteristics, enabling the model to better capture complex dynamic changes. After processing with the nonlinear activation function, the intermediate state vector is converted into an updated state vector, which more accurately reflects the user's interest state at the current time step. Finally, the updated state vector is mapped into a sequence-dependent feature using an output equation derived from the combination of the control input matrix and the observation matrix. Specifically, the Mamba module maps the updated state vector into a sequence-dependent feature using the output equation. The output equation combines the control input matrix, which adjusts the influence of input features, and the observation matrix, which maps the state vector to the final output features. The output equation converts the state vector into feature vectors that reflect user interest dependencies. These feature vectors serve as important inputs for subsequent recommendation calculations.
[0055] Through the above steps, the Mamba module can effectively model the course feature sequence after frequency domain filtering, capture the dynamic changes of user interests, and generate feature vectors that can reflect the dependency relationship of user interests.
[0056] Step S203 , obtaining a plurality of frequency-domain filtered course feature sequences and a plurality of sequence dependency features respectively by alternately stacking a plurality of frequency-domain filtering modules and Mamba modules.
[0057] It should be noted that by alternately stacking multiple frequency domain filter modules and Mamba modules, the model can gradually remove noise while capturing the dynamic changes of user interests. The course feature sequence processed by each layer of frequency domain filter module serves as the input of the next layer of Mamba module, and the sequence dependency features generated by each layer of Mamba module serve as the input of the next layer of frequency domain filter module. ,Through Fourier transform, the target course feature sequence is converted into the original frequency domain feature, which is specifically expressed as: FFT stands for Fast Fourier Transform, which maps a fixed-length time series to a frequency domain representation of real-imaginary composite components. represents the index of the frequency domain, Indicates the index in the batch. In single batch processing, The default value is 1. represents the dimension of the embedding vector, Represents the length of the target course feature sequence, and obtains the frequency domain feature expression of the target course feature sequence Then, the original frequency domain features are weighted based on the complex filter weights to obtain the filtered frequency domain features, which can be specifically expressed as: in For the frequency components in the frequency domain and channel dimension The learnable complex filter weights on are used to weight the original spectrum, thereby suppressing or enhancing the signal in a specific frequency band and filtering out noise. The filtered frequency domain features are restored in the time domain through the inverse Fourier transform to obtain the course feature sequence after frequency domain filtering, which is specifically expressed as: IFFT stands for Fast Inverse Fourier Transform, which converts frequency domain features back to the time domain. The sequence operator based on the state space model in the Mamba module efficiently models the time domain signal. The filtered frequency domain features are input into the modeling equation to obtain the sequence dependency features, which can be expressed as: Mamba means Mamba module. is the final output of the current layer.
[0058] This multi-layer stacking structure can then gradually enhance the expressive power of features and ultimately generate a high-quality feature sequence. This allows the final generated feature sequence to more comprehensively reflect the user's behavior patterns and interest preferences, providing richer information for subsequent recommendations.
[0059] Step S204: Fusing the sequence dependency feature with the course feature sequence after frequency domain filtering to obtain enhanced course features.
[0060] It should be noted that the course feature sequence after frequency domain filtering is concatenated with the sequence-dependent features to form a higher-dimensional feature vector. The concatenated feature vector incorporates the stability of the course feature sequence after frequency domain filtering and the dynamics of the sequence-dependent features, enabling the model to more comprehensively reflect user behavior patterns and interests.
[0061] Next, the concatenated feature vectors are weighted. Weighting coefficients are automatically learned through training to adapt to different data characteristics and user behavior patterns. For example, if a feature has a greater impact on the recommendation results, the system automatically assigns it a higher weight. This weighting process further optimizes the fusion effect, allowing the model to better capture the dynamic changes in user interests and long-term dependencies.
[0062] To improve computational efficiency, the weighted feature vectors are subjected to dimensionality reduction. This can be achieved through principal component analysis (PCA) or other dimensionality reduction techniques, which retain the primary components of the feature vector and remove redundant information to produce a processed feature vector. This processed feature vector is not only more compact but also improves the computational efficiency of the model, enabling it to generate recommendations more quickly.
[0063] To further enhance the expressiveness of features, the processed feature vectors are processed using nonlinear activation functions to generate enhanced course features. Nonlinear activation functions can introduce nonlinear characteristics, enabling the model to better capture complex dynamic changes. For example, activation functions such as ReLU, Sigmoid, or Tanh can be used. These activation functions not only enhance the expressiveness of features but also improve the model's generalization capabilities, enabling the model to better adapt to diverse user behavior patterns.
[0064] Through the above series of processing, enhanced course features are generated. These features can more accurately reflect the user's interest preferences and provide high-quality input for subsequent recommendation algorithms.
[0065] Step S205 , normalizing and feedforward network transforming the enhanced course features to obtain target interest courses.
[0066] It should be noted that the enhanced course features are normalized, specifically expressed as follows: in, Represents the normalization function. Normalization adjusts the length of feature vectors to a uniform scale, typically to the unit vector (length 1). This process ensures that different features have the same scale in subsequent calculations, thus avoiding computational errors caused by differences in feature length. Normalized feature vectors are not only more stable but also improve model computational efficiency and accuracy.
[0067] Next, the normalized enhanced course features are input into the feedforward network for conversion. The feedforward network is a simple neural network structure that can perform nonlinear transformations on input features to further enhance the expressiveness of the features. The feedforward network usually contains multiple layers of neurons, and each layer introduces nonlinear characteristics through an activation function. For example, activation functions such as ReLU, Sigmoid, or Tanh can be used. These activation functions can not only enhance the expressiveness of features, but also improve the generalization ability of the model, so that the model can better adapt to different user behavior patterns. In the feedforward network, the neurons in each layer will perform a weighted summation on the input features and perform a nonlinear transformation through the activation function, which is specifically expressed as: in, , is the learnable weight matrix, The activation function is the Gaussian Error Linear Unit (GELU). This nonlinear transformation can capture the complex relationships between features, allowing the model to more accurately reflect the user's interests and preferences. The output of the feedforward network is the feature representation of the target interest course. These feature representations can more accurately reflect the user's interests and preferences, providing high-quality input for the subsequent recommendation algorithm. Finally, the target interest course is generated based on the output of the feedforward network. This process is completed by calculating the similarity between the feature representation of the target interest course and the candidate course resource set. The similarity can be calculated using methods such as dot product or cosine similarity, ultimately obtaining a recommendation score for each candidate course. Based on the recommendation score, the preset number of recommendations with the highest scores are selected as the final recommendation result.
[0068] This embodiment removes noise through frequency domain filtering, uses the Mamba module to model sequence dependencies, alternately stacks multiple layers to enhance feature expression, fuses features to improve information richness, and generates target interest courses through normalization and feedforward network conversion. This effectively filters noise, accurately models the dynamic changes in user interests, improves recommendation accuracy and efficiency, and provides users with personalized course recommendations.
[0069] Based on the first embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above introduction and will not be described in detail later. Figure 4 The course resource recommendation step S60 based on the improved state space model further includes steps S301 to S305: Step S301: Obtain the embedding vector of each course resource in the candidate course resource set to form a candidate course resource embedding matrix.
[0070] It's important to note that the above steps first filter out qualified candidate course resources from the total set of course resources. This screening process is based on pre-set filtering rules, such as course category, difficulty level, user ratings, and course duration. These rules ensure the quality and relevance of the candidate course resource set, making the recommendation results more aligned with the user's interests and learning needs.
[0071] Next, for each course resource in the candidate course resource set, its embedding vector is obtained. The embedding vector is generated by a pre-trained embedding model and can capture the semantic information and features of the course resource. For example, information such as the course category, difficulty, content theme, user rating, etc. will be encoded into the embedding vector. The embedding model is usually a deep learning model such as Word2Vec, GloVe or BERT, which can convert the text description, label and other information of the course resource into a low-dimensional vector representation. These vectors can not only retain the main features of the course resource, but also capture the similarity between courses through vector operations.
[0072] Finally, the embedding vectors for each candidate course resource are arranged in order to form the candidate course resource embedding matrix. Each embedding vector is a row in the matrix, and each column of the embedding matrix corresponds to a dimension of the embedding vector. The candidate course resource embedding matrix is a two-dimensional matrix, where each row represents the feature representation of a candidate course resource. This matrix not only contains rich semantic information about the candidate course resources, but also enables efficient subsequent recommendation calculations through matrix operations.
[0073] Step S302: obtaining a target interest course feature vector according to the target interest course.
[0074] It's important to note that generating a corresponding feature vector based on the target interest course typically involves a multi-dimensional analysis of the target interest course, including course content, user behavior data, and contextual information. For example, the system might consider factors such as course category, difficulty level, user ratings, and study time. These factors together constitute the multi-dimensional features of the target interest course.
[0075] Next, the system converts these multi-dimensional features into low-dimensional feature vectors using an embedding model. An embedding model is a deep learning model that maps complex course features into a low-dimensional space while preserving semantic similarities between courses. For example, using models such as Word2Vec, GloVe, or BERT, course text descriptions, tags, and other information can be converted into low-dimensional vector representations. These vectors not only preserve the key characteristics of the courses but also capture similarities between courses through vector operations.
[0076] To further optimize the quality of the feature vectors, the generated feature vectors are normalized. Normalization adjusts the length of the vectors to a uniform scale, typically to the unit vector (length 1). This process ensures that different feature vectors have the same scale in subsequent calculations, thus avoiding computational errors caused by differences in vector length. Normalized feature vectors are not only more stable but also improve the computational efficiency and accuracy of the model.
[0077] Finally, the normalized feature vector is used as the target interest course feature vector. This feature vector not only contains rich semantic information but also enables efficient subsequent recommendation calculations through vector operations. For example, by calculating the similarity between the target interest course feature vector and the embedding matrix of candidate course resources, the system can quickly generate recommendation results.
[0078] Step S303: perform a vector dot product operation on the target interest course feature vector and the candidate course resource embedding vector to obtain the original matching score vector of each candidate course resource.
[0079] It should be noted that the first step is to obtain the feature vector of the target course of interest. This feature vector is obtained by embedding and normalizing the multi-dimensional features of the target course of interest and accurately reflects the user's current interests and preferences. The target course feature vector is a low-dimensional vector representation that contains rich semantic information. Next, the embedding vector of each course resource in the candidate course resource set is obtained. These embedding vectors are also generated using a pre-trained embedding model and capture the semantic characteristics of each candidate course resource. The candidate course resource embedding vectors form an embedding matrix, where each row corresponds to the feature representation of a candidate course resource. Next, to evaluate the relevance of each candidate course resource to the target course of interest, a vector dot product operation is performed on the target course feature vector and each candidate course resource embedding vector. The vector dot product operation is a commonly used similarity calculation method that measures the linear correlation between two vectors. Specifically, the vector dot product operation calculates the sum of the products of the corresponding elements of two vectors, resulting in a scalar value. This scalar value reflects the similarity between the two vectors, with larger values indicating higher similarity.
[0080] Finally, a vector dot product operation is performed to obtain the raw matching score vector for each candidate course resource. The raw matching score vector is a one-dimensional vector, where each element corresponds to the matching score of a candidate course resource. These matching scores reflect the relevance of each candidate course resource to the target course of interest, providing an accurate basis for subsequent recommendation ranking.
[0081] Step S304: Perform a numerical conversion operation on the original matching score vector to obtain a standardized recommendation score.
[0082] It should be noted that the system first calculates a raw matching score vector for each candidate course resource. These scores are obtained by performing a dot product operation on the feature vector of the target course of interest and the embedding vector of the candidate course resource, reflecting the relevance of each candidate course to the user's interests. However, the range of raw matching scores may vary depending on the feature vector and calculation method, which may lead to inconsistent recommendation results.
[0083] To ensure the comparability and stability of recommendation scores, the system performs a numerical conversion on the raw matching score vector. This conversion aims to adjust the raw matching scores to a uniform range, typically [0, 1] or [-1, 1]. Common numerical conversion methods include normalization and standardization. Through this conversion, the system converts the raw matching score vector into a standardized recommendation score vector. Each score in the standardized recommendation score vector is within a uniform range and has the same scale and distribution characteristics. This allows for direct comparison of scores across candidate course resources, improving the stability and reliability of the recommendation results.
[0084] Step S305 : sorting the candidate course resources in descending order according to the standardized recommendation scores to obtain the recommendation scores.
[0085] It should be noted that the candidate course resources are sorted in descending order according to the standardized recommendation score. Descending sorting is to arrange the candidate course resources from high to low according to the recommendation score, so that the course resources that best meet the user's interests are ranked first. This process is achieved through simple sorting algorithms, such as quick sort or merge sort, which can complete the sorting operation of large-scale data in a shorter time. During the sorting process, the system will generate a sorted list of candidate course resources. The position of each course resource in the list is determined by its standardized recommendation score. The sorted list can not only clearly show the relevance of the candidate course resources, but also provide users with ordered recommendation options.
[0086] This embodiment obtains the embedding vector for each course resource in the candidate course resource set to form an embedding matrix. Next, a feature vector is generated based on the target interest courses. Next, a vector dot product operation is used to calculate the raw matching score vector for each candidate course resource, and a numerical conversion is performed to obtain a standardized recommendation score. Finally, a recommendation list is generated by sorting the recommendation scores in descending order, improving recommendation accuracy and user experience.
[0087] Based on the first embodiment of the present application, the present application also provides a course resource recommendation device based on an improved state space model, please refer to Figure 5 , the device comprises: The collection module 10 is used to collect the user's course resource data.
[0088] The acquisition module 20 is used to process the course resource data through time-series grouping and splicing to obtain a course resource interaction sequence.
[0089] The processing module 30 is used to perform data preprocessing on the course resource interaction sequence to obtain a user interaction sequence.
[0090] The sequence acquisition module 40 is used to map the user interaction sequence into a low-dimensional vector space to obtain a target course feature sequence.
[0091] The feature extraction module 50 is used to input the target course feature sequence into the preset improved state space model to obtain the target interest course, wherein the preset improved state space model includes a frequency domain filtering module, a Mamba module and an optimization module. The frequency domain filtering module is used to perform Fourier transform on the initial course features to obtain a time domain signal. The Mamba module is used to perform state space modeling on the time domain signal. The optimization module includes a normalization layer and a feedforward network layer.
[0092] The matching module 60 is used to match the target interest course with the candidate course resource set to obtain a recommendation score, wherein the candidate course resource set is obtained by filtering out qualified candidate course resources from the total course resource set according to preset filtering rules.
[0093] The result module 70 is used to output the recommended courses based on the recommendation scores and generate a course recommendation list.
[0094] The course resource recommendation device based on the improved state-space model provided in this application adopts the course resource recommendation method based on the improved state-space model in the above-mentioned embodiment, which can solve the technical problem of how to improve the efficiency and accuracy of course resource recommendation. Compared with the existing technology, the beneficial effects of the course resource recommendation device based on the improved state-space model provided in this application are the same as the beneficial effects of the course resource recommendation method based on the improved state-space model provided in the above-mentioned embodiment, and the other technical features of the course resource recommendation device based on the improved state-space model are the same as the features disclosed in the above-mentioned embodiment method, and are not further described here.
[0095] In one embodiment, the acquisition module 20 is further used to extract user behavior data based on the course resource data, wherein the user behavior data includes click data, browsing data, collection data and learning time data; grouping and aggregating the user behavior data by user ID to generate an initial interaction record; performing a pruning operation on the initial interaction record to obtain a pruned interaction record; segmenting the pruned interaction record according to a preset time window to generate multiple interaction subsequences; deduplicating the multiple interaction subsequences according to the course resource ID to obtain a target interaction subsequence; and splicing the target interaction subsequences in chronological order to obtain a course resource interaction sequence.
[0096] In one embodiment, the sequence acquisition module 40 is also used to construct an embedding table of course resources, where each row in the embedding table corresponds to a low-dimensional embedding vector of a course resource; the course resource ID in the user interaction sequence is searched in the embedding table to obtain the corresponding low-dimensional embedding vector; the low-dimensional embedding vectors are arranged in the order of the user interaction sequence to form an initial course feature sequence; the initial course feature sequence is normalized to obtain a normalized initial course feature sequence; regularization is applied to the normalized initial course feature sequence to obtain a regularized initial course feature sequence; noise reduction is performed on the regularized initial course feature sequence to obtain a noise-reduced initial course feature sequence; and the noise-reduced initial course feature sequence is used as the target course feature sequence.
[0097] In one embodiment, the feature extraction module 50 is further used to input the target course feature sequence into a frequency domain filtering module in a preset improved state space model for processing to obtain a course feature sequence after frequency domain filtering; input the course feature sequence after frequency domain filtering into a Mamba module in a preset improved state space model for sequence modeling using a selective state space mechanism to obtain a sequence dependency feature; obtain multiple course feature sequences after frequency domain filtering and multiple sequence dependency features by alternately stacking multiple frequency domain filtering modules and Mamba modules; fuse the sequence dependency feature with the course feature sequence after frequency domain filtering to obtain an enhanced course feature; and perform normalization processing and feedforward network conversion on the enhanced course feature to obtain a target interest course.
[0098] In one embodiment, the feature extraction module 50 is also used to initialize the state parameters of the Mamba module, and the state parameters include an initial state vector and a state transfer matrix. The initial state vector is determined based on the course feature sequence after frequency domain filtering, and the state transfer matrix is used to describe the dynamic change relationship between states; the course feature sequence after frequency domain filtering and the initial state vector are processed by the Mamba module to obtain a current state vector; the current state vector is linearly transformed using the state transfer matrix to obtain an intermediate state vector; the intermediate state vector is processed by a nonlinear activation function to obtain an updated state vector; the updated state vector is mapped to a sequence-dependent feature through an output equation, and the output equation is obtained based on a combination of a control input matrix and an observation matrix. The control input matrix is used to adjust the influence of the input state vector, and the observation matrix is used to map the state vector to a sequence-dependent feature.
[0099] In one embodiment, the matching module 60 is further used to obtain the embedding vector of each course resource in the candidate course resource set to form a candidate course resource embedding matrix; obtain the target interest course feature vector based on the target interest course; perform a vector dot product operation on the target interest course feature vector and the candidate course resource embedding vector to obtain the original matching score vector of each candidate course resource; perform a numerical conversion operation on the original matching score vector to obtain a standardized recommendation score; and sort the candidate course resources in descending order according to the standardized recommendation score to obtain a recommendation score.
[0100] In one embodiment, the result module 70 is also used to obtain user historical interaction data; globally sort all candidate course resources from high to low according to the recommendation score to obtain a sorted course resource list; select a preset number of recommended course resources with the highest scores from the sorted course resource list to generate an initial recommendation set; filter the course resources that the user has learned or confirmed to be not interested in according to the user historical interaction data and the initial recommendation set to obtain an optimized recommendation set; re-sort the course resources in the optimized recommendation set according to the recommendation score to obtain a target recommendation sequence; format the course resource information in the target recommendation sequence to generate a course recommendation list.
[0101] The present application provides a course resource recommendation device based on an improved state space model. The course resource recommendation device based on the improved state space model includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the course resource recommendation method based on the improved state space model in the above-mentioned embodiment one.
[0102] Reference below Figure 6 , which shows a schematic structural diagram of a course resource recommendation device based on an improved state-space model suitable for implementing an embodiment of the present application. The course resource recommendation device based on the improved state-space model in the embodiment of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), in-vehicle terminals (such as in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 6 The course resource recommendation device based on the improved state space model shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0103] like Figure 6As shown, the course resource recommendation device based on the improved state space model may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to the program stored in the read-only memory 1002 (ROM: Read Only Memory) or the program loaded from the storage device 1003 to the random access memory 1004 (RAM: Random Access Memory). Various programs and data required for the operation of the course resource recommendation device based on the improved state space model are also stored in RAM1004. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the course resource recommendation device based on the improved state space model to communicate wirelessly or wired with other devices to exchange data. Although the figure shows various course resource recommendation devices based on the improved state space model, it should be understood that it is not required to implement or have all of the shown ones. More or fewer can be implemented or have instead.
[0104] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer-readable storage medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0105] The course resource recommendation device based on the improved state space model provided by this application adopts the course resource recommendation method based on the improved state space model in the above-mentioned embodiment, which can solve the technical problem of how to improve the efficiency and accuracy of course resource recommendation. Compared with the existing technology, the beneficial effects of the course resource recommendation device based on the improved state space model provided by this application are the same as the beneficial effects of the course resource recommendation method based on the improved state space model provided by the above-mentioned embodiment, and the other technical features of the course resource recommendation device based on the improved state space model are the same as the features disclosed in the method of the previous embodiment, and will not be repeated here.
[0106] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0107] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
[0108] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, a computer program) stored thereon, wherein the computer-readable program instructions are used to execute the course resource recommendation method based on the improved state space model in the above-mentioned embodiment.
[0109] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible storage medium that contains or stores a program that can be executed by instructions, used by a device, or used in conjunction with it. The program code contained on the computer-readable storage medium may be transmitted using any suitable storage medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0110] The computer-readable storage medium may be included in the course resource recommendation device based on the improved state space model; or it may exist independently without being assembled into the course resource recommendation device based on the improved state space model.
[0111] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the course resource recommendation device based on the improved state-space model, the course resource recommendation device based on the improved state-space model can be written in one or more programming languages or a combination thereof to write computer program codes for performing the operations of the present application. The above-mentioned programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also conventional procedural programming languages such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0112] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based implementation that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0113] The modules described in the embodiments of the present application may be implemented in software or hardware, wherein the name of a module does not necessarily limit the unit itself.
[0114] The computer-readable storage medium provided in this application stores computer-readable program instructions (i.e., a computer program) for executing the aforementioned method for recommending course resources based on an improved state-space model. This computer-readable storage medium can address the technical problem of improving the efficiency and accuracy of course resource recommendations. Compared to the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the method for recommending course resources based on an improved state-space model provided in the aforementioned embodiments, and are not further elaborated upon here.
[0115] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the above-mentioned method for recommending course resources based on the improved state-space model.
[0116] The computer program product provided in this application can solve the technical problem of improving the efficiency and accuracy of course resource recommendations. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the course resource recommendation method based on the improved state-space model provided in the above embodiment, and will not be elaborated here.
[0117] The above description is only part of the embodiments of the present application and does not limit the patent scope of the present application. All equivalent structural transformations made by using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A course resource recommendation method based on an improved state space model, characterized in that: include: Collect users' course resource data; Processing the course resource data through time-series grouping and splicing to obtain a course resource interaction sequence; Performing data preprocessing on the course resource interaction sequence to obtain a user interaction sequence; Mapping the user interaction sequence to a low-dimensional vector space to obtain a target course feature sequence; Inputting the target course feature sequence into a preset improved state space model to obtain a target interest course, wherein the preset improved state space model includes a frequency domain filtering module, a Mamba module and an optimization module, the frequency domain filtering module is used to perform Fourier transform on the target course feature sequence to obtain a time domain signal, the Mamba module is used to perform state space modeling on the time domain signal, and the optimization module includes a normalization layer and a feedforward network layer; Matching the target interest course with a candidate course resource set to obtain a recommendation score, wherein the candidate course resource set is obtained by filtering out qualified candidate course resources from the total course resource set according to preset filtering rules; The recommended courses are output based on the recommendation scores to generate a course recommendation list.
2. The method according to claim 1, wherein The step of processing the course resource data by time-series grouping and splicing to obtain a course resource interaction sequence includes: Extracting user behavior data based on the course resource data, wherein the user behavior data includes click data, browsing data, collection data, and learning time data; Grouping and aggregating the user behavior data by user ID to generate initial interaction records; Performing a deletion operation on the initial interaction record to obtain a deleted interaction record; Segmenting the interaction records after elimination according to a preset time window to generate multiple interaction subsequences; Deduplication is performed on the plurality of interaction subsequences according to the course resource ID to obtain a target interaction subsequence; The target interaction subsequences are spliced in chronological order to obtain a course resource interaction sequence.
3. The method according to claim 1, wherein The step of mapping the user interaction sequence to a low-dimensional vector space to obtain a target course feature sequence includes: Construct an embedding table for the course resources, where each row in the embedding table corresponds to a low-dimensional embedding vector of a course resource; Search the embedding table according to the course resource ID in the user interaction sequence to obtain the corresponding low-dimensional embedding vector; Arranging the low-dimensional embedding vectors in the order of the user interaction sequence to form an initial course feature sequence; Normalizing the initial course feature sequence to obtain a normalized initial course feature sequence; Applying regularization processing to the normalized initial course feature sequence to obtain a regularized initial course feature sequence; Performing denoising on the regularized initial course feature sequence to obtain a denoised initial course feature sequence; The denoised initial course feature sequence is used as the target course feature sequence.
4. The method according to claim 1, wherein The step of inputting the target course feature sequence into a preset improved state space model to obtain a target interest course includes: Input the target course feature sequence into a frequency domain filtering module in a preset improved state space model for processing to obtain a course feature sequence after frequency domain filtering; Inputting the course feature sequence after frequency domain filtering into the Mamba module in the preset improved state space model to perform sequence modeling using the selective state space mechanism to obtain sequence dependency features; By alternately stacking a plurality of frequency domain filtering modules and Mamba modules, a plurality of frequency domain filtered course feature sequences and a plurality of sequence dependency features are obtained respectively; Fusing the sequence dependency feature with the course feature sequence after frequency domain filtering to obtain an enhanced course feature; The enhanced course features are normalized and converted into a feedforward network to obtain target interest courses.
5. The method according to claim 4, wherein The step of inputting the frequency-domain filtered course feature sequence into the Mamba module in the preset improved state space model to perform sequence modeling using a selective state space mechanism to obtain sequence dependency features includes: Initialize the state parameters of the Mamba module, which include an initial state vector and a state transfer matrix. The initial state vector is determined based on the course feature sequence after frequency domain filtering, and the state transfer matrix is used to describe the dynamic change relationship between states. Processing the course feature sequence after frequency domain filtering and the initial state vector through the Mamba module to obtain a current state vector; Performing a linear transformation on the current state vector using the state transfer matrix to obtain an intermediate state vector; Processing the intermediate state vector through a nonlinear activation function to obtain an updated state vector; The updated state vector is mapped to a sequence-dependent feature through an output equation, where the output equation is obtained based on a combination of a control input matrix and an observation matrix, where the control input matrix is used to adjust the influence of the input state vector, and the observation matrix is used to map the state vector to a sequence-dependent feature.
6. The method according to claim 1, wherein The step of matching the target interest course with the candidate course resource set to obtain a recommendation score includes: Obtaining the embedding vector of each course resource in the candidate course resource set to form a candidate course resource embedding matrix; Obtaining a target interest course feature vector according to the target interest course; Performing a vector dot product operation on the target interest course feature vector and the candidate course resource embedding vector to obtain an original matching score vector for each candidate course resource; Performing a numerical conversion operation on the original matching score vector to obtain a standardized recommendation score; The candidate course resources are sorted in descending order according to the standardized recommendation scores to obtain recommendation scores.
7. The method according to claim 1, wherein The step of outputting the recommended courses based on the recommendation scores and generating a course recommendation list includes: Obtain user historical interaction data; Globally sorting all candidate course resources from high to low according to the recommendation scores to obtain a sorted course resource list; Selecting a preset number of recommended course resources with the highest scores from the sorted course resource list to generate an initial recommendation set; Filtering the course resources that the user has studied or confirmed to be uninterested in based on the user's historical interaction data and the initial recommendation set to obtain an optimized recommendation set; Reordering the course resources in the optimized recommendation set according to the recommendation scores to obtain a target recommendation sequence; The course resource information in the target recommendation sequence is formatted to generate a course recommendation list.
8. A course resource recommendation device based on an improved state space model, characterized in that: The device comprises: Collection module, used to collect users' course resource data; An acquisition module, configured to process the course resource data by time-series grouping and splicing to obtain a course resource interaction sequence; A processing module, configured to perform data preprocessing on the course resource interaction sequence to obtain a user interaction sequence; A sequence acquisition module is used to map the user interaction sequence into a low-dimensional vector space to obtain a target course feature sequence; A feature extraction module is used to input the target course feature sequence into a preset improved state space model to obtain a target interest course, wherein the preset improved state space model includes a frequency domain filtering module, a Mamba module and an optimization module, the frequency domain filtering module is used to perform Fourier transform on the target course feature sequence to obtain a time domain signal, the Mamba module is used to perform state space modeling on the time domain signal, and the optimization module includes a normalization layer and a feedforward network layer; A matching module is used to match the target interest course with a candidate course resource set to obtain a recommendation score, wherein the candidate course resource set is obtained by filtering out qualified candidate course resources from the total course resource set according to preset filtering rules; The result module is used to output the recommended courses based on the recommendation scores and generate a course recommendation list.
9. A course resource recommendation device based on an improved state space model, characterized in that: The device includes: a memory, a processor, and a course resource recommendation program based on an improved state space model stored in the memory and running on the processor. The course resource recommendation program based on the improved state space model is configured to implement the steps of the course resource recommendation method based on the improved state space model as described in any one of claims 1-7.
10. A storage medium, characterized in that: The storage medium stores a course resource recommendation program based on an improved state space model. When the course resource recommendation program based on the improved state space model is executed by the processor, the steps of the course resource recommendation method based on the improved state space model as described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Charging pile charging charge prediction method, system and device based on Internet of Things
CN118572699A
Epilepsy prediction method based on adaptive space-time attention and dynamic fusion network
CN119344751A
Location social network service recommendation method based on trajectory collaborative filtering and Mama
CN120256746A
Method, apparatus, and system for wireless gait recognition
EP3695783A1
Cited By
Recommendation method and device, electronic equipment and storage medium
CN121256151A
Course recommendation method and device based on wavelet transform and attention mechanism, equipment and storage medium
CN121524446A
Course recommendation method and device based on wavelet transform and attention mechanism, equipment and storage medium
CN121524446B
Sequence recommendation method for decoupling modeling of long and short term preferences of user based on frequency domain analysis
CN122196275A
Sequence recommendation method for decoupling user long-term and short-term preferences based on frequency domain analysis
CN122196275B
