CN116028530A - Object resource reading method and device, electronic equipment and readable storage medium - Google Patents

Object resource reading method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN116028530A
CN116028530A CN202211611415.3A CN202211611415A CN116028530A CN 116028530 A CN116028530 A CN 116028530A CN 202211611415 A CN202211611415 A CN 202211611415A CN 116028530 A CN116028530 A CN 116028530A
Authority
CN
China
Prior art keywords
target
data
reading
dependent data
object resource
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211611415.3A
Other languages
Chinese (zh)
Inventor
杨东东
段立国
施黄骏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202211611415.3A priority Critical patent/CN116028530A/en
Publication of CN116028530A publication Critical patent/CN116028530A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The disclosure provides an object resource reading method, an object resource reading device, electronic equipment and a storage medium, relates to the field of artificial intelligence, in particular to cloud computing, cloud storage and cloud database technology, and can be applied to an intelligent cloud scene. The specific implementation scheme is as follows: responding to an object resource reading request, and detecting whether a local buffer area stores target reading dependent data matched with the object resource reading request; if the target reading dependent data is stored in the local cache region and the target reading dependent data is determined to be short-time effective cache data, acquiring target object resources matched with the object resource reading request; and taking the target object resource as a feedback result of the object resource reading request. The technical scheme can optimize the existing object resource reading scheme. The stability of the object resource reading service is improved.

Description

Object resource reading method and device, electronic equipment and readable storage medium
Technical Field
The disclosure relates to the field of artificial intelligence, in particular to cloud computing, cloud storage and cloud database technology, which can be applied to intelligent cloud scenes, and particularly relates to an object resource reading method, an object resource reading device, electronic equipment and a non-transitory computer readable storage medium storing computer instructions.
Background
The object store treats the file as a collection of object resources. These object resources are stored in the object storage system in the form of key-value pairs.
When the object storage system provides the read service of the object resource, it also needs to acquire some dependent data from the dependent database to perform request processing, for example, authority information or signature information. Efficient retrieval of dependent data is a necessary condition for the object storage system to be able to provide persistent services externally.
In the related art, when a service failure occurs in the storage-dependent database, the object storage system cannot provide the file reading service to the outside. That is, the service stability of the object storage system is entirely limited by the database-dependent service stability.
Disclosure of Invention
The present disclosure provides an object resource reading method, an object resource reading apparatus, an electronic device, and a non-transitory computer-readable storage medium storing computer instructions.
According to an aspect of the present disclosure, there is provided an object resource reading method, including:
responding to an object resource reading request, and detecting whether a local buffer area stores target reading dependent data matched with the object resource reading request;
If the target reading dependent data is stored in the local cache region and the target reading dependent data is determined to be short-time effective cache data, acquiring target object resources matched with the object resource reading request;
and taking the target object resource as a feedback result of the object resource reading request.
According to another aspect of the present disclosure, there is provided an object resource reading apparatus including:
the dependency data detection module is used for responding to the object resource reading request and detecting whether the local buffer area stores target reading dependency data matched with the object resource reading request;
the object resource obtaining module is used for obtaining the object resource matched with the object resource reading request if the target reading dependent data is stored in the local cache region and the target reading dependent data is determined to be short-time effective cache data;
and the first feedback result generation module is used for taking the target object resource as a feedback result of the object resource reading request.
According to another aspect of the present disclosure, there is provided an electronic device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method according to any one of the embodiments of the present disclosure.
According to another aspect of the present disclosure, there is also provided a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform a method according to any one of the embodiments of the present disclosure.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a flow chart of an object resource reading method provided in accordance with an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of another object resource reading method provided in accordance with an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of yet another object resource reading method provided in accordance with an embodiment of the present disclosure;
FIG. 4 is a view of an object resource reading scenario provided according to an embodiment of the present disclosure;
FIG. 5 is a flow chart of an object resource reading apparatus provided according to an embodiment of the present disclosure;
fig. 6 is a block diagram of an electronic device for implementing an object resource reading method of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a flowchart of an object resource reading method provided according to an embodiment of the present disclosure. The embodiment of the disclosure can be applied to the situation of accessing the object resources in the object storage system, and is particularly suitable for the application scene of frequently accessing the object storage system in a short period by the same user, so as to improve the service stability of the object storage system. The method may be performed by an object resource reading device, which may be implemented in hardware and/or software, and may generally be integrated in an object storage system, where the object storage system may be a single server or a cluster of servers.
As shown in fig. 1, the method for reading object resources provided in the embodiment of the present disclosure includes the following specific steps:
s110, responding to the target resource reading request, and detecting whether the local buffer area stores target reading dependent data matched with the target resource reading request.
In this embodiment, the object storage system is configured to store various object resources, where the object resources are data resources stored in a Key-Value pair (Key-Value) format.
In an alternative application scenario, the user stores the first object resource to be stored in the object storage system. When a user needs to perform read access on the first object resource, an object resource reading request corresponding to the first object resource can be sent to the object storage system so as to read the first object resource from the object storage system.
Correspondingly, the target resource reading request is a request sent by a set data reader and used for reading the set target resource in the target storage system. Generally, the object resource reading request includes data reading party identification information and resource identification information of the target object resource to be read.
In the related art, after obtaining an object resource reading request, the object storage system first needs to search and obtain reading dependent data matched with the object resource reading request in a dependent database. The reading dependent data is mainly used for identifying whether the sender of the target resource reading request, namely, the data reader opens the reading service of the target resource or has the authority of reading the related target resource or not.
That is, only if it is determined that there is target read dependent data, the target storage system will feed back its requested target resource to the data requester that sent the target resource read request.
In general, to ensure the security of dependent data, the dependent database is not stored locally by the object storage system, but rather needs to be stored in another separate, secure device. Further, when the object storage system is disconnected from the dependent database for some reason, it is not possible to provide a data reading service to each data reader even if the object storage system is operating normally.
In contrast, in this embodiment, the read dependency data found by the dependency database in the last period of time is locally cached inside the object storage system. With the above arrangement, even if an access abnormality occurs in the dependent database, the object storage system can provide a data reading service for a certain period of time to the data reader matched with each reading dependent data in the local cache area.
The local buffer area is arranged in the object storage system and is used for temporarily storing read dependent data obtained by searching from the dependent database in the latest time.
S120, if the target reading dependent data is stored in the local cache region and the target reading dependent data is determined to be short-time effective cache data, acquiring a target object resource matched with the object resource reading request.
In this embodiment, if the target read dependent data corresponding to the target resource read request is successfully found from the local cache region, it is indicated that the target read dependent data was once found and stored from the dependent database in the last period of time.
To further ensure the validity of the read-dependent data, it is necessary to further verify whether the target read-dependent data is short-lived cached data.
In a specific example, the read rights of a certain data read requester expire at a certain point in time, and if both the data read requester and the data read requester reside in the local buffer for a longer period of time, the data reader can theoretically read the object resources stored in the object storage system. In order to avoid the problem of permission leakage to the greatest extent, whether the target read dependent data is short-time effective cache data can be verified by detecting the stored time length of the target read dependent data in the local cache region.
When the target reading dependent data is determined to be stored in the local cache region, it can be stated that the data requesting party of the target resource reading request has the data reading authority of the target storage system or opens the data reading function; when the target reading dependent data is determined to be short-time effective cache data, the fact that the time point when the data requesting party of the target resource reading request has the data reading authority of the target storage system or the data reading function is started is short from the current system time is indicated, the fact that the probability that the data requesting party of the target resource reading request still has the data reading authority of the target storage system or the data reading function is started is very high can be indicated, at the moment, authority verification is not needed through a dependent database again, and target object resources matched with the target resource reading request can be directly obtained in all locally stored target object resources.
Alternatively, the target object resource corresponding to the resource identification information may be searched and acquired in the object storage system according to the resource identification information included in the object resource reading request.
S130, taking the target object resource as a feedback result of the object resource reading request.
In this embodiment, after the target object resource is acquired, the target object resource or the storage address of the target object resource may be fed back to the data reader of the object resource reading request.
According to the technical scheme, after the object resource reading request is detected, target reading dependent data of the object resource reading request is not directly inquired to the dependent database, whether the target reading dependent data is just stored in a short time is firstly inquired in the local buffer zone, and if yes, target object resources corresponding to the object resource reading request can be directly acquired and fed back. The technical scheme of the embodiment of the disclosure provides a novel object resource reading scheme, which can effectively improve the stability of object resource reading service, in particular to effectively improve the service quality and service stability of an object storage system for frequently accessed data readers.
Fig. 2 is a flowchart of another object resource reading method provided according to an embodiment of the present disclosure. The embodiments of the present disclosure are refined based on the embodiments of the disclosure described above, and in this embodiment, the operations performed when the target read dependent data is not stored in the local cache region are further refined.
As shown in fig. 2, the method for reading object resources provided in the embodiment of the present disclosure includes the following specific steps:
s210, responding to an object resource reading request, and detecting whether a local buffer area stores target reading dependent data matched with the object resource reading request or not: if yes, execution is S220, otherwise execution is S230.
S220, if the target reading dependent data is determined to be the short-time effective cache data, acquiring a target resource matched with the target resource reading request, and executing S240.
S230, after the operation of inquiring the target read dependent data in the dependent database is executed, S250 is executed.
In this embodiment, if the local buffer area does not store the target read dependency data matched with the target resource read request, it cannot be directly verified locally whether the target resource read request has permission to acquire the target resource data requested to be read, and at this time, verification still needs to be performed according to the query result in the dependency database.
Wherein the read dependency data in the dependency database comprises at least one of: rights data, signature data, and read service authorization data.
The authorization data may be used to verify the type of the object resource that the data reader can read, the signature data may be used to verify whether the data reader qualifies for accessing the resource storage system, and the read service authorization data may be used to verify whether the data reader has opened the object resource reading service in the resource storage system.
Optionally, the manner of performing the operation of querying the dependency database for the target read dependency data may include:
acquiring data reader identity identification information in the object resource reading request; and querying target reading dependent data matched with the identification information of the data reader in the dependent database.
In this embodiment, when the local buffer area does not store the target read dependent data matched with the target resource read request, the data reader identification information may be extracted from the target resource read request. The data reader identity identification information can be account information registered in the object storage system by the data reader, or equipment identification information of the data reader and the like.
In the dependency database, a mapping relation between the identification information and the dependency data is stored, and after the identification information of the data reader is obtained, a matched dependency data query request can be constructed and sent to the dependency database so as to query the target read dependency data from the dependency database.
The advantages of this arrangement are that: the method and the device provide a supplement scheme when the local buffer area does not store target read dependent data matched with the target resource read request, further perfect the implementation mode of the disclosure, and provide required target resource read services for different types of data readers in different scenes.
S240, taking the target object resource as a feedback result of the object resource reading request.
S250, judging whether the target reading dependent data is queried, if so, executing S260; otherwise, S270 is performed.
In this embodiment, it is considered that after the operation of querying the target read dependent data in the dependent database is performed, there may be two results, one is that the target read dependent data is queried and one is not queried. When the target reading dependent data is queried, the target object resource can be fed back normally, and when the target reading dependent data is not queried, the data reader has no authority to access the object storage system or no authority to read the target object resource, and at this time, response information without the data reading authority needs to be generated as a feedback result of the object resource reading request.
S260, storing the target reading dependent data into the local cache area, and executing S280.
In this embodiment, if the target read dependent data is successfully obtained from the dependent database, in order to cope with the same data reader and initiate the read access to the target storage system again in a shorter time, the target read dependent data may be cached in the local cache region.
Optionally, storing the target read dependent data in the local cache area may include:
detecting whether a residual storage space exists in the local cache region;
if yes, storing the target reading dependent data into the local cache area;
and if not, according to a least recently used algorithm, eliminating the historical reading dependent data from the local cache region, and then storing the target reading dependent data into the local cache region.
The performance of the object storage system for providing services to the outside can be affected by taking a large amount of occupation of the storage space of the local cache area into consideration. Thus, a limited memory space may be allocated in the local cache to store read dependency data recently retrieved from a query in the dependency database.
Correspondingly, after the reading dependent data is successfully obtained, whether the reading dependent data can be stored in the residual storage space in the local cache area or not can be detected, and if so, the reading dependent data can be directly stored; if not already stored, a least recently used (LRU, least Recently Used) algorithm may be employed to store the target read dependent data into the local cache after one or more of the historical read dependent data has been eliminated.
The LRU algorithm is a commonly used page replacement algorithm, and selects the page that is not used the latest to be eliminated. The algorithm gives each page an access field for recording the time t that a page has elapsed since the last time it was accessed, and when a page has to be eliminated, the page with the largest t value, i.e. the least recently used page, of the existing pages is selected for elimination.
Similarly, an access field may be maintained for each read-dependent data in the local cache region, for recording the time p when the read-dependent data was successfully matched by the last target resource read request sent by the data reader. When the target read-dependent data needs to be stored, one or more read-dependent data with the largest p value can be selected for elimination, and the released storage space is used for storing the target read-dependent data.
The advantages of this arrangement are that: the service performance of the object storage system is ensured, meanwhile, the reading dependent data of a data reader which frequently accesses the object storage system in a short period is effectively maintained, the service quality and the service stability of a hot user (short-time frequently accessed user) can be effectively ensured, and the user experience of the object storage system is improved to the greatest extent.
S270, generating response information without data reading authority as a feedback result of the target resource reading request.
S280, acquiring a target object resource matched with the object resource reading request, and taking the target object resource as a feedback result of the object resource reading request.
According to the technical scheme, after the object resource reading request is detected, target reading dependent data of the object resource reading request is not directly inquired to the dependent database, whether the target reading dependent data is just stored in a short time is firstly inquired in the local buffer zone, and if yes, target object resources corresponding to the object resource reading request can be directly acquired and fed back. The technical scheme of the embodiment of the disclosure provides a novel object resource reading scheme, which can effectively improve the stability of object resource reading service, in particular to effectively improve the service quality and service stability of an object storage system for frequently accessed data readers.
FIG. 3 is a flow chart of another object resource reading method provided in accordance with an embodiment of the present disclosure; the embodiments of the present disclosure are refined based on the embodiments of the disclosure described above, and in this embodiment, operations performed when the target read dependent data stored in the local cache region is not short-time valid cache data are further refined.
As shown in fig. 3, the method for reading the object resource provided in the embodiment of the present disclosure includes the following specific steps:
s310, responding to the target resource reading request, and detecting whether the local buffer area stores target reading dependent data matched with the target resource reading request.
If the target read dependent data is stored in the local cache area and the target read dependent data is determined to be short-time valid cache data, S320 is executed; if the target read dependent data is stored in the local cache region and the target read dependent data is determined to be invalid cache data within the degradation cache time, S330 is executed; if the target read dependent data is stored in the local cache region and it is determined that the target read dependent data is stale cache data exceeding the demotion cache time, S340 is performed.
In this embodiment, in order to further ensure service stability of short-time frequent access users and effectively prevent permission leakage to a certain extent, an implementation manner of degrading cache is provided.
Specifically, two time periods may be defined, one for use as a basis for determining the short-time effective buffered data, for example, 10 minutes, 20 minutes, or 30 minutes, etc. The other is used as a degradation buffer time, which may be 1 day, 2 days, or 3 days, for example.
In this embodiment, when it is determined that the target read dependent data stored in the local cache region is not short-time valid cache data, instead of directly querying the dependency database for the target read dependent data, it may be further determined whether the storage time of the target read dependent data in the local cache region is within the degraded cache time.
If the storage time is within the degradation cache time, the data reader can be considered to still have the read qualification of the target object resource with high probability, and then the target object resource can be directly fed back to the data reader, if the storage time exceeds the degradation cache time, the last time that the data reader has the read qualification of the target object resource is known to be longer than the current system time, at the moment, the probability of the authority failure of the data reader is increased, so that the target object resource is not directly fed back to the data reader any more, and the target read dependent data matched with the data reader needs to be queried from the dependent database.
S320, obtaining the target object resource matched with the object resource reading request, and executing S350.
S330, obtaining the target object resource matched with the object resource reading request, and executing S360.
S340, after the operation of inquiring the target read dependent data in the dependent database is executed, S380 is executed.
S350, taking the target object resource as a feedback result of the object resource reading request, and ending the flow.
S360, after taking the target resource as a feedback result of the target resource reading request, executing S370.
S370, acquiring new target reading dependent data from the dependent database, so as to re-update the target reading dependent data in the local cache area into short-time effective cache data, and ending the flow.
In this embodiment, when it is determined that the target read dependent data is stored in the local cache region and it is determined that the target read dependent data is invalid cache data within the degradation cache time, in order to ensure service stability of the data reader, the target object resource may be directly fed back. However, in consideration of the fact that the time difference between the last time of acquiring the target reading dependent data and the current system time is also longer, new target reading dependent data can be acquired from the dependent database in an asynchronous acquisition mode, and the target reading dependent data is stored in the local cache area again. At this time, since the storage time of the target read-dependent data is updated, the target read-dependent data in the local cache area is updated again to short-time valid cache data.
The asynchronous acquisition means that the process of feeding back the target object resource to the data requester and the process of acquiring new target read dependent data from the dependent database are asynchronous, and the two processes are independently executed without sequential time sequence relationship.
Further, if the new target read dependency data is not successfully obtained from the dependency database, it may be stated that the read dependency data of the data reader (or simply understood as the read authority of the target resource) fails. At this time, the target read dependent data may be directly deleted from the local cache region, so as to avoid permission leakage caused when the data reader reads the target resource again in the degraded cache time.
After the new target reading dependent data is obtained from the dependent database, the new target reading dependent data can be directly used to directly replace the target reading dependent data stored in the local cache region in a history manner, or in order to reduce the implementation complexity, the new target reading dependent data can be stored in the local cache region according to a least recently used algorithm according to the residual storage amount of the local cache region.
S380, if the target reading dependent data is queried, storing the target reading dependent data into the local cache area, and executing S390.
In this embodiment, if the target read dependent data is stored in the local cache area and it is determined that the target read dependent data is invalid cache data exceeding the demotion cache time, the operation of querying the target read dependent data in the dependent database needs to be executed first, if the target read dependent data is successfully obtained, the target read dependent data stored in the local cache area is directly replaced by new target read dependent data, or the new target read dependent data may be stored in the local cache area according to a least recently used algorithm according to a remaining storage amount of the local cache area.
If the target reading dependent data is not acquired, the response information without the data reading authority can be directly generated as a feedback result of the target resource reading request. Meanwhile, target reading dependent data stored in the local cache area can be directly deleted.
S390, obtaining a target object resource matched with the object resource reading request, and taking the target object resource as a feedback result of the object resource reading request.
According to the technical scheme, the target reading dependent data are defined to be in three storage states (short-time effective cache data, invalid cache data in the degradation cache time and invalid cache data exceeding the degradation cache time), so that the degradation reading of the object storage system can be realized while the reading permission is avoided to the greatest extent, and the service quality and service stability of the object storage system to a hot user can be further ensured when the short-time connection fault of the object storage system and the dependent database occurs.
On the basis of the foregoing embodiments, determining that the target read dependent data is short-time valid cache data may specifically include:
if the difference between the current system time and the storage time of the target reading dependent data in the local cache area is smaller than or equal to the short-time effective time, determining that the target reading dependent data is the short-time effective cache data;
determining that the target read-dependent data is stale cache data within a demotion cache time may include:
if the storage time difference between the current system time and the target reading dependent data in the local cache region is between the short effective time and the degradation cache time, determining that the target reading dependent data is invalid cache data in the degradation cache time;
determining that the target read-dependent data is stale cache data exceeding a demotion cache time may include:
and if the difference between the current system time and the storage time of the target reading dependent data in the local buffer area is larger than the degradation buffer time, determining the target reading dependent data as the invalid buffer data exceeding the degradation buffer time.
Wherein the short effective time is less than the demotion buffering time. It will be appreciated that, according to the actual scenario and practical experience, those skilled in the art may preset specific values of the short-time valid time and the degradation buffering time, which is not limited in this embodiment.
The advantages of this arrangement are: the target reading dependent data are defined into three storage states (short-time effective cache data, invalid cache data in the degradation cache time and invalid cache data exceeding the degradation cache time), so that the degradation reading of the object storage system can be effectively realized while the leakage of the reading permission is avoided to the greatest extent.
Fig. 4 is a view of an object resource reading scenario provided according to an embodiment of the present disclosure. As shown in fig. 4, the main implementation flow of the embodiment of the disclosure is as follows:
1. the user initiates an object resource reading request to the object storage system for the first time, and the object storage system acquires the identification information of the data reader from the object resource reading request.
2. When the object storage system determines that the identity identification information of the data reader is not in the middle of the local cache area, inquiring corresponding dependent data (typically, authentication data) from a dependent database, storing the corresponding dependent data in the local cache area, and if the local cache area has a residual space, directly inserting the corresponding dependent data into the latest position; otherwise, the most recently unused dependent data is eliminated, and then the currently queried dependent data is inserted into the latest position.
3. The object storage system feeds back the matched target object resources to the user.
4. The user initiates again an object resource read request to the object storage system within a certain time.
5. The object storage system acquires corresponding dependent data from the local cache region, and checks the validity of the dependent data (namely, whether the last storage time of the dependent data exceeds the preset short-time valid time) and if so, feeds back the matched target object resource to the user.
6. The user initiates again an object resource read request to the object storage system at intervals.
7. The object storage system acquires corresponding dependent data from the local cache region, checks the validity of the data, and if the data is valid, directly feeds back matched target object resources to the user; if the user fails but is still within the preset degradation caching time, an update task can be generated and added into a queue, the update of the dependent data is asynchronously carried out, and the matched target object resource is directly fed back to the user; if the target object resource is invalid and exceeds the degradation caching time, the target object resource is synchronously requested to the dependency database to update the dependency data, and the matched target object resource is fed back to the user after the update is successful.
By the technical scheme of the embodiment of the disclosure, the following is realized:
The LRU-based algorithm maintains the cache data in the local cache region, ensuring that the hot data (i.e., the dependent data needed to be used by hot users who frequently access the subject storage system) is readable in the local cache region. The main function of using LRU is to store hot data preferentially when the capacity of the local buffer reaches the limit, so as to ensure the service quality of the hot users.
Meanwhile, the data in the local cache area can be used in a degrading mode, and the local cache area is updated in a synchronous and asynchronous combined mode.
Specifically, when the dependent data in the local cache area expires (exceeds a short effective time) but does not reach the forced expiration (does not exceed a degraded cache time), the object resource reading service is normally provided for the user, meanwhile, an update task is generated, the latest dependent data is asynchronously obtained from the dependent database and updated to the local cache area, and the asynchronous update is helpful for reducing the average delay of the object resource reading request.
When the dependent data in the local cache region expires and a forced expiration condition (exceeding the demotion cache time) is reached. The latest data is synchronously pulled from the dependent database, then updated to the local buffer area, and finally the object resource reading service is provided for the user.
The embodiment of the disclosure ensures the service stability of the hot spot user by degrading the dependent data in the local cache region, has the characteristic of high reliability, and can continuously provide data reading service for the user in the abnormal scenes such as short-time fault of the dependent database service or network isolation.
As an implementation of the above-mentioned method for reading each object resource, the present disclosure further provides an optional embodiment of an executing device for implementing the above-mentioned method for reading each object resource.
Fig. 5 is a schematic structural view of an object resource reading apparatus provided according to an embodiment of the present disclosure; as shown in fig. 5, the target resource reading apparatus includes: a dependent data detection module 510, an object resource acquisition module 520, and a first feedback result generation module 530.
A dependent data detection module 510, configured to respond to an object resource read request, and detect whether a local buffer stores target read dependent data matched with the object resource read request;
an object resource obtaining module 520, configured to obtain a target object resource that matches the object resource reading request if the target reading dependent data is stored in the local cache region and the target reading dependent data is determined to be short-time valid cache data;
A first feedback result generating module 530, configured to take the target object resource as a feedback result of the object resource reading request.
According to the technical scheme, after the object resource reading request is detected, target reading dependent data of the object resource reading request is not directly inquired to the dependent database, whether the target reading dependent data is just stored in a short time is firstly inquired in the local buffer zone, and if yes, target object resources corresponding to the object resource reading request can be directly acquired and fed back. The technical scheme of the embodiment of the disclosure provides a novel object resource reading scheme, which can effectively improve the stability of object resource reading service, in particular to effectively improve the service quality and service stability of an object storage system for frequently accessed data readers.
On the basis of the above embodiments, the apparatus may further include:
the dependent data acquisition module is used for executing the operation of inquiring the target reading dependent data in the dependent database if the target reading dependent data is not stored in the local cache area after detecting whether the target reading dependent data matched with the target resource reading request is stored in the local cache area;
The dependent data caching module is used for storing the target reading dependent data into the local cache area if the target reading dependent data is queried;
and the second feedback result generation module is used for acquiring a target object resource matched with the object resource reading request and taking the target object resource as a feedback result of the object resource reading request.
Based on the foregoing embodiments, the dependency data obtaining module 520 may specifically be configured to:
acquiring data reader identity identification information in the object resource reading request;
and querying target reading dependent data matched with the identification information of the data reader in the dependent database.
On the basis of the foregoing embodiments, the dependency data caching module may specifically be configured to:
detecting whether a residual storage space exists in the local cache region;
if yes, storing the target reading dependent data into the local cache area;
and if not, according to a least recently used algorithm, eliminating the historical reading dependent data from the local cache region, and then storing the target reading dependent data into the local cache region.
On the basis of the above embodiments, the degradation processing module may further include a degradation processing module, configured to:
after detecting whether a local cache region stores target reading dependent data matched with the target resource reading request, if the target reading dependent data is stored in the local cache region and the target reading dependent data is determined to be invalid cache data in the degradation cache time, acquiring target resource matched with the target resource reading request;
taking the target object resource as a feedback result of the object resource reading request;
and acquiring new target reading dependent data from the dependent database so as to re-update the target reading dependent data in the local cache area into short-time effective cache data.
On the basis of the above embodiments, the method may further include a conventional processing module, configured to, after detecting whether a local cache region stores target read dependent data that matches the target resource read request, perform an operation of querying the dependent database for the target read dependent data if the target read dependent data is stored in the local cache region and the target read dependent data is determined to be invalid cache data exceeding a demotion cache time;
If the target reading dependent data is queried, storing the target reading dependent data into the local cache region;
and acquiring a target object resource matched with the object resource reading request, and taking the target object resource as a feedback result of the object resource reading request.
On the basis of the foregoing embodiments, the object resource obtaining module 520 may be specifically configured to determine that the target read dependent data is short-time valid cache data if a difference between a current system time and a storage time of the target read dependent data in the local cache area is less than or equal to a short-time valid time;
the degradation processing module may be specifically configured to determine that the target read dependent data is stale cache data in the degraded cache time if a difference between a current system time and a storage time of the target read dependent data in the local cache region is between a short valid time and the degraded cache time;
the conventional processing module may be specifically configured to determine that the target read dependent data is the stale cache data exceeding the demote cache time if a difference between a current system time and a storage time of the target read dependent data in the local cache region is greater than the demote cache time.
On the basis of the above embodiments, the read dependency data in the dependency database may include at least one of:
rights data, signature data, and read service authorization data.
The product can execute the method provided by any embodiment of the disclosure, and has the corresponding functional modules and beneficial effects of executing the method.
In the technical scheme of the disclosure, the related processes of collecting, storing, using, processing, transmitting, providing, disclosing and the like of the personal information of the user accord with the regulations of related laws and regulations, and the public order colloquial is not violated.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
Fig. 6 illustrates a schematic block diagram of an example electronic device 600 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 6, the apparatus 600 includes a computing unit 601 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 602 or a computer program loaded from a storage unit 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 may also be stored. The computing unit 601, ROM 602, and RAM 603 are connected to each other by a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Various components in the device 600 are connected to the I/O interface 605, including: an input unit 606 such as a keyboard, mouse, etc.; an output unit 607 such as various types of displays, speakers, and the like; a storage unit 608, such as a magnetic disk, optical disk, or the like; and a communication unit 609 such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The computing unit 601 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 601 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the respective methods and processes described above, for example, implementing the object resource reading method as described in the embodiments of the present disclosure.
For example, in some embodiments, the object resource reading method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 600 via the ROM 602 and/or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the object resource reading method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the above-described object resource reading method in any other suitable way (e.g. by means of firmware).
Namely: responding to an object resource reading request, and detecting whether a local buffer area stores target reading dependent data matched with the object resource reading request;
if the target reading dependent data is stored in the local cache region and the target reading dependent data is determined to be short-time effective cache data, acquiring target object resources matched with the object resource reading request;
and taking the target object resource as a feedback result of the object resource reading request.
Various implementations of the systems and techniques described here above can be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome. The server may also be a server of a distributed system or a server that incorporates a blockchain.
Artificial intelligence is the discipline of studying the process of making a computer mimic certain mental processes and intelligent behaviors (e.g., learning, reasoning, thinking, planning, etc.) of a person, both hardware-level and software-level techniques. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing, and the like; the artificial intelligent software technology mainly comprises a computer vision technology, a voice recognition technology, a natural language processing technology, a machine learning/deep learning technology, a big data processing technology, a knowledge graph technology and the like.
Cloud computing (cloud computing) refers to a technical system that a shared physical or virtual resource pool which is elastically extensible is accessed through a network, resources can comprise servers, operating systems, networks, software, applications, storage devices and the like, and resources can be deployed and managed in an on-demand and self-service mode. Through cloud computing technology, high-efficiency and powerful data processing capability can be provided for technical application such as artificial intelligence and blockchain, and model training.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel, sequentially, or in a different order, provided that the desired results of the technical solutions provided by the present disclosure are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (15)

1. An object resource reading method, comprising:
responding to an object resource reading request, and detecting whether a local buffer area stores target reading dependent data matched with the object resource reading request;
if the target reading dependent data is stored in the local cache region and the target reading dependent data is determined to be short-time effective cache data, acquiring target object resources matched with the object resource reading request;
and taking the target object resource as a feedback result of the object resource reading request.
2. The method of claim 1, after detecting whether a local cache region stores target read dependency data matching the subject resource read request, further comprising:
if the target reading dependent data is not stored in the local cache area, executing the operation of inquiring the target reading dependent data in a dependent database;
If the target reading dependent data is queried, storing the target reading dependent data into the local cache region;
and acquiring a target object resource matched with the object resource reading request, and taking the target object resource as a feedback result of the object resource reading request.
3. The method of claim 2, wherein performing the operation of querying the dependency database for the target read dependency data comprises:
acquiring data reader identity identification information in the object resource reading request;
and querying target reading dependent data matched with the identification information of the data reader in the dependent database.
4. The method of claim 2, wherein storing the target read dependent data into the local cache region comprises:
detecting whether a residual storage space exists in the local cache region;
if yes, storing the target reading dependent data into the local cache area;
and if not, according to a least recently used algorithm, eliminating the historical reading dependent data from the local cache region, and then storing the target reading dependent data into the local cache region.
5. The method of claim 1, after detecting whether a local cache region stores target read dependency data matching the subject resource read request, further comprising:
if the target reading dependent data is stored in the local cache region and the target reading dependent data is determined to be invalid cache data in the degradation cache time, acquiring target object resources matched with the object resource reading request;
taking the target object resource as a feedback result of the object resource reading request;
and acquiring new target reading dependent data from the dependent database so as to re-update the target reading dependent data in the local cache area into short-time effective cache data.
6. The method of claim 1, after detecting whether a local cache region stores target read dependency data matching the subject resource read request, further comprising:
if the target reading dependent data is stored in the local cache region and the target reading dependent data is determined to be invalid cache data exceeding the degradation cache time, executing the operation of inquiring the target reading dependent data in the dependent database;
If the target reading dependent data is queried, storing the target reading dependent data into the local cache region;
and acquiring a target object resource matched with the object resource reading request, and taking the target object resource as a feedback result of the object resource reading request.
7. The method of claim 5 or 6, wherein determining that the target read-dependent data is short-lived cache data comprises:
if the difference between the current system time and the storage time of the target reading dependent data in the local cache area is smaller than or equal to the short-time effective time, determining that the target reading dependent data is the short-time effective cache data;
determining that the target read dependent data is stale cache data within a demotion cache time comprises:
if the storage time difference between the current system time and the target reading dependent data in the local cache region is between the short effective time and the degradation cache time, determining that the target reading dependent data is invalid cache data in the degradation cache time;
determining that the target read dependent data is stale cache data exceeding a demotion cache time comprises:
And if the difference between the current system time and the storage time of the target reading dependent data in the local buffer area is larger than the degradation buffer time, determining the target reading dependent data as the invalid buffer data exceeding the degradation buffer time.
8. The method of claim 2, wherein the read dependency data in the dependency database comprises at least one of:
rights data, signature data, and read service authorization data.
9. An object resource reading apparatus comprising:
the dependency data detection module is used for responding to the object resource reading request and detecting whether the local buffer area stores target reading dependency data matched with the object resource reading request;
the object resource obtaining module is used for obtaining the object resource matched with the object resource reading request if the target reading dependent data is stored in the local cache region and the target reading dependent data is determined to be short-time effective cache data;
and the first feedback result generation module is used for taking the target object resource as a feedback result of the object resource reading request.
10. The apparatus of claim 9, further comprising:
The dependent data acquisition module is used for executing the operation of inquiring the target reading dependent data in the dependent database if the target reading dependent data is not stored in the local cache area after detecting whether the target reading dependent data matched with the target resource reading request is stored in the local cache area;
the dependent data caching module is used for storing the target reading dependent data into the local cache area if the target reading dependent data is queried;
and the second feedback result generation module is used for acquiring a target object resource matched with the object resource reading request and taking the target object resource as a feedback result of the object resource reading request.
11. The apparatus of claim 10, wherein the dependent data acquisition module is specifically configured to:
acquiring data reader identity identification information in the object resource reading request;
and querying target reading dependent data matched with the identification information of the data reader in the dependent database.
12. The apparatus of claim 10, wherein the dependent data caching module is specifically configured to:
Detecting whether a residual storage space exists in the local cache region;
if yes, storing the target reading dependent data into the local cache area;
and if not, according to a least recently used algorithm, eliminating the historical reading dependent data from the local cache region, and then storing the target reading dependent data into the local cache region.
13. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-8.
14. A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method of any one of claims 1-8.
15. A computer program product comprising a computer program which, when executed by a processor, implements the steps of the method of any of claims 1-8.
CN202211611415.3A 2022-12-14 2022-12-14 Object resource reading method and device, electronic equipment and readable storage medium Pending CN116028530A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211611415.3A CN116028530A (en) 2022-12-14 2022-12-14 Object resource reading method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211611415.3A CN116028530A (en) 2022-12-14 2022-12-14 Object resource reading method and device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN116028530A true CN116028530A (en) 2023-04-28

Family

ID=86090353

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211611415.3A Pending CN116028530A (en) 2022-12-14 2022-12-14 Object resource reading method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN116028530A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117724852A (en) * 2024-02-07 2024-03-19 微网优联科技(成都)有限公司 Cloud computer computing resource allocation method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117724852A (en) * 2024-02-07 2024-03-19 微网优联科技(成都)有限公司 Cloud computer computing resource allocation method and device

Similar Documents

Publication Publication Date Title
CN108804447B (en) Method and system for responding to data request by using cache
CN114116613A (en) Metadata query method, equipment and storage medium based on distributed file system
CN111225010A (en) Data processing method, data processing system and device
CN116028530A (en) Object resource reading method and device, electronic equipment and readable storage medium
CN111737564A (en) Information query method, device, equipment and medium
CN110955390B (en) Data processing method, device, electronic equipment and storage medium
US20190108416A1 (en) Methods for more effectively moderating one or more images and devices thereof
CN113157198A (en) Method, apparatus and computer program product for managing a cache
CN113010535A (en) Cache data updating method, device, equipment and storage medium
CN116578502A (en) Access request processing device, processing method, equipment and storage medium
CN115103024B (en) Sequence number generation method and device, electronic equipment and storage medium
CN107589907B (en) Data processing method, electronic device and computer readable storage medium
CN116540938A (en) Data reading method, device, distributed storage system, equipment and storage medium
CN113986135B (en) Method, device, equipment and storage medium for processing request
CN113676531B (en) E-commerce flow peak clipping method and device, electronic equipment and readable storage medium
CN113553074B (en) Applet distribution control method, device, electronic equipment and storage medium
CN110889053B (en) Interface data caching method and device and computing equipment
CN107423375B (en) Application program searching method and device
CN114077858A (en) Vector data processing method, device, equipment and storage medium
US11687266B2 (en) Managing deduplication operations based on a likelihood of duplicability
CN112783507B (en) Data stream guiding playback method and device, electronic equipment and readable storage medium
CN114553806B (en) Optimization method, device and equipment for instant messaging and storage medium
US20220107949A1 (en) Method of optimizing search system
CN112988391B (en) Data processing method, device, equipment and storage medium
US20220283709A1 (en) Metadata size reduction for data objects in cloud storage systems

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination