Data pre-warming caching method, device, equipment and storage medium
By pre-warming and caching hot data to cache nodes and local storage before internet events, the performance impact caused by high concurrency in the leaderboard system was resolved, and the system's high availability and data reading efficiency were improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA CONSTRUCTION BANK
- Filing Date
- 2022-09-30
- Publication Date
- 2026-04-17
AI Technical Summary
In the lead-up to internet events, ranking systems face performance challenges due to high concurrency requests, resulting in decreased throughput and response latency, which impacts system availability and user experience.
Before the target information is published, hot data related to the target information is identified and preheated from the database to cache nodes and local storage. Target nodes are selected for caching according to preset rules, and data is read from local storage when an access request is received.
It improved the system's high availability and throughput efficiency, enhanced data reading efficiency and user data acquisition speed, and improved the user experience.
Smart Images

Figure CN115510107B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of big data processing technology, and in particular to a data preheating and caching method, apparatus, device and storage medium. Background Technology
[0002] With the development of the internet, various social media viral marketing campaigns are conducted before each event to promote the platform and acquire customers through more channels. Ranking systems have become a crucial component of these campaigns. At the beginning of an event, there is often a surge in concurrency for the same ranking data, with a massive number of users simultaneously accessing the ranking system to view online rankings. For data in a single state, this leads to a problem of concurrent requests flowing back to the database, significantly impacting overall system performance. If all instantaneous accesses penetrate the database for responses, it can easily result in decreased throughput, data read waiting times, and response delays. This not only compromises system high availability but also severely impacts user experience. Summary of the Invention
[0003] This application provides a data preheating caching method, apparatus, device, and storage medium, which aims to at least partially solve one of the technical problems in the related art.
[0004] In a first aspect, this application provides a data preheating caching method, which, before the target information is published, determines the first hot data to be accessed related to the target information; retrieves the first hot data from the database and writes it to multiple cache nodes; determines the target node among the multiple cache nodes according to preset rules, and writes the second hot data cached by the target node to local storage; and, in response to receiving a second hot data access request, reads the second hot data from local storage and returns it.
[0005] Secondly, this application provides a data preheating caching device, comprising: a first determining module, configured to determine first hot data to be accessed related to the target information before the target information is published; a first writing module, configured to retrieve the first hot data from a database and write it to multiple cache nodes; a second writing module, configured to determine a target node among the multiple cache nodes according to preset rules and write the second hot data cached by the target node to local storage; and a reading module, configured to read the second hot data from local storage and return it in response to receiving a second hot data access request.
[0006] Thirdly, this application provides an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute instructions to implement a data preheating cache method.
[0007] Fourthly, this application provides a computer-readable storage medium that, when the instructions in the computer-readable storage medium are executed by the processor of an electronic device, enables the electronic device to perform a data preheating caching method.
[0008] Fifthly, this application provides a computer program product, including a computer program, wherein the computer program is executed by a processor using a data preheating cache method.
[0009] The data preheating and caching method, apparatus, device, and storage medium provided in this application, by identifying first hot data related to the target information to be accessed before the target information is published, retrieving the first hot data from the database and writing it to multiple cache nodes, determining the target node among the multiple cache nodes according to preset rules, writing the second hot data cached on the target node to local storage, and responding to a received second hot data access request by reading the second hot data from local storage and returning it, can utilize multiple cache nodes to preheat and cache hot data. Therefore, it can ensure high system availability and improve throughput efficiency. In addition, after preheating and caching, the cached data is stored in local storage and read from local storage, thus further improving data reading efficiency. Therefore, it can speed up the user's data retrieval and improve the user experience. Attached Figure Description
[0010] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0011] Figure 1 This is a schematic flowchart of a data preheating and caching method according to the first embodiment of this application;
[0012] Figure 2 This is a flowchart illustrating a data preheating and caching method according to a second embodiment of this application;
[0013] Figure 3 This is a flowchart illustrating a data preheating and caching method according to a second embodiment of this application;
[0014] Figure 4 This is a block diagram of a data preheating buffer device according to this application;
[0015] Figure 5 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present application is shown.
[0016] The accompanying drawings have illustrated specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to specific embodiments. Detailed Implementation
[0017] The embodiments of this application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application. Rather, the embodiments of this application include all variations, modifications, and equivalents falling within the spirit and scope of the appended claims.
[0018] It should be noted that the execution subject of the data preheating caching method in this embodiment can be a data preheating caching device, which can be implemented by software and / or hardware. The device can be configured in an electronic device, which may include, but is not limited to, a terminal, a server, etc.
[0019] To implement the data preheating and caching method provided in this embodiment, this embodiment also provides a data processing architecture, including: a front-end cluster, a back-end application service cluster, a preheating service cluster, a cache cluster (including multiple cache nodes), and a database. The preheating service cluster includes a timed batch task triggering module and a read / write cache module, and the data preheating and caching method of this embodiment can be executed by the preheating service cluster.
[0020] Figure 1 This is a flowchart illustrating a data preheating and caching method according to the first embodiment of this application, as shown below. Figure 1 As shown, the method includes:
[0021] S101: Before the target information is published, identify the first hot data related to the target information that needs to be accessed.
[0022] The target information can be information with a large number of visits on the Internet, such as user ranking information of e-commerce activities, or any other possible information, without any restrictions.
[0023] Hot data that is relevant to the target information and has a large number of visits can be called the first hot data. For example, if many users visit the top ten of the rankings, then the data of the top ten users can be called the first hot data. Similarly, if many users visit the top three of the rankings, then the data of the top three users can also be called the first hot data. It is understood that the first hot data can be one or more data, and there is no restriction on this.
[0024] In practical applications, a large number of users participate simultaneously in the initial stage of target information release, resulting in high instantaneous concurrency. In view of this, the preheating service cluster of this disclosure embodiment can perform preheating caching operations on the first hot data in batches at regular intervals before the target information (e.g., user leaderboard) is released.
[0025] For example, if the target information is published at time P, the database information is read at time s, and the cache read time is t, then in this embodiment, the first hot data can be determined s+t time units before time P, that is, a timed batch preheating cache task is executed.
[0026] Some embodiments, such as analyzing user leaderboard information from historical activities, can determine the top trending data in the current user leaderboard, or the top trending data can be determined in any other possible way, without limitation.
[0027] In other embodiments, the preheating service cluster can also periodically identify cold data to be accessed that is related to the target information in batches.
[0028] Data that is relevant to the target information and has low access volume can be called cold data. For example, if each user accesses their own ranking in the leaderboard, only that user will access it. In this case, the user's ranking data can be called cold data. Alternatively, cold data can be any other possible data with low access volume, without any restrictions.
[0029] S102: Retrieve the first hot data from the database and write it to multiple cache nodes.
[0030] The database is used to store all data related to the target information. After the first hot data is determined, the preheating service cluster in this embodiment can obtain the first hot data from the database and write the first hot data into multiple cache nodes of the cache cluster.
[0031] In some embodiments, when there are multiple pieces of first hot data, these pieces of first hot data can be stored in multiple cache nodes, with each cache node caching one piece of hot data.
[0032] In some embodiments, the aforementioned cold data can also be cached; that is, this embodiment also supports batch caching operations for cold data.
[0033] S103: Determine the target node among multiple cache nodes according to preset rules, and write the second hot data cached by the target node to local storage.
[0034] In other words, in this embodiment of the present disclosure, one or more nodes can be selected as the target node from multiple cache nodes according to preset rules, and the hot data cached in the target node (i.e., any first hot data) can be called the second hot data, that is to say, the second hot data belongs to the first hot data.
[0035] In some embodiments, the preset rule may be, for example, a data volume rule. Specifically, in this embodiment, the target node can be determined based on the amount of data cached by multiple cache nodes. For example, the target node can be selected by sorting the data volume of the first hot data stored in each cache node and selecting the single node with the largest amount of cached data (big key).
[0036] In other embodiments, the preset rule can also be a data popularity rule, that is, the popularity of each first hot data item. Specifically, this embodiment can determine the target node based on the data popularity of data cached by multiple cache nodes. For example, multiple cache nodes can be sorted according to the data popularity of the first hot data stored in each cache node, and the single node with the highest data popularity (hot key) can be used as the target node. It is understood that the data popularity can be determined when determining the first hot data, and there is no limitation on this.
[0037] In this embodiment, after determining the target node, the second hot data cached by the target node can be written to local storage, such as to a local read / write disk.
[0038] S104: In response to receiving a second hotspot data access request, read the second hotspot data from local storage and return it.
[0039] Furthermore, during the release of target information, this embodiment can monitor for access requests for second hot data, i.e., whether a user is accessing the second hot data. If a user accesses the second hot data, this embodiment can receive the access request, read the second hot data from local storage, and return it to the user. Therefore, this process reads hot data from pre-warmed cached local storage, without needing to query hot data in the database, thereby improving data reading efficiency.
[0040] In some embodiments, the cached first hot data (including second hot data) can have a cache expiration period r. This cache expiration period r can be set to be greater than s and t. Considering the possibility of network jitter and database resource contention, the value of r should be set much greater than the sum of s and t. In the operation of reading the second hot data, it is first determined whether the current cache time of the second hot data exceeds the cache expiration period r, that is, whether the second hot data has exceeded the cache period. Further, if it is determined that the cache time of the second hot data has not exceeded the cache expiration period, the second hot data is read from local storage and returned. If the cache expiration period r has exceeded, the cache of the second hot data has been cleared. In this case, this embodiment reads the second hot data from the database.
[0041] It should be noted that the acquisition, storage, and application of data involved in the technical solution of this application all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0042] This embodiment of the disclosure identifies first hot data related to the target information to be accessed before the target information is published, retrieves the first hot data from the database and writes it to multiple cache nodes, determines the target node among the multiple cache nodes according to preset rules, writes the second hot data cached on the target node to local storage, and reads and returns the second hot data from local storage in response to a received second hot data access request. This allows for pre-warming caching using multiple cache nodes, thus ensuring high system availability and improving throughput efficiency. Furthermore, after pre-warming the cache, the cached data is stored in local storage and read from local storage, further improving data retrieval efficiency. Therefore, it can speed up the user's data retrieval and improve the user experience.
[0043] Figure 2 This is a flowchart illustrating a data preheating and caching method according to a second embodiment of this application, as shown below. Figure 2 As shown, the method includes:
[0044] S201: Before the target information is published, identify the first hot data related to the target information that needs to be accessed.
[0045] S202: Retrieve the first hot data from the database and write it to multiple cache nodes.
[0046] S203: Determine the target node among multiple cache nodes according to preset rules, and write the second hot data cached by the target node to local storage.
[0047] For detailed explanations of S201-203, please refer to the above embodiments, which will not be repeated here.
[0048] S204: Use page cache to map the second hot spot data into memory.
[0049] After writing the second hot data cached by the target node to local storage, this embodiment of the present disclosure can further utilize a page cache to map the second hot data stored locally into memory. The validity period u of the second hot data in memory can be set.
[0050] S205: In response to receiving a second hotspot data access request, read the second hotspot data from memory and return it.
[0051] Furthermore, in the operation of reading the second hot data, the second hot data can be read directly from memory and returned.
[0052] In some embodiments, the data processing architecture of this embodiment can, for example, employ socket network communication and call the sendfile function for data read and write operations. In this embodiment, when using sendfile for socket network communication, data copying between the user and the operating system kernel can be avoided. Data is directly transferred using two file descriptors. Assuming the time to read the second hot data from memory is v, data accuracy can be guaranteed as long as u+v is less than r+t. Therefore, this embodiment maps locally stored hot data to memory, which can greatly improve cached data throughput and read efficiency.
[0053] This embodiment of the disclosure identifies first hot data related to the target information to be accessed before the target information is published, retrieves the first hot data from the database and writes it to multiple cache nodes, determines the target node among the multiple cache nodes according to preset rules, writes the second hot data cached on the target node to local storage, and reads and returns the second hot data from local storage in response to a received second hot data access request. This allows for pre-warming caching using multiple cache nodes, thus ensuring high system availability and improving throughput efficiency. Furthermore, after pre-warming the cache, the cached data is stored in local storage and read from local storage, further improving data retrieval efficiency. Therefore, it speeds up data retrieval for users and improves user experience. In addition, this embodiment maps hot data from local storage to memory, which can significantly improve cached data throughput and read efficiency.
[0054] Figure 3 This is a flowchart illustrating a data preheating and caching method according to a third embodiment of this application, as shown below. Figure 3 As shown, the method includes:
[0055] S301: Before the target information is published, identify the first hot data related to the target information that needs to be accessed.
[0056] S302: Retrieves the first hot data from the database and writes it to multiple cache nodes.
[0057] For detailed descriptions of S301-302, please refer to the above embodiments, which will not be repeated here.
[0058] S303: In response to a database update operation, update the first hot data cached on multiple cache nodes.
[0059] In this embodiment of the disclosure, the first hot spot data in the preheating cache can also be updated.
[0060] In some implementations, database updates can trigger first hot data update operations on multiple cache nodes.
[0061] For example, if the user ranking data changes, the data in the database will be updated accordingly, and the top trending data will also change. In this case, embodiments of this disclosure can update the top trending data cached on multiple cache nodes based on the database update results.
[0062] S304: Update the first hot data cached on multiple cache nodes according to the preset update interval.
[0063] In some embodiments, the update interval M can be set according to actual business needs. For example, if the user leaderboard updates quickly, a smaller update interval M can be set; if the user leaderboard updates slowly, the update interval M can be extended. M can be set to be less than r and greater than u. The smaller M is, the higher the real-time accuracy of the data. In this embodiment, the first hot data cached by multiple cache nodes can be updated according to the preset update interval. That is, the first hot data cached by multiple cache nodes is updated once every update interval M. Therefore, by updating the first hot data cached by multiple cache nodes, this embodiment can ensure the real-time performance of the cached hot data and avoid reading dirty data from the pre-warmed cache.
[0064] S305: Determine the target node among multiple cache nodes according to preset rules, and write the second hot data cached by the target node to local storage.
[0065] S306: In response to receiving a second hotspot data access request, read the second hotspot data from local storage and return it.
[0066] For detailed descriptions of S305-306, please refer to the above embodiments, which will not be repeated here.
[0067] This embodiment of the disclosure identifies first hot data related to the target information to be accessed before the target information is published, retrieves the first hot data from the database and writes it to multiple cache nodes, determines the target node among the multiple cache nodes according to preset rules, writes the second hot data cached by the target node to local storage, and reads and returns the second hot data from local storage in response to a received second hot data access request. This allows for pre-warming caching using multiple cache nodes, thus ensuring high system availability and improving throughput efficiency. Furthermore, after pre-warming the cache, the cached data is stored in local storage and read from local storage, further improving data retrieval efficiency. Therefore, it speeds up data retrieval for users and improves user experience. In addition, this embodiment ensures the real-time nature of the cached hot data by updating the first hot data cached by multiple cache nodes, avoiding the reading of dirty data from the pre-warming cache.
[0068] Figure 4 This is a block diagram of a data preheating buffer device according to this application, such as Figure 4 As shown, the data preheating cache device 40 includes:
[0069] The first determining module 401 is used to determine the first hot data related to the target information to be accessed before the target information is published.
[0070] The first write module 402 is used to retrieve the first hot data from the database and write it to multiple cache nodes;
[0071] The second write module 403 is used to determine the target node among multiple cache nodes according to preset rules, and write the second hot data cached on the target node to local storage; and
[0072] The read module 404 is used to read the second hotspot data from local storage and return it in response to receiving a second hotspot data access request.
[0073] In some embodiments, device 40 further includes a mapping module for mapping second hotspot data to memory using page cache memory;
[0074] Furthermore, the read module 404 is specifically used to: read the second hotspot data from memory and return it in response to the access request.
[0075] In some embodiments, the second writing module 403 is specifically used for:
[0076] The target node is determined based on the amount of data cached by multiple cache nodes; or
[0077] The target node is determined based on the data popularity of cached data across multiple cache nodes.
[0078] In some embodiments, device 40 further includes an update module for:
[0079] In response to a database update operation, the first hot data cached on multiple cache nodes is updated; or the first hot data cached on multiple cache nodes is updated according to a preset update interval.
[0080] In some embodiments, the reading module 404 is specifically used for:
[0081] Determine whether the caching time of the second most popular data has exceeded the cache expiration period; and
[0082] If the caching time of the second hot data has not exceeded the cache expiration period, read the second hot data from local storage and return it.
[0083] In some embodiments, the apparatus further includes a second determining module for determining cold data to be accessed related to the target information and caching the cold data.
[0084] In this embodiment, before the target information is published, first hot data related to the target information and to be accessed is identified. This first hot data is retrieved from the database and written to multiple cache nodes. A target node is determined from among the multiple cache nodes according to preset rules, and second hot data cached on the target node is written to local storage. In response to a request to access the second hot data, the second hot data is read from local storage and returned. This allows for pre-warming caching using multiple cache nodes, thus ensuring high system availability and improving throughput efficiency. Furthermore, after pre-warming the cache, the cached data is stored in local storage and read from local storage, further improving data retrieval efficiency. Therefore, the speed at which users obtain data can be accelerated, improving the user experience.
[0085] According to embodiments of this application, this application also provides an electronic device, a readable storage medium, and a computer program product.
[0086] Figure 5 This is a block diagram of an electronic device according to this application. For example, electronic device 500 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.
[0087] Reference Figure 5 The electronic device 500 may include one or more of the following components: processing component 502, memory 504, power supply component 506, multimedia component 508, audio component 510, input / output (I / O) interface 512, sensor component 514, and communication component 516.
[0088] Processing component 502 typically controls the overall operation of electronic device 500, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 502 may include one or more processors 620 to execute instructions to complete all or part of the steps of the methods described above. Furthermore, processing component 502 may include one or more modules to facilitate interaction between processing component 502 and other components. For example, processing component 502 may include a multimedia module to facilitate interaction between multimedia component 508 and processing component 502.
[0089] Memory 504 is configured to store various types of data to support the operation of electronic device 500. Examples of such data include instructions for any application or method operating on electronic device 500, contact data, phonebook data, messages, pictures, videos, etc. Memory 504 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.
[0090] Power supply component 506 provides power to various components of electronic device 500. Power supply component 506 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 500.
[0091] Multimedia component 508 includes a touch display screen that provides an output interface between electronic device 500 and user. In some embodiments, the touch display screen may include a liquid crystal display (LCD) and a touch panel (TP). The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 508 includes a front-facing camera and / or a rear-facing camera. When electronic device 500 is in an operating mode, such as a shooting mode or video mode, the front-facing camera and / or rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0092] Audio component 510 is configured to output and / or input audio signals. For example, audio component 510 includes a microphone (MIC) configured to receive external audio signals when electronic device 500 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 504 or transmitted via communication component 516.
[0093] In some embodiments, the audio component 510 further includes a speaker for outputting audio signals.
[0094] I / O interface 512 provides an interface between processing component 502 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0095] Sensor assembly 514 includes one or more sensors for providing state assessments of various aspects of electronic device 500. For example, sensor assembly 514 may detect the on / off state of electronic device 500, the relative positioning of components such as the display and keypad of electronic device 500, changes in position of electronic device 500 or a component of electronic device 500, the presence or absence of user contact with electronic device 500, orientation or acceleration / deceleration of electronic device 500, and temperature changes of electronic device 500. Sensor assembly 514 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 514 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 514 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0096] Communication component 516 is configured to facilitate wired or wireless communication between electronic device 500 and other devices. Electronic device 500 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 516 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 516 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0097] In an exemplary embodiment, the electronic device 500 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the data preheating and caching method described above.
[0098] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 504 including instructions, which can be executed by a processor 920 of an electronic device 500 to perform the above-described method. Optionally, the computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0099] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application 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 application are indicated by the following claims.
[0100] It should be understood that this application is not limited to the precise structure 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 application is limited only by the appended claims.
Claims
1. A data preheating and caching method, characterized in that, Applied to a data processing architecture, which includes a preheating service cluster, a cache cluster, and a database, the method includes: Before the target information is released, the preheating service cluster determines the first hot data to be accessed related to the target information; The preheating service cluster retrieves the first hot data from the database and writes it to multiple cache nodes of the cache cluster; A target node is determined from the plurality of cache nodes according to preset rules, and the second hot data cached by the target node is written to local storage, wherein the second hot data belongs to the first hot data; and In response to receiving a second hotspot data access request, the second hotspot data is read from the local storage and returned.
2. The method according to claim 1, characterized in that, After writing the second hot data cached by the target node to local storage, the method further includes: The second hotspot data is mapped to memory using a page cache. Furthermore, in response to receiving a second hotspot data access request, reading the second hotspot data from the local storage and returning it includes: In response to the access request, the second hotspot data is read from the memory and returned.
3. The method according to claim 1, characterized in that, The step of determining the target node among the plurality of cache nodes according to preset rules includes: The target node is determined based on the amount of data cached by the multiple cache nodes; or The target node is determined based on the data popularity of the cached data from the multiple cache nodes.
4. The method according to claim 1, characterized in that, After retrieving the first hot data from the database and writing it to multiple cache nodes, the process further includes: In response to the database update operation, the first hot data cached by the plurality of cache nodes is updated; or The first hot data cached by the multiple cache nodes is updated according to the preset update interval.
5. The method according to claim 1, characterized in that, The step of reading and returning the second hotspot data from the local storage includes: Determine whether the cache time of the second hot data has exceeded the cache expiration period; and If the caching time of the second hot data has not exceeded the caching period, the second hot data is read from the local storage and returned.
6. The method according to claim 1, characterized in that, The method further includes: Identify the cold data to be accessed that is related to the target information, and cache the cold data.
7. A data preheating and caching device, characterized in that, Applied to a data processing architecture, the data processing architecture including a preheating service cluster, a cache cluster, and a database, the device includes: The first determining module is used to determine, through the preheating service cluster, the first hot data to be accessed related to the target information before the target information is released; The first write module is used to obtain the first hot data from the database through the preheating service cluster and write it to multiple cache nodes of the cache cluster; The second write module is configured to determine a target node among the plurality of cache nodes according to preset rules, and write the second hot data cached by the target node into local storage, wherein the second hot data belongs to the first hot data; and The read module is used to read the second hotspot data from the local storage and return it in response to receiving a second hotspot data access request.
8. The apparatus according to claim 7, characterized in that, The device further includes: The mapping module is used to map the second hot data to memory using the page cache memory; Furthermore, the reading module is specifically used for: In response to the access request, the second hotspot data is read from the memory and returned.
9. The apparatus according to claim 7, characterized in that, The second writing module is specifically used for: The target node is determined based on the amount of data cached by the multiple cache nodes; or The target node is determined based on the data popularity of the cached data from the multiple cache nodes.
10. The apparatus according to claim 7, characterized in that, The device further includes an update module for: In response to the database update operation, the first hot data cached by the plurality of cache nodes is updated; or The first hot data cached by the multiple cache nodes is updated according to the preset update interval.
11. The apparatus according to claim 7, characterized in that, The reading module is specifically used for: Determine whether the cache time of the second hot data has exceeded the cache expiration period; and If the caching time of the second hot data has not exceeded the caching period, the second hot data is read from the local storage and returned.
12. The apparatus according to claim 7, characterized in that, The device further includes: The second determining module is used to determine the cold data to be accessed related to the target information and to cache the cold data.
13. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-6.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-6.
15. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method of any one of claims 1-6.
Citation Information
Patent Citations
Data request processing method and device, computer equipment and storage medium
CN112076464A
Data query method and system, equipment and storage medium
CN112307069A
Data processing method and device and storage medium
CN114281859A