Associated cache data updating method and system

Through the associated cache data update method, the problem of low cache update efficiency in the existing technology is solved, efficient data query and preloading are realized, and user experience and system performance are improved.

CN119807243APending Publication Date: 2025-04-11CHINA CITIC BANK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411774667.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

Existing cache update methods have efficiency bottlenecks when processing data that is not duplicated but associated with previous data, resulting in user experience and increased database burden.

Method used

The associated cache data update method is adopted. After receiving the user query request, the first cache database is queried, and if it is missed, it jumps to the second database. After querying the data, it is stored in the first cache database and sent to the association analysis processing device. The data is analyzed using the entity association mapping table, and the associated entity identification information is extracted and stored in the queue. The associated data is queried and stored in the cache based on the queue information.

Benefits of technology

It improves query efficiency, reduces database burden, improves user experience, and improves the speed and efficiency of data retrieval by preloading related data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119807243A_ABST
    Figure CN119807243A_ABST
Patent Text Reader

Abstract

The invention relates to an associated cache data updating method, which comprises the following steps of: after receiving a query request of a user, querying request data in a cache; if data exist in the cache, directly returning the data to the user; if no data exists in the cache, querying the data from the database, and returning the data to the user; storing the queried data in a cache; sending the queried data to a correlation analysis processing device; the association analysis processing device analyzes the data according to the entity association mapping table and extracts associated entity identification information; storing the associated entity identification information in a queue; extracting associated entity identification information from the queue, and querying associated data from a database; and storing the queried associated data in a cache. According to the method, the system can quickly provide the required data from the cache, so that the query efficiency is remarkably improved, the pressure of the database is relieved, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an associative cache data updating method and system. Background Art

[0002] In modern computer technology, cache is widely used in various systems and applications as an effective means to improve data access speed. The basic principle of cache is to store frequently accessed data in a fast-access storage medium so that data can be quickly provided upon subsequent requests, reducing direct access to the back-end database, thereby reducing the database load and improving the overall performance of the system.

[0003] Although caching technology plays an important role in improving system performance, existing cache update methods have obvious efficiency bottlenecks when processing a large number of user requests for data that is not repeated but related to previous data. This situation is particularly common in e-commerce platforms. For example, when a user issues a shopping cart query request in a shopping portal, the system first provides an overview of the product. When the user wants to further view the details of the product, if this information is not cached, the system will have to directly access the database to obtain the data. Since the access speed of the database is usually slower than the cache, this affects the user experience and increases the burden on the database. Summary of the invention

[0004] To address the deficiencies of the prior art, the present invention achieves higher query efficiency in scenarios where a large number of users request to query data associated with previous query records.

[0005] To achieve the above objectives, the technical solutions adopted by the present invention include:

[0006] An associative cache data update method, characterized by comprising:

[0007] S1. After receiving a user query request, query the target request data in the first cache database. If the target request data does not exist in the first cache database, automatically jump to the second database to query the target request data.

[0008] S2, when the first target request data is found in the second database, the first target request data is stored in the first cache database, and the found first target request data is sent to the association analysis processing device at the same time;

[0009] S3, the association analysis processing device parses the first target request data according to the entity association mapping table, extracts the associated entity identification information, and stores the associated entity identification information in a queue;

[0010] S4. Query the associated data in the second database according to the associated entity identification information in the queue, and store the associated data in the first cache database for subsequent query by the user.

[0011] Specifically, the first cache database mentioned in S1 is used as the first stop for user query requests, aiming to provide fast data access. The second database is used as a backup storage for data, providing data query resources when the first cache database misses. In S2, when the second database queries the target request data, the data is stored in the first cache database to achieve instant update of the cache. At the same time, a copy of the data is sent to the association analysis processing device to trigger subsequent data analysis and preloading.

[0012] The association analysis and processing device mentioned in S2 and S3 uses an entity association mapping table to parse and understand the intrinsic relationship between data. The entity association mapping table is a predefined data structure that clearly indicates the association method between different entities. The associated entity identification information extracted in S3 is stored in a queue, which acts as a task buffer to manage data requests that need further processing. In S4, based on the associated entity identification information in the queue, the system queries the second database to obtain the associated data and stores it in the first cache database. This strategy aims to predict the user's possible subsequent queries and improve the speed and efficiency of data retrieval by preloading relevant data into the first cache database.

[0013] The entity association mapping table can be adjusted according to the actual operation of the system and the user behavior pattern to adapt to different business needs. Through the above steps, the system can quickly respond to user query requests and provide faster data access speed when users make subsequent queries.

[0014] Exemplarily, after receiving a user query request, S1 queries the first cache database for target request data, including using an SQL statement to perform data retrieval.

[0015] Specifically, SQL is a standardized language for managing and operating relational databases. In the present technical solution, SQL statements are used to retrieve the data requested by the user from the first cache database. When the user initiates a query request, the system will construct one or more SQL query statements. SQL statements provide a high degree of flexibility and precision, allowing the system to accurately specify the data fields, tables, and possible filtering conditions to be retrieved based on the user's query request. SQL statements support complex query operations, including multi-table joins, subqueries, sorting, grouping, and aggregation, which enables the system to handle complex user query requests.

[0016] Exemplarily, after receiving the user query request, S1 queries the first cache database for the target request data, including directly returning the second target request data to the user if the first cache database queries the second target request data.

[0017] Exemplarily, in S1, if the requested data does not exist in the cache database, the query of the requested data is automatically jumped to the second database, and if the requested data cannot be found in the second database, a null value is directly returned to the user.

[0018] Exemplarily, the queue has a priority setting function, and can set different priorities according to the importance or query frequency of the entity identification information, so as to give priority to processing the entity identification information with a high priority.

[0019] Specifically, in this solution, priority determines the order in which entity identification information in the queue is processed. The importance of entity identification information can be based on a variety of factors, such as the set business logic, user access mode, or timeliness of data, and the priority of entity identification information can be set according to these factors. A sorting mechanism can be set inside the queue to automatically sort the tasks in the queue according to the priority of the entity identification information. By giving priority to high-priority entity identification information, the system can allocate resources more efficiently.

[0020] Exemplarily, the association analysis processing device further includes a prediction model for predicting possible query behaviors of users and dynamically adjusting the loading strategy of the association entity identification information based on the prediction results.

[0021] Specifically, the prediction model analyzes the user's historical query records, behavior patterns, and possible query trends to predict the query requests that the user may initiate in the future. Based on the analysis results of the prediction model, the system can dynamically adjust the loading strategy of the associated entity identification information, such as prioritizing the loading of data predicted to be high-probability queries. The prediction model can use machine learning algorithms, such as decision trees, random forests, or neural networks, to analyze data and make predictions. This technical feature can not only respond to current query requests, but also better predict future high-probability query needs, thereby achieving more intelligent and automated data management. This not only improves the performance of the system, but also provides users with a more efficient and personalized service experience.

[0022] The present invention also provides an associative cache data update system for executing any of the methods described in claims 1 to 6, comprising:

[0023] A user request query module, configured to query the target request data in the first cache database after receiving the user query request, and automatically jump to the second database to query the target request data if the target request data does not exist in the first cache database;

[0024] A data analysis trigger module, configured to store the first target request data in a first cache database upon querying the first target request data in the second database, and simultaneously send the first target request data to the association analysis processing device;

[0025] An entity information extraction module, used for the association analysis processing device to parse the first target request data according to the entity association mapping table, extract the associated entity identification information, and store the associated entity identification information in a queue;

[0026] The associated data storage module is used to query the associated data in the second database according to the associated entity identification information in the queue, and store the associated data in the first cache database for subsequent query by the user.

[0027] The present invention also provides a computer-readable storage medium, characterized in that a computer program is stored on the storage medium, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

[0028] The present invention also provides an electronic device, characterized in that it includes a processor and a memory;

[0029] The memory is used to store computer programs;

[0030] The processor is configured to execute the method according to any one of claims 1 to 6 by calling a stored computer program.

[0031] The present invention also relates to a computer program product, comprising a computer program and / or instructions, characterized in that the computer program and / or instructions implement the steps of the above method when executed by a processor.

[0032] The beneficial effects of the present invention are as follows: the present invention proposes an associative cache data update method, which can intelligently identify and predict the user's possible subsequent query needs by introducing an associative analysis and processing device, and load and cache relevant data from the database in advance. When the user initiates a query request, the system can quickly provide the required data from the cache, significantly improving the query efficiency, reducing the pressure on the database, and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 A schematic diagram of executing a logic diagram of an associative cache data updating method of the present invention.

[0034] Figure 2 It is a structural diagram of the associative cache data updating system of the present invention.

[0035] Figure 3 This is a schematic diagram of the flow structure of the associative cache data update data of the present invention.

[0036] Figure 4 The associative mapping diagram of the associative cache data update of the present invention is shown.

[0037] Figure 5 This is a schematic diagram of the entity A table structure for updating the associative cache data of the present invention.

[0038] Figure 6 This is a schematic diagram of the entity B table structure for updating the associative cache data of the present invention. DETAILED DESCRIPTION

[0039] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0040] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0041] The first aspect of the present invention relates to a method for updating cache data in an associative manner. Figure 1 As shown, including:

[0042] S1. After receiving a user query request, query the target request data in the first cache database. If the target request data does not exist in the first cache database, automatically jump to the second database to query the target request data.

[0043] When a user searches or browses for a specific product on an e-commerce platform, the platform first queries the target product data in the first cache database (e.g., a memory database for fast reading) after receiving the user's query request. If the data is not available in the first cache database, the system automatically jumps to the second database in the backend for query.

[0044] S2, when the first target request data is found in the second database, the first target request data is stored in the first cache database, and the found first target request data is sent to the association analysis processing device at the same time;

[0045] After the second database searches for the target product data, the data is stored in the first cache database to quickly respond to subsequent similar queries. At the same time, the product data is concurrently sent to the association analysis processing device, which starts analyzing and preparing recommendation data.

[0046] S3, the association analysis processing device parses the first target request data according to the entity association mapping table, extracts the associated entity identification information, and stores the associated entity identification information in a queue;

[0047] The association analysis processing device analyzes the commodity data according to the entity association mapping table (which predefines the association rules between commodities, such as similar commodities, commodities of the same category, commodities with high user ratings, etc.), extracts the identification information of the associated commodities, such as commodity ID or category ID, and stores this information in a queue with a priority setting function.

[0048] S4. Query the associated data in the second database according to the associated entity identification information in the queue, and store the associated data in the first cache database for subsequent query by the user.

[0049] The system queries the recommended product data in the second database according to the associated entity identification information in the queue. The queried recommended product data is stored in the first cache database for quick access by the user in subsequent queries.

[0050] Each associated entity identification information in the queue is assigned different priorities according to its importance or query frequency. For example, the commodity categories that users frequently view or purchase may have higher priorities. The prediction model in the association analysis processing device analyzes the user's historical browsing and purchasing behavior and predicts the recommended commodities that the user may be interested in. Based on the prediction results, the system dynamically adjusts the loading strategy of the recommended commodities and preferentially loads those commodities that are predicted to be of interest to the user.

[0051] If the target requested data is found in the first cache database, the system directly returns the data to the user. If the requested data cannot be found in the second database, the system returns a null value to the user and may provide error handling or search suggestions.

[0052] Through this embodiment, when a user queries for information related to a previously viewed product, the system can not only provide the required data instantly, but also intelligently predict and load other related data, thereby optimizing the user experience and reducing the burden on the database.

[0053] Another aspect of the present invention also relates to an associative cache data update system, the structure of which is as follows: Figure 2 As shown, including:

[0054] A user request query module, configured to query the target request data in the first cache database after receiving the user query request, and automatically jump to the second database to query the target request data if the target request data does not exist in the first cache database;

[0055] Suppose there is an online news information platform where users can browse various news and articles. The platform hopes to provide personalized content recommendations to improve user engagement and satisfaction. Users log in to the news information platform and initiate a query request, hoping to obtain news content of interest.

[0056] like Figure 3 As shown, the user request query module of the platform first queries the first cache database such as Redis or Memcached to find the news data requested by the user.

[0057] If the data is not available in the cache, the module automatically jumps to the second database on the backend, which can be MySQL or MongoDB for query.

[0058] A data analysis trigger module, configured to store the first target request data in a first cache database upon querying the first target request data in the second database, and simultaneously send the first target request data to the association analysis processing device;

[0059] After the second database queries the news data requested by the user, the data analysis trigger module stores these data in the first cache database to quickly respond to subsequent similar queries. At the same time, the module concurrently sends the news data to the association analysis processing device to start the personalized recommendation process.

[0060] An entity information extraction module, used for the association analysis processing device to parse the first target request data according to the entity association mapping table, extract the associated entity identification information, and store the associated entity identification information in a queue;

[0061] After receiving the news data, the association analysis processing device parses the data according to the entity association mapping table (which may contain association rules between entities such as keywords, topics, authors, etc.). This module extracts the associated entity identification information, such as the relevant topic ID or author ID, and stores it in a queue with a priority setting function.

[0062] The associated data storage module is used to query the associated data in the second database according to the associated entity identification information in the queue, and store the associated data in the first cache database for subsequent query by the user.

[0063] like Figure 4 , 5 As shown in FIG6 , the association analysis processing device consists of two parts, one is an entity association mapping table, which pre-sets the associated entity identification information, as shown in FIG6 . Figure 4 As shown in the figure, entity A will map entity B information. After receiving entity A information, the entity A table structure is as shown in the figure. Figure 5 , each single entity A content will be disassembled and uniquely mapped to an associated entity identification entity information. In this example, it will be parsed into the "ENTITY_B_ID" field information of entity A, that is, the associated entity identification information, and stored in the queue. After that, the associated entity identification information "ENTITY_B_ID" of entity B will be continuously taken out from the queue, and according to the associated entity identification information, it will be queried and loaded from the database and stored in the first cache database. The entity B table structure is as shown in the attached figure. Figure 6 , where the "ENTITY_B_ID" field is the primary key of the table, which can uniquely identify an entity B information.

[0064] According to the associated entity identification information in the queue, the associated data storage module queries the second database to find other news or articles associated with the user request data. For example, other articles by the same author or news on the same topic. The queried associated data is stored in the first cache database for quick access by the user in subsequent queries.

[0065] The prediction model in the association analysis processing device analyzes the user's historical browsing and clicking behavior and predicts the type of news or topics that the user may be interested in. Based on the prediction results, the system dynamically adjusts the loading strategy to prioritize loading and recommending news content that is predicted to be of interest to the user. The entity identification information in the queue is given different priorities according to its importance or user query frequency, and high-priority content (such as articles by authors or popular news topics that users frequently browse) will be processed and loaded into the cache more quickly.

[0066] By using this system, the above-mentioned operation processing method can be executed and the corresponding technical effects can be achieved.

[0067] An embodiment of the present invention also provides a computer-readable storage medium capable of implementing all the steps in the method in the above embodiment, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, all the steps in the method in the above embodiment are implemented.

[0068] An embodiment of the present invention also provides an electronic device for executing the above method. As an implementation device of the method, the electronic device has at least a processor and a memory, and in particular, the memory stores data and related computer programs required for executing the method, such as storage, etc., and the processor calls the data and programs in the memory to execute all the steps of the implementation method and obtains the corresponding technical effect.

[0069] Preferably, the electronic device may include a bus architecture, the bus may include any number of interconnected buses and bridges, and the bus will include various circuits linked together by one or more processors and memories. The bus may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are all well known in the art and are therefore not further described herein. The bus interface provides an interface between the bus and the receiver and transmitter. The receiver and transmitter may be the same component, i.e., a transceiver, providing a unit for communicating with various other systems over a transmission medium. The processor is responsible for managing the bus and general processing, while the memory may be used to store data used by the processor when performing operations.

[0070] In addition, the electronic device may further include components such as a communication module, an input unit, an audio processor, a display, and a power supply. The processor (or controller, operation control) used may include a microprocessor or other processor device and / or a logic device, which receives input and controls the operation of various components of the electronic device; the memory may be one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory, or other suitable devices, which may store the above-mentioned related data information, and may also store a program for executing related information, and the processor may execute the program stored in the memory to realize information storage or processing, etc.; the input unit is used to provide input to the processor, for example, it may be a key or a touch input device; the power supply is used to provide power to the electronic device; the display is used to display display objects such as images and text, for example, it may be an LCD display. The communication module is a transmitter / receiver that sends and receives signals via an antenna. The communication module (transmitter / receiver) is coupled to the processor to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal. Based on different communication technologies, multiple communication modules may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless local area network module, etc. The communication module (transmitter / receiver) is also coupled to a speaker and a microphone via an audio processor to provide an audio output via the speaker and receive an audio input from the microphone, thereby realizing a common telecommunication function. The audio processor may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor is also coupled to a central processor, so that recording can be performed on the machine through the microphone, and the sound stored on the machine can be played through the speaker.

[0071] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0072] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A system that specifies the functions of a box or multiple boxes.

[0073] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction system, which is implemented in the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0074] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps of the functions specified in a box or multiple boxes. Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they know the basic creative concept. Therefore, the attached claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0075] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A method for updating associative cache data, characterized in that: include: S1. After receiving a user query request, query the target request data in the first cache database. If the target request data does not exist in the first cache database, automatically jump to the second database to query the target request data. S2, when the first target request data is found in the second database, the first target request data is stored in the first cache database, and the found first target request data is sent to the association analysis processing device at the same time; S3, the association analysis processing device parses the first target request data according to the entity association mapping table, extracts the associated entity identification information, and stores the associated entity identification information in a queue; S4. Query the associated data in the second database according to the associated entity identification information in the queue, and store the associated data in the first cache database for subsequent query by the user.

2. The method according to claim 1, characterized in that: After receiving the user query request, S1 queries the first cache database for target request data, including using SQL statements to perform data retrieval.

3. The method according to claim 1, characterized in that After receiving the user query request, S1 queries the first cache database for the target request data, including directly returning the second target request data to the user if the first cache database queries the second target request data.

4. The method according to claim 1, characterized in that: In S1, if the requested data does not exist in the cache database, the query of the requested data is automatically redirected to the second database, and if the requested data cannot be found in the second database, a null value is directly returned to the user.

5. The method according to any one of claims 1 to 4, characterized in that The queue has a priority setting function, and can set different priorities according to the importance or query frequency of the entity identification information, so as to give priority to processing the entity identification information with a high priority.

6. The method according to any one of claims 1 to 4, characterized in that: The association analysis processing device also includes a prediction model for predicting the user's possible query behavior and dynamically adjusting the loading strategy of the associated entity identification information based on the prediction result.

7. An associative cache data update system, characterized in that: Used to perform any of the methods described in claims 1 to 6, comprising: A user request query module is used to query the target request data in the first cache database after receiving the user query request, and automatically jump to the second database to query the target request data if the target request data does not exist in the first cache database; A data analysis trigger module, configured to store the first target request data in a first cache database upon querying the first target request data in the second database, and simultaneously send the first target request data to the association analysis processing device; An entity information extraction module, used for the association analysis processing device to parse the first target request data according to the entity association mapping table, extract the associated entity identification information, and store the associated entity identification information in a queue; The associated data storage module is used to query the associated data in the second database according to the associated entity identification information in the queue, and store the associated data in the first cache database for subsequent query by the user.

8. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

9. An electronic device, characterized in that: including a processor and a memory; The memory is used to store computer programs; The processor executes the method according to any one of claims 1 to 6 by calling a stored computer program.

10. A computer program product comprising a computer program and / or instructions, characterized in that: When the computer program and / or the instructions are executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.