Book recommendation algorithm and system for mobile library

Through multi-level recommendation algorithm pipeline and containerized deployment technology, the problems of information overload, homogeneity and poor scalability of traditional library systems are solved, efficient and personalized book recommendations are achieved, and large-scale user access and rapid model updates are supported.

CN120336644APending Publication Date: 2025-07-18GUILIN UNIV OF ELECTRONIC TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510407188.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-01
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

When facing massive book data, traditional library systems have problems such as information overload, homogeneity of recommendation results, insufficient real-time response capabilities, low communication efficiency between modules and poor scalability. They fail to effectively utilize user implicit behavior and book text characteristics, and the model update and deployment are complex.

Method used

The multi-level recommendation algorithm pipeline is adopted (recall-coarse-fine-rearrangement), combining item collaborative filtering, DSSM semantic matching, Deep&Wide feature fusion and DPP diversity optimization, and module decoupling is achieved through the gRPC protocol and the Docker containerized deployment and Redis real-time update is adopted to support high concurrent communication.

Benefits of technology

It realizes accurate and personalized recommendations, improves the diversity and efficiency of recommendation results, reduces system response time, supports concurrent access by tens of millions of users, shortens the model iteration cycle and reduces operation and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120336644A_ABST
    Figure CN120336644A_ABST
Patent Text Reader

Abstract

The invention discloses a book recommendation algorithm and system for a mobile library, and belongs to the technical field of artificial intelligence and mobile internet. The system comprises a user interaction module, a recommendation algorithm module, a data storage module, a communication module and a deployment module. The algorithm process comprises the following steps: 1, recall: based on an article collaborative filtering algorithm, calculating similarity and interestingness by combining book features, user features and cross features of books and users, and generating a candidate set; performing rough arrangement: adopting a DSSM model to fuse user attributes and book text features to calculate similarity, and screening Top-50; 3, performing fine discharge: passing through Deepmp; the Wide model fuses the low-order cross feature and the high-order depth feature, and Top-20 is output; and 4, rearrangement: constructing a kernel matrix based on a DPP algorithm, and maximizing determinant value optimization diversity. Through multi-level algorithm collaboration and containerization deployment, the problems of homogenization, high delay and poor expansibility of a traditional recommendation system are solved, and an efficient and intelligent solution is provided for mobile reading services.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of book recommendation algorithms, and specifically to a book recommendation algorithm and system for a mobile library. Background Art

[0002] Traditional library systems mainly rely on retrieval methods based on classification catalogs or a single collaborative filtering algorithm, such as recommendation based on the historical behavior of user ratings. In the face of a vast amount of book data, this mode has a significant information overload problem: users need to manually screen a large amount of irrelevant content, and the retrieval efficiency is low. At the same time, the recommendation results are highly homogeneous, tending to push popular or similar books, lacking the ability of personalized adaptation. For example, the existing systems mentioned in the document do not fully utilize the implicit behavior data of users (such as likes, shares, comments) and the text features of books (such as introductions, author styles), resulting in the recommendation results being limited to explicit ratings or simple classification labels and being difficult to meet the deep interest needs of users. In addition, the real-time response ability of the traditional architecture is insufficient, unable to dynamically respond to the real-time behavior changes of users, and the recommendation list update lags behind.

[0003] There are obvious gaps in the data processing level of the current technical system: Although the collaborative filtering algorithm can generate recommendations based on user-item interaction data, it overly relies on explicit ratings and ignores the value of implicit behaviors such as user browsing duration and collection records. The document points out that the interactions of users with books (such as collections, comments) are only simplified to a single value in the existing system and are not deeply combined with the semantic information of books (such as title keywords, introduction themes). For example, a user frequently collects science fiction books and writes relevant comments, but the system fails to associate this behavior pattern with the text features of the books (such as keywords like "space exploration", "artificial intelligence"), resulting in the recommendation results staying at the surface category matching. In addition, deep learning methods (such as DSSM, Deep&Wide) can capture text semantics, but lack a dynamic regulation mechanism for recommendation diversity and are prone to falling into the dilemma of repeatedly recommending books of the same category.

[0004] At the same time, the architecture design of existing recommendation systems generally has high coupling, and the communication efficiency between modules is low. Traditional systems often adopt a monolithic architecture, and the recall and ranking modules highly depend on the same database, resulting in resource competition and response delays. Taking the collaborative filtering algorithm as an example, its calculation process needs to frequently access the user behavior data table, but in a high-concurrency scenario, the database read and write pressure surges, and the system throughput significantly decreases. In addition, the model update and deployment process is complex: if the recommendation strategy needs to be adjusted, the entire code needs to be refactored and the model needs to be retrained, making it difficult to achieve rapid iteration. Summary of the Invention

[0005] The technical problem to be solved by the present invention is to overcome the existing defects, and provide a book recommendation algorithm and system for a mobile library, which has a four-level pipeline of recall - rough ranking - fine ranking - re-ranking, and combines item-based collaborative filtering, DSSM semantic matching, Deep&Wide feature fusion and DPP diversity optimization in sequence to achieve accurate recommendation; uses the gRPC protocol and Protocol Buffers interface to achieve module decoupling and supports high-concurrency communication; and is based on Docker containerization deployment and Redis real-time update to ensure system scalability and dynamic response, which can effectively solve the problems in the background technology.

[0006] To achieve the above object, the present invention proposes: a mobile library system based on a recommendation algorithm, including: a user interaction module, a recommendation algorithm module, a communication module, a deployment module, a timed task module and a data storage module, which is implemented based on a WeChat mini-program, and provides user login, book search, activity release and registration, book detail display and waterfall flow recommendation interfaces;

[0007] The recommendation algorithm module includes a recall module, a rough ranking module, a fine ranking module and a re-ranking module connected in sequence, where:

[0008] Recall module: Adopts an item-based collaborative filtering algorithm to screen a candidate book set from a large number of books by calculating item similarity and user interest;

[0009] Rough ranking module: Calculates the semantic matching degree of candidate books through a DSSM model to generate a preliminary sorted list;

[0010] Fine ranking module: Fuses low-order logistic regression and high-order deep neural network features through a Deep&Wide model to generate an accurate sorted list;

[0011] Re-ranking module: Adopts a DPP algorithm to optimize the diversity of the recommendation results and reduce repetition;

[0012] The data storage module includes: a MongoDB database for storing a book type table and a book information table;

[0013] A MySQL database for storing a user information table, an activity information table and a user behavior table;

[0014] The communication module realizes inter-module communication based on the gRPC protocol, and defines the interface and data transmission format through Protocol Buffers;

[0015] The deployment module independently deploys the rough ranking model, the fine ranking model and the re-ranking model through Docker containers, and the recall module runs directly in the Linux environment as a binary file compiled in Go language;

[0016] The scheduled task module executes the recall calculation every day at midnight and stores the results in the Redis database as hot data.

[0017] Preferably, it is characterized in that the implementation of the recall module includes the following algorithm formula:

[0018]

[0019] Where W i and are respectively the sets of users who like items i and j;

[0020] V i,j = W i ∩W j is the intersection user set of the two;

[0021] User interest calculation:

[0022] Interest(u, i) = ∑ a∈A Number of operations(a), A = {like, share, comment}

[0023] The Redis storage format is:

[0024] Key: user_id, Value: {(book_id, similarity × interest)}

[0025] Preferably, it is characterized in that the DSSM model of the rough ranking module includes:

[0026] User feature encoding: The user ID is mapped to a vector through the embedding layer

[0027] The user's MBTI, gender, and age are generated into u through One-Hot encoding meta ;

[0028] Book feature encoding: The book title, author, and introduction are vectorized through TF-IDF into

[0029] The book type is generated into b through One-Hot encoding type ;

[0030] Semantic matching probability:

[0031] Where σ is the Sigmoid function, is the vector concatenation.

[0032] Preferably, the Deep&Wide model of the fine ranking module includes:

[0033] Wide part:

[0034] where φ(x wide ) is the cross - feature of the user's MBTI and book type;

[0035] Deep part: h L = ReLU(W L ·h L―1 + b L );

[0036] Final prediction:

[0037] Singleton pattern initialization: Load the pre - trained model parameters through a globally unique instance.

[0038] Preferably, the DPP algorithm of the rearrangement module includes:

[0039] Kernel matrix construction:

[0040] where f i is the encoded vector of book type and author;

[0041] Diversity optimization: P(S) ∝ det(L S );

[0042] Iteratively select a subset of books that maximizes det(L S ) through a greedy algorithm.

[0043] Preferably, in the data storage module:

[0044] MongoDB book information table:

[0045] Schema: {Id: ObjectId, title: string, author: string, cover: string};

[0046] MySQL user behavior table:

[0047] Schema: {openid: varchar, book_id: varchar, action_type: varchar};

[0048] Preferably, in the gRPC protocol of the communication module:

[0049] Service definition: The service name is RankingService, providing a remote call method RankBooks;

[0050] The RankBooks method receives request parameters of the RankRequest type and returns response results of the RankResponse type;

[0051] Request message body: Two fields are defined in the RankRequest message body: user_id is used to identify the requesting user;

[0052] book_ids represents the list of book IDs to be sorted;

[0053] Response message body: The ranked_book_ids field (of string array type, marked as 1) is defined in the RankResponse message body, representing the list of sorted book IDs;

[0054] Interaction logic: The rough ranking module, as a gRPC client, sends a request to the fine ranking module, carrying the user ID and the list of candidate book IDs; after receiving the request as a gRPC server, the fine ranking module calls the model to calculate the sorting result and returns the list of sorted book IDs.

[0055] Preferably, in the recall stage: Every day at midnight, the item similarity and user interest are calculated in parallel through Go coroutines to generate a candidate set;

[0056] Rough ranking stage: Screen the top 200 candidates through the DSSM model;

[0057] Fine ranking stage: Output the top 50 accurate rankings through the Deep&Wide model;

[0058] Re-ranking stage: Generate a top-10 diverse recommendation list based on the DPP algorithm.

[0059] Preferably, the recall stage further includes:

[0060] Parallel calculation:

[0061] Coroutine 1: Calculate item similarity;

[0062] Coroutine 2: Calculate user interest;

[0063] Redis key-value storage:

[0064] Key: user: 123, Value: {(book: 456, 0.92), (book: 789, 0.85)}

[0065] Preferably, when the program is executed by the processor, it implements the book recommendation method described in claims 8-9, specifically including:

[0066] Call the Go coroutine to execute the timed recall task;

[0067] Load the DSSM, Deep&Wide, and DPP models for sorting;

[0068] Transmit intermediate results through the gRPC interface;

[0069] The final recommended list is displayed through the WeChat mini-program interface.

[0070] Compared with the prior art, the beneficial effects of the present invention are:

[0071] 1. The present invention realizes accurate recommendation through a multi-level recommendation algorithm pipeline (recall - rough ranking - fine ranking - re-ranking): In the recall stage, combining the item collaborative filtering algorithm with the user's implicit behavior, calculating the user's interest degree and item similarity, covering a wider candidate set;

[0072] 2. In the rough ranking stage, based on the DSSM model, embedding user attributes (MBTI, gender) and book text features (title, introduction) into a high-dimensional semantic space to improve the semantic matching accuracy; In the fine ranking stage, the Deep&Wide model is used to fuse low-order cross features (such as user-book type combinations) and high-order deep features; In the re-ranking stage, the DPP algorithm is adopted, which can effectively avoid the homogeneity and repetition of recommendations, and on the basis of personalized recommendations, improve the diversity of recommendation results;

[0073] 3. Decouple the recall, rough ranking, fine ranking, and re-ranking modules through the gRPC protocol and the Protocol Buffers interface, supporting parallel computing and high-concurrency requests; Containerized deployment and Redis caching: The rough ranking, fine ranking, and re-ranking modules run independently in Docker containers, and the recall results are stored in the Redis database. Combined with Go coroutine parallel tasks, the system response time is reduced to the millisecond level, supporting tens of millions of user concurrent accesses. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] Figure 1 It is a flowchart of the present invention;

[0075] Figure 2 The recommended page diagram of the book home page;

[0076] Figure 3 The book search page diagram;

[0077] Figure 4 The result diagram of the recall stage;

[0078] Figure 5 The content diagram of the communication protocol file;

[0079] Figure 6 The docker container diagram;

[0080] Figure 7 It is the re-ranking (DPP container) model. DETAILED DESCRIPTION OF THE INVENTION

[0081] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0082] Please refer to Figure 1-7 , the present invention provides the following technical solutions:

[0083] Embodiment 1: 1. Overall system architecture

[0084] The mobile library system in this embodiment is designed based on a microservices architecture and includes the following core modules:

[0085] User interaction module: Implemented through a WeChat mini-program, providing functions such as user login, waterfall flow recommendation, book search, activity participation, and details display (as shown in Figure 2 , Figure 3 );

[0086] Recommendation algorithm module: Consisting of four-level pipelines of recall, rough ranking, fine ranking, and re-ranking, and adopting multi-level algorithms to collaboratively optimize the recommendation results;

[0087] Data storage module: Using MongoDB to store book information (such as Table 1 Book Information Table), MySQL to store user information (such as Table 2 User Information Table) and behavior data (such as Table 3 Favorite Table, Table 4 Comment Table);

[0088] Field Name Type Description Id ObjectId Id Identification title string Book Name author string Book Author intro string Book Introduction insert_time date Store Test Papers word_count string Book Word Count cover String Book Cover URL

[0089] Table 1 Book Information Table

[0090] Field Name Type Description openid varchar User WeChat ID email varchar User Email sex varchar User Gender birthday date User Birthday mbti varchar User MBTI

[0091] Table 2 User Information Table

[0092]

[0093]

[0094] Table 3 Favorite Information Table

[0095] Field Name Type Description openid varchar User ID collection_name varchar Book Type book_id varchar Book ID comment_info varchar Comment Content

[0096] Table 4 Comment Information Table

[0097] Communication module: Based on the gRPC protocol to achieve inter-module communication, and defining standardized interfaces through Protocol Buffers (such as Figure 5 protocol file);

[0098] Deployment Module: The rough ranking (DSSM container), fine ranking (Deep&Wide container), and re-ranking (DPP container) models run independently through Docker containers. The recall module is directly deployed on the Ubuntu system as a binary file compiled in Go (as shown in Figure 6 Container Deployment Diagram).

[0099] 2. Specific Implementation of the Recommendation Algorithm Module

[0100] 2.1 Recall Module

[0101] Input Data: User historical behavior data (such as likes, comments, collections) and book metadata (title, author, type).

[0102] Algorithm Process:

[0103] 1. Item Similarity Calculation:

[0104]

[0105] Among them, W i , W j is the set of users who like items i and j, and V i,j = W i ∩W j .

[0106] 2. User Interest Calculation:

[0107] Interest(u, i) = ∑ a∈A Number of operations(a), A = {like, share, comment};

[0108] 3. Candidate Set Generation: Parallel calculation is performed through Go coroutines every day at midnight, and the results are stored in Redis (Key: user_id, Valuex{(book_id, similarity x interest)}).

[0109] Output: Top-200 candidate book ID list (as shown in Figure 4 Recall Result Diagram).

[0110] 2.2 Rough Ranking Module

[0111] Model Structure: A semantic matching model based on DSSM (Deep Structured Semantic Model).

[0112] User Feature Encoding: The user ID is mapped to a vector through the embedding layer · The user's MBTI, gender, and age are encoded into u meta through One-Hot encoding.

[0113] Book feature encoding: The book title, author, and introduction are vectorized by TF-IDF into m. The book type is encoded by One-Hot to generate b type .

[0114] Matching probability calculation:

[0115] where σ is the Sigmoid function, and ⊕ represents vector concatenation.

[0116] Output: Top-50 preliminary sorted list.

[0117] 2.3 Re-ranking module

[0118] Model structure: Deep&Wide model, which fuses low-order cross features and high-order deep features.

[0119] Wide part:

[0120]

[0121] where φ(x wide ) is the cross feature of the user's MBTI and the book type.

[0122] Deep part:

[0123] h L = ReLU(W L ·h L―1 + b L )

[0124] Final prediction:

[0125]

[0126] Output: Top-20 accurate sorted list.

[0127] Algorithm process: Diversity optimization based on DPP (Determinantal Point Process).

[0128] 1. Kernel matrix construction:

[0129]

[0130] where f i is the encoding vector of the book type and the author.

[0131] 2. Diversity optimization: Maximize the determinant det(L S ) through the greedy algorithm to select the subset with the highest diversity.

[0132] Output: Top-10 Final Recommendation List (Category Coverage Rate Increased by 45%).

[0133] 4. Deployment and Performance Advantages

[0134] Containerized Deployment: The rough ranking, fine ranking, and re-ranking modules run in independent Docker containers (such as Figure 6 ), with resource isolation and support for rapid iteration.

[0135] Real-time Response: Combining Redis caching and Go coroutine parallel computing, the average system response time is <50ms, supporting tens of millions of concurrent users.

[0136] Scalability: The modules are decoupled through gRPC. When adding new features (such as user social relationships), only the corresponding module needs to be extended, without reconstructing the entire system.

[0137] 5. Actual Application Effects

[0138] Precision Improvement: The measured recommended click-through rate increased by 25%, and the user retention rate increased by 30%;

[0139] Diversity Optimization: The coverage rate of niche categories such as science fiction and history increased from 15% to 60%;

[0140] Efficiency Improvement: The model iteration cycle was shortened from 7 days to 2 days, and the operation and maintenance cost was reduced by 40%.

[0141] Although the embodiments of the present invention have been shown and described, for those of ordinary skill in the art, it can be understood that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A mobile library system based on a recommendation algorithm, characterized in that: It includes a user interaction module, a recommendation algorithm module, a communication module, a deployment module, a scheduled task module, and a data storage module. It is implemented based on a WeChat mini-program, providing user login, book search, event release and registration, book details display, and waterfall flow recommendation interfaces; The recommendation algorithm module includes a recall module, a rough ranking module, a fine ranking module, and a re-ranking module connected in sequence, where: Recall module: Adopts an item-based collaborative filtering algorithm. By calculating item similarity and user interest, it screens a candidate book set from a vast number of books; Rough ranking module: Calculates the semantic matching degree of candidate books through a DSSM model to generate a preliminary sorted list; Fine ranking module: Fuses low-order logistic regression and high-order deep neural network features through a Deep&Wide model to generate an accurate sorted list; Re-ranking module: Adopts a DPP algorithm to optimize the diversity of recommendation results and reduce repetition; The data storage module includes: A MongoDB database that stores a book type table and a book information table; A MySQL database: Stores a user information table, an event information table, and a user behavior table; A Redis database: Stores user real-time preference information and the generated recommendation results; The architecture adopts a microservices architecture, in which Nacos is used to implement service registration, service discovery, and configuration management; The communication module is based on the gRPC protocol to achieve inter-module communication, and defines interfaces and data transmission formats through ProtocolBuffers; The deployment module independently deploys the rough ranking model, the fine ranking model, and the re-ranking model through Docker containers. The recall module runs directly as a binary file compiled in Go language in a Linux environment; The scheduled task module performs recall calculations every day at midnight and stores the results in the Redis database as hot data.

2. The mobile library system based on a recommendation algorithm according to claim 1, characterized in that: The implementation of the recall module includes the following algorithm formula: where W i and are the sets of users who like items i and j, respectively; V i,j = W i ∩W j is the intersection user set of the two; User interest calculation: Interest degree (u, i) = ∑ a∈A Number of operations (a), A = {like, share, comment} The Redis storage format is: Key: user_id, Value: {(book_id, similarity × interest)} 3. A mobile library system based on a recommendation algorithm according to claim 1, characterized in that: The DSSM model of the rough ranking module Includes: User feature encoding: The user ID is mapped to a vector through the embedding layer The user's MBTI, gender, and age are encoded into u through One-Hot encoding meta ; Book feature encoding: The book title, author, and introduction are vectorized by TF-IDF into The book type is generated as b through One-Hot encoding type ; Semantic matching probability: where σ is the Sigmoid function, is vector concatenation.

4. A mobile library system based on a recommendation algorithm according to claim 1, characterized in that: The Deep&Wide model of the fine ranking module includes: Wide part: where φ(x wide ) is the cross feature of the user's MBTI and book type; Deep part: h L = ReLU(W L ·h L―1 + b L ); Final prediction: Singleton pattern initialization: Loads pre-trained model parameters through a globally unique instance.

5. The mobile library system based on a recommendation algorithm according to claim 1, characterized in that: The DPP algorithm of the re-ranking module includes: Kernel matrix construction: where f i is the encoded vector of book type and author; Diversity optimization: P(S) ∝ det(L S ); Iteratively select a subset of books that maximizes det(L S ) through a greedy algorithm.

6. The mobile library system based on a recommendation algorithm according to claim 1, characterized in that: In the data storage module: MongoDB book information table: Schema: {Id: ObjectId, title: string, author: string, cover: string}; MySQL user behavior table: Schema: {openid: varchar, book_id: varchar, action_type: varchar}; 7. The mobile library system based on a recommendation algorithm according to claim 1, wherein: In the gRPC protocol of the communication module: Service definition: The service name is RankingService, providing a remote call method RankBooks; The RankBooks method receives request parameters of the RankRequest type and returns a response result of the RankResponse type; Request message body: Two fields are defined in the RankRequest message body: user_id is used to identify the requesting user; book_ids represents the list of book IDs to be sorted; Response message body: The ranked_book_ids field (a string array type, marked as 1) is defined in the RankResponse message body, representing the sorted list of book IDs; Interaction logic: The rough ranking module, as a gRPC client, sends a request to the fine ranking module, carrying the user ID and the list of candidate book IDs; after receiving the request as a gRPC server, the fine ranking module calls the model to calculate the sorting result and returns the sorted list of book IDs.

8. A book recommendation method based on a recommendation algorithm, characterized in that: The book recommendation method based on the recommendation algorithm is applied to the mobile library system based on the recommendation algorithm, including the following steps: Recall stage: Every day at midnight, calculate the item similarity and user interest degree in parallel through Go coroutines to generate a candidate set; Rough ranking stage: Screen the top 200 candidates through the DSSM model; Fine ranking stage: Output the top 50 accurate rankings through the Deep&Wide model; Re-ranking stage: Generate a top-10 diverse recommendation list based on the DPP algorithm.

9. A book recommendation method based on a recommendation algorithm according to claim 8, characterized in that, The recall stage further includes: Parallel calculation: Coroutine 1: Calculate item similarity; Coroutine 2: Calculate user interest degree; Redis key-value storage: Key: user: 123, Value: {(book: 456, 0.92), (book: 789, 0.85)}.

10. A mobile library system based on a recommendation algorithm according to claim 1, characterized in that: It also includes a computer-readable storage medium storing a computer program, which when executed by a processor implements the book recommendation method described in claims 8-9, specifically including: Call a Go coroutine to execute a timed recall task; Load the DSSM, Deep&Wide, and DPP models for sorting; Transmit intermediate results through the gRPC interface; The final recommendation list is displayed through the WeChat mini-program interface.