Rapid deployment and elastic expansion method of lightweight micro-service architecture in education
By applying association rules and clustering algorithms in the education platform to determine course relevance and student groups, and combining time series prediction and multi-level cache architecture, efficient cache strategy optimization is achieved, solving the problems of cache consistency and resource access efficiency under the microservice architecture, and improving the learning experience and system performance.
Patent Information
- Application Number
- CN202510866827.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2025-10-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In an education platform, how to implement efficient distributed caching under a microservice architecture, ensure the consistency and accuracy of cached data, and optimize the caching strategy to provide a smooth and efficient learning experience, especially when considering course relevance, student learning paths, and resource access efficiency, is a challenge.
The course relevance is determined through association rule mining algorithms, student groups are classified using clustering algorithms, differentiated caching strategies are set, learning progress is monitored in real time to trigger pre-caching, time series prediction and cache preheating mechanism are combined, a multi-level cache architecture is used to optimize cache performance, and cache capacity and strategy are dynamically adjusted.
It significantly improves the access efficiency of educational resources, improves students' learning experience, optimizes system resource utilization, and provides strong support for personalized learning.
Smart Images

Figure CN120768950A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of information technology, and in particular to a lightweight micro-service architecture rapid deployment and elastic expansion method in education. BACKGROUND
[0002] In the education platform, the cache strategy design of course content faces many technical challenges. First, how to realize efficient distributed cache under the micro-service architecture needs to consider the relevance between courses and the learning path of students. The trigger condition of pre-cache not only depends on the progress of students completing a certain course, but also needs to consider the correlation strength between multiple courses. Second, at the application level, students' individual learning paths are different, and how to dynamically adjust the preheating strategy and the priority of cache content according to each student's historical learning data and behavior patterns is a complex decision-making problem. In addition, in the process of cache preheating, the timeliness and storage cost of cache need to be balanced, that is, to ensure that students can quickly access the required learning resources, and to avoid excessive caching leading to waste of storage space. At the same time, among multiple micro-services and application nodes, how to coordinate the update and invalidation of cache to ensure the consistency and accuracy of cache data is also a difficult problem to be solved. In summary, the cache strategy design of the education platform needs to balance performance, cost, consistency and other dimensions to find the optimal balance point to provide students with a smooth and efficient learning experience. SUMMARY
[0003] The present application provides a lightweight micro-service architecture rapid deployment and elastic expansion method in education, mainly including:
[0004] Based on the historical learning data of students, the correlation between different courses is determined in the data analysis micro-service using association rule mining algorithm, the course pairs with correlation higher than the preset correlation threshold are marked, and stored in the associated course database;
[0005] Based on the course pairs in the associated course database, the learning path of students is analyzed, and the analyzed learning path is stored in the learning path pattern library;
[0006] According to the learning path, the learning behavior data of students in different time periods is counted, and the students are classified in the user portrait micro-service using clustering algorithm to obtain student groups with different learning speeds and learning modes, and different cache strategies are set for different groups;
[0007] According to the differential cache strategy, the completion progress of students in each course is monitored in real time, when the students complete the preset key milestone in the course, the pre-cache mechanism of associated courses is triggered, and the cache arrangement micro-service coordinates the pre-cache of the first two units of associated course content in the distributed cache layer of the system;
[0008] For the pre-caching mechanism, the historical login time interval of the student is recorded, the time point of the next login of the student is predicted through a time series prediction method, and the cache warm-up mechanism is started within a certain time range before the predicted login time, so that the required resources of the student are cached in advance to the local;
[0009] During the execution of the cache warm-up mechanism, the number and time span of the currently preloaded resources are determined according to the learning speed and learning mode of the student, and the current network condition and device performance;
[0010] For the preloaded resources, a cache update strategy based on time decay is adopted, different valid periods are set according to the time sensitivity of different types of educational resources, a short valid period is used for time-sensitive resources, and a long valid period is used for resources with low time sensitivity;
[0011] According to the cache update strategy, the hit rate and space usage of each cache node are continuously tracked, the cache eviction strategy is set, and the cache capacity and eviction threshold are dynamically adjusted, so that cache monitoring and optimization are realized.
[0012] Based on the cache optimization result, a multi-level cache architecture is established, different granularities and scales of caches are set at different levels, including the user end, the edge node and the center node, and through hierarchical cache coordination and data synchronization, global optimization and load balancing of the cache system are realized.
[0013] The technical scheme provided by the embodiment of the application can include the following beneficial effects:
[0014] The application discloses a lightweight micro-service architecture in education rapid deployment and elastic expansion method. The application analyzes the historical learning data of students, mines the correlation between courses and the learning path mode, and classifies students. According to the learning characteristics of different student groups, a differentiated cache strategy is set. When a student completes a course key milestone, the pre-caching mechanism of the associated course is triggered. At the same time, the application predicts the next login time of the student and starts the cache warm-up in advance. During the warm-up process, the preloaded resources are dynamically adjusted according to the student characteristics and the current network condition. A time decay-based update strategy is used for the cache resources, and the cache performance is continuously optimized. Finally, the application establishes a multi-level cache architecture, sets caches of different granularities at the user end, the edge node and the center node, and realizes global optimization and load balancing. Through intelligent analysis and multi-level cache strategy, the application significantly improves the access efficiency of educational resources, improves the learning experience of students, optimizes the system resource utilization, and provides strong support for personalized learning. BRIEF DESCRIPTION OF DRAWINGS
[0015] Fig. 1A flow chart of a lightweight micro-service architecture in education rapid deployment and elastic expansion method.
[0016] Fig. 2 A schematic diagram of a lightweight micro-service architecture in education rapid deployment and elastic expansion method.
[0017] Fig. 3 Another schematic diagram of a lightweight micro-service architecture in education rapid deployment and elastic expansion method. DETAILED DESCRIPTION
[0018] In order for those skilled in the art to better understand the technical solutions in the specification, the technical solutions in the specification will be clearly and completely described below in conjunction with the drawings in the specification. Obviously, the described embodiments are only part of the embodiments of the specification, not all. Based on the embodiments in the specification, all other embodiments obtained by those skilled in the art without creative labor should be within the scope of protection of the specification.
[0019] As Figs. 1-3 The lightweight micro-service architecture in education rapid deployment and elastic expansion method can specifically include:
[0020] In step S101, based on the historical learning data of students, the correlation between different courses is determined in the data analysis micro-service using the association rule mining algorithm. The course pairs with a correlation higher than a preset correlation threshold are marked and stored in the associated course database.
[0021] Obtain student historical learning data, the student historical learning data including course learning records, score distribution and learning duration; clean and standardize the student historical learning data to obtain a standardized student learning data set; apply an Apriori association rule mining algorithm to the standardized learning data set to generate a frequent item set; extract strong association rules from the frequent item set, calculate the support, confidence and lift indicators between course pairs, and obtain a course association matrix; filter the course association matrix according to a preset correlation strength threshold to select course pairs with a correlation strength higher than the threshold, and obtain high correlation strength course pairs; perform multi-dimensional attribute labeling on the high correlation strength course pairs to generate structured data containing course ID, correlation strength and multi-dimensional attribute labels.
[0022] Specifically, historical student learning data, including course learning records, grade distribution, and study time, was extracted from the student information system database. The raw data was cleaned and standardized, with the Z-score method used to address outliers and the mean imputed to address missing values. The processed dataset was then structured by student ID and course ID to form a standardized dataset for subsequent analysis. The standardized student learning dataset was then subjected to the Apriori association rule mining algorithm, with a minimum support of 0.05 and a minimum confidence of 0.7. The association rule mining was implemented using the Python mlxtend library. Frequent item sets were generated and strong association rules were extracted. By calculating the support, confidence, and lift metrics between course pairs, numerical indicators reflecting the strength of course correlation were obtained, and a course correlation matrix was constructed. The course correlation matrix was filtered according to a pre-set correlation strength threshold to identify course pairs with correlation strengths above the threshold. These highly correlated course pairs were then labeled and categorized. Multidimensional attribute annotations were then applied to the associated course pairs based on subject area, difficulty level, and prerequisites, generating structured data containing course IDs, correlation strengths, and multidimensional attribute labels. The generated structured data is converted into a format suitable for graph database storage. Neo4j graph database storage technology is used to build a course-related knowledge graph. Courses are treated as nodes in the graph, and the relationships between courses are treated as edges. The weights of the edges represent the strength of the relationship. The attributes of the nodes and edges store the corresponding label information. Cypher query statements are used to support complex queries and analysis based on course relationships, such as MATCH(c1:Course)-[r:RELATED_TO]-
[0023] >(c2:Course) WHERE r.strength > 0.8 RETURN c1.name, c2.name, r.strength ORDER BY r.strength DESC LIMIT 10, thus providing data support for subsequent personalized course recommendation and learning path planning. The data analysis function is deployed as a separate microservice, communicating with other microservices through RESTful APIs, achieving decoupling and independent expansion of the course correlation analysis function. In the data preprocessing stage, learning data is extracted from the student information system database, including course ID, student ID, learning duration, and score fields. The original data is cleaned, and the Z-score method is used to handle outliers, treating data deviating from the mean by more than three standard deviations as outliers and deleting them. Missing values are handled using mean imputation, such as filling missing values in the learning duration field with the average learning duration of the course. In the standardization process, scores are converted to a percentage system, and learning duration is converted to hours. The processed dataset is structured and organized by student ID and course ID, forming a standardized dataset. The Apriori association rule mining algorithm is applied to analyze course correlation, setting the minimum support at 0.05 and the minimum confidence at 0.7. The mlxtend library in Python is used to implement association rule mining, generating frequent itemsets and extracting strong association rules. The support, confidence, and lift indices between course pairs are calculated, such as the support of course A and course B being 0.1, the confidence being 0.8, and the lift being 2.5, indicating that the two courses have strong correlation. A course correlation matrix is constructed, with each element in the matrix representing the correlation strength between two courses. Set the correlation strength threshold to 0.6, and filter out course pairs with correlation strength higher than the threshold. Multi-dimensional attribute labeling is performed on high-correlation course pairs, such as labeling "Data Structure" and "Algorithm Design" as computer science fields, with a medium difficulty level, and "Data Structure" as a prerequisite for "Algorithm Design". Structured data containing course ID, correlation strength, and multi-dimensional attribute labels is generated. The structured data is converted into a format suitable for storing in a Neo4j graph database, and a course correlation knowledge graph is constructed. Courses are treated as nodes in the graph, and the correlation between courses is treated as edges, with edge weights representing correlation strength. Cypher query statements are used to support complex queries and analysis, such as MATCH (c1:Course)-[r:RELATED_TO]-
[0024] >(c2:Course) WHERE r.strength > 0.8 RETURN c1.name, c2.name, r.strength ORDER BY r.strength DESCLIMIT 10, which queries the top 10 pairs of courses with a correlation strength greater than 0.8. The data analysis function is deployed as a standalone microservice, which communicates with other microservices through RESTful APIs. The API interface design includes / api / v1 / courses / related / {courseId} for retrieving related courses for a specified course and / api / v1 / courses / recommend / {studentId} for recommending courses based on a student's learning history. The microservice architecture enables decoupling and independent scaling of the course correlation analysis function, improving the maintainability and scalability of the system.
[0025] In step S102, the learning path of the student is analyzed based on the course pairs in the correlation course database, and the analyzed learning path is stored in a learning path pattern library.
[0026] The course pair information in the correlation course database is obtained, and the course pair information includes course ID, correlation strength, and attribute label; the correlation course table and the student course record table are connected according to the course pair information, the learning sequence is generated by sorting according to the timestamp, and the learning sequence includes student ID, course ID list, and corresponding timestamp; the learning sequence is analyzed, the minimum support threshold is set to a preset value, the equivalence class is generated, and the equivalence class principle is used to find the frequent sequence pattern; the frequent sequence pattern is post-processed and screened, the support, confidence, and promotion degree indexes of each path are calculated, if the path length is greater than a preset value and the support is greater than a preset threshold, the effective learning path is determined; and the effective learning path is stored in the database.
[0027] Specifically, course pair information including course ID, association strength, and attribute tags is extracted from the association course database. Combining with the student's course selection records, the association course table and student course selection record table are connected using SQL statements, sorted by timestamp to generate learning sequences, and build student learning sequence dataset. Each sequence contains student ID, course ID list, and corresponding timestamp. The data is cleaned and preprocessed to remove duplicate records and invalid data. SPADE sequence pattern mining algorithm is used to analyze the learning sequence dataset, with minimum support threshold set to 0.05 and maximum sequence length set to 10. The original sequence is converted to vertical format through vertical data format conversion, equivalence classes are generated, and equivalence class principle is used to quickly find frequent sequence patterns, obtaining a series of representative learning path patterns. The mined learning path patterns are post-processed and filtered, and the support, confidence, and lift indicators of each path are calculated. The support represents the frequency of path appearance, the confidence represents the reliability of the path, and the lift represents the relevance of the path. Invalid paths with path length less than 3 courses or support less than 0.01 are removed, and valid learning paths that meet the course prerequisite relationship and subject logic are retained. The retained learning paths are encoded and labeled, and each path is assigned a unique identifier and description information. The processed learning path patterns are stored in the MongoDB database for persistence, and Redis is used as a distributed cache. Hash structure is used to store path data, with path ID as key and path detailed information JSON string as value. The cache expiration time is set to 1 hour to implement the periodic update strategy. RESTful style API interface is designed and implemented to provide path query, recommendation, and update functions. The API includes / api / v1 / paths / {studentId} for getting learning path recommendations suitable for specific students, / api / v1 / paths / update for updating learning path pattern library, and JWT for identity authentication and authorization. The token is included in the request header, and the server verifies the validity and authority of the token to ensure the security and scalability of the API. Course pair information is extracted from the association course database using the SQL statement: SELECT course ID, association strength, attribute tags FROM association course table JOIN student course selection record table ON association course table.course ID = student course selection record table.course ID ORDER BY student ID, course selection timestamp ASC to generate learning sequences. This query statement connects the association course table and student course selection record table through course ID and sorts them by student ID and course selection timestamp in ascending order, obtaining the course selection order of each student and their association strength and attribute tags.The constructed student learning sequence dataset contains student ID, course ID list and corresponding timestamp, such as {student ID: 1001, course sequence: [C001, C002, C003], timestamp: [1625097600, 1627776000, 1630454400]}. In the data preprocessing stage, duplicate records and invalid data such as empty course ID or abnormal timestamp records are deleted. The SPADE algorithm first converts the original sequence into vertical data format, such as.
[0028] {C001: [1, 2, 3], C002: [1, 2], C003: [2, 3]}, indicating that course C001 appears in sequences 1, 2 and 3. Then equivalence classes are generated, such as equivalence classes [C001], [C002], [C003] with length 1, equivalence classes [C001, C002], [C001, C003] with length 2, etc. Frequent sequence patterns are quickly discovered through equivalence classes, and learning path patterns such as [C001, C002, C003] are obtained. The support (frequency of occurrence), confidence (reliability) and lift (correlation) of the mined learning path patterns are calculated, such as path
[0029] [C001, C002, C003] has a support of 0.03, a confidence of 0.75 and a lift of 1.5. Remove paths with length less than 3 or support less than 0.01, and keep valid paths that meet the course prerequisite relationship. Store the processed learning path patterns in the MongoDB database, with collection structure
[0030] {_id: ObjectId(), pathId: "P001", sequence: ["C001", "C002", "C003"], support: 0.03, confidence: 0.75, lift: 1.5}. At the same time, use Redis as a distributed cache, store path data in a hash structure, and set the expiration time EXPIREpath: P0013600. Implement RESTful API interface / api / v1 / paths / {studentId}, match the most suitable learning path through student historical learning data, and return the recommended path in JSON format. Use JWT for identity verification, include BearerToken in the request header, and the server parses the token to verify validity and permissions to ensure API security.
[0031] Step S103, according to the learning path, the learning behavior data of students in different time periods is counted, and clustering algorithm is used in user portrait microservice to classify students, obtaining student groups with different learning speed and learning mode, and setting differentiated caching strategy for different groups.
[0032] According to the data in the learning path mode library, combined with the actual course selection records of students, the learning behavior data of each student in different time periods is counted to obtain a time sequence learning behavior feature vector of the student; the time sequence learning behavior feature vector includes daily average learning time, number of courses completed per week, and monthly average performance indicators. Cluster analysis is performed on the time sequence learning behavior feature vector, the number of clusters is set to a preset value, and the Euclidean distance is used as the similarity measure; the center point is initialized by the K-means algorithm, the center point position is iteratively updated until the center point position changes less than a preset threshold or the maximum number of iterations is reached. According to the clustering result, the students are divided into fast learning type, stable progress type, fluctuation type, slow learning type and potential difficulty type groups; for different student groups, a differentiated cache strategy and parameters are set. A dynamic cache management mechanism is implemented in the user portrait micro service, and the cache parameters are dynamically adjusted according to the characteristics of the student groups. Through the ApacheKafka message queue, the student group classification results are synchronized to the cache management module in real time, and the cache strategy is updated in real time.
[0033] Specifically, according to the data in the learning path pattern library, combined with the actual course selection records of students, the learning behavior data of each student in different time periods is counted, including course completion speed, learning time, homework submission situation and test scores and other indicators. These data are aggregated according to daily, weekly and monthly granularity to obtain the time series learning behavior feature vector of students, including daily average learning time, weekly course completion number, monthly average score and other indicators. The K-means clustering algorithm is used to cluster analyze the time series learning behavior feature vector of students, the number of clusters is set to 5, the Euclidean distance is used as the similarity measure, the center point is initialized by the K-means++ method, the center point position is iteratively updated until the center point position changes less than a preset threshold or reaches a maximum iteration number, and finally the clustering result is obtained by minimizing the within-cluster sum of squares (WCSS), and the students are divided into five groups: fast learning type, stable progress type, fluctuation type, slow learning type and potential difficulty type. For different student groups, differentiated caching strategies and parameters are designed. For the fast learning type group, 1GB cache capacity and 30 minute cache expiration time are set; for the slow learning type and potential difficulty type groups, 256MB cache capacity and 2 hour cache expiration time are set to provide stable learning resource support. The dynamic cache management mechanism is implemented in the user portrait microservice, the maxmemory and maxmemory-policy configurations of Redis are used to control memory occupation and eviction policy, and the cache parameters are dynamically adjusted according to the characteristics of the student groups. The student group classification results are synchronized to the cache management module in real time through the Apache Kafka message queue to realize real-time updating and optimization of the cache strategy. The user portrait microservice interacts with other microservices through the RESTful API interface and uses distributed transactions to ensure data consistency. The data is extracted from the learning path pattern library and combined with the student course selection records to count the learning behavior data. The daily average learning time is calculated as Σ(daily learning time) / number of days, the weekly course completion number is Σ(completed courses in a week) / number of weeks, and the monthly average score is Σ(all test scores in a month) / number of tests. The time series learning behavior feature vector contains [8.5,3,85], which represents 8.5 hours of daily learning, 3 courses completed per week, and 85 points of monthly average score. The K-means clustering algorithm initializes the K-means++ method, randomly selects the first center point, and selects points far from existing center points for subsequent center points. The maximum iteration number is set to 100 and the center point position change threshold is set to 0.001. The WCSS calculation formula is Σ(point to cluster center distance square), and the clustering result with the smallest WCSS is selected.After clustering, we found five groups: fast learning (centers [10, 4, 90]), stable progress (centers [8, 3, 85]), volatile (centers [7, 2.5, 80]), slow learning (centers [6, 2, 75]), and potentially difficult (centers [4, 1, 65]). In cache policy design, the fast learning group sets Redismaxmemory to 1073741824 (1GB), maxmemory-policy to allkeys-lru, and expiration to 1800 seconds (30 minutes). The slow learning and potentially difficult groups set maxmemory to 268435456 (256MB), maxmemory-policy to volatile-lru, and expiration to 7200 seconds (2 hours). The Apache Kafka topic is set to "student_group_update," with a partition count of 3 and a replication factor of 2 to ensure reliable message delivery. The user profile microservice is implemented in Spring Cloud and uses the Eureka service registry, Ribbon load balancing, Hystrix circuit breakers, and the Feign declarative REST client to interact with other microservices. Distributed transactions are implemented using the two-phase commit protocol (2PC) to ensure cross-service data consistency.
[0034] In step S104, based on the differentiated caching strategy, the student's progress in completing each course is monitored in real time. When the student completes the key milestone preset in the course, the pre-caching mechanism of the associated course is triggered. The cache orchestration microservice coordinates the pre-caching of the first two units of the associated course content in the distributed cache layer of the system.
[0035] A message queue is used to receive student learning behavior data in real time, and the real-time completion progress of students in various courses is calculated to obtain the students' course completion progress data; based on the course completion progress data, it is determined whether the students have reached pre-defined key course milestones, wherein the determination is performed using a Bloom filter; if the students have reached the key course milestones, a pre-caching event for the associated course is triggered; a cache orchestration microservice is used to receive the pre-caching event and query the course association relationship map stored in the Neo4j graph database; based on the course association relationship map, a Cypher query language is used to determine a list of associated courses that need to be pre-cached, calculate the cache priority and cache content range of each associated course, and generate a pre-caching task queue; after receiving the pre-caching task queue, a multi-level cache structure is used to load high-priority cache content into a memory cache, and the memory cache is used to store the high-priority cache content.
[0036] Specifically, according to the differentiated caching strategy of the student group, the course completion progress monitoring threshold is set, the message queue is used to receive the student learning behavior data in real time, Apache Flink is used for stream processing to calculate the real-time completion progress of each student in each course, the calculation result is stored in the Redis in-memory database, and millisecond-level progress query and update are realized. The key milestones of the course are defined in advance, including the completion of the course unit, the passing of the important examination and the submission of the project, etc. These milestone information is stored in the distributed key-value storage, and the Bloom filter is used to quickly judge whether the student has reached the key milestone. The expected number of elements is set to 1 million, and the false positive rate is 0.01. If it is reached, the pre-caching event of the associated course is triggered, and the event is transmitted to the cache arrangement microservice through Spring Cloud Stream. The cache arrangement microservice receives the pre-caching event, queries the course association graph stored in the Neo4j graph database, uses the Cypher query language to determine the list of associated courses that need to be pre-cached, calculates the cache priority and cache content range of each associated course according to the caching strategy of the student group, and generates a pre-caching task queue. The distributed cache layer receives the pre-caching task queue, uses a multi-level cache structure, uses Caffeine as the in-memory cache, loads the high-priority cache content into the in-memory cache, uses RocksDB as the SSD cache storage to store the medium-priority content, and saves the low-priority content in the HDD cache. Through the cache preheating mechanism, the contents of the first two units of the associated course are loaded in advance to improve the cache hit rate. In the implementation of the differentiated caching strategy, the progress monitoring threshold of the fast learning group is set to 10%, and the slow learning group is set to 25%. The Apache Flink Job program calculates the learning progress with a 1-second window, such as student A completing 15 out of 50 math problems, with a progress of 30%. The calculation result is stored in Redis, with the key format "studentId:courseId:progress" and the value as a floating-point number. The course key milestone definition is stored in Etcd, with the key "courseId:milestoneId" and the value as a JSON format milestone description. The Bloom filter capacity is set to 1,000,000, using 3 hash functions, with a total of 9,585,060 bits, reaching a false positive rate of 0.01. When the milestone is detected, Spring Cloud Stream sends a message to "precache-topic". The cache arrangement microservice subscribes to the topic and queries the Neo4j graph database after receiving the message. The query statement is "MATCH(c:Course{id:$courseId})-[r:RELATED_TO]- (c2:Course)<-
[0037] >(rc:Course) RETURN rc.id, r.weight ORDER BY r.weight DESC LIMIT 5" to get the top 5 related courses by weight. The cache priority formula is:
[0038] priority=relationship_weight*0.7+student_progress*0.3, with a result range of 0-1. The Caffeine cache is configured with a maximum capacity of 10,000 entries and an expiration time of 30 minutes. The RocksDB cache is configured with a block cache size of 64 MB and a write buffer size of 32 MB. The cache is pre-warmed by loading the first two units of the associated courses, approximately 50 MB of content, into the corresponding level of cache in an asynchronous manner to improve first access speed.
[0039] In step S105, for the pre-caching mechanism, the historical login time interval of the student is recorded, and the time point of the next login of the student is predicted by a time series prediction method. Within a certain time range before the predicted login time, the cache pre-warming mechanism is started to cache the required resources of the student in advance.
[0040] A distributed time series database is used to store the historical login time data of the student. The distributed time series database obtains the student login event from a real-time message queue and writes the student login timestamp and student identification number according to the student login event. Time series analysis is performed on the student login timestamp to obtain student login time interval data. A seasonal time series prediction model is established based on the student login time interval data. The seasonal time series prediction model uses a grid search method to determine the optimal parameter combination. The next login time point of the student is predicted based on the seasonal time series prediction model. The next login time point is calculated based on the latest login time of the student, and the confidence interval of the next login time point is determined. The next login time point and the confidence interval are stored in a key-value database, with the key being the student identification number and the value being the prediction information containing the next login time point and the confidence interval. A distributed task scheduler is used to periodically scan the next login time point. If the time difference between the current time and the next login time point is less than a preset threshold, a resource cache pre-warming mechanism is triggered to obtain learning resources from a content distribution network and store them in local storage.
[0041] In particular, the InfluxDB distributed time series database is used to store the historical login time data of students, the login events of students are received in real time through the message queue, the login timestamp and student ID are written into the InfluxDB, the time interval between the adjacent two logins is calculated using the InfluxQL query statement, and the time series data set is generated. The SARIMA time series prediction algorithm is used to model the login time interval of each student, considering the seasonal factor, the value range of model parameters p, d, q, P, D, Q is set to 0 to 2, the seasonal period S is set to 7, all parameter combinations are traversed through the grid search method, the model performance is evaluated using the AIC criterion, and the parameter combination with the smallest AIC value is selected as the optimal parameter. The personalized SARIMA model of each student is trained. According to the trained SARIMA model, combined with the latest login time of the student, the time point of the next login and its 95% confidence interval are predicted, and the prediction results are stored in the Redis key-value storage, the key is the student ID, and the value is the prediction information in JSON format, including the predicted next login timestamp and confidence interval. The pre-caching trigger time threshold is set to 30 to 60 minutes before the predicted login time, the predicted login time is scanned every 5 minutes by the Quartz distributed task scheduler, if the difference between the current time and the predicted login time falls within the trigger time threshold, the cache warm-up mechanism is triggered, the learning resources of the next unit of the student are obtained from the content distribution network according to the learning progress and course arrangement of the student, and the resources are cached to the local SSD storage. If the prediction fails or the resource acquisition fails, an exception log is recorded and the alarm mechanism is triggered. The InfluxDB database configuration uses the TSM engine, the data retention policy is set to 30 days, the login event is received through the HTTP API, the data point format is measurement "login_events", tag student_id, and field timestamp. The InfluxQL query
[0042] "SELECT time, student_id FROM login_events WHERE student_id = 'S001' ORDER BY time DESC LIMIT 2" to get the latest two login times and calculate the time interval. The SARIMA model parameter search range is set to p, d, q, P, D, Q ∈ [0, 1, 2], S = 7, a total of 972 combinations, each parameter group is evaluated using the rolling prediction method, and the AIC value is calculated. For student S001, the optimal parameters are (1, 1, 1) (1, 1, 1, 7), and AIC = -234.5. The prediction result is stored in Redis, the key is "login_prediction: S001", and the value is
[0043] {"next_login":1621234567,"lower_bound":1621230967,"upper_bound":1621238167}. The Quartz task is configured with cron expression "0 * / 5 ***?" to execute every 5 minutes. If the current time is 1621233567, which is less than 60 minutes from the predicted login time 1621234567, the cache warm-up is triggered. The current progress of student S001 is queried as "Math Course Unit 3", and the "Math Course Unit 4" resource of about 500MB is obtained from the CDN and cached to the / cache / S001 / directory on the local SSD. If an exception occurs, such as a prediction interval that is too large (more than 4 hours), an error log "Error: Prediction interval too large for student S001" is recorded, and an alarm message is sent to the operation and maintenance system through the message queue.
[0044] In step S106, during the execution of the cache warm-up mechanism, the number and time span of resources currently preloaded are determined according to the student's learning speed and learning mode, as well as the current network status and device performance.
[0045] The learning speed and learning mode data of the student are obtained, and time series analysis is performed through an ARIMA model to obtain the average learning speed and learning duration of the student. According to the average learning speed and learning duration, in combination with the current course progress, the number and type of resources involved by the student in the next learning period are predicted, and the expected learning duration and resource usage are determined. The network status of the student's device is detected in real time to obtain the bandwidth, delay and packet loss rate, and the CPU usage, memory occupation and storage space device performance indicators are obtained. If the device performance indicators meet the preset threshold, a resource preloading decision model is constructed, the input features including learning speed, predicted learning duration, network bandwidth and device storage space are normalized and one-hot encoded. According to the output result of the decision model, a predetermined number of learning resources are obtained from the content distribution network and stored in the local cache of the student's device.
[0046] Specifically, the learning speed and learning mode data of the student are obtained from the user portrait database, time series analysis is performed through the ARIMA model, the average learning speed and learning duration of the student are calculated, the number and type of resources that the student may involve in the next learning period are predicted in combination with the current course progress, and the prediction result includes the expected learning time and resource usage. The network status of the student's device is detected in real time using ping and traceroute tools, including bandwidth, delay and packet loss rate, while CPU usage, memory occupation and storage space and other device performance indicators are obtained through the sigar library to comprehensively evaluate the resource loading capacity of the current device. According to the learning characteristics and device status of the student, a resource preloading decision model is constructed using the CART decision tree algorithm, the input features include learning speed, predicted learning time, network bandwidth, device storage space, etc., the features are normalized and one-hot encoded, the optimal split point is selected through the Gini index, the decision tree model is constructed, and the number and time span of preloaded resources are output. According to the output result of the decision model, a threshold is set based on the output confidence to determine the specific number and time range of preloaded resources, a predetermined number of learning resources are obtained from the content distribution network, the resources are stored in the local cache of the student's device through HDFS, and a directory hierarchy structure
[0047] / user / {student_id} / {course_id} / {resource_id} organizes files, sets the replica factor to 2, and sets the expiration time of the resource to 1.5 times the predicted learning duration, regularly cleans up expired or unused cache content, triggers an exception handling mechanism when network interruption or insufficient storage space occurs, suspends preloading and sends alarm information. The learning data of student S001 is obtained from the user portrait database, showing an average of 2.5 hours of learning per day for 45 days. The ARIMA(1,1,1) model is used to fit the historical data, predicting the next learning period to be 7 days, with an expected learning duration of 20 hours and a resource usage of about 1.5GB. The ping tool detects a network delay of 50ms, and the traceroute tool shows that the data packet takes 5 hops to reach the target server with an average bandwidth of 10Mbps. The sigar library collects CPU usage of 30%, available memory of 2GB, and remaining storage space of 10GB. In the CART decision tree algorithm, the learning speed is normalized to the range of 0-1, and the network bandwidth is encoded into three categories including low speed <5Mbps, medium speed 5-20Mbps, and high speed >20Mbps. The depth of the decision tree is set to 5, and the minimum sample split number is 100. The optimal parameters are selected through cross-validation. The model output preloads 500MB of resources for a time span of 24 hours. Based on a confidence threshold of 85%, the actual preloaded resource is determined to be 425MB. The HDFS block size is configured to be 64MB, the replica factor is 2, and the storage path is / user / S001 / MATH101 / resource_20230501. The resource expiration time is set to 30 hours, which is 20*1.5. When insufficient storage space (available space less than 1GB) is detected, the cleaning mechanism is triggered to delete the oldest created cache file until the available space is greater than 2GB.
[0048] In step S107, for the preloaded resources, a cache update strategy based on time decay is adopted, and different valid periods are set according to the time sensitivity of different types of educational resources. Short valid periods are used for time-sensitive resources, while long valid periods are used for resources with low time sensitivity.
[0049] According to the content characteristics and the update frequency of the education resources, the preloaded resources are divided into three categories of strong real-time, periodic update and long-term stability, and the validity period of the resources is set. The current validity score of the resources is calculated by using an exponential decay model, wherein the exponential decay model is S(t)=S0*e^(-λt), S0 is an initial importance, λ is a decay coefficient, and t is a cache time length. A dynamic cache management mechanism is realized, and the resources in the cache are scanned once every fixed time to calculate the validity score of each resource and determine whether the validity score is lower than a preset threshold. If the validity score is lower than the preset threshold, the latest version of the resource is obtained from a source server. After obtaining the latest version of the resource, the local cache is updated, and the cache time of the resource is reset. A cache optimization scheduler is constructed, the cache optimization scheduler uses a Q-learning reinforcement learning algorithm to dynamically adjust the cache strategy, wherein the state space includes the resource type, the access frequency and the storage space occupation, and the action space includes active pre-update and passive on-demand update. According to the optimal strategy learned by the cache optimization scheduler, the execution of the cache update operation is guided, wherein for the resources with frequent access and low update cost, an active pre-update strategy is adopted to refresh the resources that will expire in advance.
[0050] Specifically, an education resource classification system is established, and the preloaded resources are divided into three categories of high, medium and low time sensitivity according to the content characteristics and update frequency of the resources. The resource attributes are defined in XML format, including resource ID, category, update frequency and other information. The validity period of real-time resources such as real-time news is set to 1 hour, the validity period of periodically updated resources such as weekly tests is set to 7 days, and the validity period of long-term stable resources such as historical documents is set to 30 days. A cache update function based on time decay is designed, and an exponential decay model S(t) = S0*e^(-λt) is used to calculate the current validity score of the resource, where S0 is the initial importance, λ is the decay coefficient, and t is the cache time. The corresponding parameter values are determined according to the characteristics of different types of resources, such as λ = 0.1 for real-time resources, λ = 0.01 for periodically updated resources, and λ = 0.001 for long-term stable resources. A dynamic cache management mechanism is implemented, which scans the resources in the cache every 10 minutes to calculate the validity score of each resource. When the score is lower than the preset threshold, the update operation is triggered. The preset threshold is dynamically calculated based on the resource type and historical access data, such as a threshold of 0.8 for real-time resources, a threshold of 0.6 for periodically updated resources, and a threshold of 0.4 for long-term stable resources. The latest version of the resource is obtained from the source server, the local cache is updated, and the cache time of the resource is reset. If the source server cannot be accessed or the update fails, an error log is recorded and the original cache is preserved. A cache optimization scheduler is built, and the Q-learning reinforcement learning algorithm is used to dynamically adjust the cache strategy. The state space includes resource type, access frequency, storage space occupation, etc., and the action space includes proactive pre-update and passive on-demand update. For frequently accessed and low-cost updated resources, the proactive pre-update strategy is adopted, and the resources that will expire in 30 minutes are refreshed in advance. For resources with low access frequency or high update cost, the passive on-demand update strategy is adopted. The cache optimization scheduler works with the dynamic cache management mechanism to guide the execution of cache update operations according to the optimal strategy learned. In the education resource classification system, taking the mathematics course as an example, "real-time mathematics news" is marked as high time sensitivity, and the XML format is
[0051] <resourceid = "M001" type = "realtime" update_frequency = "hourly" / > with a validity period of 1 hour; "weekly mathematics test" is medium time sensitivity, and the XML is
[0052] <resourceid = "M002" type = "periodic" update_frequency = "weekly" / > with a validity period of 7 days; "mathematics history" is low time sensitivity, and the XML is
[0053] <resourceid="M003"type="stable"update_frequency="monthly" / >, valid for 30 days. Apply the exponential decay model to resource M001, with initial importance S0 = 1, λ = 0.1, cache duration t = 2 hours, and calculate the current validity score S(2) = 0.819. The dynamic cache management mechanism scans every 10 minutes and finds that the score of M001 is lower than the preset threshold of 0.8, triggering the update operation. If the update fails, the error log record is "Error: Failed to update resource M001 at 2023-05-01 14:30:00". The cache optimization scheduler uses the Q-learning algorithm, and the state space is
[0054] {resource_type,access_frequency,storage_usage}, such as
[0055] {realtime, high, low}, and the action space is {preupdate, ondemand}. The Q-table is initialized with a zero matrix, a learning rate of α = 0.1, and a discount factor of γ = 0.9. After 1000 rounds of training, the optimal action learned for the state {realtime, high, low} is preupdate, which uses an active pre-update strategy for M001, triggering an update 30 minutes before expiration. The scheduler communicates this decision to the dynamic cache management mechanism, instructing it to perform the update operation.
[0056] Step S108: Based on the cache update strategy, the hit rate and space usage of each cache node are continuously tracked, a cache eviction strategy is set, and the cache capacity and eviction threshold are dynamically adjusted to achieve cache monitoring and optimization.
[0057] Performance indicators of cache nodes are collected in real time, and the performance indicators include cache hit rate, space utilization rate and request latency; resource weights are calculated based on the performance indicators, and the calculation formula of the resource weight W is W=α*(1 / T)+β*F, where T is the last access time, F is the access frequency, and α and β are adjustment factors; if the cache space utilization rate exceeds a preset threshold, the resource with the lowest weight value is evicted based on the resource weight; historical load data of the cache node is obtained, and the ARIMA model is used to predict future cache demand; the cache capacity upper limit of the cache node is dynamically adjusted according to the prediction results; monitoring data, eviction policy results and capacity adjustment results of the cache node are received, and the monitoring data, eviction policy results and capacity adjustment results are input into the DQN neural network; cache optimization actions are determined based on the output results of the DQN neural network, and the cache optimization actions include adjusting the eviction threshold, weight calculation factor and capacity adjustment range; and the cache optimization actions are executed to achieve adaptive optimization of the cache node.
[0058] Specifically, a distributed cache monitoring system is implemented by deploying Prometheus monitoring agents on each cache node to collect performance metrics such as cache hit rate, space usage, and request latency in real-time. The collected data is sent to the central monitoring server through a message queue, and the server side aggregates and analyzes the running status of each node. If the monitoring data is abnormal, an alarm mechanism is triggered and logs are recorded. An adaptive cache eviction algorithm is designed, combining LRU (Least Recently Used) and LFU (Least Frequently Used) strategies, using a weight calculation formula W = α * (1 / T) + β * F, where T is the last access time, F is the access frequency, and α and β are adjustment factors. When the cache space usage exceeds the preset threshold, the resource with the lowest weight value is preferentially evicted, while considering the time sensitivity of the resource, and appropriately reducing the eviction probability of resources with high time sensitivity. A dynamic cache capacity adjustment mechanism is built, based on the hardware configuration and historical load of the node, using the ARIMA model to predict the cache demand in the future period. The ARIMA model parameters (p, d, q) are set to (1, 1, 1), and the least squares method is used to estimate the model parameters. According to the prediction result, the upper limit of the cache capacity of each node is dynamically adjusted, automatically expanding during peak load and automatically shrinking during idle time, achieving flexible utilization of resources. A cache optimization decision engine is developed, integrating monitoring data, eviction strategies, and capacity adjustment results, using the DeepQ-Network (DQN) algorithm to continuously optimize cache parameters, including eviction threshold, weight calculation factor, and capacity adjustment amplitude. DQN uses a three-layer fully connected neural network, with the input layer receiving monitoring indicators and current cache parameters, the hidden layer using ReLU activation function, and the output layer corresponding to different optimization actions. Through repeated trial and error and reward and punishment mechanism, the overall performance and resource utilization efficiency of the cache system are continuously improved. The decision engine guides the capacity adjustment mechanism based on the DQN output result, achieving adaptive cache optimization. Prometheus monitoring agents collect data every 15 seconds on cache nodes, including cache hit rate (e.g., 85%), space usage (e.g., 75%), and average request latency (e.g., 20ms). Data is transmitted to the central server through the RabbitMQ message queue, and InfluxDB is used to store time series data. The monitoring exception judgment standard is that the hit rate is lower than 60% or the space usage exceeds 90% for more than 5 minutes. In the adaptive cache eviction algorithm, α is set to 0.7 and β is set to 0.3, resulting in a weight of 0.85 for resource A and a weight of 0.62 for resource B. When the cache space usage exceeds 80%, the eviction mechanism is triggered, preferentially evicting resource B with lower weight. The ARIMA model uses the past 7 days of historical data for training to predict the cache demand in the next 24 hours. The model parameter estimation result is AR(1) coefficient 0.8, MA(1) coefficient 0.3, and difference order 1. The prediction result shows that the cache demand will increase by 20% in the next hour, and the cache capacity is automatically adjusted from 10GB to 12GB.The input layer of the DQN neural network includes 10 monitoring indicators and 5 current cache parameters, the hidden layer has 64 neurons, and the output layer corresponds to 9 optimization actions. An e-greedy strategy is used for exploration, with an initial value of 0.9 and a decrease of 0.001 per round of training. After 10,000 rounds of training, the DQN output result suggests adjusting the eviction threshold from 80% to 75%, adjusting a from 0.7 to 0.65, and adjusting the cache capacity increase from 20% to 15%. These parameter adjustments are issued to each cache node through an API interface to achieve dynamic optimization.
[0059] Step S109, based on the cache optimization result, a multi-level architecture of cache is established, and different granularities and scales of cache are set at different levels, including user end, edge node and center node. Through hierarchical cache coordination and data synchronization, global optimization and load balancing of the cache system are realized.
[0060] Obtain cache information of the user end, the edge node and the center node, the cache information including cache capacity and storage content; execute an adaptive cache allocation algorithm according to the cache information, the adaptive cache allocation algorithm using an LSTM neural network to predict data access trend; if the prediction result shows that the access frequency of certain data exceeds a preset threshold, pre-load the data to a cache layer close to the user; use a consistent hash algorithm to perform sharding and routing on the pre-loaded data; receive a cache update event, the cache update event being propagated through a Kafka-based message queue; execute distributed cache synchronization according to the cache update event, the distributed cache synchronization using a Gossip protocol to propagate update messages among edge nodes; obtain global access mode data, the global access mode data including access frequencies of each data item; adjust data distribution in each layer cache according to the global access mode data, the adjustment including copying data with high access frequency to a cache layer close to the user.
[0061] Specifically, a three-tier cache architecture is constructed, with 100 MB local cache set up at the user end, using the browser's LocalStorage or the mobile application's SQLite database to store frequently used data, a 10 GB distributed cache cluster deployed at the edge node, using Redis cluster to store regional hot data, and a 100 GB large-scale cache cluster built at the center node, using Memcached to store global hot data. An adaptive cache allocation algorithm is implemented, which dynamically adjusts the capacity and storage content of each layer cache according to user access patterns and network conditions. The LSTM neural network is used to predict data access trends, with a network structure containing an input layer, two hidden layers (64 neurons each), and an output layer. The past 24 hours of access data are input to predict the access probability in the next hour. High-frequency access data is preloaded to the cache layer closest to the user. A hierarchical cache coordination mechanism is designed, using consistent hashing algorithm for data sharding and routing, using MurmurHash3 as the hash function, setting 200 virtual nodes, implementing cross-level cache lookup and update, and automatically requesting data from upper-layer caches when low-layer caches miss. A distributed cache synchronization method is used, using a Kafka-based message queue to propagate cache update events, using the Gossip protocol to synchronize cache states between edge nodes, randomly selecting 3 neighbor nodes to propagate update messages every 5 seconds, and using version vectors to detect and resolve data conflicts. The version vector structure is {nodeId:timestamp}, and the newer version is retained when a conflict occurs. Global cache consistency is checked every hour to ensure the consistency of multi-level cache data. Consistent hashing is used for request routing, combined with dynamic load information such as node CPU usage and network latency, and when the node load exceeds 80%, the request is rerouted to a node with lower load. Global access patterns are analyzed periodically, and the distribution of data in each layer cache is adjusted every 6 hours. The top 10% of access frequency data is copied to all edge nodes, the 10%-30% of access frequency data is distributed to regional edge nodes, and the remaining data is stored in the center node. In the three-tier cache architecture, the 100 MB local cache at the user end is managed by the LRU algorithm, and the cleaning mechanism is triggered when the storage space reaches 90 MB. The 10 GB Redis cluster at the edge node uses the master-slave replication mode, with 3 master nodes and 6 slave nodes, and the automatic failover is implemented through the sentinel mechanism. The 100 GB Memcached cluster at the center node uses consistent hashing sharding, with 1024 virtual nodes. The LSTM neural network training uses historical access data from the past 30 days, and the model parameters are updated every hour, with a prediction accuracy of 85%. Based on the prediction results, data with an access probability of more than 70% in the next hour is preloaded to the user end cache, and data with an access probability between 30% and 70% is preloaded to the edge node cache.The consistent hashing algorithm uses the MurmurHash3 function, the number of virtual nodes is 200, and the data key is mapped to a ring of 0-2^32-1 after hashing. The message structure of the Gossip protocol contains {nodeId, timestamp, dataId, value}, and 3 neighbor nodes are selected every 5 seconds for transmission. The version vector adopts the {nodeId:timestamp} structure, and the conflict resolution strategy is Last-Write-Wins. The global consistency check uses a Merkle tree with a tree height of 4, and the leaf node contains the hash value of 64 data items. In the load balancing strategy, when the CPU usage of the node exceeds 80% or the network delay exceeds 100ms, the new request is re-routed to one of the three nodes with the lowest load. The global access mode analysis uses a sliding window statistics, the window size is 24 hours, and it is slid once every 6 hours. According to the statistical results, the distribution of data in each layer is dynamically adjusted.
[0062] The above only describes the embodiments of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation, or direct or indirect application in other related technical fields, which is made by using the content of the specification and drawings of the present application, is also included in the patent protection scope of the present application.
Claims
1. A lightweight microservice architecture for rapid deployment and elastic expansion in education, characterized by: The method comprises: Based on students' historical learning data, an association rule mining algorithm is used in the data analysis microservice to determine the correlation between different courses. Course pairs with correlations higher than the preset correlation threshold are marked and stored in the associated course database. Analyze students' learning paths based on the course pairs in the associated course database and store the analyzed learning paths in the learning path pattern library; Based on the learning path, we collect students' learning behavior data in different time periods. We use clustering algorithms in the user portrait microservice to classify students. This identifies groups of students with different learning speeds and learning patterns, and we set differentiated caching strategies for different groups. Based on differentiated caching strategies, we monitor students' progress in each course in real time. When students complete key milestones in a course, we trigger the pre-caching mechanism for the associated course. The cache orchestration microservice coordinates the pre-caching of the first two units of the associated course content in the system's distributed cache layer. For the pre-caching mechanism, we record the students' historical login time intervals, predict the next login time of the students through time series prediction methods, and start the cache preheating mechanism within a certain time range before the predicted login time to cache the resources needed by the students locally in advance; During the cache warming mechanism execution, the current number of preloaded resources and the time span are determined based on the student's learning speed and learning pattern, as well as the current network conditions and device performance; For preloaded resources, different cache update strategies are set according to the time sensitivity of different types of educational resources.
2. The method according to claim 1, characterized in that Based on the student's historical learning data, the association rule mining algorithm is used in the data analysis microservice to determine the correlation between different courses, mark the course pairs with correlation higher than the preset correlation threshold, and store them in the associated course database, including: Obtaining student historical learning data, including course learning records, grade distribution, and learning time; Cleaning and standardizing the student historical learning data to obtain a standardized student learning data set; Applying the Apriori association rule mining algorithm to the standardized learning data set to generate frequent item sets; Extract strong association rules based on the frequent item sets, calculate the support, confidence and lift index between course pairs, and obtain the course association matrix; For the course correlation matrix, filtering is performed according to a preset correlation strength threshold, and course pairs with correlation strength higher than the threshold are screened out to obtain high correlation strength course pairs; Multi-dimensional attribute annotation is performed on course pairs with high correlation strength to generate structured data containing course ID, correlation strength and multi-dimensional attribute labels.
3. The method according to claim 1, characterized in that The method of analyzing the student's learning path based on the course pairs in the associated course database and storing the analyzed learning path in a learning path pattern library includes: Obtaining course pair information in the associated course database, wherein the course pair information includes a course ID, an association strength, and an attribute label; Connecting the course table and the student course selection record table according to the course pair information, and generating a learning sequence by sorting by timestamp, wherein the learning sequence includes a student ID, a course ID list and a corresponding timestamp; Analyzing the learning sequence, setting a minimum support threshold as a preset value, generating equivalence classes and discovering frequent sequence patterns using the equivalence class principle; Post-processing and screening the frequent sequence patterns, calculating the support, confidence and lift indicators of each path, and determining it as a valid learning path if the path length is greater than a preset value and the support is greater than a preset threshold; The effective learning path is stored in a database.
4. The method according to claim 1, wherein The learning behavior data of students in different time periods are collected based on the learning path, and a clustering algorithm is used in the user portrait microservice to classify students to obtain student groups with different learning speeds and learning patterns. Differentiated caching strategies are set for different groups, including: Based on the data in the learning path model library and the students' actual course selection records, we collect statistics on each student's learning behavior data in different time periods to obtain the student's time-series learning behavior feature vector; The temporal learning behavior feature vector includes the average daily learning time, the number of completed courses per week, and the monthly average performance index; Performing cluster analysis on the temporal learning behavior feature vector, setting the number of clusters to a preset value, and using Euclidean distance as a similarity metric; Initialize the center point using the K-means algorithm and iteratively update the center point position until the center point position change is less than the preset threshold or the maximum number of iterations is reached; Based on the clustering results, students are divided into fast learning type, stable progress type, fluctuating type, slow learning type and potential difficulty type groups; Set differentiated caching strategies and parameters for different student groups; Implement a dynamic cache management mechanism in the user portrait microservice to dynamically adjust cache parameters based on the characteristics of the student group; The student group classification results are synchronized to the cache management module in real time through the Apache Kafka message queue to achieve real-time update of the cache strategy.
5. The method according to claim 1, wherein Based on the differentiated caching strategy, the student's progress in each course is monitored in real time. When a student completes a key milestone in a course, the pre-caching mechanism for the associated course is triggered. The cache orchestration microservice coordinates the pre-caching of the first two units of the associated course content in the system's distributed cache layer, including: Use message queues to receive students' learning behavior data in real time, calculate students' real-time completion progress in each course, and obtain students' course completion progress data; determining, based on the course completion progress data, whether the student has reached a predefined key course milestone, wherein the determination is performed using a Bloom filter; If a student reaches a key milestone in a course, a pre-cached event for the associated course is triggered; Utilize the cache orchestration microservice to receive the pre-caching event and query the course association relationship graph stored in the Neo4j graph database; According to the course association relationship graph, a Cypher query language is used to determine a list of associated courses that need to be pre-cached, a cache priority and cache content range of each associated course is calculated, and a pre-caching task queue is generated; The pre-cache task queue is received, and a multi-level cache structure is adopted to load high-priority cache content into a memory cache, where the memory cache is used to store the high-priority cache content.
6. The method according to claim 1, characterized in that The pre-caching mechanism records the student's historical login time intervals, predicts the student's next login time using a time series prediction method, and activates the cache warming mechanism within a certain time range before the predicted login time to cache the resources required by the student locally in advance, including: A distributed time series database is used to store student historical login time data. The distributed time series database obtains student login events from a real-time message queue and writes student login timestamps and student identification numbers according to the student login events. Performing time series analysis on the student login timestamps to obtain student login time interval data, establishing a seasonal time series prediction model based on the student login time interval data, and using a grid search method to determine an optimal parameter combination for the seasonal time series prediction model; Predicting the student's next login time point based on the seasonal time series prediction model, where the next login time point is calculated based on the student's most recent login time, and determining a confidence interval for the next login time point; Storing the next login time point and the confidence interval in a key-value database, wherein the key in the key-value database is the student identification number and the value is the prediction information including the next login time point and the confidence interval; A distributed task scheduler is used to periodically scan the next login time point. If the time difference between the current time and the next login time point is less than a preset threshold, the resource cache preheating mechanism is triggered. The resource cache preheating mechanism obtains learning resources from the content distribution network and stores them in local storage.
7. The method according to claim 1, characterized in that During the execution of the cache warm-up mechanism, the number of resources currently preloaded and the time span are determined based on the student's learning speed and learning mode, as well as the current network conditions and device performance, including: Obtain students' learning speed and learning pattern data, perform time series analysis using the ARIMA model, and obtain students' average learning speed and learning duration; Based on the average learning speed and learning duration, combined with the current course progress, predict the number and type of resources involved in the student's next learning cycle, and determine the expected learning time and resource usage; Real-time detection of student device network status, obtaining bandwidth, latency, and packet loss rates, as well as CPU usage, memory usage, and storage space device performance indicators; If the device performance indicator meets the preset threshold, a resource preloading decision model is constructed, and the input features include learning speed, predicted learning time, network bandwidth and device storage space. The input features are normalized and one-hot encoded; According to the output result of the decision model, a predetermined amount of learning resources is obtained from the content distribution network, and the learning resources are stored in the local cache of the student device.
8. The method according to claim 1, characterized in that For the preloaded resources, different cache update strategies are set according to the time sensitivity of different types of educational resources, including: Based on the content characteristics and update frequency of educational resources, preloaded resources are divided into three categories: real-time, periodically updated, and long-term stable, and the validity period of each resource is set; The exponential decay model is used to calculate the current effectiveness score of the resource, where the exponential decay model is S(t) = S0*e^(-λt), where S0 is the initial importance, λ is the decay coefficient, and t is the cache duration; Implement a dynamic cache management mechanism, scan the resources in the cache at regular intervals, calculate the validity score of each resource, and determine whether the validity score is below a preset threshold; If the validity score is lower than a preset threshold, obtaining the latest version of the resource from the source server; After obtaining the latest version of the resource, update the local cache and reset the resource cache time; Constructing a cache optimization scheduler that uses a Q-learning reinforcement learning algorithm to dynamically adjust cache policies, where the state space includes resource type, access frequency, and storage space occupancy, and the action space includes active pre-updates and passive on-demand updates. The optimal strategy learned by the cache optimization scheduler is used to guide the execution of cache update operations. For resources that are frequently accessed and have low update costs, an active pre-update strategy is adopted to refresh resources that are about to expire in advance.
9. The method according to claim 1, characterized in that The method includes: continuously tracking the hit rate and space usage of each cache node according to the cache update strategy, setting the cache eviction strategy, and dynamically adjusting the cache capacity and eviction threshold to achieve cache monitoring and optimization, specifically including: Collecting performance indicators of cache nodes in real time, including cache hit rate, space utilization, and request latency; Calculate the resource weight according to the performance indicator, and the calculation formula of the resource weight W is W=α*(1 / T)+β*F, where T is the last access time, F is the access frequency, and α and β are adjustment factors; If the cache space usage exceeds the preset threshold, the resource with the lowest weight value will be evicted based on the resource weight; Obtain historical load data of cache nodes and use the ARIMA model to predict future cache demand; Dynamically adjust the cache capacity limit of the cache node based on the prediction results; Receive monitoring data, eviction policy results, and capacity adjustment results from cache nodes, and input the monitoring data, eviction policy results, and capacity adjustment results into the DQN neural network; Determining a cache optimization action based on the output of the DQN neural network, wherein the cache optimization action includes adjusting an eviction threshold, a weight calculation factor, and a capacity adjustment range; Execute cache optimization actions to achieve adaptive optimization of cache nodes.
10. The method according to claim 1, characterized in that The method includes: establishing a multi-level cache architecture based on cache optimization results, setting caches of different granularities and scales at different levels, including user terminals, edge nodes, and central nodes, and achieving global optimization and load balancing of the cache system through hierarchical cache coordination and data synchronization, specifically including: Obtaining cache information of the user terminal, edge nodes, and central nodes, wherein the cache information includes cache capacity and storage content; executing an adaptive cache allocation algorithm based on the cache information, wherein the adaptive cache allocation algorithm uses an LSTM neural network to predict data access trends; If the prediction result shows that the access frequency of a certain data exceeds the preset threshold, the data will be preloaded to the cache layer close to the user; Use consistent hashing algorithm to shard and route preloaded data; Receive cache update events, which are propagated through a Kafka-based message queue; Perform distributed cache synchronization according to the cache update event, wherein the distributed cache synchronization uses the Gossip protocol to propagate update messages between edge nodes; Obtaining global access pattern data, wherein the global access pattern data includes an access frequency of each data item; The data distribution in each cache layer is adjusted according to the global access pattern data, wherein the adjustment includes copying data with a high access frequency to a cache layer close to the user.