A data backup and recovery method and system based on cloud computing
By allocating data backup locations based on file characteristics and local server conditions, the cloud computing backup and recovery process is optimized, solving the problems of slow cloud computing backup recovery speed and insufficient technical support, achieving automated backup and rapid recovery, and reducing costs and business interruptions. risk.
Patent Information
- Application Number
- CN202410685960.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-05-30
AI Technical Summary
Existing cloud computing backup data and recovery methods rely on network connections, long recovery times, and insufficient technical support. Enterprises need to constantly update technology to adapt to the rapidly changing market environment, which increases learning costs and technical pressure.
By obtaining the file size, access times and modification times of the files to be backed up, allocate them as writing hot data, reading hot data and cold data, and based on the memory size and network bandwidth of the local server, decide whether to back up in the local or non-local cloud. Optimize data backup and recovery processes, monitor data integrity in real time and restore when necessary.
It realizes the automation and rapid recovery of data backup, reduces initial investment and operating costs, improves resource utilization and data recovery speed, and reduces business interruption time.
Smart Images

Figure CN118277164B
Abstract
Description
Technical Field
[0001] The present invention discloses a data backup and recovery method and system based on cloud computing, and relates to the field of cloud computing. Background Art
[0002] The existing methods or systems for backing up and restoring data in cloud computing have the following deficiencies:
[0003] Strong network dependence: Cloud backup and recovery are completely dependent on network connection. Without network connection, data backup and recovery operations cannot be performed.
[0004] Data recovery may take a long time: When a large amount of data needs to be recovered from the cloud, the recovery time is long due to limitations on network bandwidth and hardware performance.
[0005] Technical support may be insufficient: The technical support of some cloud service providers may not be timely or professional enough, making it difficult to quickly resolve problems when they arise.
[0006] Fast technology update: Cloud computing technology is developing rapidly. Enterprises need to keep paying attention to and learning new technologies and tools to adapt to the ever-changing market environment and technical requirements. This will increase the learning cost and technical pressure of enterprises. Summary of the invention
[0007] In view of the deficiencies in the prior art, the present invention aims to provide a data backup and recovery method and system based on cloud computing, aiming to solve the problem of slow data backup and data recovery rates in cloud computing.
[0008] In order to achieve the above object, the present invention is implemented through the following technical solutions: A data backup and recovery method based on cloud computing includes:
[0009] Step S1: Obtain the file size, access count, and modification count of the file to be backed up, and obtain allocation parameters; and divide the file to be backed up into write hot data, read hot data, and cold data according to the allocation parameters;
[0010] Step S2: Obtain the remaining memory size, network bandwidth, and data read rate and write rate of the user's local server to obtain local parameters;
[0011] Based on the file size of the file to be backed up, determine whether the local server can store the hot write data or the hot read data;
[0012] If possible, build a local cloud computing platform based on local parameters to back up hot data or read hot data;
[0013] If not, back up all the hot data, hot data, and cold data on a non-local cloud computing platform;
[0014] Step S3: According to local parameters, configure the data transmission rate of the non-local cloud computing platform to back up and write hot data or read hot data or cold data;
[0015] Monitor the access period of users to the local or non-local cloud computing platform; create snapshots for the files to be backed up in the local or non-local cloud computing platform according to the access period;
[0016] Real-time monitoring and judgment of the data integrity of files to be backed up;
[0017] If the data of the file to be backed up is incomplete, the file to be backed up is restored according to the snapshot to obtain a comparison file;
[0018] If the data of the file to be backed up is complete, no processing will be done;
[0019] Step S4: Summarize the reference files and provide feedback to the user; monitor in real time and determine whether there are new files to be backed up added; if there are, back up the new files to be backed up to the local or non-local cloud computing platform; if not, continue to monitor until the new files to be backed up are added;
[0020] Furthermore, the specific steps of step S1 are as follows:
[0021] Step S11: Use the IOException module in the io library to build a read-write access counter; use the read-write access counter to obtain the number of accesses and modifications to the file to be backed up;
[0022] Step S12: using the path.getsize() method in the os library to obtain the size of the file to be backed up;
[0023] Step S13: Count the number of files to be backed up, recorded as fn; record the file size, access times and modification times of the files to be backed up as b, r and w respectively; summarize the files to be backed up to obtain the file size b corresponding to the files to be backed up from 1 to fn 1 ~b fn ; Number of visits r 1 ~r fn ; Modification times w 1 ~w fn ;
[0024] Step S14: Summarize the data obtained in steps S11 to S13 as allocation parameters; and divide the files to be backed up into write hot data, read hot data, and cold data according to the allocation parameters;
[0025] Step S15: Allocate parameters, write hot data, read hot data and cold data, and proceed to step S2.
[0026] Furthermore, the specific steps of step S14 are as follows:
[0027] Step S141: Calculate r 1 ~r fn and w 1 ~w fn The corresponding average values are denoted as ar and aw;
[0028] Step S142: Define relation 11: r i +w i ≥ (ar*aw) 1 / 2 ; Where i is a positive integer, representing 1 to fn;
[0029] Step S143: 1 ~r fn and w 1 ~w fn , substitute into equation 11;
[0030] Filter out the files to be backed up that do not satisfy equation 11 as cold data; count the number of cold data, recorded as cmn;
[0031] The files to be backed up that satisfy equation 1 are regarded as hot data;
[0032] Step S144: Define relation 12: w j -r j ≥0; where j represents the subscript corresponding to the thermal data, and the value range of j is: 1~fn;
[0033] Step S145: Substitute the access times and modification times corresponding to the hot data into equation 12;
[0034] Filter out the data that meets the relationship 12, and record it as hot data 1;
[0035] Filter out the data that does not satisfy equation 12 and record it as hot data 2;
[0036] Step S146: Calculate b 1 ~b fn The corresponding average value is denoted as ab;
[0037] Define relation 13: ;
[0038] Define relation 14: ;
[0039] Step S147: Substitute the file size, access count and modification count corresponding to hot data 1 and hot data 2 into equations 13 and 14 respectively;
[0040] The hot data 1 satisfying the relation 13 is aggregated as the write hot data; the hot data 2 satisfying the relation 14 is aggregated as the read hot data;
[0041] The number of hot data written and hot data read are counted respectively, and recorded as wmn and sin respectively; the relationship between wmn and sin and cmn and fn satisfies: wmn-sin≤fn-cmn;
[0042] Step S148: In hot data 1 and hot data 2, hot data that do not satisfy equation 13 and equation 14 are respectively summarized as cold data;
[0043] On the basis of the original cmn, cmn is modified to cmn'; cmn'=cmn+fn-wmn-sin.
[0044] Furthermore, the specific steps of step S2 are:
[0045] Step S21: Obtain the remaining memory size, network bandwidth, and data read rate and write rate of the user's local server to obtain local parameters;
[0046] Count the number of local servers, recorded as sn; obtain the read rate, write rate and remaining memory size of the local server, recorded as sr, sw and si respectively; obtain the server BS;
[0047] BS{(sr 1 , sw 1 ,si 1 ), (sr 2 , sw 2 ,si 2 )~(sr sn , sw sn ,si sn )}; Among them, (sr 1 , sw 1 ,si 1 ) represents the first local server, corresponding to the read rate, write rate and remaining memory size; and so on, (sr 2 , sw 2 ,si 2 )~(sr sn , sw sn ,si sn ) represents the read rate, write rate and remaining memory size of the 2nd to snth local servers;
[0048] Step S22: Identify and mark the maximum read rate and the minimum read rate and the maximum write rate and the minimum write rate of the 1st to snth local servers, which are respectively recorded as mr and lr and mw and lw; calculate the average read rate and the average write rate corresponding to the 1st to snth local servers, which are respectively recorded as asr and asw;
[0049] Step S23: Define relation 21:
[0050] ; Among them, sr i and sw i Indicates the read rate and write rate corresponding to the i-th local server, where i represents 1 to sn;
[0051] Substitute the read rate and write rate corresponding to the 1st to snth local servers into equation 21, and summarize the local servers that satisfy equation 21 as the preferred servers; count the number of preferred servers, recorded as yn;
[0052] The local servers that do not satisfy equation 21 are used as candidate servers;
[0053] Step S24: Define the relation 22:
[0054] ; Among them, sr j and sw j Indicates the read rate and write rate corresponding to the jth candidate server. The value range of j is: 1~sn. The number of candidate servers represented by j is: (sn-yn);
[0055] Step S25: Substitute the read rate and write rate corresponding to the candidate server into equation 22, and collect the local servers that do not satisfy equation 22 as the secondary servers; count the number of the preferred servers, recorded as cn; the relationship between yn, cn and sn satisfies yn+cn≤sn;
[0056] Step S26: according to the file size of the file to be backed up, a local cloud computing platform is built on the preferred server to back up part of the hot write data or hot read data to obtain the remaining read and write data;
[0057] Step S27: Repeat the same steps of backing up the hot write data or the hot read data on the preferred server, build a local cloud computing platform on the secondary server, back up the remaining read and write data; summarize the remaining read and write data that has not been backed up to obtain the data that has not been backed up;
[0058] Step S28: Summarize the unbacked up data and proceed to step S3.
[0059] Furthermore, the specific steps of step S26 are as follows:
[0060] Step S261: Define the relationship 23: yw x ≥yr x ; Among them, yw x and yr x , respectively represent the write rate and read rate corresponding to the xth preferred server, the value range of x is: 1~sn, and the number of preferred servers represented by x is: yn;
[0061] Step S262: Substitute the read rate and write rate corresponding to the preferred server into equation 23, aggregate the preferred servers satisfying equation 23 as preferred write servers; aggregate the preferred servers not satisfying equation 23 as preferred read servers;
[0062] Count the number of preferred write servers and preferred read servers respectively, denoted as ywn and yrn;
[0063] Step S263: Arrange the write hot data or read hot data in ascending order of data size to obtain matching sequences W1 and R1; arrange the preferred write server and the preferred read server in descending order of remaining memory size to obtain matching sequences W2 and R2;
[0064] Step S264: allocating a preferred write server for writing hot data according to the matching sequence W1 and the matching sequence W2;
[0065] Step S265: repeat the same step of assigning a preferred write server to the hot write data according to the matching sequence W1 and the matching sequence W2, assigning a preferred read server to the hot read data according to the matching sequence R1 and the matching sequence R2, and marking the hot read data matched to the preferred read server in the matching sequence R1;
[0066] Step S266: Summarize the marked hot write data in the matching sequence W1 and the marked hot read data in the matching sequence R1 as local backup data;
[0067] Aggregate the unmarked hot write data in the matching sequence W1 and aggregate the unmarked hot read data in the matching sequence R1 as the read-write surplus data;
[0068] Step S267: Building a local cloud computing platform for local data backup;
[0069] Step S2671: Obtain the operating system version number of the user's PC; load the corresponding private cloud operating system image according to the operating system version number; and install the private cloud operating system image on the local server;
[0070] Step S2672: Obtain the network interface number of the user's PC and configure the network interface number to the server.
[0071] Step S2673: Load and install the private cloud software installation package and private cloud SDK;
[0072] Obtain the data type of the local backup data; create a virtual machine or container of a corresponding size according to the size and data type of the local backup data, and store the local backup data in the corresponding virtual machine or container;
[0073] Step S27: Repeat the same steps of backing up the hot write data or the hot read data on the preferred server, build a local cloud computing platform on the secondary server, back up the remaining read and write data; summarize the remaining read and write data that has not been backed up to obtain the data that has not been backed up;
[0074] Step S28: Summarize the unbacked up data and proceed to step S3.
[0075] Furthermore, the specific steps of step S264 are as follows:
[0076] Step S2641: define FW(i1), which represents the remaining memory size corresponding to the i1th preferred write server in the matching sequence W2; i1 represents the subscript 1 to yn, and the initial value of i1 is 1;
[0077] Step S2642: define SW (i2-i3), which indicates the cumulative memory size of the hot data from i2 to i3 in the first allocation sequence; i2 and i3 respectively indicate the subscripts of the hot data; i2 and i3 satisfy: i2<i3 and i3-i2≥1, the initial value of i2 is 0, and the initial value of i3 is 1;
[0078] Step S2643: Determine the size of FW (i1) and SW (i2-i3);
[0079] Step S26431: If FW(i1)>SW(i2~i3), i1 and i2 remain unchanged, i3 is increased by 1 on the original basis, and then it is determined whether FW(i1)>SW(i2~i3), until FW(i1)≤SW(i2~i3);
[0080] Step S26432: If FS(i1)=SS(i2-i3), then i1 is increased by 1, and the value of i3 is assigned to i2 to obtain i2'; the value of i3 is changed to i3', i3'=i2'+1; the i2-i3th write hot data in the matching sequence W1 is matched to the i1th preferred write server in the matching sequence W2;
[0081] Step S26433: If FS (i1) < SS (i2-i3), then i1 is increased by 1, and the value of i3 is assigned to i2 to obtain i2'; the value of i3 is modified to i3', i3'=i2'+1; the i2-(i3-1)th write hot data in the matching sequence W1 is matched to the i1th preferred write server in the matching sequence W2;
[0082] Step S2644: repeat step S2643 until all the preferred write servers in the matching sequence W2 are matched;
[0083] In the matching sequence W1, the hot write data matched to the preferred write server is marked.
[0084] Furthermore, the specific steps of step S3 are as follows:
[0085] Step S31: calling the same steps of building a local cloud computing platform to back up unbacked up data and cold data on a non-local cloud computing platform;
[0086] Step S32: Read the network bandwidth of each server corresponding to the local parameters, denoted as wk, and obtain wk 1 ~wk sn , where sn represents the number of local servers;
[0087] Read the network bandwidth corresponding to each server corresponding to the local parameters, recorded as wk, and get wk 1 ~wk sn , where sn represents the number of local servers;
[0088] Read the read rate of each server corresponding to the local parameters to get sr 1 ~sr sn ;
[0089] Step S33: define calculation formula 31:
[0090] ; Among them, fs i represents the data transmission rate of the non-local cloud computing platform to send data to the i-th local server; i represents 1 to sn;
[0091] Use the private cloud SDK to adjust the data sending rate corresponding to local servers 1 to sn according to formula 31;
[0092] Step S34: recording, through the task manager, the time period during which the user accesses the local or non-local cloud computing platform as the access period;
[0093] Create snapshots for files to be backed up in a local or non-local cloud computing platform based on access periods;
[0094] Step S35: Based on the snapshot, real-time monitoring and judging of the data integrity of the file to be backed up; if the data of the file to be backed up is incomplete, the file to be backed up is restored based on the snapshot to obtain a reference file, and then the process proceeds to step S36;
[0095] If the data of the file to be backed up is complete, no processing is performed, step S36 is skipped, and step S37 is entered;
[0096] Step S36: the file data to be backed up is incomplete, and the incomplete file data to be backed up is backed up as error data;
[0097] Restore the erroneous data according to the snapshot to obtain the corrected data;
[0098] Summarize the error data and the correction data to obtain the comparison file;
[0099] Step S37: Continuously monitor the data integrity of the files to be backed up until all the files to be backed up are monitored.
[0100] A data backup and recovery system based on cloud computing includes:
[0101] Data acquisition module: used to obtain the file size, access times and modification times of the files to be backed up, and obtain allocation parameters; according to the allocation parameters, the files to be backed up are divided into write hot data, read hot data and cold data;
[0102] Local cloud management module: used to obtain the remaining memory size, network bandwidth, and data read and write rates of the user's local server to obtain local parameters;
[0103] Based on the file size of the file to be backed up, determine whether the local server can store the hot write data or the hot read data;
[0104] If possible, build a local cloud computing platform based on local parameters to back up hot data or read hot data;
[0105] If not, back up all the hot data, hot data, and cold data on a non-local cloud computing platform;
[0106] Non-local cloud management module: used to configure the data transmission rate of the non-local cloud computing platform according to local parameters, and to back up and write hot data or read hot data or cold data;
[0107] Monitor the access period of users to the local or non-local cloud computing platform; create snapshots for the files to be backed up in the local or non-local cloud computing platform according to the access period;
[0108] Real-time monitoring and judgment of the data integrity of files to be backed up;
[0109] If the data of the file to be backed up is incomplete, the file to be backed up is restored according to the snapshot to obtain a comparison file;
[0110] If the data of the file to be backed up is complete, no processing will be done;
[0111] User interaction module: used to summarize the comparison files and provide feedback to the user; monitor in real time and determine whether there are new files to be backed up; if so, back up the new files to be backed up to the local or non-local cloud computing platform; if not, continue to monitor until the new files to be backed up are added.
[0112] Compared with the prior art, the present invention has the following beneficial effects:
[0113] Cost-effectiveness: The present invention does not require enterprises to purchase and maintain expensive hardware equipment, thus reducing initial investment and operating costs. In addition, based on the variable storage size of cloud computing, the present invention dynamically adjusts storage space according to the user's actual demand data, thereby improving resource utilization.
[0114] Fast data recovery speed: The present invention realizes the automation of data backup, reduces human errors and delays, and ensures timely backup of data; when data loss or damage occurs, the present invention restores data from the cloud to reduce business interruption time.
[0115] Scalability: As enterprise data grows, the cloud computing platform built by the present invention can expand storage space and processing capabilities; and the present invention divides data into important data (read hot data and write hot data) and cold data according to the frequency of data use by users, backs up important data (read hot data and write hot data) to the local cloud, and backs up cold data to the non-local cloud. In addition, the data sending rate of the non-local cloud is adjusted according to the data processing rate of the local cloud, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0116] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0117] Figure 1 It is a schematic diagram of the method of the present invention;
[0118] Figure 2 It is a schematic diagram of the system of the present invention;
[0119] Figure 3 This is a schematic diagram of data processing of the present invention. DETAILED DESCRIPTION
[0120] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and understandable, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments. Embodiment 1
[0121] See also Figure 1 and Figure 3 , a data backup and recovery method based on cloud computing includes:
[0122] It should be noted that, because directly scanning the user's PC to obtain data will infringe the user's privacy, the present invention adopts the "user authorized scanning" method to obtain data; that is, the user creates a folder named "scan target" on the PC and configures the absolute path of the "scan target";
[0123] The user stores the data or files to be processed by the present invention in the "scan target" (folder) as files to be backed up;
[0124] The present invention automatically searches for a "scan target" (folder) through an absolute path, and then reads the data or files in the "scan target" (folder) to obtain the files to be backed up;
[0125] Step S1: Obtain the file size, access count, and modification count of the file to be backed up, and obtain allocation parameters; and divide the file to be backed up into write hot data, read hot data, and cold data according to the allocation parameters;
[0126] The specific steps of step S1 are as follows:
[0127] Step S11: Use the IOException module in the io library to build a read-write access counter; configure the absolute path of the "scan target" (folder) to the read-write access counter; use the read-write access counter to obtain the number of accesses and modifications to the file to be backed up;
[0128] Step S12: using the path.getsize() method in the os library to obtain the size of the file to be backed up;
[0129] Step S13: Count the number of files to be backed up, recorded as fn; record the file size, access times and modification times of the files to be backed up as b, r and w respectively; summarize the files to be backed up to obtain the file size b corresponding to the files to be backed up from 1 to fn 1 ~b fn ; Number of visits r 1 ~r fn ; Modification times w 1 ~w fn ;
[0130] Step S14: Summarize the data obtained in steps S11 to S13 as allocation parameters; and divide the files to be backed up into write hot data, read hot data, and cold data according to the allocation parameters;
[0131] Step S141: Calculate r 1 ~r fn and w 1 ~w fn The corresponding average values are denoted as ar and aw;
[0132] Step S142: Define relation 11: r i +w i ≥ (ar*aw) 1 / 2 ; Where i is a positive integer, representing 1 to fn;
[0133] Step S143: 1 ~r fn and w 1 ~w fn , substitute into equation 11;
[0134] Filter out the files to be backed up that do not satisfy equation 11 as cold data; count the number of cold data, recorded as cmn;
[0135] The files to be backed up that satisfy equation 1 are regarded as hot data;
[0136] Step S144: Define relation 12: w j -r j ≥0; where j represents the subscript corresponding to the thermal data, and the value range of j is: 1~fn;
[0137] Step S145: Substitute the access times and modification times corresponding to the hot data into equation 12;
[0138] Filter out the data that meets the relationship 12, and record it as hot data 1;
[0139] Filter out the data that does not satisfy equation 12 and record it as hot data 2;
[0140] Step S146: Calculate b 1 ~b fn The corresponding average value is denoted as ab;
[0141] Define relation 13: ;
[0142] Define relation 14: ;
[0143] Step S147: Substitute the file size, access count and modification count corresponding to hot data 1 and hot data 2 into equations 13 and 14 respectively;
[0144] The hot data 1 satisfying the relation 13 is aggregated as the write hot data; the hot data 2 satisfying the relation 14 is aggregated as the read hot data;
[0145] The number of hot data written and hot data read are counted respectively, and recorded as wmn and sin respectively; the relationship between wmn and sin and cmn and fn satisfies: wmn-sin≤fn-cmn;
[0146] Step S148: In hot data 1 and hot data 2, hot data that do not satisfy equation 13 and equation 14 are respectively summarized as cold data;
[0147] On the basis of the original cmn, cmn is modified to cmn'; cmn'=cmn+fn-wmn-sin.
[0148] Step S2: Obtain the remaining memory size, network bandwidth, and data read rate and write rate of the user's local server to obtain local parameters;
[0149] Based on the file size of the file to be backed up, determine whether the local server can store the hot write data or the hot read data;
[0150] If possible, build a local cloud computing platform based on local parameters to back up hot data or read hot data;
[0151] If not, back up all the hot data, hot data, and cold data on a non-local cloud computing platform;
[0152] Specific steps of step S2:
[0153] Step S21: Obtain the remaining memory size, network bandwidth, and data read rate and write rate of the user's local server to obtain local parameters;
[0154] Count the number of local servers, recorded as sn; obtain the read rate, write rate and remaining memory size of the local server, recorded as sr, sw and si respectively; obtain the server BS;
[0155] BS{(sr 1 , sw 1 ,si 1 ), (sr 2 , sw 2 ,si 2 )~(sr sn , sw sn ,si sn )}; Among them, (sr 1 , sw 1 ,si 1 ) represents the first local server, corresponding to the read rate, write rate and remaining memory size; and so on, (sr 2 , sw 2 ,si 2 )~(sr sn , sw sn ,si sn ) represents the read rate, write rate and remaining memory size of the 2nd to snth local servers;
[0156] Step S22: Identify and mark the maximum read rate and the minimum read rate and the maximum write rate and the minimum write rate of the 1st to snth local servers, which are respectively recorded as mr and lr and mw and lw; calculate the average read rate and the average write rate corresponding to the 1st to snth local servers, which are respectively recorded as asr and asw;
[0157] Step S23: Define relation 21:
[0158] ; Among them, sr i and swi Indicates the read rate and write rate corresponding to the i-th local server, where i represents 1 to sn;
[0159] Substitute the read rate and write rate corresponding to the 1st to snth local servers into equation 21, and summarize the local servers that satisfy equation 21 as the preferred servers; count the number of preferred servers, recorded as yn;
[0160] The local servers that do not satisfy equation 21 are used as candidate servers;
[0161] Step S24: Define the relation 22:
[0162] ; Among them, sr j and sw j Indicates the read rate and write rate corresponding to the jth candidate server. The value range of j is: 1~sn. The number of candidate servers represented by j is: (sn-yn);
[0163] Step S25: Substitute the read rate and write rate corresponding to the candidate server into equation 22, and collect the local servers that do not satisfy equation 22 as the secondary servers; count the number of the preferred servers, recorded as cn; the relationship between yn, cn and sn satisfies yn+cn≤sn;
[0164] Step S26: according to the file size of the file to be backed up, a local cloud computing platform is built on the preferred server to back up part of the hot write data or hot read data to obtain the remaining read and write data;
[0165] It should be noted that the "data size of the remaining read / write data" in the present invention is less than or equal to the "total data size of the hot write data and the hot read data".
[0166] Step S261: Define the relationship 23: yw x ≥yr x ; Among them, yw x and yr x , respectively represent the write rate and read rate corresponding to the xth preferred server, the value range of x is: 1~sn, and the number of preferred servers represented by x is: yn;
[0167] Step S262: Substitute the read rate and write rate corresponding to the preferred server into equation 23, aggregate the preferred servers satisfying equation 23 as preferred write servers; aggregate the preferred servers not satisfying equation 23 as preferred read servers;
[0168] Count the number of preferred write servers and preferred read servers respectively, denoted as ywn and yrn;
[0169] Step S263: Arrange the write hot data or read hot data in ascending order of data size to obtain matching sequences W1 and R1; arrange the preferred write server and the preferred read server in descending order of remaining memory size to obtain matching sequences W2 and R2;
[0170] Step S264: allocating a preferred write server for writing hot data according to the matching sequence W1 and the matching sequence W2;
[0171] Step S2641: define FW(i1), which represents the remaining memory size corresponding to the i1th preferred write server in the matching sequence W2; i1 represents the subscript 1 to yn, and the initial value of i1 is 1;
[0172] Step S2642: define SW (i2-i3), which indicates the cumulative memory size of the hot data from i2 to i3 in the first allocation sequence; i2 and i3 respectively indicate the subscripts of the hot data; i2 and i3 satisfy: i2<i3 and i3-i2≥1, the initial value of i2 is 0, and the initial value of i3 is 1;
[0173] It should be noted that in the present invention, the Sw (i2-i3) corresponding to "the initial value of i2 is 0, the initial value of i3 is 1" represents the data size of the first hot data write in the matching sequence W1; the subsequent "i2 is 0, i3 is not 1" represents the cumulative data size of the first hot data write to the i3th hot data write in the matching sequence W1. This is special and is explained here.
[0174] Step S2643: Determine the size of FW (i1) and SW (i2-i3);
[0175] Step S26431: If FW(i1)>SW(i2~i3), i1 and i2 remain unchanged, i3 is increased by 1 on the original basis, and then it is determined whether FW(i1)>SW(i2~i3), until FW(i1)≤SW(i2~i3);
[0176] Step S26432: If FS(i1)=SS(i2-i3), then i1 is increased by 1, and the value of i3 is assigned to i2 to obtain i2'; the value of i3 is changed to i3', i3'=i2'+1; the i2-i3th write hot data in the matching sequence W1 is matched to the i1th preferred write server in the matching sequence W2;
[0177] Step S26433: If FS (i1) < SS (i2-i3), then i1 is increased by 1, and the value of i3 is assigned to i2 to obtain i2'; the value of i3 is modified to i3', i3'=i2'+1; the i2-(i3-1)th write hot data in the matching sequence W1 is matched to the i1th preferred write server in the matching sequence W2;
[0178] Step S2644: repeat step S2643 until all the preferred write servers in the matching sequence W2 are matched;
[0179] In the matching sequence W1, the hot write data matched to the preferred write server is marked;
[0180] Step S265: repeat the same step of “allocating a preferred write server for hot write data according to the matching sequence W1 and the matching sequence W2” (step S264), allocate a preferred read server for hot read data according to the matching sequence R1 and the matching sequence R2, and mark the hot read data matched to the preferred read server in the matching sequence R1;
[0181] Step S266: Summarize the marked hot write data in the matching sequence W1 and the marked hot read data in the matching sequence R1 as local backup data;
[0182] Aggregate the unmarked hot write data in the matching sequence W1 and aggregate the unmarked hot read data in the matching sequence R1 as the read-write surplus data;
[0183] Step S267: Building a local cloud computing platform for local data backup;
[0184] Step S2671: Obtain the operating system version number of the user's PC; load the corresponding private cloud operating system image (such as CentOS, Ubuntu) according to the operating system version number; and install the private cloud operating system image on the local server;
[0185] Step S2672: Obtain the network interface number (such as static IP address, subnet mask, default gateway) of the user's PC, and configure the network interface number to the server.
[0186] Step S2673: Load and install the private cloud software installation package and private cloud SDK;
[0187] Obtain the data type of the local backup data; create a virtual machine or container of a corresponding size according to the size and data type of the local backup data, and store the local backup data in the corresponding virtual machine or container;
[0188] Step S27: Repeat the same steps of backing up the hot write data or the hot read data (step S26) on the preferred server, build a local cloud computing platform on the secondary server, back up the remaining read and write data; summarize the remaining read and write data that has not been backed up to obtain the non-backed up data;
[0189] Step S28: Summarize the unbacked up data and proceed to step S3.
[0190] Step S3: According to local parameters, configure the data transmission rate of the non-local cloud computing platform to back up and write hot data or read hot data or cold data;
[0191] Monitor the access period of users to the local or non-local cloud computing platform; create snapshots for the files to be backed up in the local or non-local cloud computing platform according to the access period;
[0192] Real-time monitoring and judgment of the data integrity of files to be backed up;
[0193] If the data of the file to be backed up is incomplete, the file to be backed up is restored according to the snapshot to obtain a comparison file;
[0194] If the data of the file to be backed up is complete, no processing will be done;
[0195] The specific steps of step S3 are as follows:
[0196] Step S31: calling the same steps of building a local cloud computing platform (steps S26 to S27) to back up unbacked data and cold data on a non-local cloud computing platform;
[0197] Step S32: Read the network bandwidth of each server corresponding to the local parameters, denoted as wk, and obtain wk 1 ~wk sn , where sn represents the number of local servers;
[0198] Read the network bandwidth corresponding to each server corresponding to the local parameters, recorded as wk, and get wk 1 ~wk sn , where sn represents the number of local servers;
[0199] Read the read rate of each server corresponding to the local parameters to get sr 1 ~sr sn ;
[0200] Step S33: define calculation formula 31:
[0201] ; Among them, fs i represents the data transmission rate of the non-local cloud computing platform to send data to the i-th local server; i represents 1 to sn;
[0202] Use the private cloud SDK to adjust the data sending rate corresponding to local servers 1 to sn according to formula 31;
[0203] Step S34: recording, through the task manager, the time period during which the user accesses the local or non-local cloud computing platform as the access period;
[0204] Create snapshots for files to be backed up in a local or non-local cloud computing platform based on access periods;
[0205] Step S35: Based on the snapshot, real-time monitoring and judging of the data integrity of the file to be backed up; if the data of the file to be backed up is incomplete, the file to be backed up is restored based on the snapshot to obtain a reference file, and then the process proceeds to step S36;
[0206] If the data of the file to be backed up is complete, no processing is performed, step S36 is skipped, and step S37 is entered;
[0207] Step S36: the file data to be backed up is incomplete, and the incomplete file data to be backed up is backed up as error data;
[0208] Restore the erroneous data according to the snapshot to obtain the corrected data;
[0209] Summarize the error data and the correction data to obtain the comparison file;
[0210] Step S37: Continuously monitor the data integrity of the files to be backed up until all the files to be backed up are monitored.
[0211] Step S4: Summarize the reference files and provide feedback to the user; monitor in real time and determine whether there are new files to be backed up added; if so, back up the new files to be backed up to a local or non-local cloud computing platform; if not, continue monitoring until the new files to be backed up are added.
[0212] It should be noted that the "new files to be backed up" in the present invention means: the corresponding data or files in the first-level directory of the file newly added to the "scan target" (folder). Embodiment 2
[0213] See also Figure 2 A data backup and recovery system based on cloud computing includes: a data acquisition module, a local cloud management module, a non-local cloud management module, a user interaction module, a database and a server; wherein the data acquisition module, the local cloud management module, the non-local cloud management module and the user interaction module are connected to the database and the server respectively.
[0214] Data acquisition module: used to obtain the file size, access times and modification times of the files to be backed up, and obtain allocation parameters; according to the allocation parameters, the files to be backed up are divided into write hot data, read hot data and cold data;
[0215] Local cloud management module: used to obtain the remaining memory size, network bandwidth, and data read and write rates of the user's local server to obtain local parameters;
[0216] Based on the file size of the file to be backed up, determine whether the local server can store the hot write data or the hot read data;
[0217] If possible, build a local cloud computing platform based on local parameters to back up hot data or read hot data;
[0218] If not, back up all the hot data, hot data, and cold data on a non-local cloud computing platform;
[0219] Non-local cloud management module: used to configure the data transmission rate of the non-local cloud computing platform according to local parameters, and to back up and write hot data or read hot data or cold data;
[0220] Monitor the access period of users to the local or non-local cloud computing platform; create snapshots for the files to be backed up in the local or non-local cloud computing platform according to the access period;
[0221] Real-time monitoring and judgment of the data integrity of files to be backed up;
[0222] If the data of the file to be backed up is incomplete, the file to be backed up is restored according to the snapshot to obtain a comparison file;
[0223] If the data of the file to be backed up is complete, no processing will be done;
[0224] User interaction module: used to summarize the comparison files and provide feedback to the user; monitor in real time and determine whether there are new files to be backed up; if so, back up the new files to be backed up to the local or non-local cloud computing platform; if not, continue to monitor until the new files to be backed up are added.
[0225] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technical personnel in this field according to actual conditions. For example, if there are weight coefficients and proportional coefficients, their set sizes are to quantify each parameter to obtain a specific value, which is convenient for subsequent comparison. Regarding the size of the weight coefficient and the proportional coefficient, it is sufficient as long as it does not affect the proportional relationship between the parameter and the quantized value.
[0226] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A data backup and recovery method based on cloud computing, It is characterized in that The backup and recovery method comprises: Step S1: Obtain the file size, access count, and modification count of the file to be backed up, and obtain allocation parameters; and divide the file to be backed up into write hot data, read hot data, and cold data according to the allocation parameters; Step S2: Obtain the remaining memory size, network bandwidth, and data read rate and write rate of the user's local server to obtain local parameters; Based on the file size of the file to be backed up, determine whether the local server can store the hot write data or the hot read data; If possible, build a local cloud computing platform based on local parameters to back up hot data or read hot data; If not, back up all the hot data, hot data, and cold data on a non-local cloud computing platform; Step S3: According to local parameters, configure the data transmission rate of the non-local cloud computing platform to back up and write hot data or read hot data or cold data; Monitor the access period of users to the local or non-local cloud computing platform; create snapshots for the files to be backed up in the local or non-local cloud computing platform according to the access period; Real-time monitoring and judgment of the data integrity of files to be backed up; If the data of the file to be backed up is incomplete, the file to be backed up is restored according to the snapshot to obtain a comparison file; If the data of the file to be backed up is complete, no processing will be done; Step S4: Summarize the reference files and provide feedback to the user; monitor in real time and determine whether there are new files to be backed up added; if so, back up the new files to be backed up to a local or non-local cloud computing platform; if not, continue monitoring until the new files to be backed up are added.
2. According to the cloud computing-based data backup and recovery method of claim 1, It is characterized in that The specific steps of step S1 are as follows: Step S11: Use the IOException module in the io library to build a read-write access counter; use the read-write access counter to obtain the number of accesses and modifications to the file to be backed up; Step S12: using the path.getsize() method in the os library to obtain the size of the file to be backed up; Step S13: Count the number of files to be backed up, denoted as fn; The file size, access count, and modification count of the files to be backed up are recorded as b, r, and w, respectively; the files to be backed up are summarized to obtain the file size b corresponding to the files to be backed up from 1 to fn 1 ~b fn ; Number of visits r 1 ~r fn ; Modification times w 1 ~w fn ; Step S14: Summarize the data obtained in steps S11 to S13 as allocation parameters; According to the allocation parameters, the files to be backed up are divided into write hot data, read hot data and cold data; Step S15: Allocate parameters, write hot data, read hot data and cold data, and proceed to step S2.
3. According to the data backup and recovery method based on cloud computing in claim 2, It is characterized in that The specific steps of step S14 are as follows: Step S141: Calculate r 1 ~r fn and w 1 ~w fn The corresponding average values are denoted as ar and aw; Step S142: Define relation 11: r i +w i ≥(ar*aw) 1 / 2 ; Where i is a positive integer, representing 1 to fn; Step S143: 1 ~r fn and w 1 ~w fn , substitute into equation 11; Filter out the files to be backed up that do not satisfy equation 11 as cold data; count the number of cold data, recorded as cmn; The files to be backed up that satisfy equation 1 are regarded as hot data; Step S144: Define relation 12: w j -r j ≥0; where j represents the subscript corresponding to the thermal data, and the value range of j is: 1~fn; Step S145: Substitute the access times and modification times corresponding to the hot data into equation 12; Filter out the data that meets the relationship 12, and record it as hot data 1; Filter out the data that does not satisfy equation 12 and record it as hot data 2; Step S146: Calculate b 1 ~b fn The corresponding average value is denoted as ab; Define relation 13: Define relation 14: Step S147: Substitute the file size, access count and modification count corresponding to hot data 1 and hot data 2 into equations 13 and 14 respectively; The hot data 1 satisfying the relation 13 is aggregated as the write hot data; the hot data 2 satisfying the relation 14 is aggregated as the read hot data; The number of hot data written and hot data read are counted respectively, and recorded as wmn and sin respectively; the relationship between wmn and sin and cmn and fn satisfies: wmn-sin≤fn-cmn; Step S148: In hot data 1 and hot data 2, hot data that do not satisfy equation 13 and equation 14 are respectively summarized as cold data; On the basis of the original cmn, cmn is modified to cmn'; cmn'=cmn+fn-wmn-sin.
4. The data backup and recovery method based on cloud computing according to claim 2, It is characterized in that The specific steps of step S2 are: Step S21: Obtain the remaining memory size, network bandwidth, and data read rate and write rate of the user's local server to obtain local parameters; Count the number of local servers, recorded as sn; Get the read rate, write rate, and remaining memory size of the local server, denoted as sr, sw, and si respectively; Get server BS; BS{(sr 1 ,sw 1 ,si 1 ),(sr 2 ,sw 2 ,si 2 )~(sr sn ,sw sn ,si sn )}; Among them, (sr 1 , sw 1 ,si 1 ) represents the read rate, write rate, and remaining memory size of the first local server; and so on. 2 , sw 2 ,si 2 )~(sr sn , sw sn ,si sn ) indicates the read rate, write rate and remaining memory size corresponding to the 2nd to snth local servers; Step S22: Identify and mark the maximum read rate and the minimum read rate and the maximum write rate and the minimum write rate of the 1st to snth local servers, which are respectively recorded as mr and lr and mw and lw; calculate the average read rate and the average write rate corresponding to the 1st to snth local servers, which are respectively recorded as asr and asw; Step S23: Define relation 21: Among them, sr i and sw i Indicates the read rate and write rate corresponding to the i-th local server, where i represents 1 to sn; Substitute the read rate and write rate corresponding to the 1st to snth local servers into equation 21, and summarize the local servers that satisfy equation 21 as the preferred servers; count the number of preferred servers, recorded as yn; The local servers that do not satisfy equation 21 are used as candidate servers; Step S24: Define the relation 22: Among them, sr j and sw j Indicates the read rate and write rate corresponding to the jth candidate server. The value range of j is: 1~sn. The number of candidate servers represented by j is: (sn-yn); Step S25: Substitute the read rate and write rate corresponding to the candidate server into equation 22, and collect the local servers that do not satisfy equation 22 as the secondary servers; count the number of the preferred servers, recorded as cn; the relationship between yn, cn and sn satisfies yn+cn≤sn; Step S26: according to the file size of the file to be backed up, a local cloud computing platform is built on the preferred server to back up part of the hot write data or hot read data to obtain the remaining read and write data; Step S27: Repeat the same steps of backing up the hot write data or the hot read data on the preferred server, build a local cloud computing platform on the secondary server, back up the remaining read and write data; summarize the remaining read and write data that has not been backed up to obtain the data that has not been backed up; Step S28: Summarize the unbacked up data and proceed to step S3.
5. A data backup and recovery method based on cloud computing according to claim 4, It is characterized in that The specific steps of step S26 are as follows: Step S261: Define the relationship 23: yw x ≥yr x ; Among them, yw x and yr x , respectively represent the write rate and read rate corresponding to the xth preferred server, the value range of x is: 1~sn, and the number of preferred servers represented by x is: yn; Step S262: Substitute the read rate and write rate corresponding to the preferred server into equation 23, aggregate the preferred servers satisfying equation 23 as preferred write servers; aggregate the preferred servers not satisfying equation 23 as preferred read servers; Count the number of preferred write servers and preferred read servers respectively, denoted as ywn and yrn; Step S263: Arrange the write hot data or read hot data in ascending order of data size to obtain matching sequences W1 and R1; arrange the preferred write server and the preferred read server in descending order of remaining memory size to obtain matching sequences W2 and R2; Step S264: allocating a preferred write server for writing hot data according to the matching sequence W1 and the matching sequence W2; Step S265: repeat the same step of assigning a preferred write server to the hot write data according to the matching sequence W1 and the matching sequence W2, assigning a preferred read server to the hot read data according to the matching sequence R1 and the matching sequence R2, and marking the hot read data matched to the preferred read server in the matching sequence R1; Step S266: Summarize the marked hot write data in the matching sequence W1 and the marked hot read data in the matching sequence R1 as local backup data; Aggregate the unmarked hot write data in the matching sequence W1 and aggregate the unmarked hot read data in the matching sequence R1 as the read-write surplus data; Step S267: Building a local cloud computing platform for local data backup; Step S2671: Obtain the operating system version number of the user's PC; load the corresponding private cloud operating system image according to the operating system version number; and install the private cloud operating system image on the local server; Step S2672: Obtain the network interface number of the user's PC and configure the network interface number to the server. Step S2673: Load and install the private cloud software installation package and private cloud SDK; Obtain the data type of the local backup data; create a virtual machine or container of a corresponding size according to the size and data type of the local backup data, and store the local backup data in the corresponding virtual machine or container; Step S27: Repeat the same steps of backing up the hot write data or the hot read data on the preferred server, build a local cloud computing platform on the secondary server, back up the remaining read and write data; summarize the remaining read and write data that has not been backed up to obtain the data that has not been backed up; Step S28: Summarize the unbacked up data and proceed to step S3.
6. A data backup and recovery method based on cloud computing according to claim 5, It is characterized in that The specific steps of step S264 are as follows: Step S2641: define FW(i1), which represents the remaining memory size corresponding to the i1th preferred write server in the matching sequence W2; i1 represents the subscript 1 to yn, and the initial value of i1 is 1; Step S2642: define SW(i2-i3) to indicate the cumulative memory size of the hot data from i2 to i3 in the first allocation sequence; i2 and i3 respectively indicate the subscripts of the hot data; i2 and i3 satisfy: i2<i3 and i3-i2≥1, the initial value of i2 is 0, and the initial value of i3 is 1; Step S2643: Determine the size of FW (i 1) and SW (i2-i3); Step S26431: If FW(i1)>SW(i2~i3), then i1 and i2 remain unchanged, i3 is increased by 1 on the original basis, and then it is determined whether FW(i1)>SW(i2~i3), until FW(i1)≤SW(i2~i3); Step S26432: If FW(i1)=SW(i2-i3), then i1 is increased by 1, and the value of i3 is assigned to i2 to obtain i2'; the value of i3 is modified to i3', i3'=i2'+1; the i2-i3th write hot data in the matching sequence W1 is matched to the i1th preferred write server in the matching sequence W2; Step S26433: If FW(i1)<SW(i2~i3), then i1 is increased by 1, and the value of i3 is assigned to i2 to obtain i2'; the value of i3 is modified to i3', i3'=i2'+1; the i2th to (i3-1)th write hot data in the matching sequence W1 is matched to the i1th preferred write server in the matching sequence W2; Step S2644: repeat step S2643 until all the preferred write servers in the matching sequence W2 are matched; In the matching sequence W1, the hot write data matched to the preferred write server is marked.
7. The data backup and recovery method based on cloud computing according to claim 5, It is characterized in that The specific steps of step S3 are as follows: Step S31: calling the same steps of building a local cloud computing platform to back up unbacked up data and cold data on a non-local cloud computing platform; Step S32: Read the network bandwidth of each server corresponding to the local parameters, denoted as wk, and obtain wk 1 ~wk sn , where sn represents the number of local servers; Read the network bandwidth corresponding to each server corresponding to the local parameters, recorded as wk, and get wk 1 ~wk sn , where sn represents the number of local servers; Read the read rate of each server corresponding to the local parameters to get sr 1 ~sr sn ; Step S33: define calculation formula 31: Among them, fs i represents the data transmission rate of the non-local cloud computing platform to send data to the i-th local server; i represents 1 to sn; Use the private cloud SDK to adjust the data sending rate corresponding to local servers 1 to sn according to formula 31; Step S34: recording, through the task manager, the time period during which the user accesses the local or non-local cloud computing platform as the access period; Create snapshots for files to be backed up in a local or non-local cloud computing platform based on access periods; Step S35: Based on the snapshot, real-time monitoring and judging of the data integrity of the file to be backed up; if the data of the file to be backed up is incomplete, the file to be backed up is restored based on the snapshot to obtain a reference file, and then the process proceeds to step S36; If the data of the file to be backed up is complete, no processing is performed, step S36 is skipped, and step S37 is entered; Step S36: the file data to be backed up is incomplete, and the incomplete file data to be backed up is backed up as error data; Restore the erroneous data according to the snapshot to obtain the corrected data; Summarize the error data and the correction data to obtain the comparison file; Step S37: Continuously monitor the data integrity of the files to be backed up until all the files to be backed up are monitored.
8. A cloud computing-based data backup and recovery system, applicable to any cloud computing-based data backup and recovery method of claims 1-7, It is characterized in that The backup and recovery system includes: Data acquisition module: used to obtain the file size, access times and modification times of the files to be backed up, and obtain allocation parameters; according to the allocation parameters, the files to be backed up are divided into write hot data, read hot data and cold data; Local cloud management module: used to obtain the remaining memory size, network bandwidth, and data read and write rates of the user's local server to obtain local parameters; Based on the file size of the file to be backed up, determine whether the local server can store the hot write data or the hot read data; If possible, build a local cloud computing platform based on local parameters to back up hot data or read hot data; If not, back up all the hot data, hot data, and cold data on a non-local cloud computing platform; Non-local cloud management module: used to configure the data transmission rate of the non-local cloud computing platform according to local parameters, and to back up and write hot data or read hot data or cold data; Monitor the access period of users to the local or non-local cloud computing platform; create snapshots for the files to be backed up in the local or non-local cloud computing platform according to the access period; Real-time monitoring and judgment of the data integrity of files to be backed up; If the data of the file to be backed up is incomplete, the file to be backed up is restored according to the snapshot to obtain a comparison file; If the data of the file to be backed up is complete, no processing will be done; User interaction module: used to summarize the comparison files and provide feedback to the user; monitor in real time and determine whether there are new files to be backed up; if so, back up the new files to be backed up to the local or non-local cloud computing platform; if not, continue to monitor until the new files to be backed up are added.
