Cloud disk snapshot capacity determination method and device, computer equipment, medium and product
By determining the target storage block corresponding to the snapshot chain of each application scenario, the problem that the cloud disk snapshot capacity statistics method in the prior art is difficult to meet the charging standards requirements for different scenarios, and the refined management and cost control of resources are realized.
Patent Information
- Application Number
- CN202411672859.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-02-18
AI Technical Summary
The existing cloud disk snapshot capacity statistics method uniformly counts all snapshot capacity on the cloud disk, which is difficult to meet the diverse charging standards for snapshots in different scenarios.
By responding to the trigger instruction, the target storage blocks corresponding to the snapshot chain of each application scenario are determined, and the cloud disk snapshot capacity of each application scenario is determined based on these target storage blocks.
It realizes the use of accurate snapshot capacity of each application scenario, rationally allocate storage resources, optimize resource configuration, and avoid resource waste or insufficient resources, helps enterprise users better plan cloud storage budget and resource usage strategies, and improve resource utilization efficiency. Reduce operating costs.
Smart Images

Figure CN119473159A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud storage technology, and in particular to a method, device, computer equipment, medium and product for determining cloud disk snapshot capacity. Background Art
[0002] With the development of cloud computing technology, cloud disk snapshot technology is increasingly used in public cloud scenarios. Users can save specific states of cloud disk data at different time points, which facilitates subsequent data comparison, recovery, and management operations.
[0003] However, the current cloud disk snapshot capacity statistics method has certain limitations. It does not count snapshots individually, but rather counts the sum of all snapshot capacities on the cloud disk. This statistical method is difficult to meet the diverse charging standards for snapshots in different scenarios in public cloud scenarios. Summary of the invention
[0004] Based on this, it is necessary to provide a method c that can solve the above-mentioned technical problems.
[0005] In a first aspect, the present application provides a method for determining cloud disk snapshot capacity, the method comprising:
[0006] In response to the trigger instruction, determine the target storage block corresponding to the snapshot chain of each application scenario;
[0007] According to the target storage blocks corresponding to each snapshot chain, the cloud disk snapshot capacity corresponding to each application scenario is determined.
[0008] In one embodiment, the above-mentioned determining the target storage block corresponding to the snapshot chain of each application scenario includes:
[0009] Determine the version range corresponding to the snapshot chain of each application scenario;
[0010] According to the version range of each snapshot chain, the target storage block corresponding to each snapshot chain is determined.
[0011] In one embodiment, the method further comprises:
[0012] In the target scenario, the cloud disk is snapshotted to obtain the target snapshot and the chain parameters corresponding to the target snapshot; the chain parameters represent the target snapshot chain to which the target snapshot belongs;
[0013] Get the version number from the distributed storage engine and determine the version range of the target snapshot chain based on the version number.
[0014] In one embodiment, the version range of the target snapshot chain includes the first snapshot version range; determining the version range of the target snapshot chain according to the version number includes:
[0015] In the case of the first snapshot, the first snapshot version range is determined based on the minimum data version and version number supported by the distributed storage engine.
[0016] In one embodiment, the version range of the target snapshot chain includes a non-first snapshot version range; determining the version range of the target snapshot chain according to the version number includes:
[0017] If it is not the first snapshot, the target snapshot is added to the end of the target snapshot chain according to the chain parameters;
[0018] Determine the non-first snapshot version interval based on the previous version interval and version number.
[0019] In one embodiment, determining the cloud disk snapshot capacity corresponding to each application scenario according to the target storage block corresponding to each snapshot chain includes:
[0020] For each snapshot chain, calculate the data capacity of multiple target storage blocks of the snapshot chain;
[0021] The data capacities of multiple target storage blocks are added together to obtain the cloud disk snapshot capacity corresponding to each application scenario.
[0022] In a second aspect, the present application also provides a cloud disk snapshot capacity determination device. The device includes:
[0023] A storage block determination module, used to determine a target storage block corresponding to the snapshot chain of each application scenario in response to a trigger instruction;
[0024] The capacity determination module is used to determine the cloud disk snapshot capacity corresponding to each application scenario according to the target storage block corresponding to each snapshot chain.
[0025] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0026] In response to the trigger instruction, determine the target storage block corresponding to the snapshot chain of each application scenario;
[0027] According to the target storage blocks corresponding to each snapshot chain, the cloud disk snapshot capacity corresponding to each application scenario is determined.
[0028] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0029] In response to the trigger instruction, determine the target storage block corresponding to the snapshot chain of each application scenario;
[0030] According to the target storage blocks corresponding to each snapshot chain, the cloud disk snapshot capacity corresponding to each application scenario is determined.
[0031] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0032] In response to the trigger instruction, determine the target storage block corresponding to the snapshot chain of each application scenario;
[0033] According to the target storage blocks corresponding to each snapshot chain, the cloud disk snapshot capacity corresponding to each application scenario is determined.
[0034] The above-mentioned cloud disk snapshot capacity determination method, device, computer equipment, medium and product first respond to the trigger instruction to determine the target storage block corresponding to the snapshot chain of each application scenario, and then determine the cloud disk snapshot capacity corresponding to each application scenario based on the target storage block corresponding to each snapshot chain. By determining the cloud disk snapshot capacity corresponding to each application scenario, the present application can reasonably allocate storage resources and optimize resource configuration according to the accurate snapshot capacity usage of each application scenario, thereby avoiding waste or shortage of resources. At the same time, enterprise users can also better plan their own cloud storage budget and resource usage strategy based on the accurate snapshot capacity information in each scenario, improve resource utilization efficiency and reduce operating costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 A diagram of an application environment of a method for determining cloud disk snapshot capacity in an embodiment;
[0036] Figure 2 A schematic diagram of a process of determining a cloud disk snapshot capacity in one embodiment;
[0037] Figure 3 A schematic diagram of a process for determining a target storage block of a snapshot chain for each application scenario in one embodiment;
[0038] Figure 4 It is a flowchart of a method for determining cloud disk snapshot capacity in another embodiment;
[0039] Figure 5 It is a schematic diagram of a process of determining a version range of a target snapshot chain according to a version number in one embodiment;
[0040] Figure 6 A schematic diagram of a process for determining the cloud disk snapshot capacity corresponding to each application scenario in an embodiment;
[0041] Figure 7 A schematic diagram of an embodiment in which a snapshot protection version needs to be recorded;
[0042] Figure 8It is a structural block diagram of a device for determining the capacity of a cloud disk snapshot in one embodiment;
[0043] Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0045] The cloud disk snapshot capacity method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The server data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. First, in response to the trigger instruction, the target storage block corresponding to the snapshot chain of each application scenario is determined, and then the cloud disk snapshot capacity corresponding to each application scenario is determined according to the target storage block corresponding to each snapshot chain. Among them, the terminal 102 can be but is not limited to various personal computers, laptops, smart phones and tablets. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.
[0046] In one embodiment, Figure 2 As shown, a cloud disk snapshot capacity method is provided, which is applied to Figure 1 The server in the example is used to illustrate the following steps:
[0047] S201, in response to a trigger instruction, determining a target storage block corresponding to a snapshot chain of each application scenario.
[0048] Among them, application scenarios refer to different business or functional usage scenarios involved in the actual use of cloud disks. For example, the scenario of "users directly taking snapshots of cloud disks" is that users actively take snapshots of cloud disks for personal data backup or data version management; the scenario of "users taking snapshots of cloud hosts" is mainly used to back up system status and data in the cloud host operating environment, so that they can be used when the host fails or needs to be restored to a specific state; the scenario of "users back up cloud disks, the backup feature takes snapshots of cloud disks to protect data, and then pulls snapshot data" is to ensure the consistency and integrity of backup data by taking snapshots when performing cloud disk data backup operations, and then pull snapshot data for off-site storage or other backup strategy implementation.
[0049] The snapshot chain is a concept introduced to classify and manage cloud disk snapshots. In the embodiment of the present application, each snapshot chain represents a set of snapshots with specific associations or purposes. They are isolated from each other in terms of management information and can be operated and counted independently, but may involve references to the same data blocks. For example, an enterprise can create its own snapshot chain according to different departments (such as finance, R&D, sales, etc.) or different business projects to better manage and count snapshot data related to each department or project.
[0050] The target storage block refers to the actual storage data unit associated with the snapshot chain of a specific application scenario when determining the cloud disk snapshot capacity. These storage blocks are the basic components of data storage in the cloud disk. In the snapshot operation, according to the definition of the snapshot chain and the data version management rules, it is determined which storage blocks belong to the management scope of a specific snapshot chain, and then used to calculate the cloud disk snapshot capacity corresponding to the snapshot chain.
[0051] In the embodiment of the present application, the trigger instruction can be generated by a variety of factors, such as the user manually selecting to perform snapshot capacity statistics operations for a specific application scenario in the cloud service management interface, or automatically triggered according to a preset scheduled task (such as statistical analysis of snapshot data of each application scenario of the previous day at dawn every day). After receiving the trigger instruction, the system first identifies the application scenario specified in the instruction. For example, if it is a monthly data backup scenario of the finance department, the system will locate the snapshot chain associated with the scenario (assuming it is the "financial data backup chain").
[0052] Then, according to the pre-set mapping relationship between snapshot chain and storage blocks, all target storage blocks involved in the snapshot chain are searched. This mapping relationship can be established based on a variety of rules. For example, when creating a snapshot chain, the storage area covered by the chain is clearly specified (such as the storage block range corresponding to the financial data storage folder), or according to the metadata recorded during the snapshot operation, which storage blocks are within the management scope of the snapshot chain. For the "financial data backup chain", it may involve storage blocks that store financial statements, account details and other data.
[0053] Another implementation method: The target storage block can be determined based on data feature recognition. When the trigger instruction is issued, the system traverses all storage blocks of the cloud disk and analyzes the data features in each storage block. For example, for financial data scenarios, the format of the data in the storage block (such as a specific financial software data format) and keywords (such as header information in financial statements, account classification keywords, etc.) can be identified to determine whether the storage block belongs to a snapshot chain related to financial data. Once it is determined that the storage block is related to the snapshot chain of a specific application scenario, it is marked as a target storage block and a temporary association relationship is established to facilitate subsequent calculation of the snapshot capacity. This method does not require the establishment of a strict mapping relationship in advance, is more flexible, and can adapt to changes in data storage structure or the emergence of new application scenarios. For example, when an enterprise adds a financial data file in a special format, the corresponding storage block can still be accurately included in the management scope of the financial data snapshot chain through data feature recognition.
[0054] S202: Determine the cloud disk snapshot capacity corresponding to each application scenario according to the target storage blocks corresponding to each snapshot chain.
[0055] The cloud disk snapshot capacity refers to the total storage space occupied by all target storage blocks in the corresponding snapshot chain in a specific application scenario. Accurately calculating the cloud disk snapshot capacity can help cloud service providers to rationally plan storage resources and formulate fair charging strategies; for enterprise users, it can clearly understand their own data storage needs and costs and optimize data management strategies.
[0056] In the embodiment of the present application, for each determined snapshot chain and its corresponding target storage block, the system calculates according to the pre-set capacity calculation rules. Under the ROW snapshot technology based on lava storage, the occupied space of each target storage block in different snapshot versions is calculated according to the data version management rules. For example, for a certain target storage block, if there are multiple write operations in the [1,5] version interval, according to the principle of only saving the latest data in the largest version in the ROW snapshot technology, the effective occupied space of the storage block in the interval is determined. Then, the occupied space of all target storage blocks under the same snapshot chain in each relevant version interval is accumulated to obtain the total capacity of the snapshot chain corresponding to the application scenario, that is, the cloud disk snapshot capacity of the application scenario. For example, for the "financial data backup chain", the capacity of all its target storage blocks in the relevant intervals such as [1,5] and (5,8] (determined according to the version range of the financial data snapshot) is added to obtain the cloud disk snapshot capacity of the financial data scenario.
[0057] Another implementation method: A dynamic weight allocation mechanism can be introduced to determine the cloud disk snapshot capacity. When calculating the capacity of each target storage block, different weights are assigned to it according to factors such as the frequency of use of the storage block and the importance of the data. For example, a higher weight is given to financial data storage blocks that have been frequently accessed or modified recently, because these data may be more important in data recovery or analysis. When calculating the capacity, the actual occupied space of each target storage block is multiplied by its corresponding weight and then added. The cloud disk snapshot capacity obtained in this way can more accurately reflect the actual value and resource occupancy of the data in the application scenario. For example, in the financial data scenario, the core financial statement data storage block has a higher weight, and its capacity calculation result accounts for a larger proportion of the total snapshot capacity, which is more in line with the financial data management's emphasis on key data.
[0058] The above-mentioned cloud disk snapshot capacity determination method first responds to the trigger instruction to determine the target storage block corresponding to the snapshot chain of each application scenario, and then determines the cloud disk snapshot capacity corresponding to each application scenario based on the target storage block corresponding to each snapshot chain. By determining the cloud disk snapshot capacity corresponding to each application scenario, this application can reasonably allocate storage resources and optimize resource configuration according to the accurate snapshot capacity usage of each application scenario, thereby avoiding waste or insufficient resources. At the same time, enterprise users can also better plan their own cloud storage budget and resource usage strategy based on the accurate snapshot capacity information in each scenario, improve resource utilization efficiency, and reduce operating costs.
[0059] In an exemplary embodiment, based on the above embodiment, see Figure 3 The embodiment of the present application relates to a process of determining a target storage block corresponding to a snapshot chain of each application scenario, including the following steps:
[0060] S301, determining the version range corresponding to the snapshot chain of each application scenario.
[0061] Among them, version interval: In the snapshot technology based on lava storage, the version interval refers to the data version range associated with a specific snapshot operation. For example, when the first snapshot operation is performed on the cloud disk to obtain version 5 (full snapshot), its version interval is [1,5], indicating that the snapshot covers the data status from the initial version 1 to the current version 5. The subsequent incremental snapshot (such as obtaining version 7) has a version interval of [6,7], which records the data changes after version [1,5] to version 7. The version interval is an important basis for determining the scope of snapshot protection data, data management and capacity statistics.
[0062] The server of the embodiment of the present application first locates the snapshot chain of a specific application scenario according to the mapping relationship between the application scenario and the snapshot chain set in advance. For example, for the financial data management scenario of an enterprise, the system identifies the corresponding "financial data backup chain".
[0063] Then, based on the snapshot operation information recorded in the snapshot chain, determine the corresponding version range. These snapshot operation information include the time, type (full or incremental) and generated data version number of each snapshot operation. Taking the "financial data backup chain" as an example, assuming that its first snapshot obtains version 5 (full snapshot), and then an incremental snapshot operation is performed at a specific time to obtain version 8, then the version range corresponding to the snapshot chain includes [1,5] (initial version to first snapshot version) and (5,8] (incremental interval between the first snapshot version and the second snapshot version). The system can obtain this information by querying the operation log or related metadata of the snapshot chain, thereby accurately determining the version range.
[0064] Another implementation method: the version interval can be determined based on data change analysis. The system monitors the changes in cloud disk data in real time. When the amount of data change reaches a certain threshold (such as the amount of data block written exceeds a set percentage, the number of updates of a specific type of data reaches a certain number, etc.), the version interval determination operation is triggered. For specific application scenarios, analyze the version range involved in the data changes related to the scenario. For example, in the R&D project data scenario, when a large number of code files are modified and reach the set threshold, the system determines the version range from the last snapshot version to the current data change as the new version interval. This method does not rely on a pre-set snapshot operation time interval or fixed rules, and can more flexibly adapt to application scenarios with frequent data changes, ensuring the accuracy and timeliness of the version interval.
[0065] S302: Determine the target storage block corresponding to each snapshot chain according to the version interval of each snapshot chain.
[0066] In the embodiment of the present application, based on the determined snapshot chain version interval, the system traverses all storage blocks of the cloud disk. For each storage block, check whether its data version falls within the version interval of the corresponding snapshot chain. For example, for the "financial data backup chain" with a version interval of [1,5], the system checks whether the data version of each storage block is within this range.
[0067] If the data version of the storage block is within the version range and meets other associated conditions of the application scenario (such as the data format meets the financial data format requirements, the storage path is located in the financial data storage area, etc.), then the storage block is determined as the target storage block corresponding to the snapshot chain. In this way, the system can accurately filter out the target storage blocks related to a specific snapshot chain and application scenario, providing an accurate data basis for subsequent capacity calculations.
[0068] Another implementation method: introduce an index mechanism to determine the target storage block. Establish an index structure based on version intervals and application scenario characteristics in the cloud disk storage system. When the target storage block needs to be determined, the corresponding storage block identifier is directly searched in the index according to the version interval and application scenario information of the snapshot chain.
[0069] For example, for the snapshot chain of the sales data application scenario, its version range is [1,3] and (3,6]. The system quickly locates the storage blocks related to these version ranges and sales data features (such as customer order data format, sales statistics file keywords, etc.) through indexes. This method can greatly improve the search efficiency of the target storage block, especially suitable for large-scale cloud disk storage environments, reduce the performance overhead caused by traversing storage blocks, and improve the efficiency of the entire cloud disk snapshot capacity determination process.
[0070] The cloud storage system can achieve refined management of data by accurately determining the version interval and target storage block corresponding to the snapshot chain of each application scenario in the embodiment of the present application. In different application scenarios, only data related to the scenario will be included in the management scope of the corresponding snapshot chain, avoiding interference from irrelevant data. For example, in financial data management, it is ensured that only financial-related storage blocks participate in the management of the financial data backup chain, thereby improving the accuracy of data management. At the same time, the accurate target storage block determination process reduces unnecessary data processing and storage overhead, and improves the overall efficiency of data management.
[0071] In an exemplary embodiment, based on the above embodiment, see Figure 4 , the method of the embodiment of the present application further includes the following steps:
[0072] S401, in a target scenario, snapshot processing is performed on the cloud disk to obtain a target snapshot and chain parameters corresponding to the target snapshot.
[0073] The target scenario refers to an application scenario with specific data management requirements and business logic during the use of cloud disks. For example, the financial data management scenario in an enterprise is characterized by extremely high requirements for data security and accuracy, relatively low data update frequency but critical data integrity; the R&D project data management scenario focuses on frequent version iterations and data experiments, and requires rapid creation and management of snapshots of multiple versions to support code development and testing.
[0074] Chain parameters are parameter information used to identify the target snapshot chain to which the cloud disk snapshot belongs. These parameters may include the unique identifier of the snapshot chain, the creation time, the identification of the application scenario to which it belongs, etc. Through chain parameters, the system can clearly classify snapshots into specific snapshot chains, realize independent management and data isolation between different snapshot chains, and ensure that each snapshot chain can be operated and managed according to the requirements of its corresponding target scenario.
[0075] In an embodiment of the present application, when a snapshot operation is triggered in a target scenario (for example, after completing the development of an important code module, the R&D personnel manually clicks the "Create Snapshot" button in the cloud disk management interface), the system first identifies the current target scenario (such as determining it as a R&D project data management scenario through user login information, operating permissions, or pre-set scenario mapping rules).
[0076] Then, based on the predefined relationship between the target scenario and the snapshot chain, determine the target snapshot chain (assuming it is the "R&D project snapshot chain") to which the target snapshot should belong. In the process of creating the target snapshot, the system generates corresponding chain parameters for the snapshot, including a unique identifier assigned to the "R&D project snapshot chain" (such as a string of numbers and letters), the current timestamp as the creation time, and identification information related to the R&D project (such as the project number or name). These chain parameters will be associated with the target snapshot and stored in the system so that subsequent management and operation of the snapshot can accurately identify the snapshot chain to which it belongs.
[0077] S402, obtaining a version number from a distributed storage engine, and determining a version range of a target snapshot chain according to the version number.
[0078] In the embodiment of the present application, after the target snapshot is created and its chain parameters are obtained, the system requests the distributed storage engine (such as the lava storage engine) to obtain the version number. The distributed storage engine assigns a unique version number (assuming version 10) to the target snapshot according to its internal data version management mechanism (such as version tagging based on data blocks, timestamp sorting, etc.).
[0079] Then, the version range is determined based on the historical version information of the target snapshot chain to which the target snapshot belongs and the currently acquired version number. If the target snapshot chain is the first snapshot created (i.e., the head snapshot of the chain), the version range is determined to be [1,10] (assuming that the initial version number of the distributed storage engine is 1), indicating that all data states of the snapshot chain from the initial version to the currently acquired version 10 are protected. If the target snapshot chain already has a historical snapshot, for example, the version number of the previous snapshot is 7, then the version range of the current target snapshot is determined to be (7,10], indicating that the snapshot records the incremental changes in data from version 7 to version 10. The system obtains this information by querying the version history or related metadata of the target snapshot chain, thereby accurately determining the version range.
[0080] In the embodiment of the present application, a dynamic adjustment mechanism of version interval based on data change is introduced. While obtaining the version number from the distributed storage engine, the system analyzes the data change involved in this snapshot operation in the target scenario (such as the number of new, modified or deleted data blocks).
[0081] Another implementation method: According to the pre-set data change amount and version interval adjustment rules, if the data change amount exceeds a certain threshold, the system divides the version interval more finely. For example, in a large file storage scenario, if a snapshot operation involves the modification of a large number of data blocks, the system may further subdivide the version interval into multiple sub-intervals (such as (7,8], (8,9], (9,10]) to more accurately track and manage data changes at different stages. This method can flexibly adjust the version interval according to the actual data changes, improve the accuracy of version management, and is particularly suitable for target scenarios with frequent and complex data changes.
[0082] By accurately performing snapshot processing in the target scenario and determining the version interval of the target snapshot chain, the cloud storage system can provide highly customized data management and protection strategies according to the needs of different scenarios. In the R&D scenario, snapshots with clear version intervals can be created for each important development stage, which is convenient for developers to go back to any version at any time for code debugging and troubleshooting, greatly improving R&D efficiency. In the financial scenario, strict version interval management ensures the accuracy and integrity of financial data at each key node, effectively reduces data risks, and meets the requirements of different business scenarios for data management flexibility.
[0083] In an exemplary embodiment, based on the above embodiment, the embodiment of the present application relates to a process in which the version interval of the target snapshot chain includes the first snapshot version interval; and the version interval of the target snapshot chain is determined according to the version number, including the following steps:
[0084] In the case of the first snapshot, the first snapshot version range is determined based on the minimum data version and version number supported by the distributed storage engine.
[0085] Among them, the first snapshot version interval refers to the data version range determined when the first snapshot operation is performed on a specific target snapshot chain in the multi-snapshot chain mechanism. It determines the protection scope of the initial data state of the snapshot chain and is an important basis for subsequent data version management and capacity statistics. For example, in the financial data management scenario of an enterprise, the first snapshot version interval may cover the data versions from the initial deployment of the system to the first full backup of financial data, clarifying the data state boundary initially protected by the snapshot chain.
[0086] The minimum data version supported by a distributed storage engine refers to a minimum data version identifier defined by a distributed storage engine (such as the lava storage engine in this application) during the data management process. This minimum data version is the most basic data state that the engine can identify and manage, and is usually determined when the storage system is initialized or first run. For example, the lava storage engine may mark the first data version in the initial state as 1, and all subsequent data versions are monotonically increasing on this basis. This minimum data version plays a key benchmark role in determining the first snapshot version interval.
[0087] In the embodiment of the present application, when performing the first snapshot operation, the system first obtains the minimum data version (assuming it is 1) supported by the distributed storage engine (such as the lava storage engine). This minimum data version information can be obtained by querying the configuration parameters of the storage engine, system metadata, or a specific interface provided by the storage engine.
[0088] Then, the system obtains the version number (assuming it is 5) obtained from the distributed storage engine for the current first snapshot operation. According to the pre-set version interval determination rules, the first snapshot version interval is determined to be [1,5]. This means that all data states between the minimum data version 1 of the storage engine and the version 5 obtained by this first snapshot are included in the protection scope of the first snapshot. The system associates this first snapshot version interval with the target snapshot chain and records it in the system so that subsequent data management and operations on the snapshot chain can be based on this accurate version interval. For example, when an enterprise launches a new project and creates a corresponding snapshot chain, the accurate determination of the first snapshot version interval ensures the complete protection of the initial data of the project and provides a reliable data foundation for the subsequent data management and development of the project.
[0089] In the embodiment of the present application, accurately determining the first snapshot version interval provides a solid guarantee for the integrity protection and historical traceability of cloud disk data. In enterprise data management, whether it is long-term data archiving, compliance auditing or business decision analysis, it is necessary to be based on a complete and accurate initial data state. By reasonably determining the first snapshot version interval, it is ensured that all key data from the initial operation of the system or the beginning of the project are effectively protected, avoiding data loss or historical data faults caused by inaccurate first snapshot range. For example, when an enterprise conducts an annual financial audit, the first snapshot version interval can be used to accurately restore the data status of the financial system at the beginning of the launch, providing complete data clues for the audit work, and ensuring the traceability of the data and the accuracy of the audit results.
[0090] In an exemplary embodiment, based on the above embodiment, see Figure 5The embodiment of the present application relates to a target snapshot chain whose version interval includes a non-first snapshot version interval; and a process of determining a target snapshot chain's version interval according to a version number includes the following steps:
[0091] S501: In the case of a non-first snapshot, a target snapshot is added to the end of a target snapshot chain according to chain parameters.
[0092] Among them, the non-first snapshot version interval refers to the data version range determined when performing a non-first snapshot operation on a specific target snapshot chain in the multi-snapshot chain mechanism. It reflects the range of data changes from the last snapshot operation to the current snapshot operation, and is a further refinement of data version management based on the existing snapshot chain. It is of great significance for operations such as incremental backup, version tracing, and recovery point selection of data. For example, in the financial data management of an enterprise, the version interval determined by the snapshot operation after the regular financial report update is the non-first snapshot version interval, which is used to record the changes in this month's financial data relative to the previous month.
[0093] In the embodiment of the present application, when a non-first snapshot operation is performed, the system first obtains the chain parameters of the target snapshot (such as the unique identifier of the snapshot chain, creation time, etc.). These chain parameters are associated with the snapshot when the target snapshot is created and stored in the system.
[0094] According to the snapshot chain identifier in the chain parameters, the system quickly locates the target snapshot chain. Then, the target snapshot is added to the end of the target snapshot chain. This operation ensures the order of snapshots in the snapshot chain and reflects the chronological order of data versions. For example, in the data management of an enterprise's R&D project, each non-first snapshot after a code modification is added to the end of the corresponding R&D project snapshot chain in chronological order, forming an ordered snapshot sequence, which is convenient for the subsequent tracing and management of the code version evolution process.
[0095] S502: Determine a non-first snapshot version interval according to the previous version interval and version number.
[0096] In the embodiment of the present application, the server obtains the last version interval information of the target snapshot chain through the chain parameter (assuming that the last version interval is [3,7]), and then obtains the version number (assuming that it is 10) obtained from the distributed storage engine for the current non-first snapshot operation.
[0097] According to the pre-set version interval determination rule, the non-first snapshot version interval is determined to be (7,10]. This means that the non-first snapshot records the incremental data changes from the last version interval [3,7] (i.e., after version 7) to the current version 10. The system associates this non-first snapshot version interval with the target snapshot and records it in the system so that subsequent data management and operations on the snapshot chain can be based on this accurate version interval. For example, in the sales data management of an enterprise, the non-first snapshot after each sales data update determines the version interval in this way, which can accurately reflect the data changes after each sales business operation and provide accurate data support for sales data analysis and business decision-making.
[0098] The embodiment of the present application determines the non-first snapshot version interval to provide strong support for accurate version management and historical tracing of cloud disk data. In the long-term data management of an enterprise, whether it is code version backtracking during project development, historical analysis of business data, or compliance auditing, it is necessary to rely on accurate non-first snapshot version intervals. By reasonably determining the version interval, the changing trajectory of data at different time points can be clearly presented, ensuring the accuracy of data version management. For example, in a software development project, developers can quickly locate the code version of a specific function development stage based on the non-first snapshot version interval, which facilitates code debugging, troubleshooting, and function optimization, improving development efficiency and project management accuracy.
[0099] In an exemplary embodiment, based on the above embodiment, see Figure 6 The embodiment of the present application is related to determining the cloud disk snapshot capacity corresponding to each application scenario according to the target storage block corresponding to each snapshot chain, including:
[0100] S601: For each snapshot chain, calculate the data capacity of multiple target storage blocks of the snapshot chain.
[0101] In the embodiment of the present application, each target storage block in the target snapshot chain is first traversed. For each target storage block, the size information of the data block stored therein is obtained. This can be achieved by querying the metadata of the storage system or directly obtaining the attribute information of the storage block. For example, in a system based on lava storage, each data block may have corresponding metadata recording its size.
[0102] Then, calculate the data capacity of the target storage block based on the data block size. If there is data compression in the storage block, you need to decompress the data first (if the compression algorithm supports lossless decompression and it has an impact on the capacity calculation), and then calculate the actual storage space occupied. For example, a compressed target storage block has a compressed size of 5MB, but the actual data capacity after decompression may be 10MB. The decompressed size should be used when calculating the data capacity. Record the data capacity calculation results of each target storage block for subsequent calculations. In the enterprise's financial data management scenario, for the target storage block that stores financial statements, account details and other data, accurately calculating its data capacity can truly reflect the storage space occupied by the financial data snapshot.
[0103] S602, adding the data capacities of multiple target storage blocks to obtain the cloud disk snapshot capacity corresponding to each application scenario.
[0104] In the embodiment of the present application, a list of data capacities of all target storage blocks in the target snapshot chain calculated in the previous step is obtained. These data capacities are cumulatively summed to obtain the cloud disk snapshot capacity corresponding to the snapshot chain. For example, in a snapshot chain of a research and development project, there are three target storage blocks, whose data capacities are 3GB, 5GB, and 2GB, respectively. Then the cloud disk snapshot capacity corresponding to the application scenario of the research and development project is 3+5+2=10GB.
[0105] The calculated cloud disk snapshot capacity corresponding to each application scenario is recorded in the system and associated with the corresponding application scenario and snapshot chain information. This helps cloud service providers to manage resources and conduct charging statistics based on the usage of snapshot capacity in different application scenarios, and also facilitates enterprise users to understand their own cloud disk snapshot resource usage in various scenarios. For example, cloud service providers can charge according to the pre-set charging standards based on the snapshot capacity usage of enterprise financial data management scenarios. At the same time, enterprises can also optimize their own data management strategies based on these data and reasonably control the use of cloud disk snapshot capacity.
[0106] Suppose there are 3 snapshot chains 1, 2, and 3. Take 6 snapshots of the cloud disk in turn, namely A, B, E, C, F, and D, and obtain 6 data versions 5, 7, 8, 10, 12, and 16 from the lava storage. Suppose A and B are snapshot operations performed by users of snapshot chain 1. The new solution needs to record the snapshot protection versions as [1, 5] and [6, 7] respectively. Snapshots D and F are executed by users of snapshot chain 2. The snapshot protection versions need to be recorded as [1, 10] and [11, 16] respectively. Snapshots C and E are executed by users of snapshot chain 3. The snapshot protection versions need to be recorded as [1, 8] and [9, 12] respectively. Figure 7As shown, by comparison, it can be seen that the existing technology manages the version returned by the lava engine by appending it according to the version size. The multi-snapshot chain is to append the version management in the chain dimension. In the multi-chain solution, the data version that is not in this chain is not managed or paid attention to. It should be noted that the data protection version recorded by the multi-snapshot chain is only a logical concept of the block layer, which is mainly used for block layer tag understanding and capacity statistics. The lava engine layer still manages data in a single chain. Impact on capacity statistics. In a single-chain snapshot, the snapshot capacity statistics are to count the capacities of the intervals [1,5], [6,7], (7,8], [9,10], [11,12], [13,16] and add them up.
[0107] After the introduction of multiple snapshot chains, the snapshot capacity statistics method is modified as follows: when counting one chain, the capacity of the interval [1,5], (5,7] is counted and summed; when counting two chains, the capacity of the interval [1,10], (10,16] is counted and summed; when counting three chains, the capacity of the interval [1,8], (8,12] is counted and summed.
[0108] The embodiment of the present application accurately calculates the cloud disk snapshot capacity corresponding to each application scenario and provides an accurate resource management basis for the cloud service provider. By understanding the actual snapshot capacity usage of each application scenario, the cloud service provider can reasonably allocate storage resources to avoid resource waste or shortage. For example, for R&D project scenarios with large snapshot capacity requirements, more storage resources can be allocated to meet their frequent data version management needs; and for daily office scenarios with less snapshot capacity usage, resource allocation can be appropriately adjusted to improve overall resource utilization. At the same time, accurate capacity calculation also enables cloud service providers to formulate fair and reasonable charging strategies based on the actual usage of each scenario. Enterprise users can accurately estimate the cost of using cloud disk snapshots according to their own business needs, effectively control cost expenditures, and achieve refined resource management and cost control.
[0109] In an exemplary embodiment, based on the above embodiment, the method of the embodiment of the present application further includes the following steps:
[0110] Step 1: In the target scenario, take a snapshot of the cloud disk to obtain the target snapshot and the chain parameters corresponding to the target snapshot; obtain the version number from the distributed storage engine, and in the case of the first snapshot, determine the first snapshot version range based on the minimum data version and version number supported by the distributed storage engine; in the case of a non-first snapshot, add the target snapshot to the end of the target snapshot chain based on the chain parameters;
[0111] Step 2: In response to the trigger instruction, determine the version interval corresponding to the snapshot chain of each application scenario; and determine the target storage block corresponding to each snapshot chain according to the version interval of each snapshot chain;
[0112] Step 3: For each snapshot chain, calculate the data capacity of multiple target storage blocks of the snapshot chain; add the data capacity of multiple target storage blocks to obtain the cloud disk snapshot capacity corresponding to each application scenario.
[0113] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0114] Based on the same inventive concept, the embodiment of the present application also provides a cloud disk snapshot capacity determination device for implementing the cloud disk snapshot capacity determination method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more cloud disk snapshot capacity determination device embodiments provided below can refer to the limitations of the cloud disk snapshot capacity determination method above, and will not be repeated here.
[0115] In one embodiment, Figure 8 As shown, a cloud disk snapshot capacity determination device 700 is provided, comprising:
[0116] The storage block determination module 701 is used to determine the target storage block corresponding to the snapshot chain of each application scenario in response to the trigger instruction;
[0117] The capacity determination module 702 is used to determine the cloud disk snapshot capacity corresponding to each application scenario according to the target storage block corresponding to each snapshot chain.
[0118] In one embodiment, the storage block determination module 701 includes:
[0119] An interval determination unit, used to determine the version interval corresponding to the snapshot chain of each application scenario;
[0120] The storage block determination unit is used to determine the target storage block corresponding to each snapshot chain according to the version interval of each snapshot chain.
[0121] In one embodiment, the above device further comprises:
[0122] The snapshot module is used to process the cloud disk snapshot in the target scenario to obtain the target snapshot and the chain parameters corresponding to the target snapshot; the chain parameters represent the target snapshot chain to which the target snapshot belongs;
[0123] The interval determination module is used to obtain the version number from the distributed storage engine and determine the version interval of the target snapshot chain according to the version number.
[0124] In one embodiment, the version interval of the target snapshot chain includes the first snapshot version interval; and the interval determination module includes:
[0125] The first interval determination unit is used to determine the first snapshot version interval according to the minimum data version and version number supported by the distributed storage engine in the case of the first snapshot.
[0126] In one embodiment, the version interval of the target snapshot chain includes a non-first snapshot version interval; and the interval determination module includes:
[0127] A snapshot adding unit, used for adding a target snapshot to the end of the target snapshot chain according to chain parameters when it is not the first snapshot;
[0128] The non-first interval determination unit is used to determine the non-first snapshot version interval according to the previous version interval and version number.
[0129] In one embodiment, the capacity determination module includes:
[0130] A capacity calculation unit, used for calculating the data capacity of multiple target storage blocks of each snapshot chain;
[0131] The capacity determination unit is used to add the data capacities of multiple target storage blocks to obtain the cloud disk snapshot capacity corresponding to each application scenario.
[0132] Each module in the above-mentioned cloud disk snapshot capacity device can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0133] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig. 9As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a cloud disk snapshot capacity method is implemented.
[0134] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0135] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0136] In response to the trigger instruction, determine the target storage block corresponding to the snapshot chain of each application scenario;
[0137] According to the target storage blocks corresponding to each snapshot chain, the cloud disk snapshot capacity corresponding to each application scenario is determined.
[0138] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0139] Determine the version range corresponding to the snapshot chain of each application scenario;
[0140] According to the version range of each snapshot chain, the target storage block corresponding to each snapshot chain is determined.
[0141] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0142] In the target scenario, the cloud disk is snapshotted to obtain the target snapshot and the chain parameters corresponding to the target snapshot; the chain parameters represent the target snapshot chain to which the target snapshot belongs;
[0143] Get the version number from the distributed storage engine and determine the version range of the target snapshot chain based on the version number.
[0144] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0145] In the case of the first snapshot, the first snapshot version range is determined based on the minimum data version and version number supported by the distributed storage engine.
[0146] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0147] If it is not the first snapshot, the target snapshot is added to the end of the target snapshot chain according to the chain parameters;
[0148] Determine the non-first snapshot version interval based on the previous version interval and version number.
[0149] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0150] For each snapshot chain, calculate the data capacity of multiple target storage blocks of the snapshot chain;
[0151] The data capacities of multiple target storage blocks are added together to obtain the cloud disk snapshot capacity corresponding to each application scenario.
[0152] According to some embodiments of the present application, a computer program product is also provided, and when the computer program is executed by a processor, the above method can be implemented. The computer program product includes one or more computer instructions. When these computer instructions are loaded and executed on a computer, part or all of the above method can be implemented in whole or in part according to the process or function described in the embodiment of the present application.
[0153] According to some embodiments of the present application, there is also provided a non-transitory computer-readable storage medium including instructions, such as a memory including instructions, and the above instructions can be executed by a processor of an electronic device to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0154] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0155] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0156] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0157] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for determining the capacity of a cloud disk snapshot, characterized in that: The method comprises: In response to the trigger instruction, determine the target storage block corresponding to the snapshot chain of each application scenario; The cloud disk snapshot capacity corresponding to each application scenario is determined according to the target storage block corresponding to each snapshot chain.
2. The method according to claim 1, characterized in that The step of determining the target storage block corresponding to the snapshot chain of each application scenario includes: Determine the version range corresponding to the snapshot chain of each application scenario; According to the version interval of each snapshot chain, a target storage block corresponding to each snapshot chain is determined.
3. The method according to claim 2, characterized in that The method further comprises: In the target scenario, snapshot processing is performed on the cloud disk to obtain a target snapshot and a chain parameter corresponding to the target snapshot; the chain parameter represents the target snapshot chain to which the target snapshot belongs; A version number is obtained from a distributed storage engine, and a version range of the target snapshot chain is determined according to the version number.
4. The method according to claim 3, characterized in that The version interval of the target snapshot chain includes the first snapshot version interval; and determining the version interval of the target snapshot chain according to the version number includes: In the case of the first snapshot, the first snapshot version interval is determined according to the minimum data version supported by the distributed storage engine and the version number.
5. The method according to claim 3, characterized in that: The version range of the target snapshot chain includes a non-first snapshot version range; and determining the version range of the target snapshot chain according to the version number includes: In the case of a non-first snapshot, adding the target snapshot to the end of the target snapshot chain according to the chain parameters; The non-first snapshot version interval is determined according to the previous version interval and the version number.
6. The method according to any one of claims 1 to 5, characterized in that: Determining the cloud disk snapshot capacity corresponding to each application scenario according to the target storage block corresponding to each snapshot chain includes: For each of the snapshot chains, calculating the data capacity of multiple target storage blocks of the snapshot chain; The data capacities of the multiple target storage blocks are added together to obtain the cloud disk snapshot capacity corresponding to each of the application scenarios.
7. A cloud disk snapshot capacity determination device, characterized in that: The device comprises: A storage block determination module, used to determine a target storage block corresponding to the snapshot chain of each application scenario in response to a trigger instruction; The capacity determination module is used to determine the cloud disk snapshot capacity corresponding to each of the application scenarios according to the target storage blocks corresponding to each of the snapshot chains.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Data backup method and device, electronic equipment and storage medium
CN120909850A
Resource scheduling method, distributed storage system, electronic device and storage medium
WO2026200037A1