Object storage method and device, server and storage medium
By recording the access sequence and access times of objects and judging the access frequency of objects, the cost of object storage is further reduced, the problem of objects with low access frequency not being migrated is solved, and storage efficiency and space utilization are improved.
Patent Information
- Application Number
- CN202310352988.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-30
- Publication Date
- 2024-10-01
AI Technical Summary
In existing object storage methods, there is still room for further reduction in storage costs, and objects with low access frequency may not be effectively migrated to lower-cost storage tiers.
By obtaining the access sequence of the object, record the number of accesses in each time unit, and determine whether to migrate the object to a lower-cost storage layer based on the sum of the access times in the last N time units. If it is less than the threshold, migrate it.
It effectively reduces the cost of storing objects, reduces the amount of data read, and reduces storage space usage through compact data structures.
Smart Images

Figure CN118732929A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an object storage method, device, server and storage medium. Background Art
[0002] The object storage system contains multiple storage layers, each of which can be used to store different objects and their respective access data. The storage costs of data stored in different storage layers vary.
[0003] In the related art, based on the last access time of the object, it is determined whether the object has not been accessed for X days, where X is a positive integer. If so, the object is migrated from the original storage layer to a storage layer with lower cost to reduce the storage cost of the stored data.
[0004] However, there is still room for further reduction in storage costs in the above object storage methods. Summary of the invention
[0005] The embodiment of the present application provides an object storage method, device, server and storage medium. The technical solution is as follows:
[0006] According to one aspect of an embodiment of the present application, a method for storing an object is provided, the method comprising:
[0007] Acquire an access sequence of a first object, where the first object is stored in a first storage layer of an object storage system, and the access sequence is used to record at most the number of accesses to the first object in each of M consecutive time units, where M is a positive integer;
[0008] According to the first inspection task for the access sequence, determine the sum of the number of accesses of N time units, where the N time units refer to the N consecutive time units closest to the execution time of the first inspection task, and N is a positive integer less than or equal to M;
[0009] If the sum of the access times of the N time units is less than a first threshold, the first object is migrated from the first storage layer to a second storage layer of the object storage system for storage, and the storage cost of the second storage layer is lower than the storage cost of the first storage layer.
[0010] According to one aspect of an embodiment of the present application, an object storage device is provided, the device comprising:
[0011] an acquisition module, configured to acquire an access sequence of a first object, the first object being stored in a first storage layer of an object storage system, the access sequence being configured to record at most the number of accesses to the first object in each of M consecutive time units, where M is a positive integer;
[0012] a determination module, configured to determine, according to a first inspection task for the access sequence, a sum of the number of accesses of N time units, wherein the N time units refer to N consecutive time units closest to the execution time of the first inspection task, and N is a positive integer less than or equal to M;
[0013] A storage module is used to migrate the first object from the first storage layer to the second storage layer of the object storage system for storage if the sum of the access times of the N time units is less than a first threshold, and the storage cost of the second storage layer is lower than the storage cost of the first storage layer.
[0014] According to one aspect of an embodiment of the present application, a server is provided, the server comprising a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to implement the above-mentioned object storage method.
[0015] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is loaded and executed by a processor to implement the above-mentioned object storage method.
[0016] According to one aspect of an embodiment of the present application, a computer program product is provided. The computer program product includes a computer program. The computer program is loaded and executed by a processor to implement the above-mentioned object storage method.
[0017] The technical solution provided in the embodiments of the present application can bring the following beneficial effects:
[0018] By determining the sum of the number of accesses in N consecutive time units before the inspection task, the access frequency of the first object in the N time units can be obtained, so that according to the user's access to the first object, it can be determined whether to migrate the first object to a storage layer with a lower storage cost. Compared with the related art that determines whether to migrate an object only based on the time when the object was last accessed, which easily leads to the situation that objects with low access frequencies are not migrated, the present application migrates objects with access frequencies lower than the first threshold from the first storage layer to the second storage layer, thereby reducing the amount of data required to read the object and reducing the storage cost of storing the object. Moreover, by using an access sequence to store the number of accesses in each time unit, the data structure of the access sequence is relatively compact, reducing the storage space occupied by storing access data. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a schematic diagram of an implementation environment of a solution provided by an embodiment of the present application;
[0020] Figure 2is a flow chart of an object storage method provided by an embodiment of the present application;
[0021] Figure 3 is a schematic diagram of an access sequence of a first object provided by an embodiment of the present application;
[0022] Figure 4 is a comparative schematic diagram of access sequences of a first object, a second object, and a third object provided by an embodiment of the present application;
[0023] Figure 5 is a schematic diagram of an access sequence provided by an embodiment of the present application;
[0024] Figure 6 is a schematic diagram of the number of accesses of an access sequence provided by an embodiment of the present application;
[0025] Figure 7 is a schematic diagram of an access sequence for deletion provided by an embodiment of the present application;
[0026] Figure 8 is a schematic diagram of a configuration switch provided by an embodiment of the present application;
[0027] Fig. 9 is a block diagram of an object storage device provided by an embodiment of the present application;
[0028] Fig.10 This is a structural block diagram of a server provided by an embodiment of the present application. DETAILED DESCRIPTION
[0029] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0030] Cloud storage is a new concept that extends and develops from the concept of cloud computing. A distributed cloud storage system (referred to as a storage system) is a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of different types of storage devices (storage devices are also called storage nodes) in the network through application software or application interfaces to work together and provide external data storage and business access functions.
[0031] At present, the storage method of the storage system is: create a logical volume, and when creating a logical volume, allocate physical storage space for each logical volume. The physical storage space may be composed of disks of a storage device or several storage devices. The client stores data on a logical volume, that is, stores the data on the file system. The file system divides the data into many parts, each of which is an object. The object contains not only data but also additional information such as data identification (ID, ID entity). The file system writes each object into the physical storage space of the logical volume, and the file system records the storage location information of each object, so that when the client requests to access the data, the file system can allow the client to access the data according to the storage location information of each object.
[0032] The process of the storage system allocating physical storage space to a logical volume is as follows: based on the estimated capacity of the objects stored in the logical volume (this estimate often has a large margin relative to the actual capacity of the objects to be stored) and the grouping of independent redundant disk arrays (RAID, Redundant Array of Independent Disks), the physical storage space is pre-divided into stripes. A logical volume can be understood as a stripe, thereby allocating physical storage space to the logical volume.
[0033] Please refer to Figure 1 , which shows a schematic diagram of a solution implementation environment provided by an embodiment of the present application. The solution implementation environment can be implemented as an object storage system. The solution implementation environment may include: a terminal device 10 and a server 20.
[0034] The number of terminal devices 10 can be one or more. The terminal device 10 can be an electronic device such as a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal device 10 can install a client of an application, wherein the application does not limit the type of application, including but not limited to video applications, news applications, game applications, search applications, etc. The user can access different objects in the application.
[0035] The server 20 is used to provide background services for the client of the application installed and running in the terminal device 10. For example, the server 20 can be the background server of the above-mentioned application. The server 20 can be an independent physical server, or it can be a server cluster or distributed system composed of multiple physical servers, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The terminal device 10 and the server 20 can be directly or indirectly connected via wired or wireless communication, which is not limited in this application. Optionally, the server 20 provides background services for the clients of the application in multiple terminal devices 10 at the same time.
[0036] The server 20 stores an object storage system 30, which can be used to store at least one object, and each object can be stored in a container (Bucket). The object storage system 30 includes a first storage layer and a second storage layer, and the first storage layer and the second storage layer can both be used to store different objects and their respective access data. Among them, the storage cost of the data stored in the first storage layer is higher than the storage cost of the data stored in the second storage layer. The first storage layer can provide a highly reliable, highly available, and high-performance object storage service, which can support frequent data access and is suitable for storage scenarios where objects are access data of social application data, picture data, audio and video data, large website data, and other services. The second storage layer is suitable for storage scenarios with less data access, so when the object data is stored in the second storage layer, the amount of data required to read the object data is less, and the corresponding storage cost is also lower. Exemplarily, the first storage layer can be a standard storage layer, and the second storage layer can be a low-frequency storage layer. The first storage layer can be one or more, and the second storage layer can be one or more.
[0037] In the embodiment of the present application, a user can access different objects through an application on the terminal device 10. Each access to an object can generate an access log data. Based on at least one access log data, an access sequence of an object can be generated. The access sequence can record at most the number of accesses to the object in each time unit within M time units. If the number of accesses in the past N days is less than the first threshold, it means that the access frequency of the object is low, so the object can be migrated from the first storage layer to the second storage layer with lower storage cost to reduce the storage cost required for storing data. M is a positive integer, and N is a positive integer less than or equal to M.
[0038] Please refer to Figure 2, which shows a flow chart of an object storage method provided by an embodiment of the present application. The execution subject of each step of the method may be a server. The method may include at least one of the following steps 210 to 230:
[0039] Step 210, obtaining an access sequence of a first object, the first object being stored in a first storage layer of an object storage system, the access sequence being used to record at most the number of accesses to the first object in each of M consecutive time units, where M is a positive integer.
[0040] The first object refers to any object stored in the object storage system, which can be a picture, a video, a piece of music, etc. The access sequence of the first object is used to indicate the access situation of the first object. The access sequence can record the number of accesses to the first object in each time unit, and can record the number of accesses to each time unit in M consecutive time units at most. A time unit can be a week, a day, or an hour, and this application does not limit this. If a time unit refers to a day, the access sequence can record the number of accesses to the first object every day within M days at most.
[0041] Each time a user accesses the first object, an access log data may be generated. The access log data is used to record the access to the first object within the access time. The access log data includes the link address of the first object, the version information of the first object, the access time, etc. According to at least one access log data of the first object in each time unit, the number of accesses to the first object in each time unit may be obtained. If the user does not access the first object in a certain time unit, no access log data in the time unit will be generated. Therefore, according to the number of accesses to the first object in at least one time unit, an access sequence of the first object may be generated. The first element recorded in the access sequence is the number of accesses to the first object in the time unit in which the first object was accessed, and the start time of the access sequence is the time unit corresponding to the earliest recorded number of accesses in the access sequence.
[0042] The schematic diagram of the access sequence of the first object can be referred to Figure 3 As shown, the access sequence records the access status of the first object within 15 days. The first element corresponds to the access time of January 1, which means that the first object was accessed once on January 1. There is no access log data on January 2 and January 3, which means that the first object was not accessed on January 2 and January 3. In addition, Figure 3The access sequence shown may also indicate that the first object was accessed twice on January 4, three times on January 7, three times on January 10, two times on January 13, and once on January 15. January 15 also indicates the time when the first object was most recently accessed.
[0043] It should be noted that the access sequence can record at most the number of accesses to the first object in each time unit within M consecutive time units, which means that the time interval from the time unit corresponding to the first access count recorded in the access sequence to the time unit corresponding to the last access count recorded in the access sequence is M time units, that is, the maximum sequence length of the access sequence is M. Among them, each time unit within the M time units can have access log data, so each time unit can have a corresponding number of accesses, or not each time unit within the M time units can have access log data, and at least one time unit can have access log data, for example Figure 3 In the access sequence shown, only 6 time units out of 15 time units have access log data.
[0044] For different objects, the maximum sequence length of the access sequence of the object can be the same or different; the start time of the access sequence of different objects can be the same or different. They can be set independently according to the access conditions of different objects, and this application does not make specific restrictions.
[0045] For example, you can refer to Figure 4 The access sequence comparison diagram of the first object, the second object and the third object shown in the figure is a comparison diagram of the access sequence of the first object, the second object and the third object. The second object and the third object refer to any object stored in the object storage system that is different from the first object. Among them, the start time of the access sequence of the first object, the second object and the third object is also inconsistent. The start time of the access sequence of the first object is January 1, the start time of the access sequence of the second object is January 5, and the start time of the access sequence of the third object is January 8. And if Figure 4 The sequence length of the access sequence shown is the maximum sequence length. The maximum sequence lengths of the access sequences of the first object, the second object, and the third object are also inconsistent. The maximum sequence length of the access sequence of the first object is 15 time units, the maximum sequence length of the access sequence of the second object is 11 time units, and the maximum sequence length of the access sequence of the third object is 8 time units. Figure 4 The sequence length of the access sequence shown is not the maximum sequence length, and the maximum sequence lengths of the access sequences of the first object, the second object, and the third object may be the same or different.
[0046] Step 220, according to the first inspection task for the access sequence, determine the sum of the number of accesses of N time units, where N time units refer to the N consecutive time units closest to the execution time of the first inspection task, and N is a positive integer less than or equal to M.
[0047] The first inspection task refers to an inspection task for the number of accesses contained in the access sequence of the first object stored in the first storage layer, and is used to determine the number of accesses in N time units before the execution time of the first inspection task. The N time units refer to N consecutive time units before the execution time of the first inspection task.
[0048] Optionally, the time units recorded in the access sequence of the first object may include all N time units, and the time unit corresponding to the last access count in the access sequence is a time unit before the time unit corresponding to the execution time of the first inspection task. Figure 3 In the access sequence shown, if the time unit corresponding to the execution time of the first inspection task is January 16, then the access sequence includes all N time units. The time unit corresponding to the latest recorded access number in the access sequence, January 15, is a time unit before the time unit corresponding to the execution time of the first inspection task, January 16.
[0049] Optionally, the time unit recorded in the access sequence of the first object may also include at least one time unit among the N time units, and there is at least one time unit between the time unit corresponding to the last access number in the access sequence and the time unit corresponding to the execution time of the first inspection task. Figure 5 In the access sequence shown, if the time unit corresponding to the execution time of the first inspection task is January 20, and the value of N is 10, it is necessary to determine the number of accesses in the 10 time units before January 20, that is, the number of accesses in the time units from January 10 to January 19. There are 4 interval time units between the time unit corresponding to the latest recorded number of accesses in the access sequence, January 15, and the time unit corresponding to the execution time of the first inspection task, January 20, so the access sequence includes 6 of the 10 time units.
[0050] Optionally, the time units recorded in the access sequence of the first object may not include N time units. In this case, the time unit corresponding to the last number of accesses in the access sequence is before N time units, may be a time unit before N time units, or may be a time unit with at least one interval between the N time units.
[0051] In some embodiments, configuration information of the first inspection task is obtained, the configuration information including the number N of historical time units; based on the number N of historical time units and the number of accesses of each time unit recorded in the access sequence, the number of accesses of the N time units closest to the execution time of the first inspection task is determined; the number of accesses of the N time units are summed to obtain the sum of the number of accesses of the N time units.
[0052] The configuration information of the first inspection task may be customized by the user according to actual needs. For example, the configuration information of the first inspection task may also include a first threshold value, which is not limited in the present application.
[0053] The historical time unit refers to the time unit before the execution time of the first inspection task. According to the number of historical time units included in the configuration information, the number of time units required to determine the number of accesses for the access sequence of the first inspection task for the first object can be obtained, thereby determining the number of accesses of the N time units closest to the execution time of the first inspection task.
[0054] By setting the access sequence to store the access times of each time unit, the server can quickly determine the sum of the access times of N time units, thereby improving the operation efficiency. In addition, the data structure of the access sequence is relatively compact, which can reduce the storage space occupied by the access data.
[0055] In some embodiments, the time units corresponding to each access count recorded in the access sequence can be first determined; based on the number of historical time units N and the time units corresponding to each access count recorded in the access sequence, the access counts of the N time units closest to the execution time of the first inspection task can be determined.
[0056] The time units corresponding to each access count recorded in the access sequence and the time units corresponding to the execution time of the first inspection task can be determined first, so as to determine the number of N time units included in the time units recorded in the access sequence and the access counts corresponding to each of the included time units.
[0057] If the time units recorded in the access sequence include all N time units, the number of accesses corresponding to each of the N time units is determined from the access sequence. Figure 3 In the access sequence shown, if the time unit corresponding to the execution time of the first inspection task is January 16, the access sequence includes N time units. According to the number of historical time units N and the number of accesses of the N time units recorded in the access sequence, the sum of the number of accesses of the N time units is obtained.
[0058] If the time unit recorded in the access sequence does not include any time unit in the N time units, the sum of the access times of the N time units may be recorded as 0.
[0059] If the time units recorded in the access sequence do not include all N time units, the number of accesses corresponding to at least one time unit included in the access sequence is determined from the access sequence. Figure 3 In the access sequence shown, if the time unit corresponding to the execution time of the first inspection task is January 17, and the value of N is 10, then the access sequence only includes 9 time units out of the 10 time units. The number of accesses corresponding to each of the 9 time units can be determined, and the sum of the number of accesses of the 9 time units can be used as the sum of the number of accesses of the 10 time units required for the first inspection task. Figure 3 The sum of the number of visits for the 10 time units shown is 11.
[0060] By determining the time unit corresponding to each access count recorded in the access sequence, the number of N time units included in the access sequence can be obtained, and thus the sum of the access counts of the N time units can be determined, so that the access frequency of the first object can be subsequently judged based on the access frequency of the first object before the inspection task, so that the judgment condition for migrating to a storage layer with a lower cost can be combined with the access frequency of the first object to adapt to the user's actual access needs.
[0061] Step 230: if the sum of the access times of N time units is less than the first threshold, the first object is migrated from the first storage layer to the second storage layer of the object storage system for storage, and the storage cost of the second storage layer is lower than the storage cost of the first storage layer.
[0062] If the sum of the number of accesses in N time units is less than the first threshold, it means that the access frequency of the first object in N time units is low. Continuing to store the first object in the first storage layer will cause the amount of data required to read the first object to continue to refer to the read cost of the first storage layer. After the first object is migrated from the first storage layer to the second storage layer of the object storage system for storage, the amount of data required to read the first object will refer to the read cost of the second storage layer. The amount of data required to read objects in the second storage layer is less than the amount of data required to read objects in the first storage layer, and the storage cost of the second storage layer is lower than the storage cost of the first storage layer. Therefore, migrating the first object from the first storage layer to the second storage layer of the object storage system for storage can reduce the storage cost of storing the first object.
[0063] The first threshold may be customized by the user according to actual access requirements for the first object, and is not limited in this application.
[0064] In some embodiments, if the sum of the number of accesses in N time units is greater than a first threshold, the first object is kept stored in the first storage layer.
[0065] If the sum of the number of accesses in N time units is greater than the first threshold, it means that the first object is frequently accessed within the N time units, and the user needs to frequently access the first object. Storing the first object in the first storage layer can ensure the smoothness of the network path for frequent access to the first object, and the first storage layer can provide high-quality object storage services.
[0066] Optionally, if the sum of the number of accesses in N time units is equal to a first threshold, the first object can be migrated from the first storage layer to the second storage layer of the object storage system for storage, or the first object can be kept stored in the first storage layer. This can be customized according to the user's actual access requirements for the first object, and this application does not limit it.
[0067] The technical solution provided by the embodiment of the present application can obtain the access frequency of the first object in the N time units by determining the sum of the access times of N consecutive time units before the inspection task, so as to judge whether to migrate the first object to a storage layer with lower storage cost according to the user's access to the first object. Compared with the related art that judges whether to migrate an object only based on the time when the object was last accessed, which easily leads to the situation that objects with low access frequency are not migrated, the present application migrates objects with access frequency lower than the first threshold from the first storage layer to the second storage layer, thereby reducing the amount of data required to read the object and reducing the storage cost of storing the object. Moreover, by using an access sequence to store the access times in each time unit, the data structure of the access sequence is relatively compact, which reduces the storage space occupied by storing access data.
[0068] Next, other embodiments are introduced.
[0069] In some embodiments, if the total number of time units between the time unit corresponding to the earliest recorded number of accesses in the access sequence and the execution time of the first inspection task is less than N, the first object is kept stored in the first storage layer.
[0070] If the number of time units between the start time of the access sequence and the execution time of the first inspection task is less than N, that is, the first time unit of the N time units that need to be determined is before the start time of the access sequence, then the first object is kept stored in the first storage layer.
[0071] refer to Figure 3In the access sequence of the first object shown, if the execution time of the first inspection task is January 16, and the value of N is 20, the total number of time units between the time unit January 1 corresponding to the earliest recorded access count in the access sequence and the execution time of the first inspection task January 16 is 15, which is less than N. The server needs to obtain the access count of 20 time units before the execution time of the first inspection task January 16, but the access sequence only contains the access count of 15 time units, and the access count of 5 time units before January 1 cannot be obtained, so as to determine the sum of the access counts of N time units, and the size relationship between the sum of the access counts of N time units and the first threshold cannot be determined.
[0072] It is possible that the sum of the number of accesses of the time units included in the access sequence is greater than the first threshold, and the first object is kept stored in the first storage layer. It is also possible that the sum of the number of accesses of the time units included in the access sequence is less than the first threshold, and the sum of the number of accesses of N time units may be greater than the first threshold, or may be less than the first threshold. Therefore, in the case where the sum of the number of accesses of N time units cannot be determined, the first object can be kept stored in the first storage layer.
[0073] By keeping the first object stored in the first storage layer when the sum of the number of accesses of N time units cannot be determined, the situation where the sum of the number of accesses of N time units is greater than the first threshold and the first object is migrated to the second storage layer is avoided, thereby avoiding affecting the access quality of the user's subsequent access to the first object.
[0074] In some embodiments, access log data of a first object within a first time unit is obtained, where the access log data is used to record access conditions of the first object within the first time unit, and the first time unit is a time unit not recorded in an access sequence; based on the access log data, the number of accesses to the first object in the first time unit is determined; and the number of accesses to the first object in the first time unit is added to the access sequence.
[0075] The first time unit refers to any time unit after the time unit corresponding to the latest access count recorded in the access sequence, and the access count of the first time unit has not been recorded in the access sequence. Moreover, if there is an interval time unit between the first time unit and the time unit corresponding to the latest access count recorded in the access sequence, there is no access log data in the interval time unit.
[0076] Obtaining access log data of the first object in the first time unit means obtaining at least one access log data of the first object in the first time unit. According to the number of access log data of the first object in the first time unit, the number of accesses to the first object in the first time unit can be obtained, thereby adding the number of accesses to the first object in the first time unit to the corresponding time unit of the access sequence.
[0077] It should be noted that the total number of time units between the first time unit and the time unit corresponding to the earliest recorded number of accesses in the access sequence is less than M, that is, after the number of accesses of the first time unit is added to the access sequence, the number of time units recorded in the access sequence does not exceed the maximum sequence length of the access sequence.
[0078] The above method can add the access times of the time units not recorded in the access sequence to the access sequence, thereby extending the sequence length of the access sequence so that the access times of the time units recorded in the access sequence reaches the maximum access length of the access sequence.
[0079] In some embodiments, if there is at least one time unit gap between the time unit corresponding to the latest recorded number of accesses in the access sequence and the first time unit, only the number of accesses of the time unit with access log data may be recorded, and the number of accesses of the gapped time units may not be marked.
[0080] For example Figure 3 In the access sequence shown, only the access times of the six time units with access log data are recorded, and the access times of the time units without access log data are not marked. For example, January 1 and January 4 both have access log data, and the access times of each are marked in the corresponding time units in the access sequence. January 2 and January 3 do not have access log data, and the access times of these two time units are not recorded. Therefore, the time unit corresponding to the latest access times recorded in the access sequence is January 15. If the first time unit is January 17, there is a time unit between the time unit corresponding to the latest access times recorded in the access sequence and the first time unit, and the access times of January 16 are not recorded, and only the access times of January 17 are added to the access sequence.
[0081] In some embodiments, if there is at least one interval time unit between the time unit corresponding to the latest recorded access number in the access sequence and the first time unit, the access number of each interval time unit is marked as 0.
[0082] For example Figure 3In the access sequence shown in the figure, for January 2 and January 3 between January 1 and January 4, the two time units do not have access log data, so the access counts of January 2 and January 3 can be marked as 0. The access counts of each time unit between the other two time units with access counts can also be marked as 0, so that Figure 6 Therefore, if there is at least one interval time unit between the time unit corresponding to the latest recorded access number in the access sequence and the first time unit, the access number of each interval time unit can be marked as 0.
[0083] Generally, if the number of interval time units is small, for example, there are a small number of time units such as 1 or 2 between two time units recording the number of accesses, the number of accesses of each interval time unit can be marked as 0. If the number of interval time units is large, for example, there are a large number of time units such as 10 or 11 between two time units recording the number of accesses, the number of accesses of each interval time unit may not be marked separately. This application does not limit the number of interval time units for determining whether marking is required.
[0084] By marking the access count of the time units with no access log data as 0, the access count contained in the access sequence can be made clearer, thereby facilitating confirmation of the access count of each time unit and avoiding judging the time units without access count based on the time units with access count, thereby improving recognition efficiency.
[0085] In some embodiments, if there is no access log data of the first object within the first time unit, the access sequence remains unchanged.
[0086] If the user does not access the first object in the first time unit, there is no access log data for the first object in the first time unit, so there is no need to add access data to the access sequence, and there is no need to perform the above step of "adding the number of accesses to the first object in the first time unit to the access sequence". The access sequence remains unchanged, which means that the time unit corresponding to the latest access number recorded in the access sequence remains unchanged.
[0087] In some embodiments, if there are access times of expired time units in the access sequence, the access times of the expired time units are deleted; wherein the expired time unit refers to the time unit before the most recent M consecutive time units.
[0088] If the sequence length of the access sequence exceeds the maximum sequence length, the number of time units recorded in the access sequence exceeds the maximum number of time units M. Therefore, the time unit before the most recent M consecutive time units is called an expired time unit. The number of accesses to the expired time unit cannot be retained in the access sequence and needs to be deleted.
[0089] refer to Figure 7 The schematic diagram of the access sequence shown in FIG. 1 shows that the access sequence can record the access times of up to 14 consecutive time units. Therefore, after adding the access times of January 15 to the access sequence, there are 15 consecutive time units from the time unit corresponding to the first access times recorded in the access sequence to the time unit corresponding to the latest access times recorded in the access sequence, which exceeds the maximum sequence length of the access sequence. The time units before the most recent 14 consecutive time units need to be deleted. Therefore, the access times of January 1 can be deleted. Since January 2 and January 3 do not have access times, the start time of the access sequence changes to January 4, which has access times. The sequence length of the access sequence after deletion is 13, which does not exceed the maximum sequence length of the access sequence.
[0090] By limiting the time units included in the access sequence, the data storage space occupied by the access sequence does not exceed the maximum storage space that can be occupied by the access sequence, thereby controlling the data storage volume of the number of accesses to the first object, avoiding excessive accesses that occupy a large storage space and impose a burden on the operation of the server.
[0091] In some embodiments, after migrating the first object from the first storage layer to the second storage layer of the object storage system for storage, the sum of the number of accesses of K time units can be determined based on the second inspection task for the access sequence, where the K time units refer to the K consecutive time units closest to the execution time of the second inspection task, and K is a positive integer less than or equal to M; if the sum of the number of accesses of the K time units is greater than the second threshold, the first object is migrated from the second storage layer to the first storage layer for storage.
[0092] The second inspection task refers to an inspection task for the number of accesses contained in the access sequence of the first object stored in the second storage layer, and is used to determine the number of accesses in K time units before the execution time of the second inspection task. K time units refer to K consecutive time units before the execution time of the second inspection task.
[0093] The process of determining the sum of the number of accesses of K time units may refer to the process of determining the sum of the number of accesses of N time units in the above embodiment, and will not be described in detail here.
[0094] If the sum of the number of accesses in K time units is greater than the second threshold, it means that the first object is accessed frequently in K time units and the user needs to access the first object frequently. Storing the first object in the second storage layer cannot guarantee the smoothness of the network path for frequent access to the first object, and the second storage layer cannot adapt to the frequent access of users. The first storage layer can provide high-quality object storage services. Therefore, the first object is migrated from the second storage layer to the first storage layer for storage.
[0095] If the sum of the number of access times of K time units is less than the second threshold, it means that the access frequency of the first object within K time units is low. Storing the first object in the second storage layer can maintain a low storage cost for storing the first object without affecting the user's access experience too much.
[0096] The second threshold here can be customized by the user according to the actual access requirements for the first object, and this application does not limit it.
[0097] Optionally, if the sum of the number of accesses of K time units is equal to the second threshold, the first object can be migrated from the second storage layer to the first storage layer for storage, or the first object can be kept stored in the second storage layer. This can be customized according to the user's actual access requirements for the first object, and this application does not limit it.
[0098] It should be noted that the value of K may be the same as the value of N in the above embodiment, or may be different from the value of N, and there is no limitation on this.
[0099] By migrating objects with a high access frequency from the second storage layer to the first storage layer, the first storage layer can guarantee the user's frequent access needs to the object and provide users with high-quality object storage services.
[0100] In some embodiments, when the sum of the number of accesses of N time units is less than a first threshold, whether to migrate the first object from the first storage layer to the second storage layer of the object storage system for storage; and when the sum of the number of accesses of K time units is greater than a second threshold, whether to migrate the first object from the second storage layer to the first storage layer for storage, a configuration switch may be provided on the terminal device, and the user may customize the settings according to their actual object access requirements, and whether to turn on the migration of the storage layer of the first object based on the relationship between the number of accesses of multiple time units and the threshold.
[0101] You can refer to Figure 8In the sub-picture (a) in Figure 1, if the user checks "Automatically downgrade based on object access frequency" or "Automatically upgrade based on object access frequency", it means that the user has turned on the configuration switch of "Automatically downgrade based on object access frequency" or "Automatically upgrade based on object access frequency". If the user checks "Automatically downgrade based on object access frequency", the terminal device will immediately display the configuration switch. Figure 8 The configuration setting box shown in sub-figure (b) in FIG. 1 is used to customize the number N of historical time units and the first threshold of the sum of the number of access times.
[0102] For example, if the number of historical time units N is set to 30 and the first threshold of the sum of access times is set to 5, if the sum of the access times in the most recent 30 time units before the execution time of the first inspection task is less than 5 times, the object will be migrated from the first storage layer to the second storage layer.
[0103] The names of the above configuration switches are only examples. In the implementation of the technical solution of the present application, the names of the configuration switches are not specifically limited.
[0104] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0105] Please refer to Fig. 9 It shows a block diagram of an object storage device provided by an embodiment of the present application. The device has the function of implementing the above-mentioned object storage method, and the function can be implemented by hardware, or by hardware executing corresponding software. The device can be the server introduced above, or it can be set in the server. Fig. 9 As shown, the device 900 may include: an acquisition module 910 , a determination module 920 and a storage module 930 .
[0106] The acquisition module 910 is used to obtain an access sequence of a first object, where the first object is stored in a first storage layer of an object storage system. The access sequence is used to record at most the number of accesses to the first object in each time unit within M consecutive time units, where M is a positive integer.
[0107] Determination module 920 is used to determine the sum of the number of accesses of N time units based on the first inspection task for the access sequence, where the N time units refer to the N consecutive time units closest to the execution time of the first inspection task, and N is a positive integer less than or equal to M.
[0108] Storage module 930 is used to migrate the first object from the first storage layer to the second storage layer of the object storage system for storage if the sum of the access times of the N time units is less than a first threshold, and the storage cost of the second storage layer is lower than the storage cost of the first storage layer.
[0109] In some embodiments, the determining module 920 includes:
[0110] An acquisition unit is used to acquire configuration information of the first inspection task, where the configuration information includes the number N of historical time units.
[0111] The first determining unit is used to determine the access times of the N time units closest to the execution time of the first inspection task according to the number N of historical time units and the access times of each time unit recorded in the access sequence.
[0112] The second determining unit is used to sum the number of accesses of the N time units to obtain the sum of the number of accesses of the N time units.
[0113] In some embodiments, the first determining unit is configured to:
[0114] Determine the time unit corresponding to each access number recorded in the access sequence;
[0115] The access times of the N time units closest to the execution time of the first inspection task are determined according to the number N of historical time units and the time units corresponding to the respective access times recorded in the access sequence.
[0116] In some embodiments, the storage module 930 is further used to:
[0117] If the sum of the access times of the N time units is greater than the first threshold, the first object is kept stored in the first storage layer.
[0118] In some embodiments, the storage module 930 is further used to:
[0119] If the total number of time units between the time unit corresponding to the earliest recorded number of accesses in the access sequence and the execution time of the first inspection task is less than N, the first object is kept stored in the first storage layer.
[0120] In some embodiments, the apparatus 900 further includes an adding module, wherein the adding module is configured to:
[0121] Acquire access log data of the first object in a first time unit, where the access log data is used to record access conditions of the first object in the first time unit, and the first time unit is a time unit not recorded in the access sequence;
[0122] Determining, based on the access log data, the number of times the first object is accessed in the first time unit;
[0123] The number of accesses to the first object in the first time unit is added to the access sequence.
[0124] In some embodiments, the apparatus 900 further includes a marking module, wherein the marking module is configured to:
[0125] If there is at least one interval time unit between the time unit corresponding to the latest recorded access number in the access sequence and the first time unit, the access number of each of the interval time units is marked as 0.
[0126] In some embodiments, the adding module is used to:
[0127] If there is no access log data of the first object within the first time unit, the access sequence remains unchanged.
[0128] In some embodiments, the apparatus 900 further includes a deletion module, wherein the deletion module is configured to:
[0129] If there is an access count of an expired time unit in the access sequence, the access count of the expired time unit is deleted; wherein the expired time unit refers to a time unit before the most recent M consecutive time units.
[0130] In some embodiments, the storage module 930 is further used to:
[0131] According to the second inspection task for the access sequence, determine the sum of the number of accesses of K time units, where the K time units refer to the K consecutive time units closest to the execution time of the second inspection task, and K is a positive integer less than or equal to M;
[0132] If the sum of the access times of the K time units is greater than a second threshold, the first object is migrated from the second storage layer to the first storage layer for storage.
[0133] The technical solution provided by the embodiment of the present application can obtain the access frequency of the first object in the N time units by determining the sum of the access times of N consecutive time units before the inspection task, so as to judge whether to migrate the first object to a storage layer with lower storage cost according to the user's access to the first object. Compared with the related art that judges whether to migrate an object only based on the time when the object was last accessed, which easily leads to the situation that objects with low access frequency are not migrated, the present application migrates objects with access frequency lower than the first threshold from the first storage layer to the second storage layer, thereby reducing the amount of data required to read the object and reducing the storage cost of storing the object. Moreover, by using an access sequence to store the access times in each time unit, the data structure of the access sequence is relatively compact, which reduces the storage space occupied by storing access data.
[0134] It should be noted that the device provided in the above embodiment, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the content structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0135] Please refer to Fig.10 , which shows a structural block diagram of a server 1000 provided in one embodiment of the present application. The server 1000 may be any electronic device with data computing, processing and storage functions. The server 1000 may be used to implement the object storage method provided in the above embodiment.
[0136] Typically, the server 1000 includes: a processor 1001 and a memory 1002 .
[0137] The processor 1001 may include one or more processing cores, such as a 4-core processor, a 9-core processor, etc. The processor 1001 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1001 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 1001 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1001 may also include an AI processor, which is used to process computing operations related to machine learning.
[0138] The memory 1002 may include one or more computer-readable storage media, which may be non-transitory. The memory 1002 may also include a high-speed random access memory and a non-volatile memory, such as one or more disk storage devices and flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1002 is used to store a computer program, which is configured to be executed by one or more processors to implement the above-mentioned object storage method.
[0139] Those skilled in the art will understand that Fig.10 The structure shown in the figure does not constitute a limitation on the server 1000, and the server 1000 may include more or less components than those shown in the figure, or combine certain components, or adopt a different component arrangement.
[0140] In an illustrative embodiment, a computer-readable storage medium is also provided, wherein a computer program is stored in the storage medium, and the computer program implements the object storage method when executed by a processor of a server. Optionally, the computer-readable storage medium may be a ROM (Read-Only Memory), a RAM (Random Access Memory), a CD-ROM (Compact Disc Read-Only Memory), a magnetic tape, a floppy disk, an optical data storage device, etc.
[0141] In an exemplary embodiment, a computer program product is also provided, the computer program product comprising a computer program, the computer program being stored in a computer-readable storage medium. A processor of a server reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the server executes the above object storage method.
[0142] It should be noted that this application can display a prompt interface, pop-up window or output voice prompt information before collecting relevant data of users and during the process of collecting relevant data of users. The prompt interface, pop-up window or voice prompt information is used to prompt the user that relevant data is currently being collected, so that this application only starts to execute the relevant steps of obtaining relevant data of users after obtaining the confirmation operation issued by the user to the prompt interface or pop-up window, otherwise (that is, when the confirmation operation issued by the user to the prompt interface or pop-up window is not obtained), the relevant steps of obtaining relevant data of users are terminated, that is, the relevant data of users are not obtained. In other words, all user data collected by this application (including access log data of users accessing different objects) are processed strictly in accordance with the requirements of relevant national laws and regulations, and the informed consent or separate consent of the subject of personal information is obtained with the consent and authorization of the user. The subsequent data use and processing behavior is carried out within the scope of authorization of laws and regulations and the subject of personal information, and the collection, use and processing of relevant user data shall comply with the relevant laws, regulations and standards of relevant countries and regions.
[0143] It should be understood that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. In addition, the step numbers described in this article only illustrate a possible execution sequence between the steps. In some other embodiments, the above steps may not be executed in the order of the numbers, such as two steps with different numbers are executed at the same time, or two steps with different numbers are executed in the opposite order to the diagram. The embodiments of the present application are not limited to this.
[0144] The above description is only an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. An object storage method, characterized in that: The method comprises: Acquire an access sequence of a first object, where the first object is stored in a first storage layer of an object storage system, and the access sequence is used to record at most the number of accesses to the first object in each of M consecutive time units, where M is a positive integer; According to the first inspection task for the access sequence, determine the sum of the number of accesses of N time units, where the N time units refer to the N consecutive time units closest to the execution time of the first inspection task, and N is a positive integer less than or equal to M; If the sum of the access times of the N time units is less than a first threshold, the first object is migrated from the first storage layer to a second storage layer of the object storage system for storage, and the storage cost of the second storage layer is lower than the storage cost of the first storage layer.
2. The method according to claim 1, characterized in that The determining the sum of the number of accesses of N time units according to the first inspection task for the access sequence comprises: Acquire configuration information of the first inspection task, where the configuration information includes the number N of historical time units; Determine the access count of the N time units closest to the execution time of the first inspection task according to the number N of the historical time units and the access count of each time unit recorded in the access sequence; The number of accesses of the N time units is summed to obtain the sum of the number of accesses of the N time units.
3. The method according to claim 2, characterized in that The determining, according to the number N of historical time units and the number of accesses of each time unit recorded in the access sequence, the number of accesses of the N time units closest to the execution time of the first inspection task includes: Determine the time unit corresponding to each access number recorded in the access sequence; The access times of the N time units closest to the execution time of the first inspection task are determined according to the number N of historical time units and the time units corresponding to the respective access times recorded in the access sequence.
4. The method according to claim 1, characterized in that After determining the sum of the number of accesses of N time units according to the first inspection task for the access sequence, the method further includes: If the sum of the access times of the N time units is greater than the first threshold, the first object is kept stored in the first storage layer.
5. The method according to claim 1, characterized in that The method further comprises: If the total number of time units between the time unit corresponding to the earliest recorded number of accesses in the access sequence and the execution time of the first inspection task is less than N, the first object is kept stored in the first storage layer.
6. The method according to claim 1, characterized in that The method further comprises: Acquire access log data of the first object in a first time unit, where the access log data is used to record access conditions of the first object in the first time unit, and the first time unit is a time unit not recorded in the access sequence; Determining, based on the access log data, the number of times the first object is accessed in the first time unit; The number of accesses to the first object in the first time unit is added to the access sequence.
7. The method according to claim 6, characterized in that The method further comprises: If there is at least one interval time unit between the time unit corresponding to the latest recorded access number in the access sequence and the first time unit, the access number of each of the interval time units is marked as 0.
8. The method according to claim 6, characterized in that The method further comprises: If there is no access log data of the first object within the first time unit, the access sequence remains unchanged.
9. The method according to claim 1, characterized in that: The method further comprises: If there is an access count of an expired time unit in the access sequence, the access count of the expired time unit is deleted; wherein the expired time unit refers to a time unit before the most recent M consecutive time units.
10. The method according to claim 1, characterized in that After the first object is migrated from the first storage layer to the second storage layer of the object storage system for storage, the method further includes: According to the second inspection task for the access sequence, determine the sum of the number of accesses of K time units, where the K time units refer to the K consecutive time units closest to the execution time of the second inspection task, and K is a positive integer less than or equal to M; If the sum of the access times of the K time units is greater than a second threshold, the first object is migrated from the second storage layer to the first storage layer for storage.
11. An object storage device, characterized in that: The device comprises: an acquisition module, configured to acquire an access sequence of a first object, the first object being stored in a first storage layer of an object storage system, the access sequence being configured to record at most the number of accesses to the first object in each of M consecutive time units, where M is a positive integer; a determination module, configured to determine, according to a first inspection task for the access sequence, a sum of the number of accesses of N time units, wherein the N time units refer to N consecutive time units closest to the execution time of the first inspection task, and N is a positive integer less than or equal to M; A storage module is used to migrate the first object from the first storage layer to the second storage layer of the object storage system for storage if the sum of the access times of the N time units is less than a first threshold, and the storage cost of the second storage layer is lower than the storage cost of the first storage layer.
12. A server, characterized in that: The server includes a processor and a memory, wherein a computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement the object storage method according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is loaded and executed by a processor to implement the object storage method according to any one of claims 1 to 10.
14. A computer program product, characterized in that The computer program product comprises a computer program, and the computer program is loaded and executed by a processor to implement the object storage method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Hierarchical storage method, hierarchical storage system and object access controller
CN103795756A
Data caching method, equipment and system
CN107870729A
Data migration between multiple tiers in a storage system using age and frequency statistics
US8370597B1
