Data synchronization method and device and electronic equipment
By regularly obtaining the preset indicator parameter values of the storage server, calculating performance indicators, and selecting the best performance storage server to store cloud mobile phone backup data, the problem of insufficient data storage performance of cloud mobile phones is solved and efficient data storage is achieved.
Patent Information
- Application Number
- CN202411822621.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-11
AI Technical Summary
With the increase of cloud mobile phone users, the number of cloud mobile data stored in the storage server increases, resulting in insufficient storage space for some storage servers, which in turn affects storage performance. It is necessary to reasonably store cloud mobile phone backup data in the storage server with the best performance.
By obtaining the preset indicator parameter values of each storage server every preset cycle, determining the optimal and worst parameter values set, calculating the performance indicators of the storage server, and selecting the target storage server with the best performance to store cloud mobile phone backup data.
Ensure that cloud mobile phone backup data is stored in the target storage server with the best storage performance, improve the efficiency and performance of data storage, and avoid data loss or access delay caused by insufficient storage server performance.
Smart Images

Figure CN119766826A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of data backup, and in particular, relates to a method, device and electronic device for data synchronization. Background Art
[0002] A cloud phone is an operating system that runs in a cloud server through virtualization technology. It transmits the cloud phone screen to the user terminal through video streaming, and at the same time transmits the user-triggered operations from the user terminal to the cloud phone in the cloud server, enabling the user to control the cloud phone in real-time remotely.
[0003] With the widespread use of cloud phones, the data security of cloud phones has become increasingly important. To ensure the security of cloud phone data, cloud phone data can be backed up on a storage server. In this way, when local cloud phone data is lost, the cloud phone data in the storage server can be read, thereby ensuring that users can use the cloud phone normally.
[0004] However, with the increase in the number of cloud phone users, the cloud phone data stored in the storage server has also increased, resulting in insufficient storage space on some storage servers, which further leads to insufficient storage performance of the storage server for cloud phone data. Therefore, it is necessary to reasonably allocate appropriate storage servers for the cloud phone data corresponding to each cloud phone. Summary of the invention
[0005] The embodiments of the present application provide a method, apparatus, device, storage medium and program product for data synchronization, which can ensure that cloud phone backup data is stored in a target storage server with the best storage performance.
[0006] In a first aspect, an embodiment of the present application provides a method for data synchronization, which is applied to a load balancing server, and the method includes:
[0007] Every first preset period, obtaining a parameter value of a preset indicator of each storage server;
[0008] According to the parameter values of the preset indicators of each storage server, the optimal parameter value and the worst parameter value of each preset indicator are determined to obtain the optimal parameter value set and the worst parameter value set;
[0009] For each storage server, a first distance from the optimal parameter value set and a second distance from the worst parameter value set are calculated according to the parameter value of the preset indicator of the storage server, wherein the first distance represents the performance gap between the performance of the storage server and the performance corresponding to the optimal parameter value set, and the second distance represents the performance gap between the performance of the storage server and the performance corresponding to the worst parameter value set;
[0010] For each storage server, using the first distance and the second distance corresponding to the storage server, calculate a performance indicator of the storage server, where the performance indicator is used to characterize the storage performance of the storage server;
[0011] A target storage server corresponding to the maximum performance indicator is determined, and the target storage server is used to store the cloud phone backup data.
[0012] In a possible implementation, determining the optimal parameter value and the worst parameter value of each preset indicator according to the parameter value of the preset indicator of each storage server to obtain the optimal parameter value set and the worst parameter value set includes:
[0013] According to the parameter values of the preset indicators of each storage server, a decision matrix is constructed, wherein the elements in the same column of the decision matrix are used to represent the parameter values of the same preset indicator of different storage servers, and the elements in the same row of the decision matrix are used to represent the parameter values of different preset indicators of one storage server;
[0014] For each column element in the decision matrix, determining the optimal parameter value and the worst parameter value;
[0015] Using the optimal parameter values in each column of elements, construct the optimal parameter value set;
[0016] The worst parameter value set is constructed by using the worst parameter value in each column element.
[0017] In a possible implementation, for each storage server, calculating, according to a parameter value of a preset indicator of the storage server, a first distance from the optimal parameter value set and a second distance from the worst parameter value set includes:
[0018] According to the preset weight corresponding to the preset indicator, the parameter value of the preset indicator of the storage server is calculated to calculate the first distance from the optimal parameter value set and the second distance from the worst parameter value set.
[0019] In a possible implementation, the number of the preset indicators is 3; and the step of calculating, according to the preset weights corresponding to the preset indicators, the first distance between the parameter value of the preset indicator of the storage server and the optimal parameter value set, and the second distance between the parameter value of the worst parameter value set includes:
[0020] The first distance is calculated according to the following formula:
[0021]
[0022] Among them, D i+ represents the first distance corresponding to the i-th storage server, w j represents the preset weight corresponding to the jth preset indicator, M j + represents the optimal parameter set, m i ′ j Indicates the parameter value of the preset indicator corresponding to the i-th storage server;
[0023] The second distance is calculated according to the following formula:
[0024]
[0025] Among them, D i - represents the second distance corresponding to the i-th storage server, w j represents the preset weight corresponding to the jth preset indicator, M j - represents the worst parameter set, m i ′ j Indicates the parameter value of the preset indicator corresponding to the i-th storage server.
[0026] In a possible implementation, for each storage server, calculating the performance indicator of the storage server by using the first distance and the second distance corresponding to the storage server includes:
[0027] The performance index is calculated according to the following formula:
[0028]
[0029] Among them, the D i Represents the performance indicator corresponding to the i-th storage server.
[0030] In a possible implementation, storing the cloud phone backup data using the target storage server includes:
[0031] Obtain the target backup task corresponding to the earliest timestamp from the backup task sequence;
[0032] Obtain the target cloud phone backup data corresponding to the target backup task;
[0033] The target cloud phone backup data is sent to the target storage server.
[0034] In a possible implementation, before obtaining the target backup task corresponding to the earliest timestamp from the backup task sequence, the method further includes:
[0035] Receive data backup instructions sent by different cloud phones;
[0036] Build a backup task sequence based on the timestamp of the data backup instruction corresponding to each cloud phone.
[0037] In a possible implementation, after storing the cloud phone backup data using the target storage server, the method further includes:
[0038] At every preset period, determining whether the cloud phone backup data is updated;
[0039] When the cloud phone backup data is updated, the updated cloud phone backup data is sent to the target storage server.
[0040] In a possible implementation, the determining whether the cloud phone backup data is updated includes:
[0041] Acquire the data to be backed up of the target cloud phone, where the target cloud phone is the cloud phone corresponding to the cloud phone backup data stored in the target storage server;
[0042] Divide the data to be backed up into blocks according to a preset block division rule to obtain multiple data blocks and a number for each data block;
[0043] According to the data to be backed up contained in each data block, a first check code corresponding to each data block is calculated using an information digest algorithm;
[0044] Sending the preset block division rule, the number of each data block and the first check code corresponding to each data block to the target storage server, so that the target storage server divides the cloud phone backup data into blocks using the preset block division rule, obtains the data blocks corresponding to the cloud phone backup data and the number of each data block, and uses the information digest algorithm to calculate the second check code of the data block corresponding to the cloud phone backup data, and determines the difference data block where data update occurs by comparing the first check code and the second check code of the data block with the same number;
[0045] When receiving the serial number of the difference data block, determining that the cloud phone backup data is updated;
[0046] The sending the updated cloud phone backup data to the target storage server includes:
[0047] The data block content corresponding to the number of the difference data block is sent to the target storage server, so that the target storage server updates the cloud phone backup data according to the data block content.
[0048] In a possible implementation, dividing the data to be backed up into blocks according to a preset block division rule to obtain a plurality of data blocks and a number for each data block includes:
[0049] Starting from the first byte of the data to be backed up, a first number of bytes are selected according to a preset number;
[0050] Determining whether the number of bytes of the first number of bytes is within a preset byte number range;
[0051] If the number of bytes of the first number of bytes is not within the preset byte number interval, selecting a second number of bytes according to the preset number;
[0052] When the number of bytes of the second number of bytes and the first number of bytes are within the preset byte number interval, taking the first number of bytes and the second number of bytes as a data block;
[0053] A number is assigned to the data block.
[0054] In a possible implementation, storing the cloud phone backup data using the target storage server includes:
[0055] Receiving the cloud phone backup data;
[0056] generating a first random number;
[0057] generating the public key based on the first random number;
[0058] Calculate the product of the public key and the second random number to obtain an elliptic curve point;
[0059] Generate an intermediate parameter using a preset key derivation function, the elliptic curve point, and the data length of the cloud phone backup data;
[0060] Calculate the XOR value of the cloud phone backup data and the intermediate parameter to obtain the original encrypted data;
[0061] Obtaining a first cascade value of the elliptic curve point and the cloud phone backup data;
[0062] Calculate the hash value of the first cascade value to obtain an anti-tampering parameter;
[0063] Calculate the product of the elliptic curve base point and the first random number to obtain a secret value calculation parameter;
[0064] The original encrypted data, the tamper-proof parameter and the secret value calculation parameter are cascaded to obtain the encrypted data.
[0065] The encrypted data is sent to the target storage server.
[0066] In a possible implementation, the load balancing server stores a private key corresponding to each cloud phone; after sending the encrypted data to the target storage server, the method further includes:
[0067] Receive the backup data reading instruction sent by the cloud phone;
[0068] Reading the encrypted data from the target storage server;
[0069] Calculating the product of the private key and the secret value calculation parameter to obtain the elliptic curve point;
[0070] Acquire the intermediate parameter according to the elliptic curve point and the preset key derivation function;
[0071] Calculate the XOR value of the original encrypted data and the intermediate parameter to obtain the cloud phone backup data;
[0072] Cascading the cloud phone backup data and the elliptic curve point to obtain a second cascade value;
[0073] Calculate the hash value of the second cascade value to obtain the target tamper-proof parameter;
[0074] When the target anti-tampering parameter and the anti-tampering parameter are the same, it is determined that the cloud phone backup data verification has passed.
[0075] In a second aspect, an embodiment of the present application provides a data synchronization device, which is applied to a load balancing server, including:
[0076] An acquisition module, used for acquiring a parameter value of a preset indicator of each storage server every first preset period;
[0077] A determination module, used to determine the optimal parameter value and the worst parameter value of each preset indicator according to the parameter value of the preset indicator of each storage server, and obtain the optimal parameter value set and the worst parameter value set;
[0078] A calculation module, configured to calculate, for each storage server, a first distance from the optimal parameter value set and a second distance from the worst parameter value set according to a parameter value of a preset indicator of the storage server, wherein the first distance represents a performance gap between the performance of the storage server and the performance corresponding to the optimal parameter value set, and the second distance represents a performance gap between the performance of the storage server and the performance corresponding to the worst parameter value set;
[0079] The calculation module is further used to calculate, for each storage server, a performance index of the storage server using the first distance and the second distance corresponding to the storage server, wherein the performance index is used to characterize the storage performance of the storage server;
[0080] The storage module is used to determine the target storage server corresponding to the maximum performance indicator, and use the target storage server to store the cloud phone backup data.
[0081] In a third aspect, an embodiment of the present application provides an electronic device, the device comprising: a processor and a memory storing computer program instructions;
[0082] When the processor executes the computer program instructions, the method for data synchronization as described in any one of the first aspects is implemented.
[0083] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method for data synchronization as described in any one of the first aspects is implemented.
[0084] In a fifth aspect, an embodiment of the present application provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the data synchronization method as described in any one of the first aspects.
[0085] A method, device, equipment, storage medium and program product for data synchronization according to an embodiment of the present application. The load balancing server can obtain the parameter value of the preset index of each storage server every first preset period, and then determine the optimal parameter value and the worst parameter value of each preset index from the parameter value of the preset index of each storage server, and obtain the optimal parameter value set and the worst parameter value set. Among them, the optimal parameter value set can characterize the optimal performance of the storage server, and the worst parameter value set can characterize the worst performance of the storage server. In this way, the parameter value of the preset index of each storage server is used to calculate the first distance from the optimal parameter value set, and the second distance from the worst parameter value set, wherein the first distance can characterize the performance gap between each storage server and the optimal performance, and the second distance can characterize the performance gap between each storage server and the worst performance. Then, the performance index corresponding to each storage server can be calculated using the first distance and the second distance. In this way, the maximum performance index is determined from the performance index corresponding to each storage server, so as to determine the target storage server corresponding to the maximum performance index, and the target storage server with the best performance in the current storage server can be obtained, and then the target storage server is used to store the cloud phone backup data, which can ensure the storage performance of the storage server for the cloud phone backup data. BRIEF DESCRIPTION OF THE DRAWINGS
[0086] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0087] Figure 1 It is a flowchart of a data synchronization method provided by an embodiment of the present application;
[0088] Figure 2 It is a flowchart of a method for determining an optimal parameter set and a worst parameter set provided in an embodiment of the present application;
[0089] Figure 3 It is a flowchart of a data encryption method provided in an embodiment of the present application;
[0090] Figure 4 It is a flowchart of another data encryption method provided in an embodiment of the present application;
[0091] Figure 5 It is a flowchart of a data decryption method provided in an embodiment of the present application;
[0092] Figure 6 It is a flowchart of another data decryption method provided in an embodiment of the present application;
[0093] Figure 7 It is a flowchart of an incremental update method provided in an embodiment of the present application;
[0094] Figure 8 It is a structural diagram of a data synchronization device provided in an embodiment of the present application;
[0095] Fig. 9 It is a structural schematic diagram of an electronic device provided in yet another embodiment of the present application. DETAILED DESCRIPTION
[0096] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0097] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0098] In order to solve the problems existing in the prior art, the embodiments of the present application provide a method, apparatus, device, storage medium and program product for selecting a component. Figure 1 A data synchronization method provided in an embodiment of the present application is introduced, and the method is applied to a load balancing server, such as Figure 1 As shown, the method includes:
[0099] S101. Obtain a parameter value of a preset indicator of each storage server every first preset period.
[0100] Among them, in the distributed server architecture, including multiple storage servers, the load balancing server can obtain the parameter values of the preset indicators of each storage server, thereby determining the storage performance of each storage server based on the parameter values of the preset indicators of each storage server, and then assigning the backup task of the cloud phone backup data to the storage server with the best storage performance for data backup.
[0101] The preset index is preset based on experience. Specifically, the preset index may be space utilization rate, unit storage speed, and remaining space. It should be noted that the present application embodiment does not impose specific restrictions on the preset index.
[0102] S102: Determine the optimal parameter value and the worst parameter value of each preset indicator according to the parameter value of the preset indicator of each storage server, and obtain an optimal parameter value set and a worst parameter value set.
[0103] Among them, for different preset indicators, the method of measuring the quality of parameter values is different. For example, for the above-mentioned space utilization rate, the smaller the parameter value of the space utilization rate, the better the storage server performance; for the above-mentioned unit storage speed, the larger the parameter value of the unit storage speed, the better the storage server performance; for the above-mentioned remaining space, the larger the parameter value of the remaining space, the better the storage server performance. Therefore, for different preset indicators, the optimal parameter value and the worst parameter value are determined according to the method of measuring the quality of performance corresponding to each preset indicator.
[0104] It can be understood that the optimal parameter value set includes the optimal parameter values corresponding to each preset indicator, and the optimal parameter value set can represent the optimal storage performance provided by the distributed server architecture. Correspondingly, the worst parameter value set includes the worst parameter values corresponding to each preset indicator, and the worst parameter value set can represent the worst storage performance provided by the distributed server architecture.
[0105] S103: For each storage server, calculate a first distance from an optimal parameter value set and a second distance from a worst parameter value set according to the parameter value of a preset indicator of the storage server.
[0106] The first distance represents the performance gap between the performance of the storage server and the performance corresponding to the optimal parameter value set, and the second distance represents the performance gap between the performance of the storage server and the performance corresponding to the worst parameter value set.
[0107] S104: For each storage server, calculate a performance indicator of the storage server using the first distance and the second distance corresponding to the storage server.
[0108] It can be understood that based on the first distance and the second distance, the performance gap between each storage server and the optimal performance and the worst performance can be determined. Therefore, based on the first distance and the second distance corresponding to each storage server, the storage performance corresponding to each storage server can be measured, so that the target storage server with the best current storage performance can be determined.
[0109] S105. Determine a target storage server corresponding to the maximum performance indicator, and use the target storage server to store the cloud phone backup data.
[0110] In one implementation, a backup data area may be pre-set in the cloud phone, and the data in the backup data area is the cloud phone backup data, and the backup data area may be a storage space.
[0111] Specifically, for the data in the cloud phone, the target application that needs to be backed up is set in advance according to actual needs. After the cloud phone detects that the user operates the target application, it stores the data generated by this operation in the storage space corresponding to the backup data area. Then the load balancing server obtains the cloud phone backup data from the storage space corresponding to the backup data area, and stores the cloud phone backup data in the target storage server.
[0112] In another implementation, the cloud phone backup data may be the full data of the cloud phone.
[0113] By adopting the above method, the load balancing server can obtain the parameter value of the preset index of each storage server every first preset period, and then determine the optimal parameter value and the worst parameter value of each preset index from the parameter value of the preset index of each storage server, and obtain the optimal parameter value set and the worst parameter value set. Among them, the optimal parameter value set can characterize the optimal performance of the storage server, and the worst parameter value set can characterize the worst performance of the storage server. In this way, the parameter value of the preset index of each storage server is used to calculate the first distance from the optimal parameter value set, and the second distance from the worst parameter value set, wherein the first distance can characterize the performance gap between each storage server and the optimal performance, and the second distance can characterize the performance gap between each storage server and the worst performance. Then, the performance index corresponding to each storage server can be calculated using the first distance and the second distance. In this way, the maximum performance index is determined from the performance index corresponding to each storage server, thereby determining the target storage server corresponding to the maximum performance index, and the target storage server with the best performance in the current storage server can be obtained, and then the target storage server is used to store the cloud phone backup data, which can ensure the storage performance of the storage server for the cloud phone backup data.
[0114] The following combination Figure 2 Introduce how to determine the optimal parameter value set and the worst parameter value set, such as Figure 2 As shown, the above S102, according to the parameter value of the preset indicator of each storage server, determines the optimal parameter value and the worst parameter value of each preset indicator, and obtains the optimal parameter value set and the worst parameter value set, which can be specifically implemented as follows:
[0115] S201. Construct a decision matrix according to the parameter values of the preset indicators of each storage server.
[0116] The elements in the same column of the decision matrix are used to represent the parameter values of the same preset indicator of different storage servers, and the elements in the same row of the decision matrix are used to represent the parameter values of different preset indicators of one storage server.
[0117] In an example, the preset indicators are space utilization rate, unit storage speed, and remaining space, and the decision matrix constructed is:
[0118]
[0119] Among them, m ij Indicates the parameter value of the jth preset indicator of the ith server.
[0120] Then the above decision matrix is normalized to obtain the normalized decision matrix:
[0121]
[0122] Among them, m i ′ j Represents the element after the parameter value of the j-th preset indicator of the ith server is normalized.
[0123] S202: Determine the optimal parameter value and the worst parameter value for each column element in the decision matrix.
[0124] S203. Construct an optimal parameter value set using the optimal parameter values in each column of elements.
[0125] S204. Construct a worst parameter value set using the worst parameter value in each column element.
[0126] Specifically, continuing the above example, based on the above normalized decision matrix, the optimal parameter value set can be constructed as follows:
[0127] M+=max(M1 ′ ,M2 ′ ,M3 ′ )
[0128] The worst parameter value set is constructed as:
[0129] M-=min(M1 ′ ,M2 ′ ,M3 ′ )
[0130] By adopting the method provided in the embodiment of the present application, after obtaining the parameter values of the preset indicators of the storage server, a decision matrix can be constructed. In this way, the optimal parameter value and the worst parameter value in each column element can be quickly and intuitively found, thereby constructing the optimal parameter value set and the worst parameter value set.
[0131] Based on the above construction to obtain the optimal parameter value set and the worst parameter value set, the above S103, for each storage server, calculates the first distance from the optimal parameter value set and the second distance from the worst parameter value set according to the parameter value of the preset indicator of the storage server, which can be specifically implemented as follows:
[0132] According to the preset weight corresponding to the preset indicator, the parameter value of the preset indicator of the storage server is calculated to calculate the first distance from the optimal parameter value set and the second distance from the worst parameter value set.
[0133] It is understandable that in the data backup scenario, since each preset indicator of the storage server has a different impact on the storage performance of the storage server, the first distance and the second distance can be calculated according to the preset weights corresponding to the preset indicators. The first distance and the second distance corresponding to each storage server can be accurately obtained, thereby improving the accuracy of the performance indicators calculated subsequently.
[0134] Specifically, the first distance can be calculated according to the following formula:
[0135]
[0136] Among them, D i + represents the first distance corresponding to the i-th storage server, w j represents the preset weight corresponding to the jth preset indicator, M j + represents the optimal parameter set, m i ′ j Indicates the parameter value of the preset indicator corresponding to the i-th storage server;
[0137] The second distance is calculated according to the following formula:
[0138]
[0139] Among them, D i - represents the second distance corresponding to the i-th storage server, w j represents the preset weight corresponding to the jth preset indicator, M j - represents the worst parameter set, m i ′ j Indicates the parameter value of the preset indicator corresponding to the i-th storage server.
[0140] In some embodiments of the present application, based on the first distance and the second distance corresponding to the storage server obtained by the above calculation, the performance index can be calculated according to the following formula:
[0141]
[0142] Among them, D i Represents the performance indicator corresponding to the i-th storage server.
[0143] In this way, based on the calculated performance indicators, the load balancing server determines the target storage server according to the performance indicators, and the load balancing server obtains the target backup task corresponding to the earliest timestamp from the backup task sequence; obtains the target cloud phone backup data corresponding to the target backup task; and stores the target cloud phone backup data to the target storage server.
[0144] It should be noted that before obtaining the backup data of the target cloud phone, the load balancing server can receive data backup instructions sent by different cloud phones, and then build a backup task sequence according to the timestamp of the data backup instruction corresponding to each cloud phone.
[0145] It is understandable that the cloud phone server can provide services for multiple cloud phones. When different users use cloud phones, different cloud phones can send data backup instructions to the load balancing server. The load balancing server records the timestamp of the data backup instructions corresponding to each cloud phone in chronological order according to the different times of the received data backup instructions, thereby constructing a backup task sequence.
[0146] In this way, after receiving the data backup instructions sent by each cloud phone, the load balancing server can build a backup task sequence according to the timestamp corresponding to each data backup instruction, so as to obtain the cloud phone backup data in the order of the data backup instructions corresponding to each cloud phone, ensuring that each cloud phone can perform data backup in an orderly manner.
[0147] In some embodiments of the present application, when the cloud phone sends the cloud phone backup data to the storage server, in order to ensure the security of data transmission, the cloud phone can encrypt the cloud phone backup data, such as Figure 3 As shown in the figure, the specific data encryption process is as follows:
[0148] S301, receiving cloud phone backup data.
[0149] S302: Encrypt the cloud phone backup data using the public key to obtain encrypted data.
[0150] Among them, the load balancing server can generate a key pair for each cloud phone. The key pair includes a private key and a public key. The public key is used to encrypt the cloud phone backup data, and the private key is used by the load balancing server to decrypt the encrypted data after reading the encrypted data in the storage server to obtain the plaintext data.
[0151] S303: Send the encrypted data to the target storage server.
[0152] In this way, the original cloud phone backup data is encrypted by the pre-generated public key to ensure the security of the transmission process.
[0153] The following combination Figure 4 Introduce the detailed process of encrypting cloud phone backup data, such as Figure 4 As shown in the figure, the process of encrypting the cloud phone backup data is as follows:
[0154] S401. Generate a first random number.
[0155] The load balancing server may use a random number generator to generate a first random number.
[0156] S402: Generate a public key based on the first random number.
[0157] S403: Calculate the product of the public key and the second random number to obtain an elliptic curve point.
[0158] Specifically, the load balancing server uses the first random number as a private key, calculates the product of the private key and the base point of the elliptic curve, and obtains the public key corresponding to the cloud phone. The base point of the elliptic curve is pre-set. Then, the product of the second random number and the public key is calculated to obtain the elliptic curve point.
[0159] S404: Generate intermediate parameters using a preset key derivation function, an elliptic curve point, and the data length of the cloud phone backup data.
[0160] The specific method for calculating the intermediate parameter is as follows: e = KDF (x1||y1, len), where e represents the intermediate parameter, KDF represents the preset key derivation function, and len represents the data length value of the cloud phone backup data. x1||y1 represents the concatenation of the horizontal coordinate and the vertical coordinate of the elliptic curve point.
[0161] S405, calculating the XOR value of the cloud phone backup data and the intermediate parameter to obtain the original encrypted data.
[0162] S406: Obtain the first cascade value of the elliptic curve point and the cloud phone backup data.
[0163] S407: Calculate the hash value of the first cascade value to obtain an anti-tampering parameter.
[0164] Specifically, the anti-tampering parameter can be calculated by the following formula:
[0165] C2=Hash(x1∥C0∥y1)
[0166] Among them, C2 represents the anti-tampering parameter, x1 represents the horizontal coordinate of the elliptic curve point, y1 represents the vertical coordinate of the elliptic curve point, and C0 represents the cloud phone backup data.
[0167] S408. Calculate the product of the elliptic curve base point and the second random number to obtain a secret value calculation parameter.
[0168] S409: Cascade the original encrypted data, the anti-tampering parameter and the secret value calculation parameter to obtain the encrypted data.
[0169] Using the method provided in the embodiment of the present application, an elliptic curve point is generated by a randomly generated first random number, and then an intermediate parameter is generated using a preset key derivation function, an elliptic curve point and the data length of the cloud phone backup data. Among them, the intermediate parameters can be used to encrypt the cloud phone backup data to obtain the original encrypted data, and then generate secret value calculation parameters and anti-tampering parameters. The secret value calculation parameters and anti-tampering parameters are concatenated with the original encrypted data and stored together in the target storage server. In this way, after the subsequent load balancing server decrypts the encrypted data, it can use the anti-tampering parameters to determine whether the data in the target storage server has been illegally tampered with, thereby ensuring the security of data storage and data transmission.
[0170] Accordingly, after the target storage server is used to store the cloud phone backup data, the cloud phone can read the cloud phone backup data through the load balancing server. Figure 5 As shown, after S303, sending the encrypted data to the target storage server, the method further includes:
[0171] S501, receiving a backup data reading instruction sent by the cloud phone.
[0172] Among them, the backup data reading instruction carries the cloud phone identifier, and the target storage server can search for the corresponding encrypted data according to the cloud phone identifier.
[0173] S502: Read encrypted data from the target storage server.
[0174] S503: Decrypt the encrypted data using the private key corresponding to the cloud phone to obtain the cloud phone backup data.
[0175] The following combination Figure 6 Introduce the process of decrypting encrypted data by the load balancing server, such as Figure 6 As shown, the decryption process is as follows:
[0176] S5031. Calculate the product of the private key and the secret value calculation parameter to obtain an elliptic curve point.
[0177] S5032. Obtain intermediate parameters according to the elliptic curve point and the preset key derivation function.
[0178] Among them, based on the calculated elliptic curve point, the intermediate parameter e=KDF(x1||y1,len) is calculated according to the data length of the cloud phone backup data.
[0179] Among them, e represents an intermediate parameter, KDF represents a preset key derivation function, x1 represents the horizontal coordinate of the elliptic curve point, and y1 represents the vertical coordinate of the elliptic curve point.
[0180] S5033. Calculate the XOR value of the original encrypted data and the intermediate parameter to obtain the cloud phone backup data.
[0181] The load balancing server is based on the formula Get the decrypted data corresponding to the intermediate parameter. e represents the intermediate parameter, C1 represents the original backup data ciphertext, and C0 represents the decrypted data.
[0182] S5034. Cascade the cloud phone backup data and the elliptic curve point to obtain a second cascade value.
[0183] S5035. Calculate the hash value of the second cascade value to obtain the target anti-tampering parameter.
[0184] S5036. When the target anti-tampering parameter and the anti-tampering parameter are the same, determine that the cloud phone backup data verification has passed.
[0185] The load balancing server obtains the target anti-tampering parameter value corresponding to the decrypted data, and determines whether the target anti-tampering parameter is the same as the anti-tampering parameter corresponding to the cloud phone. If the target anti-tampering parameter is the same as the anti-tampering parameter, it indicates that the backup data of the cloud phone has not been tampered with. If the target anti-tampering parameter is different from the anti-tampering parameter, it indicates that the backup data of the cloud phone has been tampered with, so the load balancer issues an abnormal warning.
[0186] Using the method provided in the embodiment of the present application, the private key corresponding to each cloud phone is stored in the load balancing server. By calculating the product of the private key and the secret value calculation parameter, an elliptic curve point can be obtained, and then the intermediate parameter can be calculated according to the preset key derivation function, and the cloud phone backup data is calculated using the intermediate parameter. In order to further ensure data security, the hash value of the second cascade value of the cloud phone backup data and the elliptic curve point is calculated to obtain the target anti-tampering parameter. By comparing the target anti-tampering parameter with the anti-tampering parameter in the encrypted data, it can be determined whether the cloud phone backup data is backed up with illegal tampering. When the target anti-tampering parameter and the anti-tampering parameter are the same, it is determined that the cloud phone backup data verification has passed, and no illegal tampering has occurred, thereby ensuring data security.
[0187] After the target storage server stores the full amount of cloud phone data, the load balancing server can also regularly monitor whether the cloud phone backup data in the target storage server has been modified. If modified, the cloud phone backup data in the target storage server will be incrementally updated. Figure 7 As shown, after using the target storage server to store the cloud phone backup data, the method further includes:
[0188] S701. Every second preset period, determine whether the cloud phone backup data is updated.
[0189] S702: When the cloud phone backup data is updated, the updated cloud phone backup data is sent to the target storage server.
[0190] By adopting the method provided in the embodiment of the present application, since the target storage server stores the full amount of cloud phone backup data of the cloud phone, the load balancing server can detect the cloud phone backup data every second preset period to determine whether the cloud phone backup data has been updated, and then send the updated cloud phone backup data to the target storage server when the cloud phone backup data has been updated. In this way, the number of backups of the cloud phone backup data in the target storage server is reduced, and the workload of the load balancing server is reduced. In addition, the cloud phone backup data is detected every preset period, and when the cloud phone backup data is updated, the cloud phone backup data in the target storage server can be updated in a timely manner.
[0191] Regarding the above S701, determining whether the cloud phone backup data is updated can be specifically implemented as follows:
[0192] Step 1: Get the data to be backed up on the target cloud phone.
[0193] Among them, the target cloud phone is the cloud phone corresponding to the cloud phone backup data stored in the target storage server.
[0194] Among them, the load balancing server stores the corresponding relationship between the storage server and the cloud phone identifier, and the storage server stores the corresponding relationship between the cloud phone identifier and the cloud phone backup data.
[0195] Step 2: Divide the backup data into blocks according to a preset block division rule to obtain multiple data blocks and a number for each data block.
[0196] After the load balancing server divides the data to be backed up into blocks, it numbers each data block according to the order of the blocks.
[0197] Step 3: According to the data to be backed up contained in each data block, a message digest algorithm is used to calculate a first check code corresponding to each data block.
[0198] Specifically, the load balancing server uses an information digest algorithm to calculate a first check code of the data to be backed up in the data block.
[0199] Step 4: Send the preset block segmentation rule, the number of each data block and the first verification code corresponding to each data block to the target storage server, so that the target storage server adopts the preset block segmentation rule to segment the cloud phone backup data, obtains the data blocks corresponding to the cloud phone backup data and the number of each data block, and uses the information summary algorithm to calculate the second verification code of the data block corresponding to the cloud phone backup data, and determines the difference data block where data update occurs by comparing the first verification code and the second verification code of the data block with the same number.
[0200] It can be understood that after receiving the preset block rules, the target storage server can block the encrypted cloud phone backup data according to the preset block rules. Since the preset block rules in the target storage server and the preset block rules in the load balancing server are the same, the data length contained in the obtained data blocks is the same, and the data blocks are numbered the same. In the case of calculating the second check code, the first check code and the second check code corresponding to the same number are compared. Since the first check code and the second check code are both calculated using the information digest algorithm for the data in the data block, if the data content of the data blocks with the same number is the same, the first check code and the second check code are the same. If the data content of the data blocks with the same number is different, the first check code and the second check code are different. Thus, the target storage server can determine the data block where the data has been updated, and return the number of the data block where the data has been updated to the load balancing server.
[0201] Step 5: When receiving the number of the difference data block, determine that the cloud phone backup data is updated.
[0202] Accordingly, the updated cloud phone backup data is sent to the target storage server, including:
[0203] The data block content corresponding to the number of the difference data block is sent to the target storage server, so that the target storage server can update the cloud phone backup data according to the data block content.
[0204] According to the method provided by the embodiment of the present application, after the load balancing server divides the backup data into blocks and calculates the first check code, the preset block rule, the first check code and the number of the data block are sent to the target storage server. Since the preset block rule in the target storage server is the same as the preset block rule in the load balancing server, the data length contained in the obtained data block is the same, and the number of the data block is the same. In the case of calculating the second check code, the first check code and the second check code corresponding to the same number are compared. Since the first check code and the second check code are both calculated by the information digest algorithm for the data in the data block, if the data content of the data blocks with the same number is the same, the first check code and the second check code are the same. If the data content of the data blocks with the same number is different, the first check code and the second check code are different. Thus, the target storage server can determine the data block where the data is updated and return the number of the data block where the data is updated to the load balancing server. In this way, when the load balancing server receives the number of the difference data block, it indicates that the cloud phone backup data has been updated, and the updated data is sent to the target storage server, avoiding the load balancing server from transmitting the full amount of data of the cloud phone, reducing the amount of data transmission, and thus improving the efficiency of data synchronization.
[0205] It should be noted that when the load balancing server detects the cloud phone backup data according to the preset period to determine whether the data has been updated, if new data is detected in the data to be backed up in the cloud phone, the new data will be synchronized in full to the target storage server.
[0206] Specifically, for the above step 2, the backup data is divided into blocks according to the preset block division rule to obtain multiple data blocks and the number of each data block, which can be specifically implemented as follows:
[0207] Step A: Starting from the first byte of the data to be backed up, a first number of bytes is selected according to a preset number.
[0208] Step B: determine whether the number of bytes of the first number of bytes is within a preset byte number range.
[0209] The preset number and the preset byte range are set based on experience.
[0210] Step C: when the number of bytes of the first number of bytes is not within a preset byte number interval, select a second number of bytes according to the preset number.
[0211] It can be understood that when the number of bytes of the first number of bytes is less than the minimum value of the preset byte interval, it means that the number of bytes of the first number of bytes is small and the corresponding data block is small.
[0212] Step D: When the number of bytes of the second number of bytes and the number of bytes of the first number of bytes are within a preset byte number interval, the first number of bytes and the second number of bytes are used as a data block.
[0213] The load balancing server may select the second number of bytes multiple times according to a preset number until the total number of bytes selected is within a preset byte range.
[0214] It can be understood that when the number of bytes of the second number of bytes and the first number of bytes is within a preset byte number interval, it means that the byte lengths of the second number of bytes and the first number of bytes are moderate and can be divided into data blocks.
[0215] Specifically, the data block is obtained by taking the second number of bytes and the first number of bytes as the splitting point.
[0216] Step E: assign numbers to data blocks.
[0217] Specifically, the load balancing server assigns numbers to the data blocks according to the order in which the data blocks are obtained.
[0218] In one example, the preset byte interval can be a fixed-length window, and the number of bytes included in the fixed-length window is within the range of a preset minimum value and a preset maximum value. The byte length of the preset sliding window is a preset number, and the load balancing server starts from the first byte of the data to be backed up, selects bytes according to the preset sliding window, slides a preset sliding window length each time, and then after each slide, determines whether the selected number of bytes is within the byte length range of the fixed-length window.
[0219] By adopting the method provided in the embodiment of the present application, the data to be backed up is divided into blocks according to a preset number of degrees, and the range of the number of bytes contained in the data block is limited, so that the data block data is prevented from being too long. In addition, by presetting the byte number range, the data block data length is prevented from being too short, thereby ensuring the validity of the data block.
[0220] Based on the same concept, the embodiment of the present application provides a data synchronization device, which is applied to a load balancing server, such as Figure 8 As shown, the device comprises:
[0221] An acquisition module 801 is used to acquire a parameter value of a preset indicator of each storage server every first preset period;
[0222] A determination module 802 is used to determine the optimal parameter value and the worst parameter value of each preset indicator according to the parameter value of the preset indicator of each storage server, and obtain an optimal parameter value set and a worst parameter value set;
[0223] A calculation module 803 is used to calculate, for each storage server, a first distance from an optimal parameter value set and a second distance from a worst parameter value set according to a parameter value of a preset indicator of the storage server, wherein the first distance represents a performance gap between the performance of the storage server and the performance corresponding to the optimal parameter value set, and the second distance represents a performance gap between the performance of the storage server and the performance corresponding to the worst parameter value set;
[0224] The calculation module 803 is further used to calculate, for each storage server, a performance index of the storage server using the first distance and the second distance corresponding to the storage server, where the performance index is used to characterize the storage performance of the storage server;
[0225] The storage module 804 is used to determine the target storage server corresponding to the maximum performance indicator, and use the target storage server to store the cloud phone backup data.
[0226] In a possible implementation, the calculation module 803 is specifically configured to:
[0227] According to the parameter values of the preset indicators of each storage server, a decision matrix is constructed, where the elements in the same column of the decision matrix are used to represent the parameter values of the same preset indicator of different storage servers, and the elements in the same row of the decision matrix are used to represent the parameter values of different preset indicators of a storage server;
[0228] For each column element in the decision matrix, determine the optimal parameter value and the worst parameter value;
[0229] Using the optimal parameter values in each column element, construct an optimal parameter value set;
[0230] Using the worst parameter value in each column element, construct the worst parameter value set.
[0231] In a possible implementation, the calculation module 803 is specifically configured to:
[0232] According to the preset weight corresponding to the preset indicator, the parameter value of the preset indicator of the storage server is calculated to calculate the first distance from the optimal parameter value set and the second distance from the worst parameter value set.
[0233] In a possible implementation, the number of preset indicators is 3; the calculation module 803 is specifically configured to:
[0234] The first distance is calculated according to the following formula:
[0235]
[0236] Among them, D i + represents the first distance corresponding to the i-th storage server, w jrepresents the preset weight corresponding to the jth preset indicator, M j + represents the optimal parameter set, m i ′ j Indicates the parameter value of the preset indicator corresponding to the i-th storage server;
[0237] The second distance is calculated according to the following formula:
[0238]
[0239] Among them, D i - represents the second distance corresponding to the i-th storage server, w j represents the preset weight corresponding to the jth preset indicator, M j - represents the worst parameter set, m i ′ j Indicates the parameter value of the preset indicator corresponding to the i-th storage server.
[0240] In a possible implementation, the calculation module 803 is further configured to:
[0241] The performance index is calculated according to the following formula:
[0242]
[0243] Among them, D i Represents the performance indicator corresponding to the i-th storage server.
[0244] In a possible implementation, the storage module 804 is specifically configured to:
[0245] Obtain the target backup task corresponding to the earliest timestamp from the backup task sequence;
[0246] Get the target cloud phone backup data corresponding to the target backup task;
[0247] Send the target cloud phone backup data to the target storage server.
[0248] In a possible implementation, the storage module 804 is specifically configured to:
[0249] Before obtaining the target backup task corresponding to the earliest timestamp from the backup task sequence, receiving data backup instructions sent by different cloud phones;
[0250] Build a backup task sequence based on the timestamp of the data backup instruction corresponding to each cloud phone.
[0251] In a possible implementation, the device further includes:
[0252] A judgment module, used for judging whether the cloud phone backup data is updated every second preset period;
[0253] The sending module is used to send the updated cloud phone backup data to the target storage server when the cloud phone backup data is updated.
[0254] In a possible implementation, the determination module is specifically configured to:
[0255] Obtain the data to be backed up of the target cloud phone, where the target cloud phone is the cloud phone corresponding to the cloud phone backup data stored in the target storage server;
[0256] Divide the backup data into blocks according to the preset block division rule to obtain multiple data blocks and the number of each data block;
[0257] According to the data to be backed up contained in each data block, a first check code corresponding to each data block is calculated using an information digest algorithm;
[0258] Sending a preset block division rule, the number of each data block and the first check code corresponding to each data block to the target storage server, so that the target storage server divides the cloud phone backup data into blocks using the preset block division rule, obtains the data blocks corresponding to the cloud phone backup data and the number of each data block, and uses the information digest algorithm to calculate the second check code of the data block corresponding to the cloud phone backup data, and determines the difference data block where data update occurs by comparing the first check code and the second check code of the data block with the same number;
[0259] When receiving the number of the difference data block, it is determined that the cloud phone backup data is updated;
[0260] The sending module is specifically used for:
[0261] The data block content corresponding to the number of the difference data block is sent to the target storage server, so that the target storage server can update the cloud phone backup data according to the data block content.
[0262] In a possible implementation, the backup data is divided into blocks according to a preset block division rule to obtain a plurality of data blocks and a number of each data block, including:
[0263] Starting from the first byte of the data to be backed up, a first number of bytes are selected according to a preset number;
[0264] Determining whether the number of bytes of the first number of bytes is within a preset byte number range;
[0265] If the number of bytes of the first number of bytes is not within the preset byte number interval, selecting a second number of bytes according to the preset number;
[0266] When the number of bytes of the second number of bytes and the first number of bytes are within the preset byte number interval, taking the first number of bytes and the second number of bytes as a data block;
[0267] A number is assigned to the data block.
[0268] In a possible implementation, the storage module 804 is specifically configured to:
[0269] Receiving the cloud phone backup data;
[0270] generating a first random number;
[0271] generating the public key based on the first random number;
[0272] Calculate the product of the public key and the second random number to obtain an elliptic curve point;
[0273] Generate an intermediate parameter using a preset key derivation function, the elliptic curve point, and the data length of the cloud phone backup data;
[0274] Calculate the XOR value of the cloud phone backup data and the intermediate parameter to obtain the original encrypted data;
[0275] Obtaining a first cascade value of the elliptic curve point and the cloud phone backup data;
[0276] Calculate the hash value of the first cascade value to obtain an anti-tampering parameter;
[0277] Calculate the product of the elliptic curve base point and the first random number to obtain a secret value calculation parameter;
[0278] The original encrypted data, the tamper-proof parameter and the secret value calculation parameter are cascaded to obtain the encrypted data.
[0279] The encrypted data is sent to the target storage server.
[0280] In a possible implementation, the load balancing server stores a private key corresponding to each cloud phone; the device:
[0281] A receiving module, used to receive a backup data reading instruction sent by the cloud phone;
[0282] A reading module, used for reading the encrypted data from the target storage server;
[0283] The calculation module 803 is further used to calculate the product of the private key and the secret value calculation parameter to obtain the elliptic curve point;
[0284] An acquisition module 801 is used to acquire the intermediate parameter according to the elliptic curve point and the preset key derivation function;
[0285] The calculation module 803 is further used to calculate the XOR value of the original encrypted data and the intermediate parameter to obtain the cloud phone backup data;
[0286] A cascading module, used for cascading the cloud phone backup data and the elliptic curve point to obtain a second cascade value;
[0287] The calculation module 803 is further used to calculate the hash value of the second cascade value to obtain a target anti-tampering parameter;
[0288] The verification module is used to determine whether the cloud phone backup data verification has passed when the target anti-tampering parameter and the anti-tampering parameter are the same.
[0289] It should be noted that the device for file access is a device corresponding to the above-mentioned method for file access, and all implementation methods in the above-mentioned method embodiment are applicable to the embodiment of the device and can achieve the same technical effect.
[0290] Fig. 9 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.
[0291] The electronic device may include a processor 901 and a memory 902 storing computer program instructions.
[0292] Specifically, the processor 901 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0293] The memory 902 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 902 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 902 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 902 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 902 is a non-volatile solid-state memory.
[0294] The memory may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.
[0295] The processor 901 implements any one of the data synchronization methods in the above embodiments by reading and executing computer program instructions stored in the memory 902 .
[0296] In one example, the electronic device may further include a communication interface 903 and a bus 904. Fig. 9 As shown, the processor 901, the memory 902, and the communication interface 903 are connected via a bus 904 and communicate with each other.
[0297] The communication interface 903 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0298] Bus 904 includes hardware, software or both, and the parts of electronic equipment are coupled to each other.For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In suitable cases, bus 904 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.
[0299] In addition, in combination with the data synchronization method in the above embodiment, the embodiment of the present application can provide a computer storage medium to implement. The computer storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the data synchronization methods in the above embodiment is implemented.
[0300] In combination with the data synchronization method in the above embodiments, an embodiment of the present application may provide a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes any data synchronization method in the above embodiments.
[0301] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0302] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0303] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0304] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0305] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A method for data synchronization, characterized in that: Applied to a load balancing server, the method comprises: Every first preset period, obtaining a parameter value of a preset indicator of each storage server; According to the parameter values of the preset indicators of each storage server, the optimal parameter value and the worst parameter value of each preset indicator are determined to obtain the optimal parameter value set and the worst parameter value set; For each storage server, a first distance from the optimal parameter value set and a second distance from the worst parameter value set are calculated according to the parameter value of the preset indicator of the storage server, wherein the first distance represents the performance gap between the performance of the storage server and the performance corresponding to the optimal parameter value set, and the second distance represents the performance gap between the performance of the storage server and the performance corresponding to the worst parameter value set; For each storage server, using the first distance and the second distance corresponding to the storage server, calculate a performance indicator of the storage server, where the performance indicator is used to characterize the storage performance of the storage server; A target storage server corresponding to the maximum performance indicator is determined, and the target storage server is used to store the cloud phone backup data.
2. The method according to claim 1, characterized in that The step of determining the optimal parameter value and the worst parameter value of each preset indicator according to the parameter value of the preset indicator of each storage server, and obtaining the optimal parameter value set and the worst parameter value set includes: According to the parameter values of the preset indicators of each storage server, a decision matrix is constructed, wherein the elements in the same column of the decision matrix are used to represent the parameter values of the same preset indicator of different storage servers, and the elements in the same row of the decision matrix are used to represent the parameter values of different preset indicators of one storage server; For each column element in the decision matrix, determining the optimal parameter value and the worst parameter value; Using the optimal parameter values in each column of elements, construct the optimal parameter value set; The worst parameter value set is constructed by using the worst parameter value in each column element.
3. The method according to claim 1, characterized in that The step of calculating, for each storage server, a first distance from the optimal parameter value set and a second distance from the worst parameter value set according to a parameter value of a preset indicator of the storage server includes: According to the preset weight corresponding to the preset indicator, the parameter value of the preset indicator of the storage server is calculated to calculate the first distance from the optimal parameter value set and the second distance from the worst parameter value set.
4. The method according to claim 3, characterized in that The number of the preset indicators is 3; and the calculation of the parameter value of the preset indicator of the storage server according to the preset weight corresponding to the preset indicator, the calculation of the first distance from the optimal parameter value set, and the calculation of the second distance from the worst parameter value set include: The first distance is calculated according to the following formula: Among them, D i + represents the first distance corresponding to the i-th storage server, w j represents the preset weight corresponding to the jth preset indicator, M j + represents the optimal parameter value set, m i ′ j Indicates the parameter value of the preset indicator corresponding to the i-th storage server; The second distance is calculated according to the following formula: Among them, D i - represents the second distance corresponding to the i-th storage server, w j represents the preset weight corresponding to the jth preset indicator, M j - represents the worst parameter value set, m i ′ j Indicates the parameter value of the preset indicator corresponding to the i-th storage server.
5. The method according to claim 1, characterized in that: The step of calculating, for each storage server, a performance indicator of the storage server by using the first distance and the second distance corresponding to the storage server, includes: The performance index is calculated according to the following formula: Among them, the D i Represents the performance indicator corresponding to the i-th storage server.
6. The method according to claim 1, characterized in that The storing of the cloud phone backup data by using the target storage server includes: Obtain the target backup task corresponding to the earliest timestamp from the backup task sequence; Obtain the target cloud phone backup data corresponding to the target backup task; The target cloud phone backup data is sent to the target storage server.
7. The method according to claim 6, characterized in that Before obtaining the target backup task corresponding to the earliest timestamp from the backup task sequence, the method further includes: Receive data backup instructions sent by different cloud phones; The backup task sequence is constructed according to the timestamp of the data backup instruction corresponding to each cloud phone.
8. The method according to claim 1, characterized in that After storing the cloud phone backup data using the target storage server, the method further includes: Every second preset period, determining whether the cloud phone backup data is updated; When the cloud phone backup data is updated, the updated cloud phone backup data is sent to the target storage server.
9. The method according to claim 8, characterized in that The determining whether the cloud phone backup data is updated includes: Acquire the data to be backed up of the target cloud phone, where the target cloud phone is the cloud phone corresponding to the cloud phone backup data stored in the target storage server; Divide the data to be backed up into blocks according to a preset block division rule to obtain multiple data blocks and a number for each data block; According to the data to be backed up contained in each data block, a first check code corresponding to each data block is calculated using an information digest algorithm; Sending the preset block division rule, the number of each data block and the first check code corresponding to each data block to the target storage server, so that the target storage server divides the cloud phone backup data into blocks using the preset block division rule, obtains the data blocks corresponding to the cloud phone backup data and the number of each data block, and uses the information digest algorithm to calculate the second check code of the data block corresponding to the cloud phone backup data, and determines the difference data block where data update occurs by comparing the first check code and the second check code of the data block with the same number; When receiving the serial number of the difference data block, determining that the cloud phone backup data is updated; The sending the updated cloud phone backup data to the target storage server includes: The data block content corresponding to the number of the difference data block is sent to the target storage server, so that the target storage server updates the cloud phone backup data according to the data block content.
10. The method according to claim 9, characterized in that The step of dividing the data to be backed up into blocks according to a preset block division rule to obtain a plurality of data blocks and a number for each data block includes: Starting from the first byte of the data to be backed up, a first number of bytes are selected according to a preset number; Determining whether the number of bytes of the first number of bytes is within a preset byte number range; If the number of bytes of the first number of bytes is not within the preset byte number interval, selecting a second number of bytes according to the preset number; When the number of bytes of the second number of bytes and the first number of bytes are within the preset byte number interval, taking the first number of bytes and the second number of bytes as a data block; A number is assigned to the data block.
11. The method according to claim 1, characterized in that: The storing of cloud phone backup data by using the target storage server includes: Receiving the cloud phone backup data; generating a first random number; generating the public key based on the first random number; Calculate the product of the public key and the second random number to obtain an elliptic curve point; Generate an intermediate parameter using a preset key derivation function, the elliptic curve point, and the data length of the cloud phone backup data; Calculate the XOR value of the cloud phone backup data and the intermediate parameter to obtain the original encrypted data; Obtaining a first cascade value of the elliptic curve point and the cloud phone backup data; Calculate the hash value of the first cascade value to obtain an anti-tampering parameter; Calculate the product of the elliptic curve base point and the first random number to obtain a secret value calculation parameter; Cascading the original encrypted data, the anti-tampering parameter and the secret value calculation parameter to obtain the encrypted data; The encrypted data is sent to the target storage server.
12. The method according to claim 11, characterized in that The load balancing server stores the private key corresponding to each cloud phone; After sending the encrypted data to the target storage server, the method further includes: Receive the backup data reading instruction sent by the cloud phone; Reading the encrypted data from the target storage server; Calculating the product of the private key and the secret value calculation parameter to obtain the elliptic curve point; Acquire the intermediate parameter according to the elliptic curve point and the preset key derivation function; Calculate the XOR value of the original encrypted data and the intermediate parameter to obtain the cloud phone backup data; Cascading the cloud phone backup data and the elliptic curve point to obtain a second cascade value; Calculate the hash value of the second cascade value to obtain the target tamper-proof parameter; When the target anti-tampering parameter and the anti-tampering parameter are the same, it is determined that the cloud phone backup data verification has passed.
13. A data synchronization device, characterized in that: Applied to a load balancing server, the device comprises: An acquisition module, used for acquiring a parameter value of a preset indicator of each storage server every first preset period; A determination module, used to determine the optimal parameter value and the worst parameter value of each preset indicator according to the parameter value of the preset indicator of each storage server, and obtain the optimal parameter value set and the worst parameter value set; A calculation module, configured to calculate, for each storage server, a first distance from the optimal parameter value set and a second distance from the worst parameter value set according to a parameter value of a preset indicator of the storage server, wherein the first distance represents a performance gap between the performance of the storage server and the performance corresponding to the optimal parameter value set, and the second distance represents a performance gap between the performance of the storage server and the performance corresponding to the worst parameter value set; The calculation module is further used to calculate, for each storage server, a performance indicator of the storage server using the first distance and the second distance corresponding to the storage server, wherein the performance indicator is used to characterize the storage performance of the storage server; The storage module is used to determine the target storage server corresponding to the maximum performance indicator, and use the target storage server to store the cloud phone backup data.
14. An electronic device, characterized in that: The device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the method for data synchronization as described in any one of claims 1-12 is implemented.
Citation Information
Patent Citations
Load balancing method and device under multi-data-center environment
CN103973728A
Big data cluster master server election method and system
CN112817824A
Capability baseline generation method and device, electronic system and storage medium
CN116166426A
Performance Manager and Method Performed Thereby for Managing the Performance of a Logical Server of a Data Center
US20200012508A1