A distributed storage adjustment method, device, apparatus and storage medium
By dynamically adjusting the number of snapshot copies, the performance bottleneck in the snapshot process is resolved, the snapshot reading capability is improved, and intelligent adjustment based on actual needs is achieved.
Patent Information
- Application Number
- CN202110641597.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-09
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2041-06-09
AI Technical Summary
In existing technologies, the number of snapshot copies cannot be dynamically adjusted, causing the snapshot process to become a performance bottleneck.
By determining the historical read pressure of the snapshot to be processed, predicting the current read pressure based on the historical read pressure, and dynamically adjusting the number of replicas according to the current read pressure, a target number of replicas corresponding to the snapshot to be processed are created.
It enables intelligent adjustment of the number of snapshot copies based on actual needs, improves the snapshot reading capability, and solves the problem that the number of snapshot copies cannot be dynamically adjusted.
Smart Images

Figure CN115454927B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of distributed technology, and particularly relates to a distributed storage adjustment method and device, equipment and a storage medium. BACKGROUND
[0002] With the advent of the cloud computing era, various cloud computing solutions have emerged in an endless stream. Among them, the distributed storage system is the most important part of the cloud computing system because it carries the data business of the entire system, and a small problem in the distributed system can have an unpredictable impact on the entire cloud computing system. The snapshot technology provides the storage system with online backup, data recovery, data reuse and other capabilities, and is an indispensable part of the distributed block storage system. At present, most cloud storage systems generate a fixed number of, for example, three copies through snapshot technology. Among them, the fixed number of copies can all respond to read requests sent by users.
[0003] However, in the above scheme, the number of snapshot copies cannot be dynamically adjusted, which causes the snapshot process to easily become a performance bottleneck.
[0004] SUMMARY
[0005] To solve the above technical problems, the present application expects to provide a distributed storage adjustment method, device, equipment and storage medium, which solves the problem that the number of snapshot copies cannot be dynamically adjusted at present, proposes a technical solution for dynamically adjusting the number of copies, effectively enriches the method for dynamically adjusting the number of snapshot copies, intelligently adjusts the number of snapshot copies according to actual needs, and effectively guarantees the reading ability of snapshots.
[0006] The technical solution of the present application is implemented as follows:
[0007] In a first aspect, a distributed storage adjustment method is provided, and the method comprises the following steps:
[0008] determining the historical reading pressure of a to-be-processed snapshot;
[0009] determining the current reading pressure based on the historical reading pressure;
[0010] determining the number of copies of the to-be-processed snapshot based on the current reading pressure;
[0011] creating target copies corresponding to the to-be-processed snapshot in the number of copies.
[0012] Optionally, the step of determining the historical reading pressure of a to-be-processed snapshot comprises the following steps:
[0013] determining a preset sampling number;
[0014] Based on the sampling time relationship from near to far, the historical sampling values obtained by sampling the read requests for the snapshot to be processed before the current sampling point are determined according to the preset number of sampling points, and the preset number of historical sampling values are obtained; wherein, the historical read pressure includes the preset number of historical sampling values.
[0015] Optionally, determining the current read pressure based on the historical read pressure includes:
[0016] Based on the aforementioned sampling time relationship, determine the preset number of weight values;
[0017] The current reading pressure is obtained based on the preset number of weight values and the preset number of historical sample values.
[0018] Optionally, obtaining the current reading pressure based on the preset number of weight values and the preset number of historical sample values includes:
[0019] Determine the product of each weight value and the corresponding historical sample value to obtain the preset number of first product values;
[0020] The current reading pressure is obtained by determining the sum of the preset number of first product values.
[0021] Optionally, determining the number of replicas of the snapshot to be processed based on the current read pressure includes:
[0022] Determine the target regression coefficients and target bias parameters;
[0023] The number of replicas is determined based on the target regression coefficient, the target bias parameter, and the current read pressure.
[0024] Optionally, determining the number of replicas of the snapshot to be processed based on the target regression coefficient, the target bias parameter, and the current read pressure includes:
[0025] Determine the second product value of the target regression coefficient and the current reading pressure;
[0026] Determine the sum between the second product value and the target bias parameter to obtain a reference value;
[0027] The reference value is rounded down to obtain the target value;
[0028] The number of replicas is determined based on the target value.
[0029] Optionally, determining the number of replicas based on the target value includes:
[0030] Determine the minimum and maximum allowed number of replicas;
[0031] The number of replicas is determined based on the target value, the minimum allowed number of replicas, and the maximum allowed number of replicas.
[0032] Optionally, determining the number of replicas based on the target value, the minimum allowed number of replicas, and the maximum allowed number of replicas includes:
[0033] If the target value is less than or equal to the minimum allowed number of replicas, then the number of replicas is determined to be the minimum allowed number of replicas.
[0034] If the target value is greater than the minimum allowed number of replicas, and the target value is less than or equal to the maximum allowed number of replicas, then the number of replicas is determined to be the target value.
[0035] If the target value is greater than the maximum allowed number of replicas, then the number of replicas is determined to be the maximum allowed number of replicas.
[0036] Secondly, a distributed storage adjustment device, the device comprising: a determining unit and a creating unit; wherein:
[0037] The determining unit is used to determine the historical read pressure of the snapshot to be processed;
[0038] The determining unit is further configured to determine the current read pressure based on the historical read pressure;
[0039] The determining unit is further configured to determine the number of copies of the snapshot to be processed based on the current read pressure;
[0040] The creation unit is used to create the number of target copies corresponding to the number of snapshots to be processed.
[0041] Thirdly, a distributed storage adjustment device, the device comprising a memory, a processor, and a communication bus; wherein:
[0042] The memory is used to store executable instructions;
[0043] The communication bus is used to realize the communication connection between the processor and the memory;
[0044] The processor is configured to execute a distributed storage adjustment program stored in the memory to implement the steps of the distributed storage adjustment method as described in any of the preceding claims.
[0045] Fourthly, a storage medium storing a distributed storage adjustment program, which, when executed by a processor, implements the steps of the distributed storage adjustment method as described in any of the preceding claims.
[0046] This application provides a distributed storage adjustment method, apparatus, device, and storage medium. It determines the historical read pressure of a snapshot to be processed, and based on this historical read pressure, determines the current read pressure. Then, based on the current read pressure, it determines the number of replicas of the snapshot to be processed, and finally creates a target replica corresponding to the specified number of snapshots to be processed. This method predicts the current read pressure using the historical read pressure of the snapshot to be processed, and then determines the number of replicas corresponding to the snapshot to be processed based on the predicted current read pressure, creating a target replica corresponding to the specified number of snapshots. This solves the current problem of not being able to dynamically adjust the number of snapshot replicas, and proposes a technical solution for dynamically adjusting the number of replicas. It effectively enriches the methods for dynamically adjusting the number of snapshot replicas, realizes intelligent adjustment of the number of snapshot replicas according to actual needs, and effectively ensures the read capability of snapshots. Attached Figure Description
[0047] Figure 1 A flowchart illustrating the distributed storage adjustment method provided in this application embodiment. Figure 1 ;
[0048] Figure 2 A flowchart illustrating the distributed storage adjustment method provided in this application embodiment. Figure 2 ;
[0049] Figure 3 A flowchart illustrating the distributed storage adjustment method provided in this application embodiment. Figure 3 ;
[0050] Figure 4 A flowchart illustrating the distributed storage adjustment method provided in this application embodiment. Figure 4 ;
[0051] Figure 5 This is a schematic diagram of the structure of a distributed storage adjustment device provided in an embodiment of this application;
[0052] Figure 6 This is a schematic diagram of the structure of a distributed storage adjustment device provided in an embodiment of this application. Detailed Implementation
[0053] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0054] Embodiments of this application provide a distributed storage adjustment method, referring to... Figure 1As shown, the method is applied to a distributed storage adjustment device, and the method includes the following steps:
[0055] Step 101: Determine the historical read pressure of the snapshot to be processed.
[0056] In this embodiment, the snapshot to be processed is snapshot data in a distributed storage system, which has read-only characteristics. The corresponding distributed storage adjustment device can be a distributed server providing distributed storage services in the distributed storage system. The historical read pressure of the snapshot to be processed can be represented by the number of historical read accesses by users to the snapshot to be processed, i.e., the frequency of historical read requests to the snapshot to be processed.
[0057] Step 102: Determine the current read pressure based on historical read pressure.
[0058] In this embodiment of the application, since the number of accesses to a snapshot has a certain time periodic pattern, the historical read pressure can be analyzed to predict the current read pressure at the current moment.
[0059] Step 103: Determine the number of copies of the snapshot to be processed based on the current read pressure.
[0060] In this embodiment of the application, the current read pressure is analyzed to determine the number of copies of the snapshot to be processed corresponding to the current sampling point for the current read pressure.
[0061] Step 104: Create the target replicas corresponding to the number of snapshots to be processed.
[0062] In this embodiment of the application, a certain number of target replicas are created for the snapshot to be processed. Since the number of replicas is related to the current read pressure on the snapshot to be processed, users can improve the read performance of the snapshot to be processed and improve the service performance of the business system by accessing the target number of replicas.
[0063] This application provides a distributed storage adjustment method that determines the historical read pressure of a snapshot to be processed, determines the current read pressure based on the historical read pressure, determines the number of replicas of the snapshot to be processed based on the current read pressure, and finally creates a target replica corresponding to the snapshot to be processed. In this way, the current read pressure is predicted by using the historical read pressure of the snapshot to be processed, and the number of replicas corresponding to the snapshot to be processed is determined based on the predicted current read pressure, and a target replica corresponding to the snapshot to be processed is created. This solves the problem that the number of snapshot replicas cannot be dynamically adjusted, and proposes a technical solution for dynamically adjusting the number of replicas, effectively enriching the methods for dynamically adjusting the number of snapshot replicas, realizing intelligent adjustment of the number of snapshot replicas according to actual needs, and effectively ensuring the read capability of snapshots.
[0064] Based on the foregoing embodiments, embodiments of this application provide a distributed storage adjustment method, referring to... Figure 2 As shown, the method is applied to a distributed storage adjustment device, and the method includes the following steps:
[0065] Step 201: Determine the preset sampling quantity.
[0066] In this embodiment of the application, the preset sampling quantity can be an empirical value obtained from a large number of experiments, or it can be a value set by the user according to actual needs.
[0067] Step 202: Based on the sampling time relationship from near to far, determine the preset number of historical sampling values obtained by sampling the read requests for the snapshot to be processed before the current sampling point, and obtain the preset number of historical sampling values.
[0068] Historical read pressure includes a preset number of historical sample values. Historical read pressure can be the frequency of read requests for the snapshot to be processed.
[0069] In this embodiment, the current sampling point can be the current sampling period or the current sampling time point. A preset number of historical sampling values prior to the current sampling point are determined. For example, if the current sampling point is denoted as n+1 and the corresponding preset sampling number is 100, and R represents the sampling value, the corresponding preset number of historical sampling values are arranged according to their sampling time from closest to furthest from the current sampling point. This preset number of historical sampling values can be denoted as R. n R n-1 R n-2 , ..., R n-99 .
[0070] Step 203: Determine the current read pressure based on historical read pressure.
[0071] In this embodiment of the application, the historical read pressure R of the snapshot to be processed is... n R n-1 R n-2 , ..., R n-99 Analysis was performed to determine the current read pressure R for the snapshot to be processed. n+1 .
[0072] Step 204: Determine the number of copies of the snapshot to be processed based on the current read pressure.
[0073] In this embodiment of the application, the current read pressure R n+1 The analysis determines the number of copies of the snapshot to be processed at the current sampling point.
[0074] Step 205: Create the target replicas corresponding to the number of snapshots to be processed.
[0075] In this embodiment of the application, when the current sampling point is the sampling period, the snapshot to be processed is copied within the sampling period to obtain the corresponding number of target copies.
[0076] Based on the foregoing embodiments, in other embodiments of this application, reference is made to... Figure 3 As shown, step 203 can be implemented by steps 203a~203b:
[0077] Step 203a: Determine the preset number of sampling weight values according to the sampling time relationship.
[0078] In this embodiment of the application, the preset number of sampling weight values are determined by using a certain sampling weight coefficient method:
[0079] Preferably, it is determined using an exponential formula related to the preset number of samples;
[0080] Preferably, the preset empirical values are corresponding to a preset number of weight values, and the sum of the preset number of weight values is 1.
[0081] Among the preset number of weight values, the weight values gradually decrease according to the time relationship between the current sampling point and the time corresponding to the sampling point. This effectively reduces the influence of historical sampling values from a long time ago on the current sampling point.
[0082] For example, according to the time relationship from near to far, the corresponding preset number of sampling weight values can be denoted as: τ n , τ n-1 , τ n-2 , ..., τ n-99,in, τ n With R n correspond, τ n-1 With R n-1 correspond,……, τ n-99 With R n-99 correspond.
[0083] Step 203b: Based on the preset number of weight values and the preset number of historical sample values, obtain the current reading pressure.
[0084] In this embodiment, the current reading pressure is determined by analyzing a preset number of weight values and a preset number of historical sample values.
[0085] Based on the foregoing embodiments, in other embodiments of this application, step 203b can be implemented by steps a11~a12:
[0086] Step a11: Determine the product of each weight value and the corresponding historical sample value to obtain a preset number of first product values.
[0087] In this embodiment of the application, the preset number of first product values can be denoted as: τ n *R n , τ n-1 *R n-1 ... τ n-99 *R n-99 .
[0088] Step a12: Determine the sum of the preset number of first product values to obtain the current reading pressure.
[0089] In this embodiment of the application, the current read pressure R n+1 = τ n *R n + τ n-1 *R n-1 +……+ τ n-99 *R n-99 .
[0090] Based on the foregoing embodiments, in other embodiments of this application, reference is made to... Figure 4 As shown, step 204 can be implemented by steps 204a~204b:
[0091] Step 204a: Determine the target regression coefficients and target bias parameters.
[0092] In this embodiment, the target regression coefficient can be denoted as k, and the target bias parameter can be denoted as b. The target regression coefficient and target bias parameter are empirical values obtained through extensive prior analysis. The process of determining the target regression coefficient and target bias parameter can be as follows: obtain a certain number of historical actual replicas and the corresponding historical actual read pressure corresponding to the snapshot to be processed; wherein the number of historical actual replicas is greater than the minimum allowed replica number and less than or equal to the maximum allowed replica number; perform regression parameter fitting on a certain number of historical actual replicas and the corresponding historical actual read pressure to obtain the target regression coefficient and target bias parameter. As the sample size increases, the target regression coefficient and target bias parameter can be changed accordingly, achieving continuous correction.
[0093] Step 204b: Determine the number of replicas based on the target regression coefficient, target bias parameter, and current read pressure.
[0094] In this embodiment, the target regression coefficient, target bias parameter, and current read pressure are used to perform calculations and analyses to determine the number of copies.
[0095] Based on the foregoing embodiments, in other embodiments of this application, step 204b can be implemented by steps b11 to b14:
[0096] Step b11: Determine the second product of the target regression coefficient and the current reading pressure.
[0097] In this embodiment of the application, the second product value = k*R n+1 .
[0098] Step b12: Determine the sum between the second product value and the target bias parameter to obtain a reference value.
[0099] In this embodiment of the application, the reference value = k*R n+1 +b.
[0100] Step b13: Round the reference value to obtain the target value.
[0101] In this embodiment, the rounding process can be either rounding up or rounding down. The specific rounding method can be determined according to the actual situation, and no limitation is made here.
[0102] Step b14: Determine the number of replicas based on the target value.
[0103] In this embodiment of the application, the target value is analyzed to determine the number of copies.
[0104] Based on the foregoing embodiments, in other embodiments of this application, step b14 can be implemented by steps b141~b142:
[0105] Step b141: Determine the minimum and maximum allowed number of replicas.
[0106] In this embodiment, the minimum and maximum allowed number of replicas are empirical values derived from extensive experience and can be determined based on actual circumstances. The minimum allowed number of replicas is typically set to 3, while the maximum allowed number of replicas is usually determined based on the performance of the distributed storage adjustment device; no restrictions are imposed here.
[0107] Step b142: Determine the number of replicas based on the target value, the minimum allowed number of replicas, and the maximum allowed number of replicas.
[0108] In this embodiment of the application, the corresponding number of replicas is determined based on the relationship between the target value and the minimum and maximum allowed number of replicas.
[0109] Based on the foregoing embodiments, in other embodiments of this application, step b142 can be implemented by steps c11-c13:
[0110] Step c11: If the target value is less than or equal to the minimum allowed number of replicas, determine the number of replicas as the minimum allowed number of replicas.
[0111] Step c12: If the target value is greater than the minimum allowed number of replicas and the target value is less than or equal to the maximum allowed number of replicas, determine the number of replicas as the target value.
[0112] Step c13: If the target value is greater than the maximum allowed number of replicas, determine the number of replicas as the maximum allowed number of replicas.
[0113] Based on the foregoing embodiments, distributed storage typically supports tiered storage. Tiered snapshots allow the creation of multiple clones for a single device based on a single snapshot. When creating clone volumes, a snapshot is usually taken first, stored, and then any number of clone volumes are created based on the snapshot. Snapshots are read-only, while clones are read-write. The advantage of supporting clone volumes is that users can quickly clone a large amount of required content from a single clone volume. Since the read performance of a snapshot is positively correlated with the number of its replicas, the distributed storage adjustment method provided in this application dynamically adjusts the number of snapshot replicas by considering the current read pressure of the snapshot, thereby improving the read performance of the parent snapshot and mitigating the performance impact of hot data bottlenecks on the business system. The specific implementation steps of a distributed storage adjustment method provided in this application can be as follows:
[0114] Step 1: Determine the historical read pressure corresponding to the snapshot to be processed within the n periods prior to the current sampling period, denoted as R. nR n-1 R n-2 , ..., R1.
[0115] Among them, R n The corresponding sampling period is the previous period adjacent to the current sampling period, and the sampling period corresponding to R1 is the farthest from the current sampling period.
[0116] Step 2: Determine the weight value corresponding to each of the n periods, and denot it as follows: τ n , τ n-1 , τ n-2 , ..., τ 1.
[0117] in, τ n The corresponding sampling period is the period immediately preceding the current sampling period. τ n With R n correspond; τ The sampling period corresponding to 1 is the furthest from the current sampling period. τ 1 corresponds to R1. τ n + τ n-1 + τ n-2 +……+ τ 1 = 1. For example, when n = 3, the corresponding... τ 3 = 1 / 2 τ 2 = 1 / 4 τ 1 = 1 / 4. The role of τ is to balance the weights of the current sampling period and historical sampling periods on the current read pressure. When setting the weights, following the principle of locality of reference in data access, the value should be set such that the read pressure of historical sampling periods closer to the current sampling period has a greater impact on the current read pressure, i.e., the closer the value of τ is to 1; conversely, the read pressure of older historical sampling periods has a smaller impact on the current read pressure, i.e., the closer the value of τ is to 0.
[0118] Step 3, using formula R n+1 = τ n *R n + τ n-1 *R n-1 The current reading pressure R corresponding to the current sampling period is calculated by adding ... +τ1*R1. n+1 .
[0119] Step 4: Determine the number of copies N of the snapshot to be processed within the current sampling period using the following formula.
[0120]
[0121] In the formula, τ1 +τ2 + … + τi-2 +τi-1 = 1, and τ1<τ2<…<τi-2<τi-1, and [] is the integer symbol.
[0122] Where k is a known regression coefficient, b is a known bias parameter, and both k and b are non-zero constants. m is the minimum allowed number of replicas, with a minimum value of 3, and M is the maximum allowed number of replicas. In some application scenarios, k and b are determined as follows: obtain the historical actual read pressure R corresponding to the condition m < N ≤ M when the number of replicas N satisfies the condition. Then, based on the known N and R, perform linear regression fitting on the formula N = k * R + b to obtain k and b.
[0123] Step 5: For the current sampling period, create N target replicas for the snapshot to be processed.
[0124] By providing services to users corresponding to the snapshots to be processed through N target replicas, the read performance of the snapshots to be processed is effectively improved.
[0125] It should be noted that the descriptions of the same steps and contents as in other embodiments in this embodiment can be found in the descriptions in other embodiments, and will not be repeated here.
[0126] This application provides a distributed storage adjustment method that determines the historical read pressure of a snapshot to be processed, determines the current read pressure based on the historical read pressure, determines the number of replicas of the snapshot to be processed based on the current read pressure, and finally creates a target replica corresponding to the snapshot to be processed. In this way, the current read pressure is predicted by using the historical read pressure of the snapshot to be processed, and the number of replicas corresponding to the snapshot to be processed is determined based on the predicted current read pressure, and a target replica corresponding to the snapshot to be processed is created. This solves the problem that the number of snapshot replicas cannot be dynamically adjusted, and proposes a technical solution for dynamically adjusting the number of replicas, effectively enriching the methods for dynamically adjusting the number of snapshot replicas, realizing intelligent adjustment of the number of snapshot replicas according to actual needs, and effectively ensuring the read capability of snapshots.
[0127] Based on the foregoing embodiments, embodiments of this application provide a distributed storage adjustment device, which can be applied to... Figures 1 to 4 In the distributed storage adjustment method provided in the corresponding embodiment, refer to Figure 5As shown, the distributed storage adjustment device 3 may include: a determining unit 31 and a creating unit 32, wherein:
[0128] Determining unit 31 is used to determine the historical read pressure of the snapshot to be processed;
[0129] The determining unit 31 is also used to determine the current read pressure based on the historical read pressure;
[0130] The determining unit 31 is also used to determine the number of copies of the snapshot to be processed based on the current read pressure;
[0131] Create unit 32, which is used to create the target replicas corresponding to the number of snapshots to be processed.
[0132] In other embodiments of this application, when the determining unit is used to implement the step of determining the historical read pressure of the snapshot to be processed, it can be specifically implemented through the following steps:
[0133] Determine the preset sampling quantity;
[0134] Based on the sampling time relationship from near to far, a preset number of historical sampling values are obtained by sampling the read requests for the snapshot to be processed before the current sampling point, resulting in a preset number of historical sampling values; wherein, the historical read pressure includes the preset number of historical sampling values.
[0135] In other embodiments of this application, when the determining unit is used to determine the current read pressure based on historical read pressure, it can be implemented through the following steps:
[0136] Based on the sampling time relationship, determine the preset number of weight values for sampling;
[0137] The current reading pressure is obtained based on a preset number of weight values and a preset number of historical sample values.
[0138] In other embodiments of this application, when the determining unit is used to obtain the current reading pressure based on a preset number of weight values and a preset number of historical sample values, it can be implemented through the following steps:
[0139] Determine the product of each weight value and its corresponding historical sample value to obtain a preset number of first product values;
[0140] The current reading pressure is obtained by determining the sum of the first product values of the preset number of samples.
[0141] In other embodiments of this application, when the determining unit is used to implement the step of determining the number of copies of the snapshot to be processed based on the current read pressure, it can be implemented through the following steps:
[0142] Determine the target regression coefficients and target bias parameters;
[0143] The number of replicas is determined based on the target regression coefficient, target bias parameter, and current read pressure.
[0144] In other embodiments of this application, when the determining unit is used to determine the number of copies of the snapshot to be processed based on the target regression coefficient, the target bias parameter, and the current read pressure, it can be implemented through the following steps:
[0145] Determine the second product of the target regression coefficient and the current reading pressure;
[0146] Determine the sum between the second product value and the target bias parameter to obtain a reference value;
[0147] The reference value is rounded to obtain the target value.
[0148] The number of replicas is determined based on the target value.
[0149] In other embodiments of this application, when the determining unit is used to implement the step of determining the number of copies based on a target value, it can be implemented through the following steps:
[0150] Determine the minimum and maximum allowed number of replicas;
[0151] The number of replicas is determined based on the target value, the minimum allowed number of replicas, and the maximum allowed number of replicas.
[0152] In other embodiments of this application, the determining unit is used to implement the steps based on the target value, the minimum allowed number of replicas, and the maximum allowed number of replicas. Specifically, the determination of the number of replicas can be achieved through the following steps:
[0153] If the target value is less than or equal to the minimum allowed number of replicas, the number of replicas is determined to be the minimum allowed number of replicas;
[0154] If the target value is greater than the minimum allowed number of replicas, and the target value is less than or equal to the maximum allowed number of replicas, then the number of replicas is determined as the target value.
[0155] If the target value is greater than the maximum allowed number of replicas, the number of replicas is set to the maximum allowed number of replicas.
[0156] It should be noted that the specific implementation process of the steps performed by the distributed storage adjustment device in this embodiment can be referred to... Figures 1 to 4 The implementation process of the distributed storage adjustment method provided in the corresponding embodiment will not be described in detail here.
[0157] This application provides a distributed storage adjustment device that determines the historical read pressure of a snapshot to be processed, determines the current read pressure based on the historical read pressure, determines the number of replicas of the snapshot to be processed based on the current read pressure, and finally creates a target replica corresponding to the snapshot to be processed. In this way, the current read pressure is predicted based on the historical read pressure of the snapshot to be processed, and the number of replicas corresponding to the snapshot to be processed is determined based on the predicted current read pressure, and a target replica corresponding to the snapshot to be processed is created. This solves the problem that the number of snapshot replicas cannot be dynamically adjusted, and proposes a technical solution for dynamically adjusting the number of replicas, effectively enriching the methods for dynamically adjusting the number of snapshot replicas, realizing intelligent adjustment of the number of snapshot replicas according to actual needs, and effectively ensuring the read capability of snapshots.
[0158] Based on the foregoing embodiments, embodiments of this application provide a distributed storage adjustment device, which can be applied to... Figures 1 to 4 In the distributed storage adjustment method provided in the corresponding embodiment, refer to Figure 6 As shown, the distributed storage adjustment device 4 may include: a processor 41, a memory 42, and a communication bus 43, wherein:
[0159] Communication bus 43 is used to realize the communication connection between processor 41 and memory 42;
[0160] Processor 41 is used to execute the distributed storage adjustment program stored in memory 42 to achieve Figures 1 to 4 The implementation process of the distributed storage adjustment method provided in the corresponding embodiment will not be described in detail here.
[0161] Based on the foregoing embodiments, embodiments of this application provide a computer-readable storage medium, simply referred to as a storage medium, which stores one or more programs that can be executed by one or more processors to implement the reference. Figures 1 to 4 The implementation process of the distributed storage adjustment method provided in the corresponding embodiment will not be described in detail here.
[0162] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.
[0163] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0164] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0165] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0166] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application.
Claims
1. A distributed storage adjustment method, characterized in that, The method includes: Determine the historical read pressure of the snapshot to be processed; Based on the historical read pressure, determine the current read pressure; Based on the current read pressure, determine the number of copies of the snapshot to be processed; Create the specified number of target replicas corresponding to the snapshots to be processed; The step of determining the number of replicas of the snapshot to be processed based on the current read pressure includes: Determine the target regression coefficients and target bias parameters; The number of replicas is determined based on the target regression coefficient, the target bias parameter, and the current read pressure.
2. The method according to claim 1, characterized in that, The determination of the historical read pressure of the snapshot to be processed includes: Determine the preset sampling quantity; Based on the sampling time relationship from near to far, the historical sampling values obtained by sampling the read requests for the snapshot to be processed before the current sampling point are determined according to the preset number of sampling points, and the preset number of historical sampling values are obtained; wherein, the historical read pressure includes the preset number of historical sampling values.
3. The method according to claim 2, characterized in that, Determining the current read pressure based on the historical read pressure includes: Based on the aforementioned sampling time relationship, determine the preset number of weight values; The current reading pressure is obtained based on the preset number of weight values and the preset number of historical sample values.
4. The method according to claim 3, characterized in that, The process of obtaining the current reading pressure based on the preset number of weight values and the preset number of historical sample values includes: Determine the product of each weight value and the corresponding historical sample value to obtain the preset number of first product values; The current reading pressure is obtained by determining the sum of the preset number of first product values.
5. The method according to claim 1, characterized in that, Determining the number of replicas of the snapshot to be processed based on the target regression coefficient, the target bias parameter, and the current read pressure includes: Determine the second product value of the target regression coefficient and the current reading pressure; Determine the sum between the second product value and the target bias parameter to obtain a reference value; The reference value is rounded down to obtain the target value; The number of replicas is determined based on the target value.
6. The method according to claim 5, characterized in that, Determining the number of replicas based on the target value includes: Determine the minimum and maximum allowed number of replicas; The number of replicas is determined based on the target value, the minimum allowed number of replicas, and the maximum allowed number of replicas.
7. The method according to claim 6, characterized in that, Determining the number of replicas based on the target value, the minimum allowed number of replicas, and the maximum allowed number of replicas includes: If the target value is less than or equal to the minimum allowed number of replicas, then the number of replicas is determined to be the minimum allowed number of replicas. If the target value is greater than the minimum allowed number of replicas, and the target value is less than or equal to the maximum allowed number of replicas, then the number of replicas is determined to be the target value. If the target value is greater than the maximum allowed number of replicas, then the number of replicas is determined to be the maximum allowed number of replicas.
8. A distributed storage adjustment device, characterized in that, The apparatus includes: a determining unit and a creating unit; wherein: The determining unit is used to determine the historical read pressure of the snapshot to be processed; The determining unit is further configured to determine the current read pressure based on the historical read pressure; The determining unit is further configured to determine the number of copies of the snapshot to be processed based on the current read pressure; The creation unit is used to create the number of target copies corresponding to the number of snapshots to be processed; When the determining unit performs the step of determining the number of copies of the snapshot to be processed based on the current read pressure, it can be achieved through the following steps: Determine the target regression coefficients and target bias parameters; The number of replicas is determined based on the target regression coefficient, the target bias parameter, and the current read pressure.
9. A distributed storage adjustment device, characterized in that, The device includes a memory, a processor, and a communication bus; wherein: The memory is used to store executable instructions; The communication bus is used to realize the communication connection between the processor and the memory; The processor is configured to execute the distributed storage adjustment program stored in the memory, and implement the steps of the distributed storage adjustment method as described in any one of claims 1 to 7.
10. A storage medium, characterized in that, The storage medium stores a distributed storage adjustment program, which, when executed by a processor, implements the steps of the distributed storage adjustment method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Big data access method and system based on artificial intelligence
CN112363992A
Data access method based on distributed cloud storage system
CN112491831A