Data caching method and device, server and storage medium

By using scheduled tasks to retrieve and process marquee data from the database, the system achieves categorized management and real-time updates of local cache, solving the problems of long response time and high database pressure for marquee data, and improving system performance and the real-time nature of data display.

CN115357619BActive Publication Date: 2026-05-12BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
Filing Date
2022-08-23
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

In existing technologies, the response time for scrolling data is relatively long, and the database pressure is too high in high-concurrency scenarios, leading to a decrease in system performance.

Method used

The system retrieves raw data from the first database via a scheduled task, processes it into cached data, stores it in the second database, and updates it periodically. This enables the system to classify and manage locally cached data and update it in real time, allowing the system to retrieve display data directly from the local cache.

Benefits of technology

It reduces the response time of data requests, reduces the pressure on database access, and ensures the real-time performance and accuracy of data display in high-concurrency scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115357619B_ABST
    Figure CN115357619B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of data caching, and particularly relates to a data caching method and device, a server and a storage medium. The data caching method comprises the following steps: sending a first data request message to a first database based on a first timing task, the first timing task comprising: requesting a specific amount of original data from the first database at a timing; obtaining the original data sent by the first database, and processing the original data to obtain cached data; sending the cached data to a second database for caching; sending a second data request message to the second database based on a second timing task, the second timing task comprising: requesting a specific amount of cached data of a specific type from the second database at a timing; and obtaining the cached data sent by the second database and updating the cached data to a local cache. The method of the present disclosure reduces the response time of the requested data, reduces the direct access to the database in a high-concurrency scenario, and relieves the pressure on the database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data caching technology, and in particular to a data caching method, apparatus, server, and storage medium. Background Technology

[0002] A marquee animation is a type of animation effect that scrolls through messages, implemented through programming. The data used to display a marquee animation is called marquee data.

[0003] In existing technologies, scrolling data is generally stored in a database. When displaying detailed information about a specific scrolling data, the original data needs to be retrieved from the database, processed according to the settings of the front-end page, and then displayed through the front-end page.

[0004] However, in related technologies, the response time for retrieving marquee data by querying the database is relatively long, and frequent database queries in high-concurrency scenarios can lead to excessive pressure on the database, thereby reducing database availability and ultimately reducing the performance of the entire system. Summary of the Invention

[0005] This disclosure provides a data caching method, apparatus, server, and storage medium to at least solve the problems of long data request response time and high database pressure in related technologies.

[0006] The technical solution disclosed herein is as follows:

[0007] According to a first aspect of the present disclosure, a data caching method is provided, comprising:

[0008] Based on the first scheduled task, a first data request message is sent to the first database. The first scheduled task includes: periodically requesting a specific amount of raw data from the first database.

[0009] Obtain the raw data sent by the first database, and process the raw data to obtain cached data;

[0010] Send the cached data to the second database for caching;

[0011] A second data request message is sent to the second database based on a second scheduled task; wherein the second scheduled task includes: periodically requesting a specific amount of cached data of a specific type from the second database;

[0012] Obtain the cached data sent by the second database and update the cached data in the local cache.

[0013] Optionally, the method further includes:

[0014] Receive data display requests;

[0015] The data requested by the data display request is retrieved from the local cache and displayed on the front end.

[0016] Optionally, processing the original data to obtain cached data includes classifying each piece of data in the original data.

[0017] Optionally, the second database is used to store different types of cached data in separate queues, wherein different types of cached data correspond to different queues.

[0018] Optionally, different queues correspond to a maximum cache threshold; the second database is also used for:

[0019] If the current storage amount of the queue exceeds the maximum cache threshold corresponding to the queue, the earliest data stored in the queue is removed so that the storage amount of the queue after the removal is less than or equal to the maximum cache threshold corresponding to the queue.

[0020] Optionally, the specific quantity is determined based on the scrolling rate of the data when it is displayed on the front end.

[0021] According to a second aspect of the present disclosure, a data caching device is provided, comprising:

[0022] The first sending unit is configured to send a first data request message to the first database based on a first timed task, wherein the first timed task includes: periodically requesting a specific amount of raw data from the first database;

[0023] The first acquisition unit is configured to acquire the raw data sent by the first database and process the raw data to obtain cached data.

[0024] The second sending unit is configured to send the cached data to the second database for caching.

[0025] The third sending unit is configured to send a second data request message to the second database based on a second timed task; wherein the second timed task includes: periodically requesting a specific amount of cached data of a specific type from the second database;

[0026] The second acquisition unit is configured to acquire cached data sent by the second database and update the cached data to the local cache.

[0027] Optionally, the device further includes:

[0028] The receiving unit is configured to receive data display requests;

[0029] The display unit is configured to retrieve the data requested by the data display request from the local cache and display it on the front end based on the data.

[0030] Optionally, the first acquisition unit is configured to classify each piece of data in the original data.

[0031] According to a third aspect of this disclosure, a server is provided, comprising:

[0032] processor;

[0033] Memory used to store the processor's executable instructions;

[0034] The processor is configured to execute the instructions to implement the data caching method described in the first aspect.

[0035] According to a fourth aspect of this disclosure, a storage medium is provided that, when instructions in the storage medium are executed by a server's processor, enables the server to perform a data caching method as described in the first aspect.

[0036] The technical solutions provided by the embodiments of this disclosure have at least the following beneficial effects:

[0037] In some or related embodiments, a first data request message is sent to a first database based on a first scheduled task to obtain the original data sent by the first database. The original data is then processed to obtain cached data. Subsequently, the cached data is sent to a second database for caching. A second data request message is then sent to the second database based on a second scheduled task to obtain the cached data sent by the second database, and the cached data is updated in the local cache. Therefore, in this embodiment of the present disclosure, by updating the cached data to the local cache, when a data display request is received, the requested data can be directly obtained from the local cache and displayed on the front end, without querying the database. This reduces the response time for requesting data. Furthermore, in high-concurrency scenarios, the requested data can also be obtained from the local cache without simultaneously accessing the database, thereby reducing direct database access and alleviating database pressure.

[0038] Furthermore, in this embodiment of the disclosure, the first database stores the original data, and before caching the data to the local cache, the original data in the first database is classified and cached to the second database, and the data in the second cache database is updated regularly. This realizes the classification management and real-time update of the data, so that the local cache can obtain different types of real-time and latest cached data through the second database. Then, when the data in the local cache is displayed on the front end, it is ensured that the displayed data can keep up with the timeliness of current hot events.

[0039] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0040] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.

[0041] Figure 1 This is a flowchart illustrating a data caching method according to an exemplary embodiment;

[0042] Figure 2 This is a flowchart illustrating a data caching method according to an exemplary embodiment;

[0043] Figure 3 This is a block diagram illustrating a data caching device according to an exemplary embodiment;

[0044] Figure 4 This is a block diagram illustrating a data caching device according to an exemplary embodiment;

[0045] Figure 5 This is a block diagram illustrating a server according to an exemplary embodiment. Detailed Implementation

[0046] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0047] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0048] Figure 1 This is a flowchart illustrating a data caching method according to an exemplary embodiment, such as... Figure 1 As shown, the data caching method may include the following steps:

[0049] In step S11, a first data request message is sent to the first database based on the first scheduled task.

[0050] In some embodiments, the first timed task may include: periodically requesting a specific amount of raw data from a first database, wherein the first timed task may further include the type of raw data requested (e.g., news).

[0051] In some embodiments, the aforementioned request for a specific amount of raw data may be marquee data that the front-end page needs to scroll and display; the aforementioned specific amount may be determined based on the scrolling rate of the marquee data when it is displayed on the front end.

[0052] For example, assuming the scrolling rate of the marquee data displayed on the front end is 3 rows / s (i.e., 3 rows of data are displayed per second), and the unit time is 1 minute, then the specific number determined based on the scrolling rate of the marquee data displayed on the front end = rate × unit time = 3 rows / s × 60s = 180 rows of data.

[0053] In some embodiments, the first scheduled task can be pre-set by the user according to the needs of the front-end page to display marquee data, and the time interval of the first scheduled task can be set according to the user's needs, such as an interval of 3 minutes. Furthermore, the first scheduled task can be automatically executed when its execution time is reached.

[0054] In some embodiments, the first database mentioned above can be a MySQL database, and the MySQL database stores all the original data.

[0055] Furthermore, in some embodiments, the first data request message sent to the MySQL database may include the type and a specific quantity of the requested marquee raw data. Also, in some embodiments, after receiving the first data request message, the MySQL database may, based on the type and specific quantity of the marquee raw data in the first data request message, return the corresponding quantity of marquee raw data retrieved from the MySQL database.

[0056] In step S12, the original data sent by the first database is obtained, and the original data is processed to obtain cached data.

[0057] In some embodiments, the front-end page needs to display and update different original marquee data according to the type of the original marquee data (e.g., entertainment, news). Therefore, the original marquee data sent by the first database cannot be directly cached. The original marquee data needs to be processed to obtain the corresponding cached data.

[0058] In some embodiments, the method for processing the original data to obtain cached data may include classifying each piece of data in the original data. Specifically, the data can be classified according to its content, and a corresponding type identifier can be added to obtain cached data. Furthermore, after classifying each piece of data in the original data and adding a type identifier to obtain cached data, the cached data can be directly returned to the front-end page for display based on its corresponding type.

[0059] In step S13, cached data is sent to the second database for caching.

[0060] In some embodiments, the second database mentioned above can be a Redis database.

[0061] In some embodiments, the second database is used to: store different types of cached data in separate queues, wherein different types of cached data correspond to different queues. Furthermore, each queue corresponds to a maximum cache threshold (i.e., the maximum amount of data a queue can store).

[0062] In some embodiments, the second database is also used to: if the current storage amount of the queue exceeds the maximum cache threshold corresponding to the queue, remove the earliest data stored in the queue, so that the storage amount of the queue after removal is less than or equal to the maximum cache threshold corresponding to the queue.

[0063] For example, suppose the maximum cache threshold for entertainment-type marquee data is 30 entries. If two entertainment-type marquee data entries are received and the current storage capacity of the entertainment-type queue is 30 entries, then the current storage capacity of the entertainment-type queue exceeds the maximum cache threshold corresponding to the queue. In this case, the two earliest entries stored in the entertainment-type queue are removed, and the two received entertainment-type marquee data entries are stored in the entertainment-type queue in the second database.

[0064] In some embodiments, the second database can store different types of marquee cache data by means of type identifiers of the marquee cache data, and control the amount of marquee cache data corresponding to each type in the second database by limiting the length of different types of queues, so that different types of real-time updated marquee cache data can be obtained through the second database.

[0065] In step S14, a second data request message is sent to the second database based on the second scheduled task.

[0066] In some embodiments, the second scheduled task can be: periodically requesting a specific quantity of cached data of a specific type from a second database. This request for a specific quantity of cached data of a specific type from the second database can refer to the type of data that the front-end page needs to display and the corresponding quantity of data for that type.

[0067] For example, the second scheduled task includes: 20 entertainment tasks and 10 video tasks.

[0068] Furthermore, in some embodiments, the second data request message sent to the second database may include a specific type and a corresponding specific quantity of cached data requested. Also, in some embodiments, after receiving the second data request message, the second database may, based on the specific type of cached data requested and the corresponding quantity of data for that specific type in the second data request message, retrieve the latest specific quantity of scrolling cache data from the type queue corresponding to that specific type.

[0069] It should be noted that in some embodiments, the aforementioned second scheduled task can be pre-set in the server by the user based on the requirements of the front-end page to display marquee data. Based on this, the user can flexibly configure the specific type and the specific quantity of cached data obtained from the second database according to their needs. Furthermore, the timing interval of the second scheduled task can be set according to the user's needs, for example, an interval of 5 minutes.

[0070] In step S15, the cached data sent by the second database is obtained and the cached data is updated in the local cache.

[0071] In some embodiments, the method of updating cached data to the local cache may include: deleting the scrolling cache data in the original local cache and updating the cached data to the local cache.

[0072] In some embodiments, cached data is updated to the local cache. Then, when a data display request is received, the data requested by the data display request can be directly obtained from the local cache and displayed on the front end based on the data. This reduces the response time for data requests. In high-concurrency scenarios, the requested data can also be obtained from the local cache without accessing the database, thereby reducing direct access to the database and alleviating the pressure on the database.

[0073] In summary, in some or related embodiments, a first data request message is sent to a first database based on a first scheduled task to obtain the original data sent by the first database. The original data is then processed to obtain cached data. Subsequently, the cached data is sent to a second database for caching. A second data request message is then sent to the second database based on a second scheduled task to obtain the cached data sent by the second database, and the cached data is updated in the local cache. Therefore, in this embodiment of the present disclosure, by updating the cached data in the local cache, when a data display request is received, the requested data can be directly obtained from the local cache and displayed on the front end, without querying the database. This reduces the response time for requesting data. Furthermore, in high-concurrency scenarios, the requested data can also be obtained from the local cache without simultaneously accessing the database, thereby reducing direct database access and alleviating database pressure.

[0074] Furthermore, in this embodiment of the disclosure, the first database stores the original data, and before caching the data to the local cache, the original data in the first database is classified and cached to the second database, and the data in the second cache database is updated regularly. This realizes the classification management and real-time update of the data, so that the local cache can obtain different types of real-time and latest cached data through the second database. Then, when the data in the local cache is displayed on the front end, it is ensured that the displayed data can keep up with the timeliness of current hot events.

[0075] Figure 2 This is a flowchart illustrating a data caching method according to an exemplary embodiment, such as... Figure 2 As shown, the data caching method may include the following steps:

[0076] In step S21, a first data request message is sent to the first database based on the first scheduled task.

[0077] In step S22, the original data sent by the first database is obtained, and the original data is processed to obtain cached data.

[0078] In step S23, cached data is sent to the second database for caching.

[0079] In step S24, a second data request message is sent to the second database based on the second scheduled task.

[0080] In step S25, the cached data sent by the second database is obtained and the cached data is updated in the local cache.

[0081] For a detailed description of steps S21-S25, please refer to the relevant descriptions in the above embodiments. This disclosure will not repeat the details here.

[0082] In step S26, a data display request is received.

[0083] In some embodiments, the front page may display the title of the marquee data. When a user wants to obtain the detailed content of the marquee data, they can click on the marquee data to send a request to display the marquee data.

[0084] In step S27, the data requested by the data display request is obtained from the local cache and displayed on the front end based on the data.

[0085] In summary, in some or related embodiments, a first data request message is sent to a first database based on a first scheduled task to obtain the original data sent by the first database. The original data is then processed to obtain cached data. Subsequently, the cached data is sent to a second database for caching. A second data request message is then sent to the second database based on a second scheduled task to obtain the cached data sent by the second database, and the cached data is updated in the local cache. Therefore, in this embodiment of the present disclosure, by updating the cached data in the local cache, when a data display request is received, the requested data can be directly obtained from the local cache and displayed on the front end, without querying the database. This reduces the response time for requesting data. Furthermore, in high-concurrency scenarios, the requested data can also be obtained from the local cache without simultaneously accessing the database, thereby reducing direct database access and alleviating database pressure.

[0086] Furthermore, in this embodiment of the disclosure, the first database stores the original data, and before caching the data to the local cache, the original data in the first database is classified and cached to the second database, and the data in the second cache database is updated regularly. This realizes the classification management and real-time update of the data, so that the local cache can obtain different types of real-time and latest cached data through the second database. Then, when the data in the local cache is displayed on the front end, it is ensured that the displayed data can keep up with the timeliness of current hot events.

[0087] Figure 3 This is a block diagram illustrating a data caching device according to an exemplary embodiment. (Refer to...) Figure 3 The data caching device includes:

[0088] The first sending unit 301 is configured to send a first data request message to the first database based on a first timed task, wherein the first timed task includes: periodically requesting a specific amount of raw data from the first database.

[0089] The first acquisition unit 302 is configured to acquire the raw data sent by the first database and process the raw data to obtain cached data.

[0090] The second sending unit 303 is configured to send cached data to the second database for caching.

[0091] The third sending unit 304 is configured to send a second data request message to the second database based on a second timed task; wherein the second timed task includes: periodically requesting a specific amount of cached data of a specific type from the second database;

[0092] The second acquisition unit 305 is configured to acquire cached data sent by the second database and update the cached data to the local cache.

[0093] Optional, Figure 4 This is a block diagram illustrating a data caching device according to an exemplary embodiment. (Refer to...) Figure 4 The data caching device also includes:

[0094] The receiving unit 306 is configured to receive data display requests;

[0095] Display unit 307 is configured to retrieve the data requested by the data display request from the local cache and display it on the front end based on the data.

[0096] Optionally, the first acquisition unit 302 is configured to classify each piece of data in the original data.

[0097] In summary, in some or related embodiments, a first data request message is sent to a first database based on a first scheduled task to obtain the original data sent by the first database. The original data is then processed to obtain cached data. Subsequently, the cached data is sent to a second database for caching. A second data request message is then sent to the second database based on a second scheduled task to obtain the cached data sent by the second database, and the cached data is updated in the local cache. Therefore, in this embodiment of the present disclosure, by updating the cached data in the local cache, when a data display request is received, the requested data can be directly obtained from the local cache and displayed on the front end, without querying the database. This reduces the response time for requesting data. Furthermore, in high-concurrency scenarios, the requested data can also be obtained from the local cache without simultaneously accessing the database, thereby reducing direct database access and alleviating database pressure.

[0098] Furthermore, in this embodiment of the disclosure, the first database stores the original data, and before caching the data to the local cache, the original data in the first database is classified and cached to the second database, and the data in the second cache database is updated regularly. This realizes the classification management and real-time update of the data, so that the local cache can obtain different types of real-time and latest cached data through the second database. Then, when the data in the local cache is displayed on the front end, it is ensured that the displayed data can keep up with the timeliness of current hot events.

[0099] Figure 5 This is a block diagram illustrating a server according to an exemplary embodiment. Figure 5 As shown, the server includes a memory 501 and a processor 502. Additionally, the server also includes necessary components such as a power supply unit 503 and a communication unit 504.

[0100] Memory 501 is used to store computer programs and can be configured to store various other data to support operation on the electronic device. Examples of this data include instructions for any application or method used to operate on the electronic device.

[0101] The memory 501 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0102] Communication component 504 is used for data transmission with other devices.

[0103] Processor 502 can execute computer instructions stored in memory 501 to perform the above-described methods.

[0104] Accordingly, embodiments of this disclosure also provide a computer-readable storage medium storing a computer program. When the computer-readable storage medium stores a computer program, and the computer program is executed by one or more processors, it causes one or more processors to perform... Figure 1 Each step in the method embodiment.

[0105] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied 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.

[0106] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0107] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0108] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0109] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0110] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0111] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0112] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.

[0113] The above are merely specific embodiments of this disclosure, enabling those skilled in the art to understand or implement this disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to these embodiments, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

[0114] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0115] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A data caching method, characterized in that, The method includes: Based on a first scheduled task, a first data request message is sent to a first database. The first scheduled task includes: periodically requesting a specific amount of raw data from the first database, wherein the specific amount is determined based on the scrolling rate of the data when it is displayed on the front end. Obtain the raw data sent by the first database, and process the raw data to obtain cached data; The cached data is sent to the second database for caching; the second database is used to: store different types of cached data in separate queues, wherein different types of cached data correspond to different queues, and each queue corresponds to a maximum cache threshold; if the current storage amount of the queue exceeds the maximum cache threshold corresponding to the queue, the earliest data stored in the queue is removed, so that the storage amount of the queue after removal is less than or equal to the maximum cache threshold corresponding to the queue. A second data request message is sent to the second database based on a second scheduled task, wherein the second scheduled task includes: periodically requesting a specific amount of cached data of a specific type from the second database; Obtain the cached data sent by the second database and update the cached data in the local cache.

2. The method according to claim 1, characterized in that, The method further includes: Receive data display requests; The data requested by the data display request is retrieved from the local cache and displayed on the front end.

3. The method according to claim 1, characterized in that, The process of processing the original data to obtain cached data includes: classifying each piece of data in the original data.

4. A data caching device, characterized in that, The device includes: The first sending unit is configured to send a first data request message to a first database based on a first timed task. The first timed task includes: periodically requesting a specific amount of raw data from the first database, wherein the specific amount is determined based on the scrolling rate of the data when it is displayed on the front end. The first acquisition unit is configured to acquire the raw data sent by the first database and process the raw data to obtain cached data. The second sending unit is configured to send the cached data to the second database for caching; the second database is used to: store different types of cached data in separate queues, wherein different types of cached data correspond to different queues, and each queue corresponds to a maximum cache threshold; if the current storage amount of the queue exceeds the maximum cache threshold corresponding to the queue, the earliest data stored in the queue is removed, so that the storage amount of the queue after removal is less than or equal to the maximum cache threshold corresponding to the queue. The third sending unit is configured to send a second data request message to the second database based on a second timed task; wherein the second timed task includes: periodically requesting a specific amount of cached data of a specific type from the second database; The second acquisition unit is configured to acquire cached data sent by the second database and update the cached data to the local cache.

5. The apparatus according to claim 4, characterized in that, The device further includes: The receiving unit is configured to receive data display requests; The display unit is configured to retrieve the data requested by the data display request from the local cache and display it on the front end based on the data.

6. The apparatus according to claim 4, characterized in that, The first acquisition unit is configured to classify each piece of data in the original data.

7. A server, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the method as described in any one of claims 1-3.

8. A storage medium, wherein instructions in the storage medium, when executed by a processor of a server, enable the server to perform the method as described in any one of claims 1-3.