Data access method and device, equipment and storage medium
By using the flag bits of the preset queue in the data access request to determine the hotspot request, the problem of poor flexibility in the identification of hotspot requests in the prior art is solved, and the data access success rate is improved.
Patent Information
- Application Number
- CN202311863014.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-07-01
AI Technical Summary
The existing hotspot request identification methods are poor in flexibility, resulting in a high failure rate of hotspot requests and cannot effectively improve the success rate of data access.
By obtaining the identification and request type of the data access request, the flag bit in the preset queue is used to determine whether it is a hotspot request. If so, the data will be obtained from the cache. Otherwise, the flag bit value will be obtained and updated from the database to identify subsequent requests as a hotspot request.
It realizes flexible and timely identification of hot spot requests, reduces the probability of user access failure caused by insufficient processing capabilities of storage services, and improves the success rate of data access requests.
Smart Images

Figure CN120238326A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of data access, and in particular, to a data access method, apparatus, device, and storage medium. Background Art
[0002] In Internet applications, a large amount of data access is usually required. Distributed storage systems provide services with unlimited storage space, high performance, and high reliability. However, for high-frequency hot requests from users for the same data, the underlying service cannot provide high throughput, and requests beyond the processing capacity can only be rejected, resulting in failures of user hot requests. To improve the service ability for hot requests, a cache layer is usually added on top of the storage service, and after identifying a hot request, the data is directly retrieved from the cache layer and returned to the user.
[0003] Existing hot request identification methods mainly include rule matching method and hot spot statistics method. The rule matching method specifically involves manually configuring hot identifiers, preloading the data corresponding to the hot identifiers into the cache, or adding a central counter to count the hot identifiers, and identifying hot requests based on whether the request contains a hot identifier or the counting result of the included hot identifier. However, only hot requests containing fixed hot identifiers can be identified by the rule matching method, and the flexibility is poor. The hot spot statistics method analyzes the logs to count the hot identifiers and loads the corresponding data into the cache, which has a lag and still causes some hot requests to fail, affecting the success rate of requests. Therefore, how to flexibly and real-time identify hot requests and improve the access success rate of data access requests is a technical problem to be solved. Summary of the Invention
[0004] To solve the above technical problems, the present disclosure provides a data access method, apparatus, device, and storage medium.
[0005] In a first aspect of an embodiment of the present disclosure, a data access method is provided, and the method includes:
[0006] Obtain a first data access request, where the first data access request includes an identifier of target data to be accessed and request type information;
[0007] If it is determined according to the request type information that the request type of the first data access request is a read request, then determine whether the first data access request is a hot request based on a flag bit corresponding to the identifier in a preset queue;
[0008] If so, access a cache based on the identifier to obtain the target data;
[0009] Otherwise, access the database based on the identifier, obtain the target data, and modify the value stored in the flag bit in the preset queue to a preset value, so as to determine that the second data access request is a hot request when the value stored in the flag bit corresponding to the identifier included in the second data access request after the first data access request in the preset queue is the preset value.
[0010] The second aspect of the embodiments of the present disclosure provides a data access device, which includes:
[0011] A request acquisition module, configured to acquire a first data access request, where the first data access request includes an identifier of target data to be accessed and request type information;
[0012] A judgment module, configured to, if it is determined according to the request type information that the request type of the first data access request is a read request, judge whether the first data access request is a hot request based on the flag bit corresponding to the identifier in a preset queue;
[0013] A first access module, configured to, if so, access a cache based on the identifier and obtain the target data;
[0014] A second access module, configured to, if not, access the database based on the identifier, obtain the target data, and modify the value stored in the flag bit in the preset queue to a preset value, so as to determine that the second data access request is a hot request when the value stored in the flag bit corresponding to the identifier included in the second data access request after the first data access request in the preset queue is the preset value.
[0015] The third aspect of the embodiments of the present disclosure provides a computer device, including a memory, a processor, and a computer program, where the computer program is stored in the memory, and when the computer program is executed by the processor, the data access method as described in the first aspect above is implemented.
[0016] The fourth aspect of the embodiments of the present disclosure provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the data access method as described in the first aspect above is implemented.
[0017] The technical solutions provided by the embodiments of the present disclosure have the following advantages compared with the prior art:
[0018] In the data access method, apparatus, device, and storage medium provided by the embodiments of the present disclosure, by obtaining a first data access request, the first data access request includes an identifier of target data to be accessed and request type information. If it is determined according to the request type information that the request type of the first data access request is a read request, then based on the flag bit corresponding to the identifier in a preset queue, it is determined whether the first data access request is a hot request. If so, the cache is accessed based on the identifier to obtain the target data. If not, the database is accessed based on the identifier to obtain the target data, and the value stored in the flag bit in the preset queue is modified to a preset value, so that when the value stored in the flag bit corresponding to the identifier included in a second data access request after the first data access request in the preset queue is the preset value, it is determined that the second data access request is a hot request. It is possible to identify a hot request flexibly and in a timely manner without a preset hot identifier, and then obtain the target data to be accessed by the hot request from the cache, reduce the number of times of accessing the database for the same data in a short time, reduce the probability of user access failure caused by insufficient storage service processing capabilities, and improve the access success rate of data access requests. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure.
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0021] Figure 1 is a flowchart of a data access method provided by an embodiment of the present disclosure;
[0022] Figure 2 is a flowchart of a method for determining a hot request provided by an embodiment of the present disclosure;
[0023] Figure 3 is a flowchart of a method for obtaining target data provided by an embodiment of the present disclosure;
[0024] Figure 4 is a flowchart of a method for determining whether target metadata is included in a cache provided by an embodiment of the present disclosure;
[0025] Figure 5 is a flowchart of another method for determining whether target metadata is included in a cache provided by an embodiment of the present disclosure;
[0026] Figure 6 is a flowchart of a method for determining whether target data is included in a cache provided by an embodiment of the present disclosure;
[0027] Figure 7 is a flowchart of a method for writing data provided by an embodiment of the present disclosure;
[0028] Figure 8 is a schematic structural diagram of a data access device provided by an embodiment of the present disclosure;
[0029] Figure 9 is a schematic structural diagram of a computer device provided by an embodiment of the present disclosure. Detailed implementation manners
[0030] In order to more clearly understand the above objects, features, and advantages of the present disclosure, the solutions of the present disclosure will be further described below. It should be noted that, without conflict, the embodiments of the present disclosure and the features in the embodiments may be combined with each other.
[0031] In the following description, many specific details are set forth to fully understand the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only a part of the embodiments of the present disclosure, rather than all the embodiments.
[0032] It should be understood that the various steps recorded in the method embodiments of the present disclosure may be executed in different orders and / or executed in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this regard.
[0033] Figure 1 is a flowchart of a data access method provided by an embodiment of the present disclosure, and this method can be executed by a data access device. As Figure 1 shown, the data access method provided in this embodiment includes the following steps:
[0034] S101. Obtain a first data access request, where the first data access request includes an identifier of target data to be accessed and request type information.
[0035] The target data in the embodiments of the present disclosure can be understood as the data to be accessed by the first access request. For example, for a read request, the target data is the target read data stored in the cache or database, and for a write request, the target data is the target write data carried in the data access request.
[0036] The identifier in the embodiments of the present disclosure can be understood as the information used to identify the target data to be accessed, and different data corresponds to different identifiers.
[0037] The request type information in the embodiments of the present disclosure can be understood as information used to characterize the request type of the first data access request. The request type includes a read request and a write request. For example, the request type information can be the information carried by the flag bit included in the first data access request for characterizing the request type. Different values of the flag bit represent different request types, and this flag bit can be specifically located in the request header of the first data access request.
[0038] In the embodiments of the present disclosure, after obtaining the first data access request sent by the user and including the identifier of the target data to be accessed and the request type information, the data access device can obtain the identifier and the request type information from the first data access request.
[0039] In an exemplary implementation manner of the embodiments of the present disclosure, the data access device may include a reverse proxy web server Nginx (engine x). After obtaining the first data access request, the data access device can obtain the identifier and the request type information included in the first data access request through Nginx in the rewrite stage.
[0040] S102. If it is determined according to the request type information that the request type of the first data access request is a read request, then based on the flag bit corresponding to the identifier in the preset queue, it is determined whether the first data access request is a hot request.
[0041] The preset queue in the embodiments of the present disclosure can be understood as a pre-created storage queue including multiple flag bits. For example, each flag bit can store a value of 0 or 1. After the preset queue is created, the initial value stored in each flag bit therein can be 0. This preset queue can be set in the Nginx server to identify hot requests in the access stage.
[0042] In the embodiments of the present disclosure, after obtaining the identifier and the request type information included in the first data access request, the data access device can determine the request type of the first data access request according to the request type information. If the request type of the first data access request is a read request, then it is further determined whether the first data access request is a hot request. Specifically, the flag bit corresponding to the identifier can be determined according to the identifier in the first data access request, and then it is determined whether the first data access request is a hot request based on the flag bit in the preset queue.
[0043] In an exemplary implementation of the embodiments of the present disclosure, after determining that the request type of the first data access request is a read request, the data access device may determine the corresponding flag bits according to the identifiers in the first data access request, locate these flag bits in a preset queue, obtain the values stored on the flag bits in the preset queue, and analyze the obtained values. According to the analysis result, it is determined whether the first data access request is a hot request.
[0044] S103. If so, access the cache based on the identifier to obtain the target data.
[0045] In the embodiments of the present disclosure, after determining that the first data access request is a hot request, the data access device may perform an operation of accessing the cache, search for and obtain the target data according to the identifier included in the first data access request. Specifically, when the target data corresponding to the identifier is included in the cache, the target data may be obtained from the cache according to the identifier; when the target data corresponding to the identifier is not included in the cache, the database is accessed according to the identifier to obtain the target data. Optionally, when the target data corresponding to the identifier is not included in the cache and the target data is obtained by accessing the database according to the identifier, the target data obtained from the database may be written into the cache, so that when the next read request containing the same identifier is determined to be a hot request, the data access device can directly obtain the target data when accessing the cache based on the identifier.
[0046] In an exemplary implementation of the embodiments of the present disclosure, after determining that the first data access request is a hot request, the data access device may add a hot mark to the first hot access request. Specifically, a request header may be added as the hot mark, so that the storage interface (Application Programming Interface, API) determines whether the data access request is a hot request according to whether the data access request carries the request header corresponding to the hot mark, and thus performs different processes of accessing the cache or accessing the database.
[0047] S104. If not, access the database based on the identifier to obtain the target data, and modify the value stored on the flag bit in the preset queue to a preset value, so that when the value stored on the flag bit corresponding to the identifier included in the second data access request after the first data access request in the preset queue is the preset value, it is determined that the second data access request is a hot request.
[0048] In an embodiment of the present disclosure, after determining that the first data access request is not a hot request, the data access device may perform an operation of accessing the database, search for and obtain target data in the database according to the identifier included in the first data access request, and modify the value stored in the flag bit in the preset queue to a preset value based on the storage rule of the preset queue. Thus, after receiving the first data access request, when receiving a second data access request containing the same identifier and the value stored in the flag bit corresponding to the identifier in the preset queue is the preset value, it is determined whether the second data access request is a hot request. Wherein, each flag bit in the preset queue is used to store a value of 0 or 1, and when the initial value is 0, the preset value may be 1.
[0049] In an exemplary implementation manner of an embodiment of the present disclosure, if it is determined according to the request type information included in the second data access request that the request type of the second data access request is a read request, then when it is determined that the value stored in the flag bit corresponding to the identifier in the preset queue is the preset value according to the identifier included in the second data access request, it is determined that the second data access request is a hot request.
[0050] In an embodiment of the present disclosure, by obtaining a first data access request, the first data access request includes an identifier of target data to be accessed and request type information. If it is determined according to the request type information that the request type of the first data access request is a read request, then based on the flag bit corresponding to the identifier in the preset queue, it is determined whether the first data access request is a hot request. If so, the target data is obtained by accessing the cache based on the identifier. If not, the target data is obtained by accessing the database based on the identifier, and the value stored in the flag bit in the preset queue is modified to the preset value, so that when the value stored in the flag bit corresponding to the identifier included in the second data access request after the first data access request in the preset queue is the preset value, it is determined that the second data access request is a hot request. It is possible to determine the second and subsequent received requests as hot requests when at least two read requests containing the same identifier are received within a short time without a preset hot identifier, thereby flexibly and timely identifying hot requests, and then obtaining the target data to be accessed by the hot requests from the cache, reducing the number of times of accessing the database for the same data within a short time, reducing the probability of user access failure caused by insufficient storage service processing capacity, and improving the access success rate of data access requests.
[0051] In some embodiments of the present disclosure, S102 includes: determining whether the first data access request is a hot request based on whether the value stored in the flag bit corresponding to the identifier in the preset queue is the preset value.
[0052] Specifically, when the data access device needs to determine whether the first data access request is a hot request based on the flag bit in the preset queue, it can determine whether the first data access request is a hot request according to whether the value stored in the flag bit in the preset queue is a preset value. For example, when the value stored in the flag bit in the preset queue is the preset value, it can be determined that the first data access request is a hot request; otherwise, it is determined that the first data access request is not a hot request.
[0053] Optionally, the preset queue is set in the Bloom filter, and the Bloom filter becomes invalid after the creation time reaches the preset time.
[0054] Among them, the Bloom filter where the preset queue is located can be understood as a discriminator for detecting whether an element is in a certain set, and it consists of a storage queue and a mapping function (usually a hash function). Since a hot request is a request for high-frequency access to the same data within a short period of time, it is necessary to set an expiration time for the Bloom filter. After the creation time of the Bloom filter reaches the preset time and it becomes invalid, the preset queue contained therein also becomes invalid at the same time, so as to identify hot requests for high-frequency access to the same data within a short period of time based on the periodically invalidated Bloom filter.
[0055] Figure 2 is a flowchart of a method for determining a hot request provided by an embodiment of the present disclosure. As Figure 2 shown, based on the above embodiment, a hot request can be determined by the following method.
[0056] S201. Perform a mapping process on the identifier to obtain a mapping result.
[0057] In the embodiment of the present disclosure, the data access device can use the mapping function corresponding to the preset Bloom filter to perform a mapping process on the identifier to obtain a mapping result.
[0058] In an exemplary implementation manner of the embodiment of the present disclosure, the data access device can perform multiple mapping processes on the identifier respectively based on a plurality of preset mapping functions to obtain multiple mapping results.
[0059] S202. Based on the first preset queue included in the unexpired first Bloom filter, determine whether the value stored in the flag bit corresponding to the mapping result in the first preset queue is a preset value.
[0060] In the embodiment of the present disclosure, after obtaining the mapping result corresponding to the identifier, the data access device can obtain the unexpired first Bloom filter at the current moment, and use the first preset queue included in the first Bloom filter to determine whether the value stored in the flag bit corresponding to the mapping result is a preset value.
[0061] In an exemplary implementation manner of the embodiments of the present disclosure, after obtaining the mapping result, the data access device may determine whether there is an unexpired first Bloom filter currently. If not, a first Bloom filter is created.
[0062] In another exemplary implementation manner of the embodiments of the present disclosure, there may be multiple valid Bloom filters at the same time. Each Bloom filter contains a storage queue respectively, and the numerical ranges corresponding to the flag bits in each storage queue are different. For example, there may be three unexpired Bloom filters A, B, and C at the same time. The numerical ranges corresponding to the flag bits in the storage queues they contain are 1-10, 11-20, and 21-30 respectively. The mapping results corresponding to the identifiers abc are 1, 4, and 7, and the mapping results corresponding to the identifier bcd are 21, 24, and 27. Then, the flag bits corresponding to the mapping results 1, 4, and 7 of the identifier abc need to be found in the storage queue contained in Bloom filter A, and the flag bits corresponding to the mapping results 21, 24, and 27 of the identifier bcd need to be found in the storage queue contained in Bloom filter C. After the data access device obtains the mapping result corresponding to the identifier, it needs to first determine whether the Bloom filter corresponding to the numerical range where it is located is expired according to the mapping result. If not, it is determined as the first Bloom filter, and S202 is executed. It is judged whether the value stored in the flag bit corresponding to the mapping result in the storage queue contained in this first Bloom filter is the preset value. If there is no unexpired Bloom filter corresponding to the numerical range where the mapping result is located, a corresponding first Bloom filter is created. Since the storage queue contained in the newly created first Bloom filter is in an initial state, the values stored in all flag bits are not the preset value. Therefore, the value stored in the flag bit corresponding to the mapping result in the storage queue contained in the first Bloom filter is modified to the preset value, and the step of directly judging whether the value stored in the flag bit corresponding to the mapping result is the preset value by using the second preset queue contained in the latest expired second Bloom filter is executed. When the value stored in the flag bit corresponding to the mapping result in the second preset queue contained in the latest expired second Bloom filter is the preset value, the first data access request is determined as a hot request.
[0063] S203. If so, determine that the first data access request is a hot request.
[0064] In the embodiments of the present disclosure, after determining that the value stored in the flag bit corresponding to the mapping result in the first preset queue contained in the first Bloom filter is the preset value, the data access device may determine that at least one data access request containing the same identifier has been received within a short time before receiving the first data access request. Therefore, the first data access request is determined as a hot request.
[0065] S204. If not, modify the value stored in the flag bit corresponding to the mapping result in the first preset queue to a preset value, and determine that the first data access request is a hot request when the value stored in the flag bit corresponding to the mapping result in the second preset queue included in the latest invalidated second Bloom filter is the preset value.
[0066] In the embodiments of the present disclosure, when the data access device determines that the value stored in the flag bit corresponding to the mapping result in the first preset queue included in the first Bloom filter is not the preset value, it can determine that no data access request containing the same identifier has been received after the creation of the first Bloom filter. Therefore, the value stored in the flag bit corresponding to the mapping result in the first Bloom filter is modified to the preset value, and the latest invalidated second Bloom filter is used to determine whether the value stored in the flag bit corresponding to the mapping result is the preset value. When the value stored in the flag bit corresponding to the mapping result in the second preset queue included in the latest invalidated second Bloom filter is the preset value, it is determined that the first data access request is a hot request, avoiding misjudgment of hot requests caused by receiving a data access request containing the same identifier shortly before the second Bloom filter expires, but due to the expiration of the second Bloom filter during this interval, the value stored in the flag bit corresponding to the mapping result in the second preset queue included in the newly created first Bloom filter is not the preset value.
[0067] In an exemplary implementation manner of the embodiments of the present disclosure, when there are multiple Bloom filters at the same time and the Bloom filter corresponding to the numerical range where the mapping result is located becomes invalid, after re-creating the first Bloom filter and modifying the value stored in the flag bit corresponding to the mapping result in the storage queue it contains to the preset value, the data access device can search for the latest invalidated Bloom filter in the invalidated Bloom filter corresponding to the numerical range where the mapping result is located and determine it as the second Bloom filter. When the value stored in the flag bit corresponding to the mapping result in the second preset queue included in the second Bloom filter is the preset value, it is determined that the first data access request is a hot request.
[0068] In the embodiments of the present disclosure, by performing mapping processing on an identifier to obtain a mapping result, and based on a first preset queue included in an unexpired first Bloom filter, determining whether the value stored in the flag bit corresponding to the mapping result in the first preset queue is a preset value. If so, it is determined that the first data access request is a hot request. If not, the value stored in the flag bit corresponding to the mapping result in the first preset queue is modified to the preset value, and when the value stored in the flag bit corresponding to the mapping result in a second preset queue included in the most recently expired second Bloom filter is the preset value, it is determined that the first data access request is a hot request. It is possible to implement the determination of hot requests based on a Bloom filter, ensuring that when at least two data access requests containing the same identifier are received within the expiration duration of the Bloom filter, i.e., the preset time, hot requests can be accurately identified, avoiding missed judgments.
[0069] In some embodiments of the present disclosure, the process of receiving a data access request, determining whether the data access request is a hot request, and finally obtaining the target data is as follows: within the preset time, the data access device sequentially receives three data access requests A1, A2, and A3 containing the same identifier abc. Among them, A1 is the first data access request containing the identifier abc received during this period. After receiving A1, the value stored in the flag bit corresponding to the mapping result in the storage queue of the Bloom filter is not the preset value, and it is determined that A1 is not a hot request. The value stored in the flag bit corresponding to the mapping result in the storage queue of the Bloom filter is modified to the preset value, and the target data is obtained by accessing the database. After receiving A2, the value stored in the flag bit corresponding to the mapping result in the storage queue of the Bloom filter is the preset value, and it is determined that A2 is a hot request. The cache is accessed, but the target data is not found in the cache. The database is further accessed to obtain the target data, and the target data is written into the cache. After receiving A3, the value stored in the flag bit corresponding to the mapping result in the storage queue of the Bloom filter is the preset value, and it is determined that A3 is a hot request, and the target data is obtained by accessing the cache.
[0070] In some other embodiments of the present disclosure, S103 includes: accessing a first cache based on the identifier to obtain target metadata corresponding to the target data; accessing a second cache based on the target metadata to obtain the target data. The first cache is used to cache metadata, and the second cache is used to cache data.
[0071] Specifically, the target metadata can be understood as data used to describe the target data. For example, the target metadata may include the logical address of the target data, and this logical address can point to the physical address of the target data in the second cache and the second database. After the data access device parses the identifier, it can access the first cache for caching metadata based on the identifier to obtain the target metadata, and locate the target data based on the target metadata, and access the second cache for caching data to obtain the target data.
[0072] Optionally, since the amount of metadata is small while the amount of data is large, the first cache may be set as a central cache, and the second cache may be set as a distributed cache. When accessing the first cache and the second cache through the storage API, the second cache may be set as the local cache of the storage API.
[0073] Figure 3 is a flowchart of a method for obtaining target data provided by an embodiment of the present disclosure. As Figure 3 shown, based on the above embodiment, the target data can be obtained through the following method.
[0074] S301. Access the first cache based on the identifier.
[0075] In the embodiment of the present disclosure, after obtaining the identifier in the first data access request, the data access device may access the first cache for caching metadata according to the identifier, specifically, determine whether the target metadata is included in the first cache.
[0076] S302. If the target metadata is included in the first cache, extract the target metadata from the first cache.
[0077] In the embodiment of the present disclosure, when the data access device determines that the target metadata is included in the first cache, it may extract the target metadata from the first cache.
[0078] S303. If the target metadata is not included in the first cache, access the first database based on the identifier, extract the target metadata from the first database, and write the target metadata into the first cache.
[0079] In the embodiment of the present disclosure, when the data access device determines that the target metadata is not included in the first cache, it may further access the first database for storing metadata based on the identifier, extract the target metadata from the first database, and write the target metadata into the first cache.
[0080] S304. Access the second cache based on the target metadata.
[0081] In the embodiment of the present disclosure, after extracting the target metadata from the first cache or the first database, the data access device may access the second cache based on the target metadata to determine whether the target data is included in the second cache.
[0082] S305. If the target data is included in the second cache, extract the target data from the second cache.
[0083] In the embodiment of the present disclosure, when the data access device determines that the target data is included in the second cache, it may extract the target data from the second cache.
[0084] S306. If the target data is not included in the second cache, access the second database based on the target metadata, extract the target data from the second database, and write the target data into the second cache. The first database is used to store metadata, and the second database is used to store data.
[0085] In the embodiments of the present disclosure, when it is determined that the target data is not included in the second cache, the data access device may access the second database for storing data based on the target metadata, and extract the target data from the second database.
[0086] In the embodiments of the present disclosure, by accessing the first cache based on an identifier, if the target metadata is included in the first cache, extract the target metadata from the first cache; if the target metadata is not included in the first cache, access the first database based on the identifier, and extract the target metadata from the first database, write the target metadata into the first cache, access the second cache based on the target metadata, if the target data is included in the second cache, extract the target data from the second cache; if the target data is not included in the second cache, access the second database based on the target metadata, and extract the target data from the second database, write the target data into the second cache. The first database is used to store metadata, and the second database is used to store data, so as to realize the acquisition of the target data to be accessed.
[0087] Figure 4 It is a flowchart of a method for determining whether target metadata is included in a cache provided by the embodiments of the present disclosure. As Figure 4 shown, based on the above embodiments, the following method may be used to determine whether target metadata is included in the cache. The data access device may create a data access process and control the data access process to perform a data access operation.
[0088] S401. Determine that there is no other process accessing the target metadata, where the other process is a process other than the data access process.
[0089] In the embodiments of the present disclosure, when the data access device needs to find the target metadata in the first cache, it may first determine whether there is any other process accessing the target metadata, and when it is determined that there is no other process accessing the target metadata, access the target metadata. Optionally, before each access to the target metadata by the data access device, it is necessary to determine that there is no other process accessing the target metadata.
[0090] In an exemplary implementation of the embodiments of the present disclosure, when determining whether there are other processes accessing the target metadata, the data access device may determine whether there is a sentry corresponding to the target metadata. Herein, the sentry can be understood as protection information set to ensure metadata consistency, which can prevent the metadata from being accessed by other objects while being modified by a certain object. When there is a corresponding sentry for the metadata, it indicates that the metadata is being modified and it is necessary to wait until the metadata modification is completed. When there is no corresponding sentry, the metadata can be accessed.
[0091] In an exemplary implementation of the embodiments of the present disclosure, when the data access device determines that there are other processes accessing the target metadata, it may access the first database based on the identifier and extract the target metadata from the first database.
[0092] S402. Access the first cache based on the identifier. When the target metadata is not included in the first cache, determine whether other processes are accessing the target metadata.
[0093] In the embodiments of the present disclosure, when the data access device determines that there are no other processes accessing the target metadata, it may access the first cache based on the identifier. When the target metadata is not included in the first cache, it may determine again whether there are other processes accessing the target metadata.
[0094] S403. If so, access the first cache again based on the identifier after waiting for the first time. When the target metadata is not included in the first cache during the second access to the first cache, it is determined that the target metadata is not included in the first cache.
[0095] The first time in the embodiments of the present disclosure can be understood as the waiting time set to wait for the access operation of other objects to the target metadata to be completed. Optionally, the specific duration of the first time can be preset or randomly determined by a random function.
[0096] In the embodiments of the present disclosure, when the data access device determines that there are other processes accessing the target metadata, it may access the first cache again based on the identifier after waiting for the first time, and determine whether the target metadata is included in the first cache. After determining that the target metadata is not included in the first cache during the second access to the first cache, it is determined that the target metadata is not included in the first cache.
[0097] S404. If not, access the first cache again based on the identifier. When the target metadata is not included in the first cache during the second access to the first cache, access the first cache for the third time based on the identifier after waiting for the second time. When the target metadata is not included in the first cache during the third access to the first cache, it is determined that the target metadata is not included in the first cache.
[0098] The specific duration of the second time in the embodiments of the present disclosure can be preset or randomly determined by a random function.
[0099] In the embodiments of the present disclosure, when the data access device determines that there is no other process accessing the target metadata, it can determine that it can access the target metadata at this time. Therefore, based on the identifier, it accesses the first cache again to determine whether the first cache contains the target metadata. After determining that the first cache does not contain the target metadata when accessing the first cache again, it waits for the second time, then accesses the first cache for the third time based on the identifier to determine whether the first cache contains the target metadata. After determining that the first cache does not contain the target metadata when accessing the first cache for the third time, it is determined that the first cache does not contain the target metadata.
[0100] In the embodiments of the present disclosure, by determining that there is no other process accessing the target metadata (the other process is a process other than the data access process), accessing the first cache based on the identifier, and when the first cache does not contain the target metadata, determining whether the other process is accessing the target metadata. If so, after waiting for the first time, it accesses the first cache again based on the identifier. If the first cache does not contain the target metadata when accessing the first cache again, it is determined that the first cache does not contain the target metadata. If not, it accesses the first cache again based on the identifier. If the first cache does not contain the target metadata when accessing the first cache again, it accesses the first cache for the third time based on the identifier after waiting for the second time. If the first cache does not contain the target metadata when accessing the first cache for the third time, it is determined that the first cache does not contain the target metadata. This can ensure the consistency of the metadata, and at the same time, by accessing the first cache multiple times, it is possible to find and obtain the target metadata from the first cache as much as possible, reduce the access frequency to the first database, and further improve the access success rate of the data access request.
[0101] Figure 5 It is a flowchart of another method provided by the embodiments of the present disclosure for determining whether the cache contains the target metadata. The following is combined with Figure 5 to illustrate the process of S401 - S404. Among them, the data access device can determine whether the target metadata is being accessed by other processes by determining whether the first sentry corresponding to the target metadata exists.
[0102] Such as Figure 5As shown, after the data access device determines that the first data access request is a hotspot request, it determines whether the first sentinel corresponding to the target metadata exists. If it exists, it accesses the first database, obtains the target metadata from the first database and returns the result. If it does not exist, it accesses the first cache and determines whether the target metadata is included in the first cache. If it is included, it extracts the target metadata from the first cache. If it is not included, it creates a process lock to prevent concurrent reads of the storage. After successful creation, it determines again whether the first sentinel corresponding to the target metadata exists. If the first sentinel does not exist, it accesses the first cache again based on the identifier and determines whether the target metadata is included in the first cache. If it is included, it extracts the target metadata from the first cache. If it is not included, it accesses the first cache for the third time based on the identifier after waiting for the second time and determines whether the target metadata is included in the first cache. If it is included, it extracts the target metadata from the first cache. If it is not included, it accesses the first database, extracts the target metadata from the first database, writes the target metadata into the first cache. If the first sentinel exists, it accesses the first cache again based on the identifier after waiting for the first time and determines whether the target metadata is included in the first cache. If it is included, it extracts the target metadata from the first cache. If it is not included, it accesses the first database, extracts the target metadata from the first database, writes the target metadata into the first cache, and after obtaining the target metadata from the first cache or the first database, releases the process lock and returns the processing result.
[0103] In some other embodiments of the present disclosure, S304 specifically includes: accessing the second cache based on the target metadata. When accessing the second cache, if the target data is not included in the second cache, it accesses the second cache again based on the target metadata. When accessing the second cache again, if the target data is not included in the second cache, it accesses the second cache for the third time based on the target metadata after waiting for the third time. When accessing the second cache for the third time, if the target data is not included in the second cache, it determines that the target data is not included in the second cache.
[0104] Figure 6 It is a flowchart of a method for determining whether target data is included in a cache provided by an embodiment of the present disclosure. The following combines Figure 6 to illustrate the specific execution process of S304.
[0105] As Figure 6As shown, after determining that the first data access request is a hot request and obtaining the target metadata, the data access device accesses the second cache based on the target metadata, and determines whether the target data is included in the second cache. If it is included, the target data is extracted from the second cache and then the processing result is returned. If it is not included, a process lock is created, and the second cache is accessed again based on the target metadata to determine whether the target data is included in the second cache. If it is included, the target data is extracted from the second cache. If it is not included, after waiting for a third period of time, the second cache is accessed for the third time based on the target metadata to determine whether the target data is included in the second cache. If it is included, the target data is extracted from the second cache. If it is not included, the second database is accessed based on the target metadata, the target data is extracted from the second database and written into the second cache, and after obtaining the target data from the second cache or the second database, the process lock is released and the processing result is returned.
[0106] Figure 7 It is a flowchart of a method for writing data provided by an embodiment of the present disclosure. As Figure 7 shown, based on the above embodiment, data can be written through the following method.
[0107] S701. If it is determined according to the request type information that the request type of the first data access request is a write request, the target metadata is marked to obtain a marking result, so that other processes stop accessing the target metadata when detecting the marking result.
[0108] In an embodiment of the present disclosure, when the data access device determines that the request type of the first data access request is a write request according to the request type information in the first data access request, the target metadata and the target data to be written in the first data access request can be obtained, and the target metadata is marked to obtain a marking result, so that other processes stop accessing the target metadata when detecting the marking result.
[0109] In an exemplary implementation manner of the embodiment of the present disclosure, the data access device marks the target metadata, specifically, a second sentinel corresponding to the target metadata can be created, so that when other processes want to access the target metadata, after detecting the second sentinel created by the data access device, they stop accessing the target metadata.
[0110] S702. Clear the historical metadata corresponding to the target metadata in the first cache.
[0111] In the embodiments of the present disclosure, before writing the target metadata, the data access device may first check whether the first cache contains the historical metadata corresponding to the target metadata. If it does, the historical metadata corresponding to the target metadata in the first cache is cleared. Optionally, if the purpose of the first data access request is to modify the data Q0 in the second database to data Q1, the metadata corresponding to Q0 is q0, and the metadata corresponding to Q1 is q1, then it is determined whether the historical metadata q0 is contained in the first cache. If it is, q0 is cleared.
[0112] S703. Clear the historical metadata corresponding to the target metadata in the first database.
[0113] In the embodiments of the present disclosure, after clearing the historical metadata corresponding to the target metadata in the first cache, the data access device may further clear the historical metadata corresponding to the target metadata in the first database. For example, q0 in the first database may be cleared.
[0114] S704. Write the target metadata into the first database.
[0115] In the embodiments of the present disclosure, after determining that the historical metadata corresponding to the target metadata in the first cache and the first database has been cleared, the data access device may write the target metadata into the first database.
[0116] Optionally, after writing the target metadata into the first database, the data access device may determine whether the historical metadata corresponding to the target metadata is contained in the first cache again. If it is, the historical metadata corresponding to the target metadata in the first cache is cleared again.
[0117] S705. Delete the annotation result of the target metadata.
[0118] In the embodiments of the present disclosure, after writing the target metadata into the first database, the data access device may delete the annotation result of the target metadata so that when other processes access the target metadata and determine that there is no annotation result corresponding to the target metadata, they can access the target metadata.
[0119] In an exemplary implementation manner of the embodiments of the present disclosure, after clearing the historical metadata corresponding to the target metadata in the first cache again, the data access device may determine that the related operations of writing the target metadata have been completed, and delete the second sentinel corresponding to the target metadata so that other objects can access the target metadata.
[0120] S706. Write the target data into the second database.
[0121] In an embodiment of the present disclosure, after the target metadata is written to the first database, the data access device may write the target data to the second database.
[0122] In an embodiment of the present disclosure, if it is determined according to the request type information that the request type of the first data access request is a write request, the target metadata is marked to obtain a marking result, so that when other processes detect the marking result, they stop accessing the target metadata, clear the historical metadata corresponding to the target metadata in the first cache, clear the historical metadata corresponding to the target metadata in the first database, write the target metadata to the first database, delete the marking result of the target metadata, and write the target data to the second database. This can ensure the data consistency of the metadata during the writing process, and since new objects are generated during the data writing process itself, there is no data consistency problem.
[0123] Figure 8 It is a schematic structural diagram of a data access device provided by an embodiment of the present disclosure. As Figure 8 shown, the data access device 800 includes: a request acquisition module 810, a judgment module 820, a first access module 830, and a second access module 840. Among them, the request acquisition module 810 is used to acquire a first data access request, and the first data access request includes an identifier of target data to be accessed and request type information; the judgment module 820 is used to, if it is determined according to the request type information that the request type of the first data access request is a read request, judge whether the first data access request is a hot request based on a flag bit corresponding to the identifier in a preset queue; the first access module 830 is used to, if so, access the cache based on the identifier to acquire the target data; the second access module 840 is used to, if not, access the database based on the identifier to acquire the target data, and modify a value stored in the flag bit in the preset queue to a preset value, so that when the value stored in the flag bit corresponding to the identifier included in a second data access request after the first data access request in the preset queue is the preset value, it is determined that the second data access request is a hot request.
[0124] Optionally, the judgment module 820 is specifically used to judge whether the first data access request is a hot request based on whether a value stored in a flag bit corresponding to the identifier in the preset queue is the preset value.
[0125] Optionally, the preset queue is set in a Bloom filter, and the Bloom filter becomes invalid after a creation time reaches a preset time.
[0126] Optionally, the determination module 820 includes: a mapping unit configured to perform mapping processing on the identifier to obtain a mapping result; a determination unit configured to determine whether a value stored in a flag bit corresponding to the mapping result in a first preset queue included in an unexpired first Bloom filter is the preset value; a first determination unit configured to, if so, determine that the first data access request is a hot request; and a second determination unit configured to, if not, modify the value stored in the flag bit corresponding to the mapping result in the first preset queue to the preset value, and determine that the first data access request is a hot request when the value stored in the flag bit corresponding to the mapping result in a second preset queue included in a most recently expired second Bloom filter is the preset value.
[0127] Optionally, the first access module 830 includes: a first access unit configured to access a first cache based on the identifier to obtain target metadata corresponding to the target data; and a second access unit configured to access a second cache based on the target metadata to obtain the target data, where the first cache is used to cache metadata and the second cache is used to cache data.
[0128] Optionally, the first access unit includes: a first access subunit configured to access the first cache based on the identifier; a first extraction subunit configured to, if the target metadata is included in the first cache, extract the target metadata from the first cache; and a second access subunit configured to, if the target metadata is not included in the first cache, access a first database based on the identifier and extract the target metadata from the first database, and write the target metadata into the first cache; the second access unit includes: a third access subunit configured to access the second cache based on the target metadata; a second extraction subunit configured to, if the target data is included in the second cache, extract the target data from the second cache; and a fourth access subunit configured to, if the target data is not included in the second cache, access a second database based on the target metadata and extract the target data from the second database, and write the target data into the second cache, where the first database is used to store metadata and the second database is used to store data.
[0129] Optionally, the method is executed by a data access process; the first access unit further includes: a determination subunit, configured to determine that there is no other process accessing the target metadata, where the other process is a process other than the data access process; the first access subunit includes: a judgment sub-subunit, configured to access the first cache based on the identifier, and when the first cache does not contain the target metadata, judge whether the other process is accessing the target metadata; a first determination sub-subunit, configured to, if so, access the first cache again based on the identifier after waiting for a first time, and when the first cache does not contain the target metadata when accessing the first cache again, determine that the first cache does not contain the target metadata; a second determination sub-subunit, configured to, if not, access the first cache again based on the identifier, and when the first cache does not contain the target metadata when accessing the first cache again, access the first cache for the third time based on the identifier after waiting for a second time, and when the first cache does not contain the target metadata when accessing the first cache for the third time, determine that the first cache does not contain the target metadata.
[0130] Optionally, the third access subunit is specifically configured to access the second cache based on the target metadata, and when the second cache does not contain the target data when accessing the second cache, access the second cache again based on the target metadata, and when the second cache does not contain the target data when accessing the second cache again, access the second cache for the third time based on the target metadata after waiting for a third time, and when the second cache does not contain the target data when accessing the second cache for the third time, determine that the second cache does not contain the target data.
[0131] Optionally, the data access device 800 further includes: a marking module, configured to, if it is determined according to the request type information that the request type of the first data access request is a write request, mark the target metadata to obtain a marking result, so that the other process stops accessing the target metadata when detecting the marking result; a first clearing module, configured to clear the historical metadata corresponding to the target metadata in the first cache; a second clearing module, configured to clear the historical metadata corresponding to the target metadata in the first database; a first writing module, configured to write the target metadata into the first database; a deleting module, configured to delete the marking result of the target metadata; a second writing module, configured to write the target data into the second database.
[0132] The data access device provided in this embodiment can execute the method described in any of the above embodiments, and its execution manner and beneficial effects are similar, which will not be elaborated here.
[0133] Figure 9 It is a schematic structural diagram of a computer device provided by an embodiment of the present disclosure.
[0134] As Figure 9 shown, the computer device may include a processor 910 and a memory 920 storing computer program instructions.
[0135] Specifically, the above-mentioned processor 910 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0136] The memory 920 may include a mass storage for information or instructions. By way of example and not limitation, the memory 920 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disc, a magneto-optical disc, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. In a suitable case, the memory 920 may include removable or non-removable (or fixed) media. In a suitable case, the memory 920 may be internal or external to the integrated gateway device. In a specific embodiment, the memory 920 is a non-volatile solid-state memory. In a specific embodiment, the memory 920 includes a read-only memory (ROM). In a suitable case, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically alterable ROM (EAROM), or a flash memory, or a combination of two or more of these.
[0137] The processor 910 reads and executes the computer program instructions stored in the memory 920 to perform the steps of the data access method provided by the embodiments of the present disclosure.
[0138] In one example, the computer device may further include a transceiver 930 and a bus 940. Among them, as Figure 9 shown, the processor 910, the memory 920, and the transceiver 930 are connected through the bus 940 and complete communication with each other.
[0139] Bus 940 includes hardware, software, or both. By way of example and not limitation, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side BUS (FSB), a Hyper Transport (HT) interconnect, an Industrial Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable bus or a combination of two or more of these. Where appropriate, bus 940 may include one or more buses. Although embodiments of the present application describe and illustrate specific buses, the present application contemplates any suitable bus or interconnect.
[0140] Embodiments of the present disclosure also provide a computer-readable storage medium that may store a computer program, which, when executed by a processor, causes the processor to implement the data access method provided by the embodiments of the present disclosure.
[0141] The above storage medium may include, for example, a memory 920 for computer program instructions, and the above instructions may be executed by a processor 910 of a data access device to complete the data access method provided by the embodiments of the present disclosure. Optionally, the storage medium may be a non-transitory computer-readable storage medium. For example, the non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a compact disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, and an optical data storage device, etc. The above computer program may be written in any combination of one or more programming languages for programming code to perform the operations of the embodiments of the present disclosure. The programming languages include object-oriented programming languages such as Java, C++, etc., and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on a user computing device, partially on the user device, executed as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0142] It should be noted that in this document, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the existence of additional identical elements in the process, method, article or device comprising the element.
[0143] The above are only specific embodiments of the present disclosure, enabling those skilled in the art to understand or implement the present disclosure. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A data access method, characterized in that, The method includes: Obtain a first data access request, where the first data access request includes an identifier of target data to be accessed and request type information; If it is determined according to the request type information that the request type of the first data access request is a read request, then determine whether the first data access request is a hot request based on a flag bit corresponding to the identifier in a preset queue; If so, access the cache based on the identifier to obtain the target data; If not, access the database based on the identifier to obtain the target data, and modify the value stored in the flag bit in the preset queue to a preset value, so that when the value stored in the flag bit corresponding to the identifier included in a second data access request after the first data access request in the preset queue is the preset value, it is determined that the second data access request is a hot request.
2. The method according to claim 1, wherein The determining whether the first data access request is a hot request based on the flag bit corresponding to the identifier in the preset queue includes: Determine whether the first data access request is a hot request based on whether the value stored in the flag bit corresponding to the identifier in the preset queue is the preset value.
3. The method according to claim 2, wherein The preset queue is set in a Bloom filter, and the Bloom filter becomes invalid after a creation time reaches a preset time.
4. The method according to claim 3, characterized in that, The determining whether the first data access request is a hot request based on whether the value stored in the flag bit corresponding to the identifier in the preset queue is the preset value includes: Perform a mapping process on the identifier to obtain a mapping result; Based on a first preset queue included in an unfailed first Bloom filter, determine whether the value stored in the flag bit corresponding to the mapping result in the first preset queue is the preset value; If so, determine that the first data access request is a hot request; If not, modify the value stored in the flag bit corresponding to the mapping result in the first preset queue to the preset value, and when the value stored in the flag bit corresponding to the mapping result in a second preset queue included in a second Bloom filter that has just become invalid is the preset value, determine that the first data access request is a hot request.
5. The method according to claim 1, characterized in that The accessing the cache based on the identifier to obtain the target data includes: Access a first cache based on the identifier to obtain target metadata corresponding to the target data; Access a second cache based on the target metadata to obtain the target data, where the first cache is used to cache metadata and the second cache is used to cache data.
6. The method according to claim 5, wherein The accessing the first cache based on the identifier to obtain target metadata corresponding to the target data includes: Access the first cache based on the identifier; If the target metadata is included in the first cache, extract the target metadata from the first cache; If the target metadata is not included in the first cache, access a first database based on the identifier and extract the target metadata from the first database, and write the target metadata into the first cache; The accessing the second cache based on the target metadata to obtain the target data includes: Access the second cache based on the target metadata; If the target data is included in the second cache, extract the target data from the second cache; If the target data is not included in the second cache, access the second database based on the target metadata, extract the target data from the second database, and write the target data into the second cache. The first database is used to store metadata, and the second database is used to store data.
7. The method according to claim 6, characterized in that The method is executed by a data access process; Before accessing the first cache based on the identifier, the method further includes: Determine that there is no other process accessing the target metadata, where the other process is a process other than the data access process; The accessing the first cache based on the identifier includes: Access the first cache based on the identifier. When the target metadata is not included in the first cache, determine whether the other process is accessing the target metadata; If so, after waiting for a first period of time, access the first cache again based on the identifier. If the target metadata is not included in the first cache when accessing the first cache again, determine that the target metadata is not included in the first cache; If not, access the first cache again based on the identifier. If the target metadata is not included in the first cache when accessing the first cache again, after waiting for a second period of time, access the first cache for the third time based on the identifier. If the target metadata is not included in the first cache when accessing the first cache for the third time, determine that the target metadata is not included in the first cache.
8. The method according to claim 6, characterized in that The accessing the second cache based on the target metadata includes: Access the second cache based on the target metadata. When the target data is not included in the second cache when accessing the second cache, access the second cache again based on the target metadata. If the target data is not included in the second cache when accessing the second cache again, after waiting for a third period of time, access the second cache for the third time based on the target metadata. If the target data is not included in the second cache when accessing the second cache for the third time, determine that the target data is not included in the second cache.
9. The method according to claim 7, characterized in that, The method further includes: If it is determined according to the request type information that the request type of the first data access request is a write request, label the target metadata to obtain a labeling result, so that when the other process detects the labeling result, it stops accessing the target metadata; Clear the historical metadata corresponding to the target metadata in the first cache; Clear the historical metadata corresponding to the target metadata in the first database; Write the target metadata into the first database; Delete the labeling result of the target metadata; Write the target data into the second database.
10. A data access device, characterized in that, The device includes: A request acquisition module, configured to acquire a first data access request, where the first data access request includes an identifier of target data to be accessed and request type information; A determination module, configured to, if it is determined according to the request type information that the request type of the first data access request is a read request, determine whether the first data access request is a hot request based on the flag bit corresponding to the identifier in a preset queue; A first access module, configured to, if so, access a cache based on the identifier to obtain the target data; A second access module, configured to, if not, access a database based on the identifier to obtain the target data, and modify the value stored in the flag bit in the preset queue to a preset value, so that when the value stored in the flag bit corresponding to the identifier included in a second data access request after the first data access request in the preset queue is the preset value, it is determined that the second data access request is a hot request.
11. A computer device, characterized in that, Comprising: A memory; A processor; And a computer program; wherein, the computer program is stored in the memory and is configured to be executed by the processor to implement the method according to any one of claims 1-9.
12. A computer-readable storage medium, characterized in that, A computer program is stored in the storage medium, and when the computer program is executed by a processor, the data access method according to any one of claims 1-9 is implemented.