Data reading method, device and equipment and readable storage medium

By introducing two linked lists in the storage system and reading data reading requests according to the prompt information processing data, the problem of hotspot data elimination caused by the LRU linked list has been solved, and the effect of reducing the repeated reading of hot data and improving the performance of the equipment is achieved.

CN119377266APending Publication Date: 2025-01-28TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202310930026.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-26
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

In existing storage systems, the limited length of the LRU linked list leads to a faster elimination of hot spot data, causing hot spot data to be read repeatedly, affecting equipment performance.

Method used

By introducing two linked lists in the cache unit, the first linked list is used to store the data requested by the request requesting the request of the prompt information. Data. According to the data and prompt information in the linked list, the data that is not in the two linked lists is determined from the target data, and the data is read from the disk unit, which is stored in the first linked list to reduce the elimination speed of the hot data.

Benefits of technology

By storing the large amount of data in the first linked list, reducing the elimination rate of hot data in the second linked list, reducing the phenomenon of repeated reading of hot data, and improving equipment performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119377266A_ABST
    Figure CN119377266A_ABST
Patent Text Reader

Abstract

The invention discloses a data reading method, device and equipment and a readable storage medium, and belongs to the technical field of storage. The method comprises the following steps: on the basis that a reading request of target data carries prompt information for prompting that the data volume of the target data is not less than a threshold value, determining first data which is not in a first linked list and is not in a second linked list from the target data according to data in the first linked list and data in the second linked list; and reading the first data from the disk unit and storing the first data in the first linked list. The first linked list and the second linked list are linked lists in the cache unit, the first linked list is used for storing data requested to be read by the data reading request carrying the prompt information, and the second linked list is used for storing data requested to be read by the data reading request not carrying the prompt information. By storing the data with larger data volume in the first linked list and storing the data with smaller data volume in the second linked list, the elimination speed of the hotspot data in the second linked list is reduced, and the equipment performance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of storage technology, and in particular to a data reading method, device, equipment and readable storage medium. Background Art

[0002] With the development of computers, more and more data need to be processed, and the amount of data is growing explosively, which brings many problems to the storage system.

[0003] In the related art, the storage system includes a cache unit and a disk unit, and data can be read from the disk unit and stored in the cache unit. The cache unit includes a least recently used (Least Recently Use, LRU) linked list, and the read data is stored at the head of the LRU linked list, causing the data originally stored in the LRU linked list to move to the tail of the LRU linked list. Since the length of the LRU linked list is limited, the data originally stored in the tail of the LRU linked list will be moved out of the LRU linked list, causing this part of the data to be eliminated.

[0004] In some cases, some data in the LRU list will be reused, and these reused data are hot data. When the amount of data read is large, the elimination speed of hot data will be accelerated, resulting in the phenomenon of hot data being read repeatedly, affecting device performance. Summary of the invention

[0005] The present application provides a data reading method, device, equipment and readable storage medium, which can reduce the elimination speed of hot data and improve equipment performance. The technical solution includes the following contents.

[0006] In one aspect, a data reading method is provided, the method comprising:

[0007] Get a read request for the target data;

[0008] Based on the prompt information carried in the read request of the target data, and according to the data in the first linked list and the data in the second linked list, determining the first data from the target data, wherein the prompt information is used to prompt that the data volume of the target data is not less than a data volume threshold, and the first data is not in the first linked list and is not in the second linked list;

[0009] Reading the first data from the disk unit, and storing the first data in the first linked list;

[0010] Among them, the first linked list and the second linked list are linked lists in the cache unit, the first linked list is used to store data requested to be read by the data read request carrying the prompt information, and the second linked list is used to store data requested to be read by the data read request not carrying the prompt information.

[0011] In another aspect, a data reading device is provided, the device comprising:

[0012] An acquisition module, used for acquiring a read request for target data;

[0013] a determination module, configured to determine first data from the target data based on prompt information carried in the read request of the target data and according to data in the first linked list and data in the second linked list, wherein the prompt information is used to prompt that the data volume of the target data is not less than a data volume threshold, and the first data is not in the first linked list and is not in the second linked list;

[0014] A reading and storing module, used for reading the first data from the disk unit and storing the first data into the first linked list;

[0015] Among them, the first linked list and the second linked list are linked lists in the cache unit, the first linked list is used to store data requested to be read by the data read request carrying the prompt information, and the second linked list is used to store data requested to be read by the data read request not carrying the prompt information.

[0016] In a possible implementation, the first linked list before storing the first data includes a plurality of first use units for storing data;

[0017] The reading and storing module is used to scan each first usage unit based on the sum of the storage capacity of each first idle unit being less than the data volume of the first data, and obtain the number of scans of the data in each first usage unit, wherein the first idle unit is allocated to the first linked list and does not store data; for any first usage unit, based on the number of scans of the data in any first usage unit being not less than a number threshold, release the data in any first usage unit; based on the sum of the storage capacity of each first idle unit and the storage capacity of each first usage unit for releasing data being not less than the data volume of the first data, read the first data from the disk unit, and store the first data in each first idle unit and each first usage unit for releasing data.

[0018] In a possible implementation, the acquisition module is further used to acquire configuration parameters of the first linked list, where the configuration parameters are used to determine a storage capacity threshold of the first linked list;

[0019] The determination module is further configured to determine the storage capacity of each of the first idle units according to the storage capacity threshold of the first linked list and the storage capacity of each of the first used units.

[0020] In a possible implementation, the first linked list after the first data is stored includes a plurality of second use units storing data; and the device further includes:

[0021] A scanning module, configured to scan each second usage unit through the scanning thread based on reaching a trigger condition of the scanning thread, and obtain a scanning number of data in each second usage unit;

[0022] The release module is used to release the data in any second usage unit based on the scanning times of the data in any second usage unit being not less than a times threshold.

[0023] In a possible implementation, the acquisition module is further used to acquire a concurrency parameter, where the concurrency parameter is used to describe the concurrency of the data read request carrying the prompt information;

[0024] The device also includes:

[0025] An improving module, configured to increase the triggering frequency of the scanning thread based on the concurrency parameter being greater than a first parameter threshold;

[0026] A reducing module, configured to reduce a triggering frequency of the scanning thread based on the concurrency parameter being less than a second parameter threshold;

[0027] The increased trigger frequency or the decreased trigger frequency is used to determine whether the trigger condition of the scanning thread is met.

[0028] In a possible implementation, the determination module is further configured to determine at least one of second data and third data from the target data based on the data in the first linked list and the data in the second linked list, based on the read request for the target data not carrying the prompt information, the second data being in the first linked list but not in the second linked list, and the third data being not in the first linked list but not in the second linked list;

[0029] The reading and storing module is further used to read the second data from the first linked list and store the second data into the second linked list when the second data is determined;

[0030] The reading and storing module is further used to read the third data from the disk unit and store the third data into the second linked list when the third data is determined.

[0031] In a possible implementation, the second linked list includes a first area, and the reading and storing module is used to store the second data at the head of the first area; and store the third data at the head of the first area;

[0032] The second linked list also includes a second area, and the target data also includes fourth data, which is the data in the second linked list except the second data and the third data in the target data. The reading and storage module is also used to read the fourth data from the second linked list and store the fourth data at the head of the second area.

[0033] In a possible implementation manner, the head of the first region is spliced ​​with the tail of the second region, and the device further includes:

[0034] a release module, configured to release the data in the tail of the first area based on the electronic device satisfying at least one of the first condition and the second condition, and the amount of data in the second linked list is not less than a storage capacity threshold of the second linked list;

[0035] The electronic device satisfies the first condition when the electronic device stores the fourth data in the header of the second area, and the electronic device satisfies the second condition when the electronic device stores at least one of the second data and the third data in the header of the first area.

[0036] On the other hand, an electronic device is provided, comprising a processor and a memory, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor so that the electronic device implements any of the above-mentioned data reading methods.

[0037] On the other hand, a computer-readable storage medium is provided, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor so that an electronic device can implement any of the above-mentioned data reading methods.

[0038] On the other hand, a computer program is also provided. The computer program is at least one, and the at least one computer program is loaded and executed by a processor to enable the electronic device to implement any of the above data reading methods.

[0039] On the other hand, a computer program product is also provided, wherein at least one computer program is stored in the computer program product, and the at least one computer program is loaded and executed by a processor to enable an electronic device to implement any of the above data reading methods.

[0040] The technical solution provided by this application brings at least the following beneficial effects:

[0041] In the technical solution provided by the present application, when the read request of the target data carries prompt information for prompting that the data volume of the target data is not less than the data volume threshold, the first data that is not in the first linked list and the second linked list is determined from the target data according to the data in the first linked list and the data in the second linked list, and the first data is read from the disk unit and stored in the first linked list, thereby realizing that the data with a large data volume is stored in the first linked list. In addition, since the second linked list is used to store the data requested to be read by the data read request that does not carry the prompt information, therefore, by storing the data with a large data volume in the first linked list and the data with a small data volume in the second linked list, the elimination speed of the hot data in the second linked list can be reduced, the phenomenon of repeated reading of the hot data can be reduced, and the device performance can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0043] Figure 1 It is a schematic diagram of an implementation environment of a data reading method provided in an embodiment of the present application;

[0044] Figure 2 is a flow chart of a data reading method provided in an embodiment of the present application;

[0045] Figure 3 is a schematic diagram of a second linked list provided in an embodiment of the present application;

[0046] Figure 4 is a schematic diagram of a device resource grouping provided in an embodiment of the present application;

[0047] Figure 5 It is a framework diagram of a data reading method provided in an embodiment of the present application;

[0048] Figure 6 This is a schematic diagram of the relationship between the concurrency of a data read request and a set performance indicator provided in an embodiment of the present application;

[0049] Figure 7 is a structural schematic diagram of a data reading device provided in an embodiment of the present application;

[0050] Figure 8 It is a structural diagram of a terminal device provided in an embodiment of the present application;

[0051] Fig. 9 It is a structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION

[0052] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0053] Figure 1 is a schematic diagram of an implementation environment of a data reading method provided in an embodiment of the present application, such as Figure 1 As shown, the implementation environment includes a terminal device 101 and a server 102. The data reading method in the embodiment of the present application can be executed by the terminal device 101, can be executed by the server 102, or can be executed by the terminal device 101 and the server 102 together.

[0054] The terminal device 101 can be a smart phone, a game console, a desktop computer, a tablet computer, a laptop computer, a smart TV, a smart car device, an intelligent voice interaction device, a smart home appliance, etc. The server 102 can be a single server, or a server cluster consisting of multiple servers, or any one of a cloud computing platform and a virtualization center, which is not limited in the embodiments of the present application. The server 102 can be connected to the terminal device 101 through a wired network or a wireless network. The server 102 can have functions such as data processing, data storage, and data transmission and reception, which are not limited in the embodiments of the present application. The number of terminal devices 101 and servers 102 is not limited and can be one or more.

[0055] In storage technology, the storage system includes a cache unit and a disk unit, which can read data from the disk unit and store the data in the cache unit. The cache unit includes a least recently used (Least Recently Use, LRU) linked list, and the read data is stored at the head of the LRU linked list, causing the data originally stored in the LRU linked list to move to the tail of the LRU linked list. Since the length of the LRU linked list is limited, the data originally stored in the tail of the LRU linked list will be moved out of the LRU linked list, causing this part of the data to be eliminated.

[0056] In some cases, some data in the LRU list will be reused, and these reused data are hot data. When the amount of data read is large, the elimination speed of hot data will be accelerated, resulting in the phenomenon of hot data being read repeatedly, affecting device performance.

[0057] The embodiment of the present application provides a data reading method, which can be applied to the above implementation environment, can reduce the elimination speed of hot data and improve device performance. Figure 2The data reading method in the embodiment of the present application can be executed by the terminal device 101 or the server 102. In the following, the terminal device 101 and the server 102 can be referred to as electronic devices, that is, the data reading method in the embodiment of the present application can be executed by an electronic device. Figure 2 As shown, the method includes the following steps.

[0058] Step 201: Obtain a read request for target data.

[0059] In an embodiment of the present application, a user can operate a terminal device and interact with a server through the terminal device, so that the terminal device can obtain data from the server and present the data to the user through a display interface. In this process, the terminal device generates a read request for target data based on the user's operation and sends it to the server. The read request for target data can be called a target data read request, and the target data read request is used to request to read the target data. After receiving the read request for target data, the server sends the target data to the client in response to the read request for target data.

[0060] For example, a browser is installed on a terminal device. After a user enters a keyword on the browser and clicks a query, the terminal device generates a query request for the keyword in response to the user's operation. The query request is a request to read the target data. The terminal device sends the query request to the server. After the server obtains the query request, it sends a query result for the keyword to the terminal device based on the query request. The query result is the target data.

[0061] It is understandable that the target data read request is any request for requesting to read the target data. For example, the target data read request may be a parallel query request for the target data, a migration request for the target data, a verification request for the target data, etc. Optionally, the target data read request is a structured query language (SQL).

[0062] Step 202, based on the prompt information carried in the read request of the target data, the first data is determined from the target data according to the data in the first linked list and the data in the second linked list, and the prompt information is used to prompt that the data volume of the target data is not less than the data volume threshold, and the first data is not in the first linked list and is not in the second linked list.

[0063] Among them, the first linked list and the second linked list are linked lists in the cache unit, the first linked list is used to store data requested to be read by a data read request carrying prompt information, and the second linked list is used to store data requested to be read by a data read request not carrying prompt information.

[0064] In the embodiment of the present application, the cache unit is also called a buffer pool (BF). When the server queries the data in the database or updates the data in the database, the server needs to operate the data in the cache unit. In other words, the cache unit is a unit where data is stored when the electronic device processes data. When the data is already in the cache unit, the electronic device can directly process the data. When the data is not in the cache unit, the electronic device needs to read the data from the disk unit, store the data in the cache unit, and then process the data in the cache unit.

[0065] The cache unit includes at least one instance unit. For any instance unit, the instance unit includes a least recently used list (LRU List), a free list (Free List), a flush list (Flush List), etc. The following introduces these three lists.

[0066] In the field of database technology, the basic unit of data storage is a data page, and a data page is 16 kilobytes (KB). Among them, the object used to store data pages in the cache unit is called a cache block. Based on this, it can be seen that the LRU List, Free List and Flush List all include at least one cache block.

[0067] Since Free List is a free linked list, there is no data stored in any cache block in Free List, and the cache block without data is also called free block. In other words, all cache blocks in Free List are free blocks. In extreme cases, if all cache blocks in the storage unit store data, there is no cache block without data, that is, there is no free block, so there is no cache block in Free List.

[0068] Since the LRU List is the least recently used linked list, the data used by the electronic device is stored in the LRU List, that is, any cache block in the LRU List stores data, and the cache block storing data is also called a data block. A data block stores a data page, and each cache block in the LRU List is a data block. Therefore, the LRU List is used to manage the data pages that have been read.

[0069] When the database is just started, there are no data pages that have been read, so there are no cache blocks in the LRU List, and there are no data pages. When the data page needs to be stored in the buffer pool, first check whether there is a free block from the Free List. If there is a free block in the Free List, the free block is released from the Free List and the free block is divided into the LRU List. In other words, the LRU List needs to apply to the Free List to release the free block so that the data page can be stored in the free block. If there is no free block in the Free List, some data pages in the LRU List are eliminated, so that the cache blocks in the LRU List that originally stored the eliminated data pages become free blocks. These free blocks belong to the Free List. Then, the LRU List applies to the Free List to release the free block so that the data page can be stored in the free block.

[0070] In summary, the Free List includes at least one free block. When the electronic device needs to store a data page in the LRU List, the LRU List obtains a free block from the Free List, and stores the data page in the obtained free block, to obtain a data block belonging to the LRU List. If there is no free block in the Free List, the LRU List releases the data page in the data block, to obtain a free block belonging to the Free List, and then the LRU List obtains a free block from the Free List, and stores the data page in the obtained free block, to obtain a data block belonging to the LRU List.

[0071] When a data page in the LRU List is modified, it becomes a dirty page. A dirty page is data that is inconsistent between the buffer unit and the disk unit. The dirty page is stored in the Flush List, which means that the cache block in the Flush List is the data block that stores the dirty page.

[0072] In an embodiment of the present application, the cache unit includes a first linked list and a second linked list. The first linked list stores data requested to be read by a data read request carrying prompt information, and the second linked list stores data requested to be read by a data read request not carrying prompt information. The amount of data requested to be read by the data read request carrying prompt information is not less than a data amount threshold, and the amount of data requested to be read by the data read request not carrying prompt information is less than the data amount threshold.

[0073] That is to say, if the data volume of the target data is not less than the data volume threshold, hint information is added to the read request of the target data so that the read request of the target data carries the hint information. If the data volume of the target data is less than the data volume threshold, there is no need to add hint information to the read request of the target data.

[0074] The embodiments of the present application do not limit the data volume threshold. Exemplarily, the data volume threshold is a numerical value set according to manual experience, or a numerical range is set according to manual experience, a numerical value within the numerical range is randomly generated, and the randomly generated numerical value is used as the data volume threshold. Alternatively, when the read request for the target data is a request triggered by the operation of a specified user, the data volume of the target data is the data volume threshold.

[0075] That is, in one possible implementation, a read request for target data triggered by an operation of a designated user carries prompt information. In another possible implementation, a read request for target data greater than a data volume threshold carries prompt information.

[0076] The embodiment of the present application does not limit the prompt information. Exemplarily, the prompt information includes at least one number from 0 to 9, and / or at least one letter from a to z (the letter can be uppercase or lowercase), and / or at least one special character from +, @, *, etc. For example, the prompt information is select / *+independent* / from t.

[0077] When the read request of the target data carries the prompt information, the electronic device obtains the data in the first linked list and the data in the second linked list. The first linked list can be called an isolation linked list, which is used to store the data requested to be read by the data read request carrying the prompt information. The second linked list can be called an LRU linked list, which is used to store the data requested to be read by the data read request not carrying the prompt information.

[0078] The electronic device can compare the target data, the data in the first linked list, and the data in the second linked list. Based on the comparison result, the electronic device can determine the data that is not in the first linked list and not in the second linked list from the target data, and the determined data is called the first data.

[0079] Step 203, read the first data from the disk unit, and store the first data in the first linked list.

[0080] In the embodiment of the present application, the electronic device can read the first data from the disk unit. Since the first linked list is used to store the data requested to be read by the data read request carrying the prompt information, and the first data is the data in the target data requested to be read by the read request carrying the target data of the prompt information, the electronic device can store the read first data in the first linked list.

[0081] By reading the first data that is not stored in the first linked list and not stored in the second linked list from the disk unit, and storing the first data in the first linked list, it is achieved that the data with a large amount of data is stored in the first linked list, and the data with a large amount of data is prevented from affecting the data in the second linked list. In addition, for the data in the target data that has been stored in the first linked list or the second linked list, the data is directly read without changing the storage location of the data, which can also prevent the data with a large amount of data from affecting the data in the second linked list. In summary, the embodiment of the present application can reduce the elimination speed of hot data, reduce the phenomenon of repeated reading of hot data, and improve device performance.

[0082] In a possible implementation, the first linked list before storing the first data includes a plurality of first use units for storing data. In this case, step 203 includes steps 2031 to 2033 (not shown in the figure).

[0083] In the embodiment of the present application, the first linked list stores the data requested to be read by the data read request carrying the prompt information, and therefore, the cache block in the first linked list is a data block. Before the first data is stored in the first linked list, the first linked list may have stored the data, and at this time, the first linked list includes at least one data block, and one data block stores one data page. The data block in the first linked list is also called a first usage unit, and the first usage unit stores data, and one first usage unit stores one data page.

[0084] It is understandable that before the first data is stored in the first linked list, the first linked list may not store any data. At this time, the first linked list does not include the data block, that is, the first linked list is empty.

[0085] Step 2031, based on the fact that the sum of the storage capacities of the first idle units is less than the amount of the first data, each first used unit is scanned to obtain the number of scans of the data in each first used unit, and the first idle unit is used to be allocated to the first linked list and does not store data.

[0086] In an embodiment of the present application, the cache unit includes a free list, and the free list includes a plurality of free blocks. The electronic device can apply to the free list to release at least one free block, and allocate each released free block to the first list, so as to store the first data in the allocated free block. The free block allocated by the electronic device to the first list is also called a first free unit, and the first free unit applies to release from the free list and does not store data.

[0087] It can be understood that a first idle unit corresponds to a certain storage capacity, and the electronic device determines the sum of the storage capacities of each first idle unit by determining each first idle unit allocated to the first linked list.

[0088] In a possible implementation, step 2031 also includes steps 204 to 205 (not shown in the figure).

[0089] Step 204: Acquire configuration parameters of the first linked list, where the configuration parameters are used to determine a storage capacity threshold of the first linked list.

[0090] The embodiment of the present application does not limit the method for obtaining the configuration parameters of the first linked list. For example, the electronic device can receive the configuration parameters of the first linked list input by the user, or the electronic device can receive the configuration parameters of the first linked list sent by other devices through the network, or the electronic device can read the configuration parameters of the first linked list from a storage device.

[0091] Optionally, the configuration parameter of the first linked list is used to describe a storage capacity threshold of the first linked list. For example, the configuration parameter of the first linked list is 2 Gigabytes (GB), indicating that the storage capacity threshold of the first linked list is 2 GB.

[0092] Alternatively, the configuration parameter of the first linked list is used to describe the ratio between the storage capacity threshold of the first linked list and the storage capacity of the cache unit. For example, if the configuration parameter of the first linked list is 5%, it means that the storage capacity threshold of the first linked list accounts for 5% of the storage capacity of the cache unit. If the storage capacity of the cache unit is 32GB, the storage capacity threshold of the first linked list is 32GB×5%=1.6GB.

[0093] Step 205: Determine at least one first idle unit according to the storage capacity threshold of the first linked list and the storage capacity of each first used unit.

[0094] In the embodiment of the present application, one first usage unit corresponds to one storage capacity. The storage capacity of each first idle unit can be obtained by subtracting the storage capacity threshold of the first linked list from the storage capacity of each first usage unit in the first linked list.

[0095] For example, the storage capacity threshold of the first linked list is 1600KB, the storage capacity of a first used unit is 16KB, and there are 50 first used units in total. Then the sum of the storage capacity of each first idle unit is 1600-50×16=800KB. Since the storage capacity of a first idle unit is 16KB, the number of first idle units is 50. In other words, based on the storage capacity threshold of the first linked list, 50 first used units, the storage capacity of each first used unit, and the storage capacity of each first idle unit, 50 first idle units can be obtained.

[0096] By releasing the cache blocks belonging to the first linked list from the free linked list of the cache unit, the first linked list is divided from the cache unit instead of from other storage units (for example, the other storage units may be temporary memory), which can prevent waste of storage space and avoid the phenomenon of Out Of Memory (OOM). OOM refers to the existence of unreclaimable memory or excessive memory in the system, so that the memory used by the program to run is greater than the maximum memory that can be provided.

[0097] Optionally, the electronic device starts a scanning thread to scan each first usage unit through the scanning thread to obtain the scanning times of the data in each first usage unit, so as to determine whether to release the data in any first usage unit according to the scanning times of the data in the first usage unit.

[0098] Optionally, for data in any first usage unit, each time the first usage unit where the data is located is scanned once by a scanning thread, the number of scans of the data increases by 1. It is understandable that the first usage unit where the data is located may change or remain unchanged.

[0099] Step 2032: for any first usage unit, based on the scan times of the data in any first usage unit being not less than a times threshold, release the data in any first usage unit.

[0100] The embodiment of the present application does not limit the number threshold. For example, the number threshold is a value set according to manual experience, or a value range is set according to manual experience, a value within the value range is randomly generated, and the randomly generated value is used as the number threshold. Optionally, the number threshold is a positive integer.

[0101] In an exemplary embodiment, the number threshold is the number of times data in any one first usage unit is read.

[0102] Since the first idle unit is an idle block that does not store data, there is no data reading number for any first idle unit. When the electronic device reads data from the disk unit to the cache unit, it can apply to the free list to release the free block, and store the read data in the released free block, so that the free block is changed to a data block. In the case where the data block stores data, the electronic device can read the data in the data block again. Since the first use unit stores data, for any first use unit, each time the electronic device reads the data in the first use unit, the reading number of the data in the first use unit increases by 1. In an embodiment of the present application, the reading number of the data in any first use unit is the number threshold corresponding to the data in the first use unit.

[0103] For example, the electronic device reads data m five times. If the data m is stored in the first usage unit m, the number of times the data m in the first usage unit m is read is 5, and the number threshold corresponding to the data m is 5.

[0104] If the scanning times of the data in any first usage unit is not less than the times threshold, the electronic device releases the data in any first usage unit to obtain the first usage unit for releasing the data, so that the first usage unit for releasing the data does not store the data.

[0105] It can be understood that, since the first usage unit for releasing data does not store data, the first usage unit for releasing data is a free block in the free linked list.

[0106] In summary, in a possible implementation, on the one hand, each first usage unit is scanned by a scanning thread. When any first usage unit is scanned, the number of scans of the data in the first usage unit is increased by 1 to obtain the number of scans of the data in the first usage unit. For example, when the electronic device scans the first usage unit m through the scanning thread, the number of scans of the data m in the first usage unit m is increased by 1 to obtain the number of scans of the data m 5. On the other hand, each time the data in the first usage unit is read, the number of reads of the data in the first usage unit is increased by 1 to obtain the number of reads of the data in the first usage unit. For example, if the electronic device reads the data m five times, the number of reads of the data m is 5. If the number of scans of the data is the same as the number of reads of the data, the data in the first usage unit.

[0107] Step 2033, based on the fact that the sum of the storage capacity of each first idle unit and the storage capacity of each first used unit for releasing data is not less than the data volume of the first data, read the first data from the disk unit and store the first data in each first idle unit and each first used unit for releasing data.

[0108] In the embodiment of the present application, the storage capacity of each first idle unit and the storage capacity of each first use unit for releasing data are added to obtain an addition result. If the addition result is not less than the data amount of the first data, it means that there is enough storage space in the cache unit for storing the first data. In this case, the electronic device reads the first data from the disk unit and stores the first data in each first idle unit and each first use unit for releasing data.

[0109] It is understandable that the first data includes at least one data page, and a data page is stored in a free block. A free block can be a first idle unit or a first use unit for releasing data. Any first idle unit can store or not store a data page, and any first use unit for releasing data can also store or not store a data page.

[0110] In summary, before the first data is stored in the first linked list, the first linked list only includes the first use unit. When the first data needs to be stored in the first linked list, the electronic device determines each first idle unit in the free linked list based on the storage capacity threshold of the first linked list and the storage capacity of each first use unit in the first linked list, and any first idle unit is an idle block and belongs to the free linked list. If the sum of the storage capacity of each first idle unit is less than the data volume of the first data, the data in at least one first use unit is released, and at this time, any first use unit of the released data is an idle block and belongs to the free linked list. If the sum of the storage capacity of each first idle unit and the storage capacity of each first use unit of the released data is not less than the data volume of the first data, the electronic device releases at least one idle block from the free linked list, and the first data is sequentially stored in at least one idle block in units of data pages, and at this time, these idle blocks storing data pages are data blocks and belong to the first linked list. From then on, the first data is stored in the first linked list, and at this time, the first linked list after the first data is stored includes multiple second use units, and any second use unit stores data.

[0111] It should be noted that if the sum of the storage capacity of each first idle unit and the storage capacity of each first use unit that releases data is less than the data volume of the first data, in this case, each first use unit except the first use unit that releases data can be scanned in accordance with step 2031 to obtain the number of scans of the data in each first use unit, and then in accordance with step 2032, the data in the first use unit corresponding to the number of scans not less than the number threshold is released, and then in accordance with step 2033, when the sum of the storage capacity of each first idle unit and the storage capacity of each first use unit that releases data is not less than the data volume of the first data, the first data is read from the disk unit and stored in each first idle unit and each first use unit that releases data. The implementation of the above process can be seen in the description of steps 2031 to 2033, which will not be repeated here.

[0112] For example, before the first data is stored in the first linked list, the first linked list includes 480 first use units. If the storage capacity threshold of the first linked list is 500 cache blocks, the free linked list includes 20 first idle units corresponding to the first linked list, and 40 cache blocks are required to store the first data. In this case, the 480 first use units can be scanned to obtain the number of scans of the data in each first use unit. Assuming that the number of scans of the data in 10 of the 480 first use units is not less than the number threshold, the data in these 10 first use units are released, and 470 first use units remain. At this time, the free linked list includes 20 first idle units and 10 first use units for releasing data. Since the sum of the storage capacity of the 30 cache blocks is less than the storage capacity of the 40 storage blocks required to store the first data, the 470 first use units are scanned to obtain the number of scans of the data in each first use unit. Assuming that the number of scans of the data in 15 of the 470 first use units is not less than the number threshold, the data in these 15 first use units are released. At this time, the free list includes 20 first idle units and 25 first used units for releasing data (a total of 45 cache blocks), and the sum of the storage capacity of the 45 cache blocks is greater than the storage capacity of the 40 cache blocks required to store the first data. In this case, the electronic device applies to the free list to release 40 cache blocks, reads the first data from the disk unit, and stores the first data in these 40 cache blocks. At this time, the free list still has 5 cache blocks corresponding to the first list.

[0113] In a possible implementation, the first linked list storing the first data includes a plurality of second use units storing data. In this case, step 203 is followed by steps 206 to 207 (not shown in the figure).

[0114] In the embodiment of the present application, after the first data is stored in the first linked list, the first linked list includes at least one data block, and one data block stores one data page. At this time, the data block in the first linked list is also called a second usage unit, the second usage unit stores data, and one second usage unit stores one data page.

[0115] Step 206 : based on the triggering condition of the scanning thread being reached, each second usage unit is scanned by the scanning thread to obtain the scanning times of the data in each second usage unit.

[0116] The embodiments of the present application do not limit the triggering conditions for the electronic device to meet the scanning thread. Exemplarily, the triggering frequency of the scanning thread is configured according to manual experience. After the electronic device obtains the triggering frequency, it determines the triggering time of the scanning thread. When the time is the triggering time of the scanning thread, the electronic device determines that the triggering condition of the scanning thread is met. For example, the triggering frequency of the scanning thread is configured to trigger the scanning thread once every 10 minutes. Then, the electronic device can determine the triggering time of the scanning thread as 0:10, 0:20, 0:30, etc. based on the triggering frequency. When the electronic device determines that the time is 0:10 or 0:20 or 0:30, etc., the electronic device determines that the triggering condition of the scanning thread is met. Alternatively, the electronic device can obtain the user's triggering operation for the scanning thread, and in response to the triggering operation, determine that the triggering condition of the scanning thread is met.

[0117] When the electronic device reaches the trigger condition of the scanning thread, the electronic device starts the scanning thread, scans each second usage unit through the scanning thread, obtains the scanning times of the data in each second usage unit, and determines whether to release the data in any second usage unit according to the scanning times of the data in the second usage unit. The implementation of step 206 is similar to the implementation of step 2031, which can be seen in the above description of step 2031, and will not be repeated here.

[0118] In an exemplary embodiment, the method in the embodiment of the present application further includes steps 208 and 209 (not shown in the figure). Optionally, steps 208 and 209 can be performed before step 206.

[0119] Step 208: Acquire a concurrency parameter, where the concurrency parameter is used to describe the concurrency of the data read request carrying the prompt information.

[0120] In the field of computer technology, an electronic device can continuously obtain data read requests. An electronic device can obtain multiple data read requests at a certain time or in a certain period of time. This data read request acquisition situation is also called a concurrent data read request situation.

[0121] In the embodiment of the present application, any data read request may or may not carry prompt information. The electronic device may count each data read request obtained at a certain time or within a certain period of time to obtain a concurrency parameter, wherein the concurrency parameter may be the number of acquisitions or acquisition frequency of the data read request carrying the prompt information, and the number of acquisitions or acquisition frequency may be used to reflect the concurrency of the data read request carrying the prompt information.

[0122] Step 209, based on the concurrency parameter being greater than the first parameter threshold, increase the trigger frequency of the scanning thread; based on the concurrency parameter being less than the second parameter threshold, reduce the trigger frequency of the scanning thread; wherein the increased trigger frequency or the reduced trigger frequency is used to determine whether the trigger condition of the scanning thread is met.

[0123] The first parameter threshold is greater than the second parameter threshold. The first parameter threshold can be set according to manual experience, or the first parameter threshold can be determined according to the number of acquisitions or acquisition frequencies of data read requests carrying prompt information in multiple historical times or multiple historical time periods, or the distribution function satisfied by the number of acquisitions or acquisition frequencies of data read requests carrying prompt information can be determined, and the first parameter threshold is determined according to the distribution function. It can be understood that the second parameter threshold is determined in a similar manner to the first parameter threshold, which will not be repeated here.

[0124] In the embodiment of the present application, if the concurrency parameter is greater than the first parameter threshold, the electronic device increases the trigger frequency of the scanning thread. When the trigger frequency of the scanning thread is increased, the electronic device can determine whether the electronic device meets the trigger condition of the scanning thread according to the increased trigger frequency according to the implementation principle of step 206, thereby determining whether to start the scanning thread and scan each second usage unit storing data through the scanning thread.

[0125] The trigger frequency of the scanning thread is positively correlated with the concurrency parameter, that is, the greater the concurrency parameter, the greater the trigger frequency of the scanning thread. By increasing the trigger frequency of the scanning thread, the frequency of scanning the second usage unit is increased, the data in the second usage unit can be released faster, and the phenomenon of cache competition is reduced.

[0126] In the embodiment of the present application, if the concurrency parameter is less than the second parameter threshold, the electronic device reduces the trigger frequency of the scanning thread. When the trigger frequency of the scanning thread is reduced, the electronic device can determine whether the electronic device meets the trigger condition of the scanning thread according to the reduced trigger frequency according to the implementation principle of step 206, thereby determining whether to start the scanning thread and scan each second usage unit storing data through the scanning thread.

[0127] Among them, the trigger frequency of the scanning thread is positively correlated with the concurrency parameter, that is, the smaller the concurrency parameter, the smaller the trigger frequency of the scanning thread. By reducing the trigger frequency of the scanning thread, the frequency of scanning the second usage unit is reduced, the data in the second usage unit can be released more slowly, and the data read reuse rate is improved. In addition, it can also reduce the computing processing pressure of the electronic device and improve the computing performance of the electronic device.

[0128] In the case of high concurrency of data read requests carrying prompt information, the trigger frequency of the scanning thread is increased, and in the case of low concurrency of data read requests carrying prompt information, the trigger frequency of the scanning thread is reduced, which can improve the processing capability of the electronic device for data read requests, thereby improving the performance of the electronic device. After testing, without adjusting the trigger frequency of the scanning thread, the processing capability of the electronic device for data read requests is about 13.8%, while when adjusting the trigger frequency of the scanning thread, the processing capability of the electronic device for data read requests is about 51.9%, which is an increase of about 300%.

[0129] Step 207: for any second usage unit, based on the scanning times of the data in any second usage unit being not less than the times threshold, release the data in any second usage unit.

[0130] The embodiments of the present application do not limit the method for determining the number threshold. For example, the number threshold can be determined based on manual experience, or a numerical range can be manually specified, and a numerical value within the numerical range can be randomly generated, and the randomly generated numerical value can be determined as the number threshold.

[0131] Optionally, the number threshold is the number of times data in any second usage unit is read. This part of the content can be seen in the above description of "the number threshold is the number of times data in any first usage unit is read", and the implementation principles of the two are similar, which will not be repeated here.

[0132] If the number of scans of data in any second usage unit is not greater than the number threshold, it means that the read reuse rate of the data in the second usage unit is low, and the data in the second usage unit can be released to avoid cache occupancy. Among them, the second usage unit that releases the data is an idle block, which belongs to the idle linked list. Since the data released is the data with a low read reuse rate, it is equivalent to reducing the elimination speed of data with a high read reuse rate, that is, reducing the elimination speed of hot data, reducing the phenomenon of hot data being read repeatedly, and improving device performance.

[0133] In a possible implementation, the method of the embodiment of the present application further includes steps 210 and 211 (not shown in the figure). Steps 210 and 211 may be performed after step 201.

[0134] Step 210, based on the fact that the read request for the target data does not carry prompt information, at least one of the second data and the third data is determined from the target data according to the data in the first linked list and the data in the second linked list, the second data is in the first linked list and not in the second linked list, and the third data is not in the first linked list and not in the second linked list.

[0135] In the embodiment of the present application, if the read request for the target data does not carry prompt information, it means that the amount of target data requested to be read by the read request for the target data is less than the data amount threshold, and the target data can be stored in the second linked list.

[0136] It is understandable that part of the target data may be stored in the first linked list and the disk unit, and this part of the data is not stored in the second linked list. For the convenience of description, this part of the data is called second data. The target data may also have part of the data that is neither stored in the first linked list nor in the second linked list, and this part of the data is only stored in the disk unit. For the convenience of description, this part of the data is called third data.

[0137] By comparing the target data with the data in the first linked list, the second data can be determined from the target data. By comparing the target data, the second data and the data in the second linked list, the third data can be determined from the target data.

[0138] Step 211, when the second data is determined, read the second data from the first linked list and store the second data in the second linked list; when the third data is determined, read the third data from the disk unit and store the third data in the second linked list.

[0139] In the embodiment of the present application, when the target data includes the second data, since the second data is in the first linked list but not in the second linked list, the second data can be read from the first linked list and stored in the second linked list. When the target data includes the third data, since the third data is neither in the first linked list nor in the second linked list, and the third data is in the disk unit, the third data can be read from the disk unit and stored in the second linked list.

[0140] It can be understood that if the target data includes second data and third data, then: on the one hand, the second data is read from the first linked list and stored in the second linked list, and on the other hand, the third data is read from the disk unit and stored in the second linked list.

[0141] Since both the first linked list and the second linked list include cache blocks in the cache unit, reading the second data from the first linked list and storing the second data in the second linked list is equivalent to inserting each data block storing the second data in the first linked list into the second linked list, so that the second data is stored in the second linked list instead of in the first linked list.

[0142] As for the third data, the third data is read from the disk unit and stored in the second linked list, which is equivalent to: the electronic device applies to the free linked list to release at least one free block for storing the third data, reads the third data from the disk unit, and stores the third data in each free block to obtain each data block, and inserts each data block into the second linked list.

[0143] In an exemplary embodiment, the second linked list includes the first region. In this case, "storing the second data into the second linked list" in step 211 includes: storing the second data into the head of the first region. "Storing the third data into the second linked list" in step 211 includes: storing the third data into the head of the first region.

[0144] The second linked list includes a first area, and the first area is used to store data read from a non-second linked list. In the embodiment of the present application, the first area can store data read from the disk unit, and can also store data read from the first linked list.

[0145] When the target data includes the second data, since the second data is in the first linked list and not in the second linked list, the second data can be read from the first linked list and stored in the head of the first region. In other words, each data block storing the second data in the first linked list is inserted into the head of the first region in the second linked list.

[0146] When the target data includes the third data, since the third data is neither in the first linked list nor in the second linked list, and the third data is in the disk unit, the third data can be read from the disk unit and stored in the head of the first area. In other words, the free linked list is requested to release at least one free block, the third data is read from the disk unit, and the third data is stored in each free block to obtain each data block, and each data block is inserted into the head of the first area in the second linked list.

[0147] Optionally, the second linked list further includes a second region, the target data further includes fourth data, the fourth data is data in the target data other than the second data and the third data in the second linked list, and the method of the embodiment of the present application further includes: reading the fourth data from the second linked list, and storing the fourth data in the head of the second region. The aforementioned steps may be performed after step 210.

[0148] The second linked list also includes a second area, and the second area is used to store data read from the second linked list. In the embodiment of the present application, the second linked list includes a first area and a second area, so the second area can store data read from the first area or the second area.

[0149] It is understandable that part of the target data may be stored in the second linked list and the disk unit, and this part of the data is not stored in the first linked list. For the convenience of description, this part of the data is referred to as fourth data. The fourth data is the data in the target data other than the second data and the third data.

[0150] When the target data includes the fourth data, since the fourth data is in the second linked list and not in the first linked list, the fourth data can be read from the second linked list and stored in the head of the second region. In other words, each data block storing the fourth data in the second linked list is inserted into the head of the second region in the second linked list.

[0151] Optionally, the head of the first area is spliced ​​with the tail of the second area. In this case, the method of the embodiment of the present application also includes: the electronic device satisfies at least one of the first condition and the second condition, and the amount of data in the second linked list is not less than the storage capacity threshold of the second linked list, and the data in the tail of the first area is released. Among them, the electronic device satisfies the first condition when the electronic device stores the fourth data in the head of the second area, and the electronic device satisfies the second condition when the electronic device stores at least one of the second data and the third data in the head of the first area. It can be understood that the aforementioned steps can be performed after at least one of the steps of "reading the fourth data from the second linked list and storing the fourth data in the head of the second area", "reading the second data from the first linked list and storing the second data in the second linked list", and "reading the third data from the disk unit and storing the third data in the second linked list".

[0152] In the embodiment of the present application, the head of the first region is spliced ​​after the tail of the second region, and the second linked list can be represented from the beginning to the end as the head of the second region, the tail of the second region, the head of the first region, and the tail of the first region. In other words, the head of the second linked list is equivalent to the head of the second region, the tail of the second linked list is equivalent to the tail of the first region, and the tail of the second region and the head of the first region belong to the middle part of the second linked list.

[0153] If the electronic device stores at least one of the second data and the third data at the head of the first area, and / or the electronic device stores the fourth data at the head of the second area, it indicates that there is a situation where a data block is inserted into the second linked list, so that the amount of data stored in the second linked list increases. Generally, there is a storage capacity threshold for the second linked list. When the amount of data in the second linked list is not less than the storage capacity threshold of the second linked list, the data in the tail of the first area is released. Since the tail of the first area is the tail of the second linked list, it is equivalent to the electronic device releasing the data in the data block at the tail of the second linked list to reduce the amount of data in the second linked list. Among them, the data block of the released data is the free block in the free linked list.

[0154] See also Figure 3 , Figure 3 is a schematic diagram of a second linked list provided in an embodiment of the present application. Figure 3 In the example, the second linked list includes the first region and the second region, and the head of the first region is spliced ​​after the tail of the second region. The head of the second linked list is the head of the second region, and the tail of the second linked list is the tail of the first region. The position where the head of the first region and the tail of the second region are spliced ​​is the midpoint of the second linked list, that is, the midpoint of the second linked list is both the head of the first region and the tail of the second region.

[0155] When the electronic device reads data from a non-second linked list (e.g., a disk unit, a first linked list, etc.), the data is stored at the head of the first area. When the electronic device reads data from the second linked list, the data is stored at the head of the second area. When the amount of data in the second linked list is not less than the storage capacity threshold of the second linked list, the data in the tail of the first area (i.e., the tail of the second linked list) is released.

[0156] In one possible implementation, the device resources of the electronic device can be divided into multiple resource groups, and one resource group is configured to correspond to multiple objects, one object corresponds to one resource group, and one resource group corresponds to part of the storage space in the cache unit, which includes a first linked list and a second linked list.

[0157] Optionally, according to a read request of the target data of the target object, a resource group corresponding to the target object is determined from a plurality of resource groups, and the resource group corresponding to the target object includes a first linked list and a second linked list. Next, it is determined whether the read request of the target data carries prompt information. If the read request of the target data carries prompt information, the first data is determined from the target data according to the data in the first linked list and the data in the second linked list, the first data is read from the disk unit, and the first data is stored in the first linked list. If the read request of the target data does not carry prompt information, at least one of the second data and the third data is determined from the target data according to the data in the first linked list and the data in the second linked list. When the second data is determined, the second data is read from the first linked list and stored in the second linked list; when the third data is determined, the third data is read from the disk unit and stored in the second linked list.

[0158] See also Figure 4 , Figure 4It is a schematic diagram of a device resource grouping provided in an embodiment of the present application. In an embodiment of the present application, the device resources of the electronic device include computing resources, read-write resources, and storage resources. Among them, computing resources include a central processing unit (CPU), a graphics processing unit (GPU), etc., read-write resources include input / output (IO) interfaces, and storage resources include cache units, disk units, etc.

[0159] By dividing the device resources into four resource groups, we get resource groups 1 to 4. Resource group 1 includes 10% of computing resources, 20% of read-write resources, and 15% of storage resources; resource group 2 includes 10% of computing resources, 25% of read-write resources, and 15% of storage resources; resource group 3 includes 10% of computing resources, 20% of read-write resources, and 30% of storage resources; and resource group 4 includes 70% of computing resources, 35% of read-write resources, and 40% of storage resources.

[0160] One resource group corresponds to multiple objects, and one object corresponds to one resource group. After the electronic device receives a data read request for any object, the resource group corresponding to the object is determined from resource groups 1 to 4. Assume that the object corresponds to resource group 2, and the storage resources of resource group 2 include a first linked list and a second linked list. According to whether the data read request carries prompt information, data in the first linked list, and data in the second linked list, according to the method of the embodiment of the present application, the data requested to be read by the data read request is read.

[0161] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant regions. For example, the target data, configuration parameters, etc. involved in this application are all obtained with full authorization.

[0162] In the above method, when the read request of the target data carries prompt information for prompting that the data volume of the target data is not less than the data volume threshold, the first data that is not in the first linked list and the second linked list is determined from the target data according to the data in the first linked list and the data in the second linked list, and the first data is read from the disk unit and stored in the first linked list, thereby storing the data with a larger data volume in the first linked list. Since the second linked list is used to store the data requested to be read by the data read request that does not carry the prompt information, therefore, by storing the data with a larger data volume in the first linked list and the data with a smaller data volume in the second linked list, the elimination speed of the hot data in the second linked list can be reduced, the phenomenon of repeated reading of the hot data can be reduced, and the device performance can be improved.

[0163] The above describes the data reading method of the embodiment of the present application from the perspective of method steps. Figure 5 To further describe, Figure 5 It is a framework diagram of a data reading method provided in an embodiment of the present application. In the embodiment of the present application, any object can trigger a data reading request carrying prompt information or trigger a data reading request without carrying prompt information.

[0164] When the data read request carries prompt information, the electronic device can read data from the disk unit and store the data in the isolation linked list according to the implementation principle of steps 201 to 203. The isolation linked list corresponds to the first linked list mentioned above, the isolation linked list before data storage and the isolation linked list after data storage both include at least one data block, any data block in the isolation linked list before data storage corresponds to the first use unit mentioned above, and any data block in the isolation linked list after data storage corresponds to the second use unit mentioned above.

[0165] In an embodiment of the present application, the cache unit includes a free list, the free list includes multiple free blocks, and no free block stores data. When the electronic device needs to store data in the isolation list, the electronic device can apply to the free list to release at least one free block to the isolation list, and read the data from the disk unit, and store the data in each free block released from the free list to the isolation list, so as to obtain each data block belonging to the isolation list.

[0166] Optionally, if the sum of the storage spaces of the free blocks released by the free list to the isolation list is less than the amount of data, it means that the storage space of the isolation list is insufficient. In this case, each data block in the isolation list is scanned by a scanning thread, and the data in at least one data block is released based on the scanning result. The data block of the released data is a free block and belongs to the free list. In this case, the electronic device applies to the free list again to release at least one free block to the isolation list, and reads data from the disk unit, and stores the data in each free block released by the free list to the isolation list, and obtains each data block belonging to the isolation list. This part of the content can be seen in the description of steps 2031 to 2033, which will not be repeated here.

[0167] In an exemplary embodiment, the trigger frequency of the scanning thread can be configured, and each data block in the isolation linked list is scanned by the scanning thread regularly, and data in at least one data block is released based on the scanning result. The data block of the released data is a free block and belongs to the free linked list. This part of the content can be seen in the description of step 206 to step 207, and will not be repeated here.

[0168] When the data read request does not carry prompt information, the electronic device can read data from the disk unit and store the data in the least recently used linked list according to the implementation principle of step 210 to step 211. The least recently used linked list corresponds to the second linked list mentioned above, and the second linked list includes multiple data blocks.

[0169] Similar to the isolation linked list, when an electronic device needs to store data in the least recently used linked list, the electronic device can apply to the free linked list to release at least one free block to the least recently used linked list, and read data from the disk unit, and store the data in each free block released from the free linked list to the least recently used linked list, thereby obtaining each data block belonging to the least recently used linked list.

[0170] It can be understood that the data requested by the data read request includes three parts of data. The first part of the data is stored in the disk unit, not stored in the isolation linked list and not stored in the least recently used linked list. The second part of the data is stored in the disk unit and also stored in the isolation linked list, but not stored in the least recently used linked list. The third part of the data is stored in the disk unit, not stored in the isolation linked list but stored in the least recently used linked list.

[0171] If the data read request carries prompt information, then: for the first part of the data, the first part of the data can be read from the disk unit and stored in the isolation linked list. In this case, the first part of the data corresponds to the first data mentioned above. For the second part of the data, since the second part of the data has been stored in the isolation linked list, the second part of the data is still stored in the isolation linked list, and the position of the data block of the second part of the data in the isolation linked list remains unchanged. For the third part of the data, since the third part of the data has been stored in the least recently used linked list, it is equivalent to the third part of the data has been stored in the cache unit. Therefore, the third part of the data is still stored in the least recently used linked list, and the position of the data block of the third part of the data in the least recently used linked list remains unchanged. This can avoid the impact of large data volume requests on the elimination of hot data, which is beneficial to improving device performance. After testing, the device performance can be improved by about 4%.

[0172] If the data read request does not carry the prompt information, the data requested to be read by the data read request needs to be stored in the least recently used linked list, wherein the least recently used linked list includes the first area and the second area, and the head of the first area is spliced ​​after the tail of the second area. For the first part of the data, the first part of the data can be read from the disk unit, and the first part of the data is stored in the head of the first area of ​​the least recently used linked list. In this case, the first part of the data corresponds to the third data mentioned above. For the second part of the data, since the second part of the data has been stored in the isolation linked list, the second part of the data can be read from the isolation linked list, and the second part of the data can be stored in the head of the first area of ​​the least recently used linked list. In this case, the second part of the data corresponds to the second data mentioned above. Optionally, the data block of the second part of the data in the isolation linked list is inserted into the head of the first area of ​​the least recently used linked list, so as to realize the storage of the second part of the data in the head of the first area of ​​the least recently used linked list. For the third part of the data, since the third part of the data has been stored in the least recently used linked list, the third part of the data can be stored in the head of the second area of ​​the least recently used linked list. In this case, the third part of the data corresponds to the fourth data mentioned above. Optionally, the data block of the third part of the data in the least recently used linked list is inserted into the head of the second area in the least recently used linked list, so as to store the third part of the data in the head of the second area in the least recently used linked list.

[0173] As data is continuously stored in the head of the first region or the head of the second region in the least recently used linked list, the amount of data in the least recently used linked list gradually approaches the storage capacity threshold of the least recently used linked list. When the amount of data in the least recently used linked list is not less than the storage capacity threshold of the least recently used linked list, data in the data block at the tail of the least recently used linked list is released to reduce the amount of data in the least recently used linked list. The data block of the released data is a free block, which belongs to the free linked list.

[0174] In the embodiment of the present application, the prompt information is used to prompt that the data volume is not less than the data volume threshold. Therefore, the data read request carrying the prompt information requests a larger amount of data to be read, while the data read request not carrying the prompt information requests a smaller amount of data to be read. By storing data with a larger amount of data in an isolation linked list and storing data with a smaller amount of data in a least recently used linked list, the elimination speed of hot data in the least recently used linked list can be reduced, avoiding repeated reading of hot data and improving device performance.

[0175] It should be noted that, in the embodiment of the present application, when the storage space of the isolation linked list is insufficient or the trigger time of the scanning thread is reached, the isolation linked list is scanned by the scanning thread to release the data of some data blocks in the isolation linked list. This data release method can be called a clock algorithm. For the least recently used linked list, when the amount of data in the least recently used linked list is not less than the storage capacity threshold of the least recently used linked list, the data at the tail of the least recently used linked list is released. This data release method can be called a least recently used algorithm. Table 1 below shows the comparative information of the clock algorithm and the least recently used algorithm in terms of hot data reuse rate and data elimination speed.

[0176] Table 1

[0177] algorithm Hotspot data reuse rate Data elimination speed Data is released directly after being used Approximately 0 Approximately 100% Least Recently Used Algorithm Higher Hotspot data is slowly eliminated Clock Algorithm Higher Non-hotspot data is eliminated quickly

[0178] As can be seen from Table 1, the embodiment of the present application uses a clock algorithm and a least recently used algorithm to ensure the reuse rate of hotspot data and reduce the phenomenon of repeated reading of hotspot data. Since the least recently used algorithm inserts the read data into the head of the first area or the head of the second area, it is difficult for the hotspot data to reach the tail of the least recently used linked list, thereby slowing down the elimination of hotspot data. For the isolation linked list, the number of reads of non-hotspot data is small, and the number of reads of hotspot data is large. As the number of scans increases, non-hotspot data is more likely to meet the requirement that the number of scans is equal to the number of reads than hotspot data, thereby eliminating non-hotspot data faster and reducing the elimination rate of hotspot data.

[0179] See also Figure 6 , Figure 6It is a schematic diagram of the relationship between the concurrency of data read requests and the set performance index provided in an embodiment of the present application, wherein the concurrency of data read requests refers to the number of data read requests received within one second.

[0180] In the embodiment of the present application, the data read request may or may not carry prompt information. When the data read request carries prompt information, the data read request carrying prompt information can be processed using related technologies, or the method provided in the embodiment of the present application (i.e., the technology of the present application) can be used to process the data read request carrying prompt information. Figure 6 It can be seen that when the method provided in the embodiment of the present application is used to process a data read request carrying prompt information, the device performance index is close to the device performance index corresponding to the data read request without the prompt information, while when the related technology is used to process a data read request carrying prompt information, the device performance index is significantly different from the device performance index corresponding to the data read request without the prompt information. Therefore, the method provided in the embodiment of the present application can improve device performance.

[0181] Optionally, the device performance indicator corresponding to the data read request without carrying prompt information is subtracted from the device performance indicator when the data read request carrying prompt information is processed using the relevant technology, and the subtraction result is divided by the device performance indicator corresponding to the data read request without carrying prompt information. The result obtained is used as the first impact indicator, and the first impact indicator is used to describe the impact of the use of relevant technology to process the data read request carrying prompt information on the device performance. Similarly, the device performance indicator corresponding to the data read request without carrying prompt information is subtracted from the device performance indicator when the data read request carrying prompt information is processed using the method provided in the embodiment of the present application, and the subtraction result is divided by the device performance indicator corresponding to the data read request without carrying prompt information. The result obtained is used as the second impact indicator, and the second impact indicator is used to describe the impact of the use of the method in the embodiment of the present application to process the data read request carrying prompt information on the device performance. Based on Figure 6 By calculating the first impact index and the second impact index, the data shown in Table 2 can be obtained.

[0182] Table 2

[0183] Concurrency 5 10 15 20 25 30 First Impact Indicator 8.0% 8.4% 13.4% 18.5% 25.4% 27.9% Second impact indicator 2.9% 3.7% 3.6% 4.0% 5.3% 4.3% Concurrency 35 40 45 50 55 60 First Impact Indicator 27% 29.7% 33.2% 37.8% 41.2% 45.3% Second impact indicator 4.9% 5.7% 5.8% 8.0% 9.8% 9.3%

[0184] As can be seen from Table 2, the first impact index is greater than the second impact index, indicating that the impact of using the relevant technology to process the data read request carrying prompt information on the device performance is greater than the impact of using the method of the embodiment of the present application to process the data read request carrying prompt information on the device performance. Among them, when the concurrency is less than or equal to 60, the average value of the first impact index is approximately 26.3%, and the average value of the second impact index is approximately 5.6%, which also indirectly illustrates that the impact of using the relevant technology to process the data read request carrying prompt information on the device performance is greater than the impact of using the method of the embodiment of the present application to process the data read request carrying prompt information on the device performance. In other words, the method of the embodiment of the present application can improve device performance.

[0185] Figure 7 FIG. 1 is a schematic diagram of a data reading device provided in an embodiment of the present application. Figure 7 As shown, the device comprises:

[0186] An acquisition module 701 is used to acquire a read request of target data;

[0187] A determination module 702 is configured to determine first data from the target data based on prompt information carried in the read request of the target data and according to the data in the first linked list and the data in the second linked list, wherein the prompt information is used to prompt that the data volume of the target data is not less than a data volume threshold, and the first data is not in the first linked list and is not in the second linked list;

[0188] The reading and storing module 703 is used to read the first data from the disk unit and store the first data into the first linked list;

[0189] Among them, the first linked list and the second linked list are linked lists in the cache unit, the first linked list is used to store data requested to be read by a data read request carrying prompt information, and the second linked list is used to store data requested to be read by a data read request not carrying prompt information.

[0190] In a possible implementation, the first linked list before storing the first data includes a plurality of first use units for storing data;

[0191] The reading and storing module 703 is used to scan each first usage unit based on the fact that the sum of the storage capacities of each first idle unit is less than the data volume of the first data, and obtain the number of scans of the data in each first usage unit. The first idle unit is used to be allocated to the first linked list and does not store data; for any first usage unit, based on the fact that the number of scans of the data in any first usage unit is not less than a number threshold, release the data in any first usage unit; based on the fact that the sum of the storage capacity of each first idle unit and the storage capacity of each first usage unit for releasing data is not less than the data volume of the first data, read the first data from the disk unit, and store the first data in each first idle unit and each first usage unit for releasing data.

[0192] In a possible implementation, the acquisition module 701 is further used to acquire configuration parameters of the first linked list, where the configuration parameters are used to determine a storage capacity threshold of the first linked list;

[0193] The determination module 702 is further configured to determine at least one first idle unit according to the storage capacity threshold of the first linked list and the storage capacity of each first used unit.

[0194] In a possible implementation, the first linked list after the first data is stored includes a plurality of second use units storing data; and the device further includes:

[0195] A scanning module, configured to scan each second usage unit through a scanning thread based on reaching a trigger condition of the scanning thread, and obtain a scanning number of data in each second usage unit;

[0196] The release module is used to release the data in any second usage unit based on the scanning times of the data in any second usage unit being not less than the times threshold.

[0197] In a possible implementation, the acquisition module 701 is further used to acquire a concurrency parameter, where the concurrency parameter is used to describe the concurrency of the data read request carrying the prompt information;

[0198] The device also includes:

[0199] An improving module, used for increasing the triggering frequency of the scanning thread based on the concurrency parameter being greater than the first parameter threshold;

[0200] A reduction module, used for reducing the triggering frequency of the scanning thread based on the concurrency parameter being less than the second parameter threshold;

[0201] The increased trigger frequency or the decreased trigger frequency is used to determine whether the trigger condition of the scanning thread is met.

[0202] In a possible implementation, the determination module 702 is further configured to determine at least one of the second data and the third data from the target data based on the data in the first linked list and the data in the second linked list, based on the read request for the target data not carrying the prompt information, the second data being in the first linked list and not in the second linked list, and the third data being not in the first linked list and not in the second linked list;

[0203] The reading and storing module 703 is further used to read the second data from the first linked list and store the second data into the second linked list when the second data is determined;

[0204] The reading and storing module 703 is further used to read the third data from the disk unit and store the third data into the second linked list when the third data is determined.

[0205] In a possible implementation, the second linked list includes a first area, and the reading and storing module 703 is used to store the second data at the head of the first area; store the third data at the head of the first area;

[0206] The second linked list also includes a second area, and the target data also includes fourth data. The fourth data is the data in the second linked list except the second data and the third data in the target data. The reading and storage module 703 is also used to read the fourth data from the second linked list and store the fourth data at the head of the second area.

[0207] In a possible implementation, the head of the first region is spliced ​​with the tail of the second region, and the device further includes:

[0208] A release module, configured to release the data in the tail of the first region based on the electronic device satisfying at least one of the first condition and the second condition, and the amount of data in the second linked list is not less than a storage capacity threshold of the second linked list;

[0209] The electronic device satisfies the first condition when the electronic device stores the fourth data in the header of the second area, and the electronic device satisfies the second condition when the electronic device stores at least one of the second data and the third data in the header of the first area.

[0210] In the above device, when the read request of the target data carries prompt information for prompting that the data volume of the target data is not less than the data volume threshold, the first data that is not in the first linked list and the second linked list is determined from the target data according to the data in the first linked list and the data in the second linked list, and the first data is read from the disk unit and stored in the first linked list, thereby storing the data with a larger data volume in the first linked list. Since the second linked list is used to store the data requested to be read by the data read request that does not carry the prompt information, therefore, by storing the data with a larger data volume in the first linked list and the data with a smaller data volume in the second linked list, the elimination speed of the hot data in the second linked list can be reduced, the phenomenon of repeated reading of the hot data can be reduced, and the performance of the device can be improved.

[0211] It should be understood that the above Figure 7 When the device provided realizes its functions, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0212] Figure 8 The structure block diagram of a terminal device 800 provided by an exemplary embodiment of the present application is shown. The terminal device 800 includes: a processor 801 and a memory 802 .

[0213] The processor 801 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 801 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 801 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 801 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 801 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0214] The memory 802 may include one or more computer-readable storage media, which may be non-transitory. The memory 802 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 802 is used to store at least one computer program, which is used to be executed by the processor 801 to implement the data reading method provided in the method embodiment of the present application.

[0215] In some embodiments, the terminal device 800 may further optionally include: a peripheral device interface 803 and at least one peripheral device. The processor 801, the memory 802 and the peripheral device interface 803 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 803 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 804, a display screen 805, a camera assembly 806, an audio circuit 807 and a power supply 808.

[0216] The peripheral device interface 803 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 801 and the memory 802. In some embodiments, the processor 801, the memory 802, and the peripheral device interface 803 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 801, the memory 802, and the peripheral device interface 803 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.

[0217] The radio frequency circuit 804 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 804 communicates with communication networks and other communication devices through electromagnetic signals. The radio frequency circuit 804 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 804 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency circuit 804 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 804 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.

[0218] The display screen 805 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 805 is a touch display screen, the display screen 805 also has the ability to collect touch signals on the surface or above the surface of the display screen 805. The touch signal can be input to the processor 801 as a control signal for processing. At this time, the display screen 805 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 805 can be one, set on the front panel of the terminal device 800; in other embodiments, the display screen 805 can be at least two, respectively set on different surfaces of the terminal device 800 or in a folding design; in other embodiments, the display screen 805 can be a flexible display screen, set on the curved surface or folding surface of the terminal device 800. Even, the display screen 805 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 805 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode, organic light-emitting diode).

[0219] The camera assembly 806 is used to capture images or videos. Optionally, the camera assembly 806 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 806 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.

[0220] The audio circuit 807 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 801 for processing, or input them into the radio frequency circuit 804 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal device 800. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 801 or the radio frequency circuit 804 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 807 may also include a headphone jack.

[0221] The power supply 808 is used to power various components in the terminal device 800. The power supply 808 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 808 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery charged through a wired line, and a wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.

[0222] In some embodiments, the terminal device 800 further includes one or more sensors 809 , including but not limited to: an acceleration sensor 811 , a gyroscope sensor 812 , a pressure sensor 813 , an optical sensor 814 , and a proximity sensor 815 .

[0223] The acceleration sensor 811 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal device 800. For example, the acceleration sensor 811 can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 801 can control the display screen 805 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 811. The acceleration sensor 811 can also be used for collecting game or user motion data.

[0224] The gyroscope sensor 812 can detect the body direction and rotation angle of the terminal device 800, and the gyroscope sensor 812 can cooperate with the acceleration sensor 811 to collect the user's 3D actions on the terminal device 800. The processor 801 can implement the following functions based on the data collected by the gyroscope sensor 812: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.

[0225] The pressure sensor 813 can be set on the side frame of the terminal device 800 and / or the lower layer of the display screen 805. When the pressure sensor 813 is set on the side frame of the terminal device 800, it can detect the user's holding signal of the terminal device 800, and the processor 801 performs left and right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 813. When the pressure sensor 813 is set on the lower layer of the display screen 805, the processor 801 controls the operability controls on the UI interface according to the user's pressure operation on the display screen 805. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.

[0226] The optical sensor 814 is used to collect the ambient light intensity. In one embodiment, the processor 801 can control the display brightness of the display screen 805 according to the ambient light intensity collected by the optical sensor 814. Specifically, when the ambient light intensity is high, the display brightness of the display screen 805 is increased; when the ambient light intensity is low, the display brightness of the display screen 805 is reduced. In another embodiment, the processor 801 can also dynamically adjust the shooting parameters of the camera assembly 806 according to the ambient light intensity collected by the optical sensor 814.

[0227] The proximity sensor 815, also called a distance sensor, is usually arranged on the front panel of the terminal device 800. The proximity sensor 815 is used to collect the distance between the user and the front of the terminal device 800. In one embodiment, when the proximity sensor 815 detects that the distance between the user and the front of the terminal device 800 is gradually decreasing, the processor 801 controls the display screen 805 to switch from the screen-on state to the screen-off state; when the proximity sensor 815 detects that the distance between the user and the front of the terminal device 800 is gradually increasing, the processor 801 controls the display screen 805 to switch from the screen-off state to the screen-on state.

[0228] Those skilled in the art will understand that Figure 8 The structure shown in the figure does not constitute a limitation on the terminal device 800, and may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.

[0229] Fig. 9This is a schematic diagram of the structure of the server provided in the embodiment of the present application. The server 900 may have relatively large differences due to different configurations or performances, and may include one or more processors 901 and one or more memories 902, wherein the one or more memories 902 store at least one computer program, and the at least one computer program is loaded and executed by the one or more processors 901 to implement the data reading method provided by the above-mentioned various method embodiments. Exemplarily, the processor 901 is a CPU. Of course, the server 900 may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The server 900 may also include other components for implementing device functions, which will not be described in detail here.

[0230] In an exemplary embodiment, a computer-readable storage medium is further provided, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor to enable an electronic device to implement any of the above data reading methods.

[0231] Optionally, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.

[0232] In an exemplary embodiment, a computer program is further provided. The computer program is at least one, and the at least one computer program is loaded and executed by a processor to enable an electronic device to implement any of the above data reading methods.

[0233] In an exemplary embodiment, a computer program product is further provided. The computer program product stores at least one computer program, and the at least one computer program is loaded and executed by a processor to enable an electronic device to implement any of the above data reading methods.

[0234] It should be understood that the "plurality" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.

[0235] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0236] The above description is only an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A data reading method, characterized in that: The method comprises: Get a read request for target data; Based on the prompt information carried in the read request of the target data, and according to the data in the first linked list and the data in the second linked list, determining the first data from the target data, wherein the prompt information is used to prompt that the data volume of the target data is not less than a data volume threshold, and the first data is not in the first linked list and is not in the second linked list; Reading the first data from the disk unit, and storing the first data in the first linked list; Among them, the first linked list and the second linked list are linked lists in the cache unit, the first linked list is used to store data requested to be read by the data read request carrying the prompt information, and the second linked list is used to store data requested to be read by the data read request not carrying the prompt information.

2. The method according to claim 1, characterized in that The first linked list before storing the first data includes a plurality of first use units for storing data; The step of reading the first data from the disk unit and storing the first data in the first linked list includes: Based on the fact that the sum of the storage capacities of the first idle units is less than the data volume of the first data, scanning the first used units to obtain the scanning times of the data in the first used units, the first idle units are used to be allocated to the first linked list and do not store data; For any first usage unit, based on the scanning times of the data in the any first usage unit being not less than a times threshold, releasing the data in the any first usage unit; Based on the fact that the sum of the storage capacity of each first idle unit and the storage capacity of each first used unit for released data is not less than the data volume of the first data, the first data is read from the disk unit and stored in each first idle unit and each first used unit for released data.

3. The method according to claim 2, characterized in that Before scanning each first used unit to obtain the number of scans of the data in each first used unit based on the sum of the storage capacities of each first idle unit being less than the data volume of the first data, the method further includes: Acquire configuration parameters of the first linked list, where the configuration parameters are used to determine a storage capacity threshold of the first linked list; At least one first idle unit is determined according to the storage capacity threshold of the first linked list and the storage capacity of each of the first used units.

4. The method according to claim 1, characterized in that The first linked list after storing the first data includes a plurality of second use units storing data; After the first data is read from the disk unit and stored in the first linked list, the method further includes: Based on reaching the trigger condition of the scanning thread, each second usage unit is scanned by the scanning thread to obtain the scanning times of the data in each second usage unit; For any second usage unit, based on the fact that the number of scans of the data in the any second usage unit is not less than a number threshold, the data in the any second usage unit is released.

5. The method according to claim 4, characterized in that The method further comprises: Acquire a concurrency parameter, where the concurrency parameter is used to describe the concurrency of the data read request carrying the prompt information; Based on the concurrency parameter being greater than a first parameter threshold, increasing the triggering frequency of the scanning thread; Based on the concurrency parameter being less than a second parameter threshold, reducing the triggering frequency of the scanning thread; The increased trigger frequency or the decreased trigger frequency is used to determine whether the trigger condition of the scanning thread is met.

6. The method according to claim 1, characterized in that The method further comprises: Based on the read request of the target data not carrying the prompt information, determining at least one of second data and third data from the target data according to the data in the first linked list and the data in the second linked list, the second data is in the first linked list but not in the second linked list, and the third data is not in the first linked list but not in the second linked list; When the second data is determined, reading the second data from the first linked list and storing the second data in the second linked list; When the third data is determined, the third data is read from the disk unit and stored in the second linked list.

7. The method according to claim 6, characterized in that The second linked list includes a first area, and storing the second data in the second linked list includes: storing the second data in the header of the first area; The storing the third data into the second linked list comprises: storing the third data in the header of the first area; The second linked list further includes a second area, the target data further includes fourth data, and the fourth data is data in the target data other than the second data and the third data in the second linked list, and the method further includes: The fourth data is read from the second linked list, and the fourth data is stored in the head of the second area.

8. The method according to claim 7, characterized in that The head of the first region is spliced ​​with the tail of the second region, and the method further includes: Based on the electronic device satisfying at least one of the first condition and the second condition, and the amount of data in the second linked list is not less than the storage capacity threshold of the second linked list, releasing the data in the tail of the first area; The electronic device satisfies the first condition when the electronic device stores the fourth data in the header of the second area, and the electronic device satisfies the second condition when the electronic device stores at least one of the second data and the third data in the header of the first area.

9. A data reading device, characterized in that: The device comprises: An acquisition module, used to obtain a read request for target data; a determination module, configured to determine first data from the target data based on prompt information carried in the read request of the target data and according to data in the first linked list and data in the second linked list, wherein the prompt information is used to prompt that the data volume of the target data is not less than a data volume threshold, and the first data is not in the first linked list and is not in the second linked list; A reading and storing module, used for reading the first data from the disk unit and storing the first data into the first linked list; Among them, the first linked list and the second linked list are linked lists in the cache unit, the first linked list is used to store data requested to be read by the data read request carrying the prompt information, and the second linked list is used to store data requested to be read by the data read request not carrying the prompt information.

10. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor so that the electronic device implements the data reading method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer program, and the at least one computer program is loaded and executed by the processor to enable the electronic device to implement the data reading method according to any one of claims 1 to 8.

12. A computer program product, characterized in that The computer program product stores at least one computer program, and the at least one computer program is loaded and executed by a processor so that the electronic device implements the data reading method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Page data processing method and device, terminal and storage medium

    CN112948440A

  • Cache data management method and device

    CN112948444A

  • Data processing method and device, storage medium and computer equipment

    CN115309671A

  • Computer-readable recording medium storing data storage program, computer, and method thereof

    US20100250855A1